@draht/coding-agent 2026.11.5-1 → 2026.11.14-1
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-C5ZJVCKX.js +6 -0
- package/dist/bundle/chunks/{azure-openai-responses-NCMJPZVJ.js → azure-openai-responses-TNRID5YC.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-DWOGGNWY.js → chunk-2IQVBLH6.js} +1 -1
- package/dist/bundle/chunks/{chunk-P7O36UDU.js → chunk-4FPBO5KP.js} +5 -1
- package/dist/bundle/chunks/{chunk-Q2QKCYPU.js → chunk-5C4MAPF6.js} +1 -1
- package/dist/bundle/chunks/chunk-5WEOWREV.js +82 -0
- package/dist/bundle/chunks/{chunk-DN7SM3LX.js → chunk-ATYP3OSV.js} +3 -1
- package/dist/bundle/chunks/chunk-B6S2UR4T.js +2 -0
- package/dist/bundle/chunks/chunk-EBTEI43G.js +20 -0
- package/dist/bundle/chunks/{chunk-F5TDVH26.js → chunk-GAABJAG4.js} +12 -15
- package/dist/bundle/chunks/{chunk-PMINB7UH.js → chunk-JHKMYVPC.js} +169 -130
- package/dist/bundle/chunks/{chunk-EOXOMUKR.js → chunk-LCTFXH4P.js} +1 -1
- package/dist/bundle/chunks/{chunk-UFACUBF2.js → chunk-MPJIXESS.js} +1 -1
- package/dist/bundle/chunks/{chunk-PZKD35UB.js → chunk-MXA4WY3C.js} +1 -1
- package/dist/bundle/chunks/chunk-O2XYFH2E.js +30 -0
- package/dist/bundle/chunks/{chunk-CA23BDNK.js → chunk-OUXJRC2W.js} +1 -1
- package/dist/bundle/chunks/{chunk-3BJ462DN.js → chunk-RI7HJ6AF.js} +1 -1
- package/dist/bundle/chunks/chunk-RVXTPNXQ.js +44 -0
- package/dist/bundle/chunks/{chunk-QBUTRTYN.js → chunk-SXHVGWCU.js} +1 -1
- package/dist/bundle/chunks/chunk-WNZ64GW3.js +2 -0
- package/dist/bundle/chunks/chunk-XWZLYE4L.js +9 -0
- package/dist/bundle/chunks/{chunk-HJ3PS7QP.js → chunk-YSE3VKKB.js} +2 -2
- package/dist/bundle/chunks/{cli-4SUT6MJ6.js → cli-2QKCAPPD.js} +3 -3
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-BJVMNETD.js → cloudflare-workers-ai-system-one-UCG6T3XP.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +2 -0
- package/dist/bundle/chunks/{execute-ZI7T2SUH.js → execute-KGJOWTPG.js} +2 -2
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-GPBKPOXA.js +2 -0
- package/dist/bundle/chunks/google-vertex-USZY53NF.js +2 -0
- package/dist/bundle/chunks/{llama-cpp-classify-L4URPZ4F.js → llama-cpp-classify-7DEQ4ZUF.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-CK2BS74V.js → mistral-conversations-UOGXPDZ3.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-XGVNKP4D.js → openai-codex-responses-VUDXQ3EU.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-72XZO4Q3.js → openai-completions-UQOOS7NM.js} +3 -3
- package/dist/bundle/chunks/{openai-decisions-P5OCXLLD.js → openai-decisions-24WNXO2R.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-RGLZ4E3Q.js → openai-responses-5AF6MZ5L.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-LSBWMZDK.js → openrouter-images-OUXVVTYQ.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-CL4MEVNS.js → pi-messages-DRMOEO6B.js} +1 -1
- package/dist/bundle/chunks/{runtime-FJYRBK3O.js → runtime-FZKS2BWI.js} +1 -1
- package/dist/bundle/chunks/{runtime-F4362CZF.js → runtime-L23MZBKL.js} +1 -1
- package/dist/bundle/chunks/{settings-manager-T6G6KKY3.js → settings-manager-CWRQW6PZ.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-BFYS6AEA.js → typesafe-system-one-K63EBJDD.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-JZV35VDE.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-UJZ4SGHU.js +0 -6
- package/dist/bundle/chunks/chunk-AOCWORXE.js +0 -2
- package/dist/bundle/chunks/chunk-BK5LXGIH.js +0 -2
- package/dist/bundle/chunks/chunk-DQ4G4IS4.js +0 -20
- package/dist/bundle/chunks/chunk-SUVMF4W5.js +0 -2
- package/dist/bundle/chunks/chunk-VXO6B72D.js +0 -9
- package/dist/bundle/chunks/chunk-WXASQQBZ.js +0 -44
- package/dist/bundle/chunks/chunk-YD5VPPI4.js +0 -30
- package/dist/bundle/chunks/chunk-YWRWN7ZB.js +0 -82
- package/dist/bundle/chunks/google-generative-ai-N5IPPKQY.js +0 -2
- package/dist/bundle/chunks/google-vertex-A4BKUE4H.js +0 -2
- package/dist/bundle/chunks/virtual-modules-BPZIVXNK.js +0 -2
|
@@ -38,8 +38,11 @@ function splitModel(model) {
|
|
|
38
38
|
* but none active, reads "running" rather than falling through to "pending".** "Pending" is
|
|
39
39
|
* reserved for phases where no agent has made any progress yet; partial progress should not
|
|
40
40
|
* look identical to "not started".
|
|
41
|
+
* 3. **A finished phase with no `done` agent but at least one cancelled one reads "cancelled"**, and
|
|
42
|
+
* **a phase without agents that the run has already moved past reads "skipped"**, so neither
|
|
43
|
+
* shows the `done` or `pending` glyph for work that never happened.
|
|
41
44
|
*/
|
|
42
|
-
function phaseStatusFor(agentRows, isCurrent) {
|
|
45
|
+
function phaseStatusFor(agentRows, isCurrent, passed) {
|
|
43
46
|
const total = agentRows.length;
|
|
44
47
|
const anyActive = agentRows.some((row) => isActive(row.status));
|
|
45
48
|
const anyFinished = agentRows.some((row) => isFinished(row.status));
|
|
@@ -47,8 +50,12 @@ function phaseStatusFor(agentRows, isCurrent) {
|
|
|
47
50
|
const anyFailed = agentRows.some((row) => row.status === "failed");
|
|
48
51
|
if (anyFailed && !anyActive)
|
|
49
52
|
return "failed";
|
|
50
|
-
if (allFinished && !isCurrent)
|
|
51
|
-
|
|
53
|
+
if (allFinished && !isCurrent) {
|
|
54
|
+
const anyDone = agentRows.some((row) => row.status === "done");
|
|
55
|
+
return !anyDone && agentRows.some((row) => row.status === "cancelled") ? "cancelled" : "done";
|
|
56
|
+
}
|
|
57
|
+
if (total === 0 && !isCurrent && passed)
|
|
58
|
+
return "skipped";
|
|
52
59
|
if (isCurrent || anyActive)
|
|
53
60
|
return "running";
|
|
54
61
|
if (anyFinished)
|
|
@@ -64,7 +71,15 @@ function phaseElapsedMs(agentRows) {
|
|
|
64
71
|
function boundedTail(items, tailItems) {
|
|
65
72
|
return tailItems > 0 ? items.slice(-tailItems) : [];
|
|
66
73
|
}
|
|
67
|
-
function buildPhaseSnapshots(phases, agents, currentPhase, incomplete = false) {
|
|
74
|
+
function buildPhaseSnapshots(phases, agents, currentPhase, finished, incomplete = false) {
|
|
75
|
+
// The furthest phase the run has reached: the current one, or the latest phase any agent was
|
|
76
|
+
// started in. An agent-less phase before it was passed over, not still ahead; once the run has
|
|
77
|
+
// finished, every agent-less phase was (unless a degraded snapshot dropped its agents).
|
|
78
|
+
let reachedPhase = currentPhase ?? -1;
|
|
79
|
+
for (const row of agents) {
|
|
80
|
+
if (row.phase !== undefined && row.status !== "pending")
|
|
81
|
+
reachedPhase = Math.max(reachedPhase, row.phase);
|
|
82
|
+
}
|
|
68
83
|
return phases.map((phase, index) => {
|
|
69
84
|
const agentRows = agents.filter((row) => row.phase === index);
|
|
70
85
|
const agentIdx = agentRows.map((row) => row.i);
|
|
@@ -75,7 +90,7 @@ function buildPhaseSnapshots(phases, agents, currentPhase, incomplete = false) {
|
|
|
75
90
|
detail: phase.detail,
|
|
76
91
|
model: phase.model,
|
|
77
92
|
dynamic: phase.dynamic,
|
|
78
|
-
status: phaseStatusFor(agentRows, currentPhase === index),
|
|
93
|
+
status: phaseStatusFor(agentRows, currentPhase === index, index < reachedPhase || (finished && !incomplete)),
|
|
79
94
|
agentIdx,
|
|
80
95
|
done,
|
|
81
96
|
total: agentRows.length,
|
|
@@ -173,7 +188,7 @@ export function snapshotFromRun(run, options) {
|
|
|
173
188
|
args: run.workflow.args,
|
|
174
189
|
}
|
|
175
190
|
: undefined,
|
|
176
|
-
phases: buildPhaseSnapshots(phases, agents, run.status === "running" ? run.currentPhase : undefined),
|
|
191
|
+
phases: buildPhaseSnapshots(phases, agents, run.status === "running" ? run.currentPhase : undefined, run.status !== "running"),
|
|
177
192
|
currentPhase: run.currentPhase,
|
|
178
193
|
agents,
|
|
179
194
|
log: run.log.map((line) => line.text),
|
|
@@ -282,7 +297,7 @@ export function snapshotFromDetails(details, options) {
|
|
|
282
297
|
args: details.workflow.args,
|
|
283
298
|
}
|
|
284
299
|
: undefined,
|
|
285
|
-
phases: buildPhaseSnapshots(phases, agents, details.status === "running" ? details.currentPhase : undefined, details.agentsOmitted !== undefined),
|
|
300
|
+
phases: buildPhaseSnapshots(phases, agents, details.status === "running" ? details.currentPhase : undefined, details.status !== "running", details.agentsOmitted !== undefined),
|
|
286
301
|
currentPhase: details.currentPhase,
|
|
287
302
|
agents,
|
|
288
303
|
agentsOmitted: details.agentsOmitted,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../../../src/core/polyphase/render/snapshot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAkGvE,SAAS,WAAW;IACnB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE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AAE,OAAO,CAAC,GAAG,IAAI,EAAE;QACtB,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB;QACjD,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC;KAChC,CAAC;AACH,CAAC","sourcesContent":["/**\n * Render model: a plain-data snapshot of a run, taken either from the live store (`snapshotFromRun`)\n * or from persisted details (`snapshotFromDetails`). `render/run-block.ts` (P9) and `ui/inspector.ts`\n * (P10) consume only this snapshot, never `RunView`/`AgentView` or `PolyphaseDetails` directly, so the\n * same layout code renders live and archived runs identically.\n */\n\nimport type { ThinkingLevel } from \"@draht/agent-core\";\nimport { billableTokens, extractStatusLine } from \"../child-events.ts\";\nimport type { LimiterStats } from \"../limiter.ts\";\nimport type {\n\tAgentDetails,\n\tAgentStatus,\n\tAgentView,\n\tCancelReason,\n\tChildAgentState,\n\tModelSource,\n\tPhaseDetails,\n\tPhaseInfo,\n\tPolyphaseDetails,\n\tRunKind,\n\tRunOrigin,\n\tRunStatus,\n\tRunView,\n\tSubagentMode,\n\tTranscriptItem,\n\tWorkflowSource,\n} from \"../types.ts\";\n\nexport interface PhaseSnapshot {\n\tindex: number;\n\ttitle: string;\n\tdetail?: string;\n\tmodel?: string;\n\tdynamic: boolean;\n\tstatus: \"pending\" | \"running\" | \"done\" | \"failed\";\n\tagentIdx: number[];\n\tdone: number;\n\ttotal: number;\n\telapsedMs?: number;\n\t/** True when `done`/`total` are computed from a subset of agents (archived details with\n\t * `agentsOmitted`), so they must not be read as the phase's true totals. See `RunSnapshot.agentsOmitted`\n\t * for the omitted count. */\n\tincomplete?: boolean;\n}\n\nexport interface AgentSnapshotRow {\n\ti: number;\n\tlabel: string;\n\tagentType: string;\n\tphase?: number;\n\tstep?: number;\n\tstatus: AgentStatus;\n\tcancelReason?: CancelReason;\n\tprovider?: string;\n\tmodelId?: string;\n\tmodelText?: string;\n\tthinking?: ThinkingLevel;\n\tmodelSource?: ModelSource;\n\tmodelConfirmed?: boolean;\n\telapsedMs?: number;\n\tturns: number;\n\ttoolCalls: number;\n\ttools?: Record<string, number>;\n\ttokens: number;\n\tcost: number;\n\tblocked: number;\n\tblockedSample?: string;\n\ttask: string;\n\tnow?: string;\n\tstatusLine?: string;\n\toutput?: string;\n\terror?: string;\n\tmerge?: \"ok\" | \"failed\";\n\t/** Live only: the newest `tailItems` transcript items (references, not copies). */\n\ttail?: readonly TranscriptItem[];\n}\n\nexport interface RunSnapshot {\n\trunId: string;\n\tkind: RunKind;\n\torigin: RunOrigin;\n\tmode?: SubagentMode;\n\ttitle: string;\n\tstatus: RunStatus;\n\tlive: boolean;\n\tstartedAt: number;\n\telapsedMs: number;\n\tcounts: Record<AgentStatus, number>;\n\ttokens: number;\n\tcost: number;\n\tbudget?: { totalTokens: number; spentTokens: number; exhausted: boolean };\n\ttimeLimit?: { totalMs: number; reached: boolean };\n\tworkflow?: { name: string; description: string; source: WorkflowSource; args?: string };\n\tphases: PhaseSnapshot[];\n\tcurrentPhase?: number;\n\tagents: AgentSnapshotRow[];\n\tagentsOmitted?: { count: number; byStatus: Partial<Record<AgentStatus, number>> };\n\tlog: string[];\n\tresultPreview?: string;\n\terror?: string;\n\tblockedToolCalls: number;\n\tlimiter?: LimiterStats;\n\tversion: number;\n}\n\nfunction emptyCounts(): Record<AgentStatus, number> {\n\treturn { pending: 0, queued: 0, starting: 0, running: 0, done: 0, failed: 0, cancelled: 0, skipped: 0 };\n}\n\nconst ACTIVE_STATUSES: readonly AgentStatus[] = [\"running\", \"starting\"];\nconst FINISHED_STATUSES: readonly AgentStatus[] = [\"done\", \"failed\", \"cancelled\", \"skipped\"];\n\nfunction isActive(status: AgentStatus): boolean {\n\treturn ACTIVE_STATUSES.includes(status);\n}\n\nfunction isFinished(status: AgentStatus): boolean {\n\treturn FINISHED_STATUSES.includes(status);\n}\n\nfunction firstLine(text: string): string {\n\tconst idx = text.indexOf(\"\\n\");\n\treturn idx === -1 ? text : text.slice(0, idx);\n}\n\nfunction splitModel(model: string | undefined): { provider?: string; id?: string } {\n\tif (!model) return {};\n\tconst slash = model.indexOf(\"/\");\n\tif (slash === -1) return { id: model };\n\treturn { provider: model.slice(0, slash), id: model.slice(slash + 1) };\n}\n\n/**\n * Implements DESIGN §11.1's phase status rules, plus two deliberate extra rules the design's\n * unordered rule list leaves ambiguous (both pinned by tests in render-snapshot.test.ts):\n * 1. **Precedence is failed > done > running > pending.** A non-current phase whose agents all\n * finished with at least one failure reads \"failed\", not \"done\", because that is the more\n * actionable signal.\n * 2. **A non-current phase with some finished and some not-yet-started (queued/pending) agents,\n * but none active, reads \"running\" rather than falling through to \"pending\".** \"Pending\" is\n * reserved for phases where no agent has made any progress yet; partial progress should not\n * look identical to \"not started\".\n */\nfunction phaseStatusFor(agentRows: readonly AgentSnapshotRow[], isCurrent: boolean): PhaseSnapshot[\"status\"] {\n\tconst total = agentRows.length;\n\tconst anyActive = agentRows.some((row) => isActive(row.status));\n\tconst anyFinished = agentRows.some((row) => isFinished(row.status));\n\tconst allFinished = total > 0 && agentRows.every((row) => isFinished(row.status));\n\tconst anyFailed = agentRows.some((row) => row.status === \"failed\");\n\tif (anyFailed && !anyActive) return \"failed\";\n\tif (allFinished && !isCurrent) return \"done\";\n\tif (isCurrent || anyActive) return \"running\";\n\tif (anyFinished) return \"running\";\n\treturn \"pending\";\n}\n\nfunction phaseElapsedMs(agentRows: readonly AgentSnapshotRow[]): number | undefined {\n\tconst withElapsed = agentRows.map((row) => row.elapsedMs).filter((ms): ms is number => ms !== undefined);\n\tif (withElapsed.length === 0) return undefined;\n\treturn Math.max(...withElapsed);\n}\n\nfunction boundedTail(items: readonly TranscriptItem[], tailItems: number): readonly TranscriptItem[] {\n\treturn tailItems > 0 ? items.slice(-tailItems) : [];\n}\n\nfunction buildPhaseSnapshots(\n\tphases: readonly { title: string; detail?: string; model?: string; dynamic: boolean }[],\n\tagents: readonly AgentSnapshotRow[],\n\tcurrentPhase: number | undefined,\n\tincomplete = false,\n): PhaseSnapshot[] {\n\treturn phases.map((phase, index) => {\n\t\tconst agentRows = agents.filter((row) => row.phase === index);\n\t\tconst agentIdx = agentRows.map((row) => row.i);\n\t\tconst done = agentRows.filter((row) => row.status === \"done\").length;\n\t\treturn {\n\t\t\tindex,\n\t\t\ttitle: phase.title,\n\t\t\tdetail: phase.detail,\n\t\t\tmodel: phase.model,\n\t\t\tdynamic: phase.dynamic,\n\t\t\tstatus: phaseStatusFor(agentRows, currentPhase === index),\n\t\t\tagentIdx,\n\t\t\tdone,\n\t\t\ttotal: agentRows.length,\n\t\t\telapsedMs: phaseElapsedMs(agentRows),\n\t\t\t...(incomplete ? { incomplete: true } : {}),\n\t\t};\n\t});\n}\n\nfunction rowFromAgentView(agent: AgentView, now: number, tailItems: number): AgentSnapshotRow {\n\tconst state: Readonly<ChildAgentState> = agent.state;\n\tconst tokens = billableTokens(state.usage) + billableTokens(state.liveUsage);\n\tconst cost = (state.usage?.cost.total ?? 0) + (state.liveUsage?.cost.total ?? 0);\n\tconst firstBlocked = state.blocked[0];\n\tconst result = agent.result;\n\t// Matches details.ts's buildAgentDetails: gate on status, and prefer stderr over errorMessage\n\t// (details.ts: `agent.result?.stderr || agent.state.errorMessage`), so the error text does not\n\t// change when a row switches from the live store to persisted details at completion.\n\tconst isFailureStatus = agent.status === \"failed\" || agent.status === \"cancelled\";\n\tconst errorSource = result?.stderr || state.errorMessage;\n\tconst error = isFailureStatus && errorSource ? firstLine(errorSource) : undefined;\n\tconst elapsedMs = state.startedAt === undefined ? undefined : Math.max(0, (state.endedAt ?? now) - state.startedAt);\n\tconst resolved = Boolean(state.model.provider && state.model.id);\n\tconst modelText =\n\t\t!state.model.confirmed && !resolved\n\t\t\t? (state.model.requested ?? (state.model.source === \"child-default\" ? \"default model\" : undefined))\n\t\t\t: undefined;\n\treturn {\n\t\ti: agent.index,\n\t\tlabel: agent.label,\n\t\tagentType: agent.agentType,\n\t\tphase: agent.phase,\n\t\tstep: agent.step,\n\t\tstatus: agent.status,\n\t\tcancelReason: agent.cancelReason,\n\t\tprovider: state.model.provider,\n\t\tmodelId: state.model.id,\n\t\tmodelText,\n\t\t// Matches details.ts's buildAgentDetails, which writes `thinking` only from the confirmed\n\t\t// `state.model.thinkingLevel`, never from `requestedThinking`. A queued/pending agent's\n\t\t// requested thinking level is therefore not shown until the child confirms it.\n\t\tthinking: state.model.thinkingLevel,\n\t\tmodelSource: state.model.source,\n\t\tmodelConfirmed: state.model.confirmed,\n\t\telapsedMs,\n\t\tturns: state.turns,\n\t\ttoolCalls: state.toolCalls,\n\t\ttools: Object.keys(state.toolCounts).length > 0 ? state.toolCounts : undefined,\n\t\ttokens,\n\t\tcost,\n\t\tblocked: state.blockedCount,\n\t\tblockedSample: firstBlocked ? `${firstBlocked.toolName}: ${firstBlocked.summary}` : undefined,\n\t\ttask: agent.task,\n\t\tnow: isFinished(agent.status) ? undefined : state.nowLine || undefined,\n\t\tstatusLine: extractStatusLine(result?.output ?? state.finalText),\n\t\toutput: result?.output,\n\t\terror,\n\t\tmerge: result?.merge ? (result.merge.success ? \"ok\" : \"failed\") : undefined,\n\t\ttail: boundedTail(state.transcript, tailItems),\n\t};\n}\n\n/** Live view of a run, taken from the store. `tailItems` bounds `AgentSnapshotRow.tail`. */\nexport function snapshotFromRun(\n\trun: RunView,\n\toptions: { now: number; tailItems: number; limiter?: LimiterStats },\n): RunSnapshot {\n\tconst counts = emptyCounts();\n\tconst agents = run.agents.map((agent) => {\n\t\tconst row = rowFromAgentView(agent, options.now, options.tailItems);\n\t\tcounts[row.status]++;\n\t\treturn row;\n\t});\n\tconst tokens = agents.reduce((sum, row) => sum + row.tokens, 0);\n\tconst cost = agents.reduce((sum, row) => sum + row.cost, 0);\n\tconst blockedToolCalls = agents.reduce((sum, row) => sum + row.blocked, 0);\n\tconst phases: readonly PhaseInfo[] = run.phases;\n\tconst elapsedMs = Math.max(0, (run.endedAt ?? options.now) - run.startedAt);\n\treturn {\n\t\trunId: run.id,\n\t\tkind: run.kind,\n\t\torigin: run.origin,\n\t\tmode: run.mode,\n\t\ttitle: run.title,\n\t\tstatus: run.status,\n\t\tlive: true,\n\t\tstartedAt: run.startedAt,\n\t\telapsedMs,\n\t\tcounts,\n\t\ttokens,\n\t\tcost,\n\t\tbudget: run.budget.totalTokens === null ? undefined : { ...run.budget, totalTokens: run.budget.totalTokens },\n\t\ttimeLimit:\n\t\t\trun.timeLimit?.totalMs === null || run.timeLimit?.totalMs === undefined\n\t\t\t\t? undefined\n\t\t\t\t: { totalMs: run.timeLimit.totalMs, reached: run.timeLimit.reached },\n\t\tworkflow: run.workflow\n\t\t\t? {\n\t\t\t\t\tname: run.workflow.name,\n\t\t\t\t\tdescription: run.workflow.description,\n\t\t\t\t\tsource: run.workflow.source,\n\t\t\t\t\targs: run.workflow.args,\n\t\t\t\t}\n\t\t\t: undefined,\n\t\tphases: buildPhaseSnapshots(phases, agents, run.status === \"running\" ? run.currentPhase : undefined),\n\t\tcurrentPhase: run.currentPhase,\n\t\tagents,\n\t\tlog: run.log.map((line) => line.text),\n\t\tresultPreview: run.resultPreview,\n\t\terror: run.error,\n\t\tblockedToolCalls,\n\t\tlimiter: options.limiter,\n\t\tversion: run.version,\n\t};\n}\n\nfunction rowFromAgentDetails(d: AgentDetails, now: number): AgentSnapshotRow {\n\t// details.ts's modelText() writes \"provider/id\" when both are known, else the raw requested\n\t// pattern verbatim (§9.2). A requested pattern can itself contain a \"/\" (e.g. a frontmatter\n\t// model written as \"anthropic/claude-opus\"), so a resolved value cannot be told apart from an\n\t// unresolved one by searching for a slash; that inference wrongly split such patterns.\n\t// Override, phase and inherited sources always resolve provider/id before the child even\n\t// starts (model-selection.ts), so `model` is \"provider/id\" for them regardless of confirmation.\n\t// Frontmatter is the only source whose pre-confirmation display resolution is ambiguous from\n\t// `model` alone, so it is treated as resolved only once `modelConfirmed` is true; `child-default`\n\t// never sets `model` while unconfirmed (modelText() returns `requested`, which is undefined).\n\tconst resolved =\n\t\td.model !== undefined &&\n\t\t(d.modelConfirmed === true ||\n\t\t\td.modelSource === \"override\" ||\n\t\t\td.modelSource === \"phase\" ||\n\t\t\td.modelSource === \"inherited\");\n\tconst split = resolved ? splitModel(d.model) : {};\n\tconst modelText = resolved\n\t\t? undefined\n\t\t: (d.model ?? (d.modelSource === \"child-default\" ? \"default model\" : undefined));\n\tconst elapsedMs = d.startedAt === undefined ? undefined : Math.max(0, (d.endedAt ?? now) - d.startedAt);\n\tconst isFailureStatus = d.status === \"failed\" || d.status === \"cancelled\";\n\treturn {\n\t\ti: d.i,\n\t\tlabel: d.label,\n\t\tagentType: d.agent,\n\t\tphase: d.phase,\n\t\tstep: d.step,\n\t\tstatus: d.status,\n\t\tcancelReason: d.cancelReason,\n\t\tprovider: split.provider,\n\t\tmodelId: split.id,\n\t\tmodelText,\n\t\tthinking: d.thinking,\n\t\tmodelSource: d.modelSource,\n\t\tmodelConfirmed: d.modelConfirmed,\n\t\telapsedMs,\n\t\tturns: d.turns ?? 0,\n\t\ttoolCalls: d.toolCalls ?? 0,\n\t\ttools: d.tools,\n\t\ttokens: d.tokens ?? 0,\n\t\tcost: d.cost ?? 0,\n\t\tblocked: d.blocked ?? 0,\n\t\tblockedSample: d.blockedSample,\n\t\ttask: d.task,\n\t\tnow: d.now,\n\t\tstatusLine: d.statusLine,\n\t\toutput: d.output,\n\t\terror: isFailureStatus ? d.error : undefined,\n\t\tmerge: d.merge,\n\t};\n}\n\nfunction phaseInfoFromDetails(phase: PhaseDetails): {\n\ttitle: string;\n\tdetail?: string;\n\tmodel?: string;\n\tdynamic: boolean;\n} {\n\treturn { title: phase.title, detail: phase.detail, model: phase.model, dynamic: phase.dynamic ?? false };\n}\n\n/** Cheap djb2 hash of the whole payload, so a line cache keyed on `RunSnapshot.version` (§11.2)\n * invalidates on every field a renderer can show (model confirmation, log lines, resultPreview,\n * agent `now`/tokens, degradation level, ...), not only status/endedAt/totals.byStatus. Details are\n * capped at `FINAL_DETAILS_MAX_BYTES`/`PARTIAL_DETAILS_MAX_BYTES`, so stringifying them is cheap.\n * `PolyphaseDetails` carries no version counter of its own. */\nfunction detailsVersion(details: PolyphaseDetails): number {\n\tconst fingerprint = JSON.stringify(details);\n\tlet hash = 5381;\n\tfor (let i = 0; i < fingerprint.length; i++) {\n\t\thash = (hash * 33) ^ fingerprint.charCodeAt(i);\n\t}\n\treturn hash >>> 0;\n}\n\n/** Archived or persisted view of a run, taken from `PolyphaseDetails`. No transcript is available, so\n * every `AgentSnapshotRow.tail` is left undefined. */\nexport function snapshotFromDetails(details: PolyphaseDetails, options?: { now?: number }): RunSnapshot {\n\tconst now = options?.now ?? Date.now();\n\tconst agents = details.agents.map((agent) => rowFromAgentDetails(agent, now));\n\tconst counts: Record<AgentStatus, number> = { ...emptyCounts(), ...details.totals.byStatus };\n\tconst phases = (details.phases ?? []).map(phaseInfoFromDetails);\n\tconst elapsedMs = Math.max(0, (details.endedAt ?? now) - details.startedAt);\n\treturn {\n\t\trunId: details.runId,\n\t\tkind: details.kind,\n\t\torigin: details.origin,\n\t\tmode: details.mode,\n\t\ttitle: details.title,\n\t\tstatus: details.status,\n\t\tlive: false,\n\t\tstartedAt: details.startedAt,\n\t\telapsedMs,\n\t\tcounts,\n\t\ttokens: details.totals.tokens,\n\t\tcost: details.totals.cost,\n\t\tbudget: details.budget,\n\t\ttimeLimit: details.timeLimit,\n\t\tworkflow: details.workflow\n\t\t\t? {\n\t\t\t\t\tname: details.workflow.name,\n\t\t\t\t\tdescription: details.workflow.description,\n\t\t\t\t\tsource: details.workflow.source,\n\t\t\t\t\targs: details.workflow.args,\n\t\t\t\t}\n\t\t\t: undefined,\n\t\tphases: buildPhaseSnapshots(\n\t\t\tphases,\n\t\t\tagents,\n\t\t\tdetails.status === \"running\" ? details.currentPhase : undefined,\n\t\t\tdetails.agentsOmitted !== undefined,\n\t\t),\n\t\tcurrentPhase: details.currentPhase,\n\t\tagents,\n\t\tagentsOmitted: details.agentsOmitted,\n\t\tlog: details.log ?? [],\n\t\tresultPreview: details.resultPreview,\n\t\terror: details.error,\n\t\tblockedToolCalls: details.totals.blockedToolCalls,\n\t\tversion: detailsVersion(details),\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../../../src/core/polyphase/render/snapshot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAkGvE,SAAS,WAAW;IACnB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AACzG,CAAC;AAED,MAAM,eAAe,GAA2B,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AACxE,MAAM,iBAAiB,GAA2B,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAE7F,SAAS,QAAQ,CAAC,MAAmB;IACpC,OAAO,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,UAAU,CAAC,MAAmB;IACtC,OAAO,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,UAAU,CAAC,KAAyB;IAC5C,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC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;QACN,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE;QACtB,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB;QACjD,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC;KAChC,CAAC;AACH,CAAC","sourcesContent":["/**\n * Render model: a plain-data snapshot of a run, taken either from the live store (`snapshotFromRun`)\n * or from persisted details (`snapshotFromDetails`). `render/run-block.ts` (P9) and `ui/inspector.ts`\n * (P10) consume only this snapshot, never `RunView`/`AgentView` or `PolyphaseDetails` directly, so the\n * same layout code renders live and archived runs identically.\n */\n\nimport type { ThinkingLevel } from \"@draht/agent-core\";\nimport { billableTokens, extractStatusLine } from \"../child-events.ts\";\nimport type { LimiterStats } from \"../limiter.ts\";\nimport type {\n\tAgentDetails,\n\tAgentStatus,\n\tAgentView,\n\tCancelReason,\n\tChildAgentState,\n\tModelSource,\n\tPhaseDetails,\n\tPhaseInfo,\n\tPolyphaseDetails,\n\tRunKind,\n\tRunOrigin,\n\tRunStatus,\n\tRunView,\n\tSubagentMode,\n\tTranscriptItem,\n\tWorkflowSource,\n} from \"../types.ts\";\n\nexport interface PhaseSnapshot {\n\tindex: number;\n\ttitle: string;\n\tdetail?: string;\n\tmodel?: string;\n\tdynamic: boolean;\n\tstatus: \"pending\" | \"running\" | \"done\" | \"failed\" | \"cancelled\" | \"skipped\";\n\tagentIdx: number[];\n\tdone: number;\n\ttotal: number;\n\telapsedMs?: number;\n\t/** True when `done`/`total` are computed from a subset of agents (archived details with\n\t * `agentsOmitted`), so they must not be read as the phase's true totals. See `RunSnapshot.agentsOmitted`\n\t * for the omitted count. */\n\tincomplete?: boolean;\n}\n\nexport interface AgentSnapshotRow {\n\ti: number;\n\tlabel: string;\n\tagentType: string;\n\tphase?: number;\n\tstep?: number;\n\tstatus: AgentStatus;\n\tcancelReason?: CancelReason;\n\tprovider?: string;\n\tmodelId?: string;\n\tmodelText?: string;\n\tthinking?: ThinkingLevel;\n\tmodelSource?: ModelSource;\n\tmodelConfirmed?: boolean;\n\telapsedMs?: number;\n\tturns: number;\n\ttoolCalls: number;\n\ttools?: Record<string, number>;\n\ttokens: number;\n\tcost: number;\n\tblocked: number;\n\tblockedSample?: string;\n\ttask: string;\n\tnow?: string;\n\tstatusLine?: string;\n\toutput?: string;\n\terror?: string;\n\tmerge?: \"ok\" | \"failed\";\n\t/** Live only: the newest `tailItems` transcript items (references, not copies). */\n\ttail?: readonly TranscriptItem[];\n}\n\nexport interface RunSnapshot {\n\trunId: string;\n\tkind: RunKind;\n\torigin: RunOrigin;\n\tmode?: SubagentMode;\n\ttitle: string;\n\tstatus: RunStatus;\n\tlive: boolean;\n\tstartedAt: number;\n\telapsedMs: number;\n\tcounts: Record<AgentStatus, number>;\n\ttokens: number;\n\tcost: number;\n\tbudget?: { totalTokens: number; spentTokens: number; exhausted: boolean };\n\ttimeLimit?: { totalMs: number; reached: boolean };\n\tworkflow?: { name: string; description: string; source: WorkflowSource; args?: string };\n\tphases: PhaseSnapshot[];\n\tcurrentPhase?: number;\n\tagents: AgentSnapshotRow[];\n\tagentsOmitted?: { count: number; byStatus: Partial<Record<AgentStatus, number>> };\n\tlog: string[];\n\tresultPreview?: string;\n\terror?: string;\n\tblockedToolCalls: number;\n\tlimiter?: LimiterStats;\n\tversion: number;\n}\n\nfunction emptyCounts(): Record<AgentStatus, number> {\n\treturn { pending: 0, queued: 0, starting: 0, running: 0, done: 0, failed: 0, cancelled: 0, skipped: 0 };\n}\n\nconst ACTIVE_STATUSES: readonly AgentStatus[] = [\"running\", \"starting\"];\nconst FINISHED_STATUSES: readonly AgentStatus[] = [\"done\", \"failed\", \"cancelled\", \"skipped\"];\n\nfunction isActive(status: AgentStatus): boolean {\n\treturn ACTIVE_STATUSES.includes(status);\n}\n\nfunction isFinished(status: AgentStatus): boolean {\n\treturn FINISHED_STATUSES.includes(status);\n}\n\nfunction firstLine(text: string): string {\n\tconst idx = text.indexOf(\"\\n\");\n\treturn idx === -1 ? text : text.slice(0, idx);\n}\n\nfunction splitModel(model: string | undefined): { provider?: string; id?: string } {\n\tif (!model) return {};\n\tconst slash = model.indexOf(\"/\");\n\tif (slash === -1) return { id: model };\n\treturn { provider: model.slice(0, slash), id: model.slice(slash + 1) };\n}\n\n/**\n * Implements DESIGN §11.1's phase status rules, plus two deliberate extra rules the design's\n * unordered rule list leaves ambiguous (both pinned by tests in render-snapshot.test.ts):\n * 1. **Precedence is failed > done > running > pending.** A non-current phase whose agents all\n * finished with at least one failure reads \"failed\", not \"done\", because that is the more\n * actionable signal.\n * 2. **A non-current phase with some finished and some not-yet-started (queued/pending) agents,\n * but none active, reads \"running\" rather than falling through to \"pending\".** \"Pending\" is\n * reserved for phases where no agent has made any progress yet; partial progress should not\n * look identical to \"not started\".\n * 3. **A finished phase with no `done` agent but at least one cancelled one reads \"cancelled\"**, and\n * **a phase without agents that the run has already moved past reads \"skipped\"**, so neither\n * shows the `done` or `pending` glyph for work that never happened.\n */\nfunction phaseStatusFor(\n\tagentRows: readonly AgentSnapshotRow[],\n\tisCurrent: boolean,\n\tpassed: boolean,\n): PhaseSnapshot[\"status\"] {\n\tconst total = agentRows.length;\n\tconst anyActive = agentRows.some((row) => isActive(row.status));\n\tconst anyFinished = agentRows.some((row) => isFinished(row.status));\n\tconst allFinished = total > 0 && agentRows.every((row) => isFinished(row.status));\n\tconst anyFailed = agentRows.some((row) => row.status === \"failed\");\n\tif (anyFailed && !anyActive) return \"failed\";\n\tif (allFinished && !isCurrent) {\n\t\tconst anyDone = agentRows.some((row) => row.status === \"done\");\n\t\treturn !anyDone && agentRows.some((row) => row.status === \"cancelled\") ? \"cancelled\" : \"done\";\n\t}\n\tif (total === 0 && !isCurrent && passed) return \"skipped\";\n\tif (isCurrent || anyActive) return \"running\";\n\tif (anyFinished) return \"running\";\n\treturn \"pending\";\n}\n\nfunction phaseElapsedMs(agentRows: readonly AgentSnapshotRow[]): number | undefined {\n\tconst withElapsed = agentRows.map((row) => row.elapsedMs).filter((ms): ms is number => ms !== undefined);\n\tif (withElapsed.length === 0) return undefined;\n\treturn Math.max(...withElapsed);\n}\n\nfunction boundedTail(items: readonly TranscriptItem[], tailItems: number): readonly TranscriptItem[] {\n\treturn tailItems > 0 ? items.slice(-tailItems) : [];\n}\n\nfunction buildPhaseSnapshots(\n\tphases: readonly { title: string; detail?: string; model?: string; dynamic: boolean }[],\n\tagents: readonly AgentSnapshotRow[],\n\tcurrentPhase: number | undefined,\n\tfinished: boolean,\n\tincomplete = false,\n): PhaseSnapshot[] {\n\t// The furthest phase the run has reached: the current one, or the latest phase any agent was\n\t// started in. An agent-less phase before it was passed over, not still ahead; once the run has\n\t// finished, every agent-less phase was (unless a degraded snapshot dropped its agents).\n\tlet reachedPhase = currentPhase ?? -1;\n\tfor (const row of agents) {\n\t\tif (row.phase !== undefined && row.status !== \"pending\") reachedPhase = Math.max(reachedPhase, row.phase);\n\t}\n\treturn phases.map((phase, index) => {\n\t\tconst agentRows = agents.filter((row) => row.phase === index);\n\t\tconst agentIdx = agentRows.map((row) => row.i);\n\t\tconst done = agentRows.filter((row) => row.status === \"done\").length;\n\t\treturn {\n\t\t\tindex,\n\t\t\ttitle: phase.title,\n\t\t\tdetail: phase.detail,\n\t\t\tmodel: phase.model,\n\t\t\tdynamic: phase.dynamic,\n\t\t\tstatus: phaseStatusFor(agentRows, currentPhase === index, index < reachedPhase || (finished && !incomplete)),\n\t\t\tagentIdx,\n\t\t\tdone,\n\t\t\ttotal: agentRows.length,\n\t\t\telapsedMs: phaseElapsedMs(agentRows),\n\t\t\t...(incomplete ? { incomplete: true } : {}),\n\t\t};\n\t});\n}\n\nfunction rowFromAgentView(agent: AgentView, now: number, tailItems: number): AgentSnapshotRow {\n\tconst state: Readonly<ChildAgentState> = agent.state;\n\tconst tokens = billableTokens(state.usage) + billableTokens(state.liveUsage);\n\tconst cost = (state.usage?.cost.total ?? 0) + (state.liveUsage?.cost.total ?? 0);\n\tconst firstBlocked = state.blocked[0];\n\tconst result = agent.result;\n\t// Matches details.ts's buildAgentDetails: gate on status, and prefer stderr over errorMessage\n\t// (details.ts: `agent.result?.stderr || agent.state.errorMessage`), so the error text does not\n\t// change when a row switches from the live store to persisted details at completion.\n\tconst isFailureStatus = agent.status === \"failed\" || agent.status === \"cancelled\";\n\tconst errorSource = result?.stderr || state.errorMessage;\n\tconst error = isFailureStatus && errorSource ? firstLine(errorSource) : undefined;\n\tconst elapsedMs = state.startedAt === undefined ? undefined : Math.max(0, (state.endedAt ?? now) - state.startedAt);\n\tconst resolved = Boolean(state.model.provider && state.model.id);\n\tconst modelText =\n\t\t!state.model.confirmed && !resolved\n\t\t\t? (state.model.requested ?? (state.model.source === \"child-default\" ? \"default model\" : undefined))\n\t\t\t: undefined;\n\treturn {\n\t\ti: agent.index,\n\t\tlabel: agent.label,\n\t\tagentType: agent.agentType,\n\t\tphase: agent.phase,\n\t\tstep: agent.step,\n\t\tstatus: agent.status,\n\t\tcancelReason: agent.cancelReason,\n\t\tprovider: state.model.provider,\n\t\tmodelId: state.model.id,\n\t\tmodelText,\n\t\t// Matches details.ts's buildAgentDetails, which writes `thinking` only from the confirmed\n\t\t// `state.model.thinkingLevel`, never from `requestedThinking`. A queued/pending agent's\n\t\t// requested thinking level is therefore not shown until the child confirms it.\n\t\tthinking: state.model.thinkingLevel,\n\t\tmodelSource: state.model.source,\n\t\tmodelConfirmed: state.model.confirmed,\n\t\telapsedMs,\n\t\tturns: state.turns,\n\t\ttoolCalls: state.toolCalls,\n\t\ttools: Object.keys(state.toolCounts).length > 0 ? state.toolCounts : undefined,\n\t\ttokens,\n\t\tcost,\n\t\tblocked: state.blockedCount,\n\t\tblockedSample: firstBlocked ? `${firstBlocked.toolName}: ${firstBlocked.summary}` : undefined,\n\t\ttask: agent.task,\n\t\tnow: isFinished(agent.status) ? undefined : state.nowLine || undefined,\n\t\tstatusLine: extractStatusLine(result?.output ?? state.finalText),\n\t\toutput: result?.output,\n\t\terror,\n\t\tmerge: result?.merge ? (result.merge.success ? \"ok\" : \"failed\") : undefined,\n\t\ttail: boundedTail(state.transcript, tailItems),\n\t};\n}\n\n/** Live view of a run, taken from the store. `tailItems` bounds `AgentSnapshotRow.tail`. */\nexport function snapshotFromRun(\n\trun: RunView,\n\toptions: { now: number; tailItems: number; limiter?: LimiterStats },\n): RunSnapshot {\n\tconst counts = emptyCounts();\n\tconst agents = run.agents.map((agent) => {\n\t\tconst row = rowFromAgentView(agent, options.now, options.tailItems);\n\t\tcounts[row.status]++;\n\t\treturn row;\n\t});\n\tconst tokens = agents.reduce((sum, row) => sum + row.tokens, 0);\n\tconst cost = agents.reduce((sum, row) => sum + row.cost, 0);\n\tconst blockedToolCalls = agents.reduce((sum, row) => sum + row.blocked, 0);\n\tconst phases: readonly PhaseInfo[] = run.phases;\n\tconst elapsedMs = Math.max(0, (run.endedAt ?? options.now) - run.startedAt);\n\treturn {\n\t\trunId: run.id,\n\t\tkind: run.kind,\n\t\torigin: run.origin,\n\t\tmode: run.mode,\n\t\ttitle: run.title,\n\t\tstatus: run.status,\n\t\tlive: true,\n\t\tstartedAt: run.startedAt,\n\t\telapsedMs,\n\t\tcounts,\n\t\ttokens,\n\t\tcost,\n\t\tbudget: run.budget.totalTokens === null ? undefined : { ...run.budget, totalTokens: run.budget.totalTokens },\n\t\ttimeLimit:\n\t\t\trun.timeLimit?.totalMs === null || run.timeLimit?.totalMs === undefined\n\t\t\t\t? undefined\n\t\t\t\t: { totalMs: run.timeLimit.totalMs, reached: run.timeLimit.reached },\n\t\tworkflow: run.workflow\n\t\t\t? {\n\t\t\t\t\tname: run.workflow.name,\n\t\t\t\t\tdescription: run.workflow.description,\n\t\t\t\t\tsource: run.workflow.source,\n\t\t\t\t\targs: run.workflow.args,\n\t\t\t\t}\n\t\t\t: undefined,\n\t\tphases: buildPhaseSnapshots(\n\t\t\tphases,\n\t\t\tagents,\n\t\t\trun.status === \"running\" ? run.currentPhase : undefined,\n\t\t\trun.status !== \"running\",\n\t\t),\n\t\tcurrentPhase: run.currentPhase,\n\t\tagents,\n\t\tlog: run.log.map((line) => line.text),\n\t\tresultPreview: run.resultPreview,\n\t\terror: run.error,\n\t\tblockedToolCalls,\n\t\tlimiter: options.limiter,\n\t\tversion: run.version,\n\t};\n}\n\nfunction rowFromAgentDetails(d: AgentDetails, now: number): AgentSnapshotRow {\n\t// details.ts's modelText() writes \"provider/id\" when both are known, else the raw requested\n\t// pattern verbatim (§9.2). A requested pattern can itself contain a \"/\" (e.g. a frontmatter\n\t// model written as \"anthropic/claude-opus\"), so a resolved value cannot be told apart from an\n\t// unresolved one by searching for a slash; that inference wrongly split such patterns.\n\t// Override, phase and inherited sources always resolve provider/id before the child even\n\t// starts (model-selection.ts), so `model` is \"provider/id\" for them regardless of confirmation.\n\t// Frontmatter is the only source whose pre-confirmation display resolution is ambiguous from\n\t// `model` alone, so it is treated as resolved only once `modelConfirmed` is true; `child-default`\n\t// never sets `model` while unconfirmed (modelText() returns `requested`, which is undefined).\n\tconst resolved =\n\t\td.model !== undefined &&\n\t\t(d.modelConfirmed === true ||\n\t\t\td.modelSource === \"override\" ||\n\t\t\td.modelSource === \"phase\" ||\n\t\t\td.modelSource === \"inherited\");\n\tconst split = resolved ? splitModel(d.model) : {};\n\tconst modelText = resolved\n\t\t? undefined\n\t\t: (d.model ?? (d.modelSource === \"child-default\" ? \"default model\" : undefined));\n\tconst elapsedMs = d.startedAt === undefined ? undefined : Math.max(0, (d.endedAt ?? now) - d.startedAt);\n\tconst isFailureStatus = d.status === \"failed\" || d.status === \"cancelled\";\n\treturn {\n\t\ti: d.i,\n\t\tlabel: d.label,\n\t\tagentType: d.agent,\n\t\tphase: d.phase,\n\t\tstep: d.step,\n\t\tstatus: d.status,\n\t\tcancelReason: d.cancelReason,\n\t\tprovider: split.provider,\n\t\tmodelId: split.id,\n\t\tmodelText,\n\t\tthinking: d.thinking,\n\t\tmodelSource: d.modelSource,\n\t\tmodelConfirmed: d.modelConfirmed,\n\t\telapsedMs,\n\t\tturns: d.turns ?? 0,\n\t\ttoolCalls: d.toolCalls ?? 0,\n\t\ttools: d.tools,\n\t\ttokens: d.tokens ?? 0,\n\t\tcost: d.cost ?? 0,\n\t\tblocked: d.blocked ?? 0,\n\t\tblockedSample: d.blockedSample,\n\t\ttask: d.task,\n\t\tnow: d.now,\n\t\tstatusLine: d.statusLine,\n\t\toutput: d.output,\n\t\terror: isFailureStatus ? d.error : undefined,\n\t\tmerge: d.merge,\n\t};\n}\n\nfunction phaseInfoFromDetails(phase: PhaseDetails): {\n\ttitle: string;\n\tdetail?: string;\n\tmodel?: string;\n\tdynamic: boolean;\n} {\n\treturn { title: phase.title, detail: phase.detail, model: phase.model, dynamic: phase.dynamic ?? false };\n}\n\n/** Cheap djb2 hash of the whole payload, so a line cache keyed on `RunSnapshot.version` (§11.2)\n * invalidates on every field a renderer can show (model confirmation, log lines, resultPreview,\n * agent `now`/tokens, degradation level, ...), not only status/endedAt/totals.byStatus. Details are\n * capped at `FINAL_DETAILS_MAX_BYTES`/`PARTIAL_DETAILS_MAX_BYTES`, so stringifying them is cheap.\n * `PolyphaseDetails` carries no version counter of its own. */\nfunction detailsVersion(details: PolyphaseDetails): number {\n\tconst fingerprint = JSON.stringify(details);\n\tlet hash = 5381;\n\tfor (let i = 0; i < fingerprint.length; i++) {\n\t\thash = (hash * 33) ^ fingerprint.charCodeAt(i);\n\t}\n\treturn hash >>> 0;\n}\n\n/** Archived or persisted view of a run, taken from `PolyphaseDetails`. No transcript is available, so\n * every `AgentSnapshotRow.tail` is left undefined. */\nexport function snapshotFromDetails(details: PolyphaseDetails, options?: { now?: number }): RunSnapshot {\n\tconst now = options?.now ?? Date.now();\n\tconst agents = details.agents.map((agent) => rowFromAgentDetails(agent, now));\n\tconst counts: Record<AgentStatus, number> = { ...emptyCounts(), ...details.totals.byStatus };\n\tconst phases = (details.phases ?? []).map(phaseInfoFromDetails);\n\tconst elapsedMs = Math.max(0, (details.endedAt ?? now) - details.startedAt);\n\treturn {\n\t\trunId: details.runId,\n\t\tkind: details.kind,\n\t\torigin: details.origin,\n\t\tmode: details.mode,\n\t\ttitle: details.title,\n\t\tstatus: details.status,\n\t\tlive: false,\n\t\tstartedAt: details.startedAt,\n\t\telapsedMs,\n\t\tcounts,\n\t\ttokens: details.totals.tokens,\n\t\tcost: details.totals.cost,\n\t\tbudget: details.budget,\n\t\ttimeLimit: details.timeLimit,\n\t\tworkflow: details.workflow\n\t\t\t? {\n\t\t\t\t\tname: details.workflow.name,\n\t\t\t\t\tdescription: details.workflow.description,\n\t\t\t\t\tsource: details.workflow.source,\n\t\t\t\t\targs: details.workflow.args,\n\t\t\t\t}\n\t\t\t: undefined,\n\t\tphases: buildPhaseSnapshots(\n\t\t\tphases,\n\t\t\tagents,\n\t\t\tdetails.status === \"running\" ? details.currentPhase : undefined,\n\t\t\tdetails.status !== \"running\",\n\t\t\tdetails.agentsOmitted !== undefined,\n\t\t),\n\t\tcurrentPhase: details.currentPhase,\n\t\tagents,\n\t\tagentsOmitted: details.agentsOmitted,\n\t\tlog: details.log ?? [],\n\t\tresultPreview: details.resultPreview,\n\t\terror: details.error,\n\t\tblockedToolCalls: details.totals.blockedToolCalls,\n\t\tversion: detailsVersion(details),\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dock.d.ts","sourceRoot":"","sources":["../../../../src/core/polyphase/ui/dock.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAIvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"dock.d.ts","sourceRoot":"","sources":["../../../../src/core/polyphase/ui/dock.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAIvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAStD,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACnB;AAqED,uGAAuG;AACvG,qBAAa,aAAc,YAAW,SAAS;IAC9C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoB;IACzC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IACzC,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,WAAW,CAAgB;IAEnC,YAAY,IAAI,EAAE,iBAAiB,EAKlC;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA8C9B;IAED,UAAU,IAAI,IAAI,CAEjB;IAED,OAAO,IAAI,IAAI,CAEd;IAED,OAAO,CAAC,GAAG;CAGX"}
|
|
@@ -4,11 +4,14 @@
|
|
|
4
4
|
* Owns no timers: it reads the store at render time and asks the TUI to re-render on every flush.
|
|
5
5
|
*/
|
|
6
6
|
import { keyHint } from "../../../modes/interactive/components/keybinding-hints.js";
|
|
7
|
-
import { fitLine, formatCost, spinnerFrame } from "../render/format.js";
|
|
8
|
-
import { layoutRun } from "../render/run-block.js";
|
|
7
|
+
import { columns, fitLine, formatCost, formatDuration, spinnerFrame, statusGlyph } from "../render/format.js";
|
|
8
|
+
import { layoutRun, sanitizeChildText } from "../render/run-block.js";
|
|
9
9
|
import { snapshotFromRun } from "../render/snapshot.js";
|
|
10
10
|
const DOCK_MAX_LINES = 10;
|
|
11
11
|
const COMMAND_RUN_MAX_LINES = 8;
|
|
12
|
+
/** Per-run lines are listed only when at least this many runs are live: with a single run, the
|
|
13
|
+
* summary line (and that run's own tool row or phase tree) already says everything. */
|
|
14
|
+
const RUN_LINES_MIN_RUNS = 2;
|
|
12
15
|
/** Live counts only: running runs, and the done/failed/cancelled/queued/active/cost of those
|
|
13
16
|
* runs' own agents (§12.6's "2 runs · 3 running · 1 queued · 6 done" reads as running runs plus an
|
|
14
17
|
* agent-level breakdown within them) — never `store.totals()`'s session-wide retained totals,
|
|
@@ -54,6 +57,25 @@ function summaryLine(summary, theme, now) {
|
|
|
54
57
|
parts.push(keyHint("app.polyphase.inspector", "inspect"));
|
|
55
58
|
return `${theme.fg("accent", spinnerFrame(now))} ${parts.join(" · ")}`;
|
|
56
59
|
}
|
|
60
|
+
/** ` ● <title> 3/5 done 1:20 $0.12`: one live run that has no phase tree of its own in the dock. */
|
|
61
|
+
function runLine(run, theme, width, now) {
|
|
62
|
+
let done = 0;
|
|
63
|
+
let cost = 0;
|
|
64
|
+
for (const agent of run.agents) {
|
|
65
|
+
if (agent.status === "done")
|
|
66
|
+
done++;
|
|
67
|
+
cost += (agent.state.usage?.cost.total ?? 0) + (agent.state.liveUsage?.cost.total ?? 0);
|
|
68
|
+
}
|
|
69
|
+
return columns([
|
|
70
|
+
{
|
|
71
|
+
text: ` ${statusGlyph("running", theme, { now, animate: false })} ${sanitizeChildText(run.title)}`,
|
|
72
|
+
width: "flex",
|
|
73
|
+
},
|
|
74
|
+
{ text: `${done}/${run.agents.length} done`, width: 11, align: "right" },
|
|
75
|
+
{ text: formatDuration(now - run.startedAt), width: 7, align: "right" },
|
|
76
|
+
{ text: formatCost(cost), width: 7, align: "right" },
|
|
77
|
+
], width);
|
|
78
|
+
}
|
|
57
79
|
/** `Component` for `ctx.ui.setWidget`'s `(tui, theme) => Component & { dispose?(): void }` factory. */
|
|
58
80
|
export class PolyphaseDock {
|
|
59
81
|
deps;
|
|
@@ -85,6 +107,16 @@ export class PolyphaseDock {
|
|
|
85
107
|
return this.cachedLines;
|
|
86
108
|
this.cacheKey = key;
|
|
87
109
|
const lines = [fitLine(summaryLine(liveSummary(runs), this.deps.theme, now), width)];
|
|
110
|
+
const liveRuns = runs.filter((run) => run.status === "running");
|
|
111
|
+
if (liveRuns.length >= RUN_LINES_MIN_RUNS) {
|
|
112
|
+
for (const run of liveRuns) {
|
|
113
|
+
if (lines.length >= DOCK_MAX_LINES)
|
|
114
|
+
break;
|
|
115
|
+
if (run.kind === "workflow" && run.origin === "command")
|
|
116
|
+
continue;
|
|
117
|
+
lines.push(runLine(run, this.deps.theme, width, now));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
88
120
|
for (const run of runs) {
|
|
89
121
|
if (lines.length >= DOCK_MAX_LINES)
|
|
90
122
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dock.js","sourceRoot":"","sources":["../../../../src/core/polyphase/ui/dock.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,2DAA2D,CAAC;AAEpF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIxD,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAmBhC;;;0FAG0F;AAC1F,SAAS,WAAW,CAAC,IAAwB;IAC5C,MAAM,OAAO,GAAgB,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAC1G,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,GAAG,CAAC,MAAM,KAA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AC,IAAI,CAAC,KAAK,EAAE;gBACxD,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,IAAI;gBACb,KAAK,EAAE,IAAI;gBACX,QAAQ,EAAE,qBAAqB;gBAC/B,KAAK,EAAE,KAAK;gBACZ,GAAG;aACH,CAAC,CAAC;YACH,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;gBACzB,IAAI,KAAK,CAAC,MAAM,IAAI,cAAc;oBAAE,MAAM;gBAC1C,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;YAClC,CAAC;QACF,CAAC;QACD,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,OAAO,KAAK,CAAC;IACd,CAAC;IAED,UAAU;QACT,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC3B,CAAC;IAED,OAAO;QACN,IAAI,CAAC,WAAW,EAAE,CAAC;IACpB,CAAC;IAEO,GAAG;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IACrD,CAAC;CACD","sourcesContent":["/**\n * `PolyphaseDock`: the one-line summary widget shown above the editor while any run is active\n * (`ctx.ui.setWidget(\"polyphase\", ..., { placement: \"aboveEditor\" })`). See DESIGN.md §12.6.\n * Owns no timers: it reads the store at render time and asks the TUI to re-render on every flush.\n */\n\nimport type { Component, TUI } from \"@draht/tui\";\nimport { keyHint } from \"../../../modes/interactive/components/keybinding-hints.ts\";\nimport type { Theme } from \"../../../modes/interactive/theme/theme.ts\";\nimport { fitLine, formatCost, spinnerFrame } from \"../render/format.ts\";\nimport { layoutRun } from \"../render/run-block.ts\";\nimport { snapshotFromRun } from \"../render/snapshot.ts\";\nimport type { PolyphaseSession } from \"../session.ts\";\nimport type { RunView } from \"../types.ts\";\n\nconst DOCK_MAX_LINES = 10;\nconst COMMAND_RUN_MAX_LINES = 8;\n\nexport interface PolyphaseDockDeps {\n\tsession: PolyphaseSession;\n\ttui: TUI;\n\ttheme: Theme;\n\tnow?: () => number;\n}\n\ninterface DockSummary {\n\truns: number;\n\tactive: number;\n\tqueued: number;\n\tdone: number;\n\tfailed: number;\n\tcancelled: number;\n\tcost: number;\n}\n\n/** Live counts only: running runs, and the done/failed/cancelled/queued/active/cost of those\n * runs' own agents (§12.6's \"2 runs · 3 running · 1 queued · 6 done\" reads as running runs plus an\n * agent-level breakdown within them) — never `store.totals()`'s session-wide retained totals,\n * which include every finished run still kept for `/workflows list` and the inspector. */\nfunction liveSummary(runs: readonly RunView[]): DockSummary {\n\tconst summary: DockSummary = { runs: 0, active: 0, queued: 0, done: 0, failed: 0, cancelled: 0, cost: 0 };\n\tfor (const run of runs) {\n\t\tif (run.status !== \"running\") continue;\n\t\tsummary.runs++;\n\t\tfor (const agent of run.agents) {\n\t\t\tif (agent.status === \"queued\") summary.queued++;\n\t\t\tif (agent.status === \"starting\" || agent.status === \"running\") summary.active++;\n\t\t\tif (agent.status === \"done\") summary.done++;\n\t\t\tif (agent.status === \"failed\") summary.failed++;\n\t\t\tif (agent.status === \"cancelled\") summary.cancelled++;\n\t\t\tsummary.cost += agent.state.usage?.cost.total ?? 0;\n\t\t\tsummary.cost += agent.state.liveUsage?.cost.total ?? 0;\n\t\t}\n\t}\n\treturn summary;\n}\n\nfunction summaryLine(summary: DockSummary, theme: Theme, now: number): string {\n\tconst parts = [\"polyphase\", `${summary.runs} run${summary.runs === 1 ? \"\" : \"s\"}`];\n\tif (summary.active > 0) parts.push(`${summary.active} running`);\n\tif (summary.queued > 0) parts.push(`${summary.queued} queued`);\n\tif (summary.done > 0) parts.push(`${summary.done} done`);\n\tif (summary.failed > 0) parts.push(`${summary.failed} failed`);\n\tif (summary.cancelled > 0) parts.push(`${summary.cancelled} cancelled`);\n\tconst cost = formatCost(summary.cost);\n\tif (cost) parts.push(cost);\n\tparts.push(keyHint(\"app.polyphase.inspector\", \"inspect\"));\n\treturn `${theme.fg(\"accent\", spinnerFrame(now))} ${parts.join(\" · \")}`;\n}\n\n/** `Component` for `ctx.ui.setWidget`'s `(tui, theme) => Component & { dispose?(): void }` factory. */\nexport class PolyphaseDock implements Component {\n\tprivate readonly deps: PolyphaseDockDeps;\n\tprivate readonly unsubscribe: () => void;\n\tprivate cacheKey: string | undefined;\n\tprivate cachedLines: string[] = [];\n\n\tconstructor(deps: PolyphaseDockDeps) {\n\t\tthis.deps = deps;\n\t\tthis.unsubscribe = deps.session.store.subscribe(() => {\n\t\t\tdeps.tui.requestRender();\n\t\t});\n\t}\n\n\trender(width: number): string[] {\n\t\tconst now = this.now();\n\t\tconst store = this.deps.session.store;\n\t\tconst runs = store.runs();\n\t\t// Recomputing `totals()` plus a `snapshotFromRun`/`layoutRun` pass per running command\n\t\t// workflow on every render (including every editor keystroke, since the TUI redraws the\n\t\t// whole screen on each one) would walk every retained run's agents and up to 200 log lines\n\t\t// each time. Every input that can change what this widget shows bumps some run's `version`,\n\t\t// so a signature of (width, spinner frame, run versions) is enough to skip that work when\n\t\t// nothing has actually changed since the last render.\n\t\tconst spinner = spinnerFrame(now);\n\t\t// A second-granularity term alongside the spinner frame: the frame alone cycles every second\n\t\t// (4 frames at 250ms each), so a render exactly N seconds after the last one would otherwise\n\t\t// hit the cache and show a stale elapsed time from `layoutRun`'s live duration.\n\t\tconst key = `${width}|${spinner}|${Math.floor(now / 1000)}|${runs.map((run) => `${run.id}:${run.version}`).join(\",\")}`;\n\t\tif (key === this.cacheKey) return this.cachedLines;\n\t\tthis.cacheKey = key;\n\n\t\tconst lines: string[] = [fitLine(summaryLine(liveSummary(runs), this.deps.theme, now), width)];\n\t\tfor (const run of runs) {\n\t\t\tif (lines.length >= DOCK_MAX_LINES) break;\n\t\t\tif (run.status !== \"running\" || run.kind !== \"workflow\" || run.origin !== \"command\") continue;\n\t\t\tconst snapshot = snapshotFromRun(run, { now, tailItems: 0 });\n\t\t\tconst body = layoutRun(snapshot, width, this.deps.theme, {\n\t\t\t\texpanded: false,\n\t\t\t\tpartial: true,\n\t\t\t\tfocus: true,\n\t\t\t\tmaxLines: COMMAND_RUN_MAX_LINES,\n\t\t\t\thints: false,\n\t\t\t\tnow,\n\t\t\t});\n\t\t\tfor (const line of body) {\n\t\t\t\tif (lines.length >= DOCK_MAX_LINES) break;\n\t\t\t\tlines.push(fitLine(line, width));\n\t\t\t}\n\t\t}\n\t\tthis.cachedLines = lines;\n\t\treturn lines;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.cacheKey = undefined;\n\t}\n\n\tdispose(): void {\n\t\tthis.unsubscribe();\n\t}\n\n\tprivate now(): number {\n\t\treturn this.deps.now ? this.deps.now() : Date.now();\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dock.js","sourceRoot":"","sources":["../../../../src/core/polyphase/ui/dock.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,2DAA2D,CAAC;AAEpF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC9G,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIxD,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC;uFACuF;AACvF,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAmB7B;;;0FAG0F;AAC1F,SAAS,WAAW,CAAC,IAAwB;IAC5C,MAAM,OAAO,GAAgB,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,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,CAAC;IACrD,CAAC;CACD","sourcesContent":["/**\n * `PolyphaseDock`: the one-line summary widget shown above the editor while any run is active\n * (`ctx.ui.setWidget(\"polyphase\", ..., { placement: \"aboveEditor\" })`). See DESIGN.md §12.6.\n * Owns no timers: it reads the store at render time and asks the TUI to re-render on every flush.\n */\n\nimport type { Component, TUI } from \"@draht/tui\";\nimport { keyHint } from \"../../../modes/interactive/components/keybinding-hints.ts\";\nimport type { Theme } from \"../../../modes/interactive/theme/theme.ts\";\nimport { columns, fitLine, formatCost, formatDuration, spinnerFrame, statusGlyph } from \"../render/format.ts\";\nimport { layoutRun, sanitizeChildText } from \"../render/run-block.ts\";\nimport { snapshotFromRun } from \"../render/snapshot.ts\";\nimport type { PolyphaseSession } from \"../session.ts\";\nimport type { RunView } from \"../types.ts\";\n\nconst DOCK_MAX_LINES = 10;\nconst COMMAND_RUN_MAX_LINES = 8;\n/** Per-run lines are listed only when at least this many runs are live: with a single run, the\n * summary line (and that run's own tool row or phase tree) already says everything. */\nconst RUN_LINES_MIN_RUNS = 2;\n\nexport interface PolyphaseDockDeps {\n\tsession: PolyphaseSession;\n\ttui: TUI;\n\ttheme: Theme;\n\tnow?: () => number;\n}\n\ninterface DockSummary {\n\truns: number;\n\tactive: number;\n\tqueued: number;\n\tdone: number;\n\tfailed: number;\n\tcancelled: number;\n\tcost: number;\n}\n\n/** Live counts only: running runs, and the done/failed/cancelled/queued/active/cost of those\n * runs' own agents (§12.6's \"2 runs · 3 running · 1 queued · 6 done\" reads as running runs plus an\n * agent-level breakdown within them) — never `store.totals()`'s session-wide retained totals,\n * which include every finished run still kept for `/workflows list` and the inspector. */\nfunction liveSummary(runs: readonly RunView[]): DockSummary {\n\tconst summary: DockSummary = { runs: 0, active: 0, queued: 0, done: 0, failed: 0, cancelled: 0, cost: 0 };\n\tfor (const run of runs) {\n\t\tif (run.status !== \"running\") continue;\n\t\tsummary.runs++;\n\t\tfor (const agent of run.agents) {\n\t\t\tif (agent.status === \"queued\") summary.queued++;\n\t\t\tif (agent.status === \"starting\" || agent.status === \"running\") summary.active++;\n\t\t\tif (agent.status === \"done\") summary.done++;\n\t\t\tif (agent.status === \"failed\") summary.failed++;\n\t\t\tif (agent.status === \"cancelled\") summary.cancelled++;\n\t\t\tsummary.cost += agent.state.usage?.cost.total ?? 0;\n\t\t\tsummary.cost += agent.state.liveUsage?.cost.total ?? 0;\n\t\t}\n\t}\n\treturn summary;\n}\n\nfunction summaryLine(summary: DockSummary, theme: Theme, now: number): string {\n\tconst parts = [\"polyphase\", `${summary.runs} run${summary.runs === 1 ? \"\" : \"s\"}`];\n\tif (summary.active > 0) parts.push(`${summary.active} running`);\n\tif (summary.queued > 0) parts.push(`${summary.queued} queued`);\n\tif (summary.done > 0) parts.push(`${summary.done} done`);\n\tif (summary.failed > 0) parts.push(`${summary.failed} failed`);\n\tif (summary.cancelled > 0) parts.push(`${summary.cancelled} cancelled`);\n\tconst cost = formatCost(summary.cost);\n\tif (cost) parts.push(cost);\n\tparts.push(keyHint(\"app.polyphase.inspector\", \"inspect\"));\n\treturn `${theme.fg(\"accent\", spinnerFrame(now))} ${parts.join(\" · \")}`;\n}\n\n/** ` ● <title> 3/5 done 1:20 $0.12`: one live run that has no phase tree of its own in the dock. */\nfunction runLine(run: RunView, theme: Theme, width: number, now: number): string {\n\tlet done = 0;\n\tlet cost = 0;\n\tfor (const agent of run.agents) {\n\t\tif (agent.status === \"done\") done++;\n\t\tcost += (agent.state.usage?.cost.total ?? 0) + (agent.state.liveUsage?.cost.total ?? 0);\n\t}\n\treturn columns(\n\t\t[\n\t\t\t{\n\t\t\t\ttext: ` ${statusGlyph(\"running\", theme, { now, animate: false })} ${sanitizeChildText(run.title)}`,\n\t\t\t\twidth: \"flex\",\n\t\t\t},\n\t\t\t{ text: `${done}/${run.agents.length} done`, width: 11, align: \"right\" },\n\t\t\t{ text: formatDuration(now - run.startedAt), width: 7, align: \"right\" },\n\t\t\t{ text: formatCost(cost), width: 7, align: \"right\" },\n\t\t],\n\t\twidth,\n\t);\n}\n\n/** `Component` for `ctx.ui.setWidget`'s `(tui, theme) => Component & { dispose?(): void }` factory. */\nexport class PolyphaseDock implements Component {\n\tprivate readonly deps: PolyphaseDockDeps;\n\tprivate readonly unsubscribe: () => void;\n\tprivate cacheKey: string | undefined;\n\tprivate cachedLines: string[] = [];\n\n\tconstructor(deps: PolyphaseDockDeps) {\n\t\tthis.deps = deps;\n\t\tthis.unsubscribe = deps.session.store.subscribe(() => {\n\t\t\tdeps.tui.requestRender();\n\t\t});\n\t}\n\n\trender(width: number): string[] {\n\t\tconst now = this.now();\n\t\tconst store = this.deps.session.store;\n\t\tconst runs = store.runs();\n\t\t// Recomputing `totals()` plus a `snapshotFromRun`/`layoutRun` pass per running command\n\t\t// workflow on every render (including every editor keystroke, since the TUI redraws the\n\t\t// whole screen on each one) would walk every retained run's agents and up to 200 log lines\n\t\t// each time. Every input that can change what this widget shows bumps some run's `version`,\n\t\t// so a signature of (width, spinner frame, run versions) is enough to skip that work when\n\t\t// nothing has actually changed since the last render.\n\t\tconst spinner = spinnerFrame(now);\n\t\t// A second-granularity term alongside the spinner frame: the frame alone cycles every second\n\t\t// (4 frames at 250ms each), so a render exactly N seconds after the last one would otherwise\n\t\t// hit the cache and show a stale elapsed time from `layoutRun`'s live duration.\n\t\tconst key = `${width}|${spinner}|${Math.floor(now / 1000)}|${runs.map((run) => `${run.id}:${run.version}`).join(\",\")}`;\n\t\tif (key === this.cacheKey) return this.cachedLines;\n\t\tthis.cacheKey = key;\n\n\t\tconst lines: string[] = [fitLine(summaryLine(liveSummary(runs), this.deps.theme, now), width)];\n\t\tconst liveRuns = runs.filter((run) => run.status === \"running\");\n\t\tif (liveRuns.length >= RUN_LINES_MIN_RUNS) {\n\t\t\tfor (const run of liveRuns) {\n\t\t\t\tif (lines.length >= DOCK_MAX_LINES) break;\n\t\t\t\tif (run.kind === \"workflow\" && run.origin === \"command\") continue;\n\t\t\t\tlines.push(runLine(run, this.deps.theme, width, now));\n\t\t\t}\n\t\t}\n\t\tfor (const run of runs) {\n\t\t\tif (lines.length >= DOCK_MAX_LINES) break;\n\t\t\tif (run.status !== \"running\" || run.kind !== \"workflow\" || run.origin !== \"command\") continue;\n\t\t\tconst snapshot = snapshotFromRun(run, { now, tailItems: 0 });\n\t\t\tconst body = layoutRun(snapshot, width, this.deps.theme, {\n\t\t\t\texpanded: false,\n\t\t\t\tpartial: true,\n\t\t\t\tfocus: true,\n\t\t\t\tmaxLines: COMMAND_RUN_MAX_LINES,\n\t\t\t\thints: false,\n\t\t\t\tnow,\n\t\t\t});\n\t\t\tfor (const line of body) {\n\t\t\t\tif (lines.length >= DOCK_MAX_LINES) break;\n\t\t\t\tlines.push(fitLine(line, width));\n\t\t\t}\n\t\t}\n\t\tthis.cachedLines = lines;\n\t\treturn lines;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.cacheKey = undefined;\n\t}\n\n\tdispose(): void {\n\t\tthis.unsubscribe();\n\t}\n\n\tprivate now(): number {\n\t\treturn this.deps.now ? this.deps.now() : Date.now();\n\t}\n}\n"]}
|
|
@@ -69,6 +69,9 @@ export declare class PolyphaseInspector implements Component, Focusable {
|
|
|
69
69
|
invalidate(): void;
|
|
70
70
|
dispose(): void;
|
|
71
71
|
private now;
|
|
72
|
+
private phaseTitleOf;
|
|
73
|
+
/** `● thinking 0:41`: the agent detail header's right side (§12.2). */
|
|
74
|
+
private agentStatusText;
|
|
72
75
|
private resolveInitialView;
|
|
73
76
|
private selectFirstActiveAgentForCurrentRun;
|
|
74
77
|
/** Resolves the runs-view selection by the identity of the previously selected row (its runId or
|
|
@@ -98,20 +101,29 @@ export declare class PolyphaseInspector implements Component, Focusable {
|
|
|
98
101
|
private currentRunAgents;
|
|
99
102
|
private currentAgentRow;
|
|
100
103
|
private currentAgentTranscriptFor;
|
|
104
|
+
/** `countsWidth` is the widest counts cell across every listed run (at least the default), so
|
|
105
|
+
* multi-digit counts like `●10 ✓12` are never cut to `●1`. */
|
|
101
106
|
private formatRunsRow;
|
|
102
107
|
private renderRunsBody;
|
|
103
108
|
private formatAgentRow;
|
|
104
109
|
private runTitleForHeader;
|
|
105
110
|
private runHeaderRight;
|
|
106
111
|
private renderRunBody;
|
|
112
|
+
/** The run view's list (§12.2): a limits gauge when the run has a budget or time limit, then
|
|
113
|
+
* agents grouped by phase for workflows, numbered for chains, flat otherwise, then the newest log
|
|
114
|
+
* line or the result. Shared by the full-width run view and the split view's left pane, so the
|
|
115
|
+
* phase tree survives the split. */
|
|
116
|
+
private runListLines;
|
|
107
117
|
private renderSplitBody;
|
|
118
|
+
/** `identityFrom` is set by the split view, whose border title names the run rather than the
|
|
119
|
+
* agent: the pane then opens with the agent's own title and status line. */
|
|
108
120
|
private renderAgentDetailBody;
|
|
109
|
-
/** `width` is the same inner width the caller laid its body out to
|
|
110
|
-
*
|
|
111
|
-
* which carries no ellipsis of its own. */
|
|
121
|
+
/** `width` is the same inner width the caller laid its body out to: hints that do not fit are
|
|
122
|
+
* dropped by `fitHints`, and anything still too wide is ellipsised like every other row instead
|
|
123
|
+
* of being hard-cut by `sideLine`'s padding, which carries no ellipsis of its own. */
|
|
112
124
|
private footerLine;
|
|
113
|
-
private
|
|
114
|
-
private
|
|
115
|
-
private
|
|
125
|
+
private runsHints;
|
|
126
|
+
private runHints;
|
|
127
|
+
private agentHints;
|
|
116
128
|
}
|
|
117
129
|
//# sourceMappingURL=inspector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../../../src/core/polyphase/ui/inspector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGhF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"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