/** * Agent Types * TypeScript types for agent streaming and callbacks */ /** * Agent stream event types from SSE */ export type AgentStreamEventType = 'content' | 'tool_call' | 'tool_result' | 'mcp_tool_call' | 'sparklet_created' | 'sparklet_ready' | 'grounding' | 'done' | 'error'; /** * Agent stream event structure */ export interface AgentStreamEvent { type: AgentStreamEventType; data: { text?: string; partial?: boolean; thinking?: boolean; id?: string; name?: string; result?: unknown; callId?: string; serverName?: string; toolName?: string; arguments?: Record; argumentsJson?: string; conversationId?: string; sparkletHashKey?: string; title?: string; assetHashKey?: string; assetType?: 'image' | 'video'; fileName?: string; signedUrl?: string; generationPrompt?: string; aiModel?: string; sources?: Array<{ title?: string; url?: string; snippet?: string; }>; error?: string; }; } /** * Callbacks for agent stream events */ export interface AgentStreamCallbacks { onContent?: (text: string, partial: boolean) => void; onThinking?: (isThinking: boolean) => void; onToolCall?: (id: string, name: string) => void; onToolResult?: (id: string, name: string, result?: unknown) => void; onMcpToolCall?: (callId: string, serverName: string, toolName: string, args: Record) => Promise; onSparkletCreated?: (hashKey: string, title: string) => void; onMediaGenerated?: (media: { assetHashKey: string; assetType: 'image' | 'video'; fileName?: string; signedUrl?: string; generationPrompt?: string; aiModel?: string; }) => void; onGrounding?: (sources: Array<{ title?: string; url?: string; snippet?: string; }>) => void; onDone?: (conversationId?: string) => void; onError?: (error: string) => void; } /** * MCP tool call result */ export interface McpToolResult { content: McpContentItem[]; isError: boolean; } /** * MCP content item */ export interface McpContentItem { type: 'text' | 'image' | 'resource'; text?: string; data?: string; mimeType?: string; } /** * MCP server status */ export interface McpServerStatus { name: string; connected: boolean; tools: McpToolInfo[]; error?: string; } /** * MCP tool info */ export interface McpToolInfo { name: string; description?: string; inputSchema: Record; } /** * MCP state for API calls */ export interface McpState { mcpEnabled: boolean; mcpServers: Array<{ name: string; connected: boolean; tools: McpToolInfo[]; }>; } //# sourceMappingURL=types.d.ts.map