@draht/coding-agent 2026.10.4 → 2026.10.8
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 +13 -0
- package/README.md +32 -6
- package/dist/bundle/chunks/anthropic.js +1 -1
- package/dist/bundle/chunks/{chunk-DPE4ALPU.js → chunk-2VAF4XJI.js} +1 -1
- package/dist/bundle/chunks/chunk-6APPDDHH.js +65 -0
- package/dist/bundle/chunks/{chunk-LDAOC5RB.js → chunk-JFDPOIUH.js} +1 -1
- package/dist/bundle/chunks/{chunk-COF5JT7R.js → chunk-KU5HAKZL.js} +1 -1
- package/dist/bundle/chunks/{chunk-Z2INEV2J.js → chunk-MIUVNYYW.js} +292 -153
- package/dist/bundle/chunks/{chunk-5VZWYVZB.js → chunk-NHTOADU6.js} +2 -2
- package/dist/bundle/chunks/{chunk-H6FT43VC.js → chunk-OWGSPJPZ.js} +4 -4
- package/dist/bundle/chunks/chunk-PGJAHC3R.js +107 -0
- package/dist/bundle/chunks/chunk-QVFELZW2.js +312 -0
- package/dist/bundle/chunks/{chunk-XKDTJ4YR.js → chunk-TJ3AW62W.js} +1 -1
- package/dist/bundle/chunks/{cli-SR5QBZH4.js → cli-U7Y4VNNI.js} +1 -1
- package/dist/bundle/chunks/execute-ZWB4PIQQ.js +18 -0
- package/dist/bundle/chunks/google-antigravity.js +1 -1
- package/dist/bundle/chunks/google-gemini-cli.js +1 -1
- package/dist/bundle/chunks/openai-chatgpt.js +1 -1
- package/dist/bundle/chunks/openai-codex.js +1 -1
- package/dist/bundle/chunks/openrouter.js +1 -1
- package/dist/bundle/chunks/radius.js +1 -1
- package/dist/bundle/chunks/runtime-363BOYEO.js +3 -0
- package/dist/bundle/chunks/{runtime-6YJPGSP7.js → runtime-PXJK4L7Y.js} +1 -1
- package/dist/bundle/chunks/{settings-manager-D2EG7WDO.js → settings-manager-GEOZJXFQ.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-BEJ4ZJ3D.js +2 -0
- package/dist/bundle/chunks/xai.js +1 -1
- 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.js +3 -3
- package/dist/cli/args.js.map +1 -1
- package/dist/core/builtins/duet.d.ts +5 -2
- package/dist/core/builtins/duet.d.ts.map +1 -1
- package/dist/core/builtins/duet.js +65 -27
- package/dist/core/builtins/duet.js.map +1 -1
- package/dist/core/builtins/index.d.ts.map +1 -1
- package/dist/core/builtins/index.js +2 -0
- package/dist/core/builtins/index.js.map +1 -1
- package/dist/core/builtins/polyphase.d.ts +15 -0
- package/dist/core/builtins/polyphase.d.ts.map +1 -0
- package/dist/core/builtins/polyphase.js +196 -0
- package/dist/core/builtins/polyphase.js.map +1 -0
- package/dist/core/builtins/subagent.d.ts +44 -34
- package/dist/core/builtins/subagent.d.ts.map +1 -1
- package/dist/core/builtins/subagent.js +827 -560
- package/dist/core/builtins/subagent.js.map +1 -1
- package/dist/core/extensions/types.d.ts +17 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/keybindings.d.ts +30 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +24 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-resolver.js +4 -4
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/multi-agent/permission-gate.d.ts.map +1 -1
- package/dist/core/multi-agent/permission-gate.js +4 -1
- package/dist/core/multi-agent/permission-gate.js.map +1 -1
- package/dist/core/polyphase/approval.d.ts +35 -0
- package/dist/core/polyphase/approval.d.ts.map +1 -0
- package/dist/core/polyphase/approval.js +184 -0
- package/dist/core/polyphase/approval.js.map +1 -0
- package/dist/core/polyphase/child-events.d.ts +107 -0
- package/dist/core/polyphase/child-events.d.ts.map +1 -0
- package/dist/core/polyphase/child-events.js +862 -0
- package/dist/core/polyphase/child-events.js.map +1 -0
- package/dist/core/polyphase/child-process.d.ts +65 -0
- package/dist/core/polyphase/child-process.d.ts.map +1 -0
- package/dist/core/polyphase/child-process.js +361 -0
- package/dist/core/polyphase/child-process.js.map +1 -0
- package/dist/core/polyphase/commands.d.ts +44 -0
- package/dist/core/polyphase/commands.d.ts.map +1 -0
- package/dist/core/polyphase/commands.js +244 -0
- package/dist/core/polyphase/commands.js.map +1 -0
- package/dist/core/polyphase/details.d.ts +40 -0
- package/dist/core/polyphase/details.d.ts.map +1 -0
- package/dist/core/polyphase/details.js +538 -0
- package/dist/core/polyphase/details.js.map +1 -0
- package/dist/core/polyphase/emitter.d.ts +20 -0
- package/dist/core/polyphase/emitter.d.ts.map +1 -0
- package/dist/core/polyphase/emitter.js +90 -0
- package/dist/core/polyphase/emitter.js.map +1 -0
- package/dist/core/polyphase/jsonl-reader.d.ts +31 -0
- package/dist/core/polyphase/jsonl-reader.d.ts.map +1 -0
- package/dist/core/polyphase/jsonl-reader.js +161 -0
- package/dist/core/polyphase/jsonl-reader.js.map +1 -0
- package/dist/core/polyphase/keyword.d.ts +27 -0
- package/dist/core/polyphase/keyword.d.ts.map +1 -0
- package/dist/core/polyphase/keyword.js +97 -0
- package/dist/core/polyphase/keyword.js.map +1 -0
- package/dist/core/polyphase/limiter.d.ts +38 -0
- package/dist/core/polyphase/limiter.d.ts.map +1 -0
- package/dist/core/polyphase/limiter.js +129 -0
- package/dist/core/polyphase/limiter.js.map +1 -0
- package/dist/core/polyphase/model-selection.d.ts +35 -0
- package/dist/core/polyphase/model-selection.d.ts.map +1 -0
- package/dist/core/polyphase/model-selection.js +72 -0
- package/dist/core/polyphase/model-selection.js.map +1 -0
- package/dist/core/polyphase/render/format.d.ts +52 -0
- package/dist/core/polyphase/render/format.d.ts.map +1 -0
- package/dist/core/polyphase/render/format.js +169 -0
- package/dist/core/polyphase/render/format.js.map +1 -0
- package/dist/core/polyphase/render/renderers.d.ts +63 -0
- package/dist/core/polyphase/render/renderers.d.ts.map +1 -0
- package/dist/core/polyphase/render/renderers.js +277 -0
- package/dist/core/polyphase/render/renderers.js.map +1 -0
- package/dist/core/polyphase/render/run-block.d.ts +45 -0
- package/dist/core/polyphase/render/run-block.d.ts.map +1 -0
- package/dist/core/polyphase/render/run-block.js +843 -0
- package/dist/core/polyphase/render/run-block.js.map +1 -0
- package/dist/core/polyphase/render/snapshot.d.ts +106 -0
- package/dist/core/polyphase/render/snapshot.d.ts.map +1 -0
- package/dist/core/polyphase/render/snapshot.js +292 -0
- package/dist/core/polyphase/render/snapshot.js.map +1 -0
- package/dist/core/polyphase/result-text.d.ts +41 -0
- package/dist/core/polyphase/result-text.d.ts.map +1 -0
- package/dist/core/polyphase/result-text.js +326 -0
- package/dist/core/polyphase/result-text.js.map +1 -0
- package/dist/core/polyphase/session.d.ts +33 -0
- package/dist/core/polyphase/session.d.ts.map +1 -0
- package/dist/core/polyphase/session.js +106 -0
- package/dist/core/polyphase/session.js.map +1 -0
- package/dist/core/polyphase/settings.d.ts +18 -0
- package/dist/core/polyphase/settings.d.ts.map +1 -0
- package/dist/core/polyphase/settings.js +93 -0
- package/dist/core/polyphase/settings.js.map +1 -0
- package/dist/core/polyphase/store.d.ts +197 -0
- package/dist/core/polyphase/store.d.ts.map +1 -0
- package/dist/core/polyphase/store.js +558 -0
- package/dist/core/polyphase/store.js.map +1 -0
- package/dist/core/polyphase/types.d.ts +371 -0
- package/dist/core/polyphase/types.d.ts.map +1 -0
- package/dist/core/polyphase/types.js +36 -0
- package/dist/core/polyphase/types.js.map +1 -0
- package/dist/core/polyphase/ui/controller.d.ts +28 -0
- package/dist/core/polyphase/ui/controller.d.ts.map +1 -0
- package/dist/core/polyphase/ui/controller.js +150 -0
- package/dist/core/polyphase/ui/controller.js.map +1 -0
- package/dist/core/polyphase/ui/dock.d.ts +27 -0
- package/dist/core/polyphase/ui/dock.d.ts.map +1 -0
- package/dist/core/polyphase/ui/dock.js +121 -0
- package/dist/core/polyphase/ui/dock.js.map +1 -0
- package/dist/core/polyphase/ui/inspector.d.ts +117 -0
- package/dist/core/polyphase/ui/inspector.d.ts.map +1 -0
- package/dist/core/polyphase/ui/inspector.js +1016 -0
- package/dist/core/polyphase/ui/inspector.js.map +1 -0
- package/dist/core/polyphase/ui/transcript-layout.d.ts +55 -0
- package/dist/core/polyphase/ui/transcript-layout.d.ts.map +1 -0
- package/dist/core/polyphase/ui/transcript-layout.js +210 -0
- package/dist/core/polyphase/ui/transcript-layout.js.map +1 -0
- package/dist/core/polyphase/update-pump.d.ts +18 -0
- package/dist/core/polyphase/update-pump.d.ts.map +1 -0
- package/dist/core/polyphase/update-pump.js +132 -0
- package/dist/core/polyphase/update-pump.js.map +1 -0
- package/dist/core/polyphase/workflow/agent-host.d.ts +26 -0
- package/dist/core/polyphase/workflow/agent-host.d.ts.map +1 -0
- package/dist/core/polyphase/workflow/agent-host.js +187 -0
- package/dist/core/polyphase/workflow/agent-host.js.map +1 -0
- package/dist/core/polyphase/workflow/guidance.d.ts +19 -0
- package/dist/core/polyphase/workflow/guidance.d.ts.map +1 -0
- package/dist/core/polyphase/workflow/guidance.js +119 -0
- package/dist/core/polyphase/workflow/guidance.js.map +1 -0
- package/dist/core/polyphase/workflow/launch.d.ts +41 -0
- package/dist/core/polyphase/workflow/launch.d.ts.map +1 -0
- package/dist/core/polyphase/workflow/launch.js +173 -0
- package/dist/core/polyphase/workflow/launch.js.map +1 -0
- package/dist/core/polyphase/workflow/meta.d.ts +43 -0
- package/dist/core/polyphase/workflow/meta.d.ts.map +1 -0
- package/dist/core/polyphase/workflow/meta.js +529 -0
- package/dist/core/polyphase/workflow/meta.js.map +1 -0
- package/dist/core/polyphase/workflow/prelude.d.ts +24 -0
- package/dist/core/polyphase/workflow/prelude.d.ts.map +1 -0
- package/dist/core/polyphase/workflow/prelude.js +93 -0
- package/dist/core/polyphase/workflow/prelude.js.map +1 -0
- package/dist/core/polyphase/workflow/runtime.d.ts +79 -0
- package/dist/core/polyphase/workflow/runtime.d.ts.map +1 -0
- package/dist/core/polyphase/workflow/runtime.js +217 -0
- package/dist/core/polyphase/workflow/runtime.js.map +1 -0
- package/dist/core/polyphase/workflow/runtime.lazy.d.ts +3 -0
- package/dist/core/polyphase/workflow/runtime.lazy.d.ts.map +1 -0
- package/dist/core/polyphase/workflow/runtime.lazy.js +3 -0
- package/dist/core/polyphase/workflow/runtime.lazy.js.map +1 -0
- package/dist/core/polyphase/workflow/saved.d.ts +55 -0
- package/dist/core/polyphase/workflow/saved.d.ts.map +1 -0
- package/dist/core/polyphase/workflow/saved.js +299 -0
- package/dist/core/polyphase/workflow/saved.js.map +1 -0
- package/dist/core/polyphase/workflow/structured-output.d.ts +22 -0
- package/dist/core/polyphase/workflow/structured-output.d.ts.map +1 -0
- package/dist/core/polyphase/workflow/structured-output.js +66 -0
- package/dist/core/polyphase/workflow/structured-output.js.map +1 -0
- package/dist/core/polyphase/workflow/tool.d.ts +24 -0
- package/dist/core/polyphase/workflow/tool.d.ts.map +1 -0
- package/dist/core/polyphase/workflow/tool.js +139 -0
- package/dist/core/polyphase/workflow/tool.js.map +1 -0
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.js +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +27 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/socket-server/permission-relay.js +4 -0
- package/dist/core/socket-server/permission-relay.js.map +1 -1
- package/dist/core/trust-manager.d.ts +3 -2
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +5 -2
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/experimental/micro/runtime.js +1 -1
- package/dist/experimental/micro/runtime.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +7 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +18 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +11 -2
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +9 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/prompts/commands/orchestrate.md +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +7 -1
- package/dist/utils/shell.js.map +1 -1
- package/docs/docs.json +4 -0
- package/docs/duet.md +3 -3
- package/docs/environment-variables.md +11 -0
- package/docs/json.md +7 -0
- package/docs/keybindings.md +20 -0
- package/docs/polyphase.md +391 -0
- package/docs/rpc-commands.md +9 -9
- package/docs/settings.md +12 -0
- package/docs/virtual-models.md +3 -3
- package/examples/extensions/preset.ts +3 -3
- package/examples/extensions/subagent/README.md +1 -1
- package/examples/extensions/subagent/agents/planner.md +1 -1
- package/examples/extensions/subagent/agents/reviewer.md +1 -1
- package/examples/extensions/subagent/agents/scout.md +1 -1
- package/examples/extensions/subagent/agents/worker.md +1 -1
- package/examples/extensions/summarize.ts +3 -3
- package/examples/sdk/02-custom-model.ts +1 -1
- package/examples/sdk/12-full-control.ts +1 -1
- package/examples/sdk/README.md +1 -1
- package/package.json +10 -10
- package/prompts/commands/orchestrate.md +1 -1
- package/dist/bundle/chunks/chunk-CEJJ5XF2.js +0 -170
- package/dist/bundle/chunks/execute-VCYDHEYA.js +0 -328
- package/dist/bundle/chunks/virtual-modules-JTCGDL2Z.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-block.js","sourceRoot":"","sources":["../../../../src/core/polyphase/render/run-block.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAkB,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,2DAA2D,CAAC;AAE7F,OAAO,EAAE,SAAS,EAAE,MA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EAAE,OAAyB;QACpE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,KAAa;QACnB,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,EAAE,CAAC;QAC9D,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAClF,MAAM,GAAG,GAAG,GAAG,QAAQ,CAAC,OAAO,IAAI,KAAK,IAAI,gBAAgB,CAAC,OAAO,CAAC,IAAI,OAAO,EAAE,CAAC;QACnF,IAAI,GAAG,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC3B,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;YACpB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAED,UAAU;QACT,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC3B,CAAC;CACD","sourcesContent":["/**\n * Layout for one polyphase run's tool-row content (§11.3-11.4): `layoutRun` turns a `RunSnapshot`\n * into fitted lines, and `PolyphaseRunBlock` is the `Component` `render/renderers.ts` reuses across\n * re-renders of the same tool call. Every line goes through `fitLine` as the last step (§0 width\n * safety); no timers live here (§11.2.5) — the animated frame comes from `options.now`.\n */\n\nimport { type Component, visibleWidth } from \"@draht/tui\";\nimport { keyHint, keyText } from \"../../../modes/interactive/components/keybinding-hints.ts\";\nimport type { Theme } from \"../../../modes/interactive/theme/theme.ts\";\nimport { stripAnsi } from \"../../../utils/ansi.ts\";\nimport { sanitizeBinaryOutput } from \"../../../utils/shell.ts\";\nimport { normalizeDisplayText, replaceTabs } from \"../../tools/render-utils.ts\";\nimport type { AgentStatus, CancelReason, TranscriptItem } from \"../types.ts\";\nimport {\n\ttype ColumnCell,\n\tcolumns,\n\tfitLine,\n\tformatCost,\n\tformatDuration,\n\tformatModelLabel,\n\tformatTokens,\n\toneLine,\n\tspinnerFrame,\n\tstatusGlyph,\n} from \"./format.ts\";\nimport type { AgentSnapshotRow, PhaseSnapshot, RunSnapshot } from \"./snapshot.ts\";\n\nexport interface RunLayoutOptions {\n\texpanded: boolean;\n\tpartial: boolean;\n\t/** Only the focused row animates and shows live elapsed/now/tokens (§11.2.2). */\n\tfocus: boolean;\n\t/** Row budget for agent/phase content, excluding the summary and hint lines (§11.2.3). */\n\tmaxLines: number;\n\thints: boolean;\n\tnow: number;\n}\n\nconst COUNT_ORDER: readonly AgentStatus[] = [\"running\", \"done\", \"failed\", \"cancelled\", \"queued\", \"pending\", \"skipped\"];\n\nconst STATUS_WORDS: Record<AgentStatus, string> = {\n\tpending: \"pending\",\n\tqueued: \"queued\",\n\tstarting: \"starting\",\n\trunning: \"running\",\n\tdone: \"done\",\n\tfailed: \"failed\",\n\tcancelled: \"cancelled\",\n\tskipped: \"skipped\",\n};\n\nconst FINISHED_STATUSES: readonly AgentStatus[] = [\"done\", \"failed\", \"cancelled\", \"skipped\"];\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\n/** Whether this row/run may show animated or live-only content: elapsed, live tokens/cost, the\n * now column and the transcript tail (§11.2.2). False only for a non-focused partial row, which\n * must render static content that changes only on an agent's status transition. */\nfunction isLive(options: RunLayoutOptions): boolean {\n\treturn options.focus || !options.partial;\n}\n\nfunction staticHintText(): string {\n\treturn `live view on the newest run · ${keyText(\"app.polyphase.inspector\")}`;\n}\n\n/** Packs `left` and `right` onto one line with at least a two-space gap; falls back to a plain\n * concatenation (later clipped by `fitLine`) when both together would not fit. */\nfunction joinLeftRight(left: string, right: string, width: number): string {\n\tif (!right) return left;\n\tconst leftWidth = visibleWidth(left);\n\tconst rightWidth = visibleWidth(right);\n\tconst minGap = 2;\n\tif (leftWidth + minGap + rightWidth >= width) return `${left} ${right}`;\n\treturn left + \" \".repeat(width - leftWidth - rightWidth) + right;\n}\n\nfunction slotsBusySuffix(limiter: RunSnapshot[\"limiter\"], queued: number): string {\n\tif (!limiter || queued <= 0 || limiter.active < limiter.capacity) return \"\";\n\treturn ` (${limiter.active}/${limiter.capacity} slots busy)`;\n}\n\nfunction rightSummaryParts(snapshot: RunSnapshot): string[] {\n\tconst parts: string[] = [formatDuration(snapshot.elapsedMs)];\n\tif (snapshot.budget) {\n\t\tparts.push(`${formatTokens(snapshot.budget.spentTokens)}/${formatTokens(snapshot.budget.totalTokens)} tok`);\n\t} else if (snapshot.tokens > 0) {\n\t\tparts.push(`${formatTokens(snapshot.tokens)} tok`);\n\t}\n\tconst cost = formatCost(snapshot.cost);\n\tif (cost) parts.push(cost);\n\treturn parts;\n}\n\n/** Joins `left` and as many of `rightParts` (in order) as fit at `width`, dropping whole parts from\n * the end rather than cutting one mid-token (§11.3's \"drop parts from the right when space runs\n * out\"). */\nfunction joinLeftRightParts(left: string, rightParts: readonly string[], width: number): string {\n\tfor (let count = rightParts.length; count > 0; count--) {\n\t\tconst candidate = joinLeftRight(left, rightParts.slice(0, count).join(\" · \"), width);\n\t\tif (visibleWidth(candidate) <= width) return candidate;\n\t}\n\treturn left;\n}\n\nfunction liveCountsLeft(snapshot: RunSnapshot, theme: Theme, options: RunLayoutOptions): string {\n\tconst merged: Record<AgentStatus, number> = {\n\t\t...snapshot.counts,\n\t\trunning: snapshot.counts.running + snapshot.counts.starting,\n\t};\n\tconst pieces: string[] = [];\n\tfor (const status of COUNT_ORDER) {\n\t\tconst n = merged[status];\n\t\tif (n <= 0) continue;\n\t\tconst animate = options.focus && options.partial && status === \"running\";\n\t\tpieces.push(`${statusGlyph(status, theme, { now: options.now, animate })} ${n} ${STATUS_WORDS[status]}`);\n\t}\n\tconst left =\n\t\tpieces.length > 0\n\t\t\t? pieces.join(\" · \")\n\t\t\t: `${statusGlyph(\"running\", theme, { now: options.now, animate: options.focus && options.partial })} 0 running`;\n\t// The limiter reflects every run's slots, not just this one's, so the suffix must stay off\n\t// static rows (§11.2.2): it can otherwise change a row with no status transition of its own.\n\treturn isLive(options) ? left + slotsBusySuffix(snapshot.limiter, merged.queued) : left;\n}\n\n/** \"cancelled by you\" only when every cancelled agent was cancelled by the user; otherwise the\n * generic word, since a budget/parent/shutdown cancel was not the user's doing. */\nfunction cancelledByText(agents: readonly AgentSnapshotRow[]): string {\n\tconst cancelled = agents.filter((a) => a.status === \"cancelled\");\n\tconst byUser =\n\t\tcancelled.length > 0 && cancelled.every((a) => a.cancelReason === \"user\" || a.cancelReason === undefined);\n\treturn byUser ? \"cancelled by you\" : \"cancelled\";\n}\n\n/** A single agent's cancel wording: `cancelled by you` for the user, else `cancelled by <reason>`\n * (budget/run/parent/shutdown), matching §11.4's mockup wording for the user case. */\nfunction cancelReasonText(reason: CancelReason | undefined): string {\n\tif (!reason) return \"cancelled\";\n\treturn reason === \"user\" ? \"cancelled by you\" : `cancelled by ${reason}`;\n}\n\n/** Child-sourced text (output, error, status/now lines, task, tool summaries, labels, log lines,\n * result previews) may carry ANSI/OSC sequences, raw tabs or a trailing CR. Stripped and normalized\n * before any width math runs, so `visibleWidth`/`fitLine` see exactly what the terminal will draw\n * (§0 width safety): a bare tab would otherwise jump to the terminal's own 8-column stop regardless\n * of the 3-column width this file assumes, and a CR would move the cursor back to column 0. */\nexport function sanitizeChildText(text: string): string {\n\treturn normalizeDisplayText(replaceTabs(sanitizeBinaryOutput(stripAnsi(text))));\n}\n\nfunction sanitizeRow(row: AgentSnapshotRow): AgentSnapshotRow {\n\treturn {\n\t\t...row,\n\t\tlabel: sanitizeChildText(row.label),\n\t\ttask: sanitizeChildText(row.task),\n\t\tnow: row.now !== undefined ? sanitizeChildText(row.now) : row.now,\n\t\tstatusLine: row.statusLine !== undefined ? sanitizeChildText(row.statusLine) : row.statusLine,\n\t\toutput: row.output !== undefined ? sanitizeChildText(row.output) : row.output,\n\t\terror: row.error !== undefined ? sanitizeChildText(row.error) : row.error,\n\t\tblockedSample: row.blockedSample !== undefined ? sanitizeChildText(row.blockedSample) : row.blockedSample,\n\t\t// The child reports `provider`/`id` in its own `message_start` event, and `modelText` falls\n\t\t// back to the raw requested pattern before confirmation: both reach `formatModelLabel`\n\t\t// unsanitized otherwise (§security, formatModelLabel probe).\n\t\tprovider: row.provider !== undefined ? sanitizeChildText(row.provider) : row.provider,\n\t\tmodelId: row.modelId !== undefined ? sanitizeChildText(row.modelId) : row.modelId,\n\t\tmodelText: row.modelText !== undefined ? sanitizeChildText(row.modelText) : row.modelText,\n\t};\n}\n\n/** Applied once at the top of `layoutRun` (§0), so every downstream layout function works on\n * already-clean text instead of each sanitizing its own slice of it. */\nfunction sanitizePhase(phase: PhaseSnapshot): PhaseSnapshot {\n\treturn {\n\t\t...phase,\n\t\ttitle: sanitizeChildText(phase.title),\n\t\tdetail: phase.detail !== undefined ? sanitizeChildText(phase.detail) : undefined,\n\t};\n}\n\n/** A workflow script controls its own `name`/`description`/`args` (`workflow/meta.ts`), so these\n * are script-supplied strings exactly like phase titles. */\nfunction sanitizeWorkflow(workflow: RunSnapshot[\"workflow\"]): RunSnapshot[\"workflow\"] {\n\tif (!workflow) return workflow;\n\treturn {\n\t\t...workflow,\n\t\tname: sanitizeChildText(workflow.name),\n\t\tdescription: sanitizeChildText(workflow.description),\n\t\targs: workflow.args !== undefined ? sanitizeChildText(workflow.args) : undefined,\n\t};\n}\n\n/** Every child- or script-supplied string a `RunSnapshot` carries, sanitized once so every renderer\n * that consumes the snapshot (this file's `layoutRun`, `ui/inspector.ts`) works on already-clean\n * text instead of each re-implementing the same stripping. */\nexport function sanitizeSnapshot(snapshot: RunSnapshot): RunSnapshot {\n\treturn {\n\t\t...snapshot,\n\t\ttitle: sanitizeChildText(snapshot.title),\n\t\tlog: snapshot.log.map(sanitizeChildText),\n\t\tresultPreview: snapshot.resultPreview !== undefined ? sanitizeChildText(snapshot.resultPreview) : undefined,\n\t\tagents: snapshot.agents.map(sanitizeRow),\n\t\tphases: snapshot.phases.map(sanitizePhase),\n\t\tworkflow: sanitizeWorkflow(snapshot.workflow),\n\t\terror: snapshot.error !== undefined ? sanitizeChildText(snapshot.error) : undefined,\n\t};\n}\n\n/** The fixed §11.4 mockup wording: a blocked tool's real gate reason (child-events.ts keeps it in\n * full, `NO_UI_APPROVAL_SUFFIX` included) is never shown on the tool row, only in the inspector's\n * expanded detail, so a long or sensitive rule description can never widen or leak onto this line. */\nconst BLOCKED_TOOL_TEXT = \"blocked: needs approval (subagents cannot ask)\";\n\n/** The run's true agent count, including any dropped before this snapshot was built (a degraded\n * archived/final `details` with `agentsOmitted` set). `snapshot.counts` already covers every agent\n * (it is copied from `details.totals.byStatus`), so only `agents.length` on its own undercounts. */\nfunction agentTotal(snapshot: RunSnapshot): number {\n\treturn snapshot.agents.length + (snapshot.agentsOmitted?.count ?? 0);\n}\n\n/** Appended to a final/archived summary so a degraded snapshot never silently claims to be the\n * whole run. Empty for a live or non-degraded snapshot. */\nfunction agentsOmittedNote(snapshot: RunSnapshot): string {\n\tconst omitted = snapshot.agentsOmitted?.count ?? 0;\n\treturn omitted > 0 ? ` (${omitted} agent${omitted === 1 ? \"\" : \"s\"} omitted)` : \"\";\n}\n\nfunction finalSummaryLeft(snapshot: RunSnapshot, theme: Theme): string {\n\tconst total = agentTotal(snapshot);\n\tconst { done, failed, cancelled } = snapshot.counts;\n\tconst note = agentsOmittedNote(snapshot);\n\tif (snapshot.status === \"cancelled\" && failed === 0) {\n\t\treturn `${statusGlyph(\"cancelled\", theme, { now: 0, animate: false })} ${cancelledByText(snapshot.agents)} after ${total} agent${total === 1 ? \"\" : \"s\"}${note}`;\n\t}\n\tif (done === total) {\n\t\treturn `${statusGlyph(\"done\", theme, { now: 0, animate: false })} ${done}/${total} succeeded${note}`;\n\t}\n\tconst parts = [`${done} of ${total} succeeded`];\n\tif (failed > 0) parts.push(`${failed} failed`);\n\tif (cancelled > 0) parts.push(`${cancelled} cancelled`);\n\tconst glyph =\n\t\tfailed > 0\n\t\t\t? statusGlyph(\"failed\", theme, { now: 0, animate: false })\n\t\t\t: statusGlyph(\"cancelled\", theme, { now: 0, animate: false });\n\treturn `${glyph} ${parts.join(\" · \")}${note}`;\n}\n\nfunction buildMultiSummaryLine(snapshot: RunSnapshot, theme: Theme, options: RunLayoutOptions, width: number): string {\n\tconst left =\n\t\tsnapshot.status === \"running\" ? liveCountsLeft(snapshot, theme, options) : finalSummaryLeft(snapshot, theme);\n\tif (!isLive(options)) return joinLeftRight(left, theme.fg(\"muted\", staticHintText()), width);\n\treturn joinLeftRightParts(left, rightSummaryParts(snapshot), width);\n}\n\n/** §11.3's `nowLine`-driven flex cell: the status word for a static row, else the live activity,\n * final status line/error, or chain-specific \"waits for step N\" / \"not run\". */\nfunction flexText(row: AgentSnapshotRow, options: RunLayoutOptions, waitsForStep: number | undefined): string {\n\tif (!isLive(options)) return STATUS_WORDS[row.status];\n\tswitch (row.status) {\n\t\tcase \"done\":\n\t\t\treturn row.statusLine || (row.output ? firstLine(row.output) : \"\") || \"done\";\n\t\tcase \"failed\":\n\t\t\treturn row.error ? row.error : \"failed\";\n\t\tcase \"cancelled\":\n\t\t\treturn cancelReasonText(row.cancelReason);\n\t\tcase \"queued\":\n\t\t\treturn \"queued\";\n\t\tcase \"pending\":\n\t\t\treturn waitsForStep !== undefined ? `waits for step ${waitsForStep}` : \"pending\";\n\t\tcase \"skipped\":\n\t\t\treturn \"not run\";\n\t\tdefault:\n\t\t\treturn row.now || \"running\";\n\t}\n}\n\ninterface RowExtra {\n\tstepLabel?: string;\n\twaitsForStep?: number;\n\tlabelWidth?: number;\n}\n\n/** label width = `clamp(longest label, 6, 16)`, taken across every row in the group being laid out\n * (§11.3), so the model/elapsed columns line up across rows instead of each row sizing itself. */\nfunction computeLabelWidth(agents: readonly AgentSnapshotRow[]): number {\n\tconst longest = agents.reduce((max, agent) => Math.max(max, visibleWidth(agent.label)), 0);\n\treturn Math.min(16, Math.max(6, longest));\n}\n\n/** `formatModelLabel`, but a static row never shows `thinking`: it is set only once the child's\n * `message_end` confirms it (child-events.ts §6.3), which is not a status transition, so a static\n * row must not change shape when it lands (§11.2.2). */\nfunction modelLabelFor(\n\trow: AgentSnapshotRow,\n\toptions: RunLayoutOptions,\n\tformatOptions: { withProvider: boolean; withSource?: boolean },\n): string {\n\tif (isLive(options)) return formatModelLabel(row, formatOptions);\n\treturn formatModelLabel({ ...row, thinking: undefined }, formatOptions);\n}\n\nfunction agentCollapsedLine(\n\trow: AgentSnapshotRow,\n\ttheme: Theme,\n\toptions: RunLayoutOptions,\n\twidth: number,\n\textra?: RowExtra,\n): string {\n\tconst animate = options.focus && options.partial && (row.status === \"running\" || row.status === \"starting\");\n\tconst glyph = statusGlyph(row.status, theme, { now: options.now, animate });\n\tconst labelWidth = extra?.labelWidth ?? computeLabelWidth([row]);\n\tconst cells: ColumnCell[] = [\n\t\textra?.stepLabel ? { text: `${glyph} ${extra.stepLabel}`, width: 4 } : { text: glyph, width: 2 },\n\t\t{ text: row.label, width: labelWidth },\n\t];\n\tif (width >= 60) cells.push({ text: modelLabelFor(row, options, { withProvider: false }), width: 22 });\n\tif (width >= 40) {\n\t\tconst elapsedText = isLive(options) && row.elapsedMs !== undefined ? formatDuration(row.elapsedMs) : \"\";\n\t\tcells.push({ text: elapsedText, width: 5, align: \"right\" });\n\t}\n\tcells.push({ text: flexText(row, options, extra?.waitsForStep), width: \"flex\" });\n\treturn columns(cells, width, 1);\n}\n\nfunction toolsSummary(tools: Record<string, number> | undefined): string {\n\tif (!tools) return \"\";\n\treturn Object.entries(tools)\n\t\t.map(([name, count]) => `${name} ×${count}`)\n\t\t.join(\" · \");\n}\n\n/** `tools read ×6 · grep ×3[ · ⚠ k blocked (<sample>)]` (§11.3). The blocked annotation is shown\n * whenever `row.blocked > 0`, even if the agent has no tool-call counts yet. */\nfunction toolsLineText(row: AgentSnapshotRow): string {\n\tconst parts: string[] = [];\n\tconst toolsText = toolsSummary(row.tools);\n\tif (toolsText) parts.push(toolsText);\n\tif (row.blocked > 0) parts.push(`⚠ ${row.blocked} blocked${row.blockedSample ? ` (${row.blockedSample})` : \"\"}`);\n\treturn parts.join(\" · \");\n}\n\n/** Up to 10 lines with a `│ ` gutter; beyond that, the first 3, an omission marker, and the last 6\n * (§11.3's final-output rule). */\nfunction outputBlockLines(text: string): string[] {\n\tconst lines = text.split(\"\\n\");\n\tif (lines.length <= 10) return lines.map((line) => ` │ ${line}`);\n\tconst first = lines.slice(0, 3).map((line) => ` │ ${line}`);\n\tconst last = lines.slice(-6).map((line) => ` │ ${line}`);\n\treturn [...first, ` … ${lines.length - 9} lines omitted …`, ...last];\n}\n\nfunction tailItemLines(items: readonly TranscriptItem[], width: number): string[] {\n\tconst lines: string[] = [];\n\tfor (const item of items) {\n\t\tif (item.kind === \"thinking\" || item.kind === \"text\") {\n\t\t\tconst label = item.kind === \"thinking\" ? \"thinking\" : \"writing\";\n\t\t\tconst cursor = item.done ? \"\" : \"▌\";\n\t\t\tlines.push(` ▸ ${label} ${oneLine(sanitizeChildText(item.text))}${cursor}`);\n\t\t} else if (item.kind === \"tool\") {\n\t\t\tconst name = sanitizeChildText(item.name);\n\t\t\tconst summary = sanitizeChildText(item.summary);\n\t\t\tif (item.status === \"blocked\") {\n\t\t\t\tlines.push(` ⚠ ${name} ${summary} ${BLOCKED_TOOL_TEXT}`);\n\t\t\t} else {\n\t\t\t\tconst glyphChar = item.status === \"ok\" ? \"✓\" : item.status === \"error\" ? \"✗\" : \"◐\";\n\t\t\t\tconst duration =\n\t\t\t\t\titem.startedAt !== undefined && item.endedAt !== undefined\n\t\t\t\t\t\t? `${((item.endedAt - item.startedAt) / 1000).toFixed(1)}s`\n\t\t\t\t\t\t: \"\";\n\t\t\t\tlines.push(joinLeftRight(` ${glyphChar} ${name} ${summary}`.trimEnd(), duration, width));\n\t\t\t}\n\t\t} else if (item.kind === \"notice\") {\n\t\t\tlines.push(` ! ${sanitizeChildText(item.text)}`);\n\t\t}\n\t}\n\treturn lines;\n}\n\nfunction agentExpandedBlock(\n\trow: AgentSnapshotRow,\n\ttheme: Theme,\n\toptions: RunLayoutOptions,\n\twidth: number,\n\textra?: RowExtra,\n): string[] {\n\tconst lines: string[] = [];\n\tconst animate = options.focus && options.partial && (row.status === \"running\" || row.status === \"starting\");\n\tconst glyph = statusGlyph(row.status, theme, { now: options.now, animate });\n\tconst headerParts = [row.label, modelLabelFor(row, options, { withProvider: true, withSource: true })];\n\tconst live = isLive(options);\n\tif (live && row.elapsedMs !== undefined) headerParts.push(formatDuration(row.elapsedMs));\n\tif (live && row.turns > 0) headerParts.push(`${row.turns} turn${row.turns === 1 ? \"\" : \"s\"}`);\n\tif (live) {\n\t\tconst costText = formatCost(row.cost);\n\t\tif (costText) headerParts.push(costText);\n\t}\n\tif (live && row.status === \"queued\") headerParts.push(STATUS_WORDS.queued);\n\tconst prefix = extra?.stepLabel ? `${extra.stepLabel} ` : \"\";\n\tlines.push(`${glyph} ${prefix}${headerParts.filter(Boolean).join(\" · \")}`);\n\n\tif (row.status === \"pending\") {\n\t\tlines.push(` ${flexText(row, options, extra?.waitsForStep)}`);\n\t\treturn lines;\n\t}\n\n\tlines.push(` task ${oneLine(row.task)}`);\n\tconst toolsLine = toolsLineText(row);\n\tif (live && toolsLine) lines.push(` tools ${toolsLine}`);\n\tif (isFinished(row.status)) {\n\t\tif (row.output) {\n\t\t\t// A finished agent inside a still-running row shows one line (§11.4's \"Parallel, partial,\n\t\t\t// expanded\" mockup); the full `│`-gutter output block is reserved for final rows, so a\n\t\t\t// long-output agent cannot crowd out every other agent's row within the live budget.\n\t\t\tif (options.partial) {\n\t\t\t\tconst text = row.statusLine || firstLine(row.output);\n\t\t\t\tif (text) lines.push(` out ${oneLine(text)}`);\n\t\t\t} else {\n\t\t\t\tlines.push(...outputBlockLines(row.output));\n\t\t\t}\n\t\t}\n\t\tif (row.error) lines.push(` error ${firstLine(row.error)}`);\n\t} else if (live && row.tail && row.tail.length > 0) {\n\t\tlines.push(...tailItemLines(row.tail.slice(-4), width));\n\t}\n\treturn lines;\n}\n\nfunction overflowLine(remaining: number, done: number, queued: number): string {\n\tconst parts = [`${done} done`];\n\tif (queued > 0) parts.push(`${queued} queued`);\n\treturn `… +${remaining} more (${parts.join(\", \")}) · ${keyText(\"app.polyphase.inspector\")} inspect`;\n}\n\n/** Folds `agentsOmitted` (agents dropped before the row even reached this layout, e.g. a degraded\n * archived snapshot) into the agents omitted by the line budget, so the overflow count and its\n * done/queued breakdown always reflect every agent the run actually has. */\nfunction overflowLineFor(\n\tomitted: readonly AgentSnapshotRow[],\n\tagentsOmitted: RunSnapshot[\"agentsOmitted\"],\n): string | undefined {\n\tconst remaining = omitted.length + (agentsOmitted?.count ?? 0);\n\tif (remaining <= 0) return undefined;\n\tconst done = omitted.filter((a) => a.status === \"done\").length + (agentsOmitted?.byStatus.done ?? 0);\n\tconst queued = omitted.filter((a) => a.status === \"queued\").length + (agentsOmitted?.byStatus.queued ?? 0);\n\treturn overflowLine(remaining, done, queued);\n}\n\nfunction hintLine(options: RunLayoutOptions): string {\n\tif (!isLive(options)) return keyHint(\"app.polyphase.inspector\", \"inspect agents\");\n\tconst inspectHint = keyHint(\"app.polyphase.inspector\", \"inspect agents\");\n\tconst expandHint = keyHint(\"app.tools.expand\", options.expanded ? \"collapse\" : \"expand\");\n\treturn options.partial ? `${inspectHint} · ${expandHint}` : `${expandHint} · ${inspectHint}`;\n}\n\n/** Adds agent blocks/lines to `lines` while `lines.length` stays within `maxLines`, reserving one\n * line for an overflow marker unless the last agent fits without it (§11.2.3, §20.4: expanded blocks\n * must not grow the row past the viewport-derived cap). A block that cannot fit in the remaining\n * budget is clipped (header first) rather than dropped outright, so the row never shows zero agents\n * when the very first one is too big; every later agent that does not fit is left fully omitted.\n * Returns the agents that did not fit (in full). */\nfunction layoutAgentsBounded(\n\tagents: readonly AgentSnapshotRow[],\n\tmaxLines: number,\n\trenderRow: (row: AgentSnapshotRow) => string[],\n): { lines: string[]; omitted: readonly AgentSnapshotRow[] } {\n\tconst budget = Math.max(1, maxLines);\n\tconst lines: string[] = [];\n\tlet shown = 0;\n\tfor (const row of agents) {\n\t\tconst block = renderRow(row);\n\t\tconst isLastAgent = shown + 1 === agents.length;\n\t\tconst cap = isLastAgent ? budget : budget - 1;\n\t\tconst remaining = cap - lines.length;\n\t\tif (remaining <= 0) {\n\t\t\t// No room left, not even for the reserved overflow line: if nothing has shown yet, use\n\t\t\t// whatever budget remains for a clipped first block rather than show nothing at all.\n\t\t\tif (shown === 0 && budget - lines.length > 0) {\n\t\t\t\tlines.push(...block.slice(0, budget - lines.length));\n\t\t\t\tshown++;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tif (block.length <= remaining) {\n\t\t\tlines.push(...block);\n\t\t\tshown++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (shown === 0) {\n\t\t\tlines.push(...block.slice(0, remaining));\n\t\t\tshown++;\n\t\t}\n\t\tbreak;\n\t}\n\treturn { lines, omitted: agents.slice(shown) };\n}\n\nfunction layoutParallel(snapshot: RunSnapshot, theme: Theme, options: RunLayoutOptions, width: number): string[] {\n\tconst lines = [buildMultiSummaryLine(snapshot, theme, options, width)];\n\tconst labelWidth = computeLabelWidth(snapshot.agents);\n\tconst { lines: agentLines, omitted } = layoutAgentsBounded(snapshot.agents, options.maxLines, (row) =>\n\t\toptions.expanded\n\t\t\t? agentExpandedBlock(row, theme, options, width, { labelWidth })\n\t\t\t: [agentCollapsedLine(row, theme, options, width, { labelWidth })],\n\t);\n\tlines.push(...agentLines);\n\tconst overflow = overflowLineFor(omitted, snapshot.agentsOmitted);\n\tif (overflow) lines.push(overflow);\n\treturn lines;\n}\n\n/** The chain's current step: the first agent still doing something (running/starting/queued), else\n * the first agent waiting to start (pending). A queued or momentarily-pending current step must\n * still count as \"the\" step, not fall through to `step N of N` (§11.3). */\nfunction findRunningStep(snapshot: RunSnapshot): number | undefined {\n\tconst active = snapshot.agents.find(\n\t\t(a) => a.status === \"running\" || a.status === \"starting\" || a.status === \"queued\",\n\t);\n\tif (active) return active.step ?? active.i + 1;\n\tconst pending = snapshot.agents.find((a) => a.status === \"pending\");\n\treturn pending ? (pending.step ?? pending.i + 1) : undefined;\n}\n\nfunction chainSummaryLine(snapshot: RunSnapshot, theme: Theme, options: RunLayoutOptions, width: number): string {\n\tconst total = agentTotal(snapshot);\n\tconst note = agentsOmittedNote(snapshot);\n\tif (snapshot.status !== \"running\") {\n\t\tconst broken = snapshot.agents.find((a) => a.status === \"failed\" || a.status === \"cancelled\");\n\t\tconst left = broken\n\t\t\t? `${statusGlyph(broken.status, theme, { now: 0, animate: false })} ${broken.status === \"cancelled\" ? \"cancelled\" : \"failed\"} at step ${broken.step ?? broken.i + 1} of ${total} (${broken.label})${note}`\n\t\t\t: `${statusGlyph(\"done\", theme, { now: 0, animate: false })} done · ${total} steps${note}`;\n\t\treturn joinLeftRightParts(left, rightSummaryParts(snapshot), width);\n\t}\n\tconst runningStep = findRunningStep(snapshot) ?? total;\n\tconst animate = options.focus && options.partial;\n\tconst pieces = [`${statusGlyph(\"running\", theme, { now: options.now, animate })} step ${runningStep} of ${total}`];\n\tfor (const status of COUNT_ORDER) {\n\t\tif (status === \"running\") continue;\n\t\tconst n = snapshot.counts[status];\n\t\tif (n <= 0) continue;\n\t\tpieces.push(`${statusGlyph(status, theme, { now: options.now, animate: false })} ${n} ${STATUS_WORDS[status]}`);\n\t}\n\tconst left = pieces.join(\" · \");\n\tif (!isLive(options)) return joinLeftRight(left, theme.fg(\"muted\", staticHintText()), width);\n\treturn joinLeftRightParts(left, rightSummaryParts(snapshot), width);\n}\n\nfunction layoutChain(snapshot: RunSnapshot, theme: Theme, options: RunLayoutOptions, width: number): string[] {\n\tconst lines = [chainSummaryLine(snapshot, theme, options, width)];\n\tconst waitsForStep = findRunningStep(snapshot);\n\tconst labelWidth = computeLabelWidth(snapshot.agents);\n\tconst { lines: agentLines, omitted } = layoutAgentsBounded(snapshot.agents, options.maxLines, (row) => {\n\t\tconst extra: RowExtra = { stepLabel: String(row.step ?? row.i + 1), waitsForStep, labelWidth };\n\t\treturn options.expanded\n\t\t\t? agentExpandedBlock(row, theme, options, width, extra)\n\t\t\t: [agentCollapsedLine(row, theme, options, width, extra)];\n\t});\n\tlines.push(...agentLines);\n\tconst overflow = overflowLineFor(omitted, snapshot.agentsOmitted);\n\tif (overflow) lines.push(overflow);\n\treturn lines;\n}\n\nfunction layoutSingle(snapshot: RunSnapshot, theme: Theme, options: RunLayoutOptions, width: number): string[] {\n\tconst row = snapshot.agents[0];\n\tif (!row) return [snapshot.title];\n\n\tconst live = isLive(options);\n\tconst animate = options.focus && options.partial && (row.status === \"running\" || row.status === \"starting\");\n\tconst leftParts = [\n\t\tSTATUS_WORDS[row.status],\n\t\tmodelLabelFor(row, options, { withProvider: options.expanded, withSource: options.expanded }),\n\t];\n\tif (live && (options.expanded || isFinished(row.status)) && row.turns > 0) {\n\t\tleftParts.push(`${row.turns} turn${row.turns === 1 ? \"\" : \"s\"}`);\n\t}\n\tconst left = `${statusGlyph(row.status, theme, { now: options.now, animate })} ${leftParts.filter(Boolean).join(\" · \")}`;\n\n\tconst rightParts: string[] = [];\n\tif (live) {\n\t\tif (row.elapsedMs !== undefined) rightParts.push(formatDuration(row.elapsedMs));\n\t\tif (row.tokens > 0) rightParts.push(`${formatTokens(row.tokens)} tok`);\n\t\tconst costText = formatCost(row.cost);\n\t\tif (costText) rightParts.push(costText);\n\t}\n\n\tconst lines = [joinLeftRightParts(left, rightParts, width)];\n\n\tif (options.expanded) {\n\t\tlines.push(` task ${oneLine(row.task)}`);\n\t\tconst toolsLine = toolsLineText(row);\n\t\tif (live && toolsLine) lines.push(` tools ${toolsLine}`);\n\t\tif (isFinished(row.status)) {\n\t\t\tif (row.output) lines.push(...outputBlockLines(row.output));\n\t\t\tif (row.error) lines.push(` error ${firstLine(row.error)}`);\n\t\t} else if (live && row.tail && row.tail.length > 0) {\n\t\t\t// §11.2.3: single mode's row budget covers this header too, so the tail must shrink on a\n\t\t\t// short terminal instead of growing the row past `options.maxLines` unconditionally.\n\t\t\tconst tailBudget = Math.max(0, Math.min(8, options.maxLines - lines.length - 1));\n\t\t\tif (tailBudget > 0) lines.push(...tailItemLines(row.tail.slice(-tailBudget), width));\n\t\t}\n\t} else if (isFinished(row.status)) {\n\t\tconst text = row.statusLine ?? (row.output ? firstLine(row.output) : undefined);\n\t\tif (text) lines.push(` ${text}`);\n\t\tif (row.error) lines.push(` error ${firstLine(row.error)}`);\n\t} else {\n\t\tlines.push(` task ${oneLine(row.task)}`);\n\t\tif (live && row.now) lines.push(` now ${row.now}`);\n\t}\n\treturn lines;\n}\n\nfunction phaseAgentStatus(status: PhaseSnapshot[\"status\"]): AgentStatus {\n\treturn status;\n}\n\n/** §11.4's alternative final-summary lines, chosen by `snapshot.status`/`snapshot.budget` rather\n * than by agent counts alone, so a script-error `failed` run and a user `cancelled` run never show\n * the `done` glyph. */\nfunction workflowFinalSummaryLeft(snapshot: RunSnapshot, theme: Theme): string {\n\tconst total = agentTotal(snapshot);\n\tconst { done, failed, cancelled } = snapshot.counts;\n\tconst note = agentsOmittedNote(snapshot);\n\tif (snapshot.budget?.exhausted) {\n\t\treturn `${theme.fg(\"warning\", \"⚠\")} budget of ${formatTokens(snapshot.budget.totalTokens)} tokens reached · ${cancelled} agent${cancelled === 1 ? \"\" : \"s\"} cancelled${note}`;\n\t}\n\tif (snapshot.status === \"cancelled\") {\n\t\treturn `${statusGlyph(\"cancelled\", theme, { now: 0, animate: false })} ${cancelledByText(snapshot.agents)} after ${total} agent${total === 1 ? \"\" : \"s\"}${note}`;\n\t}\n\tif (snapshot.status === \"failed\") {\n\t\tconst detail = snapshot.error ? oneLine(snapshot.error) : `${done} of ${total} succeeded · ${failed} failed`;\n\t\treturn `${statusGlyph(\"failed\", theme, { now: 0, animate: false })} ${detail}${note}`;\n\t}\n\treturn `${statusGlyph(\"done\", theme, { now: 0, animate: false })} done · ${total} agents · ${done} ok${cancelled > 0 ? ` · ${cancelled} cancelled` : \"\"}${note}`;\n}\n\nfunction workflowSummaryLine(snapshot: RunSnapshot, theme: Theme, options: RunLayoutOptions, width: number): string {\n\tif (snapshot.status !== \"running\") {\n\t\treturn joinLeftRightParts(workflowFinalSummaryLeft(snapshot, theme), rightSummaryParts(snapshot), width);\n\t}\n\tconst currentPhase = snapshot.currentPhase !== undefined ? snapshot.phases[snapshot.currentPhase] : undefined;\n\tconst animate = options.focus && options.partial;\n\t// §11.4's mockup is the phase's position among every phase (`(2/3)`), not its own agent tally\n\t// (which the phase line below already shows as `done/total`).\n\tconst phaseText = currentPhase\n\t\t? `${currentPhase.title} (${currentPhase.index + 1}/${snapshot.phases.length})`\n\t\t: snapshot.title;\n\tconst pieces = [`${statusGlyph(\"running\", theme, { now: options.now, animate })} ${phaseText}`];\n\tconst running = snapshot.counts.running + snapshot.counts.starting;\n\tif (running > 0) pieces.push(`${statusGlyph(\"running\", theme, { now: options.now, animate: false })} ${running}`);\n\tfor (const status of COUNT_ORDER) {\n\t\tif (status === \"running\") continue;\n\t\tconst n = snapshot.counts[status];\n\t\tif (n <= 0) continue;\n\t\tpieces.push(`${statusGlyph(status, theme, { now: options.now, animate: false })} ${n}`);\n\t}\n\tconst left = pieces.join(\" · \");\n\tif (!isLive(options)) return joinLeftRight(left, theme.fg(\"muted\", staticHintText()), width);\n\treturn joinLeftRightParts(left, rightSummaryParts(snapshot), width);\n}\n\n/** Final phase tally: `done/total ok[ · c cancelled (<labels>[, by you])]` (§11.4). Running phases\n * keep the plain `done/total` form from the live counts. */\nfunction phaseTotalsText(\n\tsnapshot: RunSnapshot,\n\tphase: PhaseSnapshot,\n\tphaseAgents: readonly AgentSnapshotRow[],\n): string {\n\tif (snapshot.status === \"running\") return `${phase.done}/${phase.total}`;\n\t// `phase.done`/`phase.total` are computed only from the agents a degraded archived snapshot\n\t// kept (snapshot.ts), so a partial tally must not read as the phase's complete result.\n\tif (phase.incomplete) return `${phase.done}/${phase.total}+`;\n\tconst cancelled = phaseAgents.filter((agent) => agent.status === \"cancelled\");\n\tif (cancelled.length === 0) return `${phase.done}/${phase.total} ok`;\n\tconst labels = cancelled.map((agent) => agent.label).join(\", \");\n\tconst byYou = cancelled.every((agent) => agent.cancelReason === \"user\");\n\treturn `${phase.done}/${phase.total} ok · ${cancelled.length} cancelled (${labels}${byYou ? \", by you\" : \"\"})`;\n}\n\nconst COLLAPSED_ACTIVE_PHASE_AGENT_CAP = 6;\n\nfunction phaseAgentsOf(snapshot: RunSnapshot, phase: PhaseSnapshot): AgentSnapshotRow[] {\n\treturn snapshot.agents.filter((agent) => agent.phase === phase.index);\n}\n\nfunction isActivePhase(snapshot: RunSnapshot, phase: PhaseSnapshot): boolean {\n\treturn phase.status === \"running\" && snapshot.currentPhase === phase.index;\n}\n\nfunction phaseHeaderLine(\n\tsnapshot: RunSnapshot,\n\ttheme: Theme,\n\toptions: RunLayoutOptions,\n\twidth: number,\n\tphase: PhaseSnapshot,\n\tphaseAgents: readonly AgentSnapshotRow[],\n): string {\n\tconst glyph = statusGlyph(phaseAgentStatus(phase.status), theme, {\n\t\tnow: options.now,\n\t\tanimate: options.focus && options.partial && phase.status === \"running\",\n\t});\n\tconst left = `${glyph} ${phase.index + 1} ${phase.title} ${phaseTotalsText(snapshot, phase, phaseAgents)}`;\n\tconst elapsed = isLive(options) && phase.elapsedMs !== undefined ? formatDuration(phase.elapsedMs) : \"\";\n\treturn joinLeftRight(left, elapsed, width);\n}\n\n/** One phase's full block within `budget` lines total (header included): its header line, plus its\n * agents (up to 6 collapsed, §11.3) when `showAgents` is true, with an overflow marker for whatever\n * does not fit. Agents left out get folded exactly like `layoutAgentsBounded` elsewhere, so a single\n * phase can never consume more than its share of the tree's budget. */\nfunction phaseBlock(\n\tsnapshot: RunSnapshot,\n\ttheme: Theme,\n\toptions: RunLayoutOptions,\n\twidth: number,\n\tphase: PhaseSnapshot,\n\tphaseAgents: readonly AgentSnapshotRow[],\n\tshowAgents: boolean,\n\tbudget: number,\n): string[] {\n\tif (budget <= 0) return [];\n\tconst header = phaseHeaderLine(snapshot, theme, options, width, phase, phaseAgents);\n\tif (!showAgents || phaseAgents.length === 0) return [header];\n\tconst capped = options.expanded ? phaseAgents : phaseAgents.slice(0, COLLAPSED_ACTIVE_PHASE_AGENT_CAP);\n\tconst cappedOverflow = options.expanded ? [] : phaseAgents.slice(COLLAPSED_ACTIVE_PHASE_AGENT_CAP);\n\tconst labelWidth = computeLabelWidth(capped);\n\tconst reserve = cappedOverflow.length > 0 ? 1 : 0;\n\tconst agentBudget = budget - 1 - reserve;\n\tif (agentBudget <= 0) {\n\t\t// No room for an agent line within budget: a forced minimum line here would push the block\n\t\t// past budget (the overrun this guards against). Prefer the overflow marker over a clipped\n\t\t// agent line whenever there is room for it; otherwise the header alone.\n\t\tif (budget - 1 > 0) {\n\t\t\tconst overflow = overflowLineFor(phaseAgents, undefined);\n\t\t\tif (overflow) return [header, ` ${overflow}`];\n\t\t}\n\t\treturn [header];\n\t}\n\tconst { lines: agentLines, omitted } = layoutAgentsBounded(capped, agentBudget, (row) =>\n\t\t(options.expanded\n\t\t\t? agentExpandedBlock(row, theme, options, Math.max(1, width - 4), { labelWidth })\n\t\t\t: [agentCollapsedLine(row, theme, options, Math.max(1, width - 4), { labelWidth })]\n\t\t).map((line) => ` ${line}`),\n\t);\n\tconst lines = [header, ...agentLines];\n\tconst overflow = overflowLineFor([...omitted, ...cappedOverflow], undefined);\n\tif (overflow && lines.length < budget) lines.push(` ${overflow}`);\n\treturn lines;\n}\n\n/** The plain top-to-bottom layout: every phase in order, each a `phaseBlock`, until `budget` runs\n * out. `shownIndexes` lets the caller tell whether this covered the run's active phase;\n * `lineCountByIndex` lets the caller tell whether that phase's block was clipped by the room left\n * over from earlier phases rather than laid out at its full share. */\nfunction layoutPhasesSequential(\n\tsnapshot: RunSnapshot,\n\ttheme: Theme,\n\toptions: RunLayoutOptions,\n\twidth: number,\n\tbudget: number,\n): { lines: string[]; shownIndexes: Set<number>; lineCountByIndex: Map<number, number> } {\n\tconst lines: string[] = [];\n\tconst shownIndexes = new Set<number>();\n\tconst lineCountByIndex = new Map<number, number>();\n\tfor (const phase of snapshot.phases) {\n\t\tif (lines.length >= budget) break;\n\t\tconst phaseAgents = phaseAgentsOf(snapshot, phase);\n\t\tconst showAgents = options.expanded || isActivePhase(snapshot, phase);\n\t\tconst block = phaseBlock(snapshot, theme, options, width, phase, phaseAgents, showAgents, budget - lines.length);\n\t\tlines.push(...block);\n\t\tshownIndexes.add(phase.index);\n\t\tlineCountByIndex.set(phase.index, block.length);\n\t}\n\treturn { lines, shownIndexes, lineCountByIndex };\n}\n\n/** Fallback for when the plain sequential layout would run out of budget before reaching the\n * active phase (e.g. many phases, a late current phase): the active phase and its running agents\n * are laid out first, so they are never silently dropped, and every other phase is folded into a\n * single `+N phases` header-only marker once there is no more room (§11.3). */\nfunction layoutPhasesActiveFirst(\n\tsnapshot: RunSnapshot,\n\ttheme: Theme,\n\toptions: RunLayoutOptions,\n\twidth: number,\n\tbudget: number,\n\tactiveIndex: number,\n): string[] {\n\tconst phases = snapshot.phases;\n\tconst activePhase = phases[activeIndex];\n\tconst activeBlock = phaseBlock(\n\t\tsnapshot,\n\t\ttheme,\n\t\toptions,\n\t\twidth,\n\t\tactivePhase,\n\t\tphaseAgentsOf(snapshot, activePhase),\n\t\ttrue,\n\t\tbudget,\n\t);\n\tconst lines = [...activeBlock];\n\tconst otherIndexes = phases.map((_, index) => index).filter((index) => index !== activeIndex);\n\tconst remaining = Math.max(0, budget - lines.length);\n\tconst showCount = otherIndexes.length <= remaining ? otherIndexes.length : Math.max(0, remaining - 1);\n\tfor (let k = 0; k < showCount; k++) {\n\t\tconst phase = phases[otherIndexes[k]];\n\t\tlines.push(phaseHeaderLine(snapshot, theme, options, width, phase, phaseAgentsOf(snapshot, phase)));\n\t}\n\tconst omitted = otherIndexes.length - showCount;\n\tif (omitted > 0) lines.push(`… +${omitted} phase${omitted === 1 ? \"\" : \"s\"}`);\n\treturn lines;\n}\n\n/** Collapsed: only the active phase, up to 6 agents (§11.3). Expanded: every phase's every agent,\n * bounded by `budget` (§11.4's \"every phase with every agent row\"). Either way, agents left out by\n * the 6-agent cap or by the line budget get an overflow marker (§11.3's \"when agents exceed the line\n * cap\" rule), indented under their phase, so live agents never silently disappear from the tree.\n * When the plain top-to-bottom layout would run out of room before the active phase, it switches to\n * `layoutPhasesActiveFirst` instead of letting that phase vanish. */\nfunction workflowPhaseLines(\n\tsnapshot: RunSnapshot,\n\ttheme: Theme,\n\toptions: RunLayoutOptions,\n\twidth: number,\n\tbudget: number,\n): string[] {\n\tif (budget <= 0 || snapshot.phases.length === 0) return [];\n\tconst sequential = layoutPhasesSequential(snapshot, theme, options, width, budget);\n\tconst activeIndex = snapshot.phases.findIndex((phase) => isActivePhase(snapshot, phase));\n\tif (activeIndex === -1) return sequential.lines;\n\tconst activePhase = snapshot.phases[activeIndex];\n\tif (!sequential.shownIndexes.has(activePhase.index)) {\n\t\treturn layoutPhasesActiveFirst(snapshot, theme, options, width, budget, activeIndex);\n\t}\n\t// The sequential pass reached the active phase, but may have handed it only whatever budget\n\t// earlier phases left over, clipping its header/agents/overflow marker below what it would get\n\t// at its full share. Compare against that full-share block (computed with the whole budget, as\n\t// `layoutPhasesActiveFirst` would give it) to tell \"reached\" apart from \"fit\".\n\tconst fullActiveBlock = phaseBlock(\n\t\tsnapshot,\n\t\ttheme,\n\t\toptions,\n\t\twidth,\n\t\tactivePhase,\n\t\tphaseAgentsOf(snapshot, activePhase),\n\t\ttrue,\n\t\tbudget,\n\t);\n\tconst renderedActiveLines = sequential.lineCountByIndex.get(activePhase.index) ?? 0;\n\tif (renderedActiveLines < fullActiveBlock.length) {\n\t\treturn layoutPhasesActiveFirst(snapshot, theme, options, width, budget, activeIndex);\n\t}\n\treturn sequential.lines;\n}\n\n/** Agents started before the script's first `phase()` call (`run.resolvePhase(undefined)` leaves\n * `agent.phase` unset), or whose recorded phase index fell out of `snapshot.phases` (a degraded\n * archived snapshot), belong to no phase row and would otherwise never be shown. */\nfunction unphasedAgents(snapshot: RunSnapshot): AgentSnapshotRow[] {\n\tconst validIndexes = new Set(snapshot.phases.map((phase) => phase.index));\n\treturn snapshot.agents.filter((agent) => agent.phase === undefined || !validIndexes.has(agent.phase));\n}\n\nfunction layoutWorkflow(snapshot: RunSnapshot, theme: Theme, options: RunLayoutOptions, width: number): string[] {\n\tconst budget = Math.max(1, options.maxLines);\n\tconst lines: string[] = [];\n\tconst unphased = unphasedAgents(snapshot);\n\tif (unphased.length > 0) {\n\t\tconst capped = options.expanded ? unphased : unphased.slice(0, COLLAPSED_ACTIVE_PHASE_AGENT_CAP);\n\t\tconst cappedOverflow = options.expanded ? [] : unphased.slice(COLLAPSED_ACTIVE_PHASE_AGENT_CAP);\n\t\tconst labelWidth = computeLabelWidth(capped);\n\t\tconst reserve = cappedOverflow.length > 0 ? 1 : 0;\n\t\tconst { lines: unphasedLines, omitted } = layoutAgentsBounded(capped, Math.max(1, budget - reserve), (row) =>\n\t\t\toptions.expanded\n\t\t\t\t? agentExpandedBlock(row, theme, options, width, { labelWidth })\n\t\t\t\t: [agentCollapsedLine(row, theme, options, width, { labelWidth })],\n\t\t);\n\t\tlines.push(...unphasedLines);\n\t\tconst overflow = overflowLineFor([...omitted, ...cappedOverflow], undefined);\n\t\tif (overflow && lines.length < budget) lines.push(overflow);\n\t}\n\tlines.push(...workflowPhaseLines(snapshot, theme, options, width, Math.max(0, budget - lines.length)));\n\tif (options.partial && isLive(options) && lines.length < budget) {\n\t\tif (options.expanded) {\n\t\t\tconst logLines = snapshot.log.slice(-5);\n\t\t\tif (logLines.length > 0) {\n\t\t\t\tlines.push(theme.fg(\"muted\", \"log\"));\n\t\t\t\tfor (const line of logLines) {\n\t\t\t\t\tif (lines.length >= budget) break;\n\t\t\t\t\tlines.push(`${theme.fg(\"muted\", \"»\")} ${oneLine(line)}`);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst lastLog = snapshot.log[snapshot.log.length - 1];\n\t\t\tif (lastLog) lines.push(`${theme.fg(\"muted\", \"»\")} ${oneLine(lastLog)}`);\n\t\t}\n\t} else if (!options.partial && snapshot.resultPreview && lines.length < budget) {\n\t\tlines.push(`${theme.fg(\"accent\", \"→\")} ${oneLine(snapshot.resultPreview)}`);\n\t}\n\treturn [workflowSummaryLine(snapshot, theme, options, width), ...lines];\n}\n\n/** Everything after `renderCall`'s title line (§11.4): the summary, the agent rows or workflow\n * phase tree, and the hint line, each fitted to `width`. */\nexport function layoutRun(snapshot: RunSnapshot, width: number, theme: Theme, options: RunLayoutOptions): string[] {\n\tconst sanitized = sanitizeSnapshot(snapshot);\n\tconst body =\n\t\tsanitized.kind === \"workflow\"\n\t\t\t? layoutWorkflow(sanitized, theme, options, width)\n\t\t\t: sanitized.mode === \"single\"\n\t\t\t\t? layoutSingle(sanitized, theme, options, width)\n\t\t\t\t: sanitized.mode === \"chain\"\n\t\t\t\t\t? layoutChain(sanitized, theme, options, width)\n\t\t\t\t\t: layoutParallel(sanitized, theme, options, width);\n\tconst lines = options.hints ? [...body, hintLine(options)] : body;\n\treturn lines.map((line) => fitLine(line, width));\n}\n\nfunction layoutOptionsKey(options: RunLayoutOptions): string {\n\treturn `${options.expanded}|${options.partial}|${options.focus}|${options.maxLines}|${options.hints}`;\n}\n\n/** Reused across re-renders of the same tool call (`context.lastComponent`). Caches its lines by\n * `(snapshot.version, width, options, spinner frame when focus && partial)` (§11.2.6). */\nexport class PolyphaseRunBlock implements Component {\n\tprivate snapshot: RunSnapshot | undefined;\n\tprivate theme: Theme | undefined;\n\tprivate options: RunLayoutOptions | undefined;\n\tprivate cacheKey: string | undefined;\n\tprivate cachedLines: string[] = [];\n\n\tupdate(snapshot: RunSnapshot, theme: Theme, options: RunLayoutOptions): void {\n\t\tthis.snapshot = snapshot;\n\t\tthis.theme = theme;\n\t\tthis.options = options;\n\t}\n\n\trender(width: number): string[] {\n\t\tif (!this.snapshot || !this.theme || !this.options) return [];\n\t\tconst snapshot = this.snapshot;\n\t\tconst theme = this.theme;\n\t\tconst options = this.options;\n\t\tconst spinner = options.focus && options.partial ? spinnerFrame(options.now) : \"\";\n\t\tconst key = `${snapshot.version}|${width}|${layoutOptionsKey(options)}|${spinner}`;\n\t\tif (key !== this.cacheKey) {\n\t\t\tthis.cacheKey = key;\n\t\t\tthis.cachedLines = layoutRun(snapshot, width, theme, options);\n\t\t}\n\t\treturn this.cachedLines;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.cacheKey = undefined;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render model: a plain-data snapshot of a run, taken either from the live store (`snapshotFromRun`)
|
|
3
|
+
* or from persisted details (`snapshotFromDetails`). `render/run-block.ts` (P9) and `ui/inspector.ts`
|
|
4
|
+
* (P10) consume only this snapshot, never `RunView`/`AgentView` or `PolyphaseDetails` directly, so the
|
|
5
|
+
* same layout code renders live and archived runs identically.
|
|
6
|
+
*/
|
|
7
|
+
import type { ThinkingLevel } from "@draht/agent-core";
|
|
8
|
+
import type { LimiterStats } from "../limiter.ts";
|
|
9
|
+
import type { AgentStatus, CancelReason, ModelSource, PolyphaseDetails, RunKind, RunOrigin, RunStatus, RunView, SubagentMode, TranscriptItem, WorkflowSource } from "../types.ts";
|
|
10
|
+
export interface PhaseSnapshot {
|
|
11
|
+
index: number;
|
|
12
|
+
title: string;
|
|
13
|
+
detail?: string;
|
|
14
|
+
model?: string;
|
|
15
|
+
dynamic: boolean;
|
|
16
|
+
status: "pending" | "running" | "done" | "failed";
|
|
17
|
+
agentIdx: number[];
|
|
18
|
+
done: number;
|
|
19
|
+
total: number;
|
|
20
|
+
elapsedMs?: number;
|
|
21
|
+
/** True when `done`/`total` are computed from a subset of agents (archived details with
|
|
22
|
+
* `agentsOmitted`), so they must not be read as the phase's true totals. See `RunSnapshot.agentsOmitted`
|
|
23
|
+
* for the omitted count. */
|
|
24
|
+
incomplete?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface AgentSnapshotRow {
|
|
27
|
+
i: number;
|
|
28
|
+
label: string;
|
|
29
|
+
agentType: string;
|
|
30
|
+
phase?: number;
|
|
31
|
+
step?: number;
|
|
32
|
+
status: AgentStatus;
|
|
33
|
+
cancelReason?: CancelReason;
|
|
34
|
+
provider?: string;
|
|
35
|
+
modelId?: string;
|
|
36
|
+
modelText?: string;
|
|
37
|
+
thinking?: ThinkingLevel;
|
|
38
|
+
modelSource?: ModelSource;
|
|
39
|
+
modelConfirmed?: boolean;
|
|
40
|
+
elapsedMs?: number;
|
|
41
|
+
turns: number;
|
|
42
|
+
toolCalls: number;
|
|
43
|
+
tools?: Record<string, number>;
|
|
44
|
+
tokens: number;
|
|
45
|
+
cost: number;
|
|
46
|
+
blocked: number;
|
|
47
|
+
blockedSample?: string;
|
|
48
|
+
task: string;
|
|
49
|
+
now?: string;
|
|
50
|
+
statusLine?: string;
|
|
51
|
+
output?: string;
|
|
52
|
+
error?: string;
|
|
53
|
+
merge?: "ok" | "failed";
|
|
54
|
+
/** Live only: the newest `tailItems` transcript items (references, not copies). */
|
|
55
|
+
tail?: readonly TranscriptItem[];
|
|
56
|
+
}
|
|
57
|
+
export interface RunSnapshot {
|
|
58
|
+
runId: string;
|
|
59
|
+
kind: RunKind;
|
|
60
|
+
origin: RunOrigin;
|
|
61
|
+
mode?: SubagentMode;
|
|
62
|
+
title: string;
|
|
63
|
+
status: RunStatus;
|
|
64
|
+
live: boolean;
|
|
65
|
+
startedAt: number;
|
|
66
|
+
elapsedMs: number;
|
|
67
|
+
counts: Record<AgentStatus, number>;
|
|
68
|
+
tokens: number;
|
|
69
|
+
cost: number;
|
|
70
|
+
budget?: {
|
|
71
|
+
totalTokens: number;
|
|
72
|
+
spentTokens: number;
|
|
73
|
+
exhausted: boolean;
|
|
74
|
+
};
|
|
75
|
+
workflow?: {
|
|
76
|
+
name: string;
|
|
77
|
+
description: string;
|
|
78
|
+
source: WorkflowSource;
|
|
79
|
+
args?: string;
|
|
80
|
+
};
|
|
81
|
+
phases: PhaseSnapshot[];
|
|
82
|
+
currentPhase?: number;
|
|
83
|
+
agents: AgentSnapshotRow[];
|
|
84
|
+
agentsOmitted?: {
|
|
85
|
+
count: number;
|
|
86
|
+
byStatus: Partial<Record<AgentStatus, number>>;
|
|
87
|
+
};
|
|
88
|
+
log: string[];
|
|
89
|
+
resultPreview?: string;
|
|
90
|
+
error?: string;
|
|
91
|
+
blockedToolCalls: number;
|
|
92
|
+
limiter?: LimiterStats;
|
|
93
|
+
version: number;
|
|
94
|
+
}
|
|
95
|
+
/** Live view of a run, taken from the store. `tailItems` bounds `AgentSnapshotRow.tail`. */
|
|
96
|
+
export declare function snapshotFromRun(run: RunView, options: {
|
|
97
|
+
now: number;
|
|
98
|
+
tailItems: number;
|
|
99
|
+
limiter?: LimiterStats;
|
|
100
|
+
}): RunSnapshot;
|
|
101
|
+
/** Archived or persisted view of a run, taken from `PolyphaseDetails`. No transcript is available, so
|
|
102
|
+
* every `AgentSnapshotRow.tail` is left undefined. */
|
|
103
|
+
export declare function snapshotFromDetails(details: PolyphaseDetails, options?: {
|
|
104
|
+
now?: number;
|
|
105
|
+
}): RunSnapshot;
|
|
106
|
+
//# sourceMappingURL=snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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AAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,cAAc,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxF,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,aAAa,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAA;KAAE,CAAC;IAClF,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CAChB;AA8ID,4FAA4F;AAC5F,wBAAgB,eAAe,CAC9B,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,YAAY,CAAA;CAAE,GACjE,WAAW,CA4Cb;AA8ED;sDACsD;AACtD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,CA2CtG"}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render model: a plain-data snapshot of a run, taken either from the live store (`snapshotFromRun`)
|
|
3
|
+
* or from persisted details (`snapshotFromDetails`). `render/run-block.ts` (P9) and `ui/inspector.ts`
|
|
4
|
+
* (P10) consume only this snapshot, never `RunView`/`AgentView` or `PolyphaseDetails` directly, so the
|
|
5
|
+
* same layout code renders live and archived runs identically.
|
|
6
|
+
*/
|
|
7
|
+
import { billableTokens, extractStatusLine } from "../child-events.js";
|
|
8
|
+
function emptyCounts() {
|
|
9
|
+
return { pending: 0, queued: 0, starting: 0, running: 0, done: 0, failed: 0, cancelled: 0, skipped: 0 };
|
|
10
|
+
}
|
|
11
|
+
const ACTIVE_STATUSES = ["running", "starting"];
|
|
12
|
+
const FINISHED_STATUSES = ["done", "failed", "cancelled", "skipped"];
|
|
13
|
+
function isActive(status) {
|
|
14
|
+
return ACTIVE_STATUSES.includes(status);
|
|
15
|
+
}
|
|
16
|
+
function isFinished(status) {
|
|
17
|
+
return FINISHED_STATUSES.includes(status);
|
|
18
|
+
}
|
|
19
|
+
function firstLine(text) {
|
|
20
|
+
const idx = text.indexOf("\n");
|
|
21
|
+
return idx === -1 ? text : text.slice(0, idx);
|
|
22
|
+
}
|
|
23
|
+
function splitModel(model) {
|
|
24
|
+
if (!model)
|
|
25
|
+
return {};
|
|
26
|
+
const slash = model.indexOf("/");
|
|
27
|
+
if (slash === -1)
|
|
28
|
+
return { id: model };
|
|
29
|
+
return { provider: model.slice(0, slash), id: model.slice(slash + 1) };
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Implements DESIGN §11.1's phase status rules, plus two deliberate extra rules the design's
|
|
33
|
+
* unordered rule list leaves ambiguous (both pinned by tests in render-snapshot.test.ts):
|
|
34
|
+
* 1. **Precedence is failed > done > running > pending.** A non-current phase whose agents all
|
|
35
|
+
* finished with at least one failure reads "failed", not "done", because that is the more
|
|
36
|
+
* actionable signal.
|
|
37
|
+
* 2. **A non-current phase with some finished and some not-yet-started (queued/pending) agents,
|
|
38
|
+
* but none active, reads "running" rather than falling through to "pending".** "Pending" is
|
|
39
|
+
* reserved for phases where no agent has made any progress yet; partial progress should not
|
|
40
|
+
* look identical to "not started".
|
|
41
|
+
*/
|
|
42
|
+
function phaseStatusFor(agentRows, isCurrent) {
|
|
43
|
+
const total = agentRows.length;
|
|
44
|
+
const anyActive = agentRows.some((row) => isActive(row.status));
|
|
45
|
+
const anyFinished = agentRows.some((row) => isFinished(row.status));
|
|
46
|
+
const allFinished = total > 0 && agentRows.every((row) => isFinished(row.status));
|
|
47
|
+
const anyFailed = agentRows.some((row) => row.status === "failed");
|
|
48
|
+
if (anyFailed && !anyActive)
|
|
49
|
+
return "failed";
|
|
50
|
+
if (allFinished && !isCurrent)
|
|
51
|
+
return "done";
|
|
52
|
+
if (isCurrent || anyActive)
|
|
53
|
+
return "running";
|
|
54
|
+
if (anyFinished)
|
|
55
|
+
return "running";
|
|
56
|
+
return "pending";
|
|
57
|
+
}
|
|
58
|
+
function phaseElapsedMs(agentRows) {
|
|
59
|
+
const withElapsed = agentRows.map((row) => row.elapsedMs).filter((ms) => ms !== undefined);
|
|
60
|
+
if (withElapsed.length === 0)
|
|
61
|
+
return undefined;
|
|
62
|
+
return Math.max(...withElapsed);
|
|
63
|
+
}
|
|
64
|
+
function boundedTail(items, tailItems) {
|
|
65
|
+
return tailItems > 0 ? items.slice(-tailItems) : [];
|
|
66
|
+
}
|
|
67
|
+
function buildPhaseSnapshots(phases, agents, currentPhase, incomplete = false) {
|
|
68
|
+
return phases.map((phase, index) => {
|
|
69
|
+
const agentRows = agents.filter((row) => row.phase === index);
|
|
70
|
+
const agentIdx = agentRows.map((row) => row.i);
|
|
71
|
+
const done = agentRows.filter((row) => row.status === "done").length;
|
|
72
|
+
return {
|
|
73
|
+
index,
|
|
74
|
+
title: phase.title,
|
|
75
|
+
detail: phase.detail,
|
|
76
|
+
model: phase.model,
|
|
77
|
+
dynamic: phase.dynamic,
|
|
78
|
+
status: phaseStatusFor(agentRows, currentPhase === index),
|
|
79
|
+
agentIdx,
|
|
80
|
+
done,
|
|
81
|
+
total: agentRows.length,
|
|
82
|
+
elapsedMs: phaseElapsedMs(agentRows),
|
|
83
|
+
...(incomplete ? { incomplete: true } : {}),
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function rowFromAgentView(agent, now, tailItems) {
|
|
88
|
+
const state = agent.state;
|
|
89
|
+
const tokens = billableTokens(state.usage) + billableTokens(state.liveUsage);
|
|
90
|
+
const cost = (state.usage?.cost.total ?? 0) + (state.liveUsage?.cost.total ?? 0);
|
|
91
|
+
const firstBlocked = state.blocked[0];
|
|
92
|
+
const result = agent.result;
|
|
93
|
+
// Matches details.ts's buildAgentDetails: gate on status, and prefer stderr over errorMessage
|
|
94
|
+
// (details.ts: `agent.result?.stderr || agent.state.errorMessage`), so the error text does not
|
|
95
|
+
// change when a row switches from the live store to persisted details at completion.
|
|
96
|
+
const isFailureStatus = agent.status === "failed" || agent.status === "cancelled";
|
|
97
|
+
const errorSource = result?.stderr || state.errorMessage;
|
|
98
|
+
const error = isFailureStatus && errorSource ? firstLine(errorSource) : undefined;
|
|
99
|
+
const elapsedMs = state.startedAt === undefined ? undefined : Math.max(0, (state.endedAt ?? now) - state.startedAt);
|
|
100
|
+
const resolved = Boolean(state.model.provider && state.model.id);
|
|
101
|
+
const modelText = !state.model.confirmed && !resolved
|
|
102
|
+
? (state.model.requested ?? (state.model.source === "child-default" ? "default model" : undefined))
|
|
103
|
+
: undefined;
|
|
104
|
+
return {
|
|
105
|
+
i: agent.index,
|
|
106
|
+
label: agent.label,
|
|
107
|
+
agentType: agent.agentType,
|
|
108
|
+
phase: agent.phase,
|
|
109
|
+
step: agent.step,
|
|
110
|
+
status: agent.status,
|
|
111
|
+
cancelReason: agent.cancelReason,
|
|
112
|
+
provider: state.model.provider,
|
|
113
|
+
modelId: state.model.id,
|
|
114
|
+
modelText,
|
|
115
|
+
// Matches details.ts's buildAgentDetails, which writes `thinking` only from the confirmed
|
|
116
|
+
// `state.model.thinkingLevel`, never from `requestedThinking`. A queued/pending agent's
|
|
117
|
+
// requested thinking level is therefore not shown until the child confirms it.
|
|
118
|
+
thinking: state.model.thinkingLevel,
|
|
119
|
+
modelSource: state.model.source,
|
|
120
|
+
modelConfirmed: state.model.confirmed,
|
|
121
|
+
elapsedMs,
|
|
122
|
+
turns: state.turns,
|
|
123
|
+
toolCalls: state.toolCalls,
|
|
124
|
+
tools: Object.keys(state.toolCounts).length > 0 ? state.toolCounts : undefined,
|
|
125
|
+
tokens,
|
|
126
|
+
cost,
|
|
127
|
+
blocked: state.blockedCount,
|
|
128
|
+
blockedSample: firstBlocked ? `${firstBlocked.toolName}: ${firstBlocked.summary}` : undefined,
|
|
129
|
+
task: agent.task,
|
|
130
|
+
now: isFinished(agent.status) ? undefined : state.nowLine || undefined,
|
|
131
|
+
statusLine: extractStatusLine(result?.output ?? state.finalText),
|
|
132
|
+
output: result?.output,
|
|
133
|
+
error,
|
|
134
|
+
merge: result?.merge ? (result.merge.success ? "ok" : "failed") : undefined,
|
|
135
|
+
tail: boundedTail(state.transcript, tailItems),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/** Live view of a run, taken from the store. `tailItems` bounds `AgentSnapshotRow.tail`. */
|
|
139
|
+
export function snapshotFromRun(run, options) {
|
|
140
|
+
const counts = emptyCounts();
|
|
141
|
+
const agents = run.agents.map((agent) => {
|
|
142
|
+
const row = rowFromAgentView(agent, options.now, options.tailItems);
|
|
143
|
+
counts[row.status]++;
|
|
144
|
+
return row;
|
|
145
|
+
});
|
|
146
|
+
const tokens = agents.reduce((sum, row) => sum + row.tokens, 0);
|
|
147
|
+
const cost = agents.reduce((sum, row) => sum + row.cost, 0);
|
|
148
|
+
const blockedToolCalls = agents.reduce((sum, row) => sum + row.blocked, 0);
|
|
149
|
+
const phases = run.phases;
|
|
150
|
+
const elapsedMs = Math.max(0, (run.endedAt ?? options.now) - run.startedAt);
|
|
151
|
+
return {
|
|
152
|
+
runId: run.id,
|
|
153
|
+
kind: run.kind,
|
|
154
|
+
origin: run.origin,
|
|
155
|
+
mode: run.mode,
|
|
156
|
+
title: run.title,
|
|
157
|
+
status: run.status,
|
|
158
|
+
live: true,
|
|
159
|
+
startedAt: run.startedAt,
|
|
160
|
+
elapsedMs,
|
|
161
|
+
counts,
|
|
162
|
+
tokens,
|
|
163
|
+
cost,
|
|
164
|
+
budget: run.budget.totalTokens === null ? undefined : { ...run.budget, totalTokens: run.budget.totalTokens },
|
|
165
|
+
workflow: run.workflow
|
|
166
|
+
? {
|
|
167
|
+
name: run.workflow.name,
|
|
168
|
+
description: run.workflow.description,
|
|
169
|
+
source: run.workflow.source,
|
|
170
|
+
args: run.workflow.args,
|
|
171
|
+
}
|
|
172
|
+
: undefined,
|
|
173
|
+
phases: buildPhaseSnapshots(phases, agents, run.status === "running" ? run.currentPhase : undefined),
|
|
174
|
+
currentPhase: run.currentPhase,
|
|
175
|
+
agents,
|
|
176
|
+
log: run.log.map((line) => line.text),
|
|
177
|
+
resultPreview: run.resultPreview,
|
|
178
|
+
error: run.error,
|
|
179
|
+
blockedToolCalls,
|
|
180
|
+
limiter: options.limiter,
|
|
181
|
+
version: run.version,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function rowFromAgentDetails(d, now) {
|
|
185
|
+
// details.ts's modelText() writes "provider/id" when both are known, else the raw requested
|
|
186
|
+
// pattern verbatim (§9.2). A requested pattern can itself contain a "/" (e.g. a frontmatter
|
|
187
|
+
// model written as "anthropic/claude-opus"), so a resolved value cannot be told apart from an
|
|
188
|
+
// unresolved one by searching for a slash; that inference wrongly split such patterns.
|
|
189
|
+
// Override, phase and inherited sources always resolve provider/id before the child even
|
|
190
|
+
// starts (model-selection.ts), so `model` is "provider/id" for them regardless of confirmation.
|
|
191
|
+
// Frontmatter is the only source whose pre-confirmation display resolution is ambiguous from
|
|
192
|
+
// `model` alone, so it is treated as resolved only once `modelConfirmed` is true; `child-default`
|
|
193
|
+
// never sets `model` while unconfirmed (modelText() returns `requested`, which is undefined).
|
|
194
|
+
const resolved = d.model !== undefined &&
|
|
195
|
+
(d.modelConfirmed === true ||
|
|
196
|
+
d.modelSource === "override" ||
|
|
197
|
+
d.modelSource === "phase" ||
|
|
198
|
+
d.modelSource === "inherited");
|
|
199
|
+
const split = resolved ? splitModel(d.model) : {};
|
|
200
|
+
const modelText = resolved
|
|
201
|
+
? undefined
|
|
202
|
+
: (d.model ?? (d.modelSource === "child-default" ? "default model" : undefined));
|
|
203
|
+
const elapsedMs = d.startedAt === undefined ? undefined : Math.max(0, (d.endedAt ?? now) - d.startedAt);
|
|
204
|
+
const isFailureStatus = d.status === "failed" || d.status === "cancelled";
|
|
205
|
+
return {
|
|
206
|
+
i: d.i,
|
|
207
|
+
label: d.label,
|
|
208
|
+
agentType: d.agent,
|
|
209
|
+
phase: d.phase,
|
|
210
|
+
step: d.step,
|
|
211
|
+
status: d.status,
|
|
212
|
+
cancelReason: d.cancelReason,
|
|
213
|
+
provider: split.provider,
|
|
214
|
+
modelId: split.id,
|
|
215
|
+
modelText,
|
|
216
|
+
thinking: d.thinking,
|
|
217
|
+
modelSource: d.modelSource,
|
|
218
|
+
modelConfirmed: d.modelConfirmed,
|
|
219
|
+
elapsedMs,
|
|
220
|
+
turns: d.turns ?? 0,
|
|
221
|
+
toolCalls: d.toolCalls ?? 0,
|
|
222
|
+
tools: d.tools,
|
|
223
|
+
tokens: d.tokens ?? 0,
|
|
224
|
+
cost: d.cost ?? 0,
|
|
225
|
+
blocked: d.blocked ?? 0,
|
|
226
|
+
blockedSample: d.blockedSample,
|
|
227
|
+
task: d.task,
|
|
228
|
+
now: d.now,
|
|
229
|
+
statusLine: d.statusLine,
|
|
230
|
+
output: d.output,
|
|
231
|
+
error: isFailureStatus ? d.error : undefined,
|
|
232
|
+
merge: d.merge,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function phaseInfoFromDetails(phase) {
|
|
236
|
+
return { title: phase.title, detail: phase.detail, model: phase.model, dynamic: phase.dynamic ?? false };
|
|
237
|
+
}
|
|
238
|
+
/** Cheap djb2 hash of the whole payload, so a line cache keyed on `RunSnapshot.version` (§11.2)
|
|
239
|
+
* invalidates on every field a renderer can show (model confirmation, log lines, resultPreview,
|
|
240
|
+
* agent `now`/tokens, degradation level, ...), not only status/endedAt/totals.byStatus. Details are
|
|
241
|
+
* capped at `FINAL_DETAILS_MAX_BYTES`/`PARTIAL_DETAILS_MAX_BYTES`, so stringifying them is cheap.
|
|
242
|
+
* `PolyphaseDetails` carries no version counter of its own. */
|
|
243
|
+
function detailsVersion(details) {
|
|
244
|
+
const fingerprint = JSON.stringify(details);
|
|
245
|
+
let hash = 5381;
|
|
246
|
+
for (let i = 0; i < fingerprint.length; i++) {
|
|
247
|
+
hash = (hash * 33) ^ fingerprint.charCodeAt(i);
|
|
248
|
+
}
|
|
249
|
+
return hash >>> 0;
|
|
250
|
+
}
|
|
251
|
+
/** Archived or persisted view of a run, taken from `PolyphaseDetails`. No transcript is available, so
|
|
252
|
+
* every `AgentSnapshotRow.tail` is left undefined. */
|
|
253
|
+
export function snapshotFromDetails(details, options) {
|
|
254
|
+
const now = options?.now ?? Date.now();
|
|
255
|
+
const agents = details.agents.map((agent) => rowFromAgentDetails(agent, now));
|
|
256
|
+
const counts = { ...emptyCounts(), ...details.totals.byStatus };
|
|
257
|
+
const phases = (details.phases ?? []).map(phaseInfoFromDetails);
|
|
258
|
+
const elapsedMs = Math.max(0, (details.endedAt ?? now) - details.startedAt);
|
|
259
|
+
return {
|
|
260
|
+
runId: details.runId,
|
|
261
|
+
kind: details.kind,
|
|
262
|
+
origin: details.origin,
|
|
263
|
+
mode: details.mode,
|
|
264
|
+
title: details.title,
|
|
265
|
+
status: details.status,
|
|
266
|
+
live: false,
|
|
267
|
+
startedAt: details.startedAt,
|
|
268
|
+
elapsedMs,
|
|
269
|
+
counts,
|
|
270
|
+
tokens: details.totals.tokens,
|
|
271
|
+
cost: details.totals.cost,
|
|
272
|
+
budget: details.budget,
|
|
273
|
+
workflow: details.workflow
|
|
274
|
+
? {
|
|
275
|
+
name: details.workflow.name,
|
|
276
|
+
description: details.workflow.description,
|
|
277
|
+
source: details.workflow.source,
|
|
278
|
+
args: details.workflow.args,
|
|
279
|
+
}
|
|
280
|
+
: undefined,
|
|
281
|
+
phases: buildPhaseSnapshots(phases, agents, details.status === "running" ? details.currentPhase : undefined, details.agentsOmitted !== undefined),
|
|
282
|
+
currentPhase: details.currentPhase,
|
|
283
|
+
agents,
|
|
284
|
+
agentsOmitted: details.agentsOmitted,
|
|
285
|
+
log: details.log ?? [],
|
|
286
|
+
resultPreview: details.resultPreview,
|
|
287
|
+
error: details.error,
|
|
288
|
+
blockedToolCalls: details.totals.blockedToolCalls,
|
|
289
|
+
version: detailsVersion(details),
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=snapshot.js.map
|