import { type AgentTool } from "@gajae-code/agent-core"; import { Container, type TUI } from "@gajae-code/tui"; export interface ToolExecutionOptions { showImages?: boolean; editFuzzyThreshold?: number; editAllowFuzzy?: boolean; hashlineAutoDropPureInsertDuplicates?: boolean; /** Internal observer for visible asynchronous renderer mutations. */ onVisibleTranscriptMutation?: () => void; } export interface ToolExecutionHandle { updateArgs(args: any, toolCallId?: string): void; updateResult(result: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string; }>; details?: any; isError?: boolean; }, isPartial?: boolean, toolCallId?: string): void; setArgsComplete(toolCallId?: string): void; setExpanded(expanded: boolean): void; /** * Applies an explicit fold choice for this renderer instance. The pin lasts * only for this instance; transcript rebuilds recreate it from global state. * Optional for source compatibility: this interface is publicly exported and * pre-existing structural implementers must keep compiling. Dispatchers must * guard with `typeof handle.setManuallyExpanded === "function"` and fall * back to {@link setExpanded}. */ setManuallyExpanded?(expanded: boolean): void; /** * Internal capability for dispatchers that need exact synchronous visible-output * detection. Optional so existing structural handles remain source compatible. */ consumeVisibleTranscriptChange?(): boolean; } /** * Component that renders a tool call with its result (updateable) */ export declare class ToolExecutionComponent extends Container { #private; constructor(toolName: string, args: any, options: ToolExecutionOptions | undefined, tool: AgentTool | undefined, ui: TUI, cwd?: string, _toolCallId?: string); updateArgs(args: any, _toolCallId?: string): void; /** * Signal that args are complete (tool is about to execute). * This triggers an immediate final diff computation for edit-like tools. */ setArgsComplete(_toolCallId?: string): void; updateResult(result: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string; }>; details?: any; isError?: boolean; }, isPartial?: boolean, _toolCallId?: string): void; consumeVisibleTranscriptChange(): boolean; /** * Stop spinner animation and cleanup resources. */ stopAnimation(): void; dispose(): void; /** Applies automatic expansion unless this renderer instance has an explicit fold choice. */ setExpanded(expanded: boolean): void; /** * Applies and pins an explicit fold choice for this renderer instance only. * Transcript rebuilds recreate components from global state and drop this pin. */ setManuallyExpanded(expanded: boolean): void; setShowImages(show: boolean): void; invalidate(): void; render(width: number): string[]; }