@kolisachint/hoocode-agent 0.5.35 → 0.5.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +2 -2
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/tool-chain.d.ts +11 -0
- package/dist/modes/interactive/components/tool-chain.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-chain.js +22 -2
- package/dist/modes/interactive/components/tool-chain.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +8 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +15 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-signal.d.ts +2 -0
- package/dist/modes/interactive/components/tool-signal.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-signal.js +6 -4
- package/dist/modes/interactive/components/tool-signal.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +2 -2
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +4 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +21 -2
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +4 -0
- package/dist/modes/interactive/theme/theme.d.ts +14 -2
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +36 -2
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/theme/vox-cutout-dark.json +2 -1
- package/dist/modes/interactive/theme/vox-cutout-light.json +2 -1
- package/docs/themes.md +10 -0
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-execution.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-execution.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,GAAG,EAEH,SAAS,EACT,eAAe,EACf,KAAK,EACL,WAAW,EACX,MAAM,EACN,IAAI,EAEJ,eAAe,EACf,YAAY,GACZ,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,wBAAwB,EAAiB,MAAM,8BAA8B,CAAC;AACvF,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAcpE;;;;;;GAMG;AACH,MAAM,eAAe;IACZ,MAAM,CAAS;IACf,KAAK,CAAY;IACjB,WAAW,CAAS;IAC5B,2EAA2E;IAC3E,yEAAyE;IACjE,IAAI,CAAmD;IAE/D,YAAY,MAAc,EAAE,KAAgB,EAAE;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAAA,CACxC;IAED,UAAU,GAAS;QAClB,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IAAA,CACtB;IAED,MAAM,CAAC,KAAa,EAAY;QAC/B,6EAA6E;QAC7E,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,G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AAC;QACvF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACnD,IAAI,OAAO,EAAE,CAAC;YACb,IAAI,IAAI,OAAO,OAAO,EAAE,CAAC;QAC1B,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,IAAI,MAAM,EAAE,CAAC;YACZ,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACvB,CAAC;QACD,OAAO,IAAI,CAAC;IAAA,CACZ;CACD","sourcesContent":["import {\n\tBox,\n\ttype Component,\n\tContainer,\n\tgetCapabilities,\n\tImage,\n\tisImageLine,\n\tSpacer,\n\tText,\n\ttype TUI,\n\ttruncateToWidth,\n\tvisibleWidth,\n} from \"@kolisachint/hoocode-tui\";\nimport type { ToolDefinition, ToolRenderContext } from \"../../../core/extensions/types.js\";\nimport type { ToolOutputView } from \"../../../core/tool-output-view.js\";\nimport { createAllToolDefinitions, type ToolName } from \"../../../core/tools/index.js\";\nimport { getTextOutput as getRenderedTextOutput } from \"../../../core/tools/render-utils.js\";\nimport { convertToPng } from \"../../../utils/image-convert.js\";\nimport { theme } from \"../theme/theme.js\";\nimport type { ChainEntry } from \"./tool-chain-summary.js\";\nimport { ToolSignalComponent, toolSubject } from \"./tool-signal.js\";\n\n/**\n * Re-exported so tool-block callers keep a single import site for the view\n * dial; the type itself lives in core (the settings manager persists it).\n */\nexport type { ToolOutputView } from \"../../../core/tool-output-view.js\";\n\nexport interface ToolExecutionOptions {\n\tshowImages?: boolean;\n\timageWidthCells?: number;\n\tview?: ToolOutputView;\n}\n\n/**\n * Renders a child component and prepends a prefix (e.g. a status dot) to its\n * first line, indenting continuation lines so they align under the content.\n *\n * This keeps the dot inline with the first line instead of stacking it on its\n * own line (which happens when a Container holds the dot as a separate child).\n */\nclass PrefixFirstLine implements Component {\n\tprivate prefix: string;\n\tprivate child: Component;\n\tprivate indentWidth: number;\n\t// Keyed on the child's returned array identity so an unchanged child keeps\n\t// this wrapper reference-stable too (parents memoize flattening by ref).\n\tprivate memo?: { src: string[]; width: number; out: string[] };\n\n\tconstructor(prefix: string, child: Component) {\n\t\tthis.prefix = prefix;\n\t\tthis.child = child;\n\t\tthis.indentWidth = visibleWidth(prefix);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.child.invalidate?.();\n\t\tthis.memo = undefined;\n\t}\n\n\trender(width: number): string[] {\n\t\t// Reserve room for the prefix so the child wraps within the remaining width.\n\t\tconst childWidth = Math.max(1, width - this.indentWidth);\n\t\tconst lines = this.child.render(childWidth);\n\t\tif (this.memo && this.memo.src === lines && this.memo.width === width) {\n\t\t\treturn this.memo.out;\n\t\t}\n\t\tconst indent = \" \".repeat(this.indentWidth);\n\t\tconst out =\n\t\t\tlines.length === 0 ? [this.prefix] : lines.map((line, i) => (i === 0 ? this.prefix + line : indent + line));\n\t\tthis.memo = { src: lines, width, out };\n\t\treturn out;\n\t}\n}\n\n/**\n * Indents every line of a child, unlike PrefixFirstLine which only offsets the\n * first. Used for a failure's body under a radar row, so the reason reads as\n * hanging off the row rather than starting a new column.\n */\nclass IndentAll implements Component {\n\tprivate child: Component;\n\tprivate indent: string;\n\tprivate memo?: { src: string[]; width: number; out: string[] };\n\n\tconstructor(child: Component, width: number) {\n\t\tthis.child = child;\n\t\tthis.indent = \" \".repeat(width);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.child.invalidate?.();\n\t\tthis.memo = undefined;\n\t}\n\n\trender(width: number): string[] {\n\t\tconst lines = this.child.render(Math.max(1, width - this.indent.length));\n\t\tif (this.memo && this.memo.src === lines && this.memo.width === width) return this.memo.out;\n\t\tconst out = lines.map((line) => (line.trim() === \"\" ? line : this.indent + line));\n\t\tthis.memo = { src: lines, width, out };\n\t\treturn out;\n\t}\n}\n\nexport class ToolExecutionComponent extends Container {\n\tprivate contentBox: Box;\n\tprivate contentText: Text;\n\tprivate selfRenderContainer: Container;\n\tprivate callRendererComponent?: Component;\n\tprivate resultRendererComponent?: Component;\n\tprivate rendererState: any = {};\n\tprivate imageComponents: Image[] = [];\n\tprivate imageSpacers: Spacer[] = [];\n\tprivate toolName: string;\n\tprivate toolCallId: string;\n\tprivate args: any;\n\tprivate expanded = false;\n\t// Persisted view (radar/glance/full). Controls how the call line is drawn and\n\t// whether the result body renders at all; `revealed` is the per-block override\n\t// the global expand key flips for radar/glance blocks.\n\tprivate view: ToolOutputView;\n\tprivate revealed = false;\n\tprivate signalComponent?: ToolSignalComponent;\n\tprivate leadingSpacer: Spacer;\n\tprivate showImages: boolean;\n\tprivate imageWidthCells: number;\n\tprivate isPartial = true;\n\tprivate toolDefinition?: ToolDefinition<any, any>;\n\tprivate builtInToolDefinition?: ToolDefinition<any, any>;\n\tprivate ui: TUI;\n\tprivate cwd: string;\n\tprivate executionStarted = false;\n\tprivate argsComplete = false;\n\tprivate result?: {\n\t\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\t\tisError: boolean;\n\t\tdetails?: any;\n\t};\n\tprivate convertedImages: Map<number, { data: string; mimeType: string }> = new Map();\n\tprivate hideComponent = false;\n\t// Once a finished tool block has scrolled far out of view the interactive mode\n\t// freezes it (see freeze()): its already-rendered lines are captured and the\n\t// heavy source payloads (full tool result, base64 image copies, per-renderer\n\t// state, child component caches) are released. A frozen block is immutable and\n\t// no longer reflows on resize — old off-screen scrollback keeps its wrapping,\n\t// which self-heals on any full rebuild (theme toggle / session reload, both of\n\t// which reconstruct components from the intact session data).\n\tprivate frozen = false;\n\tprivate frozenLines?: string[];\n\t/** Width the frozen snapshot was captured at; a wider terminal is safe as-is,\n\t * a narrower one needs re-truncation to avoid the TUI's over-width crash guard. */\n\tprivate frozenWidth = 0;\n\tprivate frozenTruncated?: string[];\n\tprivate frozenTruncatedWidth = -1;\n\n\tconstructor(\n\t\ttoolName: string,\n\t\ttoolCallId: string,\n\t\targs: any,\n\t\toptions: ToolExecutionOptions = {},\n\t\ttoolDefinition: ToolDefinition<any, any> | undefined,\n\t\tui: TUI,\n\t\tcwd: string,\n\t) {\n\t\tsuper();\n\t\tthis.toolName = toolName;\n\t\tthis.toolCallId = toolCallId;\n\t\tthis.args = args;\n\t\tthis.toolDefinition = toolDefinition;\n\t\tthis.builtInToolDefinition = createAllToolDefinitions(cwd)[toolName as ToolName];\n\t\tthis.showImages = options.showImages ?? true;\n\t\tthis.imageWidthCells = options.imageWidthCells ?? 60;\n\t\tthis.view = options.view ?? \"glance\";\n\t\tthis.ui = ui;\n\t\tthis.cwd = cwd;\n\n\t\t// The separator between consecutive tool blocks. Radar drops it: rows that\n\t\t// are one line each only read as a map when they stack without gaps.\n\t\tthis.leadingSpacer = new Spacer(1);\n\t\tthis.addChild(this.leadingSpacer);\n\n\t\t// Always create all shell variants. contentBox is used for default renderer-based composition.\n\t\t// selfRenderContainer is used when the tool renders its own framing.\n\t\t// contentText is reserved for generic fallback rendering when no tool definition exists.\n\t\t// Boxless: no filled background — hierarchy comes from status dots + indent.\n\t\t// paddingY is 0: the single leading Spacer(1) is the only separator between\n\t\t// tool blocks, so consecutive commands don't stack 3 blank lines between them.\n\t\tthis.contentBox = new Box(1, 0);\n\t\tthis.contentText = new Text(\"\", 1, 0);\n\t\tthis.selfRenderContainer = new Container();\n\n\t\tif (this.hasRendererDefinition()) {\n\t\t\tthis.addChild(this.activeShell());\n\t\t} else {\n\t\t\tthis.addChild(this.contentText);\n\t\t}\n\n\t\tthis.updateDisplay();\n\t}\n\n\tprivate getCallRenderer(): ToolDefinition<any, any>[\"renderCall\"] | undefined {\n\t\tif (!this.builtInToolDefinition) {\n\t\t\treturn this.toolDefinition?.renderCall;\n\t\t}\n\t\tif (!this.toolDefinition) {\n\t\t\treturn this.builtInToolDefinition.renderCall;\n\t\t}\n\t\treturn this.toolDefinition.renderCall ?? this.builtInToolDefinition.renderCall;\n\t}\n\n\tprivate getResultRenderer(): ToolDefinition<any, any>[\"renderResult\"] | undefined {\n\t\tif (!this.builtInToolDefinition) {\n\t\t\treturn this.toolDefinition?.renderResult;\n\t\t}\n\t\tif (!this.toolDefinition) {\n\t\t\treturn this.builtInToolDefinition.renderResult;\n\t\t}\n\t\treturn this.toolDefinition.renderResult ?? this.builtInToolDefinition.renderResult;\n\t}\n\n\tprivate hasRendererDefinition(): boolean {\n\t\treturn this.builtInToolDefinition !== undefined || this.toolDefinition !== undefined;\n\t}\n\n\tprivate getRenderShell(): \"default\" | \"self\" {\n\t\tif (!this.builtInToolDefinition) {\n\t\t\treturn this.toolDefinition?.renderShell ?? \"default\";\n\t\t}\n\t\tif (!this.toolDefinition) {\n\t\t\treturn this.builtInToolDefinition.renderShell ?? \"default\";\n\t\t}\n\t\treturn this.toolDefinition.renderShell ?? this.builtInToolDefinition.renderShell ?? \"default\";\n\t}\n\n\tprivate getRenderContext(lastComponent: Component | undefined): ToolRenderContext {\n\t\treturn {\n\t\t\targs: this.args,\n\t\t\ttoolCallId: this.toolCallId,\n\t\t\tinvalidate: () => {\n\t\t\t\tthis.invalidate();\n\t\t\t\tthis.ui.requestRender();\n\t\t\t},\n\t\t\tlastComponent,\n\t\t\tstate: this.rendererState,\n\t\t\tcwd: this.cwd,\n\t\t\texecutionStarted: this.executionStarted,\n\t\t\targsComplete: this.argsComplete,\n\t\t\tisPartial: this.isPartial,\n\t\t\texpanded: this.expanded,\n\t\t\tshowImages: this.showImages,\n\t\t\tisError: this.result?.isError ?? false,\n\t\t};\n\t}\n\n\tprivate createCallFallback(): Component {\n\t\treturn new Text(theme.fg(\"toolTitle\", theme.bold(this.toolName)), 0, 0);\n\t}\n\n\tprivate createResultFallback(): Component | undefined {\n\t\tconst output = this.getTextOutput();\n\t\tif (!output) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new Text(theme.fg(\"toolOutput\", output), 0, 0);\n\t}\n\n\tupdateArgs(args: any): void {\n\t\tthis.args = args;\n\t\tthis.updateDisplay();\n\t}\n\n\tmarkExecutionStarted(): void {\n\t\tthis.executionStarted = true;\n\t\tthis.updateDisplay();\n\t\tthis.ui.requestRender();\n\t}\n\n\tsetArgsComplete(): void {\n\t\tthis.argsComplete = true;\n\t\tthis.updateDisplay();\n\t\tthis.ui.requestRender();\n\t}\n\n\tupdateResult(\n\t\tresult: {\n\t\t\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\t\t\tdetails?: any;\n\t\t\tisError: boolean;\n\t\t},\n\t\tisPartial = false,\n\t): void {\n\t\tthis.result = result;\n\t\tthis.isPartial = isPartial;\n\t\tthis.updateDisplay();\n\t\tthis.maybeConvertImagesForKitty();\n\t}\n\n\tprivate maybeConvertImagesForKitty(): void {\n\t\tconst caps = getCapabilities();\n\t\tif (caps.images !== \"kitty\") return;\n\t\tif (!this.result) return;\n\n\t\tconst imageBlocks = this.result.content.filter((c) => c.type === \"image\");\n\t\tfor (let i = 0; i < imageBlocks.length; i++) {\n\t\t\tconst img = imageBlocks[i];\n\t\t\tif (!img.data || !img.mimeType) continue;\n\t\t\tif (img.mimeType === \"image/png\") continue;\n\t\t\tif (this.convertedImages.has(i)) continue;\n\n\t\t\tconst index = i;\n\t\t\tconvertToPng(img.data, img.mimeType).then((converted) => {\n\t\t\t\tif (this.frozen) return;\n\t\t\t\tif (converted) {\n\t\t\t\t\tthis.convertedImages.set(index, converted);\n\t\t\t\t\tthis.updateDisplay();\n\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.expanded = expanded;\n\t\t// For radar/glance blocks the same global toggle reveals the hidden body;\n\t\t// for full blocks `expanded` alone switches truncated ↔ everything.\n\t\tthis.revealed = expanded;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetView(view: ToolOutputView): void {\n\t\tthis.view = view;\n\t\tthis.updateDisplay();\n\t}\n\n\t/**\n\t * Whether this block is currently opened up.\n\t *\n\t * Read by the one-at-a-time unfold, which walks back from the newest block\n\t * to find the first one still folded.\n\t */\n\tisRevealed(): boolean {\n\t\treturn this.revealed;\n\t}\n\n\t/** This call's contribution to its chain's summary line. */\n\tchainEntry(): ChainEntry {\n\t\tconst output = this.result ? this.getTextOutput() : \"\";\n\t\treturn {\n\t\t\ttool: this.toolName,\n\t\t\tsubject: toolSubject(this.args, this.cwd),\n\t\t\tisError: this.result?.isError === true,\n\t\t\tisPartial: this.result === undefined || this.isPartial,\n\t\t\toutputLines: output.trim() ? output.split(\"\\n\").length : 0,\n\t\t};\n\t}\n\n\t/** The failure text, for a collapsed chain to print under its line. */\n\terrorText(): string {\n\t\treturn this.result?.isError ? this.getTextOutput() : \"\";\n\t}\n\n\t/**\n\t * Whether the result body should render.\n\t *\n\t * A failure always shows its reason, in every view. Everything else about\n\t * these views is a judgement about how much detail you want; why something\n\t * broke is not detail, and a red dot with no explanation was the one thing\n\t * the folded views got wrong.\n\t */\n\tprivate shouldShowBody(): boolean {\n\t\treturn this.view === \"full\" || this.revealed || this.result?.isError === true;\n\t}\n\n\t/**\n\t * Whether this block draws its radar signal line instead of the tool's own\n\t * call renderer. A revealed block leaves radar for as long as it is open, so\n\t * \"expand\" means the same thing in every view.\n\t */\n\tprivate shouldShowSignalLine(): boolean {\n\t\treturn this.view === \"radar\" && !this.revealed;\n\t}\n\n\t/**\n\t * A failure's body under a radar row hangs off the row; anywhere else it sits\n\t * directly under its own call line and needs no extra indent.\n\t */\n\tprivate indentUnderSignalRow(component: Component): Component {\n\t\treturn this.shouldShowSignalLine() ? new IndentAll(component, 3) : component;\n\t}\n\n\tprivate getSignalComponent(): ToolSignalComponent {\n\t\tconst input = {\n\t\t\ttoolName: this.toolName,\n\t\t\targs: this.args,\n\t\t\tcwd: this.cwd,\n\t\t\tresult: this.result,\n\t\t\tisPartial: this.isPartial,\n\t\t\tshowImages: this.showImages,\n\t\t};\n\t\tif (this.signalComponent) {\n\t\t\tthis.signalComponent.setInput(input);\n\t\t} else {\n\t\t\tthis.signalComponent = new ToolSignalComponent(input);\n\t\t}\n\t\treturn this.signalComponent;\n\t}\n\n\tsetShowImages(show: boolean): void {\n\t\tthis.showImages = show;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetImageWidthCells(width: number): void {\n\t\tthis.imageWidthCells = Math.max(1, Math.floor(width));\n\t\tthis.updateDisplay();\n\t}\n\n\toverride invalidate(): void {\n\t\t// A frozen block has released the state updateDisplay would rebuild from;\n\t\t// its captured snapshot is authoritative, so skip the rebuild entirely.\n\t\tif (this.frozen) return;\n\t\tsuper.invalidate();\n\t\tthis.updateDisplay();\n\t}\n\n\t/**\n\t * True when this block is a finished, visible tool result that still holds its\n\t * heavy source payloads — i.e. a candidate for freeze() once it scrolls out of\n\t * the live window. In-flight (partial) and already-frozen blocks are excluded.\n\t */\n\tisFreezable(): boolean {\n\t\treturn !this.frozen && !this.isPartial && !this.hideComponent && !!this.result;\n\t}\n\n\t/** Mark this block for freezing; the snapshot is captured on the next render\n\t * (at the real render width) and the heavy state released then. */\n\tfreeze(): void {\n\t\tif (this.isFreezable()) this.frozen = true;\n\t}\n\n\tprivate releaseHeavyState(): void {\n\t\tthis.result = undefined;\n\t\tthis.convertedImages.clear();\n\t\tthis.imageComponents = [];\n\t\tthis.imageSpacers = [];\n\t\tthis.rendererState = {};\n\t\tthis.callRendererComponent = undefined;\n\t\tthis.resultRendererComponent = undefined;\n\t\t// Drop child components so their line caches (which embed base64 image\n\t\t// payloads and full text output) become collectable.\n\t\tthis.clear();\n\t}\n\n\toverride render(width: number): string[] {\n\t\tif (this.hideComponent) {\n\t\t\treturn [];\n\t\t}\n\t\tif (this.frozenLines) {\n\t\t\t// Captured snapshot. Wider (or equal) terminal: emit as-is. Narrower:\n\t\t\t// re-truncate non-image lines to avoid the TUI's over-width crash guard,\n\t\t\t// caching the result per width so it stays O(1) on unchanged frames.\n\t\t\tif (width >= this.frozenWidth) return this.frozenLines;\n\t\t\tif (this.frozenTruncatedWidth === width && this.frozenTruncated) return this.frozenTruncated;\n\t\t\tthis.frozenTruncated = this.frozenLines.map((line) =>\n\t\t\t\tisImageLine(line) || visibleWidth(line) <= width ? line : truncateToWidth(line, width),\n\t\t\t);\n\t\t\tthis.frozenTruncatedWidth = width;\n\t\t\treturn this.frozenTruncated;\n\t\t}\n\t\tconst lines = super.render(width);\n\t\tif (this.frozen) {\n\t\t\tthis.frozenLines = lines;\n\t\t\tthis.frozenWidth = width;\n\t\t\tthis.releaseHeavyState();\n\t\t}\n\t\treturn lines;\n\t}\n\n\t/**\n\t * The container this block renders into.\n\t *\n\t * A self-rendering tool (`edit` draws its own framed diff) normally gets the\n\t * bare container so its frame can use the full width; everything else gets\n\t * the padded box. That only matters while the body is on screen. With the\n\t * body folded away the block is a single line, and the unpadded container\n\t * put it one column left of every other row — invisible while `peek` was an\n\t * opt-in, glaring now that `glance` is the default. So: padded box whenever\n\t * nothing is expanded, which also gives radar the uniform rows it exists for.\n\t */\n\tprivate activeShell(): Box | Container {\n\t\tif (!this.shouldShowBody()) return this.contentBox;\n\t\treturn this.getRenderShell() === \"self\" ? this.selfRenderContainer : this.contentBox;\n\t}\n\n\t/** Swap the attached shell when the view changes which one applies. */\n\tprivate syncShellChild(): void {\n\t\tconst wanted = this.activeShell();\n\t\tconst other = wanted === this.contentBox ? this.selfRenderContainer : this.contentBox;\n\t\tif (this.children.includes(wanted)) return;\n\t\tthis.removeChild(other);\n\t\tother.clear();\n\t\tthis.addChild(wanted);\n\t}\n\n\tprivate updateDisplay(): void {\n\t\t// Frozen blocks are immutable snapshots with their source state released.\n\t\tif (this.frozen) return;\n\t\tlet hasContent = false;\n\t\tthis.hideComponent = false;\n\t\tthis.leadingSpacer.setLines(this.shouldShowSignalLine() ? 0 : 1);\n\t\tif (this.hasRendererDefinition()) {\n\t\t\tthis.syncShellChild();\n\t\t\tconst renderContainer = this.activeShell();\n\t\t\t// Boxless: no background fill on the container.\n\t\t\tif (renderContainer instanceof Box) {\n\t\t\t\trenderContainer.setBgFn(undefined);\n\t\t\t}\n\t\t\trenderContainer.clear();\n\n\t\t\t// Status dot prefix: green for complete success, yellow for pending/partial, red for error.\n\t\t\t// The dot is prepended to the first line of the call renderer so it stays inline\n\t\t\t// (adding it as a separate child would stack it on its own line).\n\t\t\tconst dotColor = this.result?.isError ? \"error\" : this.isPartial ? \"warning\" : \"success\";\n\t\t\t// No disclosure caret. It is a click-target idiom in a TUI with no\n\t\t\t// pointer, it cost two columns on every row for an action that could\n\t\t\t// only ever be reached by keyboard, and reading it as \"this row opens\"\n\t\t\t// set an expectation the view does not meet.\n\t\t\tconst dot = theme.fg(dotColor, \"● \");\n\n\t\t\t// Radar replaces the tool's own call renderer with the uniform signal\n\t\t\t// row, so a screen of mixed tools lines up into one readable map.\n\t\t\tif (this.shouldShowSignalLine()) {\n\t\t\t\trenderContainer.addChild(new PrefixFirstLine(dot, this.getSignalComponent()));\n\t\t\t\thasContent = true;\n\t\t\t} else {\n\t\t\t\tconst callRenderer = this.getCallRenderer();\n\t\t\t\tif (!callRenderer) {\n\t\t\t\t\trenderContainer.addChild(new PrefixFirstLine(dot, this.createCallFallback()));\n\t\t\t\t\thasContent = true;\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst component = callRenderer(this.args, theme, this.getRenderContext(this.callRendererComponent));\n\t\t\t\t\t\tthis.callRendererComponent = component;\n\t\t\t\t\t\trenderContainer.addChild(new PrefixFirstLine(dot, component));\n\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tthis.callRendererComponent = undefined;\n\t\t\t\t\t\trenderContainer.addChild(new PrefixFirstLine(dot, this.createCallFallback()));\n\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.result && this.shouldShowBody()) {\n\t\t\t\tconst resultRenderer = this.getResultRenderer();\n\t\t\t\tif (!resultRenderer) {\n\t\t\t\t\tconst component = this.createResultFallback();\n\t\t\t\t\tif (component) {\n\t\t\t\t\t\trenderContainer.addChild(this.indentUnderSignalRow(component));\n\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst component = resultRenderer(\n\t\t\t\t\t\t\t{ content: this.result.content as any, details: this.result.details },\n\t\t\t\t\t\t\t{ expanded: this.expanded, isPartial: this.isPartial },\n\t\t\t\t\t\t\ttheme,\n\t\t\t\t\t\t\tthis.getRenderContext(this.resultRendererComponent),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.resultRendererComponent = component;\n\t\t\t\t\t\trenderContainer.addChild(this.indentUnderSignalRow(component));\n\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tthis.resultRendererComponent = undefined;\n\t\t\t\t\t\tconst component = this.createResultFallback();\n\t\t\t\t\t\tif (component) {\n\t\t\t\t\t\t\trenderContainer.addChild(component);\n\t\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Boxless: no background fill.\n\t\t\tthis.contentText.setCustomBgFn(undefined);\n\t\t\tthis.contentText.setText(this.formatToolExecution());\n\t\t\thasContent = true;\n\t\t}\n\n\t\tfor (const img of this.imageComponents) {\n\t\t\tthis.removeChild(img);\n\t\t}\n\t\tthis.imageComponents = [];\n\t\tfor (const spacer of this.imageSpacers) {\n\t\t\tthis.removeChild(spacer);\n\t\t}\n\t\tthis.imageSpacers = [];\n\n\t\tif (this.result && !this.shouldShowSignalLine()) {\n\t\t\tconst imageBlocks = this.result.content.filter((c) => c.type === \"image\");\n\t\t\tconst caps = getCapabilities();\n\t\t\tfor (let i = 0; i < imageBlocks.length; i++) {\n\t\t\t\tconst img = imageBlocks[i];\n\t\t\t\tif (caps.images && this.showImages && img.data && img.mimeType) {\n\t\t\t\t\tconst converted = this.convertedImages.get(i);\n\t\t\t\t\tconst imageData = converted?.data ?? img.data;\n\t\t\t\t\tconst imageMimeType = converted?.mimeType ?? img.mimeType;\n\t\t\t\t\tif (caps.images === \"kitty\" && imageMimeType !== \"image/png\") continue;\n\n\t\t\t\t\tconst spacer = new Spacer(1);\n\t\t\t\t\tthis.addChild(spacer);\n\t\t\t\t\tthis.imageSpacers.push(spacer);\n\t\t\t\t\tconst imageComponent = new Image(\n\t\t\t\t\t\timageData,\n\t\t\t\t\t\timageMimeType,\n\t\t\t\t\t\t{ fallbackColor: (s: string) => theme.fg(\"toolOutput\", s) },\n\t\t\t\t\t\t{ maxWidthCells: this.imageWidthCells },\n\t\t\t\t\t);\n\t\t\t\t\tthis.imageComponents.push(imageComponent);\n\t\t\t\t\tthis.addChild(imageComponent);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.hasRendererDefinition() && !hasContent && this.imageComponents.length === 0) {\n\t\t\tthis.hideComponent = true;\n\t\t}\n\t}\n\n\tprivate getTextOutput(): string {\n\t\treturn getRenderedTextOutput(this.result, this.showImages);\n\t}\n\n\tprivate formatToolExecution(): string {\n\t\tconst dotColor = this.result?.isError ? \"error\" : this.isPartial ? \"warning\" : \"success\";\n\t\t// A tool with no renderer still gets a radar row, just without the\n\t\t// flush-right signal column (this path has no width to align against).\n\t\tif (this.shouldShowSignalLine()) {\n\t\t\tconst subject = toolSubject(this.args, this.cwd);\n\t\t\treturn (\n\t\t\t\ttheme.fg(dotColor, \"● \") +\n\t\t\t\ttheme.fg(\"toolTitle\", theme.bold(this.toolName)) +\n\t\t\t\t(subject ? ` ${theme.fg(\"toolOutput\", subject)}` : \"\")\n\t\t\t);\n\t\t}\n\t\tlet text = theme.fg(dotColor, \"● \") + theme.fg(\"toolTitle\", theme.bold(this.toolName));\n\t\tconst content = JSON.stringify(this.args, null, 2);\n\t\tif (content) {\n\t\t\ttext += `\\n\\n${content}`;\n\t\t}\n\t\tconst output = this.shouldShowBody() ? this.getTextOutput() : \"\";\n\t\tif (output) {\n\t\t\ttext += `\\n${output}`;\n\t\t}\n\t\treturn text;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tool-execution.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-execution.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,GAAG,EAEH,SAAS,EACT,eAAe,EACf,KAAK,EACL,WAAW,EACX,MAAM,EACN,IAAI,EAEJ,eAAe,EACf,YAAY,GACZ,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,wBAAwB,EAAiB,MAAM,8BAA8B,CAAC;AACvF,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAcpE;;;;;;GAMG;AACH,MAAM,eAAe;IACZ,MAAM,CAAS;IACf,KAAK,CAAY;IACjB,WAAW,CAAS;IAC5B,2EAA2E;IAC3E,yEAAyE;IACjE,IAAI,CAAmD;IAE/D,YAAY,MAAc,EAAE,KAAgB,EAAE;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAAA,CACxC;IAED,UAAU,GAAS;QAClB,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IAAA,CACtB;IAED,MAAM,CAAC,KAAa,EAAY;QAC/B,6EAA6E;QAC7E,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;QACzD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAA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AAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACtD,CAAC;QACH,CAAC;QACD,IAAI,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAI,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QACvF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACnD,IAAI,OAAO,EAAE,CAAC;YACb,IAAI,IAAI,OAAO,OAAO,EAAE,CAAC;QAC1B,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,IAAI,MAAM,EAAE,CAAC;YACZ,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACvB,CAAC;QACD,OAAO,IAAI,CAAC;IAAA,CACZ;CACD","sourcesContent":["import {\n\tBox,\n\ttype Component,\n\tContainer,\n\tgetCapabilities,\n\tImage,\n\tisImageLine,\n\tSpacer,\n\tText,\n\ttype TUI,\n\ttruncateToWidth,\n\tvisibleWidth,\n} from \"@kolisachint/hoocode-tui\";\nimport type { ToolDefinition, ToolRenderContext } from \"../../../core/extensions/types.js\";\nimport type { ToolOutputView } from \"../../../core/tool-output-view.js\";\nimport { createAllToolDefinitions, type ToolName } from \"../../../core/tools/index.js\";\nimport { getTextOutput as getRenderedTextOutput } from \"../../../core/tools/render-utils.js\";\nimport { convertToPng } from \"../../../utils/image-convert.js\";\nimport { theme } from \"../theme/theme.js\";\nimport type { ChainEntry } from \"./tool-chain-summary.js\";\nimport { ToolSignalComponent, toolSubject } from \"./tool-signal.js\";\n\n/**\n * Re-exported so tool-block callers keep a single import site for the view\n * dial; the type itself lives in core (the settings manager persists it).\n */\nexport type { ToolOutputView } from \"../../../core/tool-output-view.js\";\n\nexport interface ToolExecutionOptions {\n\tshowImages?: boolean;\n\timageWidthCells?: number;\n\tview?: ToolOutputView;\n}\n\n/**\n * Renders a child component and prepends a prefix (e.g. a status dot) to its\n * first line, indenting continuation lines so they align under the content.\n *\n * This keeps the dot inline with the first line instead of stacking it on its\n * own line (which happens when a Container holds the dot as a separate child).\n */\nclass PrefixFirstLine implements Component {\n\tprivate prefix: string;\n\tprivate child: Component;\n\tprivate indentWidth: number;\n\t// Keyed on the child's returned array identity so an unchanged child keeps\n\t// this wrapper reference-stable too (parents memoize flattening by ref).\n\tprivate memo?: { src: string[]; width: number; out: string[] };\n\n\tconstructor(prefix: string, child: Component) {\n\t\tthis.prefix = prefix;\n\t\tthis.child = child;\n\t\tthis.indentWidth = visibleWidth(prefix);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.child.invalidate?.();\n\t\tthis.memo = undefined;\n\t}\n\n\trender(width: number): string[] {\n\t\t// Reserve room for the prefix so the child wraps within the remaining width.\n\t\tconst childWidth = Math.max(1, width - this.indentWidth);\n\t\tconst lines = this.child.render(childWidth);\n\t\tif (this.memo && this.memo.src === lines && this.memo.width === width) {\n\t\t\treturn this.memo.out;\n\t\t}\n\t\tconst indent = \" \".repeat(this.indentWidth);\n\t\tconst out =\n\t\t\tlines.length === 0 ? [this.prefix] : lines.map((line, i) => (i === 0 ? this.prefix + line : indent + line));\n\t\tthis.memo = { src: lines, width, out };\n\t\treturn out;\n\t}\n}\n\n/**\n * Indents every line of a child, unlike PrefixFirstLine which only offsets the\n * first. Used for a failure's body under a radar row, so the reason reads as\n * hanging off the row rather than starting a new column.\n */\nclass IndentAll implements Component {\n\tprivate child: Component;\n\tprivate indent: string;\n\tprivate memo?: { src: string[]; width: number; out: string[] };\n\n\tconstructor(child: Component, width: number) {\n\t\tthis.child = child;\n\t\tthis.indent = \" \".repeat(width);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.child.invalidate?.();\n\t\tthis.memo = undefined;\n\t}\n\n\trender(width: number): string[] {\n\t\tconst lines = this.child.render(Math.max(1, width - this.indent.length));\n\t\tif (this.memo && this.memo.src === lines && this.memo.width === width) return this.memo.out;\n\t\tconst out = lines.map((line) => (line.trim() === \"\" ? line : this.indent + line));\n\t\tthis.memo = { src: lines, width, out };\n\t\treturn out;\n\t}\n}\n\nexport class ToolExecutionComponent extends Container {\n\tprivate contentBox: Box;\n\tprivate contentText: Text;\n\tprivate selfRenderContainer: Container;\n\tprivate callRendererComponent?: Component;\n\tprivate resultRendererComponent?: Component;\n\tprivate rendererState: any = {};\n\tprivate imageComponents: Image[] = [];\n\tprivate imageSpacers: Spacer[] = [];\n\tprivate toolName: string;\n\tprivate toolCallId: string;\n\tprivate args: any;\n\tprivate expanded = false;\n\t// Persisted view (radar/glance/full). Controls how the call line is drawn and\n\t// whether the result body renders at all; `revealed` is the per-block override\n\t// the global expand key flips for radar/glance blocks.\n\tprivate view: ToolOutputView;\n\tprivate revealed = false;\n\tprivate signalComponent?: ToolSignalComponent;\n\tprivate leadingSpacer: Spacer;\n\tprivate showImages: boolean;\n\tprivate imageWidthCells: number;\n\tprivate isPartial = true;\n\tprivate toolDefinition?: ToolDefinition<any, any>;\n\tprivate builtInToolDefinition?: ToolDefinition<any, any>;\n\tprivate ui: TUI;\n\tprivate cwd: string;\n\tprivate executionStarted = false;\n\tprivate argsComplete = false;\n\tprivate result?: {\n\t\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\t\tisError: boolean;\n\t\tdetails?: any;\n\t};\n\tprivate convertedImages: Map<number, { data: string; mimeType: string }> = new Map();\n\tprivate hideComponent = false;\n\t// Once a finished tool block has scrolled far out of view the interactive mode\n\t// freezes it (see freeze()): its already-rendered lines are captured and the\n\t// heavy source payloads (full tool result, base64 image copies, per-renderer\n\t// state, child component caches) are released. A frozen block is immutable and\n\t// no longer reflows on resize — old off-screen scrollback keeps its wrapping,\n\t// which self-heals on any full rebuild (theme toggle / session reload, both of\n\t// which reconstruct components from the intact session data).\n\tprivate frozen = false;\n\tprivate frozenLines?: string[];\n\t/** Width the frozen snapshot was captured at; a wider terminal is safe as-is,\n\t * a narrower one needs re-truncation to avoid the TUI's over-width crash guard. */\n\tprivate frozenWidth = 0;\n\tprivate frozenTruncated?: string[];\n\tprivate frozenTruncatedWidth = -1;\n\n\tconstructor(\n\t\ttoolName: string,\n\t\ttoolCallId: string,\n\t\targs: any,\n\t\toptions: ToolExecutionOptions = {},\n\t\ttoolDefinition: ToolDefinition<any, any> | undefined,\n\t\tui: TUI,\n\t\tcwd: string,\n\t) {\n\t\tsuper();\n\t\tthis.toolName = toolName;\n\t\tthis.toolCallId = toolCallId;\n\t\tthis.args = args;\n\t\tthis.toolDefinition = toolDefinition;\n\t\tthis.builtInToolDefinition = createAllToolDefinitions(cwd)[toolName as ToolName];\n\t\tthis.showImages = options.showImages ?? true;\n\t\tthis.imageWidthCells = options.imageWidthCells ?? 60;\n\t\tthis.view = options.view ?? \"glance\";\n\t\tthis.ui = ui;\n\t\tthis.cwd = cwd;\n\n\t\t// The separator between consecutive tool blocks. Radar drops it: rows that\n\t\t// are one line each only read as a map when they stack without gaps.\n\t\tthis.leadingSpacer = new Spacer(1);\n\t\tthis.addChild(this.leadingSpacer);\n\n\t\t// Always create all shell variants. contentBox is used for default renderer-based composition.\n\t\t// selfRenderContainer is used when the tool renders its own framing.\n\t\t// contentText is reserved for generic fallback rendering when no tool definition exists.\n\t\t// Boxless: no filled background — hierarchy comes from status dots + indent.\n\t\t// paddingY is 0: the single leading Spacer(1) is the only separator between\n\t\t// tool blocks, so consecutive commands don't stack 3 blank lines between them.\n\t\tthis.contentBox = new Box(1, 0);\n\t\tthis.contentText = new Text(\"\", 1, 0);\n\t\tthis.selfRenderContainer = new Container();\n\n\t\tif (this.hasRendererDefinition()) {\n\t\t\tthis.addChild(this.activeShell());\n\t\t} else {\n\t\t\tthis.addChild(this.contentText);\n\t\t}\n\n\t\tthis.updateDisplay();\n\t}\n\n\tprivate getCallRenderer(): ToolDefinition<any, any>[\"renderCall\"] | undefined {\n\t\tif (!this.builtInToolDefinition) {\n\t\t\treturn this.toolDefinition?.renderCall;\n\t\t}\n\t\tif (!this.toolDefinition) {\n\t\t\treturn this.builtInToolDefinition.renderCall;\n\t\t}\n\t\treturn this.toolDefinition.renderCall ?? this.builtInToolDefinition.renderCall;\n\t}\n\n\tprivate getResultRenderer(): ToolDefinition<any, any>[\"renderResult\"] | undefined {\n\t\tif (!this.builtInToolDefinition) {\n\t\t\treturn this.toolDefinition?.renderResult;\n\t\t}\n\t\tif (!this.toolDefinition) {\n\t\t\treturn this.builtInToolDefinition.renderResult;\n\t\t}\n\t\treturn this.toolDefinition.renderResult ?? this.builtInToolDefinition.renderResult;\n\t}\n\n\tprivate hasRendererDefinition(): boolean {\n\t\treturn this.builtInToolDefinition !== undefined || this.toolDefinition !== undefined;\n\t}\n\n\tprivate getRenderShell(): \"default\" | \"self\" {\n\t\tif (!this.builtInToolDefinition) {\n\t\t\treturn this.toolDefinition?.renderShell ?? \"default\";\n\t\t}\n\t\tif (!this.toolDefinition) {\n\t\t\treturn this.builtInToolDefinition.renderShell ?? \"default\";\n\t\t}\n\t\treturn this.toolDefinition.renderShell ?? this.builtInToolDefinition.renderShell ?? \"default\";\n\t}\n\n\tprivate getRenderContext(lastComponent: Component | undefined): ToolRenderContext {\n\t\treturn {\n\t\t\targs: this.args,\n\t\t\ttoolCallId: this.toolCallId,\n\t\t\tinvalidate: () => {\n\t\t\t\tthis.invalidate();\n\t\t\t\tthis.ui.requestRender();\n\t\t\t},\n\t\t\tlastComponent,\n\t\t\tstate: this.rendererState,\n\t\t\tcwd: this.cwd,\n\t\t\texecutionStarted: this.executionStarted,\n\t\t\targsComplete: this.argsComplete,\n\t\t\tisPartial: this.isPartial,\n\t\t\texpanded: this.expanded,\n\t\t\tshowImages: this.showImages,\n\t\t\tisError: this.result?.isError ?? false,\n\t\t};\n\t}\n\n\tprivate createCallFallback(): Component {\n\t\treturn new Text(theme.fg(\"toolTitle\", theme.bold(this.toolName)), 0, 0);\n\t}\n\n\tprivate createResultFallback(): Component | undefined {\n\t\tconst output = this.getTextOutput();\n\t\tif (!output) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new Text(theme.fg(\"toolOutput\", output), 0, 0);\n\t}\n\n\tupdateArgs(args: any): void {\n\t\tthis.args = args;\n\t\tthis.updateDisplay();\n\t}\n\n\tmarkExecutionStarted(): void {\n\t\tthis.executionStarted = true;\n\t\tthis.updateDisplay();\n\t\tthis.ui.requestRender();\n\t}\n\n\tsetArgsComplete(): void {\n\t\tthis.argsComplete = true;\n\t\tthis.updateDisplay();\n\t\tthis.ui.requestRender();\n\t}\n\n\tupdateResult(\n\t\tresult: {\n\t\t\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\t\t\tdetails?: any;\n\t\t\tisError: boolean;\n\t\t},\n\t\tisPartial = false,\n\t): void {\n\t\tthis.result = result;\n\t\tthis.isPartial = isPartial;\n\t\tthis.updateDisplay();\n\t\tthis.maybeConvertImagesForKitty();\n\t}\n\n\tprivate maybeConvertImagesForKitty(): void {\n\t\tconst caps = getCapabilities();\n\t\tif (caps.images !== \"kitty\") return;\n\t\tif (!this.result) return;\n\n\t\tconst imageBlocks = this.result.content.filter((c) => c.type === \"image\");\n\t\tfor (let i = 0; i < imageBlocks.length; i++) {\n\t\t\tconst img = imageBlocks[i];\n\t\t\tif (!img.data || !img.mimeType) continue;\n\t\t\tif (img.mimeType === \"image/png\") continue;\n\t\t\tif (this.convertedImages.has(i)) continue;\n\n\t\t\tconst index = i;\n\t\t\tconvertToPng(img.data, img.mimeType).then((converted) => {\n\t\t\t\tif (this.frozen) return;\n\t\t\t\tif (converted) {\n\t\t\t\t\tthis.convertedImages.set(index, converted);\n\t\t\t\t\tthis.updateDisplay();\n\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.expanded = expanded;\n\t\t// For radar/glance blocks the same global toggle reveals the hidden body;\n\t\t// for full blocks `expanded` alone switches truncated ↔ everything.\n\t\tthis.revealed = expanded;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetView(view: ToolOutputView): void {\n\t\tthis.view = view;\n\t\tthis.updateDisplay();\n\t}\n\n\t/**\n\t * Whether this block is currently opened up.\n\t *\n\t * Read by the one-at-a-time unfold, which walks back from the newest block\n\t * to find the first one still folded.\n\t */\n\tisRevealed(): boolean {\n\t\treturn this.revealed;\n\t}\n\n\t/** This call's contribution to its chain's summary line. */\n\tchainEntry(): ChainEntry {\n\t\tconst output = this.result ? this.getTextOutput() : \"\";\n\t\treturn {\n\t\t\ttool: this.toolName,\n\t\t\tsubject: toolSubject(this.args, this.cwd),\n\t\t\tisError: this.result?.isError === true,\n\t\t\tisPartial: this.result === undefined || this.isPartial,\n\t\t\toutputLines: output.trim() ? output.split(\"\\n\").length : 0,\n\t\t};\n\t}\n\n\t/** The failure text, for a collapsed chain to print under its line. */\n\terrorText(): string {\n\t\treturn this.result?.isError ? this.getTextOutput() : \"\";\n\t}\n\n\t/**\n\t * Whether the result body should render.\n\t *\n\t * A failure always shows its reason, in every view. Everything else about\n\t * these views is a judgement about how much detail you want; why something\n\t * broke is not detail, and a red dot with no explanation was the one thing\n\t * the folded views got wrong.\n\t */\n\tprivate shouldShowBody(): boolean {\n\t\treturn this.view === \"full\" || this.revealed || this.result?.isError === true;\n\t}\n\n\t/**\n\t * Whether this block draws its radar signal line instead of the tool's own\n\t * call renderer. A revealed block leaves radar for as long as it is open, so\n\t * \"expand\" means the same thing in every view.\n\t */\n\tprivate isLatest = false;\n\n\tprivate shouldShowSignalLine(): boolean {\n\t\treturn this.view === \"radar\" && !this.revealed;\n\t}\n\n\t/**\n\t * A failure's body under a radar row hangs off the row; anywhere else it sits\n\t * directly under its own call line and needs no extra indent.\n\t */\n\tprivate indentUnderSignalRow(component: Component): Component {\n\t\treturn this.shouldShowSignalLine() ? new IndentAll(component, 3) : component;\n\t}\n\n\t/**\n\t * Mark this block as the newest call in the transcript, or no longer it.\n\t *\n\t * Only radar draws anything from it: the other two views already show each\n\t * call in full, so there is nothing for a \"where am I\" mark to add.\n\t */\n\tsetLatest(isLatest: boolean): void {\n\t\tif (this.isLatest === isLatest) return;\n\t\tthis.isLatest = isLatest;\n\t\tthis.signalComponent?.invalidate();\n\t\tthis.updateDisplay();\n\t}\n\n\tprivate getSignalComponent(): ToolSignalComponent {\n\t\tconst input = {\n\t\t\ttoolName: this.toolName,\n\t\t\targs: this.args,\n\t\t\tcwd: this.cwd,\n\t\t\tresult: this.result,\n\t\t\tisPartial: this.isPartial,\n\t\t\tshowImages: this.showImages,\n\t\t\tisLatest: this.isLatest,\n\t\t};\n\t\tif (this.signalComponent) {\n\t\t\tthis.signalComponent.setInput(input);\n\t\t} else {\n\t\t\tthis.signalComponent = new ToolSignalComponent(input);\n\t\t}\n\t\treturn this.signalComponent;\n\t}\n\n\tsetShowImages(show: boolean): void {\n\t\tthis.showImages = show;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetImageWidthCells(width: number): void {\n\t\tthis.imageWidthCells = Math.max(1, Math.floor(width));\n\t\tthis.updateDisplay();\n\t}\n\n\toverride invalidate(): void {\n\t\t// A frozen block has released the state updateDisplay would rebuild from;\n\t\t// its captured snapshot is authoritative, so skip the rebuild entirely.\n\t\tif (this.frozen) return;\n\t\tsuper.invalidate();\n\t\tthis.updateDisplay();\n\t}\n\n\t/**\n\t * True when this block is a finished, visible tool result that still holds its\n\t * heavy source payloads — i.e. a candidate for freeze() once it scrolls out of\n\t * the live window. In-flight (partial) and already-frozen blocks are excluded.\n\t */\n\tisFreezable(): boolean {\n\t\treturn !this.frozen && !this.isPartial && !this.hideComponent && !!this.result;\n\t}\n\n\t/** Mark this block for freezing; the snapshot is captured on the next render\n\t * (at the real render width) and the heavy state released then. */\n\tfreeze(): void {\n\t\tif (this.isFreezable()) this.frozen = true;\n\t}\n\n\tprivate releaseHeavyState(): void {\n\t\tthis.result = undefined;\n\t\tthis.convertedImages.clear();\n\t\tthis.imageComponents = [];\n\t\tthis.imageSpacers = [];\n\t\tthis.rendererState = {};\n\t\tthis.callRendererComponent = undefined;\n\t\tthis.resultRendererComponent = undefined;\n\t\t// Drop child components so their line caches (which embed base64 image\n\t\t// payloads and full text output) become collectable.\n\t\tthis.clear();\n\t}\n\n\toverride render(width: number): string[] {\n\t\tif (this.hideComponent) {\n\t\t\treturn [];\n\t\t}\n\t\tif (this.frozenLines) {\n\t\t\t// Captured snapshot. Wider (or equal) terminal: emit as-is. Narrower:\n\t\t\t// re-truncate non-image lines to avoid the TUI's over-width crash guard,\n\t\t\t// caching the result per width so it stays O(1) on unchanged frames.\n\t\t\tif (width >= this.frozenWidth) return this.frozenLines;\n\t\t\tif (this.frozenTruncatedWidth === width && this.frozenTruncated) return this.frozenTruncated;\n\t\t\tthis.frozenTruncated = this.frozenLines.map((line) =>\n\t\t\t\tisImageLine(line) || visibleWidth(line) <= width ? line : truncateToWidth(line, width),\n\t\t\t);\n\t\t\tthis.frozenTruncatedWidth = width;\n\t\t\treturn this.frozenTruncated;\n\t\t}\n\t\tconst lines = super.render(width);\n\t\tif (this.frozen) {\n\t\t\tthis.frozenLines = lines;\n\t\t\tthis.frozenWidth = width;\n\t\t\tthis.releaseHeavyState();\n\t\t}\n\t\treturn lines;\n\t}\n\n\t/**\n\t * The container this block renders into.\n\t *\n\t * A self-rendering tool (`edit` draws its own framed diff) normally gets the\n\t * bare container so its frame can use the full width; everything else gets\n\t * the padded box. That only matters while the body is on screen. With the\n\t * body folded away the block is a single line, and the unpadded container\n\t * put it one column left of every other row — invisible while `peek` was an\n\t * opt-in, glaring now that `glance` is the default. So: padded box whenever\n\t * nothing is expanded, which also gives radar the uniform rows it exists for.\n\t */\n\tprivate activeShell(): Box | Container {\n\t\tif (!this.shouldShowBody()) return this.contentBox;\n\t\treturn this.getRenderShell() === \"self\" ? this.selfRenderContainer : this.contentBox;\n\t}\n\n\t/** Swap the attached shell when the view changes which one applies. */\n\tprivate syncShellChild(): void {\n\t\tconst wanted = this.activeShell();\n\t\tconst other = wanted === this.contentBox ? this.selfRenderContainer : this.contentBox;\n\t\tif (this.children.includes(wanted)) return;\n\t\tthis.removeChild(other);\n\t\tother.clear();\n\t\tthis.addChild(wanted);\n\t}\n\n\tprivate updateDisplay(): void {\n\t\t// Frozen blocks are immutable snapshots with their source state released.\n\t\tif (this.frozen) return;\n\t\tlet hasContent = false;\n\t\tthis.hideComponent = false;\n\t\tthis.leadingSpacer.setLines(this.shouldShowSignalLine() ? 0 : 1);\n\t\tif (this.hasRendererDefinition()) {\n\t\t\tthis.syncShellChild();\n\t\t\tconst renderContainer = this.activeShell();\n\t\t\t// Boxless: no background fill on the container.\n\t\t\tif (renderContainer instanceof Box) {\n\t\t\t\trenderContainer.setBgFn(undefined);\n\t\t\t}\n\t\t\trenderContainer.clear();\n\n\t\t\t// Status dot prefix: green for complete success, yellow for pending/partial, red for error.\n\t\t\t// The dot is prepended to the first line of the call renderer so it stays inline\n\t\t\t// (adding it as a separate child would stack it on its own line).\n\t\t\tconst dotColor = this.result?.isError ? \"error\" : this.isPartial ? \"warning\" : \"success\";\n\t\t\t// No disclosure caret. It is a click-target idiom in a TUI with no\n\t\t\t// pointer, it cost two columns on every row for an action that could\n\t\t\t// only ever be reached by keyboard, and reading it as \"this row opens\"\n\t\t\t// set an expectation the view does not meet.\n\t\t\tconst dot = theme.fg(dotColor, \"● \");\n\n\t\t\t// Radar replaces the tool's own call renderer with the uniform signal\n\t\t\t// row, so a screen of mixed tools lines up into one readable map.\n\t\t\tif (this.shouldShowSignalLine()) {\n\t\t\t\trenderContainer.addChild(new PrefixFirstLine(dot, this.getSignalComponent()));\n\t\t\t\thasContent = true;\n\t\t\t} else {\n\t\t\t\tconst callRenderer = this.getCallRenderer();\n\t\t\t\tif (!callRenderer) {\n\t\t\t\t\trenderContainer.addChild(new PrefixFirstLine(dot, this.createCallFallback()));\n\t\t\t\t\thasContent = true;\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst component = callRenderer(this.args, theme, this.getRenderContext(this.callRendererComponent));\n\t\t\t\t\t\tthis.callRendererComponent = component;\n\t\t\t\t\t\trenderContainer.addChild(new PrefixFirstLine(dot, component));\n\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tthis.callRendererComponent = undefined;\n\t\t\t\t\t\trenderContainer.addChild(new PrefixFirstLine(dot, this.createCallFallback()));\n\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.result && this.shouldShowBody()) {\n\t\t\t\tconst resultRenderer = this.getResultRenderer();\n\t\t\t\tif (!resultRenderer) {\n\t\t\t\t\tconst component = this.createResultFallback();\n\t\t\t\t\tif (component) {\n\t\t\t\t\t\trenderContainer.addChild(this.indentUnderSignalRow(component));\n\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst component = resultRenderer(\n\t\t\t\t\t\t\t{ content: this.result.content as any, details: this.result.details },\n\t\t\t\t\t\t\t{ expanded: this.expanded, isPartial: this.isPartial },\n\t\t\t\t\t\t\ttheme,\n\t\t\t\t\t\t\tthis.getRenderContext(this.resultRendererComponent),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.resultRendererComponent = component;\n\t\t\t\t\t\trenderContainer.addChild(this.indentUnderSignalRow(component));\n\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tthis.resultRendererComponent = undefined;\n\t\t\t\t\t\tconst component = this.createResultFallback();\n\t\t\t\t\t\tif (component) {\n\t\t\t\t\t\t\trenderContainer.addChild(component);\n\t\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Boxless: no background fill.\n\t\t\tthis.contentText.setCustomBgFn(undefined);\n\t\t\tthis.contentText.setText(this.formatToolExecution());\n\t\t\thasContent = true;\n\t\t}\n\n\t\tfor (const img of this.imageComponents) {\n\t\t\tthis.removeChild(img);\n\t\t}\n\t\tthis.imageComponents = [];\n\t\tfor (const spacer of this.imageSpacers) {\n\t\t\tthis.removeChild(spacer);\n\t\t}\n\t\tthis.imageSpacers = [];\n\n\t\tif (this.result && !this.shouldShowSignalLine()) {\n\t\t\tconst imageBlocks = this.result.content.filter((c) => c.type === \"image\");\n\t\t\tconst caps = getCapabilities();\n\t\t\tfor (let i = 0; i < imageBlocks.length; i++) {\n\t\t\t\tconst img = imageBlocks[i];\n\t\t\t\tif (caps.images && this.showImages && img.data && img.mimeType) {\n\t\t\t\t\tconst converted = this.convertedImages.get(i);\n\t\t\t\t\tconst imageData = converted?.data ?? img.data;\n\t\t\t\t\tconst imageMimeType = converted?.mimeType ?? img.mimeType;\n\t\t\t\t\tif (caps.images === \"kitty\" && imageMimeType !== \"image/png\") continue;\n\n\t\t\t\t\tconst spacer = new Spacer(1);\n\t\t\t\t\tthis.addChild(spacer);\n\t\t\t\t\tthis.imageSpacers.push(spacer);\n\t\t\t\t\tconst imageComponent = new Image(\n\t\t\t\t\t\timageData,\n\t\t\t\t\t\timageMimeType,\n\t\t\t\t\t\t{ fallbackColor: (s: string) => theme.fg(\"toolOutput\", s) },\n\t\t\t\t\t\t{ maxWidthCells: this.imageWidthCells },\n\t\t\t\t\t);\n\t\t\t\t\tthis.imageComponents.push(imageComponent);\n\t\t\t\t\tthis.addChild(imageComponent);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.hasRendererDefinition() && !hasContent && this.imageComponents.length === 0) {\n\t\t\tthis.hideComponent = true;\n\t\t}\n\t}\n\n\tprivate getTextOutput(): string {\n\t\treturn getRenderedTextOutput(this.result, this.showImages);\n\t}\n\n\tprivate formatToolExecution(): string {\n\t\tconst dotColor = this.result?.isError ? \"error\" : this.isPartial ? \"warning\" : \"success\";\n\t\t// A tool with no renderer still gets a radar row, just without the\n\t\t// flush-right signal column (this path has no width to align against).\n\t\tif (this.shouldShowSignalLine()) {\n\t\t\tconst subject = toolSubject(this.args, this.cwd);\n\t\t\treturn (\n\t\t\t\ttheme.fg(dotColor, \"● \") +\n\t\t\t\ttheme.fg(\"toolTitle\", theme.bold(this.toolName)) +\n\t\t\t\t(subject ? ` ${theme.fg(\"toolOutput\", subject)}` : \"\")\n\t\t\t);\n\t\t}\n\t\tlet text = theme.fg(dotColor, \"● \") + theme.fg(\"toolTitle\", theme.bold(this.toolName));\n\t\tconst content = JSON.stringify(this.args, null, 2);\n\t\tif (content) {\n\t\t\ttext += `\\n\\n${content}`;\n\t\t}\n\t\tconst output = this.shouldShowBody() ? this.getTextOutput() : \"\";\n\t\tif (output) {\n\t\t\ttext += `\\n${output}`;\n\t\t}\n\t\treturn text;\n\t}\n}\n"]}
|
|
@@ -16,6 +16,8 @@ export interface ToolSignalInput {
|
|
|
16
16
|
};
|
|
17
17
|
isPartial: boolean;
|
|
18
18
|
showImages: boolean;
|
|
19
|
+
/** The newest call in the transcript. Themes that set `activeToolBg` mark it. */
|
|
20
|
+
isLatest?: boolean;
|
|
19
21
|
}
|
|
20
22
|
/**
|
|
21
23
|
* The flush-right signal: how much output came back, or why none did.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-signal.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-signal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAiC,MAAM,0BAA0B,CAAC;AAiEzF,4EAA4E;AAC5E,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAqB9D;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAA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BAAgB,oBAAoB,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAwBlF;AAED;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,SAAS;IACpD,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,IAAI,CAAC,CAAmC;IAEhD,YAAY,KAAK,EAAE,eAAe,EAEjC;IAED,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAGrC;IAED,UAAU,IAAI,IAAI,CAEjB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAK9B;CACD","sourcesContent":["import { type Component, truncateToWidth, visibleWidth } from \"@kolisachint/hoocode-tui\";\nimport { getTextOutput } from \"../../../core/tools/render-utils.js\";\nimport { getCwdRelativePath } from \"../../../utils/paths.js\";\nimport { theme } from \"../theme/theme.js\";\n\n/**\n * The \"radar\" view's one-line signal for a tool call.\n *\n * Radar answers a different question than the other two views. `glance` and\n * `full` show what a tool *said*; radar shows the *shape of the run* — the same\n * three columns for every tool, so a screen of them reads as a map:\n *\n * ● bash npm run check 412 lines\n * ● read packages/tui/src/keys.ts 1451 lines\n * ● grep toolOutputView 27 lines\n * ● edit src/core/keybindings.ts ok\n * ● find src/**.test.ts error\n *\n * Column 1 is the status dot the other views already use. Column 2 is the tool,\n * padded to a fixed width so the verbs line up and a run of reads is a visible\n * block. Column 3 is the call's subject. Flush right is the signal: how much\n * came back, which is what tells you whether a search actually found anything\n * without opening it.\n */\n\n/** Width of the tool-name column. Fits every built-in name (`websearch`, `TodoWrite`). */\nconst VERB_WIDTH = 9;\n\n/** Gap between the verb column and the subject. */\nconst VERB_GAP = 2;\n\n/** Minimum space kept for the flush-right signal before the subject is trimmed. */\nconst MIN_SIGNAL_GAP = 2;\n\n/**\n * Argument names that carry a call's subject, most specific first.\n *\n * Extensions and MCP servers bring their own argument names, so the list is a\n * preference order rather than a contract: anything unmatched falls back to the\n * first string-valued argument.\n */\nconst SUBJECT_KEYS = [\n\t\"command\",\n\t\"file_path\",\n\t// Before `path`: for grep/find the pattern is what identifies the call and\n\t// the path is only the scope it was run over.\n\t\"pattern\",\n\t\"query\",\n\t\"url\",\n\t\"path\",\n\t\"prompt\",\n\t\"description\",\n\t\"task_id\",\n\t\"subagent_type\",\n\t\"name\",\n\t\"id\",\n];\n\nfunction firstStringArg(args: Record<string, unknown>): string | undefined {\n\tfor (const value of Object.values(args)) {\n\t\tif (typeof value === \"string\" && value.trim()) return value;\n\t}\n\treturn undefined;\n}\n\n/** The single most identifying argument of a call, as a one-line string. */\nexport function toolSubject(args: unknown, cwd: string): string {\n\tif (typeof args !== \"object\" || args === null || Array.isArray(args)) return \"\";\n\n\tconst record = args as Record<string, unknown>;\n\tlet subject: string | undefined;\n\tfor (const key of SUBJECT_KEYS) {\n\t\tconst value = record[key];\n\t\tif (typeof value === \"string\" && value.trim()) {\n\t\t\tsubject = value;\n\t\t\tbreak;\n\t\t}\n\t}\n\tsubject ??= firstStringArg(record);\n\tif (!subject) return \"\";\n\n\t// Paths are the most common subject and the least readable in absolute form.\n\tconst relative = getCwdRelativePath(subject, cwd);\n\tconst display = relative && relative.length < subject.length ? relative : subject;\n\n\t// Multi-line commands (heredocs, chained scripts) collapse to their first line.\n\treturn display.replace(/\\s+/g, \" \").trim();\n}\n\nexport interface ToolSignalInput {\n\ttoolName: string;\n\targs: unknown;\n\tcwd: string;\n\tresult?: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string }>; isError: boolean };\n\tisPartial: boolean;\n\tshowImages: boolean;\n\t/** The newest call in the transcript. Themes that set `activeToolBg` mark it. */\n\tisLatest?: boolean;\n}\n\n/**\n * The flush-right signal: how much output came back, or why none did.\n *\n * Line count is the useful magnitude for nearly every tool here — it is what\n * separates a search that found one hit from one that found four hundred. A\n * result with no text (a successful `edit`, a `TodoWrite`) has no magnitude\n * worth printing, so it reports the outcome instead.\n */\nexport function toolSignal(input: ToolSignalInput): { text: string; color: \"success\" | \"error\" | \"warning\" } {\n\tif (!input.result) {\n\t\treturn { text: input.isPartial ? \"running\" : \"\", color: \"warning\" };\n\t}\n\tif (input.result.isError) {\n\t\treturn { text: \"error\", color: \"error\" };\n\t}\n\n\tconst output = getTextOutput(input.result, input.showImages);\n\tif (!output.trim()) {\n\t\treturn { text: \"ok\", color: \"success\" };\n\t}\n\n\tconst lines = output.split(\"\\n\").length;\n\treturn { text: `${lines} ${lines === 1 ? \"line\" : \"lines\"}`, color: \"success\" };\n}\n\n/**\n * Render one radar row, already padded and coloured, without the status dot —\n * the caller prepends that so the dot stays inline with the first line the same\n * way it does in the other two views.\n */\nexport function renderToolSignalLine(input: ToolSignalInput, width: number): string {\n\tconst name = input.toolName.slice(0, VERB_WIDTH);\n\tconst verb = name.padEnd(VERB_WIDTH + VERB_GAP, \" \");\n\tconst signal = toolSignal(input);\n\tconst subject = toolSubject(input.args, input.cwd);\n\n\t// `width` already excludes the caller's status-dot prefix.\n\tconst available = Math.max(0, width);\n\tconst signalWidth = signal.text ? visibleWidth(signal.text) + MIN_SIGNAL_GAP : 0;\n\tconst subjectWidth = Math.max(0, available - visibleWidth(verb) - signalWidth);\n\tconst shownSubject = subjectWidth > 0 ? truncateToWidth(subject, subjectWidth) : \"\";\n\n\tconst left = verb + shownSubject;\n\tconst pad = Math.max(signal.text ? MIN_SIGNAL_GAP : 0, available - visibleWidth(left) - visibleWidth(signal.text));\n\n\t// The marker stroke covers the verb and the subject — the part you read —\n\t// and stops before the flush-right signal, which keeps its status colour on\n\t// the page. A highlighter runs over the words, not the whole line.\n\tconst stroke = input.isLatest === true && theme.hasBg(\"activeToolBg\");\n\tconst content = theme.fg(\"toolTitle\", theme.bold(verb)) + theme.fg(\"toolOutput\", shownSubject);\n\n\treturn (\n\t\t(stroke ? theme.bg(\"activeToolBg\", content) : content) + \" \".repeat(pad) + theme.fg(signal.color, signal.text)\n\t);\n}\n\n/**\n * Component wrapper so a radar row slots into the same container the call\n * renderers use, and re-renders on resize like everything else.\n */\nexport class ToolSignalComponent implements Component {\n\tprivate input: ToolSignalInput;\n\tprivate memo?: { width: number; out: string[] };\n\n\tconstructor(input: ToolSignalInput) {\n\t\tthis.input = input;\n\t}\n\n\tsetInput(input: ToolSignalInput): void {\n\t\tthis.input = input;\n\t\tthis.memo = undefined;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.memo = undefined;\n\t}\n\n\trender(width: number): string[] {\n\t\tif (this.memo && this.memo.width === width) return this.memo.out;\n\t\tconst out = [renderToolSignalLine(this.input, width)];\n\t\tthis.memo = { width, out };\n\t\treturn out;\n\t}\n}\n"]}
|
|
@@ -118,10 +118,12 @@ export function renderToolSignalLine(input, width) {
|
|
|
118
118
|
const shownSubject = subjectWidth > 0 ? truncateToWidth(subject, subjectWidth) : "";
|
|
119
119
|
const left = verb + shownSubject;
|
|
120
120
|
const pad = Math.max(signal.text ? MIN_SIGNAL_GAP : 0, available - visibleWidth(left) - visibleWidth(signal.text));
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
// The marker stroke covers the verb and the subject — the part you read —
|
|
122
|
+
// and stops before the flush-right signal, which keeps its status colour on
|
|
123
|
+
// the page. A highlighter runs over the words, not the whole line.
|
|
124
|
+
const stroke = input.isLatest === true && theme.hasBg("activeToolBg");
|
|
125
|
+
const content = theme.fg("toolTitle", theme.bold(verb)) + theme.fg("toolOutput", shownSubject);
|
|
126
|
+
return ((stroke ? theme.bg("activeToolBg", content) : content) + " ".repeat(pad) + theme.fg(signal.color, signal.text));
|
|
125
127
|
}
|
|
126
128
|
/**
|
|
127
129
|
* Component wrapper so a radar row slots into the same container the call
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-signal.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-signal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,q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AAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAEnH,OAAO,CACN,KAAK,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,KAAK,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;QACpC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC;QACf,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CACnC,CAAC;AAAA,CACF;AAED;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IACvB,KAAK,CAAkB;IACvB,IAAI,CAAoC;IAEhD,YAAY,KAAsB,EAAE;QACnC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IAAA,CACnB;IAED,QAAQ,CAAC,KAAsB,EAAQ;QACtC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IAAA,CACtB;IAED,UAAU,GAAS;QAClB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IAAA,CACtB;IAED,MAAM,CAAC,KAAa,EAAY;QAC/B,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,KAAK;YAAE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QACjE,MAAM,GAAG,GAAG,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;QAC3B,OAAO,GAAG,CAAC;IAAA,CACX;CACD","sourcesContent":["import { type Component, truncateToWidth, visibleWidth } from \"@kolisachint/hoocode-tui\";\nimport { getTextOutput } from \"../../../core/tools/render-utils.js\";\nimport { getCwdRelativePath } from \"../../../utils/paths.js\";\nimport { theme } from \"../theme/theme.js\";\n\n/**\n * The \"radar\" view's one-line signal for a tool call.\n *\n * Radar answers a different question than the other two views. `glance` and\n * `full` show what a tool *said*; radar shows the *shape of the run* — the same\n * three columns for every tool, so a screen of them reads as a map:\n *\n * ● bash npm run check 412 lines\n * ● read packages/tui/src/keys.ts 1451 lines\n * ● grep toolOutputView 27 lines\n * ● edit src/core/keybindings.ts ok\n * ● find src/**.test.ts error\n *\n * Column 1 is the status dot the other views already use. Column 2 is the tool,\n * padded to a fixed width so the verbs line up and a run of reads is a visible\n * block. Column 3 is the call's subject. Flush right is the signal: how much\n * came back, which is what tells you whether a search actually found anything\n * without opening it.\n */\n\n/** Width of the tool-name column. Fits every built-in name (`websearch`, `TodoWrite`). */\nconst VERB_WIDTH = 9;\n\n/** Gap between the verb column and the subject. */\nconst VERB_GAP = 2;\n\n/** Minimum space kept for the flush-right signal before the subject is trimmed. */\nconst MIN_SIGNAL_GAP = 2;\n\n/**\n * Argument names that carry a call's subject, most specific first.\n *\n * Extensions and MCP servers bring their own argument names, so the list is a\n * preference order rather than a contract: anything unmatched falls back to the\n * first string-valued argument.\n */\nconst SUBJECT_KEYS = [\n\t\"command\",\n\t\"file_path\",\n\t// Before `path`: for grep/find the pattern is what identifies the call and\n\t// the path is only the scope it was run over.\n\t\"pattern\",\n\t\"query\",\n\t\"url\",\n\t\"path\",\n\t\"prompt\",\n\t\"description\",\n\t\"task_id\",\n\t\"subagent_type\",\n\t\"name\",\n\t\"id\",\n];\n\nfunction firstStringArg(args: Record<string, unknown>): string | undefined {\n\tfor (const value of Object.values(args)) {\n\t\tif (typeof value === \"string\" && value.trim()) return value;\n\t}\n\treturn undefined;\n}\n\n/** The single most identifying argument of a call, as a one-line string. */\nexport function toolSubject(args: unknown, cwd: string): string {\n\tif (typeof args !== \"object\" || args === null || Array.isArray(args)) return \"\";\n\n\tconst record = args as Record<string, unknown>;\n\tlet subject: string | undefined;\n\tfor (const key of SUBJECT_KEYS) {\n\t\tconst value = record[key];\n\t\tif (typeof value === \"string\" && value.trim()) {\n\t\t\tsubject = value;\n\t\t\tbreak;\n\t\t}\n\t}\n\tsubject ??= firstStringArg(record);\n\tif (!subject) return \"\";\n\n\t// Paths are the most common subject and the least readable in absolute form.\n\tconst relative = getCwdRelativePath(subject, cwd);\n\tconst display = relative && relative.length < subject.length ? relative : subject;\n\n\t// Multi-line commands (heredocs, chained scripts) collapse to their first line.\n\treturn display.replace(/\\s+/g, \" \").trim();\n}\n\nexport interface ToolSignalInput {\n\ttoolName: string;\n\targs: unknown;\n\tcwd: string;\n\tresult?: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string }>; isError: boolean };\n\tisPartial: boolean;\n\tshowImages: boolean;\n}\n\n/**\n * The flush-right signal: how much output came back, or why none did.\n *\n * Line count is the useful magnitude for nearly every tool here — it is what\n * separates a search that found one hit from one that found four hundred. A\n * result with no text (a successful `edit`, a `TodoWrite`) has no magnitude\n * worth printing, so it reports the outcome instead.\n */\nexport function toolSignal(input: ToolSignalInput): { text: string; color: \"success\" | \"error\" | \"warning\" } {\n\tif (!input.result) {\n\t\treturn { text: input.isPartial ? \"running\" : \"\", color: \"warning\" };\n\t}\n\tif (input.result.isError) {\n\t\treturn { text: \"error\", color: \"error\" };\n\t}\n\n\tconst output = getTextOutput(input.result, input.showImages);\n\tif (!output.trim()) {\n\t\treturn { text: \"ok\", color: \"success\" };\n\t}\n\n\tconst lines = output.split(\"\\n\").length;\n\treturn { text: `${lines} ${lines === 1 ? \"line\" : \"lines\"}`, color: \"success\" };\n}\n\n/**\n * Render one radar row, already padded and coloured, without the status dot —\n * the caller prepends that so the dot stays inline with the first line the same\n * way it does in the other two views.\n */\nexport function renderToolSignalLine(input: ToolSignalInput, width: number): string {\n\tconst name = input.toolName.slice(0, VERB_WIDTH);\n\tconst verb = name.padEnd(VERB_WIDTH + VERB_GAP, \" \");\n\tconst signal = toolSignal(input);\n\tconst subject = toolSubject(input.args, input.cwd);\n\n\t// `width` already excludes the caller's status-dot prefix.\n\tconst available = Math.max(0, width);\n\tconst signalWidth = signal.text ? visibleWidth(signal.text) + MIN_SIGNAL_GAP : 0;\n\tconst subjectWidth = Math.max(0, available - visibleWidth(verb) - signalWidth);\n\tconst shownSubject = subjectWidth > 0 ? truncateToWidth(subject, subjectWidth) : \"\";\n\n\tconst left = verb + shownSubject;\n\tconst pad = Math.max(signal.text ? MIN_SIGNAL_GAP : 0, available - visibleWidth(left) - visibleWidth(signal.text));\n\n\treturn (\n\t\ttheme.fg(\"toolTitle\", theme.bold(verb)) +\n\t\ttheme.fg(\"toolOutput\", shownSubject) +\n\t\t\" \".repeat(pad) +\n\t\ttheme.fg(signal.color, signal.text)\n\t);\n}\n\n/**\n * Component wrapper so a radar row slots into the same container the call\n * renderers use, and re-renders on resize like everything else.\n */\nexport class ToolSignalComponent implements Component {\n\tprivate input: ToolSignalInput;\n\tprivate memo?: { width: number; out: string[] };\n\n\tconstructor(input: ToolSignalInput) {\n\t\tthis.input = input;\n\t}\n\n\tsetInput(input: ToolSignalInput): void {\n\t\tthis.input = input;\n\t\tthis.memo = undefined;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.memo = undefined;\n\t}\n\n\trender(width: number): string[] {\n\t\tif (this.memo && this.memo.width === width) return this.memo.out;\n\t\tconst out = [renderToolSignalLine(this.input, width)];\n\t\tthis.memo = { width, out };\n\t\treturn out;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tool-signal.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-signal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;;;;;;;;;;;;;;;;;GAkBG;AAEH,0FAA0F;AAC1F,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB,mDAAmD;AACnD,MAA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AAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IAE/F,OAAO,CACN,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAC9G,CAAC;AAAA,CACF;AAED;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IACvB,KAAK,CAAkB;IACvB,IAAI,CAAoC;IAEhD,YAAY,KAAsB,EAAE;QACnC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IAAA,CACnB;IAED,QAAQ,CAAC,KAAsB,EAAQ;QACtC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IAAA,CACtB;IAED,UAAU,GAAS;QAClB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IAAA,CACtB;IAED,MAAM,CAAC,KAAa,EAAY;QAC/B,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,KAAK;YAAE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QACjE,MAAM,GAAG,GAAG,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;QAC3B,OAAO,GAAG,CAAC;IAAA,CACX;CACD","sourcesContent":["import { type Component, truncateToWidth, visibleWidth } from \"@kolisachint/hoocode-tui\";\nimport { getTextOutput } from \"../../../core/tools/render-utils.js\";\nimport { getCwdRelativePath } from \"../../../utils/paths.js\";\nimport { theme } from \"../theme/theme.js\";\n\n/**\n * The \"radar\" view's one-line signal for a tool call.\n *\n * Radar answers a different question than the other two views. `glance` and\n * `full` show what a tool *said*; radar shows the *shape of the run* — the same\n * three columns for every tool, so a screen of them reads as a map:\n *\n * ● bash npm run check 412 lines\n * ● read packages/tui/src/keys.ts 1451 lines\n * ● grep toolOutputView 27 lines\n * ● edit src/core/keybindings.ts ok\n * ● find src/**.test.ts error\n *\n * Column 1 is the status dot the other views already use. Column 2 is the tool,\n * padded to a fixed width so the verbs line up and a run of reads is a visible\n * block. Column 3 is the call's subject. Flush right is the signal: how much\n * came back, which is what tells you whether a search actually found anything\n * without opening it.\n */\n\n/** Width of the tool-name column. Fits every built-in name (`websearch`, `TodoWrite`). */\nconst VERB_WIDTH = 9;\n\n/** Gap between the verb column and the subject. */\nconst VERB_GAP = 2;\n\n/** Minimum space kept for the flush-right signal before the subject is trimmed. */\nconst MIN_SIGNAL_GAP = 2;\n\n/**\n * Argument names that carry a call's subject, most specific first.\n *\n * Extensions and MCP servers bring their own argument names, so the list is a\n * preference order rather than a contract: anything unmatched falls back to the\n * first string-valued argument.\n */\nconst SUBJECT_KEYS = [\n\t\"command\",\n\t\"file_path\",\n\t// Before `path`: for grep/find the pattern is what identifies the call and\n\t// the path is only the scope it was run over.\n\t\"pattern\",\n\t\"query\",\n\t\"url\",\n\t\"path\",\n\t\"prompt\",\n\t\"description\",\n\t\"task_id\",\n\t\"subagent_type\",\n\t\"name\",\n\t\"id\",\n];\n\nfunction firstStringArg(args: Record<string, unknown>): string | undefined {\n\tfor (const value of Object.values(args)) {\n\t\tif (typeof value === \"string\" && value.trim()) return value;\n\t}\n\treturn undefined;\n}\n\n/** The single most identifying argument of a call, as a one-line string. */\nexport function toolSubject(args: unknown, cwd: string): string {\n\tif (typeof args !== \"object\" || args === null || Array.isArray(args)) return \"\";\n\n\tconst record = args as Record<string, unknown>;\n\tlet subject: string | undefined;\n\tfor (const key of SUBJECT_KEYS) {\n\t\tconst value = record[key];\n\t\tif (typeof value === \"string\" && value.trim()) {\n\t\t\tsubject = value;\n\t\t\tbreak;\n\t\t}\n\t}\n\tsubject ??= firstStringArg(record);\n\tif (!subject) return \"\";\n\n\t// Paths are the most common subject and the least readable in absolute form.\n\tconst relative = getCwdRelativePath(subject, cwd);\n\tconst display = relative && relative.length < subject.length ? relative : subject;\n\n\t// Multi-line commands (heredocs, chained scripts) collapse to their first line.\n\treturn display.replace(/\\s+/g, \" \").trim();\n}\n\nexport interface ToolSignalInput {\n\ttoolName: string;\n\targs: unknown;\n\tcwd: string;\n\tresult?: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string }>; isError: boolean };\n\tisPartial: boolean;\n\tshowImages: boolean;\n\t/** The newest call in the transcript. Themes that set `activeToolBg` mark it. */\n\tisLatest?: boolean;\n}\n\n/**\n * The flush-right signal: how much output came back, or why none did.\n *\n * Line count is the useful magnitude for nearly every tool here — it is what\n * separates a search that found one hit from one that found four hundred. A\n * result with no text (a successful `edit`, a `TodoWrite`) has no magnitude\n * worth printing, so it reports the outcome instead.\n */\nexport function toolSignal(input: ToolSignalInput): { text: string; color: \"success\" | \"error\" | \"warning\" } {\n\tif (!input.result) {\n\t\treturn { text: input.isPartial ? \"running\" : \"\", color: \"warning\" };\n\t}\n\tif (input.result.isError) {\n\t\treturn { text: \"error\", color: \"error\" };\n\t}\n\n\tconst output = getTextOutput(input.result, input.showImages);\n\tif (!output.trim()) {\n\t\treturn { text: \"ok\", color: \"success\" };\n\t}\n\n\tconst lines = output.split(\"\\n\").length;\n\treturn { text: `${lines} ${lines === 1 ? \"line\" : \"lines\"}`, color: \"success\" };\n}\n\n/**\n * Render one radar row, already padded and coloured, without the status dot —\n * the caller prepends that so the dot stays inline with the first line the same\n * way it does in the other two views.\n */\nexport function renderToolSignalLine(input: ToolSignalInput, width: number): string {\n\tconst name = input.toolName.slice(0, VERB_WIDTH);\n\tconst verb = name.padEnd(VERB_WIDTH + VERB_GAP, \" \");\n\tconst signal = toolSignal(input);\n\tconst subject = toolSubject(input.args, input.cwd);\n\n\t// `width` already excludes the caller's status-dot prefix.\n\tconst available = Math.max(0, width);\n\tconst signalWidth = signal.text ? visibleWidth(signal.text) + MIN_SIGNAL_GAP : 0;\n\tconst subjectWidth = Math.max(0, available - visibleWidth(verb) - signalWidth);\n\tconst shownSubject = subjectWidth > 0 ? truncateToWidth(subject, subjectWidth) : \"\";\n\n\tconst left = verb + shownSubject;\n\tconst pad = Math.max(signal.text ? MIN_SIGNAL_GAP : 0, available - visibleWidth(left) - visibleWidth(signal.text));\n\n\t// The marker stroke covers the verb and the subject — the part you read —\n\t// and stops before the flush-right signal, which keeps its status colour on\n\t// the page. A highlighter runs over the words, not the whole line.\n\tconst stroke = input.isLatest === true && theme.hasBg(\"activeToolBg\");\n\tconst content = theme.fg(\"toolTitle\", theme.bold(verb)) + theme.fg(\"toolOutput\", shownSubject);\n\n\treturn (\n\t\t(stroke ? theme.bg(\"activeToolBg\", content) : content) + \" \".repeat(pad) + theme.fg(signal.color, signal.text)\n\t);\n}\n\n/**\n * Component wrapper so a radar row slots into the same container the call\n * renderers use, and re-renders on resize like everything else.\n */\nexport class ToolSignalComponent implements Component {\n\tprivate input: ToolSignalInput;\n\tprivate memo?: { width: number; out: string[] };\n\n\tconstructor(input: ToolSignalInput) {\n\t\tthis.input = input;\n\t}\n\n\tsetInput(input: ToolSignalInput): void {\n\t\tthis.input = input;\n\t\tthis.memo = undefined;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.memo = undefined;\n\t}\n\n\trender(width: number): string[] {\n\t\tif (this.memo && this.memo.width === width) return this.memo.out;\n\t\tconst out = [renderToolSignalLine(this.input, width)];\n\t\tthis.memo = { width, out };\n\t\treturn out;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-message.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/user-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAY,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAOxF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;IAClD,OAAO,CAAC,UAAU,CAAM;IAExB,YAAY,IAAI,EAAE,MAAM,EAAE,aAAa,GAAE,aAAkC,EAU1E;IAED;;8DAE0D;IAC1D,OAAO,CAAC,QAAQ,CAAC,CAAmC;IAE3C,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAcvC;CACD","sourcesContent":["import { Box, Container, Markdown, type MarkdownTheme } from \"@kolisachint/hoocode-tui\";\nimport {
|
|
1
|
+
{"version":3,"file":"user-message.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/user-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAY,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAOxF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;IAClD,OAAO,CAAC,UAAU,CAAM;IAExB,YAAY,IAAI,EAAE,MAAM,EAAE,aAAa,GAAE,aAAkC,EAU1E;IAED;;8DAE0D;IAC1D,OAAO,CAAC,QAAQ,CAAC,CAAmC;IAE3C,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAcvC;CACD","sourcesContent":["import { Box, Container, Markdown, type MarkdownTheme } from \"@kolisachint/hoocode-tui\";\nimport { applyPaperSheet, getMarkdownTheme, theme } from \"../theme/theme.js\";\n\nconst OSC133_ZONE_START = \"\\x1b]133;A\\x07\";\nconst OSC133_ZONE_END = \"\\x1b]133;B\\x07\";\nconst OSC133_ZONE_FINAL = \"\\x1b]133;C\\x07\";\n\n/**\n * Component that renders a user message\n */\nexport class UserMessageComponent extends Container {\n\tprivate contentBox: Box;\n\n\tconstructor(text: string, markdownTheme: MarkdownTheme = getMarkdownTheme()) {\n\t\tsuper();\n\t\tthis.contentBox = new Box(1, 1, (content: string) => theme.bg(\"userMessageBg\", content));\n\t\tapplyPaperSheet(this.contentBox);\n\t\tthis.contentBox.addChild(\n\t\t\tnew Markdown(text, 0, 0, markdownTheme, {\n\t\t\t\tcolor: (content: string) => theme.fg(\"userMessageText\", content),\n\t\t\t}),\n\t\t);\n\t\tthis.addChild(this.contentBox);\n\t}\n\n\t/** OSC-zone wrap memo: Container.render returns the same array across\n\t * frames when nothing changed, so it must not be mutated — the wrapped\n\t * copy is cached keyed on the source array's identity. */\n\tprivate zoneMemo?: { src: string[]; out: string[] };\n\n\toverride render(width: number): string[] {\n\t\tconst lines = super.render(width);\n\t\tif (lines.length === 0) {\n\t\t\treturn lines;\n\t\t}\n\n\t\tif (this.zoneMemo?.src === lines) {\n\t\t\treturn this.zoneMemo.out;\n\t\t}\n\t\tconst out = lines.slice();\n\t\tout[0] = OSC133_ZONE_START + out[0];\n\t\tout[out.length - 1] = OSC133_ZONE_END + OSC133_ZONE_FINAL + out[out.length - 1];\n\t\tthis.zoneMemo = { src: lines, out };\n\t\treturn out;\n\t}\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box, Container, Markdown } from "@kolisachint/hoocode-tui";
|
|
2
|
-
import {
|
|
2
|
+
import { applyPaperSheet, getMarkdownTheme, theme } from "../theme/theme.js";
|
|
3
3
|
const OSC133_ZONE_START = "\x1b]133;A\x07";
|
|
4
4
|
const OSC133_ZONE_END = "\x1b]133;B\x07";
|
|
5
5
|
const OSC133_ZONE_FINAL = "\x1b]133;C\x07";
|
|
@@ -11,7 +11,7 @@ export class UserMessageComponent extends Container {
|
|
|
11
11
|
constructor(text, markdownTheme = getMarkdownTheme()) {
|
|
12
12
|
super();
|
|
13
13
|
this.contentBox = new Box(1, 1, (content) => theme.bg("userMessageBg", content));
|
|
14
|
-
this.contentBox
|
|
14
|
+
applyPaperSheet(this.contentBox);
|
|
15
15
|
this.contentBox.addChild(new Markdown(text, 0, 0, markdownTheme, {
|
|
16
16
|
color: (content) => theme.fg("userMessageText", content),
|
|
17
17
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-message.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/user-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAsB,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"user-message.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/user-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAsB,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE7E,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAC3C,MAAM,eAAe,GAAG,gBAAgB,CAAC;AACzC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAC1C,UAAU,CAAM;IAExB,YAAY,IAAY,EAAE,aAAa,GAAkB,gBAAgB,EAAE,EAAE;QAC5E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;QACzF,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACjC,IAAI,CAAC,UAAU,CAAC,QAAQ,CACvB,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE;YACvC,KAAK,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,iBAAiB,EAAE,OAAO,CAAC;SAChE,CAAC,CACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAAA,CAC/B;IAED;;8DAE0D;IAClD,QAAQ,CAAoC;IAE3C,MAAM,CAAC,KAAa,EAAY;QACxC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,KAAK,CAAC;QACd,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,EAAE,GAAG,KAAK,KAAK,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC1B,CAAC;QACD,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;QAC1B,GAAG,CAAC,CAAC,CAAC,GAAG,iBAAiB,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACpC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,eAAe,GAAG,iBAAiB,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAChF,IAAI,CAAC,QAAQ,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;QACpC,OAAO,GAAG,CAAC;IAAA,CACX;CACD","sourcesContent":["import { Box, Container, Markdown, type MarkdownTheme } from \"@kolisachint/hoocode-tui\";\nimport { applyPaperSheet, getMarkdownTheme, theme } from \"../theme/theme.js\";\n\nconst OSC133_ZONE_START = \"\\x1b]133;A\\x07\";\nconst OSC133_ZONE_END = \"\\x1b]133;B\\x07\";\nconst OSC133_ZONE_FINAL = \"\\x1b]133;C\\x07\";\n\n/**\n * Component that renders a user message\n */\nexport class UserMessageComponent extends Container {\n\tprivate contentBox: Box;\n\n\tconstructor(text: string, markdownTheme: MarkdownTheme = getMarkdownTheme()) {\n\t\tsuper();\n\t\tthis.contentBox = new Box(1, 1, (content: string) => theme.bg(\"userMessageBg\", content));\n\t\tapplyPaperSheet(this.contentBox);\n\t\tthis.contentBox.addChild(\n\t\t\tnew Markdown(text, 0, 0, markdownTheme, {\n\t\t\t\tcolor: (content: string) => theme.fg(\"userMessageText\", content),\n\t\t\t}),\n\t\t);\n\t\tthis.addChild(this.contentBox);\n\t}\n\n\t/** OSC-zone wrap memo: Container.render returns the same array across\n\t * frames when nothing changed, so it must not be mutated — the wrapped\n\t * copy is cached keyed on the source array's identity. */\n\tprivate zoneMemo?: { src: string[]; out: string[] };\n\n\toverride render(width: number): string[] {\n\t\tconst lines = super.render(width);\n\t\tif (lines.length === 0) {\n\t\t\treturn lines;\n\t\t}\n\n\t\tif (this.zoneMemo?.src === lines) {\n\t\t\treturn this.zoneMemo.out;\n\t\t}\n\t\tconst out = lines.slice();\n\t\tout[0] = OSC133_ZONE_START + out[0];\n\t\tout[out.length - 1] = OSC133_ZONE_END + OSC133_ZONE_FINAL + out[out.length - 1];\n\t\tthis.zoneMemo = { src: lines, out };\n\t\treturn out;\n\t}\n}\n"]}
|
|
@@ -66,6 +66,10 @@ export declare class InteractiveMode {
|
|
|
66
66
|
private toolOutputExpanded;
|
|
67
67
|
private toolOutputView;
|
|
68
68
|
private openChain?;
|
|
69
|
+
/** The newest tool block in the transcript; radar marks it. */
|
|
70
|
+
private latestToolBlock?;
|
|
71
|
+
/** The run that block belongs to; radar marks its folded line too. */
|
|
72
|
+
private latestChain?;
|
|
69
73
|
private sawTextInCurrentMessage;
|
|
70
74
|
private hideThinkingBlock;
|
|
71
75
|
private skillCommands;
|