@kolisachint/hoocode-agent 0.5.55 → 0.5.57
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 +44 -0
- package/dist/core/keybindings.d.ts +12 -12
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +17 -16
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/session-identity.d.ts +11 -0
- package/dist/core/session-identity.d.ts.map +1 -1
- package/dist/core/session-identity.js +16 -0
- package/dist/core/session-identity.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +1 -1
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +1 -1
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-types.d.ts +1 -1
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/tool-output-view.d.ts +28 -10
- package/dist/core/tool-output-view.d.ts.map +1 -1
- package/dist/core/tool-output-view.js +24 -9
- package/dist/core/tool-output-view.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +2 -2
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/plugins.d.ts.map +1 -1
- package/dist/core/tools/plugins.js +2 -1
- package/dist/core/tools/plugins.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +2 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/search.d.ts.map +1 -1
- package/dist/core/tools/search.js +2 -1
- package/dist/core/tools/search.js.map +1 -1
- package/dist/core/tools/webfetch.d.ts.map +1 -1
- package/dist/core/tools/webfetch.js +2 -1
- package/dist/core/tools/webfetch.js.map +1 -1
- package/dist/core/tools/websearch.d.ts.map +1 -1
- package/dist/core/tools/websearch.js +2 -1
- package/dist/core/tools/websearch.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +2 -1
- package/dist/core/tools/write.js.map +1 -1
- package/dist/modes/interactive/command-executor.d.ts.map +1 -1
- package/dist/modes/interactive/command-executor.js +5 -5
- package/dist/modes/interactive/command-executor.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +3 -2
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +1 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-chain-summary.d.ts +2 -1
- package/dist/modes/interactive/components/tool-chain-summary.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-chain-summary.js +2 -1
- package/dist/modes/interactive/components/tool-chain-summary.js.map +1 -1
- package/dist/modes/interactive/components/tool-chain.d.ts +2 -9
- package/dist/modes/interactive/components/tool-chain.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-chain.js +3 -20
- package/dist/modes/interactive/components/tool-chain.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +16 -20
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +38 -37
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-signal.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-signal.js +1 -1
- package/dist/modes/interactive/components/tool-signal.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +39 -20
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +77 -69
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/keybindings.md +5 -1
- 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-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,mGAAiG;AACjG,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,mDAAmD;AACnD,MAAM,QAAQ,GAAG,CAAC,CAAC;AAEnB,mFAAmF;AACnF,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB;;;;;;GAMG;AACH,MAAM,YAAY,GAAG;IACpB,SAAS;IACT,WAAW;IACX,2EAA2E;IAC3E,8CAA8C;IAC9C,SAAS;IACT,OAAO;IACP,KAAK;IACL,MAAM;IACN,QAAQ;IACR,aAAa;IACb,SAAS;IACT,eAAe;IACf,MAAM;IACN,IAAI;CACJ,CAAC;AAEF,SAAS,cAAc,CAAC,IAA6B,EAAsB;IAC1E,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE;YAAE,OAAO,KAAK,CAAC;IAC7D,CAAC;IACD,OAAO,SAAS,CAAC;AAAA,CACjB;AAED,4EAA4E;AAC5E,MAAM,UAAU,WAAW,CAAC,IAAa,EAAE,GAAW,EAAU;IAC/D,IAAI,OAAO,IAAI,KAAK,Q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S,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 * ● SearchCodebase toolOutputView 27 lines\n * ● edit src/core/keybindings.ts ok\n * ● websearch release notes 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 — `SearchCodebase` is the longest. */\nconst VERB_WIDTH = 14;\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
|
+
{"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,mGAAiG;AACjG,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,mDAAmD;AACnD,MAAM,QAAQ,GAAG,CAAC,CAAC;AAEnB,mFAAmF;AACnF,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB;;;;;;GAMG;AACH,MAAM,YAAY,GAAG;IACpB,SAAS;IACT,WAAW;IACX,2EAA2E;IAC3E,8CAA8C;IAC9C,SAAS;IACT,OAAO;IACP,KAAK;IACL,MAAM;IACN,QAAQ;IACR,aAAa;IACb,SAAS;IACT,eAAe;IACf,MAAM;IACN,IAAI;CACJ,CAAC;AAEF,SAAS,cAAc,CAAC,IAA6B,EAAsB;IAC1E,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC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;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. `peek` 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 * ● SearchCodebase toolOutputView 27 lines\n * ● edit src/core/keybindings.ts ok\n * ● websearch release notes 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 — `SearchCodebase` is the longest. */\nconst VERB_WIDTH = 14;\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"]}
|
|
@@ -63,8 +63,16 @@ export declare class InteractiveMode {
|
|
|
63
63
|
* updateContent on message_end flushes the final state regardless. */
|
|
64
64
|
private readonly scheduleStreamingRender;
|
|
65
65
|
private pendingTools;
|
|
66
|
-
private toolOutputExpanded;
|
|
67
66
|
private toolOutputView;
|
|
67
|
+
private viewBeforeJump?;
|
|
68
|
+
/**
|
|
69
|
+
* Whether everything foldable is currently open.
|
|
70
|
+
*
|
|
71
|
+
* Not a state of its own any more — it is the top of the view dial. The
|
|
72
|
+
* header, compaction and branch summaries and skill blocks follow the dial
|
|
73
|
+
* for the same reason tool bodies do: `full` means nothing is held back.
|
|
74
|
+
*/
|
|
75
|
+
private get toolOutputExpanded();
|
|
68
76
|
private openChain?;
|
|
69
77
|
/** The newest tool block in the transcript; radar marks it. */
|
|
70
78
|
private latestToolBlock?;
|
|
@@ -333,31 +341,26 @@ export declare class InteractiveMode {
|
|
|
333
341
|
private closeOpenChain;
|
|
334
342
|
/** Every tool block in the transcript, in order, across all chains. */
|
|
335
343
|
private transcriptToolBlocks;
|
|
336
|
-
/** Every chain in the transcript, in order. */
|
|
337
|
-
private transcriptChains;
|
|
338
|
-
private toggleToolOutputExpansion;
|
|
339
344
|
/**
|
|
340
|
-
*
|
|
345
|
+
* Jump to the full view, or back to where the jump started.
|
|
341
346
|
*
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
347
|
+
* The dial's top stop is the whole result with nothing trimmed, which is what
|
|
348
|
+
* "expand" always meant — so expand is not a second state layered over the
|
|
349
|
+
* dial any more, it is a jump along it. From any stop the first press lands
|
|
350
|
+
* on `full`; the next press returns to the stop you came from (`peek` if the
|
|
351
|
+
* jump started there, so the key is never a no-op).
|
|
346
352
|
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
* scrolling — anything far enough up is in the terminal's own scrollback,
|
|
350
|
-
* where this process cannot put a cursor or scroll to a selection. So the
|
|
351
|
-
* key peels backwards through what is actually on screen, and each block it
|
|
352
|
-
* opens is its own marker for where you have got to.
|
|
353
|
+
* Only `app.view.cycleForward` writes the setting. This key deliberately does
|
|
354
|
+
* not: the dial is the decision you keep, the jump is the look you take.
|
|
353
355
|
*/
|
|
354
|
-
private
|
|
356
|
+
private jumpToFullView;
|
|
355
357
|
/**
|
|
356
|
-
* Move the view dial one stop
|
|
358
|
+
* Move the view dial one stop; the footer shows where it landed.
|
|
357
359
|
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
360
|
+
* This is the persistent decision ("how much do I ever want to see"), which
|
|
361
|
+
* is why it saves. `app.tools.expand` jumps along the same dial without
|
|
362
|
+
* saving, which is what keeps "the look I am taking now" from overwriting
|
|
363
|
+
* "the view I live in".
|
|
361
364
|
*/
|
|
362
365
|
private cycleToolOutputView;
|
|
363
366
|
/**
|
|
@@ -380,8 +383,24 @@ export declare class InteractiveMode {
|
|
|
380
383
|
*/
|
|
381
384
|
private thinkingDisplayForView;
|
|
382
385
|
private applyToolOutputView;
|
|
386
|
+
/**
|
|
387
|
+
* Open or close everything that folds but is not a tool call — the header,
|
|
388
|
+
* compaction and branch summaries, skill blocks. Tool blocks and chains are
|
|
389
|
+
* not in this sweep: they take the view dial directly.
|
|
390
|
+
*/
|
|
383
391
|
private setToolsExpanded;
|
|
384
392
|
private cycleAgentMode;
|
|
393
|
+
/**
|
|
394
|
+
* Step the session chip to the next colour slot, no picker involved.
|
|
395
|
+
*
|
|
396
|
+
* The picker exists for choosing a colour; this exists for telling two
|
|
397
|
+
* terminals apart, which is a different job — you press the key until the two
|
|
398
|
+
* chips stop looking alike, and the chip repaints on each press because
|
|
399
|
+
* setSessionColor writes the slot and the session_info event refreshes the
|
|
400
|
+
* identity. The status line names the slot as well, since the point of the
|
|
401
|
+
* names is that `/color <name>` takes them.
|
|
402
|
+
*/
|
|
403
|
+
private cycleSessionColor;
|
|
385
404
|
private toggleThinkingBlockVisibility;
|
|
386
405
|
private openExternalEditor;
|
|
387
406
|
clearEditor(): void;
|