Add interfaces package
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
import type { TAgentMode } from './agent.js';
|
||||
|
||||
export type TToolScope =
|
||||
| '*.read'
|
||||
| 'device.read'
|
||||
| 'device.write'
|
||||
| 'light.read'
|
||||
| 'light.write'
|
||||
| 'climate.read'
|
||||
| 'climate.write'
|
||||
| 'energy.read'
|
||||
| 'energy.write'
|
||||
| 'lock.read'
|
||||
| 'lock.write'
|
||||
| 'camera.read'
|
||||
| 'alarm.write'
|
||||
| 'agent.invoke'
|
||||
| 'automation.write'
|
||||
| 'approval.write';
|
||||
|
||||
export type TToolJsonSchema = Record<string, unknown>;
|
||||
|
||||
export interface IToolDefinition {
|
||||
id: string;
|
||||
ownerId: string;
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: TToolJsonSchema;
|
||||
requiredScopes: TToolScope[];
|
||||
mode: TAgentMode;
|
||||
}
|
||||
|
||||
export interface IToolCall {
|
||||
id: string;
|
||||
toolId: string;
|
||||
callerId: string;
|
||||
input: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface IToolPlan {
|
||||
id: string;
|
||||
callerId: string;
|
||||
title: string;
|
||||
reason: string;
|
||||
confidence: number;
|
||||
calls: IToolCall[];
|
||||
}
|
||||
|
||||
export interface IToolExecutionResult {
|
||||
callId: string;
|
||||
status: 'executed' | 'queuedForApproval' | 'suggested' | 'failed';
|
||||
output?: Record<string, unknown>;
|
||||
approvalId?: string;
|
||||
errorMessage?: string;
|
||||
}
|
||||
|
||||
export interface IToolPlanResult {
|
||||
planId: string;
|
||||
results: IToolExecutionResult[];
|
||||
}
|
||||
|
||||
export interface IApprovalRequest {
|
||||
id: string;
|
||||
planId: string;
|
||||
callId: string;
|
||||
agentId: string;
|
||||
title: string;
|
||||
reason: string;
|
||||
confidence: number;
|
||||
requestedScopes: TToolScope[];
|
||||
status: 'pending' | 'approved' | 'rejected' | 'expired';
|
||||
createdAt: string;
|
||||
decidedAt?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user