import type { StreamChunk } from "@dawn-ai/cli/runtime"; export interface ObservedToolCall { readonly name: string; readonly args: unknown; readonly id?: string; } export interface ObservedToolResult { readonly name: string; /** LangChain ToolMessage status, when present. */ readonly status?: "error" | "success"; /** The tool result content (string when the tool returned text/JSON). */ readonly content: unknown; /** True when the tool reported an error (status === "error"). */ readonly isError: boolean; } /** Extract tool results from final conversation messages. * * Handles two shapes: * - Serialized LangChain format: `{ lc:1, type:"constructor", id:[...,"ToolMessage"], kwargs:{name,status,content} }` * - Live LangChain instance format: `{ type:"tool", name, status, content, ... }` */ export declare function deriveToolResults(messages: ReadonlyArray>): ObservedToolResult[]; export interface CommandInterruptDetail { readonly command: string; readonly suggestedPattern: string; } export interface PathInterruptDetail { readonly path: string; readonly operation: "readFile" | "writeFile" | "listDir"; readonly suggestedPattern: string; } export interface ToolInterruptDetail { readonly toolName: string; readonly argsPreview: string; readonly suggestedPattern: string; } export interface MemoryInterruptDetail { readonly namespace: string; readonly identity: string; readonly oldId: string; readonly oldContent: string; readonly newContent: string; readonly suggestedPattern: string; } export interface SubagentInterruptDetail { readonly parentRouteId: string; readonly subagentName: string; readonly subagentRouteId: string; readonly inputPreview: string; readonly reason?: string; readonly suggestedPattern: string; } interface InterruptInfoBase { readonly interruptId: string; readonly callId?: string; } export type InterruptInfo = InterruptInfoBase & ({ readonly kind: "command"; readonly detail: CommandInterruptDetail; } | { readonly kind: "path"; readonly detail: PathInterruptDetail; } | { readonly kind: "tool"; readonly detail: ToolInterruptDetail; } | { readonly kind: "memory"; readonly detail: MemoryInterruptDetail; } | { readonly kind: "subagent"; readonly detail: SubagentInterruptDetail; }); export interface Todo { readonly content: string; readonly status: string; } export interface SubagentToolCall { readonly name: string; readonly args: unknown; } export interface SubagentRun { readonly callId: string; readonly name: string; readonly toolCalls: ReadonlyArray; readonly finalMessage?: string; readonly error?: string; } export interface SubagentEvent { readonly type: string; readonly data: Record; } export interface AgentRunResult { readonly finalMessage: string; readonly messages: ReadonlyArray>; readonly toolCalls: ReadonlyArray; readonly toolResults: ReadonlyArray; readonly tokens: ReadonlyArray; readonly state: Record; readonly threadId: string; readonly interrupts: ReadonlyArray; readonly planUpdates: ReadonlyArray<{ todos: ReadonlyArray; }>; readonly todos: ReadonlyArray; readonly subagents: ReadonlyArray; readonly subagentEvents: ReadonlyArray; readonly systemPrompt: string; } export declare function collectRunResult(stream: AsyncIterable, threadId: string): Promise; export {}; //# sourceMappingURL=run-result.d.ts.map