import { Container, type TUI } from "@kolisachint/hoocode-tui"; import type { ToolDefinition } from "../../../core/extensions/types.js"; import { type ToolOutputView } from "../../../core/tool-output-view.js"; import type { ChainEntry } from "./tool-chain-summary.js"; /** * Re-exported so tool-block callers keep a single import site for the view * dial; the type itself lives in core (the settings manager persists it). */ export type { ToolOutputView } from "../../../core/tool-output-view.js"; export interface ToolExecutionOptions { showImages?: boolean; imageWidthCells?: number; view?: ToolOutputView; } export declare class ToolExecutionComponent extends Container { private contentBox; private contentText; private selfRenderContainer; private callRendererComponent?; private resultRendererComponent?; private rendererState; private imageComponents; private imageSpacers; private toolName; private toolCallId; private args; private view; private signalComponent?; private leadingSpacer; private showImages; private imageWidthCells; private isPartial; private toolDefinition?; private builtInToolDefinition?; private ui; private cwd; private executionStarted; private argsComplete; private result?; private convertedImages; private hideComponent; private frozen; private frozenLines?; /** Width the frozen snapshot was captured at; a wider terminal is safe as-is, * a narrower one needs re-truncation to avoid the TUI's over-width crash guard. */ private frozenWidth; private frozenTruncated?; private frozenTruncatedWidth; constructor(toolName: string, toolCallId: string, args: any, options: ToolExecutionOptions | undefined, toolDefinition: ToolDefinition | undefined, ui: TUI, cwd: string); private getCallRenderer; private getResultRenderer; private hasRendererDefinition; private getRenderShell; private getRenderContext; private createCallFallback; /** * The body for a tool with no result renderer of its own. * * It gets the same peek budget as every renderer that trims itself. Before * the dial had a trimmed stop this path could print its whole result and * nothing looked wrong; now an untrimmed extension tool would be the one * thing on screen that ignores where the dial is set. */ private createResultFallback; updateArgs(args: any): void; markExecutionStarted(): void; setArgsComplete(): void; updateResult(result: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string; }>; details?: any; isError: boolean; }, isPartial?: boolean): void; private maybeConvertImagesForKitty; setView(view: ToolOutputView): void; /** This call's contribution to its chain's summary line. */ chainEntry(): ChainEntry; /** The failure text, for a collapsed chain to print under its line. */ errorText(): string; /** * Whether the result body should render. * * A failure always shows its reason, in every view. Everything else about * these views is a judgement about how much detail you want; why something * broke is not detail, and a red dot with no explanation was the one thing * the folded views got wrong. */ private shouldShowBody; /** * Whether this block draws its radar signal line instead of the tool's own * call renderer. */ private isLatest; private shouldShowSignalLine; /** * Whether this block draws its own blank row above itself. * * Radar rows do not — rows that are one line each only read as a map when * they stack without gaps — which leaves the first row of a run with nothing * between it and whatever introduced it. `ToolChainComponent` asks this so * the run can draw that one gap itself without doubling a gap the block was * already drawing, which is what happens in every other view and for a radar * block that has been opened. */ drawsLeadingGap(): boolean; /** * A failure's body under a radar row hangs off the row; anywhere else it sits * directly under its own call line and needs no extra indent. */ private indentUnderSignalRow; /** * Mark this block as the newest call in the transcript, or no longer it. * * Only radar draws anything from it: the other two views already show each * call in full, so there is nothing for a "where am I" mark to add. */ setLatest(isLatest: boolean): void; private getSignalComponent; setShowImages(show: boolean): void; setImageWidthCells(width: number): void; invalidate(): void; /** * True when this block is a finished, visible tool result that still holds its * heavy source payloads — i.e. a candidate for freeze() once it scrolls out of * the live window. In-flight (partial) and already-frozen blocks are excluded. */ isFreezable(): boolean; /** Mark this block for freezing; the snapshot is captured on the next render * (at the real render width) and the heavy state released then. */ freeze(): void; private releaseHeavyState; render(width: number): string[]; /** * The container this block renders into. * * A self-rendering tool (`edit` draws its own framed diff) gets the bare * container so its frame can use the full width; everything else gets the * padded box. The bare container costs a column of alignment, though — its * status dot sits one left of every other row — so only the stop that exists * for reading pays it. Below `full` every block takes the padded box, which * is what lets radar's rows and peek's call lines line up into a column. */ private activeShell; /** Swap the attached shell when the view changes which one applies. */ private syncShellChild; private updateDisplay; private getTextOutput; private formatToolExecution; } //# sourceMappingURL=tool-execution.d.ts.map