import { ZodRawShape } from 'zod'; export type ToolInputSchema = ZodRawShape; export type ToolOutputSchema = ZodRawShape; /** Internal bag passed as `ToolInput._metadata` when `TOOL_INPUT_METADATA_ENABLE` is on. */ export interface ToolInputMetadata { projectName?: string; sessionId?: string; activityId?: string; verificationId?: string; userEmail?: string; mcpServer?: string; toolUseId?: string; toolCallId?: string; traceId?: string; traceState?: string; collectorUrl?: string; collectorApiKey?: string; [key: string]: unknown; } /** * Tool arguments: each tool’s fields plus optional `_metadata` for routing/tracing/extra keys. */ export interface ToolInput { _metadata?: ToolInputMetadata | undefined; [key: string]: unknown; } export declare enum ArtifactType { IMAGE = "IMAGE", VIDEO = "VIDEO" } export interface ToolOutputArtifact { type: ArtifactType; filePath: string; mimeType: string; } export interface ToolOutput { /** Artifacts to upload to the collector (stripped before MCP response). */ _artifacts?: ToolOutputArtifact[]; [key: string]: unknown; } export interface ToolOutputWithImage extends ToolOutput { image?: { data: Buffer; mimeType: string; }; } export interface Tool { name(): string; description(): string; inputSchema(): ToolInputSchema; outputSchema(): ToolOutputSchema; handle(context: SC, args: ToolInput): Promise; /** * Optional. When defined and returns false, the tool is not registered (MCP/daemon/CLI). * When omitted or returns true, the tool is enabled. */ isEnabled?(): boolean; } /** Returns true if the tool is enabled (default when isEnabled is not implemented). */ export declare function isToolEnabled(tool: Tool): boolean; export interface ToolSessionContext { executionContext(): Record | {}; close(): Promise; } export interface ToolExecutor { executeTool(context: SC, tool: Tool, args: ToolInput): Promise; }