UNPKG

capsule-ai-cli

Version:

The AI Model Orchestrator - Intelligent multi-model workflows with device-locked licensing

87 lines 2.26 kB
import { Message } from '../types/index.js'; export type ToolExecutionState = 'pending' | 'running' | 'completed' | 'error' | 'cancelled'; export interface ToolParameter { name: string; type: 'string' | 'number' | 'boolean' | 'object' | 'array'; description: string; required?: boolean; default?: any; enum?: string[]; items?: { type: 'string' | 'number' | 'boolean' | 'object' | 'array'; description?: string; }; } export interface Tool { name: string; displayName: string; description: string; category: 'file' | 'code' | 'system' | 'web' | 'productivity'; icon?: string; parameters: ToolParameter[]; permissions: { fileSystem?: 'read' | 'write' | 'all'; network?: boolean; shell?: boolean; }; estimateCost?: (params: any) => { time?: number; tokens?: number; }; execute: (params: any, context: ToolExecutionContext) => Promise<ToolResult>; ui?: { showProgress?: boolean; collapsible?: boolean; dangerous?: boolean; }; } export interface ToolExecutionContext { onProgress?: (progress: ToolProgress) => void; signal?: AbortSignal; workingDirectory?: string; environment?: Record<string, string>; } export interface ToolProgress { message: string; percentage?: number; details?: any; } export interface ToolResult { success: boolean; output?: any; error?: string; executionTime: number; metadata?: { filesChanged?: string[]; tokensUsed?: number; bytesTransferred?: number; }; } export interface ToolExecution { id: string; toolName: string; displayName: string; parameters: any; state: ToolExecutionState; startTime: Date; endTime?: Date; result?: ToolResult; progress?: ToolProgress; } export interface ToolCall { id: string; name: string; arguments: any; } export interface ToolUseMessage extends Message { role: 'tool'; toolCallId: string; toolName: string; execution: ToolExecution; } export interface ToolResultMessage extends Message { role: 'tool_result'; toolCallId: string; result: ToolResult; } //# sourceMappingURL=types.d.ts.map