@draht/coding-agent 2026.11.5 → 2026.11.14
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 +66 -0
- package/dist/bundle/chunks/anthropic-messages-FKSSTO6N.js +6 -0
- package/dist/bundle/chunks/{azure-openai-responses-5YLWRJ4E.js → azure-openai-responses-AHIW4IRP.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
- package/dist/bundle/chunks/chunk-2CHTECAU.js +2 -0
- package/dist/bundle/chunks/{chunk-SPVE2GM7.js → chunk-46NQOOTO.js} +1 -1
- package/dist/bundle/chunks/{chunk-MKVW4KK2.js → chunk-4ALYWMDD.js} +1 -1
- package/dist/bundle/chunks/{chunk-EXZUXBS5.js → chunk-5K3TBDND.js} +12 -15
- package/dist/bundle/chunks/{chunk-PRT3JHOZ.js → chunk-DFFQ5ETM.js} +1 -1
- package/dist/bundle/chunks/chunk-EBTEI43G.js +20 -0
- package/dist/bundle/chunks/{chunk-LJ3SEGWI.js → chunk-G7DJ6PIU.js} +5 -1
- package/dist/bundle/chunks/{chunk-3LFBXSCO.js → chunk-GR3JEDCL.js} +1 -1
- package/dist/bundle/chunks/{chunk-JAT7HEFU.js → chunk-HIL6BIBX.js} +2 -2
- package/dist/bundle/chunks/{chunk-PZKD35UB.js → chunk-MXA4WY3C.js} +1 -1
- package/dist/bundle/chunks/chunk-NJDELBDB.js +82 -0
- package/dist/bundle/chunks/{chunk-CLNF6E5P.js → chunk-NLVN7RG3.js} +1 -1
- package/dist/bundle/chunks/chunk-NLYBRJ3F.js +9 -0
- package/dist/bundle/chunks/{chunk-UQSONZLL.js → chunk-OPLOTJXH.js} +3 -1
- package/dist/bundle/chunks/{chunk-YUBUKEPQ.js → chunk-PPJRJAR3.js} +169 -130
- package/dist/bundle/chunks/chunk-RIPTEKPX.js +44 -0
- package/dist/bundle/chunks/chunk-ROB5AWV5.js +30 -0
- package/dist/bundle/chunks/chunk-WNZ64GW3.js +2 -0
- package/dist/bundle/chunks/{chunk-ABW2JATG.js → chunk-XEVRP72T.js} +1 -1
- package/dist/bundle/chunks/{chunk-SKQFE2GA.js → chunk-XY64T2H6.js} +1 -1
- package/dist/bundle/chunks/chunk-ZZAOELWU.js +2 -0
- package/dist/bundle/chunks/{cli-7AMCJ2UG.js → cli-JDGPEN7N.js} +3 -3
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-QBCV2OWJ.js → cloudflare-workers-ai-system-one-ZPDQKK4H.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +2 -0
- package/dist/bundle/chunks/{execute-VOIPQMCI.js → execute-YOMYOVUT.js} +2 -2
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-EEDLVZAQ.js +2 -0
- package/dist/bundle/chunks/google-vertex-YQDP6U25.js +2 -0
- package/dist/bundle/chunks/{llama-cpp-classify-WGVYEPG2.js → llama-cpp-classify-SRUYBPZS.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-PV6RDK65.js → mistral-conversations-QKVAIF57.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-SEOL3EDF.js → openai-codex-responses-2FIT2Z3L.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-U32QPS37.js → openai-completions-42OND4EW.js} +3 -3
- package/dist/bundle/chunks/{openai-decisions-ULSYFV2A.js → openai-decisions-FAP6LRGH.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-5MYZJYPK.js → openai-responses-BGC7WCIQ.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-SGOP5SDW.js → openrouter-images-EAWW57ZG.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-QALFE2BD.js → pi-messages-JM6JDMH5.js} +1 -1
- package/dist/bundle/chunks/{runtime-GDH3ZURV.js → runtime-F63NCS5Y.js} +1 -1
- package/dist/bundle/chunks/{runtime-Z74VFUDD.js → runtime-S5WBSLTE.js} +1 -1
- package/dist/bundle/chunks/{settings-manager-T6UJFO2F.js → settings-manager-H3QEOPQ3.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-GTGS5MG6.js → typesafe-system-one-QOA2PTJR.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-2BURZRW7.js +2 -0
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +5 -3
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-command.d.ts.map +1 -1
- package/dist/cli/auth-command.js +30 -6
- package/dist/cli/auth-command.js.map +1 -1
- package/dist/cli/auth-login.d.ts +15 -0
- package/dist/cli/auth-login.d.ts.map +1 -0
- package/dist/cli/auth-login.js +232 -0
- package/dist/cli/auth-login.js.map +1 -0
- package/dist/cli/auth-logout.d.ts +14 -0
- package/dist/cli/auth-logout.d.ts.map +1 -0
- package/dist/cli/auth-logout.js +57 -0
- package/dist/cli/auth-logout.js.map +1 -0
- package/dist/cli/auth-terminal.d.ts +17 -0
- package/dist/cli/auth-terminal.d.ts.map +1 -0
- package/dist/cli/auth-terminal.js +63 -0
- package/dist/cli/auth-terminal.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +5 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +16 -2
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +20 -9
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +71 -29
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/ai-schemas.d.ts +1 -0
- package/dist/core/ai-schemas.d.ts.map +1 -1
- package/dist/core/builtins/budgets.d.ts.map +1 -1
- package/dist/core/builtins/budgets.js +6 -3
- package/dist/core/builtins/budgets.js.map +1 -1
- package/dist/core/cache-warmer.d.ts +4 -37
- package/dist/core/cache-warmer.d.ts.map +1 -1
- package/dist/core/cache-warmer.js +11 -91
- package/dist/core/cache-warmer.js.map +1 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +2 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/exec.d.ts +1 -0
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +4 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/ansi-to-html.d.ts +5 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js +57 -20
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/template.js +1 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +2 -3
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/types.d.ts +3 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-config.d.ts +13 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-resolver.d.ts +0 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +17 -24
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +5 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +7 -0
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/polyphase/render/format.d.ts +2 -0
- package/dist/core/polyphase/render/format.d.ts.map +1 -1
- package/dist/core/polyphase/render/format.js +6 -0
- package/dist/core/polyphase/render/format.js.map +1 -1
- package/dist/core/polyphase/render/run-block.d.ts +4 -0
- package/dist/core/polyphase/render/run-block.d.ts.map +1 -1
- package/dist/core/polyphase/render/run-block.js +71 -12
- package/dist/core/polyphase/render/run-block.js.map +1 -1
- package/dist/core/polyphase/render/snapshot.d.ts +1 -1
- package/dist/core/polyphase/render/snapshot.d.ts.map +1 -1
- package/dist/core/polyphase/render/snapshot.js +22 -7
- package/dist/core/polyphase/render/snapshot.js.map +1 -1
- package/dist/core/polyphase/ui/dock.d.ts.map +1 -1
- package/dist/core/polyphase/ui/dock.js +34 -2
- package/dist/core/polyphase/ui/dock.js.map +1 -1
- package/dist/core/polyphase/ui/inspector.d.ts +18 -6
- package/dist/core/polyphase/ui/inspector.d.ts.map +1 -1
- package/dist/core/polyphase/ui/inspector.js +125 -44
- package/dist/core/polyphase/ui/inspector.js.map +1 -1
- package/dist/core/polyphase/ui/transcript-layout.d.ts.map +1 -1
- package/dist/core/polyphase/ui/transcript-layout.js +5 -1
- package/dist/core/polyphase/ui/transcript-layout.js.map +1 -1
- package/dist/core/preferred-providers.d.ts +17 -0
- package/dist/core/preferred-providers.d.ts.map +1 -0
- package/dist/core/preferred-providers.js +24 -0
- package/dist/core/preferred-providers.js.map +1 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +18 -2
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +2 -0
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/provider-matching.d.ts +6 -0
- package/dist/core/provider-matching.d.ts.map +1 -0
- package/dist/core/provider-matching.js +8 -0
- package/dist/core/provider-matching.js.map +1 -0
- package/dist/core/radius-mcp.d.ts +13 -0
- package/dist/core/radius-mcp.d.ts.map +1 -0
- package/dist/core/radius-mcp.js +29 -0
- package/dist/core/radius-mcp.js.map +1 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +2 -0
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +8 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js +15 -1
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/session-cwd.d.ts +7 -0
- package/dist/core/session-cwd.d.ts.map +1 -1
- package/dist/core/session-cwd.js +9 -1
- package/dist/core/session-cwd.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +45 -36
- package/dist/core/session-manager.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/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +35 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +23 -14
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +182 -41
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +8 -7
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +57 -16
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +4 -0
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +20 -8
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +4 -1
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js +15 -2
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/read.d.ts +13 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +146 -35
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/renderers/read.d.ts.map +1 -1
- package/dist/core/tools/renderers/read.js +6 -2
- package/dist/core/tools/renderers/read.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +4 -0
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +24 -1
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/extensions/codemode/execute.js +4 -4
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +34 -12
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +1 -1
- package/dist/extensions/llama/provider.js +1 -1
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +15 -3
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/cli.js +5 -8
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/index.d.ts.map +1 -1
- package/dist/extensions/mcp/index.js +2 -1
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/runtime.d.ts.map +1 -1
- package/dist/extensions/mcp/runtime.js +3 -2
- package/dist/extensions/mcp/runtime.js.map +1 -1
- package/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +18 -6
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +67 -15
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +2 -19
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +14 -6
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +10 -3
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +32 -5
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/provider-brand.d.ts +14 -0
- package/dist/modes/interactive/components/provider-brand.d.ts.map +1 -0
- package/dist/modes/interactive/components/provider-brand.js +66 -0
- package/dist/modes/interactive/components/provider-brand.js.map +1 -0
- package/dist/modes/interactive/components/radius-login-selector.d.ts +1 -2
- package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/radius-login-selector.js +6 -37
- package/dist/modes/interactive/components/radius-login-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +6 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +23 -5
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +3 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +11 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +133 -78
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/session-share.js +2 -0
- package/dist/modes/interactive/session-share.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +27 -4
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/prompts/commands/test-audit.md +84 -0
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +3 -1
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/terminal-question.d.ts +8 -0
- package/dist/utils/terminal-question.d.ts.map +1 -0
- package/dist/utils/terminal-question.js +24 -0
- package/dist/utils/terminal-question.js.map +1 -0
- package/dist/utils/web-url.d.ts +12 -0
- package/dist/utils/web-url.d.ts.map +1 -0
- package/dist/utils/web-url.js +20 -0
- package/dist/utils/web-url.js.map +1 -0
- package/docs/cli.md +14 -1
- package/docs/extensions.md +6 -4
- package/docs/llama-cpp.md +5 -5
- package/docs/models-configuration.md +2 -1
- package/docs/nvidia-rtx-llama-cpp.md +5 -5
- package/docs/polyphase.md +13 -1
- package/docs/prompt-templates.md +1 -1
- package/docs/providers.md +4 -2
- package/docs/quickstart.md +1 -1
- package/docs/rpc-commands.md +1 -1
- package/docs/rpc.md +1 -1
- package/docs/sessions.md +7 -1
- package/docs/settings.md +1 -1
- package/docs/tui.md +1 -1
- package/examples/extensions/gondolin/index.ts +4 -7
- package/examples/extensions/subagent/index.ts +5 -1
- package/package.json +10 -10
- package/prompts/commands/test-audit.md +84 -0
- package/schemas/models.schema.json +5 -1
- package/schemas/settings.schema.json +1 -1
- package/dist/bundle/chunks/anthropic-messages-TXQXPH4S.js +0 -6
- package/dist/bundle/chunks/chunk-AOCWORXE.js +0 -2
- package/dist/bundle/chunks/chunk-DQ4G4IS4.js +0 -20
- package/dist/bundle/chunks/chunk-J7QTCDIN.js +0 -2
- package/dist/bundle/chunks/chunk-NNYZSIKR.js +0 -9
- package/dist/bundle/chunks/chunk-SUVMF4W5.js +0 -2
- package/dist/bundle/chunks/chunk-THDNEOXP.js +0 -44
- package/dist/bundle/chunks/chunk-TK3LS5QZ.js +0 -82
- package/dist/bundle/chunks/chunk-TYAEYYRA.js +0 -30
- package/dist/bundle/chunks/google-generative-ai-NC5KHHW3.js +0 -2
- package/dist/bundle/chunks/google-vertex-GAPUJEF7.js +0 -2
- package/dist/bundle/chunks/virtual-modules-ZUI2T3XR.js +0 -2
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { visibleWidth, wrapTextWithAnsi } from "@draht/tui";
|
|
6
6
|
import { combinedKeyHint, keyHint } from "../../../modes/interactive/components/keybinding-hints.js";
|
|
7
|
-
import { columns, fitLine, formatCost, formatDuration, formatModelLabel, formatTokens, oneLine, padToWidth, statusGlyph, } from "../render/format.js";
|
|
7
|
+
import { columns, fitLine, formatCost, formatDuration, formatModelLabel, formatTokens, oneLine, padToWidth, progressBar, statusGlyph, } from "../render/format.js";
|
|
8
8
|
import { sanitizeChildText, sanitizeSnapshot } from "../render/run-block.js";
|
|
9
9
|
import { snapshotFromDetails, snapshotFromRun } from "../render/snapshot.js";
|
|
10
10
|
import { sanitizeForDisplay, TranscriptLineCache, tailWindowOf, } from "./transcript-layout.js";
|
|
@@ -135,6 +135,8 @@ function runSubtitleText(snapshot) {
|
|
|
135
135
|
* status glyph must stay visible even when nothing else does. `columns()`'s own 1-column gap
|
|
136
136
|
* supplies the separator space before the title, matching `› ● label` elsewhere in this file. */
|
|
137
137
|
const RUNS_ROW_CURSOR_WIDTH = 3;
|
|
138
|
+
/** Cap for the runs view's widened counts cell, so it never squeezes the title to nothing. */
|
|
139
|
+
const RUNS_COUNTS_MAX_WIDTH = 20;
|
|
138
140
|
function savedWorkflowSourceLabel(source) {
|
|
139
141
|
return source === "project" ? "proj" : "user";
|
|
140
142
|
}
|
|
@@ -210,6 +212,39 @@ function formatCounts(theme, now, counts) {
|
|
|
210
212
|
function isFinishedAgentStatus(status) {
|
|
211
213
|
return status === "done" || status === "failed" || status === "cancelled" || status === "skipped";
|
|
212
214
|
}
|
|
215
|
+
/** `label · agentType · phase`, minus any part that repeats an earlier one (a workflow agent is
|
|
216
|
+
* often labelled after its type or its phase, which would otherwise read `cleanup · cleanup`). */
|
|
217
|
+
function agentTitleText(row, phaseTitle) {
|
|
218
|
+
const parts = [];
|
|
219
|
+
for (const part of [row.label, row.agentType, phaseTitle]) {
|
|
220
|
+
if (part && !parts.includes(part))
|
|
221
|
+
parts.push(part);
|
|
222
|
+
}
|
|
223
|
+
return parts.join(" · ");
|
|
224
|
+
}
|
|
225
|
+
/** `budget ███░░ 12.3k/50.0k tok · time ██░░░ 4:10/30:00` for a run with a token budget or a time
|
|
226
|
+
* limit, so how close the run is to being stopped is visible before it happens. */
|
|
227
|
+
function limitsGaugeText(snapshot, theme) {
|
|
228
|
+
const parts = [];
|
|
229
|
+
const gauge = (ratio, hit) => theme.fg(hit ? "error" : ratio >= 0.8 ? "warning" : "accent", progressBar(ratio, 10));
|
|
230
|
+
if (snapshot.budget) {
|
|
231
|
+
const { spentTokens, totalTokens, exhausted } = snapshot.budget;
|
|
232
|
+
parts.push(`budget ${gauge(spentTokens / totalTokens, exhausted)} ${formatTokens(spentTokens)}/${formatTokens(totalTokens)} tok`);
|
|
233
|
+
}
|
|
234
|
+
if (snapshot.timeLimit) {
|
|
235
|
+
const { totalMs, reached } = snapshot.timeLimit;
|
|
236
|
+
parts.push(`time ${gauge(snapshot.elapsedMs / totalMs, reached)} ${formatDuration(Math.min(snapshot.elapsedMs, totalMs))}/${formatDuration(totalMs)}`);
|
|
237
|
+
}
|
|
238
|
+
return parts.length > 0 ? parts.join(" · ") : undefined;
|
|
239
|
+
}
|
|
240
|
+
/** Joins hints with two spaces, dropping hints from just before the last one until the line fits,
|
|
241
|
+
* so the closing `back`/`close` hint stays visible on a narrow terminal instead of being cut. */
|
|
242
|
+
function fitHints(hints, width) {
|
|
243
|
+
const kept = [...hints];
|
|
244
|
+
while (kept.length > 2 && visibleWidth(kept.join(" ")) > width)
|
|
245
|
+
kept.splice(kept.length - 2, 1);
|
|
246
|
+
return kept.join(" ");
|
|
247
|
+
}
|
|
213
248
|
/**
|
|
214
249
|
* The `alt+a` popup. `render()` recomputes the live runs-view list, the current run's agent list
|
|
215
250
|
* and the selected agent's transcript window on every call, since those come straight from the
|
|
@@ -349,18 +384,15 @@ export class PolyphaseInspector {
|
|
|
349
384
|
topRight = snapshot ? this.runHeaderRight(snapshot) : "";
|
|
350
385
|
bodyLines =
|
|
351
386
|
width >= SPLIT_MIN_WIDTH
|
|
352
|
-
? this.renderSplitBody(innerWidth, bodyHeight, rows)
|
|
387
|
+
? this.renderSplitBody(innerWidth, bodyHeight, snapshot, rows)
|
|
353
388
|
: this.renderRunBody(innerWidth, bodyHeight, snapshot, rows);
|
|
354
389
|
}
|
|
355
390
|
else {
|
|
356
391
|
const snapshot = this.currentRunSnapshot();
|
|
357
392
|
const rows = this.sortedAgentsOf(snapshot);
|
|
358
393
|
const row = rows.find((r) => r.i === this.currentAgentIndex);
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
topRight = row
|
|
362
|
-
? `${statusGlyph(row.status, this.deps.theme, { now: this.now(), animate: false })} ${headerActivityText(row)}${row.elapsedMs === undefined ? "" : ` ${formatDuration(row.elapsedMs)}`}`
|
|
363
|
-
: "";
|
|
394
|
+
topTitle = row ? agentTitleText(row, this.phaseTitleOf(snapshot, row)) : "agent";
|
|
395
|
+
topRight = row ? this.agentStatusText(row) : "";
|
|
364
396
|
bodyLines = this.renderAgentDetailBody(this.currentAgentIndex, innerWidth, bodyHeight, rows);
|
|
365
397
|
}
|
|
366
398
|
const padded = padLines(bodyLines, bodyHeight);
|
|
@@ -377,6 +409,15 @@ export class PolyphaseInspector {
|
|
|
377
409
|
now() {
|
|
378
410
|
return Date.now();
|
|
379
411
|
}
|
|
412
|
+
phaseTitleOf(snapshot, row) {
|
|
413
|
+
return row.phase !== undefined ? snapshot?.phases[row.phase]?.title : undefined;
|
|
414
|
+
}
|
|
415
|
+
/** `● thinking 0:41`: the agent detail header's right side (§12.2). */
|
|
416
|
+
agentStatusText(row) {
|
|
417
|
+
const glyph = statusGlyph(row.status, this.deps.theme, { now: this.now(), animate: false });
|
|
418
|
+
const elapsed = row.elapsedMs === undefined ? "" : ` ${formatDuration(row.elapsedMs)}`;
|
|
419
|
+
return `${glyph} ${headerActivityText(row)}${elapsed}`;
|
|
420
|
+
}
|
|
380
421
|
// ── Navigation ──────────────────────────────────────────────────────────
|
|
381
422
|
resolveInitialView() {
|
|
382
423
|
const initial = this.deps.initial;
|
|
@@ -720,7 +761,9 @@ export class PolyphaseInspector {
|
|
|
720
761
|
return { items: agent.state.transcript, dropped: agent.state.droppedItems };
|
|
721
762
|
}
|
|
722
763
|
// ── Rendering ───────────────────────────────────────────────────────────
|
|
723
|
-
|
|
764
|
+
/** `countsWidth` is the widest counts cell across every listed run (at least the default), so
|
|
765
|
+
* multi-digit counts like `●10 ✓12` are never cut to `●1`. */
|
|
766
|
+
formatRunsRow(row, width, selected, countsWidth) {
|
|
724
767
|
const cursor = selected ? "› " : " ";
|
|
725
768
|
if (row.kind === "saved" && row.saved) {
|
|
726
769
|
const saved = row.saved;
|
|
@@ -747,7 +790,10 @@ export class PolyphaseInspector {
|
|
|
747
790
|
if (optional.subtitle > 0)
|
|
748
791
|
cells.push({ text: runSubtitleText(snapshot), width: optional.subtitle });
|
|
749
792
|
if (optional.counts > 0) {
|
|
750
|
-
cells.push({
|
|
793
|
+
cells.push({
|
|
794
|
+
text: formatCounts(this.deps.theme, this.now(), snapshot.counts),
|
|
795
|
+
width: Math.max(optional.counts, countsWidth),
|
|
796
|
+
});
|
|
751
797
|
}
|
|
752
798
|
if (optional.duration > 0) {
|
|
753
799
|
cells.push({ text: formatDuration(snapshot.elapsedMs), width: optional.duration, align: "right" });
|
|
@@ -767,6 +813,13 @@ export class PolyphaseInspector {
|
|
|
767
813
|
const rows = this.runsRows;
|
|
768
814
|
const lines = [];
|
|
769
815
|
const lineForRow = [];
|
|
816
|
+
let countsWidth = 0;
|
|
817
|
+
for (const row of rows) {
|
|
818
|
+
if (row.snapshot) {
|
|
819
|
+
countsWidth = Math.max(countsWidth, visibleWidth(formatCounts(this.deps.theme, this.now(), row.snapshot.counts)));
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
countsWidth = Math.min(RUNS_COUNTS_MAX_WIDTH, countsWidth);
|
|
770
823
|
let lastKind;
|
|
771
824
|
rows.forEach((row, idx) => {
|
|
772
825
|
if (row.kind !== lastKind) {
|
|
@@ -774,7 +827,7 @@ export class PolyphaseInspector {
|
|
|
774
827
|
lastKind = row.kind;
|
|
775
828
|
}
|
|
776
829
|
lineForRow[idx] = lines.length;
|
|
777
|
-
lines.push(this.formatRunsRow(row, width, idx === this.runsSelection));
|
|
830
|
+
lines.push(this.formatRunsRow(row, width, idx === this.runsSelection, countsWidth));
|
|
778
831
|
});
|
|
779
832
|
if (rows.length === 0) {
|
|
780
833
|
lines.push('No agents yet. Put "polyphase" in a prompt or run /workflow <name>.');
|
|
@@ -782,16 +835,16 @@ export class PolyphaseInspector {
|
|
|
782
835
|
const pivot = lineForRow[this.runsSelection] ?? 0;
|
|
783
836
|
const contentHeight = Math.max(1, height - 1);
|
|
784
837
|
const windowed = padLines(windowAround(lines, contentHeight, pivot, this.deps.theme), contentHeight);
|
|
785
|
-
return [...windowed, this.footerLine(this.
|
|
838
|
+
return [...windowed, this.footerLine(this.runsHints(), width)];
|
|
786
839
|
}
|
|
787
840
|
formatAgentRow(row, width, selected) {
|
|
788
841
|
const cursor = selected ? "› " : " ";
|
|
789
842
|
const glyph = statusGlyph(row.status, this.deps.theme, { now: this.now(), animate: false });
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
843
|
+
const cells = [{ text: `${cursor}${glyph} ${row.label}`, width: 18 }];
|
|
844
|
+
// Below 50 columns (the split view's left pane, a phase-indented row in it) the model column
|
|
845
|
+
// would leave no room for the activity; the split view's right pane names the model anyway.
|
|
846
|
+
if (width >= 50)
|
|
847
|
+
cells.push({ text: formatModelLabel(row, { withProvider: false }), width: 20 });
|
|
795
848
|
// Dropped below 60 columns, the same threshold `layoutRun` uses for its elapsed column: at
|
|
796
849
|
// the 40-column split-pane width there is no room for a 5th fixed cell ahead of the flex one.
|
|
797
850
|
if (width >= 60) {
|
|
@@ -816,7 +869,7 @@ export class PolyphaseInspector {
|
|
|
816
869
|
runHeaderRight(snapshot) {
|
|
817
870
|
const parts = [formatCounts(this.deps.theme, this.now(), snapshot.counts), formatDuration(snapshot.elapsedMs)];
|
|
818
871
|
if (snapshot.tokens > 0)
|
|
819
|
-
parts.push(formatTokens(snapshot.tokens));
|
|
872
|
+
parts.push(`${formatTokens(snapshot.tokens)} tok`);
|
|
820
873
|
const cost = formatCost(snapshot.cost);
|
|
821
874
|
if (cost)
|
|
822
875
|
parts.push(cost);
|
|
@@ -826,8 +879,22 @@ export class PolyphaseInspector {
|
|
|
826
879
|
if (!snapshot)
|
|
827
880
|
return [this.deps.theme.fg("muted", "run not found")];
|
|
828
881
|
this.runSelection = clamp(this.runSelection, 0, Math.max(0, rows.length - 1));
|
|
882
|
+
const { lines, lineForAgent } = this.runListLines(snapshot, rows, width);
|
|
883
|
+
const pivot = lineForAgent[this.runSelection] ?? 0;
|
|
884
|
+
const contentHeight = Math.max(1, height - 1);
|
|
885
|
+
const windowed = padLines(windowAround(lines, contentHeight, pivot, this.deps.theme), contentHeight);
|
|
886
|
+
return [...windowed, this.footerLine(this.runHints(), width)];
|
|
887
|
+
}
|
|
888
|
+
/** The run view's list (§12.2): a limits gauge when the run has a budget or time limit, then
|
|
889
|
+
* agents grouped by phase for workflows, numbered for chains, flat otherwise, then the newest log
|
|
890
|
+
* line or the result. Shared by the full-width run view and the split view's left pane, so the
|
|
891
|
+
* phase tree survives the split. */
|
|
892
|
+
runListLines(snapshot, rows, width) {
|
|
829
893
|
const lines = [];
|
|
830
894
|
const lineForAgent = [];
|
|
895
|
+
const gauge = limitsGaugeText(snapshot, this.deps.theme);
|
|
896
|
+
if (gauge)
|
|
897
|
+
lines.push(fitLine(gauge, width));
|
|
831
898
|
if (snapshot.phases.length > 0) {
|
|
832
899
|
// Agents spawned before any phase()/agent({phase}) call (§13.3) carry no phase index; they
|
|
833
900
|
// are still selectable, so they get an ungrouped block ahead of the phase list instead of
|
|
@@ -872,25 +939,29 @@ export class PolyphaseInspector {
|
|
|
872
939
|
else if (snapshot.resultPreview && snapshot.status !== "running") {
|
|
873
940
|
lines.push(`→ ${oneLine(sanitizeForDisplay(snapshot.resultPreview))}`);
|
|
874
941
|
}
|
|
875
|
-
|
|
876
|
-
const contentHeight = Math.max(1, height - 1);
|
|
877
|
-
const windowed = padLines(windowAround(lines, contentHeight, pivot, this.deps.theme), contentHeight);
|
|
878
|
-
return [...windowed, this.footerLine(this.runHintLine(), width)];
|
|
942
|
+
return { lines: lines.map((line) => fitLine(line, width)), lineForAgent };
|
|
879
943
|
}
|
|
880
|
-
renderSplitBody(width, height, rows) {
|
|
881
|
-
|
|
944
|
+
renderSplitBody(width, height, snapshot, rows) {
|
|
945
|
+
if (!snapshot)
|
|
946
|
+
return [this.deps.theme.fg("muted", "run not found")];
|
|
947
|
+
// The left list stops one column short of the divider, and one more column of air follows it.
|
|
948
|
+
const rightWidth = Math.max(1, width - SPLIT_LEFT_WIDTH - 2);
|
|
882
949
|
this.runSelection = clamp(this.runSelection, 0, Math.max(0, rows.length - 1));
|
|
883
|
-
const
|
|
884
|
-
const
|
|
885
|
-
const rightLines = this.renderAgentDetailBody(
|
|
886
|
-
// Windowed the same way `renderRunBody` windows
|
|
887
|
-
//
|
|
888
|
-
const
|
|
950
|
+
const { lines: leftLines, lineForAgent } = this.runListLines(snapshot, rows, SPLIT_LEFT_WIDTH - 1);
|
|
951
|
+
const selected = rows[this.runSelection];
|
|
952
|
+
const rightLines = this.renderAgentDetailBody(selected?.i, rightWidth, height, rows, snapshot);
|
|
953
|
+
// Windowed the same way `renderRunBody` windows its list, so a run with more agents than the
|
|
954
|
+
// pane has rows keeps the `›` cursor on screen instead of scrolling it off the top.
|
|
955
|
+
const pivot = lineForAgent[this.runSelection] ?? 0;
|
|
956
|
+
const paddedLeft = padLines(windowAround(leftLines, height, pivot, this.deps.theme), height);
|
|
889
957
|
const paddedRight = padLines(rightLines, height);
|
|
890
|
-
|
|
958
|
+
const divider = this.deps.theme.fg("dim", "│");
|
|
959
|
+
return paddedLeft.map((line, idx) => `${padToWidth(line, SPLIT_LEFT_WIDTH)}${divider} ${paddedRight[idx] ?? ""}`);
|
|
891
960
|
}
|
|
892
|
-
|
|
893
|
-
|
|
961
|
+
/** `identityFrom` is set by the split view, whose border title names the run rather than the
|
|
962
|
+
* agent: the pane then opens with the agent's own title and status line. */
|
|
963
|
+
renderAgentDetailBody(agentIndex, width, height, rows, identityFrom) {
|
|
964
|
+
const footerFallback = this.agentHints();
|
|
894
965
|
const contentHeight = Math.max(1, height - 1);
|
|
895
966
|
if (agentIndex === undefined) {
|
|
896
967
|
return [
|
|
@@ -906,6 +977,16 @@ export class PolyphaseInspector {
|
|
|
906
977
|
];
|
|
907
978
|
}
|
|
908
979
|
const header = [];
|
|
980
|
+
if (identityFrom) {
|
|
981
|
+
const status = this.agentStatusText(row);
|
|
982
|
+
header.push(columns([
|
|
983
|
+
{
|
|
984
|
+
text: this.deps.theme.bold(agentTitleText(row, this.phaseTitleOf(identityFrom, row))),
|
|
985
|
+
width: "flex",
|
|
986
|
+
},
|
|
987
|
+
{ text: status, width: visibleWidth(status), align: "right" },
|
|
988
|
+
], width));
|
|
989
|
+
}
|
|
909
990
|
const modelLabel = formatModelLabel(row, { withProvider: true, withSource: true });
|
|
910
991
|
const confirmText = row.modelConfirmed ? "confirmed" : "unconfirmed";
|
|
911
992
|
const tokensText = row.tokens > 0 ? ` · ${formatTokens(row.tokens)} tok` : "";
|
|
@@ -915,7 +996,7 @@ export class PolyphaseInspector {
|
|
|
915
996
|
header.push(oneLine(`${modelLabel} · ${confirmText} · ${turnsText} · ${toolsText}${tokensText}${costText}`));
|
|
916
997
|
header.push(`task ${oneLine(row.task)}`);
|
|
917
998
|
header.push("─".repeat(Math.max(0, width)));
|
|
918
|
-
const footer = this.footerLine(this.
|
|
999
|
+
const footer = this.footerLine(this.agentHints(row.status), width);
|
|
919
1000
|
const transcript = this.currentAgentTranscriptFor(agentIndex);
|
|
920
1001
|
if (!transcript) {
|
|
921
1002
|
const OUTPUT_PREVIEW_MAX_LINES = 8;
|
|
@@ -979,30 +1060,30 @@ export class PolyphaseInspector {
|
|
|
979
1060
|
const body = [...header, ...windowLines, ...followLine];
|
|
980
1061
|
return [...padLines(body, contentHeight), footer];
|
|
981
1062
|
}
|
|
982
|
-
/** `width` is the same inner width the caller laid its body out to
|
|
983
|
-
*
|
|
984
|
-
* which carries no ellipsis of its own. */
|
|
985
|
-
footerLine(
|
|
986
|
-
return fitLine(this.footerNotice ? this.deps.theme.fg("warning", this.footerNotice) :
|
|
1063
|
+
/** `width` is the same inner width the caller laid its body out to: hints that do not fit are
|
|
1064
|
+
* dropped by `fitHints`, and anything still too wide is ellipsised like every other row instead
|
|
1065
|
+
* of being hard-cut by `sideLine`'s padding, which carries no ellipsis of its own. */
|
|
1066
|
+
footerLine(hints, width) {
|
|
1067
|
+
return fitLine(this.footerNotice ? this.deps.theme.fg("warning", this.footerNotice) : fitHints(hints, width), width);
|
|
987
1068
|
}
|
|
988
|
-
|
|
1069
|
+
runsHints() {
|
|
989
1070
|
return [
|
|
990
1071
|
combinedKeyHint(["tui.select.up", "tui.select.down"], "select"),
|
|
991
1072
|
keyHint("tui.select.confirm", "open"),
|
|
992
1073
|
keyHint("app.polyphase.cancelRun", "cancel run"),
|
|
993
1074
|
keyHint("tui.select.cancel", "close"),
|
|
994
|
-
]
|
|
1075
|
+
];
|
|
995
1076
|
}
|
|
996
|
-
|
|
1077
|
+
runHints() {
|
|
997
1078
|
return [
|
|
998
1079
|
combinedKeyHint(["tui.select.up", "tui.select.down"], "select"),
|
|
999
1080
|
keyHint("tui.select.confirm", "follow"),
|
|
1000
1081
|
keyHint("app.polyphase.cancelAgent", "cancel agent"),
|
|
1001
1082
|
keyHint("app.polyphase.cancelRun", "cancel run"),
|
|
1002
1083
|
keyHint("tui.select.cancel", "back"),
|
|
1003
|
-
]
|
|
1084
|
+
];
|
|
1004
1085
|
}
|
|
1005
|
-
|
|
1086
|
+
agentHints(status) {
|
|
1006
1087
|
const finished = status !== undefined && isFinishedAgentStatus(status);
|
|
1007
1088
|
return [
|
|
1008
1089
|
keyHint("app.polyphase.nextAgent", "next agent"),
|
|
@@ -1010,7 +1091,7 @@ export class PolyphaseInspector {
|
|
|
1010
1091
|
keyHint("app.thinking.toggle", "thinking"),
|
|
1011
1092
|
...(finished ? [] : [keyHint("app.polyphase.cancelAgent", "cancel")]),
|
|
1012
1093
|
keyHint("tui.select.cancel", "back"),
|
|
1013
|
-
]
|
|
1094
|
+
];
|
|
1014
1095
|
}
|
|
1015
1096
|
}
|
|
1016
1097
|
//# sourceMappingURL=inspector.js.map
|