@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
69 lines • 3.21 kB
TypeScript
import { Container, type TUI } from "@earendil-works/pi-tui";
import type { ToolExecutionIdentity, ToolExecutionRenderState, ToolExecutionResult, ToolRenderers } from "./tool-execution-types.ts";
export type { ToolRenderers } from "./tool-execution-types.ts";
export interface ToolExecutionOptions {
showImages?: boolean;
imageWidthCells?: number;
}
/** Visual shell chosen by interactive chrome; classic remains the default. */
export type ToolExecutionPresentation = "classic" | "grok";
export declare class ToolExecutionComponent extends Container {
private readonly identity;
private readonly ui;
private readonly renderer;
private readonly images;
private readonly grokRow;
private readonly presentation;
private args;
private expanded;
private showImages;
private imageWidthCells;
private isPartial;
private executionStarted;
private argsComplete;
private result?;
private lastDisplaySignature?;
/** Built content was dropped by `invalidate`; the next render rebuilds it. */
private displayReleased;
private readonly renderCache;
private readonly animation;
constructor(toolName: string, toolCallId: string, args: unknown, options: ToolExecutionOptions | undefined, toolDefinition: ToolRenderers | undefined, ui: TUI, cwd: string, presentation?: ToolExecutionPresentation);
updateArgs(args: unknown): void;
/** Read-only presentation state; execution routing continues to own this original card. */
get presentationSnapshot(): {
identity: ToolExecutionIdentity;
state: ToolExecutionRenderState;
presentation: ToolExecutionPresentation;
};
markExecutionStarted(): void;
setArgsComplete(): void;
updateResult(result: ToolExecutionResult, isPartial?: boolean): void;
stopAnimation(): void;
dispose(): void;
setExpanded(expanded: boolean): void;
setShowImages(show: boolean): void;
setImageWidthCells(width: number): void;
/**
* Drops the built call and result content (and its styled output) instead of rebuilding it here;
* `render` rebuilds it from the card's state the next time the card is painted (#2537). Every card
* in the transcript is invalidated together (theme or terminal-capability changes, and the cards
* that scroll above the kept main-screen history), so an eager rebuild kept every finished card's
* output for the rest of the session. Grok rows and animating cards are rebuilt at once, as before.
*/
private rebuildNow;
invalidate(): void;
/**
* A finished card renders from state that only changes through this class's setters, each of which
* moves the revision. Cards still streaming arguments, running, animating, or in the grok
* presentation keep rendering every frame because their output can change between setter calls.
*/
getRenderRevision(): number | undefined;
render(width: number): string[];
private updateDisplay;
private createRenderState;
private createRenderSignature;
private updateSpinnerAnimation;
private updateTodoStrikeAnimation;
private invalidateRenderCache;
}
//# sourceMappingURL=tool-execution.d.ts.map