@selesai/code 0.13.11 → 0.13.13
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 +14 -0
- package/package.json +1 -1
- package/dist/bun/cli.d.ts +0 -2
- package/dist/bun/cli.js +0 -10
- package/dist/bun/register-bedrock.d.ts +0 -1
- package/dist/bun/register-bedrock.js +0 -3
- package/dist/bun/restore-sandbox-env.d.ts +0 -16
- package/dist/bun/restore-sandbox-env.js +0 -35
- package/dist/cli/args.d.ts +0 -59
- package/dist/cli/args.js +0 -428
- package/dist/cli/args.test.d.ts +0 -1
- package/dist/cli/args.test.js +0 -32
- package/dist/cli/config-selector.d.ts +0 -15
- package/dist/cli/config-selector.js +0 -30
- package/dist/cli/credential-print.d.ts +0 -22
- package/dist/cli/credential-print.js +0 -116
- package/dist/cli/file-processor.d.ts +0 -14
- package/dist/cli/file-processor.js +0 -69
- package/dist/cli/initial-message.d.ts +0 -17
- package/dist/cli/initial-message.js +0 -21
- package/dist/cli/list-models.d.ts +0 -8
- package/dist/cli/list-models.js +0 -97
- package/dist/cli/project-trust.d.ts +0 -9
- package/dist/cli/project-trust.js +0 -47
- package/dist/cli/session-picker.d.ts +0 -9
- package/dist/cli/session-picker.js +0 -35
- package/dist/cli/startup-ui.d.ts +0 -22
- package/dist/cli/startup-ui.js +0 -172
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -17
- package/dist/config.d.ts +0 -181
- package/dist/config.js +0 -788
- package/dist/core/agent-session-auto-handoff.test.d.ts +0 -1
- package/dist/core/agent-session-auto-handoff.test.js +0 -183
- package/dist/core/agent-session-runtime.d.ts +0 -118
- package/dist/core/agent-session-runtime.js +0 -305
- package/dist/core/agent-session-services.d.ts +0 -84
- package/dist/core/agent-session-services.js +0 -132
- package/dist/core/agent-session-skill-block.test.d.ts +0 -1
- package/dist/core/agent-session-skill-block.test.js +0 -19
- package/dist/core/agent-session.d.ts +0 -712
- package/dist/core/agent-session.js +0 -3031
- package/dist/core/agents.d.ts +0 -52
- package/dist/core/agents.js +0 -237
- package/dist/core/auth-guidance.d.ts +0 -4
- package/dist/core/auth-guidance.js +0 -20
- package/dist/core/auth-storage.d.ts +0 -61
- package/dist/core/auth-storage.js +0 -249
- package/dist/core/bash-executor.d.ts +0 -31
- package/dist/core/bash-executor.js +0 -110
- package/dist/core/built-in-extensions.d.ts +0 -2
- package/dist/core/built-in-extensions.js +0 -2
- package/dist/core/cache-stats.d.ts +0 -48
- package/dist/core/cache-stats.js +0 -100
- package/dist/core/compaction/branch-summarization.d.ts +0 -97
- package/dist/core/compaction/branch-summarization.js +0 -246
- package/dist/core/compaction/compaction.d.ts +0 -141
- package/dist/core/compaction/compaction.js +0 -659
- package/dist/core/compaction/index.d.ts +0 -6
- package/dist/core/compaction/index.js +0 -6
- package/dist/core/compaction/utils.d.ts +0 -37
- package/dist/core/compaction/utils.js +0 -141
- package/dist/core/defaults.d.ts +0 -3
- package/dist/core/defaults.js +0 -10
- package/dist/core/diagnostics.d.ts +0 -15
- package/dist/core/diagnostics.js +0 -1
- package/dist/core/event-bus.d.ts +0 -8
- package/dist/core/event-bus.js +0 -24
- package/dist/core/exec.d.ts +0 -28
- package/dist/core/exec.js +0 -74
- package/dist/core/experimental.d.ts +0 -5
- package/dist/core/experimental.js +0 -7
- package/dist/core/export-html/ansi-to-html.d.ts +0 -21
- package/dist/core/export-html/ansi-to-html.js +0 -248
- package/dist/core/export-html/index.d.ts +0 -36
- package/dist/core/export-html/index.js +0 -225
- package/dist/core/export-html/template.css +0 -1066
- package/dist/core/export-html/template.html +0 -55
- package/dist/core/export-html/template.js +0 -1864
- package/dist/core/export-html/tool-renderer.d.ts +0 -33
- package/dist/core/export-html/tool-renderer.js +0 -107
- package/dist/core/export-html/vendor/highlight.min.js +0 -1213
- package/dist/core/export-html/vendor/marked.min.js +0 -78
- package/dist/core/extensions/index.d.ts +0 -11
- package/dist/core/extensions/index.js +0 -8
- package/dist/core/extensions/loader.d.ts +0 -22
- package/dist/core/extensions/loader.js +0 -632
- package/dist/core/extensions/loader.test.d.ts +0 -1
- package/dist/core/extensions/loader.test.js +0 -21
- package/dist/core/extensions/runner.d.ts +0 -176
- package/dist/core/extensions/runner.js +0 -1016
- package/dist/core/extensions/types.d.ts +0 -1313
- package/dist/core/extensions/types.js +0 -44
- package/dist/core/extensions/wrapper.d.ts +0 -19
- package/dist/core/extensions/wrapper.js +0 -40
- package/dist/core/footer-data-provider.d.ts +0 -63
- package/dist/core/footer-data-provider.js +0 -337
- package/dist/core/git-command.d.ts +0 -8
- package/dist/core/git-command.js +0 -48
- package/dist/core/handoff.d.ts +0 -11
- package/dist/core/handoff.js +0 -49
- package/dist/core/http-dispatcher.d.ts +0 -21
- package/dist/core/http-dispatcher.js +0 -90
- package/dist/core/index.d.ts +0 -12
- package/dist/core/index.js +0 -12
- package/dist/core/keybindings.d.ts +0 -421
- package/dist/core/keybindings.js +0 -295
- package/dist/core/llama/client.d.ts +0 -66
- package/dist/core/llama/client.js +0 -308
- package/dist/core/llama/huggingface.d.ts +0 -22
- package/dist/core/llama/huggingface.js +0 -140
- package/dist/core/llama/index.d.ts +0 -2
- package/dist/core/llama/index.js +0 -207
- package/dist/core/llama/provider.d.ts +0 -11
- package/dist/core/llama/provider.js +0 -143
- package/dist/core/llama/ui.d.ts +0 -41
- package/dist/core/llama/ui.js +0 -415
- package/dist/core/messages.d.ts +0 -76
- package/dist/core/messages.js +0 -122
- package/dist/core/model-config.d.ts +0 -547
- package/dist/core/model-config.js +0 -278
- package/dist/core/model-registry.d.ts +0 -45
- package/dist/core/model-registry.js +0 -107
- package/dist/core/model-resolver.d.ts +0 -122
- package/dist/core/model-resolver.js +0 -558
- package/dist/core/model-runtime.d.ts +0 -86
- package/dist/core/model-runtime.js +0 -472
- package/dist/core/models-store.d.ts +0 -16
- package/dist/core/models-store.js +0 -44
- package/dist/core/output-guard.d.ts +0 -6
- package/dist/core/output-guard.js +0 -88
- package/dist/core/package-manager.d.ts +0 -221
- package/dist/core/package-manager.js +0 -2232
- package/dist/core/package-manager.test.d.ts +0 -1
- package/dist/core/package-manager.test.js +0 -58
- package/dist/core/project-trust.d.ts +0 -14
- package/dist/core/project-trust.js +0 -58
- package/dist/core/prompt-templates.d.ts +0 -53
- package/dist/core/prompt-templates.js +0 -235
- package/dist/core/provider-attribution.d.ts +0 -3
- package/dist/core/provider-attribution.js +0 -71
- package/dist/core/provider-composer.d.ts +0 -54
- package/dist/core/provider-composer.js +0 -387
- package/dist/core/radius.d.ts +0 -1
- package/dist/core/radius.js +0 -1
- package/dist/core/remote-catalog-provider.d.ts +0 -4
- package/dist/core/remote-catalog-provider.js +0 -119
- package/dist/core/resolve-config-value.d.ts +0 -29
- package/dist/core/resolve-config-value.js +0 -246
- package/dist/core/resource-loader.d.ts +0 -256
- package/dist/core/resource-loader.js +0 -974
- package/dist/core/runtime-credentials.d.ts +0 -16
- package/dist/core/runtime-credentials.js +0 -41
- package/dist/core/sdk.d.ts +0 -107
- package/dist/core/sdk.js +0 -279
- package/dist/core/session-cwd.d.ts +0 -18
- package/dist/core/session-cwd.js +0 -37
- package/dist/core/session-manager.d.ts +0 -355
- package/dist/core/session-manager.js +0 -1339
- package/dist/core/settings-manager-auto-handoff.test.d.ts +0 -1
- package/dist/core/settings-manager-auto-handoff.test.js +0 -42
- package/dist/core/settings-manager.d.ts +0 -350
- package/dist/core/settings-manager.js +0 -1076
- package/dist/core/skills.d.ts +0 -70
- package/dist/core/skills.js +0 -401
- package/dist/core/slash-commands.d.ts +0 -14
- package/dist/core/slash-commands.js +0 -27
- package/dist/core/source-info.d.ts +0 -17
- package/dist/core/source-info.js +0 -18
- package/dist/core/system-prompt.d.ts +0 -30
- package/dist/core/system-prompt.js +0 -129
- package/dist/core/system-prompt.test.d.ts +0 -1
- package/dist/core/system-prompt.test.js +0 -94
- package/dist/core/telemetry.d.ts +0 -2
- package/dist/core/telemetry.js +0 -8
- package/dist/core/timings.d.ts +0 -9
- package/dist/core/timings.js +0 -40
- package/dist/core/tools/bash.d.ts +0 -86
- package/dist/core/tools/bash.js +0 -409
- package/dist/core/tools/edit-diff.d.ts +0 -105
- package/dist/core/tools/edit-diff.js +0 -423
- package/dist/core/tools/edit.d.ts +0 -50
- package/dist/core/tools/edit.js +0 -285
- package/dist/core/tools/file-mutation-queue.d.ts +0 -5
- package/dist/core/tools/file-mutation-queue.js +0 -51
- package/dist/core/tools/find.d.ts +0 -34
- package/dist/core/tools/find.js +0 -304
- package/dist/core/tools/grep.d.ts +0 -36
- package/dist/core/tools/grep.js +0 -303
- package/dist/core/tools/index.d.ts +0 -42
- package/dist/core/tools/index.js +0 -119
- package/dist/core/tools/ls.d.ts +0 -36
- package/dist/core/tools/ls.js +0 -166
- package/dist/core/tools/output-accumulator.d.ts +0 -51
- package/dist/core/tools/output-accumulator.js +0 -183
- package/dist/core/tools/path-utils.d.ts +0 -9
- package/dist/core/tools/path-utils.js +0 -98
- package/dist/core/tools/powershell.d.ts +0 -15
- package/dist/core/tools/powershell.js +0 -38
- package/dist/core/tools/powershell.test.d.ts +0 -1
- package/dist/core/tools/powershell.test.js +0 -20
- package/dist/core/tools/read-vision.test.d.ts +0 -1
- package/dist/core/tools/read-vision.test.js +0 -122
- package/dist/core/tools/read.d.ts +0 -46
- package/dist/core/tools/read.js +0 -327
- package/dist/core/tools/render-utils.d.ts +0 -23
- package/dist/core/tools/render-utils.js +0 -64
- package/dist/core/tools/tool-definition-wrapper.d.ts +0 -13
- package/dist/core/tools/tool-definition-wrapper.js +0 -35
- package/dist/core/tools/truncate.d.ts +0 -69
- package/dist/core/tools/truncate.js +0 -214
- package/dist/core/tools/write.d.ts +0 -25
- package/dist/core/tools/write.js +0 -198
- package/dist/core/trust-manager.d.ts +0 -35
- package/dist/core/trust-manager.js +0 -201
- package/dist/core/usage-totals.d.ts +0 -20
- package/dist/core/usage-totals.js +0 -61
- package/dist/core/vision-caption.d.ts +0 -30
- package/dist/core/vision-caption.js +0 -62
- package/dist/defaults/models.json +0 -335
- package/dist/defaults/settings.json +0 -61
- package/dist/extensions/agent-browser.test.ts +0 -371
- package/dist/extensions/agent-browser.ts +0 -160
- package/dist/extensions/auto-session-name.test.ts +0 -169
- package/dist/extensions/auto-session-name.ts +0 -100
- package/dist/extensions/context-compaction-reminder.test.ts +0 -82
- package/dist/extensions/context-compaction-reminder.ts +0 -28
- package/dist/extensions/copy-turn.test.ts +0 -383
- package/dist/extensions/copy-turn.ts +0 -146
- package/dist/extensions/cost-reconcile.test.ts +0 -272
- package/dist/extensions/cost-reconcile.ts +0 -264
- package/dist/extensions/grep-app/index.test.ts +0 -406
- package/dist/extensions/grep-app/index.ts +0 -216
- package/dist/extensions/handoff-new.test.ts +0 -434
- package/dist/extensions/handoff-new.ts +0 -129
- package/dist/extensions/herdr-agent-state.ts +0 -310
- package/dist/extensions/inline-skills.test.ts +0 -204
- package/dist/extensions/inline-skills.ts +0 -102
- package/dist/extensions/package.json +0 -32
- package/dist/extensions/pi-hermes-memory/CHANGELOG.md +0 -371
- package/dist/extensions/pi-hermes-memory/LICENSE +0 -21
- package/dist/extensions/pi-hermes-memory/README.md +0 -643
- package/dist/extensions/pi-hermes-memory/docs/0.1/TASKS.md +0 -197
- package/dist/extensions/pi-hermes-memory/docs/0.2/PLAN.md +0 -290
- package/dist/extensions/pi-hermes-memory/docs/0.2/TASKS.md +0 -134
- package/dist/extensions/pi-hermes-memory/docs/0.2/TEST-PLAN.md +0 -216
- package/dist/extensions/pi-hermes-memory/docs/0.3/PLAN.md +0 -330
- package/dist/extensions/pi-hermes-memory/docs/0.3/TASKS.md +0 -125
- package/dist/extensions/pi-hermes-memory/docs/0.4/PLAN.md +0 -160
- package/dist/extensions/pi-hermes-memory/docs/0.4/TASKS.md +0 -113
- package/dist/extensions/pi-hermes-memory/docs/0.6/CHANGELOG.md +0 -57
- package/dist/extensions/pi-hermes-memory/docs/0.6/PLAN.md +0 -202
- package/dist/extensions/pi-hermes-memory/docs/0.6/TASKS.md +0 -144
- package/dist/extensions/pi-hermes-memory/docs/0.7/PLAN.md +0 -349
- package/dist/extensions/pi-hermes-memory/docs/0.7/TASKS.md +0 -110
- package/dist/extensions/pi-hermes-memory/docs/PUBLISHING.md +0 -149
- package/dist/extensions/pi-hermes-memory/docs/ROADMAP.md +0 -468
- package/dist/extensions/pi-hermes-memory/docs/images/memory-architecture.svg +0 -1
- package/dist/extensions/pi-hermes-memory/docs/images/pi-logo.svg +0 -22
- package/dist/extensions/pi-hermes-memory/docs/images/pi_memory.png +0 -0
- package/dist/extensions/pi-hermes-memory/docs/images/pi_memory.svg +0 -19
- package/dist/extensions/pi-hermes-memory/docs/images/security-flow.svg +0 -1
- package/dist/extensions/pi-hermes-memory/docs/images/session-lifecycle.svg +0 -1
- package/dist/extensions/pi-hermes-memory/docs/images/source-architecture.svg +0 -1
- package/dist/extensions/pi-hermes-memory/docs/mermaid/memory-architecture.mmd +0 -49
- package/dist/extensions/pi-hermes-memory/docs/mermaid/security-flow.mmd +0 -40
- package/dist/extensions/pi-hermes-memory/docs/mermaid/session-lifecycle.mmd +0 -56
- package/dist/extensions/pi-hermes-memory/docs/mermaid/source-architecture.mmd +0 -54
- package/dist/extensions/pi-hermes-memory/package-lock.json +0 -3799
- package/dist/extensions/pi-hermes-memory/package.json +0 -66
- package/dist/extensions/pi-hermes-memory/scripts/check-min-sdk.mjs +0 -99
- package/dist/extensions/pi-hermes-memory/scripts/ensure-dev.mjs +0 -57
- package/dist/extensions/pi-hermes-memory/src/auto-consolidation-warning.ts +0 -6
- package/dist/extensions/pi-hermes-memory/src/config.ts +0 -178
- package/dist/extensions/pi-hermes-memory/src/constants.ts +0 -424
- package/dist/extensions/pi-hermes-memory/src/extension-root-migration.ts +0 -639
- package/dist/extensions/pi-hermes-memory/src/handlers/auto-consolidate.ts +0 -401
- package/dist/extensions/pi-hermes-memory/src/handlers/background-review.ts +0 -297
- package/dist/extensions/pi-hermes-memory/src/handlers/child-process-watchdog.mjs +0 -90
- package/dist/extensions/pi-hermes-memory/src/handlers/correction-detector.ts +0 -300
- package/dist/extensions/pi-hermes-memory/src/handlers/index-sessions.ts +0 -86
- package/dist/extensions/pi-hermes-memory/src/handlers/insights.ts +0 -78
- package/dist/extensions/pi-hermes-memory/src/handlers/interview.ts +0 -37
- package/dist/extensions/pi-hermes-memory/src/handlers/learn-memory.ts +0 -186
- package/dist/extensions/pi-hermes-memory/src/handlers/message-parts.ts +0 -27
- package/dist/extensions/pi-hermes-memory/src/handlers/pi-child-process.ts +0 -485
- package/dist/extensions/pi-hermes-memory/src/handlers/preview-context.ts +0 -105
- package/dist/extensions/pi-hermes-memory/src/handlers/review-memory-ops.ts +0 -506
- package/dist/extensions/pi-hermes-memory/src/handlers/session-backfill.ts +0 -145
- package/dist/extensions/pi-hermes-memory/src/handlers/session-flush.ts +0 -151
- package/dist/extensions/pi-hermes-memory/src/handlers/session-live-index.ts +0 -94
- package/dist/extensions/pi-hermes-memory/src/handlers/skills-command.ts +0 -1334
- package/dist/extensions/pi-hermes-memory/src/handlers/standing-pin.ts +0 -111
- package/dist/extensions/pi-hermes-memory/src/handlers/switch-project.ts +0 -75
- package/dist/extensions/pi-hermes-memory/src/handlers/sync-markdown-memories.ts +0 -266
- package/dist/extensions/pi-hermes-memory/src/index.ts +0 -378
- package/dist/extensions/pi-hermes-memory/src/lifecycle-timing.ts +0 -54
- package/dist/extensions/pi-hermes-memory/src/paths.ts +0 -61
- package/dist/extensions/pi-hermes-memory/src/project-context.ts +0 -13
- package/dist/extensions/pi-hermes-memory/src/project-memory-migration.ts +0 -93
- package/dist/extensions/pi-hermes-memory/src/project.ts +0 -157
- package/dist/extensions/pi-hermes-memory/src/prompt-context.ts +0 -55
- package/dist/extensions/pi-hermes-memory/src/store/atomic-lock-coordinator.ts +0 -375
- package/dist/extensions/pi-hermes-memory/src/store/canonical-storage-path.ts +0 -54
- package/dist/extensions/pi-hermes-memory/src/store/content-scanner.ts +0 -101
- package/dist/extensions/pi-hermes-memory/src/store/db.ts +0 -1180
- package/dist/extensions/pi-hermes-memory/src/store/fts-query.ts +0 -101
- package/dist/extensions/pi-hermes-memory/src/store/markdown-mutation-lock.ts +0 -38
- package/dist/extensions/pi-hermes-memory/src/store/memory-lookup.ts +0 -24
- package/dist/extensions/pi-hermes-memory/src/store/memory-store.ts +0 -1191
- package/dist/extensions/pi-hermes-memory/src/store/recovery-maintenance.ts +0 -66
- package/dist/extensions/pi-hermes-memory/src/store/schema.ts +0 -118
- package/dist/extensions/pi-hermes-memory/src/store/session-anchor-search.ts +0 -472
- package/dist/extensions/pi-hermes-memory/src/store/session-indexer.ts +0 -511
- package/dist/extensions/pi-hermes-memory/src/store/session-parser.ts +0 -213
- package/dist/extensions/pi-hermes-memory/src/store/session-search.ts +0 -234
- package/dist/extensions/pi-hermes-memory/src/store/skill-store.ts +0 -950
- package/dist/extensions/pi-hermes-memory/src/store/skill-utils.ts +0 -133
- package/dist/extensions/pi-hermes-memory/src/store/sqlite-memory-store.ts +0 -1002
- package/dist/extensions/pi-hermes-memory/src/store/sqlite-native.ts +0 -241
- package/dist/extensions/pi-hermes-memory/src/store/standing-instructions.ts +0 -247
- package/dist/extensions/pi-hermes-memory/src/tools/memory-search-tool.ts +0 -95
- package/dist/extensions/pi-hermes-memory/src/tools/memory-tool.ts +0 -469
- package/dist/extensions/pi-hermes-memory/src/tools/session-search-tool.ts +0 -246
- package/dist/extensions/pi-hermes-memory/src/tools/shared-output-view.ts +0 -170
- package/dist/extensions/pi-hermes-memory/src/tools/skill-tool.ts +0 -333
- package/dist/extensions/pi-hermes-memory/src/tools/tool-result-views.ts +0 -105
- package/dist/extensions/pi-hermes-memory/src/types.ts +0 -214
- package/dist/extensions/pi-hermes-memory/tests/config.test.ts +0 -434
- package/dist/extensions/pi-hermes-memory/tests/extension-root-migration.test.ts +0 -368
- package/dist/extensions/pi-hermes-memory/tests/handlers/auto-consolidate.test.ts +0 -984
- package/dist/extensions/pi-hermes-memory/tests/handlers/background-review.test.ts +0 -950
- package/dist/extensions/pi-hermes-memory/tests/handlers/correction-detector.test.ts +0 -671
- package/dist/extensions/pi-hermes-memory/tests/handlers/insights.test.ts +0 -157
- package/dist/extensions/pi-hermes-memory/tests/handlers/interview.test.ts +0 -127
- package/dist/extensions/pi-hermes-memory/tests/handlers/pi-child-process.test.ts +0 -905
- package/dist/extensions/pi-hermes-memory/tests/handlers/preview-context.test.ts +0 -152
- package/dist/extensions/pi-hermes-memory/tests/handlers/prompt-context.test.ts +0 -166
- package/dist/extensions/pi-hermes-memory/tests/handlers/resources-discover.test.ts +0 -71
- package/dist/extensions/pi-hermes-memory/tests/handlers/review-memory-ops.test.ts +0 -614
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-backfill.test.ts +0 -192
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-flush.test.ts +0 -677
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-live-index.test.ts +0 -225
- package/dist/extensions/pi-hermes-memory/tests/handlers/skills-command.test.ts +0 -827
- package/dist/extensions/pi-hermes-memory/tests/handlers/standing-pin.test.ts +0 -134
- package/dist/extensions/pi-hermes-memory/tests/handlers/sync-markdown-memories.test.ts +0 -491
- package/dist/extensions/pi-hermes-memory/tests/handlers/system-prompt.test.ts +0 -199
- package/dist/extensions/pi-hermes-memory/tests/handlers/thinking-max.test.ts +0 -64
- package/dist/extensions/pi-hermes-memory/tests/index.test.ts +0 -30
- package/dist/extensions/pi-hermes-memory/tests/integration/flow.test.ts +0 -126
- package/dist/extensions/pi-hermes-memory/tests/lifecycle-timing.test.ts +0 -76
- package/dist/extensions/pi-hermes-memory/tests/paths.test.ts +0 -23
- package/dist/extensions/pi-hermes-memory/tests/project-memory-migration.test.ts +0 -80
- package/dist/extensions/pi-hermes-memory/tests/project-rebinding.test.ts +0 -115
- package/dist/extensions/pi-hermes-memory/tests/project.test.ts +0 -120
- package/dist/extensions/pi-hermes-memory/tests/run-all-timeout.test.ts +0 -107
- package/dist/extensions/pi-hermes-memory/tests/run-all.sh +0 -45
- package/dist/extensions/pi-hermes-memory/tests/store/atomic-lock-coordinator.test.ts +0 -381
- package/dist/extensions/pi-hermes-memory/tests/store/content-scanner.test.ts +0 -388
- package/dist/extensions/pi-hermes-memory/tests/store/db.test.ts +0 -1046
- package/dist/extensions/pi-hermes-memory/tests/store/markdown-mutation-lock.test.ts +0 -34
- package/dist/extensions/pi-hermes-memory/tests/store/memory-store.test.ts +0 -2150
- package/dist/extensions/pi-hermes-memory/tests/store/recovery-maintenance.test.ts +0 -170
- package/dist/extensions/pi-hermes-memory/tests/store/session-anchor-search.test.ts +0 -210
- package/dist/extensions/pi-hermes-memory/tests/store/session-indexer.test.ts +0 -643
- package/dist/extensions/pi-hermes-memory/tests/store/session-parser.test.ts +0 -282
- package/dist/extensions/pi-hermes-memory/tests/store/session-search.test.ts +0 -287
- package/dist/extensions/pi-hermes-memory/tests/store/skill-store.test.ts +0 -678
- package/dist/extensions/pi-hermes-memory/tests/store/skill-utils.test.ts +0 -21
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-lazy-load.test.ts +0 -78
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-memory-store.test.ts +0 -543
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-native.test.ts +0 -164
- package/dist/extensions/pi-hermes-memory/tests/store/standing-instructions.test.ts +0 -171
- package/dist/extensions/pi-hermes-memory/tests/tools/memory-search-tool.test.ts +0 -84
- package/dist/extensions/pi-hermes-memory/tests/tools/memory-tool.test.ts +0 -709
- package/dist/extensions/pi-hermes-memory/tests/tools/session-search-tool.test.ts +0 -345
- package/dist/extensions/pi-hermes-memory/tests/tools/shared-output-view.test.ts +0 -362
- package/dist/extensions/pi-hermes-memory/tests/tools/skill-tool.test.ts +0 -478
- package/dist/extensions/pi-hermes-memory/tests/tools/tool-result-renderer-wiring.test.ts +0 -40
- package/dist/extensions/pi-hermes-memory/tsconfig.json +0 -19
- package/dist/extensions/pi-intercom/CHANGELOG.md +0 -321
- package/dist/extensions/pi-intercom/LICENSE +0 -21
- package/dist/extensions/pi-intercom/README.md +0 -598
- package/dist/extensions/pi-intercom/banner.png +0 -0
- package/dist/extensions/pi-intercom/broker/broker.ts +0 -1721
- package/dist/extensions/pi-intercom/broker/client-liveness.test.ts +0 -173
- package/dist/extensions/pi-intercom/broker/client.test.ts +0 -83
- package/dist/extensions/pi-intercom/broker/client.ts +0 -793
- package/dist/extensions/pi-intercom/broker/extension-state.ts +0 -197
- package/dist/extensions/pi-intercom/broker/extension.test.ts +0 -486
- package/dist/extensions/pi-intercom/broker/framing.test.ts +0 -114
- package/dist/extensions/pi-intercom/broker/framing.ts +0 -115
- package/dist/extensions/pi-intercom/broker/paths.test.ts +0 -153
- package/dist/extensions/pi-intercom/broker/paths.ts +0 -134
- package/dist/extensions/pi-intercom/broker/protocol.ts +0 -208
- package/dist/extensions/pi-intercom/broker/runtime-claim.test.ts +0 -34
- package/dist/extensions/pi-intercom/broker/runtime-claim.ts +0 -21
- package/dist/extensions/pi-intercom/broker/spawn.test.ts +0 -252
- package/dist/extensions/pi-intercom/broker/spawn.ts +0 -420
- package/dist/extensions/pi-intercom/config.test.ts +0 -104
- package/dist/extensions/pi-intercom/config.ts +0 -163
- package/dist/extensions/pi-intercom/cwd.test.ts +0 -40
- package/dist/extensions/pi-intercom/cwd.ts +0 -31
- package/dist/extensions/pi-intercom/extension-api.ts +0 -84
- package/dist/extensions/pi-intercom/format-context.test.ts +0 -31
- package/dist/extensions/pi-intercom/format-context.ts +0 -32
- package/dist/extensions/pi-intercom/index.ts +0 -2821
- package/dist/extensions/pi-intercom/intercom.integration.test.ts +0 -4232
- package/dist/extensions/pi-intercom/package.json +0 -49
- package/dist/extensions/pi-intercom/project-agent.test.ts +0 -145
- package/dist/extensions/pi-intercom/project-agent.ts +0 -324
- package/dist/extensions/pi-intercom/reply-tracker.test.ts +0 -239
- package/dist/extensions/pi-intercom/reply-tracker.ts +0 -160
- package/dist/extensions/pi-intercom/skills/pi-intercom/SKILL.md +0 -452
- package/dist/extensions/pi-intercom/test/inline-message.test.ts +0 -184
- package/dist/extensions/pi-intercom/test/overlay-width.test.ts +0 -66
- package/dist/extensions/pi-intercom/types.ts +0 -165
- package/dist/extensions/pi-intercom/ui/compose.ts +0 -143
- package/dist/extensions/pi-intercom/ui/inline-message.ts +0 -118
- package/dist/extensions/pi-intercom/ui/session-list.ts +0 -166
- package/dist/extensions/pi-rewind-hook/README.md +0 -248
- package/dist/extensions/pi-rewind-hook/index.ts +0 -1575
- package/dist/extensions/pi-rewind-hook/package.json +0 -31
- package/dist/extensions/pi-subagents/.github/assets/subagent-fleet-inspector.png +0 -0
- package/dist/extensions/pi-subagents/.github/workflows/release.yml +0 -28
- package/dist/extensions/pi-subagents/.github/workflows/test.yml +0 -51
- package/dist/extensions/pi-subagents/.greptile/config.json +0 -33
- package/dist/extensions/pi-subagents/.greptile/files.json +0 -8
- package/dist/extensions/pi-subagents/.greptile/rules.md +0 -16
- package/dist/extensions/pi-subagents/.oxlintrc.json +0 -43
- package/dist/extensions/pi-subagents/AGENTS.md +0 -5
- package/dist/extensions/pi-subagents/CHANGELOG.md +0 -2249
- package/dist/extensions/pi-subagents/LICENSE +0 -21
- package/dist/extensions/pi-subagents/README.md +0 -126
- package/dist/extensions/pi-subagents/VISION.md +0 -81
- package/dist/extensions/pi-subagents/agents/delegate.md +0 -14
- package/dist/extensions/pi-subagents/agents/oracle.md +0 -78
- package/dist/extensions/pi-subagents/agents/researcher.md +0 -52
- package/dist/extensions/pi-subagents/agents/reviewer.md +0 -89
- package/dist/extensions/pi-subagents/agents/scout.md +0 -50
- package/dist/extensions/pi-subagents/agents/worker.md +0 -60
- package/dist/extensions/pi-subagents/async-retention-discovery-worker.mjs +0 -180
- package/dist/extensions/pi-subagents/docs/agents.md +0 -375
- package/dist/extensions/pi-subagents/docs/configuration.md +0 -508
- package/dist/extensions/pi-subagents/docs/extension-api.md +0 -443
- package/dist/extensions/pi-subagents/docs/missions.md +0 -121
- package/dist/extensions/pi-subagents/docs/models.md +0 -258
- package/dist/extensions/pi-subagents/docs/observability.md +0 -262
- package/dist/extensions/pi-subagents/docs/tool-reference.md +0 -482
- package/dist/extensions/pi-subagents/docs/watchdog.md +0 -176
- package/dist/extensions/pi-subagents/docs/workflows.md +0 -475
- package/dist/extensions/pi-subagents/index.ts +0 -10
- package/dist/extensions/pi-subagents/inspector-runner.mjs +0 -11
- package/dist/extensions/pi-subagents/install.mjs +0 -94
- package/dist/extensions/pi-subagents/package-lock.json +0 -1872
- package/dist/extensions/pi-subagents/package.json +0 -109
- package/dist/extensions/pi-subagents/prompts/council.md +0 -60
- package/dist/extensions/pi-subagents/prompts/gather-context-and-clarify.md +0 -13
- package/dist/extensions/pi-subagents/prompts/parallel-cleanup.md +0 -59
- package/dist/extensions/pi-subagents/prompts/parallel-research.md +0 -50
- package/dist/extensions/pi-subagents/prompts/parallel-review.md +0 -58
- package/dist/extensions/pi-subagents/prompts/review-loop.md +0 -47
- package/dist/extensions/pi-subagents/skills/council-mode/SKILL.md +0 -59
- package/dist/extensions/pi-subagents/skills/council-mode/references/pass-contracts.md +0 -150
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +0 -103
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +0 -70
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +0 -539
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +0 -161
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/multi-lane-orchestration.md +0 -51
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +0 -295
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/review-and-validation.md +0 -73
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +0 -1336
- package/dist/extensions/pi-subagents/src/agents/agent-memory.ts +0 -254
- package/dist/extensions/pi-subagents/src/agents/agent-refinements.ts +0 -624
- package/dist/extensions/pi-subagents/src/agents/agent-scope.ts +0 -6
- package/dist/extensions/pi-subagents/src/agents/agent-selection.ts +0 -25
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +0 -176
- package/dist/extensions/pi-subagents/src/agents/agents.ts +0 -2794
- package/dist/extensions/pi-subagents/src/agents/builtin-names.ts +0 -9
- package/dist/extensions/pi-subagents/src/agents/chain-serializer.ts +0 -280
- package/dist/extensions/pi-subagents/src/agents/frontmatter.ts +0 -153
- package/dist/extensions/pi-subagents/src/agents/identity.ts +0 -30
- package/dist/extensions/pi-subagents/src/agents/proactive-skills.ts +0 -194
- package/dist/extensions/pi-subagents/src/agents/runtime-agent-events.ts +0 -70
- package/dist/extensions/pi-subagents/src/agents/runtime-agent-registry.ts +0 -425
- package/dist/extensions/pi-subagents/src/agents/skills.ts +0 -754
- package/dist/extensions/pi-subagents/src/api/agents.ts +0 -12
- package/dist/extensions/pi-subagents/src/api/background-work.ts +0 -206
- package/dist/extensions/pi-subagents/src/api/capability-ceiling.ts +0 -17
- package/dist/extensions/pi-subagents/src/api/control-channel.ts +0 -4
- package/dist/extensions/pi-subagents/src/api/delegation.ts +0 -112
- package/dist/extensions/pi-subagents/src/api/external-job-provider.ts +0 -195
- package/dist/extensions/pi-subagents/src/api/external-runs.ts +0 -282
- package/dist/extensions/pi-subagents/src/api/intercom-bridge.ts +0 -3
- package/dist/extensions/pi-subagents/src/api/pi-args.ts +0 -5
- package/dist/extensions/pi-subagents/src/api/preflight.ts +0 -497
- package/dist/extensions/pi-subagents/src/api/project-panes.ts +0 -32
- package/dist/extensions/pi-subagents/src/api/shared-types.ts +0 -24
- package/dist/extensions/pi-subagents/src/extension/config.ts +0 -235
- package/dist/extensions/pi-subagents/src/extension/control-notices.ts +0 -58
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +0 -278
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +0 -205
- package/dist/extensions/pi-subagents/src/extension/index.ts +0 -1093
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +0 -209
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +0 -860
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +0 -415
- package/dist/extensions/pi-subagents/src/extension/steering-notices.ts +0 -35
- package/dist/extensions/pi-subagents/src/extension/subagent-guide.ts +0 -39
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +0 -204
- package/dist/extensions/pi-subagents/src/extension/tool-result.ts +0 -19
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +0 -235
- package/dist/extensions/pi-subagents/src/inspectors/herdr/client.ts +0 -130
- package/dist/extensions/pi-subagents/src/inspectors/herdr/focus.ts +0 -55
- package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +0 -147
- package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +0 -730
- package/dist/extensions/pi-subagents/src/inspectors/herdr/session-roots-codec.ts +0 -42
- package/dist/extensions/pi-subagents/src/inspectors/herdr/shell-command.ts +0 -16
- package/dist/extensions/pi-subagents/src/integrations/herdr-status.ts +0 -396
- package/dist/extensions/pi-subagents/src/intercom/intercom-bridge.ts +0 -191
- package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +0 -812
- package/dist/extensions/pi-subagents/src/intercom/result-intercom.ts +0 -423
- package/dist/extensions/pi-subagents/src/missions/actions.ts +0 -433
- package/dist/extensions/pi-subagents/src/missions/goal-driver.ts +0 -164
- package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +0 -367
- package/dist/extensions/pi-subagents/src/missions/store.ts +0 -584
- package/dist/extensions/pi-subagents/src/missions/types.ts +0 -190
- package/dist/extensions/pi-subagents/src/missions/workflow-state.ts +0 -260
- package/dist/extensions/pi-subagents/src/policy/authority.ts +0 -46
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +0 -662
- package/dist/extensions/pi-subagents/src/runs/background/active-async-capacity.ts +0 -498
- package/dist/extensions/pi-subagents/src/runs/background/active-run-index.ts +0 -139
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +0 -2000
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +0 -781
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +0 -627
- package/dist/extensions/pi-subagents/src/runs/background/async-retention.ts +0 -903
- package/dist/extensions/pi-subagents/src/runs/background/async-status-snapshot.ts +0 -48
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +0 -745
- package/dist/extensions/pi-subagents/src/runs/background/auto-drain.ts +0 -68
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +0 -321
- package/dist/extensions/pi-subagents/src/runs/background/chain-root-attachment.ts +0 -270
- package/dist/extensions/pi-subagents/src/runs/background/completion-batcher.ts +0 -168
- package/dist/extensions/pi-subagents/src/runs/background/completion-dedupe.ts +0 -58
- package/dist/extensions/pi-subagents/src/runs/background/completion-replay.ts +0 -287
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +0 -768
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +0 -620
- package/dist/extensions/pi-subagents/src/runs/background/index-segment.ts +0 -59
- package/dist/extensions/pi-subagents/src/runs/background/inspect-rpc.ts +0 -443
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +0 -594
- package/dist/extensions/pi-subagents/src/runs/background/owned-process-tree.ts +0 -104
- package/dist/extensions/pi-subagents/src/runs/background/parallel-groups.ts +0 -45
- package/dist/extensions/pi-subagents/src/runs/background/process-terminal.ts +0 -294
- package/dist/extensions/pi-subagents/src/runs/background/result-delivery-ownership.ts +0 -45
- package/dist/extensions/pi-subagents/src/runs/background/result-files.ts +0 -519
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +0 -792
- package/dist/extensions/pi-subagents/src/runs/background/resume-guidance.ts +0 -56
- package/dist/extensions/pi-subagents/src/runs/background/retained-children.ts +0 -135
- package/dist/extensions/pi-subagents/src/runs/background/run-id-query.ts +0 -7
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +0 -175
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +0 -694
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +0 -908
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +0 -410
- package/dist/extensions/pi-subagents/src/runs/background/steering.ts +0 -239
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +0 -5626
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +0 -725
- package/dist/extensions/pi-subagents/src/runs/background/terminal-run-index.ts +0 -138
- package/dist/extensions/pi-subagents/src/runs/background/top-level-async.ts +0 -14
- package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +0 -196
- package/dist/extensions/pi-subagents/src/runs/background/wait-config.ts +0 -50
- package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +0 -348
- package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +0 -49
- package/dist/extensions/pi-subagents/src/runs/foreground/async-dismiss-action.ts +0 -86
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +0 -262
- package/dist/extensions/pi-subagents/src/runs/foreground/async-stop-action.ts +0 -86
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +0 -2430
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-control.ts +0 -153
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +0 -160
- package/dist/extensions/pi-subagents/src/runs/foreground/prompt-audit.ts +0 -172
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +0 -6918
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-detach-reconcile.ts +0 -299
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +0 -188
- package/dist/extensions/pi-subagents/src/runs/shared/abort-recovery.ts +0 -119
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +0 -1448
- package/dist/extensions/pi-subagents/src/runs/shared/agent-contract.ts +0 -38
- package/dist/extensions/pi-subagents/src/runs/shared/async-status-projection.ts +0 -597
- package/dist/extensions/pi-subagents/src/runs/shared/background-process-options.ts +0 -9
- package/dist/extensions/pi-subagents/src/runs/shared/capability-ceiling.ts +0 -209
- package/dist/extensions/pi-subagents/src/runs/shared/chain-outputs.ts +0 -116
- package/dist/extensions/pi-subagents/src/runs/shared/child-identity.ts +0 -51
- package/dist/extensions/pi-subagents/src/runs/shared/child-launch-plan.ts +0 -151
- package/dist/extensions/pi-subagents/src/runs/shared/child-protocol.ts +0 -415
- package/dist/extensions/pi-subagents/src/runs/shared/completion-evidence.ts +0 -89
- package/dist/extensions/pi-subagents/src/runs/shared/completion-guard.ts +0 -252
- package/dist/extensions/pi-subagents/src/runs/shared/context-mode.ts +0 -44
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +0 -297
- package/dist/extensions/pi-subagents/src/runs/shared/extension-bindings.ts +0 -78
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-contract.ts +0 -138
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-preflight.ts +0 -122
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +0 -429
- package/dist/extensions/pi-subagents/src/runs/shared/external-job-bridge.ts +0 -460
- package/dist/extensions/pi-subagents/src/runs/shared/external-job-runner.ts +0 -389
- package/dist/extensions/pi-subagents/src/runs/shared/fast-mode-extension.ts +0 -10
- package/dist/extensions/pi-subagents/src/runs/shared/host-step-status.ts +0 -231
- package/dist/extensions/pi-subagents/src/runs/shared/lane-metadata.ts +0 -105
- package/dist/extensions/pi-subagents/src/runs/shared/launch-cwd.ts +0 -16
- package/dist/extensions/pi-subagents/src/runs/shared/llm-intent-arbiter.ts +0 -302
- package/dist/extensions/pi-subagents/src/runs/shared/long-running-guard.ts +0 -221
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-config-sources.ts +0 -422
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +0 -483
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-grant.ts +0 -194
- package/dist/extensions/pi-subagents/src/runs/shared/model-exclusions.ts +0 -305
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +0 -578
- package/dist/extensions/pi-subagents/src/runs/shared/model-scope.ts +0 -205
- package/dist/extensions/pi-subagents/src/runs/shared/mutation-evidence.ts +0 -199
- package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +0 -1086
- package/dist/extensions/pi-subagents/src/runs/shared/nested-path.ts +0 -52
- package/dist/extensions/pi-subagents/src/runs/shared/nested-render.ts +0 -127
- package/dist/extensions/pi-subagents/src/runs/shared/orca-progress-tabs.ts +0 -499
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +0 -692
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +0 -279
- package/dist/extensions/pi-subagents/src/runs/shared/permissions.ts +0 -99
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +0 -1044
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +0 -163
- package/dist/extensions/pi-subagents/src/runs/shared/process-signal.ts +0 -32
- package/dist/extensions/pi-subagents/src/runs/shared/run-fanout-budget.ts +0 -280
- package/dist/extensions/pi-subagents/src/runs/shared/run-history.ts +0 -201
- package/dist/extensions/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.ts +0 -71
- package/dist/extensions/pi-subagents/src/runs/shared/session-lease.ts +0 -293
- package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +0 -304
- package/dist/extensions/pi-subagents/src/runs/shared/spawn-budget.ts +0 -128
- package/dist/extensions/pi-subagents/src/runs/shared/structured-output.ts +0 -196
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-control.ts +0 -290
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +0 -808
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-startup-retry.ts +0 -116
- package/dist/extensions/pi-subagents/src/runs/shared/task-intent.ts +0 -197
- package/dist/extensions/pi-subagents/src/runs/shared/tool-availability.ts +0 -81
- package/dist/extensions/pi-subagents/src/runs/shared/tool-budget.ts +0 -80
- package/dist/extensions/pi-subagents/src/runs/shared/tool-timeout.ts +0 -93
- package/dist/extensions/pi-subagents/src/runs/shared/usage-budget.ts +0 -65
- package/dist/extensions/pi-subagents/src/runs/shared/workflow-graph.ts +0 -225
- package/dist/extensions/pi-subagents/src/runs/shared/worktree-cleanup-plan.ts +0 -847
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +0 -802
- package/dist/extensions/pi-subagents/src/shared/accessible-dir.ts +0 -47
- package/dist/extensions/pi-subagents/src/shared/agent-stream-options.ts +0 -5
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +0 -281
- package/dist/extensions/pi-subagents/src/shared/atomic-json.ts +0 -81
- package/dist/extensions/pi-subagents/src/shared/capacity-resilient-json.ts +0 -102
- package/dist/extensions/pi-subagents/src/shared/child-session-name.ts +0 -46
- package/dist/extensions/pi-subagents/src/shared/child-transcript.ts +0 -264
- package/dist/extensions/pi-subagents/src/shared/completion-owner.ts +0 -14
- package/dist/extensions/pi-subagents/src/shared/display-text.ts +0 -150
- package/dist/extensions/pi-subagents/src/shared/extension-context.ts +0 -24
- package/dist/extensions/pi-subagents/src/shared/file-coalescer.ts +0 -49
- package/dist/extensions/pi-subagents/src/shared/file-system-retry.ts +0 -95
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +0 -305
- package/dist/extensions/pi-subagents/src/shared/formatters.ts +0 -146
- package/dist/extensions/pi-subagents/src/shared/jsonl-writer.ts +0 -81
- package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +0 -135
- package/dist/extensions/pi-subagents/src/shared/model-info.ts +0 -101
- package/dist/extensions/pi-subagents/src/shared/node-executable.ts +0 -21
- package/dist/extensions/pi-subagents/src/shared/post-exit-stdio-guard.ts +0 -85
- package/dist/extensions/pi-subagents/src/shared/prompt-resources.ts +0 -11
- package/dist/extensions/pi-subagents/src/shared/pruned-fork.ts +0 -450
- package/dist/extensions/pi-subagents/src/shared/session-file-trust.ts +0 -19
- package/dist/extensions/pi-subagents/src/shared/session-identity.ts +0 -10
- package/dist/extensions/pi-subagents/src/shared/session-tokens.ts +0 -55
- package/dist/extensions/pi-subagents/src/shared/settings.ts +0 -409
- package/dist/extensions/pi-subagents/src/shared/shortcuts.ts +0 -17
- package/dist/extensions/pi-subagents/src/shared/status-format.ts +0 -55
- package/dist/extensions/pi-subagents/src/shared/thinking-ceiling.ts +0 -52
- package/dist/extensions/pi-subagents/src/shared/types.ts +0 -2834
- package/dist/extensions/pi-subagents/src/shared/utf8.ts +0 -11
- package/dist/extensions/pi-subagents/src/shared/utils.ts +0 -590
- package/dist/extensions/pi-subagents/src/shared/watch-strategy.ts +0 -10
- package/dist/extensions/pi-subagents/src/shared/workflow-child-permit.ts +0 -207
- package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +0 -426
- package/dist/extensions/pi-subagents/src/slash/delegation-json.ts +0 -108
- package/dist/extensions/pi-subagents/src/slash/delegation-request.ts +0 -162
- package/dist/extensions/pi-subagents/src/slash/prompt-template-bridge.ts +0 -419
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +0 -287
- package/dist/extensions/pi-subagents/src/slash/selector.ts +0 -147
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +0 -192
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +0 -1345
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +0 -310
- package/dist/extensions/pi-subagents/src/slash/subagents-admin.ts +0 -435
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +0 -905
- package/dist/extensions/pi-subagents/src/tui/fleet-transcript.ts +0 -536
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +0 -1436
- package/dist/extensions/pi-subagents/src/tui/render-helpers.ts +0 -111
- package/dist/extensions/pi-subagents/src/tui/render.ts +0 -3146
- package/dist/extensions/pi-subagents/src/types/pi-runtime-compat.d.ts +0 -8
- package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +0 -260
- package/dist/extensions/pi-subagents/src/watchdog/child-status.ts +0 -205
- package/dist/extensions/pi-subagents/src/watchdog/emission-guard.ts +0 -123
- package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +0 -538
- package/dist/extensions/pi-subagents/src/watchdog/model-selection.ts +0 -167
- package/dist/extensions/pi-subagents/src/watchdog/permission-arbiter.ts +0 -154
- package/dist/extensions/pi-subagents/src/watchdog/register-child.ts +0 -117
- package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +0 -440
- package/dist/extensions/pi-subagents/src/watchdog/render.ts +0 -54
- package/dist/extensions/pi-subagents/src/watchdog/review.ts +0 -303
- package/dist/extensions/pi-subagents/src/watchdog/runtime.ts +0 -868
- package/dist/extensions/pi-subagents/src/watchdog/scope.ts +0 -62
- package/dist/extensions/pi-subagents/src/watchdog/settings.ts +0 -568
- package/dist/extensions/pi-subagents/src/watchdog/tool-actions.ts +0 -155
- package/dist/extensions/pi-subagents/src/watchdog/turn-delta.ts +0 -161
- package/dist/extensions/pi-subagents/src/watchdog/types.ts +0 -198
- package/dist/extensions/pi-subagents/src/watchdog/warning-format.ts +0 -73
- package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +0 -151
- package/dist/extensions/pi-subagents/src/workflows/host-command.ts +0 -235
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +0 -2183
- package/dist/extensions/pi-subagents/src/workflows/workflow-child-summary.ts +0 -121
- package/dist/extensions/pi-subagents/src/workflows/workflow-preflight.ts +0 -270
- package/dist/extensions/pi-subagents/src/workflows/workflow-receipt.ts +0 -330
- package/dist/extensions/pi-subagents/src/workflows/workflow-resources.ts +0 -150
- package/dist/extensions/pi-subagents/src/workflows/workflow-settlement.ts +0 -246
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +0 -224
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/cli.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/register-bedrock.d.ts +0 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/restore-sandbox-env.d.ts +0 -17
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/args.d.ts +0 -57
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/config-selector.d.ts +0 -16
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/file-processor.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/initial-message.d.ts +0 -18
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/list-models.d.ts +0 -9
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/project-trust.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/session-picker.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/startup-ui.d.ts +0 -20
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/config.d.ts +0 -96
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-runtime.d.ts +0 -119
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-services.d.ts +0 -85
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session.d.ts +0 -620
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-guidance.d.ts +0 -5
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-storage.d.ts +0 -56
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/bash-executor.d.ts +0 -32
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/cache-stats.d.ts +0 -49
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/branch-summarization.d.ts +0 -93
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/compaction.d.ts +0 -128
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/index.d.ts +0 -7
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/utils.d.ts +0 -38
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/defaults.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/diagnostics.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/event-bus.d.ts +0 -9
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/exec.d.ts +0 -29
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/experimental.d.ts +0 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/ansi-to-html.d.ts +0 -22
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/index.d.ts +0 -37
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/tool-renderer.d.ts +0 -34
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/index.d.ts +0 -12
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/loader.d.ts +0 -23
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/runner.d.ts +0 -171
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/types.d.ts +0 -1261
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/wrapper.d.ts +0 -20
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/footer-data-provider.d.ts +0 -54
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/http-dispatcher.d.ts +0 -22
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/index.d.ts +0 -13
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/keybindings.d.ts +0 -358
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/messages.d.ts +0 -77
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-config.d.ts +0 -512
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-registry.d.ts +0 -43
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-resolver.d.ts +0 -121
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-runtime.d.ts +0 -82
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/models-store.d.ts +0 -17
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/output-guard.d.ts +0 -7
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/package-manager.d.ts +0 -210
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/project-trust.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/prompt-templates.d.ts +0 -54
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-attribution.d.ts +0 -4
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-composer.d.ts +0 -55
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/radius.d.ts +0 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/remote-catalog-provider.d.ts +0 -5
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resolve-config-value.d.ts +0 -30
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resource-loader.d.ts +0 -206
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/runtime-credentials.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/sdk.d.ts +0 -106
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-cwd.d.ts +0 -19
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-manager.d.ts +0 -356
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/settings-manager.d.ts +0 -297
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/skills.d.ts +0 -60
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/slash-commands.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/source-info.d.ts +0 -18
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/system-prompt.d.ts +0 -28
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/telemetry.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/timings.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/bash.d.ts +0 -68
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit-diff.d.ts +0 -106
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit.d.ts +0 -51
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/file-mutation-queue.d.ts +0 -6
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/find.d.ts +0 -35
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/grep.d.ts +0 -37
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/index.d.ts +0 -40
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/ls.d.ts +0 -37
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/output-accumulator.d.ts +0 -52
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/path-utils.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/read.d.ts +0 -35
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/render-utils.d.ts +0 -24
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/tool-definition-wrapper.d.ts +0 -14
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/truncate.d.ts +0 -70
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/write.d.ts +0 -26
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/trust-manager.d.ts +0 -36
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/usage-totals.d.ts +0 -19
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/index.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/client.d.ts +0 -61
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/huggingface.d.ts +0 -23
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/index.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/provider.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/ui.d.ts +0 -42
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/index.d.ts +0 -35
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/main.d.ts +0 -12
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/migrations.d.ts +0 -33
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/index.d.ts +0 -9
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/armin.d.ts +0 -34
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/assistant-message.d.ts +0 -22
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bash-execution.d.ts +0 -34
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bordered-loader.d.ts +0 -16
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/branch-summary-message.d.ts +0 -16
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -16
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/config-selector.d.ts +0 -102
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/countdown-timer.d.ts +0 -14
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-editor.d.ts +0 -21
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-entry.d.ts +0 -19
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-message.d.ts +0 -20
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/daxnuts.d.ts +0 -23
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/diff.d.ts +0 -12
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/dynamic-border.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/earendil-announcement.d.ts +0 -5
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-editor.d.ts +0 -22
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-input.d.ts +0 -23
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-selector.d.ts +0 -26
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/first-time-setup.d.ts +0 -25
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/footer.d.ts +0 -32
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/index.d.ts +0 -34
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/keybinding-hints.d.ts +0 -13
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/login-dialog.d.ts +0 -52
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/model-selector.d.ts +0 -54
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/oauth-selector.d.ts +0 -33
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -42
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector-search.d.ts +0 -23
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector.d.ts +0 -95
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/settings-selector.d.ts +0 -77
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/show-images-selector.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -17
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/status-indicator.d.ts +0 -28
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/theme-selector.d.ts +0 -11
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/thinking-selector.d.ts +0 -11
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tool-execution.d.ts +0 -63
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tree-selector.d.ts +0 -94
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/trust-selector.d.ts +0 -23
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message-selector.d.ts +0 -30
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message.d.ts +0 -14
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/visual-truncate.d.ts +0 -24
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/interactive-mode.d.ts +0 -394
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/model-search.d.ts +0 -12
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme-controller.d.ts +0 -29
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme.d.ts +0 -120
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/print-mode.d.ts +0 -28
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/jsonl.d.ts +0 -17
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-client.d.ts +0 -246
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-mode.d.ts +0 -20
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-types.d.ts +0 -457
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/package-manager-cli.d.ts +0 -8
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/rpc-entry.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/ansi.d.ts +0 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/changelog.d.ts +0 -22
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/child-process.d.ts +0 -18
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-image.d.ts +0 -11
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-native.d.ts +0 -11
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard.d.ts +0 -4
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/deprecation.d.ts +0 -4
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/exif-orientation.d.ts +0 -5
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/frontmatter.d.ts +0 -8
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/fs-watch.d.ts +0 -5
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/git.d.ts +0 -26
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/html.d.ts +0 -7
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-convert.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-process.d.ts +0 -18
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-core.d.ts +0 -30
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-worker.d.ts +0 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize.d.ts +0 -16
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/json.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/mime.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/open-browser.d.ts +0 -9
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/paths.d.ts +0 -31
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/photon.d.ts +0 -21
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/pi-user-agent.d.ts +0 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/shell.d.ts +0 -31
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/sleep.d.ts +0 -5
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/syntax-highlight.d.ts +0 -12
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/tools-manager.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/version-check.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/windows-self-update.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/index.mjs +0 -84
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/package.json +0 -14
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +0 -472
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +0 -6672
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +0 -1997
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +0 -1300
- package/dist/extensions/pi-subagents/test/integration/detect-error.test.ts +0 -249
- package/dist/extensions/pi-subagents/test/integration/doctor-executor.test.ts +0 -128
- package/dist/extensions/pi-subagents/test/integration/error-handling.test.ts +0 -281
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +0 -167
- package/dist/extensions/pi-subagents/test/integration/foreground-result-size.test.ts +0 -188
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +0 -1352
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +0 -1947
- package/dist/extensions/pi-subagents/test/integration/orca-progress-tabs.test.ts +0 -214
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +0 -1408
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +0 -2091
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +0 -2442
- package/dist/extensions/pi-subagents/test/integration/session-tokens.test.ts +0 -62
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +0 -9007
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +0 -1516
- package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +0 -166
- package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +0 -344
- package/dist/extensions/pi-subagents/test/integration/top-level-async.test.ts +0 -43
- package/dist/extensions/pi-subagents/test/support/cursor-smoke-inputs.ts +0 -51
- package/dist/extensions/pi-subagents/test/support/helpers.ts +0 -225
- package/dist/extensions/pi-subagents/test/support/isolated-temp-root.mjs +0 -9
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +0 -432
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +0 -159
- package/dist/extensions/pi-subagents/test/support/node-command.ts +0 -15
- package/dist/extensions/pi-subagents/test/support/real-session-child-cli.mjs +0 -185
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +0 -311
- package/dist/extensions/pi-subagents/test/support/register-loader.mjs +0 -16
- package/dist/extensions/pi-subagents/test/support/session-lease-child.mjs +0 -42
- package/dist/extensions/pi-subagents/test/support/ts-loader.mjs +0 -100
- package/dist/extensions/pi-subagents/test/unit/abort-recovery.test.ts +0 -152
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +0 -1475
- package/dist/extensions/pi-subagents/test/unit/accessible-dir.test.ts +0 -82
- package/dist/extensions/pi-subagents/test/unit/active-async-capacity.test.ts +0 -415
- package/dist/extensions/pi-subagents/test/unit/agent-contract.test.ts +0 -14
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +0 -213
- package/dist/extensions/pi-subagents/test/unit/agent-discovery-cache.test.ts +0 -232
- package/dist/extensions/pi-subagents/test/unit/agent-eject-disable.test.ts +0 -343
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +0 -2304
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +0 -1195
- package/dist/extensions/pi-subagents/test/unit/agent-memory.test.ts +0 -420
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +0 -1153
- package/dist/extensions/pi-subagents/test/unit/agent-refinements.test.ts +0 -178
- package/dist/extensions/pi-subagents/test/unit/agent-scope.test.ts +0 -20
- package/dist/extensions/pi-subagents/test/unit/agent-selection.test.ts +0 -88
- package/dist/extensions/pi-subagents/test/unit/agent-stream-options.test.ts +0 -14
- package/dist/extensions/pi-subagents/test/unit/anti-slop-oxlint.test.ts +0 -98
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +0 -78
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +0 -254
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +0 -1022
- package/dist/extensions/pi-subagents/test/unit/async-permission-session.test.ts +0 -100
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +0 -188
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +0 -976
- package/dist/extensions/pi-subagents/test/unit/async-retention.test.ts +0 -632
- package/dist/extensions/pi-subagents/test/unit/async-status-projection.test.ts +0 -246
- package/dist/extensions/pi-subagents/test/unit/async-status-snapshot.test.ts +0 -204
- package/dist/extensions/pi-subagents/test/unit/atomic-json.test.ts +0 -176
- package/dist/extensions/pi-subagents/test/unit/authority-policy.test.ts +0 -22
- package/dist/extensions/pi-subagents/test/unit/auto-drain.test.ts +0 -83
- package/dist/extensions/pi-subagents/test/unit/background-process-options.test.ts +0 -17
- package/dist/extensions/pi-subagents/test/unit/background-work.test.ts +0 -365
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-agent-allowlist.test.ts +0 -102
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-pi-args.test.ts +0 -84
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling.test.ts +0 -68
- package/dist/extensions/pi-subagents/test/unit/capacity-resilient-json.test.ts +0 -155
- package/dist/extensions/pi-subagents/test/unit/chain-append.test.ts +0 -283
- package/dist/extensions/pi-subagents/test/unit/chain-root-attachment.test.ts +0 -236
- package/dist/extensions/pi-subagents/test/unit/chain-serializer.test.ts +0 -229
- package/dist/extensions/pi-subagents/test/unit/child-launch-plan.test.ts +0 -94
- package/dist/extensions/pi-subagents/test/unit/child-protocol.test.ts +0 -202
- package/dist/extensions/pi-subagents/test/unit/child-session-name.test.ts +0 -50
- package/dist/extensions/pi-subagents/test/unit/child-transcript.test.ts +0 -267
- package/dist/extensions/pi-subagents/test/unit/close-grace-timer.test.ts +0 -101
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +0 -98
- package/dist/extensions/pi-subagents/test/unit/completion-batcher.test.ts +0 -230
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +0 -35
- package/dist/extensions/pi-subagents/test/unit/completion-evidence.test.ts +0 -150
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +0 -715
- package/dist/extensions/pi-subagents/test/unit/completion-replay.test.ts +0 -305
- package/dist/extensions/pi-subagents/test/unit/config-dir-runtime.test.ts +0 -107
- package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +0 -630
- package/dist/extensions/pi-subagents/test/unit/control-notices.test.ts +0 -110
- package/dist/extensions/pi-subagents/test/unit/cursor-smoke-inputs.test.ts +0 -77
- package/dist/extensions/pi-subagents/test/unit/default-extensions.test.ts +0 -219
- package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +0 -588
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +0 -201
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +0 -219
- package/dist/extensions/pi-subagents/test/unit/ensure-accessible-dir.test.ts +0 -125
- package/dist/extensions/pi-subagents/test/unit/extension-bindings.test.ts +0 -79
- package/dist/extensions/pi-subagents/test/unit/extension-context.test.ts +0 -27
- package/dist/extensions/pi-subagents/test/unit/external-cli-runner.test.ts +0 -339
- package/dist/extensions/pi-subagents/test/unit/external-job-runner.test.ts +0 -961
- package/dist/extensions/pi-subagents/test/unit/external-runs.test.ts +0 -261
- package/dist/extensions/pi-subagents/test/unit/extra-agent-dirs.test.ts +0 -88
- package/dist/extensions/pi-subagents/test/unit/fast-mode-extension.test.ts +0 -27
- package/dist/extensions/pi-subagents/test/unit/file-coalescer.test.ts +0 -83
- package/dist/extensions/pi-subagents/test/unit/file-system-retry.test.ts +0 -64
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +0 -1356
- package/dist/extensions/pi-subagents/test/unit/fleet-transcript.test.ts +0 -435
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +0 -1773
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +0 -125
- package/dist/extensions/pi-subagents/test/unit/foreground-tool-call-compaction.test.ts +0 -115
- package/dist/extensions/pi-subagents/test/unit/fork-cache-key.test.ts +0 -91
- package/dist/extensions/pi-subagents/test/unit/fork-context.test.ts +0 -588
- package/dist/extensions/pi-subagents/test/unit/formatters.test.ts +0 -14
- package/dist/extensions/pi-subagents/test/unit/get-final-output.test.ts +0 -149
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector-bootstrap.test.ts +0 -101
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +0 -458
- package/dist/extensions/pi-subagents/test/unit/herdr-session-roots-codec.test.ts +0 -63
- package/dist/extensions/pi-subagents/test/unit/herdr-shell-command.test.ts +0 -59
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +0 -716
- package/dist/extensions/pi-subagents/test/unit/host-command.test.ts +0 -157
- package/dist/extensions/pi-subagents/test/unit/host-peer-runtime-imports.test.ts +0 -157
- package/dist/extensions/pi-subagents/test/unit/host-step-status.test.ts +0 -98
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +0 -1311
- package/dist/extensions/pi-subagents/test/unit/index-segment.test.ts +0 -96
- package/dist/extensions/pi-subagents/test/unit/inspect-rpc.test.ts +0 -617
- package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +0 -220
- package/dist/extensions/pi-subagents/test/unit/jsonl-writer.test.ts +0 -119
- package/dist/extensions/pi-subagents/test/unit/llm-intent-arbiter.test.ts +0 -226
- package/dist/extensions/pi-subagents/test/unit/mcp-direct-tool-grant.test.ts +0 -155
- package/dist/extensions/pi-subagents/test/unit/mission-goal-driver.test.ts +0 -180
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +0 -300
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +0 -470
- package/dist/extensions/pi-subagents/test/unit/mock-pi.test.ts +0 -22
- package/dist/extensions/pi-subagents/test/unit/model-exclusions.test.ts +0 -258
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +0 -903
- package/dist/extensions/pi-subagents/test/unit/model-info.test.ts +0 -162
- package/dist/extensions/pi-subagents/test/unit/model-scope-settings.test.ts +0 -101
- package/dist/extensions/pi-subagents/test/unit/model-scope.test.ts +0 -198
- package/dist/extensions/pi-subagents/test/unit/mutation-evidence.test.ts +0 -177
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +0 -796
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +0 -655
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +0 -492
- package/dist/extensions/pi-subagents/test/unit/node-executable.test.ts +0 -26
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +0 -751
- package/dist/extensions/pi-subagents/test/unit/orca-progress-tabs.test.ts +0 -545
- package/dist/extensions/pi-subagents/test/unit/owned-process-tree.test.ts +0 -69
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +0 -241
- package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +0 -563
- package/dist/extensions/pi-subagents/test/unit/parallel-utils.test.ts +0 -269
- package/dist/extensions/pi-subagents/test/unit/path-handling.test.ts +0 -108
- package/dist/extensions/pi-subagents/test/unit/path-resolution.test.ts +0 -103
- package/dist/extensions/pi-subagents/test/unit/permissions.test.ts +0 -46
- package/dist/extensions/pi-subagents/test/unit/pi-args-permission-system.test.ts +0 -437
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +0 -2241
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +0 -461
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +0 -375
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +0 -958
- package/dist/extensions/pi-subagents/test/unit/proactive-skills.test.ts +0 -118
- package/dist/extensions/pi-subagents/test/unit/process-terminal.test.ts +0 -257
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +0 -372
- package/dist/extensions/pi-subagents/test/unit/project-panes-public-api.test.ts +0 -285
- package/dist/extensions/pi-subagents/test/unit/prompt-template-bridge.test.ts +0 -244
- package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +0 -167
- package/dist/extensions/pi-subagents/test/unit/pruned-fork.test.ts +0 -214
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +0 -182
- package/dist/extensions/pi-subagents/test/unit/reads-resolution.test.ts +0 -66
- package/dist/extensions/pi-subagents/test/unit/recursion-guard.test.ts +0 -265
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +0 -560
- package/dist/extensions/pi-subagents/test/unit/result-delivery-ownership.test.ts +0 -34
- package/dist/extensions/pi-subagents/test/unit/result-files.test.ts +0 -501
- package/dist/extensions/pi-subagents/test/unit/result-intercom.test.ts +0 -258
- package/dist/extensions/pi-subagents/test/unit/retained-children.test.ts +0 -191
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +0 -1124
- package/dist/extensions/pi-subagents/test/unit/run-fanout-budget.test.ts +0 -191
- package/dist/extensions/pi-subagents/test/unit/run-id-resolver.test.ts +0 -247
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +0 -1477
- package/dist/extensions/pi-subagents/test/unit/runtime-acknowledged-extensions.test.ts +0 -52
- package/dist/extensions/pi-subagents/test/unit/runtime-agent-registration.test.ts +0 -332
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +0 -816
- package/dist/extensions/pi-subagents/test/unit/scheduled-store-root.test.ts +0 -67
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +0 -655
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +0 -2501
- package/dist/extensions/pi-subagents/test/unit/selector.test.ts +0 -57
- package/dist/extensions/pi-subagents/test/unit/session-lease.test.ts +0 -339
- package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +0 -361
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +0 -709
- package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +0 -115
- package/dist/extensions/pi-subagents/test/unit/spawn-budget.test.ts +0 -124
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +0 -440
- package/dist/extensions/pi-subagents/test/unit/status-format.test.ts +0 -26
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +0 -435
- package/dist/extensions/pi-subagents/test/unit/steering-notices.test.ts +0 -58
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +0 -211
- package/dist/extensions/pi-subagents/test/unit/streamed-progress-bounds.test.ts +0 -78
- package/dist/extensions/pi-subagents/test/unit/subagent-action-recovery.test.ts +0 -85
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +0 -329
- package/dist/extensions/pi-subagents/test/unit/subagent-guide.test.ts +0 -37
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +0 -1510
- package/dist/extensions/pi-subagents/test/unit/subagent-startup-retry.test.ts +0 -104
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +0 -1367
- package/dist/extensions/pi-subagents/test/unit/task-intent.test.ts +0 -126
- package/dist/extensions/pi-subagents/test/unit/temp-paths.test.ts +0 -97
- package/dist/extensions/pi-subagents/test/unit/thinking-ceiling.test.ts +0 -73
- package/dist/extensions/pi-subagents/test/unit/timeout-defaults.test.ts +0 -138
- package/dist/extensions/pi-subagents/test/unit/tool-budget.test.ts +0 -67
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +0 -309
- package/dist/extensions/pi-subagents/test/unit/tool-timeout.test.ts +0 -108
- package/dist/extensions/pi-subagents/test/unit/total-cost.test.ts +0 -61
- package/dist/extensions/pi-subagents/test/unit/ts-loader.test.ts +0 -33
- package/dist/extensions/pi-subagents/test/unit/types-fork-preamble.test.ts +0 -23
- package/dist/extensions/pi-subagents/test/unit/wait-completions.test.ts +0 -76
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +0 -664
- package/dist/extensions/pi-subagents/test/unit/watch-strategy.test.ts +0 -24
- package/dist/extensions/pi-subagents/test/unit/watchdog-change-signature.test.ts +0 -434
- package/dist/extensions/pi-subagents/test/unit/watchdog-child-status.test.ts +0 -110
- package/dist/extensions/pi-subagents/test/unit/watchdog-emission-guard.test.ts +0 -62
- package/dist/extensions/pi-subagents/test/unit/watchdog-lsp-diagnostics.test.ts +0 -144
- package/dist/extensions/pi-subagents/test/unit/watchdog-model-selection.test.ts +0 -121
- package/dist/extensions/pi-subagents/test/unit/watchdog-permission-arbiter.test.ts +0 -115
- package/dist/extensions/pi-subagents/test/unit/watchdog-render.test.ts +0 -76
- package/dist/extensions/pi-subagents/test/unit/watchdog-review.test.ts +0 -327
- package/dist/extensions/pi-subagents/test/unit/watchdog-runtime.test.ts +0 -1072
- package/dist/extensions/pi-subagents/test/unit/watchdog-scope.test.ts +0 -33
- package/dist/extensions/pi-subagents/test/unit/watchdog-settings.test.ts +0 -322
- package/dist/extensions/pi-subagents/test/unit/watchdog-tool-actions.test.ts +0 -91
- package/dist/extensions/pi-subagents/test/unit/watchdog-turn-delta.test.ts +0 -130
- package/dist/extensions/pi-subagents/test/unit/widget-nested-render.test.ts +0 -171
- package/dist/extensions/pi-subagents/test/unit/windows-hide-spawn.test.ts +0 -49
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +0 -551
- package/dist/extensions/pi-subagents/test/unit/workflow-detach-reconcile.test.ts +0 -777
- package/dist/extensions/pi-subagents/test/unit/workflow-graph.test.ts +0 -134
- package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +0 -358
- package/dist/extensions/pi-subagents/test/unit/workflow-preflight.test.ts +0 -155
- package/dist/extensions/pi-subagents/test/unit/workflow-receipt.test.ts +0 -461
- package/dist/extensions/pi-subagents/test/unit/workflow-resources.test.ts +0 -98
- package/dist/extensions/pi-subagents/test/unit/workflow-resume-hint.test.ts +0 -365
- package/dist/extensions/pi-subagents/test/unit/worktree-cleanup-plan.test.ts +0 -349
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +0 -695
- package/dist/extensions/pi-subagents/test/unit/writer-budget-guidance.test.ts +0 -25
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/effect/index.ts +0 -13
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/effect/rules/no-service-constructor-imports.ts +0 -52
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/index.ts +0 -41
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-chained-type-assertions.ts +0 -77
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-conditional-empty-object-spread.ts +0 -49
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-known-value-widening.ts +0 -247
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-module-mocking.ts +0 -91
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-object-parameters.ts +0 -126
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-reflect-apply.ts +0 -28
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-reflect-get.ts +0 -28
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-runtime-typeof.ts +0 -67
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-shape-in-symbol-names.ts +0 -39
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-parameters.ts +0 -83
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-returns.ts +0 -115
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-type-aliases.ts +0 -72
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unsafe-dictionary-type.ts +0 -134
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-widen-then-assert.ts +0 -366
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/require-safety-comment-for-type-assertion.ts +0 -62
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/dictionary-types.ts +0 -502
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/lexical-type-parameters.ts +0 -60
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/reflect-method.ts +0 -35
- package/dist/extensions/pi-subagents/tsconfig.json +0 -15
- package/dist/extensions/pi-tool-display/CHANGELOG.md +0 -329
- package/dist/extensions/pi-tool-display/LICENSE +0 -21
- package/dist/extensions/pi-tool-display/README.md +0 -417
- package/dist/extensions/pi-tool-display/config/config.example.json +0 -40
- package/dist/extensions/pi-tool-display/index.ts +0 -3
- package/dist/extensions/pi-tool-display/package-lock.json +0 -2555
- package/dist/extensions/pi-tool-display/package.json +0 -86
- package/dist/extensions/pi-tool-display/src/agent-dir.ts +0 -35
- package/dist/extensions/pi-tool-display/src/ansi-utils.ts +0 -116
- package/dist/extensions/pi-tool-display/src/bash-display.ts +0 -213
- package/dist/extensions/pi-tool-display/src/capabilities.ts +0 -88
- package/dist/extensions/pi-tool-display/src/config-modal.ts +0 -541
- package/dist/extensions/pi-tool-display/src/config-store.ts +0 -304
- package/dist/extensions/pi-tool-display/src/debug-logger.ts +0 -150
- package/dist/extensions/pi-tool-display/src/diff-presentation.ts +0 -72
- package/dist/extensions/pi-tool-display/src/diff-renderer.ts +0 -2517
- package/dist/extensions/pi-tool-display/src/disposable.ts +0 -34
- package/dist/extensions/pi-tool-display/src/extension-lifecycle.ts +0 -14
- package/dist/extensions/pi-tool-display/src/index.ts +0 -109
- package/dist/extensions/pi-tool-display/src/line-width-safety.ts +0 -93
- package/dist/extensions/pi-tool-display/src/modal-icons.ts +0 -57
- package/dist/extensions/pi-tool-display/src/pending-diff-preview.ts +0 -370
- package/dist/extensions/pi-tool-display/src/presets.ts +0 -117
- package/dist/extensions/pi-tool-display/src/render-utils.ts +0 -186
- package/dist/extensions/pi-tool-display/src/settings-inspector-modal.ts +0 -475
- package/dist/extensions/pi-tool-display/src/thinking-label.ts +0 -343
- package/dist/extensions/pi-tool-display/src/tool-call-box.ts +0 -181
- package/dist/extensions/pi-tool-display/src/tool-metadata.ts +0 -139
- package/dist/extensions/pi-tool-display/src/tool-overrides.ts +0 -2168
- package/dist/extensions/pi-tool-display/src/types.ts +0 -109
- package/dist/extensions/pi-tool-display/src/user-message-box-markdown.ts +0 -64
- package/dist/extensions/pi-tool-display/src/user-message-box-native.ts +0 -66
- package/dist/extensions/pi-tool-display/src/user-message-box-patch.ts +0 -72
- package/dist/extensions/pi-tool-display/src/user-message-box-renderer.ts +0 -419
- package/dist/extensions/pi-tool-display/src/user-message-box-utils.ts +0 -106
- package/dist/extensions/pi-tool-display/src/write-display-utils.ts +0 -31
- package/dist/extensions/pi-tool-display/src/zellij-modal.ts +0 -1027
- package/dist/extensions/pi-tool-display/tests/active-backlog-red.test.ts +0 -65
- package/dist/extensions/pi-tool-display/tests/ansi-utils.test.ts +0 -345
- package/dist/extensions/pi-tool-display/tests/bash-display.test.ts +0 -442
- package/dist/extensions/pi-tool-display/tests/capabilities-edge.test.ts +0 -360
- package/dist/extensions/pi-tool-display/tests/capabilities.test.ts +0 -54
- package/dist/extensions/pi-tool-display/tests/config-modal.test.ts +0 -360
- package/dist/extensions/pi-tool-display/tests/config-store.test.ts +0 -87
- package/dist/extensions/pi-tool-display/tests/custom-tool-overrides.test.ts +0 -415
- package/dist/extensions/pi-tool-display/tests/debug-logger-edge.test.ts +0 -630
- package/dist/extensions/pi-tool-display/tests/debug-logger.test.ts +0 -62
- package/dist/extensions/pi-tool-display/tests/diff-renderer-ansi.test.ts +0 -55
- package/dist/extensions/pi-tool-display/tests/diff-renderer-edge.test.ts +0 -886
- package/dist/extensions/pi-tool-display/tests/diff-renderer-numbering.test.ts +0 -135
- package/dist/extensions/pi-tool-display/tests/diff-renderer-width.test.ts +0 -454
- package/dist/extensions/pi-tool-display/tests/diff-renderer-wrap.test.ts +0 -169
- package/dist/extensions/pi-tool-display/tests/index-integration.test.ts +0 -354
- package/dist/extensions/pi-tool-display/tests/pending-diff-preview.test.ts +0 -79
- package/dist/extensions/pi-tool-display/tests/presets-edge.test.ts +0 -229
- package/dist/extensions/pi-tool-display/tests/presets.test.ts +0 -26
- package/dist/extensions/pi-tool-display/tests/reload-behavior.test.ts +0 -1241
- package/dist/extensions/pi-tool-display/tests/render-utils.test.ts +0 -710
- package/dist/extensions/pi-tool-display/tests/settings-inspector.test.ts +0 -450
- package/dist/extensions/pi-tool-display/tests/thinking-label-edge.test.ts +0 -904
- package/dist/extensions/pi-tool-display/tests/thinking-label.test.ts +0 -72
- package/dist/extensions/pi-tool-display/tests/tool-call-box.test.ts +0 -105
- package/dist/extensions/pi-tool-display/tests/tool-overrides-config.test.ts +0 -613
- package/dist/extensions/pi-tool-display/tests/tool-overrides-mcp.test.ts +0 -499
- package/dist/extensions/pi-tool-display/tests/tool-overrides-registration.test.ts +0 -315
- package/dist/extensions/pi-tool-display/tests/tool-overrides-write-meta.test.ts +0 -68
- package/dist/extensions/pi-tool-display/tests/tool-ui-utils.test.ts +0 -413
- package/dist/extensions/pi-tool-display/tests/user-message-box-performance-red.test.ts +0 -176
- package/dist/extensions/pi-tool-display/tests/user-message-box.test.ts +0 -908
- package/dist/extensions/pi-tool-display/tests/zellij-modal.test.ts +0 -848
- package/dist/extensions/pi-tool-display/tool-display-api-consumer.d.ts +0 -30
- package/dist/extensions/pi-tool-display/tool-display-api-consumer.js +0 -40
- package/dist/extensions/pi-web-agent/CHANGELOG.md +0 -410
- package/dist/extensions/pi-web-agent/README.md +0 -131
- package/dist/extensions/pi-web-agent/package.json +0 -33
- package/dist/extensions/pi-web-agent/src/backends/config.ts +0 -262
- package/dist/extensions/pi-web-agent/src/backends/doctor.ts +0 -272
- package/dist/extensions/pi-web-agent/src/backends/factory.ts +0 -242
- package/dist/extensions/pi-web-agent/src/backends/settings-reader.ts +0 -25
- package/dist/extensions/pi-web-agent/src/cache/ttl-cache.ts +0 -28
- package/dist/extensions/pi-web-agent/src/changelog-notice.ts +0 -136
- package/dist/extensions/pi-web-agent/src/commands/web-agent-config.ts +0 -1082
- package/dist/extensions/pi-web-agent/src/extension.ts +0 -163
- package/dist/extensions/pi-web-agent/src/extract/readability.ts +0 -126
- package/dist/extensions/pi-web-agent/src/fetch/browser-resolution.ts +0 -199
- package/dist/extensions/pi-web-agent/src/fetch/firecrawl-fetch.ts +0 -100
- package/dist/extensions/pi-web-agent/src/fetch/headless-fetch.ts +0 -117
- package/dist/extensions/pi-web-agent/src/fetch/http-fetch.ts +0 -67
- package/dist/extensions/pi-web-agent/src/orchestration/answer-synthesizer.ts +0 -60
- package/dist/extensions/pi-web-agent/src/orchestration/candidate-selector.ts +0 -51
- package/dist/extensions/pi-web-agent/src/orchestration/direct-url.ts +0 -29
- package/dist/extensions/pi-web-agent/src/orchestration/evidence-quality.ts +0 -108
- package/dist/extensions/pi-web-agent/src/orchestration/evidence-ranker.ts +0 -47
- package/dist/extensions/pi-web-agent/src/orchestration/index.ts +0 -28
- package/dist/extensions/pi-web-agent/src/orchestration/query-planner.ts +0 -47
- package/dist/extensions/pi-web-agent/src/orchestration/research-orchestrator.ts +0 -441
- package/dist/extensions/pi-web-agent/src/orchestration/research-types.ts +0 -71
- package/dist/extensions/pi-web-agent/src/orchestration/research-worker.ts +0 -206
- package/dist/extensions/pi-web-agent/src/orchestration/source-profile.ts +0 -105
- package/dist/extensions/pi-web-agent/src/orchestration/stop-decider.ts +0 -81
- package/dist/extensions/pi-web-agent/src/orchestration/url.ts +0 -35
- package/dist/extensions/pi-web-agent/src/presentation/config-store.ts +0 -210
- package/dist/extensions/pi-web-agent/src/presentation/config.ts +0 -75
- package/dist/extensions/pi-web-agent/src/presentation/explore-presentation.ts +0 -73
- package/dist/extensions/pi-web-agent/src/presentation/fetch-presentation.ts +0 -54
- package/dist/extensions/pi-web-agent/src/presentation/search-presentation.ts +0 -53
- package/dist/extensions/pi-web-agent/src/presentation/select-view.ts +0 -20
- package/dist/extensions/pi-web-agent/src/presentation/types.ts +0 -63
- package/dist/extensions/pi-web-agent/src/readers/github-reader.ts +0 -150
- package/dist/extensions/pi-web-agent/src/readers/limits.ts +0 -3
- package/dist/extensions/pi-web-agent/src/readers/pdf-reader.ts +0 -87
- package/dist/extensions/pi-web-agent/src/readers/resolver.ts +0 -25
- package/dist/extensions/pi-web-agent/src/readers/types.ts +0 -11
- package/dist/extensions/pi-web-agent/src/readers/youtube-reader.ts +0 -79
- package/dist/extensions/pi-web-agent/src/search/brave.ts +0 -114
- package/dist/extensions/pi-web-agent/src/search/duckduckgo.ts +0 -99
- package/dist/extensions/pi-web-agent/src/search/exa.ts +0 -109
- package/dist/extensions/pi-web-agent/src/search/fanout.ts +0 -154
- package/dist/extensions/pi-web-agent/src/search/searxng.ts +0 -96
- package/dist/extensions/pi-web-agent/src/search/tavily.ts +0 -113
- package/dist/extensions/pi-web-agent/src/search/youcom.ts +0 -109
- package/dist/extensions/pi-web-agent/src/tools/web-explore.ts +0 -71
- package/dist/extensions/pi-web-agent/src/tools/web-fetch-headless.ts +0 -31
- package/dist/extensions/pi-web-agent/src/tools/web-fetch.ts +0 -31
- package/dist/extensions/pi-web-agent/src/tools/web-search.ts +0 -170
- package/dist/extensions/pi-web-agent/src/types.ts +0 -103
- package/dist/extensions/pi-zentui/.editorconfig +0 -12
- package/dist/extensions/pi-zentui/.github/CODEOWNERS +0 -1
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/bug_report.yml +0 -110
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/config.yml +0 -8
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/config_question.yml +0 -56
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/feature_request.yml +0 -63
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/rendering_issue.yml +0 -106
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/runtime_detection.yml +0 -103
- package/dist/extensions/pi-zentui/.github/dependabot.yml +0 -47
- package/dist/extensions/pi-zentui/.github/pull_request_template.md +0 -34
- package/dist/extensions/pi-zentui/.github/release.yml +0 -18
- package/dist/extensions/pi-zentui/.github/workflows/ci.yml +0 -79
- package/dist/extensions/pi-zentui/.github/workflows/publish.yml +0 -63
- package/dist/extensions/pi-zentui/AGENTS.md +0 -107
- package/dist/extensions/pi-zentui/CONTRIBUTING.md +0 -68
- package/dist/extensions/pi-zentui/LICENSE +0 -21
- package/dist/extensions/pi-zentui/README.md +0 -188
- package/dist/extensions/pi-zentui/SECURITY.md +0 -18
- package/dist/extensions/pi-zentui/assets/main-cover.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/editor-accent-rail.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/editor-minimalist.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/editor-opencode-copy-friendly.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/editor-opencode.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/user-message-compact.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/user-message-framed-copy-friendly.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/user-message-framed.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/user-message-labeled.png +0 -0
- package/dist/extensions/pi-zentui/assets/zentui.png +0 -0
- package/dist/extensions/pi-zentui/biome.json +0 -31
- package/dist/extensions/pi-zentui/docs/configuration.md +0 -509
- package/dist/extensions/pi-zentui/docs/footer-format.md +0 -162
- package/dist/extensions/pi-zentui/extensions/zentui/accent-rail-editor.ts +0 -99
- package/dist/extensions/pi-zentui/extensions/zentui/accent-rail-layout-patch.ts +0 -457
- package/dist/extensions/pi-zentui/extensions/zentui/completion-menu.ts +0 -157
- package/dist/extensions/pi-zentui/extensions/zentui/config.ts +0 -2100
- package/dist/extensions/pi-zentui/extensions/zentui/editor-metadata-format.ts +0 -321
- package/dist/extensions/pi-zentui/extensions/zentui/editor-transfer.ts +0 -73
- package/dist/extensions/pi-zentui/extensions/zentui/extension-status.ts +0 -89
- package/dist/extensions/pi-zentui/extensions/zentui/footer-format.ts +0 -364
- package/dist/extensions/pi-zentui/extensions/zentui/footer-layout.ts +0 -122
- package/dist/extensions/pi-zentui/extensions/zentui/footer.ts +0 -812
- package/dist/extensions/pi-zentui/extensions/zentui/format.ts +0 -620
- package/dist/extensions/pi-zentui/extensions/zentui/git.ts +0 -384
- package/dist/extensions/pi-zentui/extensions/zentui/icons.ts +0 -252
- package/dist/extensions/pi-zentui/extensions/zentui/index.ts +0 -1416
- package/dist/extensions/pi-zentui/extensions/zentui/interaction-summary.ts +0 -1049
- package/dist/extensions/pi-zentui/extensions/zentui/live-context.ts +0 -75
- package/dist/extensions/pi-zentui/extensions/zentui/minimalist-editor.ts +0 -463
- package/dist/extensions/pi-zentui/extensions/zentui/package-version.ts +0 -651
- package/dist/extensions/pi-zentui/extensions/zentui/project-refresh.ts +0 -120
- package/dist/extensions/pi-zentui/extensions/zentui/project-state.ts +0 -59
- package/dist/extensions/pi-zentui/extensions/zentui/prototype-patch-registry.ts +0 -166
- package/dist/extensions/pi-zentui/extensions/zentui/repository-root.ts +0 -98
- package/dist/extensions/pi-zentui/extensions/zentui/runtime.ts +0 -841
- package/dist/extensions/pi-zentui/extensions/zentui/selector-border.ts +0 -93
- package/dist/extensions/pi-zentui/extensions/zentui/session-lifecycle.ts +0 -60
- package/dist/extensions/pi-zentui/extensions/zentui/settings-command.ts +0 -1796
- package/dist/extensions/pi-zentui/extensions/zentui/settings-previews.ts +0 -128
- package/dist/extensions/pi-zentui/extensions/zentui/state.ts +0 -94
- package/dist/extensions/pi-zentui/extensions/zentui/style.ts +0 -424
- package/dist/extensions/pi-zentui/extensions/zentui/telemetry.ts +0 -82
- package/dist/extensions/pi-zentui/extensions/zentui/ui.ts +0 -1290
- package/dist/extensions/pi-zentui/extensions/zentui/user-message-osc.ts +0 -248
- package/dist/extensions/pi-zentui/extensions/zentui/user-message-styles.ts +0 -215
- package/dist/extensions/pi-zentui/extensions/zentui/user-message.ts +0 -206
- package/dist/extensions/pi-zentui/extensions/zentui/working-line-messages.ts +0 -24
- package/dist/extensions/pi-zentui/extensions/zentui/working-line-spinners.ts +0 -54
- package/dist/extensions/pi-zentui/extensions/zentui/working-line.ts +0 -1433
- package/dist/extensions/pi-zentui/package-lock.json +0 -5311
- package/dist/extensions/pi-zentui/package.json +0 -60
- package/dist/extensions/pi-zentui/test/accent-rail-editor.test.ts +0 -232
- package/dist/extensions/pi-zentui/test/accent-rail-layout-patch.test.ts +0 -669
- package/dist/extensions/pi-zentui/test/completion-menu.test.ts +0 -265
- package/dist/extensions/pi-zentui/test/config.test.ts +0 -3119
- package/dist/extensions/pi-zentui/test/editor-metadata-format.test.ts +0 -405
- package/dist/extensions/pi-zentui/test/editor-transfer.test.ts +0 -260
- package/dist/extensions/pi-zentui/test/editor-viewport-indicators.test.ts +0 -1286
- package/dist/extensions/pi-zentui/test/extension-compliance.test.ts +0 -7196
- package/dist/extensions/pi-zentui/test/extension-status.test.ts +0 -182
- package/dist/extensions/pi-zentui/test/fixtures/starship-nerd-font-symbols.toml +0 -172
- package/dist/extensions/pi-zentui/test/footer-format.test.ts +0 -431
- package/dist/extensions/pi-zentui/test/footer-layout.test.ts +0 -113
- package/dist/extensions/pi-zentui/test/footer-repository-path.test.ts +0 -123
- package/dist/extensions/pi-zentui/test/format.test.ts +0 -927
- package/dist/extensions/pi-zentui/test/git.test.ts +0 -212
- package/dist/extensions/pi-zentui/test/icons.test.ts +0 -69
- package/dist/extensions/pi-zentui/test/interaction-summary.test.ts +0 -1402
- package/dist/extensions/pi-zentui/test/live-context-integration.test.ts +0 -378
- package/dist/extensions/pi-zentui/test/live-context.test.ts +0 -139
- package/dist/extensions/pi-zentui/test/minimalist-editor.test.ts +0 -811
- package/dist/extensions/pi-zentui/test/package-version.test.ts +0 -321
- package/dist/extensions/pi-zentui/test/project-refresh.test.ts +0 -250
- package/dist/extensions/pi-zentui/test/project-state.test.ts +0 -159
- package/dist/extensions/pi-zentui/test/repository-root.test.ts +0 -108
- package/dist/extensions/pi-zentui/test/responsive-dependencies.test.ts +0 -825
- package/dist/extensions/pi-zentui/test/runtime.test.ts +0 -183
- package/dist/extensions/pi-zentui/test/session-lifecycle.test.ts +0 -40
- package/dist/extensions/pi-zentui/test/settings-command.test.ts +0 -1381
- package/dist/extensions/pi-zentui/test/settings-previews.test.ts +0 -347
- package/dist/extensions/pi-zentui/test/state.test.ts +0 -84
- package/dist/extensions/pi-zentui/test/telemetry-lifecycle-integration.test.ts +0 -276
- package/dist/extensions/pi-zentui/test/telemetry.test.ts +0 -105
- package/dist/extensions/pi-zentui/test/turn-summary-lifecycle.integration.test.ts +0 -327
- package/dist/extensions/pi-zentui/test/user-message-osc.test.ts +0 -164
- package/dist/extensions/pi-zentui/test/user-message-styles.test.ts +0 -292
- package/dist/extensions/pi-zentui/test/working-line-lifecycle.integration.test.ts +0 -730
- package/dist/extensions/pi-zentui/test/working-line-messages.test.ts +0 -34
- package/dist/extensions/pi-zentui/test/working-line.test.ts +0 -1990
- package/dist/extensions/pi-zentui/tsconfig.json +0 -16
- package/dist/extensions/ponytail/index.js +0 -176
- package/dist/extensions/ponytail/package.json +0 -8
- package/dist/extensions/ponytail/ponytail-config.cjs +0 -151
- package/dist/extensions/ponytail/ponytail-instructions.cjs +0 -112
- package/dist/extensions/ponytail/test/extension.test.js +0 -299
- package/dist/extensions/ponytail/test/helpers.test.js +0 -312
- package/dist/extensions/question/batch.ts +0 -103
- package/dist/extensions/question/constants.ts +0 -31
- package/dist/extensions/question/helpers.ts +0 -58
- package/dist/extensions/question/index.ts +0 -688
- package/dist/extensions/question/navigation.ts +0 -14
- package/dist/extensions/question/package.json +0 -19
- package/dist/extensions/question/question-list.ts +0 -533
- package/dist/extensions/question/row-layout.ts +0 -165
- package/dist/extensions/question/schemas.ts +0 -43
- package/dist/extensions/question/selection-mode.ts +0 -47
- package/dist/extensions/question/shortcuts.ts +0 -44
- package/dist/extensions/question/tests/batch.test.ts +0 -113
- package/dist/extensions/question/tests/exp.test.ts +0 -70
- package/dist/extensions/question/tests/exp2.test.ts +0 -59
- package/dist/extensions/question/tests/exp3.test.ts +0 -47
- package/dist/extensions/question/tests/helpers.test.ts +0 -93
- package/dist/extensions/question/tests/question-list.test.ts +0 -694
- package/dist/extensions/question/tests/row-layout.test.ts +0 -215
- package/dist/extensions/question/tests/schemas.test.ts +0 -53
- package/dist/extensions/question/tests/selection-mode.test.ts +0 -54
- package/dist/extensions/question/tests/shortcuts.test.ts +0 -107
- package/dist/extensions/question/tests/wizard.test.ts +0 -839
- package/dist/extensions/question/tests/zz-ig3.test.ts +0 -20
- package/dist/extensions/question/tests/zz-probe.test.ts +0 -29
- package/dist/extensions/question/types.ts +0 -132
- package/dist/extensions/rtk.test.ts +0 -320
- package/dist/extensions/rtk.ts +0 -123
- package/dist/extensions/test-resolve-hook-impl.mjs +0 -7
- package/dist/extensions/test-resolve-hook.mjs +0 -7
- package/dist/extensions/tokenin-onboarding.ts +0 -883
- package/dist/extensions/tps.test.ts +0 -38
- package/dist/extensions/tps.ts +0 -349
- package/dist/extensions/undo.test.ts +0 -720
- package/dist/extensions/undo.ts +0 -298
- package/dist/extensions/web-agent-onboarding.test.ts +0 -415
- package/dist/extensions/web-agent-onboarding.ts +0 -222
- package/dist/index.d.ts +0 -36
- package/dist/index.js +0 -48
- package/dist/main.d.ts +0 -11
- package/dist/main.js +0 -768
- package/dist/migrations.d.ts +0 -32
- package/dist/migrations.js +0 -280
- package/dist/modes/index.d.ts +0 -8
- package/dist/modes/index.js +0 -7
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/components/armin.d.ts +0 -33
- package/dist/modes/interactive/components/armin.js +0 -332
- package/dist/modes/interactive/components/assistant-message.d.ts +0 -21
- package/dist/modes/interactive/components/assistant-message.js +0 -142
- package/dist/modes/interactive/components/bash-execution.d.ts +0 -33
- package/dist/modes/interactive/components/bash-execution.js +0 -174
- package/dist/modes/interactive/components/bordered-loader.d.ts +0 -15
- package/dist/modes/interactive/components/bordered-loader.js +0 -53
- package/dist/modes/interactive/components/branch-summary-message.d.ts +0 -15
- package/dist/modes/interactive/components/branch-summary-message.js +0 -43
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -15
- package/dist/modes/interactive/components/compaction-summary-message.js +0 -44
- package/dist/modes/interactive/components/config-selector.d.ts +0 -101
- package/dist/modes/interactive/components/config-selector.js +0 -760
- package/dist/modes/interactive/components/countdown-timer.d.ts +0 -13
- package/dist/modes/interactive/components/countdown-timer.js +0 -32
- package/dist/modes/interactive/components/custom-editor.d.ts +0 -20
- package/dist/modes/interactive/components/custom-editor.js +0 -69
- package/dist/modes/interactive/components/custom-entry.d.ts +0 -18
- package/dist/modes/interactive/components/custom-entry.js +0 -51
- package/dist/modes/interactive/components/custom-message.d.ts +0 -21
- package/dist/modes/interactive/components/custom-message.js +0 -86
- package/dist/modes/interactive/components/daxnuts.d.ts +0 -22
- package/dist/modes/interactive/components/daxnuts.js +0 -139
- package/dist/modes/interactive/components/diff.d.ts +0 -11
- package/dist/modes/interactive/components/diff.js +0 -132
- package/dist/modes/interactive/components/dynamic-border.d.ts +0 -14
- package/dist/modes/interactive/components/dynamic-border.js +0 -20
- package/dist/modes/interactive/components/earendil-announcement.d.ts +0 -4
- package/dist/modes/interactive/components/earendil-announcement.js +0 -39
- package/dist/modes/interactive/components/extension-editor.d.ts +0 -20
- package/dist/modes/interactive/components/extension-editor.js +0 -97
- package/dist/modes/interactive/components/extension-input.d.ts +0 -22
- package/dist/modes/interactive/components/extension-input.js +0 -60
- package/dist/modes/interactive/components/extension-selector.d.ts +0 -25
- package/dist/modes/interactive/components/extension-selector.js +0 -82
- package/dist/modes/interactive/components/first-time-setup.d.ts +0 -24
- package/dist/modes/interactive/components/first-time-setup.js +0 -116
- package/dist/modes/interactive/components/footer.d.ts +0 -31
- package/dist/modes/interactive/components/footer.js +0 -221
- package/dist/modes/interactive/components/index.d.ts +0 -33
- package/dist/modes/interactive/components/index.js +0 -34
- package/dist/modes/interactive/components/keybinding-hints.d.ts +0 -12
- package/dist/modes/interactive/components/keybinding-hints.js +0 -35
- package/dist/modes/interactive/components/login-dialog.d.ts +0 -51
- package/dist/modes/interactive/components/login-dialog.js +0 -187
- package/dist/modes/interactive/components/model-selector.d.ts +0 -63
- package/dist/modes/interactive/components/model-selector.js +0 -321
- package/dist/modes/interactive/components/oauth-selector.d.ts +0 -32
- package/dist/modes/interactive/components/oauth-selector.js +0 -162
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -41
- package/dist/modes/interactive/components/scoped-models-selector.js +0 -301
- package/dist/modes/interactive/components/session-selector-search.d.ts +0 -22
- package/dist/modes/interactive/components/session-selector-search.js +0 -154
- package/dist/modes/interactive/components/session-selector.d.ts +0 -94
- package/dist/modes/interactive/components/session-selector.js +0 -866
- package/dist/modes/interactive/components/settings-selector.d.ts +0 -103
- package/dist/modes/interactive/components/settings-selector.js +0 -726
- package/dist/modes/interactive/components/show-images-selector.d.ts +0 -9
- package/dist/modes/interactive/components/show-images-selector.js +0 -38
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -16
- package/dist/modes/interactive/components/skill-invocation-message.js +0 -46
- package/dist/modes/interactive/components/startup-box.d.ts +0 -38
- package/dist/modes/interactive/components/startup-box.js +0 -90
- package/dist/modes/interactive/components/status-indicator.d.ts +0 -30
- package/dist/modes/interactive/components/status-indicator.js +0 -64
- package/dist/modes/interactive/components/theme-selector.d.ts +0 -10
- package/dist/modes/interactive/components/theme-selector.js +0 -49
- package/dist/modes/interactive/components/thinking-selector.d.ts +0 -10
- package/dist/modes/interactive/components/thinking-selector.js +0 -51
- package/dist/modes/interactive/components/tool-execution.d.ts +0 -62
- package/dist/modes/interactive/components/tool-execution.js +0 -325
- package/dist/modes/interactive/components/tree-selector.d.ts +0 -93
- package/dist/modes/interactive/components/tree-selector.js +0 -1244
- package/dist/modes/interactive/components/trust-selector.d.ts +0 -22
- package/dist/modes/interactive/components/trust-selector.js +0 -90
- package/dist/modes/interactive/components/user-message-selector.d.ts +0 -29
- package/dist/modes/interactive/components/user-message-selector.js +0 -113
- package/dist/modes/interactive/components/user-message.d.ts +0 -13
- package/dist/modes/interactive/components/user-message.js +0 -41
- package/dist/modes/interactive/components/visual-truncate.d.ts +0 -23
- package/dist/modes/interactive/components/visual-truncate.js +0 -32
- package/dist/modes/interactive/external-editor.d.ts +0 -11
- package/dist/modes/interactive/external-editor.js +0 -36
- package/dist/modes/interactive/interactive-mode.d.ts +0 -447
- package/dist/modes/interactive/interactive-mode.js +0 -5489
- package/dist/modes/interactive/model-catalog-refresh.d.ts +0 -6
- package/dist/modes/interactive/model-catalog-refresh.js +0 -33
- package/dist/modes/interactive/model-search.d.ts +0 -11
- package/dist/modes/interactive/model-search.js +0 -14
- package/dist/modes/interactive/theme/dark.json +0 -90
- package/dist/modes/interactive/theme/light.json +0 -89
- package/dist/modes/interactive/theme/theme-controller.d.ts +0 -39
- package/dist/modes/interactive/theme/theme-controller.js +0 -124
- package/dist/modes/interactive/theme/theme-schema.json +0 -348
- package/dist/modes/interactive/theme/theme.d.ts +0 -121
- package/dist/modes/interactive/theme/theme.js +0 -1090
- package/dist/modes/print-mode.d.ts +0 -27
- package/dist/modes/print-mode.js +0 -141
- package/dist/modes/rpc/jsonl.d.ts +0 -16
- package/dist/modes/rpc/jsonl.js +0 -48
- package/dist/modes/rpc/rpc-client.d.ts +0 -438
- package/dist/modes/rpc/rpc-client.js +0 -712
- package/dist/modes/rpc/rpc-mode.d.ts +0 -19
- package/dist/modes/rpc/rpc-mode.js +0 -1459
- package/dist/modes/rpc/rpc-types.d.ts +0 -902
- package/dist/modes/rpc/rpc-types.js +0 -7
- package/dist/package-manager-cli.d.ts +0 -7
- package/dist/package-manager-cli.js +0 -789
- package/dist/rpc-entry.d.ts +0 -2
- package/dist/rpc-entry.js +0 -9
- package/dist/skills/agent-browser/SKILL.md +0 -53
- package/dist/skills/batch-grill-me/SKILL.md +0 -20
- package/dist/skills/brandkit/SKILL.md +0 -800
- package/dist/skills/design-references/SKILL.md +0 -32
- package/dist/skills/design-references/references/clickhouse/DESIGN.md +0 -544
- package/dist/skills/design-taste-frontend/SKILL.md +0 -1208
- package/dist/skills/design-taste-frontend-v1/SKILL.md +0 -228
- package/dist/skills/full-output-enforcement/SKILL.md +0 -51
- package/dist/skills/gpt-taste/SKILL.md +0 -76
- package/dist/skills/grill-me/SKILL.md +0 -11
- package/dist/skills/handoff/SKILL.md +0 -17
- package/dist/skills/handoff-text/SKILL.md +0 -15
- package/dist/skills/high-end-visual-design/SKILL.md +0 -100
- package/dist/skills/image-to-code/SKILL.md +0 -1230
- package/dist/skills/imagegen-frontend-mobile/SKILL.md +0 -1467
- package/dist/skills/imagegen-frontend-web/SKILL.md +0 -989
- package/dist/skills/implanger/SKILL.md +0 -70
- package/dist/skills/improve-codebase/REFERENCE.md +0 -78
- package/dist/skills/improve-codebase/SKILL.md +0 -180
- package/dist/skills/industrial-brutalist-ui/SKILL.md +0 -94
- package/dist/skills/minimalist-ui/SKILL.md +0 -87
- package/dist/skills/pi-subagents/SKILL.md +0 -50
- package/dist/skills/pi-subagents/references/constraints-and-recipes.md +0 -274
- package/dist/skills/pi-subagents/references/execution-controls.md +0 -463
- package/dist/skills/pi-subagents/references/management-authoring-rpc.md +0 -161
- package/dist/skills/pi-subagents/references/multi-lane-orchestration.md +0 -39
- package/dist/skills/pi-subagents/references/prompting-and-roles.md +0 -267
- package/dist/skills/planger/SKILL.md +0 -167
- package/dist/skills/ponytail/SKILL.md +0 -121
- package/dist/skills/ponytail-audit/SKILL.md +0 -42
- package/dist/skills/ponytail-debt/SKILL.md +0 -45
- package/dist/skills/ponytail-gain/SKILL.md +0 -51
- package/dist/skills/ponytail-help/SKILL.md +0 -72
- package/dist/skills/ponytail-review/SKILL.md +0 -58
- package/dist/skills/redesign-existing-projects/SKILL.md +0 -180
- package/dist/skills/selesai-handoff/SKILL.md +0 -21
- package/dist/skills/stitch-design-taste/SKILL.md +0 -186
- package/dist/skills/unlazy/CHANGELOG.md +0 -109
- package/dist/skills/unlazy/CONTRIBUTING.md +0 -63
- package/dist/skills/unlazy/LICENSE +0 -21
- package/dist/skills/unlazy/README.md +0 -228
- package/dist/skills/unlazy/SECURITY.md +0 -60
- package/dist/skills/unlazy/SKILL.md +0 -93
- package/dist/skills/unlazy/package.json +0 -13
- package/dist/skills/unlazy/references/dispatch.md +0 -79
- package/dist/skills/unlazy/references/gates.md +0 -132
- package/dist/skills/unlazy/references/method.md +0 -49
- package/dist/skills/unlazy/references/orchestration.md +0 -98
- package/dist/skills/unlazy/references/parallel.md +0 -111
- package/dist/skills/unlazy/references/token-economy.md +0 -39
- package/dist/skills/unlazy/research/validation-protocol.md +0 -81
- package/dist/skills/unlazy/scripts/dispatch-check.mjs +0 -108
- package/dist/skills/unlazy/scripts/gate-check.mjs +0 -879
- package/dist/skills/unlazy/scripts/gate-lint.mjs +0 -178
- package/dist/skills/unlazy/scripts/lib/check-supervisor.mjs +0 -46
- package/dist/skills/unlazy/scripts/lib/dispatch.mjs +0 -283
- package/dist/skills/unlazy/scripts/lib/gates.mjs +0 -625
- package/dist/skills/unlazy/scripts/lib/process-tree.mjs +0 -161
- package/dist/skills/unlazy/scripts/lib/regex-worker.mjs +0 -9
- package/dist/skills/unlazy/templates/PLAN.md +0 -65
- package/dist/skills/unlazy/templates/gates-leaf.md +0 -51
- package/dist/skills/unlazy/templates/gates-node.md +0 -50
- package/dist/skills/unlazy/tests/contract-tests.mjs +0 -127
- package/dist/skills/unlazy/tests/dispatch-tests.mjs +0 -296
- package/dist/skills/unlazy/tests/hardening-tests.mjs +0 -900
- package/dist/skills/unlazy/tests/lint-tests.mjs +0 -242
- package/dist/skills/unlazy/tests/run-tests.mjs +0 -360
- package/dist/skills/unlazy/tests/self-check.mjs +0 -152
- package/dist/skills/unlazy/tests/stress-tests.mjs +0 -165
- package/dist/skills/web-design-guidelines/SKILL.md +0 -41
- package/dist/skills/workflow/SKILL.md +0 -95
- package/dist/themes/adventure.json +0 -84
- package/dist/themes/adwaita-dark.json +0 -84
- package/dist/themes/arcoiris.json +0 -84
- package/dist/themes/arthur.json +0 -84
- package/dist/themes/atom.json +0 -84
- package/dist/themes/aura.json +0 -84
- package/dist/themes/black-metal-bathory.json +0 -84
- package/dist/themes/black-metal-burzum.json +0 -84
- package/dist/themes/black-metal-khold.json +0 -84
- package/dist/themes/box.json +0 -84
- package/dist/themes/brogrammer.json +0 -84
- package/dist/themes/carbonfox.json +0 -84
- package/dist/themes/catppuccin-mocha.json +0 -84
- package/dist/themes/citruszest.json +0 -84
- package/dist/themes/cursor-dark.json +0 -84
- package/dist/themes/cutie-pro.json +0 -84
- package/dist/themes/dark-modern.json +0 -84
- package/dist/themes/dark-pastel.json +0 -84
- package/dist/themes/dimmed-monokai.json +0 -84
- package/dist/themes/doom-peacock.json +0 -84
- package/dist/themes/dracula-plus.json +0 -84
- package/dist/themes/dracula.json +0 -80
- package/dist/themes/earthsong.json +0 -84
- package/dist/themes/everforest-dark-hard.json +0 -84
- package/dist/themes/everforest-dark.json +0 -80
- package/dist/themes/fahrenheit.json +0 -84
- package/dist/themes/flatland.json +0 -84
- package/dist/themes/flexoki-dark.json +0 -84
- package/dist/themes/front-end-delight.json +0 -84
- package/dist/themes/fun-forrest.json +0 -84
- package/dist/themes/galizur.json +0 -84
- package/dist/themes/github-dark-colorblind.json +0 -84
- package/dist/themes/github-dark-high-contrast.json +0 -84
- package/dist/themes/glacier.json +0 -84
- package/dist/themes/gruber-darker.json +0 -84
- package/dist/themes/gruvbox-dark-hard.json +0 -84
- package/dist/themes/gruvbox-dark.json +0 -84
- package/dist/themes/gruvbox-material.json +0 -84
- package/dist/themes/guezwhoz.json +0 -84
- package/dist/themes/hacktober.json +0 -84
- package/dist/themes/hardcore.json +0 -84
- package/dist/themes/havn-skumring.json +0 -84
- package/dist/themes/ic-orange-ppl.json +0 -84
- package/dist/themes/iterm2-smoooooth.json +0 -84
- package/dist/themes/iterm2-tango-dark.json +0 -84
- package/dist/themes/japanesque.json +0 -84
- package/dist/themes/jellybeans.json +0 -84
- package/dist/themes/kanagawa-wave.json +0 -84
- package/dist/themes/kurokula.json +0 -84
- package/dist/themes/later-this-evening.json +0 -84
- package/dist/themes/lovelace.json +0 -84
- package/dist/themes/material-darker.json +0 -84
- package/dist/themes/matte-black.json +0 -84
- package/dist/themes/mellow.json +0 -84
- package/dist/themes/miasma.json +0 -84
- package/dist/themes/nord.json +0 -80
- package/dist/themes/nvim-dark.json +0 -84
- package/dist/themes/one-dark.json +0 -80
- package/dist/themes/popping-and-locking.json +0 -84
- package/dist/themes/rose-pine.json +0 -80
- package/dist/themes/sea-shells.json +0 -84
- package/dist/themes/sleepy-hollow.json +0 -84
- package/dist/themes/smyck.json +0 -84
- package/dist/themes/solarized-dark.json +0 -80
- package/dist/themes/tokyo-night.json +0 -80
- package/dist/themes/tomorrow-night-bright.json +0 -84
- package/dist/themes/tomorrow-night-burns.json +0 -84
- package/dist/themes/tomorrow-night.json +0 -84
- package/dist/themes/twilight.json +0 -84
- package/dist/themes/vague.json +0 -84
- package/dist/themes/vesper.json +0 -84
- package/dist/themes/xcode-dark-hc.json +0 -84
- package/dist/utils/abort.d.ts +0 -4
- package/dist/utils/abort.js +0 -47
- package/dist/utils/ansi.d.ts +0 -1
- package/dist/utils/ansi.js +0 -51
- package/dist/utils/changelog.d.ts +0 -21
- package/dist/utils/changelog.js +0 -164
- package/dist/utils/child-process.d.ts +0 -17
- package/dist/utils/child-process.js +0 -105
- package/dist/utils/clipboard-image.d.ts +0 -10
- package/dist/utils/clipboard-image.js +0 -250
- package/dist/utils/clipboard-native.d.ts +0 -10
- package/dist/utils/clipboard-native.js +0 -19
- package/dist/utils/clipboard.d.ts +0 -3
- package/dist/utils/clipboard.js +0 -140
- package/dist/utils/deprecation.d.ts +0 -3
- package/dist/utils/deprecation.js +0 -12
- package/dist/utils/exif-orientation.d.ts +0 -4
- package/dist/utils/exif-orientation.js +0 -157
- package/dist/utils/frontmatter.d.ts +0 -7
- package/dist/utils/frontmatter.js +0 -25
- package/dist/utils/fs-watch.d.ts +0 -4
- package/dist/utils/fs-watch.js +0 -24
- package/dist/utils/git.d.ts +0 -25
- package/dist/utils/git.js +0 -194
- package/dist/utils/html.d.ts +0 -6
- package/dist/utils/html.js +0 -39
- package/dist/utils/image-convert.d.ts +0 -9
- package/dist/utils/image-convert.js +0 -44
- package/dist/utils/image-process.d.ts +0 -17
- package/dist/utils/image-process.js +0 -82
- package/dist/utils/image-resize-core.d.ts +0 -29
- package/dist/utils/image-resize-core.js +0 -123
- package/dist/utils/image-resize-worker.d.ts +0 -1
- package/dist/utils/image-resize-worker.js +0 -30
- package/dist/utils/image-resize.d.ts +0 -15
- package/dist/utils/image-resize.js +0 -96
- package/dist/utils/json.d.ts +0 -2
- package/dist/utils/json.js +0 -6
- package/dist/utils/mime.d.ts +0 -2
- package/dist/utils/mime.js +0 -132
- package/dist/utils/open-browser.d.ts +0 -8
- package/dist/utils/open-browser.js +0 -21
- package/dist/utils/paths.d.ts +0 -30
- package/dist/utils/paths.js +0 -91
- package/dist/utils/photon.d.ts +0 -20
- package/dist/utils/photon.js +0 -120
- package/dist/utils/pi-user-agent.d.ts +0 -1
- package/dist/utils/pi-user-agent.js +0 -4
- package/dist/utils/shell.d.ts +0 -33
- package/dist/utils/shell.js +0 -215
- package/dist/utils/sleep.d.ts +0 -4
- package/dist/utils/sleep.js +0 -16
- package/dist/utils/syntax-highlight.d.ts +0 -11
- package/dist/utils/syntax-highlight.js +0 -117
- package/dist/utils/thinking-tags.d.ts +0 -6
- package/dist/utils/thinking-tags.js +0 -62
- package/dist/utils/tools-manager.d.ts +0 -7
- package/dist/utils/tools-manager.js +0 -402
- package/dist/utils/version-check.d.ts +0 -19
- package/dist/utils/version-check.js +0 -72
- package/dist/utils/windows-self-update.d.ts +0 -2
- package/dist/utils/windows-self-update.js +0 -76
|
@@ -1,3146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rendering functions for subagent results
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as path from "node:path";
|
|
6
|
-
import { createHash } from "node:crypto";
|
|
7
|
-
import type { AgentToolResult } from "@earendil-works/pi-agent-core";
|
|
8
|
-
import { getMarkdownTheme, keyText, type ExtensionContext } from "@selesai/code";
|
|
9
|
-
import { Container, Markdown, Spacer, Text, visibleWidth, type Component } from "@earendil-works/pi-tui";
|
|
10
|
-
import {
|
|
11
|
-
type AgentProgress,
|
|
12
|
-
type AsyncJobState,
|
|
13
|
-
type AsyncJobStep,
|
|
14
|
-
type AsyncParallelGroupStatus,
|
|
15
|
-
type Details,
|
|
16
|
-
type HostStepState,
|
|
17
|
-
type HostStepVerdict,
|
|
18
|
-
type NestedRunSummary,
|
|
19
|
-
type NestedStepSummary,
|
|
20
|
-
type WorkflowGraphNode,
|
|
21
|
-
type WorkflowNodeStatus,
|
|
22
|
-
type MainWindowRendererConfig,
|
|
23
|
-
MAX_WIDGET_JOBS,
|
|
24
|
-
WIDGET_ANIMATION_INTERVAL_MS,
|
|
25
|
-
WIDGET_KEY,
|
|
26
|
-
} from "../shared/types.ts";
|
|
27
|
-
import { previewDisplayText, sanitizeDisplayText, truncateDisplayText } from "../shared/display-text.ts";
|
|
28
|
-
import { FLEET_OPEN_SHORTCUT, formatShortcutLabel } from "../shared/shortcuts.ts";
|
|
29
|
-
import { formatContextUsage, formatTokens, formatUsage, formatDuration, formatModelThinking, formatToolCall, formatTokenUsage, shortenPath } from "../shared/formatters.ts";
|
|
30
|
-
import { getDisplayItems, getSingleResultOutput, PROMPT_REDACTED } from "../shared/utils.ts";
|
|
31
|
-
import { flatToLogicalStepIndex } from "../runs/background/parallel-groups.ts";
|
|
32
|
-
import { formatNestedAggregate } from "../runs/shared/nested-render.ts";
|
|
33
|
-
import { aggregateStepStatus, formatActivityLabel, formatAgentRunningLabel, formatParallelOutcome } from "../shared/status-format.ts";
|
|
34
|
-
import { contextModeBadge, contextModePrefix } from "../runs/shared/context-mode.ts";
|
|
35
|
-
import { shouldSuppressSingleStep, stripRepeatedAgentPrefix, withDuplicateLabelDiscriminators } from "./render-helpers.ts";
|
|
36
|
-
import { buildWorkflowChatProgressRows, type WorkflowChatProgressRow } from "../workflows/chat-progress.ts";
|
|
37
|
-
import { formatWorkflowPreflight, formatWorkflowPreflightPlanSummary, formatWorkflowPreflightWarningSummary, formatWorkflowPreflightWarnings } from "../workflows/workflow-preflight.ts";
|
|
38
|
-
import { encodeAsyncStatusSnapshotWidget } from "../runs/background/async-status-snapshot.ts";
|
|
39
|
-
import { projectAsyncWorkflowRows, type AsyncStatusWorkflowRow } from "../runs/shared/async-status-projection.ts";
|
|
40
|
-
import { hostStepReportName, hostStepVerdictLabel } from "../runs/shared/host-step-status.ts";
|
|
41
|
-
import { workflowGraphStageNodes } from "../runs/shared/workflow-graph.ts";
|
|
42
|
-
|
|
43
|
-
type Theme = ExtensionContext["ui"]["theme"];
|
|
44
|
-
|
|
45
|
-
interface WorkflowWidgetProjection {
|
|
46
|
-
stages: WorkflowGraphNode[];
|
|
47
|
-
steps: AsyncJobStep[];
|
|
48
|
-
stageProgress?: { total: number; current?: number };
|
|
49
|
-
plannedKeys?: Set<string>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
type WorkflowWidgetProjectionLookup = (job: AsyncJobState) => WorkflowWidgetProjection;
|
|
53
|
-
|
|
54
|
-
interface MainWindowRenderLayout {
|
|
55
|
-
horizontalSpacing: number;
|
|
56
|
-
compactResultMaxLines?: number;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function resolveMainWindowRenderLayout(config?: MainWindowRendererConfig): MainWindowRenderLayout {
|
|
60
|
-
return {
|
|
61
|
-
horizontalSpacing: config?.horizontalSpacing ?? 2,
|
|
62
|
-
...(config?.compactResultMaxLines !== undefined ? { compactResultMaxLines: config.compactResultMaxLines } : {}),
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function mainWindowIndent(layout: MainWindowRenderLayout, level: number): string {
|
|
67
|
-
return " ".repeat(Math.max(0, layout.horizontalSpacing * level));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function capCompactMainWindowResult(component: Component, layout: MainWindowRenderLayout, theme: Theme, enabled: boolean): Component {
|
|
71
|
-
const maxLines = layout.compactResultMaxLines;
|
|
72
|
-
if (!enabled || maxLines === undefined) return component;
|
|
73
|
-
const capped = new Container();
|
|
74
|
-
capped.render = (width: number): string[] => {
|
|
75
|
-
const lines = component.render(width);
|
|
76
|
-
if (lines.length <= maxLines) return lines;
|
|
77
|
-
const visibleRows = maxLines === 1 ? 1 : maxLines - 1;
|
|
78
|
-
const hiddenCount = lines.length - visibleRows;
|
|
79
|
-
const hint = theme.fg("accent", `… ${hiddenCount} rows hidden · ${liveDetailKeyText()} expands`);
|
|
80
|
-
if (maxLines === 1) return [truncLine(`${lines[0] ?? ""} ${hint}`, width)];
|
|
81
|
-
return [...lines.slice(0, visibleRows), truncLine(hint, width)];
|
|
82
|
-
};
|
|
83
|
-
return capped;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function liveDetailKeyText(): string {
|
|
87
|
-
return keyText("app.tools.expand");
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export function liveDetailHintText(): string {
|
|
91
|
-
return `Press ${liveDetailKeyText()} for live detail · ${formatShortcutLabel(FLEET_OPEN_SHORTCUT)} Fleet`;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function foregroundSingleHintText(shortcut?: string): string {
|
|
95
|
-
if (!shortcut) return liveDetailHintText();
|
|
96
|
-
const label = formatShortcutLabel(shortcut);
|
|
97
|
-
return `${liveDetailHintText()} · ${label} to run in background`;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function getTermWidth(): number {
|
|
101
|
-
return process.stdout.columns || 120;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const segmenter = new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
105
|
-
const ansiStylePattern = /\x1b\[[0-9;]*m/y;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Truncate a line to maxWidth, preserving ANSI styling through the ellipsis.
|
|
109
|
-
*
|
|
110
|
-
* pi-tui's truncateToWidth adds \x1b[0m before ellipsis which resets all styling,
|
|
111
|
-
* causing background color bleed in the TUI. This implementation tracks active
|
|
112
|
-
* ANSI styles and re-applies them before the ellipsis.
|
|
113
|
-
*
|
|
114
|
-
* Uses Intl.Segmenter for proper Unicode/emoji handling (not char-by-char).
|
|
115
|
-
*/
|
|
116
|
-
export function truncLine(text: string, maxWidth: number): string {
|
|
117
|
-
if (maxWidth <= 0) return "";
|
|
118
|
-
if (visibleWidth(text) <= maxWidth) return text;
|
|
119
|
-
|
|
120
|
-
const targetWidth = maxWidth - 1;
|
|
121
|
-
let result = "";
|
|
122
|
-
let currentWidth = 0;
|
|
123
|
-
let activeStyles: string[] = [];
|
|
124
|
-
let i = 0;
|
|
125
|
-
|
|
126
|
-
while (i < text.length) {
|
|
127
|
-
ansiStylePattern.lastIndex = i;
|
|
128
|
-
const ansiMatch = ansiStylePattern.exec(text);
|
|
129
|
-
if (ansiMatch) {
|
|
130
|
-
const code = ansiMatch[0];
|
|
131
|
-
result += code;
|
|
132
|
-
|
|
133
|
-
if (code === "\x1b[0m" || code === "\x1b[m") {
|
|
134
|
-
activeStyles = [];
|
|
135
|
-
} else {
|
|
136
|
-
activeStyles.push(code);
|
|
137
|
-
}
|
|
138
|
-
i += code.length;
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
let end = text.indexOf("\x1b[", i);
|
|
143
|
-
if (end === i) end = text.indexOf("\x1b[", i + 2);
|
|
144
|
-
if (end === -1) end = text.length;
|
|
145
|
-
const textPortion = text.slice(i, end);
|
|
146
|
-
for (const seg of segmenter.segment(textPortion)) {
|
|
147
|
-
const grapheme = seg.segment;
|
|
148
|
-
const graphemeWidth = grapheme === "\x1b" ? 0 : visibleWidth(grapheme);
|
|
149
|
-
|
|
150
|
-
if (currentWidth + graphemeWidth > targetWidth) {
|
|
151
|
-
return result + activeStyles.join("") + "…";
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
result += grapheme;
|
|
155
|
-
currentWidth += graphemeWidth;
|
|
156
|
-
}
|
|
157
|
-
i = end;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return result + activeStyles.join("") + "…";
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function wrapPlainText(text: string, maxWidth: number): string[] {
|
|
164
|
-
if (maxWidth <= 0) return [""];
|
|
165
|
-
const lines: string[] = [];
|
|
166
|
-
for (const rawLine of text.split("\n")) {
|
|
167
|
-
if (rawLine.length === 0) {
|
|
168
|
-
lines.push("");
|
|
169
|
-
continue;
|
|
170
|
-
}
|
|
171
|
-
let current = "";
|
|
172
|
-
let currentWidth = 0;
|
|
173
|
-
for (const seg of segmenter.segment(rawLine)) {
|
|
174
|
-
const grapheme = seg.segment;
|
|
175
|
-
const graphemeWidth = visibleWidth(grapheme);
|
|
176
|
-
if (graphemeWidth > maxWidth) continue;
|
|
177
|
-
if (currentWidth > 0 && currentWidth + graphemeWidth > maxWidth) {
|
|
178
|
-
lines.push(current);
|
|
179
|
-
current = grapheme;
|
|
180
|
-
currentWidth = graphemeWidth;
|
|
181
|
-
continue;
|
|
182
|
-
}
|
|
183
|
-
current += grapheme;
|
|
184
|
-
currentWidth += graphemeWidth;
|
|
185
|
-
}
|
|
186
|
-
lines.push(current);
|
|
187
|
-
}
|
|
188
|
-
return lines;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
const RUNNING_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
192
|
-
const STATIC_RUNNING_GLYPH = "●";
|
|
193
|
-
|
|
194
|
-
type ProgressSeedSource = Partial<Pick<AgentProgress, "index" | "toolCount" | "tokens" | "durationMs" | "lastActivityAt" | "currentToolStartedAt" | "turnCount">>;
|
|
195
|
-
|
|
196
|
-
function runningSeed(...values: Array<number | undefined>): number | undefined {
|
|
197
|
-
let seed: number | undefined;
|
|
198
|
-
for (const value of values) {
|
|
199
|
-
if (value === undefined || !Number.isFinite(value)) continue;
|
|
200
|
-
seed = (seed ?? 0) + Math.trunc(value);
|
|
201
|
-
}
|
|
202
|
-
return seed;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function runningGlyph(seed?: number): string {
|
|
206
|
-
if (seed === undefined) return STATIC_RUNNING_GLYPH;
|
|
207
|
-
return RUNNING_FRAMES[Math.abs(seed) % RUNNING_FRAMES.length]!;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
function animatedSeed(seed: number | undefined, frame: number | undefined): number | undefined {
|
|
211
|
-
if (frame === undefined) return seed;
|
|
212
|
-
return (seed ?? 0) + frame;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
function progressRunningSeed(progress: ProgressSeedSource | undefined): number | undefined {
|
|
216
|
-
if (!progress) return undefined;
|
|
217
|
-
return runningSeed(
|
|
218
|
-
progress.index,
|
|
219
|
-
progress.toolCount,
|
|
220
|
-
progress.tokens,
|
|
221
|
-
progress.durationMs,
|
|
222
|
-
progress.lastActivityAt,
|
|
223
|
-
progress.currentToolStartedAt,
|
|
224
|
-
progress.turnCount,
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
interface LegacyResultAnimationContext {
|
|
229
|
-
state: { subagentResultAnimationTimer?: ReturnType<typeof setInterval> };
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export function clearLegacyResultAnimationTimer(context: LegacyResultAnimationContext): void {
|
|
233
|
-
const timer = context.state.subagentResultAnimationTimer;
|
|
234
|
-
if (!timer) return;
|
|
235
|
-
clearInterval(timer);
|
|
236
|
-
context.state.subagentResultAnimationTimer = undefined;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
function extractOutputTarget(task: string): string | undefined {
|
|
240
|
-
const writeToMatch = task.match(/\[Write to:\s*([^\]\n]+)\]/i);
|
|
241
|
-
if (writeToMatch?.[1]?.trim()) return writeToMatch[1].trim();
|
|
242
|
-
const findingsMatch = task.match(/Write your findings to(?: exactly this path)?:\s*([^\r\n]+)/i);
|
|
243
|
-
if (findingsMatch?.[1]?.trim()) return findingsMatch[1].trim();
|
|
244
|
-
const outputMatch = task.match(/[Oo]utput(?:\s+to)?\s*:\s*(\S+)/i);
|
|
245
|
-
if (outputMatch?.[1]?.trim()) return outputMatch[1].trim();
|
|
246
|
-
return undefined;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
function hasEmptyTextOutputWithoutOutputTarget(task: string, output: string): boolean {
|
|
250
|
-
if (output.trim()) return false;
|
|
251
|
-
return !extractOutputTarget(task);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function getToolCallLines(
|
|
255
|
-
result: Pick<Details["results"][number], "messages" | "toolCalls">,
|
|
256
|
-
expanded: boolean,
|
|
257
|
-
): string[] {
|
|
258
|
-
if (result.messages) {
|
|
259
|
-
return getDisplayItems(result.messages)
|
|
260
|
-
.filter((item): item is { type: "tool"; name: string; args: Record<string, unknown> } => item.type === "tool")
|
|
261
|
-
.map((item) => formatToolCall(item.name, item.args, expanded));
|
|
262
|
-
}
|
|
263
|
-
return result.toolCalls?.map((toolCall) => expanded ? toolCall.expandedText : toolCall.text) ?? [];
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
const ansiEscapePattern = /\x1b\[[0-9;]*m/g;
|
|
267
|
-
const noisyStatusPatterns = [
|
|
268
|
-
/^(?:i|we)\s+(?:will|need|can|should|am|are)\b/i,
|
|
269
|
-
/^i(?:'m|’m| am)\b/i,
|
|
270
|
-
/\bso i (?:will|need|can)\b/i,
|
|
271
|
-
/^(?:checking|fetching|reading|inspecting|verifying|collecting|confirming|polling)\b/i,
|
|
272
|
-
/^(?:async\s+subagent\s+)?[\w.-]+\s*·\s*(?:step|agent)\s+\d+\/\d+\s*·/i,
|
|
273
|
-
/^(?:Step|Agent)\s+\d+\/\d+:\s+[\w.-]+\s*·\s*(?:running|queued|pending|complete|completed)\b/i,
|
|
274
|
-
/^(?:async\s+subagent\s+)?[\w.-]+(?:\s+\[(?:fresh|fork|mixed)\])?\s*·\s*(?:running|queued|pending|complete|completed|done)\b/i,
|
|
275
|
-
/^Press\s+\S+\s+for\s+live\s+detail$/i,
|
|
276
|
-
/^output:\s+.+\/async-subagent-runs\//i,
|
|
277
|
-
];
|
|
278
|
-
const liveOutputWordSignalPattern = /\b(?:access denied|denied|error|exception|fail(?:ed|ure)?|fatal|panic|rejected|timeout|timed out|unable|warning)\b/i;
|
|
279
|
-
const liveOutputCodeSignalPattern = /\bE[A-Z0-9_]{2,}\b/;
|
|
280
|
-
|
|
281
|
-
function oneLine(text: string): string {
|
|
282
|
-
return text.replace(ansiEscapePattern, "").replace(/\s+/g, " ").trim();
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
const COMPACT_TASK_MAX_CHARS = 96;
|
|
286
|
-
|
|
287
|
-
/** Display label for a child run: the derived session name (agent + task
|
|
288
|
-
* excerpt) when the launcher provided one, else the bare agent name. */
|
|
289
|
-
function childDisplayName(result: { agent?: string; sessionName?: string } | undefined, fallback = "subagent"): string {
|
|
290
|
-
return result?.sessionName?.trim() || result?.agent || fallback;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
export function compactTaskText(task: string | undefined, label?: string): string | undefined {
|
|
294
|
-
const taskText = task?.trim();
|
|
295
|
-
const labelText = label?.trim();
|
|
296
|
-
const normalizedTask = taskText && taskText !== PROMPT_REDACTED ? oneLine(taskText) : "";
|
|
297
|
-
const normalizedLabel = labelText && labelText !== PROMPT_REDACTED ? oneLine(labelText) : "";
|
|
298
|
-
const normalized = normalizedLabel && normalizedTask && normalizedLabel !== normalizedTask
|
|
299
|
-
? `${normalizedLabel} — ${normalizedTask}`
|
|
300
|
-
: normalizedLabel || normalizedTask;
|
|
301
|
-
if (!normalized) return undefined;
|
|
302
|
-
return previewDisplayText(normalized, COMPACT_TASK_MAX_CHARS);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
export interface AsyncLaneProjection {
|
|
306
|
-
label?: string;
|
|
307
|
-
role: string;
|
|
308
|
-
phase?: string;
|
|
309
|
-
state: AsyncJobState["status"] | AsyncJobStep["status"];
|
|
310
|
-
gate?: string;
|
|
311
|
-
next?: string;
|
|
312
|
-
output?: string;
|
|
313
|
-
workspace?: string;
|
|
314
|
-
ref: string;
|
|
315
|
-
chips: string[];
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
const LANE_VALUE_MAX_CHARS = 48;
|
|
319
|
-
|
|
320
|
-
function boundedLaneValue(value: string | undefined, maxChars = LANE_VALUE_MAX_CHARS): string | undefined {
|
|
321
|
-
if (!value?.trim() || value.trim() === PROMPT_REDACTED) return undefined;
|
|
322
|
-
return previewDisplayText(oneLine(value), maxChars);
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
function workflowNodeStepStatus(status: WorkflowNodeStatus): AsyncJobStep["status"] {
|
|
326
|
-
switch (status) {
|
|
327
|
-
case "completed":
|
|
328
|
-
return "completed";
|
|
329
|
-
case "detached":
|
|
330
|
-
return "paused";
|
|
331
|
-
default:
|
|
332
|
-
return status;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
function workflowNodeStatusLabel(status: WorkflowNodeStatus): string {
|
|
337
|
-
switch (status) {
|
|
338
|
-
case "completed":
|
|
339
|
-
return "complete";
|
|
340
|
-
case "detached":
|
|
341
|
-
return "paused";
|
|
342
|
-
default:
|
|
343
|
-
return status;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
function workflowStepPriority(step: AsyncJobStep, currentNodeId?: string): number {
|
|
348
|
-
const isCurrent = step.workflowKey === currentNodeId;
|
|
349
|
-
if (step.status === "running" || (isCurrent && step.status !== "complete" && step.status !== "completed")) return 0;
|
|
350
|
-
const gate = laneGate(step);
|
|
351
|
-
if (
|
|
352
|
-
step.status === "failed"
|
|
353
|
-
|| step.status === "partial"
|
|
354
|
-
|| step.status === "paused"
|
|
355
|
-
|| step.status === "stopped"
|
|
356
|
-
|| step.status === "rejected"
|
|
357
|
-
|| step.toolBudgetBlocked === true
|
|
358
|
-
|| step.turnBudgetExceeded === true
|
|
359
|
-
|| step.activityState === "needs_attention"
|
|
360
|
-
|| step.watchdog?.phase === "stale"
|
|
361
|
-
|| gate !== undefined
|
|
362
|
-
) return 1;
|
|
363
|
-
if (step.status === "pending") return 2;
|
|
364
|
-
return 3;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
/** Merge materialized child rows with the planned workflow stages for rendering. */
|
|
368
|
-
function workflowWidgetSteps(job: AsyncJobState, planned = job.mode === "workflow" ? workflowGraphStageNodes(job.workflowGraph) : []): AsyncJobStep[] {
|
|
369
|
-
const loaded = job.steps ?? [];
|
|
370
|
-
if (planned.length === 0) return loaded;
|
|
371
|
-
|
|
372
|
-
const loadedIndexesByKey = new Map<string, number[]>();
|
|
373
|
-
for (const [index, step] of loaded.entries()) {
|
|
374
|
-
if (!step.workflowKey) continue;
|
|
375
|
-
const indexes = loadedIndexesByKey.get(step.workflowKey) ?? [];
|
|
376
|
-
indexes.push(index);
|
|
377
|
-
loadedIndexesByKey.set(step.workflowKey, indexes);
|
|
378
|
-
}
|
|
379
|
-
const consumed = new Set<number>();
|
|
380
|
-
const entries: Array<{ step: AsyncJobStep; order: number }> = [];
|
|
381
|
-
for (const [order, node] of planned.entries()) {
|
|
382
|
-
const loadedIndex = loadedIndexesByKey.get(node.id)?.find((index) => !consumed.has(index));
|
|
383
|
-
if (loadedIndex !== undefined) {
|
|
384
|
-
consumed.add(loadedIndex);
|
|
385
|
-
const loadedStep = loaded[loadedIndex]!;
|
|
386
|
-
entries.push({
|
|
387
|
-
step: {
|
|
388
|
-
...loadedStep,
|
|
389
|
-
index: node.flatIndex ?? loadedStep.index ?? order,
|
|
390
|
-
agent: loadedStep.agent || node.agent || job.agents?.[0] || "workflow",
|
|
391
|
-
phase: loadedStep.phase ?? node.phase,
|
|
392
|
-
label: loadedStep.label ?? node.label,
|
|
393
|
-
workflowKey: loadedStep.workflowKey ?? node.id,
|
|
394
|
-
...(loadedStep.outputName === undefined && node.outputName !== undefined ? { outputName: node.outputName } : {}),
|
|
395
|
-
...(loadedStep.structured === undefined && node.structured !== undefined ? { structured: node.structured } : {}),
|
|
396
|
-
...(loadedStep.error === undefined && node.error !== undefined ? { error: node.error } : {}),
|
|
397
|
-
},
|
|
398
|
-
order,
|
|
399
|
-
});
|
|
400
|
-
continue;
|
|
401
|
-
}
|
|
402
|
-
entries.push({
|
|
403
|
-
step: {
|
|
404
|
-
index: node.flatIndex ?? order,
|
|
405
|
-
agent: node.agent ?? job.agents?.[0] ?? "workflow",
|
|
406
|
-
status: workflowNodeStepStatus(node.status),
|
|
407
|
-
workflowKey: node.id,
|
|
408
|
-
label: node.label,
|
|
409
|
-
...(node.phase ? { phase: node.phase } : {}),
|
|
410
|
-
...(node.outputName ? { outputName: node.outputName } : {}),
|
|
411
|
-
...(node.structured !== undefined ? { structured: node.structured } : {}),
|
|
412
|
-
...(node.error ? { error: node.error } : {}),
|
|
413
|
-
},
|
|
414
|
-
order,
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
for (const [index, step] of loaded.entries()) {
|
|
418
|
-
if (!consumed.has(index)) entries.push({ step, order: planned.length + index });
|
|
419
|
-
}
|
|
420
|
-
entries.sort((left, right) => workflowStepPriority(left.step, job.workflowGraph?.currentNodeId) - workflowStepPriority(right.step, job.workflowGraph?.currentNodeId) || left.order - right.order);
|
|
421
|
-
return entries.map(({ step }) => step);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
function workflowStageProgress(job: AsyncJobState, stages = job.mode === "workflow" ? workflowGraphStageNodes(job.workflowGraph) : []): { total: number; current?: number } | undefined {
|
|
425
|
-
if (job.mode !== "workflow") return undefined;
|
|
426
|
-
if (stages.length === 0) return undefined;
|
|
427
|
-
const currentId = job.workflowGraph?.currentNodeId;
|
|
428
|
-
const currentIndex = currentId ? stages.findIndex((stage) => stage.id === currentId) : -1;
|
|
429
|
-
if (currentIndex >= 0 && stages[currentIndex]?.status !== "completed") return { total: stages.length, current: currentIndex };
|
|
430
|
-
const runningIndex = stages.findIndex((stage) => stage.status === "running");
|
|
431
|
-
if (runningIndex >= 0) return { total: stages.length, current: runningIndex };
|
|
432
|
-
const indexedStage = job.currentStep !== undefined && job.currentStep >= 0 ? stages[job.currentStep] : undefined;
|
|
433
|
-
if (indexedStage && indexedStage.status !== "completed") return { total: stages.length, current: job.currentStep };
|
|
434
|
-
if (stages.every((stage) => stage.status === "completed")) return { total: stages.length, current: stages.length - 1 };
|
|
435
|
-
return { total: stages.length };
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
function buildWorkflowWidgetProjection(job: AsyncJobState): WorkflowWidgetProjection {
|
|
439
|
-
const stages = job.mode === "workflow" ? workflowGraphStageNodes(job.workflowGraph) : [];
|
|
440
|
-
const stageProgress = workflowStageProgress(job, stages);
|
|
441
|
-
const steps = workflowWidgetSteps(job, stages);
|
|
442
|
-
const projection: WorkflowWidgetProjection = { stages, steps };
|
|
443
|
-
if (stageProgress) projection.stageProgress = stageProgress;
|
|
444
|
-
if (stages.length) projection.plannedKeys = new Set(stages.map((node) => node.id));
|
|
445
|
-
return projection;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
function workflowWidgetProjectionLookup(): WorkflowWidgetProjectionLookup {
|
|
449
|
-
const projections = new WeakMap<AsyncJobState, WorkflowWidgetProjection>();
|
|
450
|
-
return (job: AsyncJobState) => {
|
|
451
|
-
const cached = projections.get(job);
|
|
452
|
-
if (cached) return cached;
|
|
453
|
-
const projection = buildWorkflowWidgetProjection(job);
|
|
454
|
-
projections.set(job, projection);
|
|
455
|
-
return projection;
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
function laneStepForJob(job: AsyncJobState, steps = workflowWidgetSteps(job)): AsyncJobStep | undefined {
|
|
460
|
-
if (steps.length === 0) return undefined;
|
|
461
|
-
const graphCurrent = job.workflowGraph?.currentNodeId;
|
|
462
|
-
if (graphCurrent) {
|
|
463
|
-
const current = steps.find((step) => step.workflowKey === graphCurrent);
|
|
464
|
-
if (current) return current;
|
|
465
|
-
}
|
|
466
|
-
if (job.currentStep !== undefined) {
|
|
467
|
-
const current = steps[job.currentStep];
|
|
468
|
-
if (current && (current.index === undefined || current.index === job.currentStep)) return current;
|
|
469
|
-
// Active parallel groups retain flat indices while exposing only the group slice.
|
|
470
|
-
const indexedCurrent = steps.find((step) => step.index === job.currentStep);
|
|
471
|
-
if (indexedCurrent) return indexedCurrent;
|
|
472
|
-
return steps[0];
|
|
473
|
-
}
|
|
474
|
-
return steps.find((step) => step.status === "running")
|
|
475
|
-
?? steps.find((step) => step.status === "pending")
|
|
476
|
-
?? steps.at(-1);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
function laneTraceForJob(job: AsyncJobState): NonNullable<AsyncJobState["workflow"]>["trace"][number] | undefined {
|
|
480
|
-
return Array.isArray(job.workflow?.trace) ? job.workflow.trace.at(-1) : undefined;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
function laneGate(step: AsyncJobStep | undefined): string | undefined {
|
|
484
|
-
const review = step?.review?.status ?? step?.acceptance?.reviewResult?.status;
|
|
485
|
-
if (review === "blockers") return "review blockers";
|
|
486
|
-
if (review === "review-required") return "review required";
|
|
487
|
-
if (review === "reviewed") return "reviewed";
|
|
488
|
-
const acceptance = step?.acceptance?.status;
|
|
489
|
-
if (acceptance === "review-required") return "acceptance review";
|
|
490
|
-
if (acceptance === "checked" || acceptance === "verified" || acceptance === "accepted") return "acceptance";
|
|
491
|
-
return undefined;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
function laneNextAction(state: AsyncLaneProjection["state"], step: AsyncJobStep | undefined, output: string | undefined, gate: string | undefined): string | undefined {
|
|
495
|
-
if (step?.watchdog?.phase === "stale") return "inspect stale state";
|
|
496
|
-
if (step?.toolBudgetBlocked === true || step?.turnBudgetExceeded === true) return "inspect blocked state";
|
|
497
|
-
if (gate === "review blockers") return "resolve review blockers";
|
|
498
|
-
if (gate === "review required" || gate === "acceptance review") return "review output";
|
|
499
|
-
if (step?.activityState === "needs_attention") return "inspect attention";
|
|
500
|
-
if (state === "queued" || state === "pending") return "await launch";
|
|
501
|
-
if (state === "failed" || state === "rejected") return "inspect failure";
|
|
502
|
-
if (state === "partial") return "inspect partial state";
|
|
503
|
-
if (state === "paused") return "inspect paused state";
|
|
504
|
-
if (state === "stopped") return "inspect stopped state";
|
|
505
|
-
if ((state === "complete" || state === "completed") && gate === "reviewed") return "ready";
|
|
506
|
-
if ((state === "complete" || state === "completed") && output) return "inspect output";
|
|
507
|
-
return undefined;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
function isTerminalLaneState(state: AsyncJobState["status"]): boolean {
|
|
511
|
-
return state !== "queued" && state !== "running";
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
/** Project already-loaded async status facts into one bounded, render-only lane row. */
|
|
515
|
-
export function projectAsyncLane(job: AsyncJobState, ...args: [selectedStep?: AsyncJobStep]): AsyncLaneProjection | undefined {
|
|
516
|
-
const selectedStep = args.length === 0 ? laneStepForJob(job) : args[0];
|
|
517
|
-
const trace = laneTraceForJob(job);
|
|
518
|
-
const workspace = job.cwd ? boundedLaneValue(shortenPath(job.cwd)) : undefined;
|
|
519
|
-
const label = compactTaskText(selectedStep?.description, selectedStep?.label)
|
|
520
|
-
?? boundedLaneValue(trace?.label)
|
|
521
|
-
?? (workspace ? undefined : boundedLaneValue(selectedStep?.workflowKey ?? job.workflowKey));
|
|
522
|
-
const role = boundedLaneValue(selectedStep?.agent ?? trace?.agent ?? job.agents?.[0] ?? widgetJobName(job), 32) ?? "subagent";
|
|
523
|
-
const phase = boundedLaneValue(selectedStep?.phase ?? trace?.phase);
|
|
524
|
-
const gate = laneGate(selectedStep);
|
|
525
|
-
const output = boundedLaneValue(selectedStep?.outputName);
|
|
526
|
-
const ref = boundedLaneValue(selectedStep?.workflowKey ?? job.workflowKey ?? job.asyncId.slice(0, 8), 24) ?? job.asyncId.slice(0, 8);
|
|
527
|
-
const chips = [
|
|
528
|
-
selectedStep?.context,
|
|
529
|
-
selectedStep?.structured ? "structured" : undefined,
|
|
530
|
-
selectedStep?.activityState === "active_long_running" ? "long-running" : undefined,
|
|
531
|
-
selectedStep?.activityState === "needs_attention" ? "attention" : undefined,
|
|
532
|
-
selectedStep?.watchdog?.phase === "stale" ? "stale" : undefined,
|
|
533
|
-
selectedStep?.toolBudgetBlocked === true || selectedStep?.turnBudgetExceeded === true ? "blocked" : undefined,
|
|
534
|
-
].filter((chip): chip is string => Boolean(chip));
|
|
535
|
-
const state = isTerminalLaneState(job.status) ? job.status : selectedStep?.status ?? job.status;
|
|
536
|
-
const next = laneNextAction(state, selectedStep, output, gate);
|
|
537
|
-
if (!label && !phase && !gate && !output && !selectedStep?.workflowKey && !job.workflowKey && !trace?.label && !trace?.phase) return undefined;
|
|
538
|
-
return { ...(label ? { label } : {}), role, ...(phase ? { phase } : {}), state, ...(gate ? { gate } : {}), ...(next ? { next } : {}), ...(output ? { output } : {}), ...(workspace ? { workspace } : {}), ref, chips };
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
function laneStateLabel(state: AsyncLaneProjection["state"], theme: Theme): string {
|
|
542
|
-
if (state === "running") return theme.fg("accent", "running");
|
|
543
|
-
if (state === "queued" || state === "pending") return theme.fg("muted", state);
|
|
544
|
-
if (state === "complete" || state === "completed") return theme.fg("success", "complete");
|
|
545
|
-
if (state === "failed" || state === "rejected") return theme.fg("error", state === "rejected" ? "rejected" : "failed");
|
|
546
|
-
return theme.fg("warning", state);
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
function formatLaneProjection(lane: AsyncLaneProjection, theme: Theme): string {
|
|
550
|
-
const label = boundedLaneValue(lane.label, 56);
|
|
551
|
-
const identity = [label, lane.role ? `role:${lane.role}` : undefined].filter(Boolean).join(" · ");
|
|
552
|
-
return `${identity ? theme.bold(identity) : theme.bold(lane.role)} · ${laneStateLabel(lane.state, theme)}`;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
function formatLaneChip(chip: string, theme: Theme): string {
|
|
556
|
-
const text = `[${chip}]`;
|
|
557
|
-
if (chip === "blocked") return theme.fg("error", text);
|
|
558
|
-
if (chip === "stale") return theme.fg("warning", text);
|
|
559
|
-
return text;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
function formatLaneProjectionDetails(lane: AsyncLaneProjection, theme: Theme): string | undefined {
|
|
563
|
-
const details = [
|
|
564
|
-
lane.phase ? `phase:${lane.phase}` : undefined,
|
|
565
|
-
lane.gate ? `gate:${lane.gate}` : undefined,
|
|
566
|
-
lane.next ? `next:${lane.next}` : undefined,
|
|
567
|
-
lane.output ? `out:${lane.output}` : undefined,
|
|
568
|
-
lane.workspace ? `workspace:${lane.workspace}` : lane.ref ? `ref:${lane.ref}` : undefined,
|
|
569
|
-
].filter(Boolean);
|
|
570
|
-
const chips = lane.chips.map((chip) => formatLaneChip(chip, theme));
|
|
571
|
-
return [...(details.length ? [theme.fg("dim", details.join(" · "))] : []), ...chips].join(" · ") || undefined;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
function formatLaneProjectionLines(lane: AsyncLaneProjection, theme: Theme, indent: string): string[] {
|
|
575
|
-
const details = formatLaneProjectionDetails(lane, theme);
|
|
576
|
-
return [
|
|
577
|
-
`${indent}${formatLaneProjection(lane, theme)}`,
|
|
578
|
-
...(details ? [`${indent} ${details}`] : []),
|
|
579
|
-
];
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
function laneRenderKey(job: AsyncJobState, projection?: WorkflowWidgetProjection): unknown {
|
|
583
|
-
const selectedStep = projection ? laneStepForJob(job, projection.steps) : laneStepForJob(job);
|
|
584
|
-
const lane = projectAsyncLane(job, selectedStep);
|
|
585
|
-
return lane ? [lane.label, lane.role, lane.phase, lane.state, lane.gate, lane.next, lane.output, lane.workspace, lane.ref, lane.chips] : undefined;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
function widgetLaneDetailLines(job: AsyncJobState, theme: Theme, projection?: WorkflowWidgetProjection): string[] {
|
|
589
|
-
if (job.steps?.length && (job.mode === "parallel" || job.mode === "chain")) return [];
|
|
590
|
-
const selectedStep = projection ? laneStepForJob(job, projection.steps) : laneStepForJob(job);
|
|
591
|
-
const lane = projectAsyncLane(job, selectedStep);
|
|
592
|
-
return lane ? formatLaneProjectionLines(lane, theme, " ") : [];
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
function workflowPreflightLines(job: AsyncJobState, expanded = false): string[] {
|
|
596
|
-
if (job.mode !== "workflow" || !job.preflight) return [];
|
|
597
|
-
if (!expanded) {
|
|
598
|
-
const warning = formatWorkflowPreflightWarningSummary(job.workflow?.preflightWarnings, { indent: " ", hint: "expand for debug" });
|
|
599
|
-
return [
|
|
600
|
-
formatWorkflowPreflightPlanSummary(job.preflight, { indent: " " }),
|
|
601
|
-
...(warning ? [warning] : []),
|
|
602
|
-
];
|
|
603
|
-
}
|
|
604
|
-
return [
|
|
605
|
-
...formatWorkflowPreflight(job.preflight, { indent: " " }).split("\n"),
|
|
606
|
-
...(job.workflow?.preflightWarnings ? formatWorkflowPreflightWarnings(job.workflow.preflightWarnings, { indent: " " }).split("\n") : []),
|
|
607
|
-
];
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
function workflowLabelForResult(details: Details, resultIndex: number): string | undefined {
|
|
611
|
-
const flatIndex = foregroundResultIndex(details, resultIndex);
|
|
612
|
-
const visit = (nodes: NonNullable<Details["workflowGraph"]>["nodes"]): string | undefined => {
|
|
613
|
-
for (const node of nodes) {
|
|
614
|
-
if (node.flatIndex === flatIndex && node.label.trim()) return node.label;
|
|
615
|
-
const nested = node.children ? visit(node.children) : undefined;
|
|
616
|
-
if (nested) return nested;
|
|
617
|
-
}
|
|
618
|
-
return undefined;
|
|
619
|
-
};
|
|
620
|
-
return details.workflowGraph ? visit(details.workflowGraph.nodes) : undefined;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
function foregroundProgressForResult(details: Details, resultIndex: number): AgentProgress | undefined {
|
|
624
|
-
const result = details.results[resultIndex];
|
|
625
|
-
if (result?.progress) return result.progress;
|
|
626
|
-
const index = result?.index ?? resultIndex;
|
|
627
|
-
const indexed = details.progress?.find((progress) => progress.index === index);
|
|
628
|
-
if (indexed) return indexed;
|
|
629
|
-
return result?.agent
|
|
630
|
-
? details.progress?.find((progress) => progress.agent === result.agent && progress.status === "running")
|
|
631
|
-
: undefined;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
function foregroundResultIndex(details: Details, resultIndex: number): number {
|
|
635
|
-
const result = details.results[resultIndex];
|
|
636
|
-
if (typeof result?.index === "number") return result.index;
|
|
637
|
-
return foregroundProgressForResult(details, resultIndex)?.index ?? resultIndex;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
function foregroundResultDisplayName(
|
|
641
|
-
details: Details,
|
|
642
|
-
resultIndex: number,
|
|
643
|
-
result: Details["results"][number] | undefined,
|
|
644
|
-
fallback: string,
|
|
645
|
-
): string {
|
|
646
|
-
const progress = foregroundProgressForResult(details, resultIndex);
|
|
647
|
-
const agent = normalizedParallelDisplayText(result?.agent) ?? normalizedParallelDisplayText(progress?.agent);
|
|
648
|
-
const workflowLabel = normalizedParallelDisplayText(workflowLabelForResult(details, resultIndex));
|
|
649
|
-
if (workflowLabel) return compactTaskText(undefined, workflowLabel) ?? workflowLabel;
|
|
650
|
-
|
|
651
|
-
const sessionName = normalizedParallelDisplayText(result?.sessionName) ?? normalizedParallelDisplayText(progress?.sessionName);
|
|
652
|
-
if (sessionName) {
|
|
653
|
-
const sessionTask = stripRepeatedAgentPrefix(sessionName, agent);
|
|
654
|
-
if (sessionTask && sessionTask !== PROMPT_REDACTED && sessionTask.toLowerCase() !== agent?.toLowerCase()) {
|
|
655
|
-
return compactTaskText(sessionTask) ?? sessionTask;
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
return compactTaskText(result?.task) ?? compactTaskText(progress?.task) ?? agent ?? fallback;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
function foregroundSingleDisplayName(result: Details["results"][number] | undefined): string {
|
|
663
|
-
return normalizedParallelDisplayText(result?.agent)
|
|
664
|
-
?? normalizedParallelDisplayText(result?.sessionName)
|
|
665
|
-
?? compactTaskText(result?.task)
|
|
666
|
-
?? "subagent";
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
function hasLiveOutputSignal(line: string): boolean {
|
|
670
|
-
const clean = oneLine(line);
|
|
671
|
-
return liveOutputWordSignalPattern.test(clean) || liveOutputCodeSignalPattern.test(clean);
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
function isNoisyStatusLine(line: string): boolean {
|
|
675
|
-
const clean = oneLine(line);
|
|
676
|
-
return clean.length > 0
|
|
677
|
-
&& clean.length <= 240
|
|
678
|
-
&& !hasLiveOutputSignal(clean)
|
|
679
|
-
&& noisyStatusPatterns.some((pattern) => pattern.test(clean));
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
function latestActivityText(line: string): string {
|
|
683
|
-
return oneLine(line)
|
|
684
|
-
.replace(/^i (?:will|can|need to|am going to)\s+/i, "")
|
|
685
|
-
.replace(/^i(?:'m|’m| am)\s+/i, "");
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
function progressUpdateSummary(lines: string[]): string {
|
|
689
|
-
const counts = new Map<string, number>();
|
|
690
|
-
for (const line of lines) counts.set(line.toLowerCase(), (counts.get(line.toLowerCase()) ?? 0) + 1);
|
|
691
|
-
const exactRepeatCount = Math.max(...counts.values());
|
|
692
|
-
const latest = latestActivityText(lines[lines.length - 1]!);
|
|
693
|
-
const repeat = exactRepeatCount > 1 ? ` · repeated ${exactRepeatCount}×` : "";
|
|
694
|
-
return `↻ ${lines.length} progress updates${repeat} · latest: ${latest}`;
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
function compactRecentOutputLines(recentOutput: string[] | undefined): string[] {
|
|
698
|
-
const lines: string[] = [];
|
|
699
|
-
const noisyLines: string[] = [];
|
|
700
|
-
const otherLines: string[] = [];
|
|
701
|
-
for (const rawLine of recentOutput ?? []) {
|
|
702
|
-
const line = oneLine(rawLine);
|
|
703
|
-
if (!line || line === "(running...)") continue;
|
|
704
|
-
lines.push(line);
|
|
705
|
-
(isNoisyStatusLine(line) ? noisyLines : otherLines).push(line);
|
|
706
|
-
}
|
|
707
|
-
if (noisyLines.length >= 4 && !otherLines.some(hasLiveOutputSignal)) {
|
|
708
|
-
if (otherLines.length === 0) {
|
|
709
|
-
return [
|
|
710
|
-
progressUpdateSummary(noisyLines),
|
|
711
|
-
"pattern: repeated short status lines",
|
|
712
|
-
];
|
|
713
|
-
}
|
|
714
|
-
const visibleTail = otherLines.slice(-3);
|
|
715
|
-
const hiddenSignals = otherLines.slice(0, -3).filter(hasLiveOutputSignal);
|
|
716
|
-
return [
|
|
717
|
-
progressUpdateSummary(noisyLines),
|
|
718
|
-
...(hiddenSignals.length > 0 ? [`… ${hiddenSignals.length} older signal ${hiddenSignals.length === 1 ? "line" : "lines"}: ${hiddenSignals.at(-1)}`] : []),
|
|
719
|
-
...visibleTail,
|
|
720
|
-
].slice(0, 5);
|
|
721
|
-
}
|
|
722
|
-
if (lines.length <= 5) return lines;
|
|
723
|
-
|
|
724
|
-
const tail = lines.slice(-5);
|
|
725
|
-
const hiddenSignals = lines.slice(0, -5).filter(hasLiveOutputSignal);
|
|
726
|
-
if (hiddenSignals.length === 0) return tail;
|
|
727
|
-
return [
|
|
728
|
-
`… ${hiddenSignals.length} older signal ${hiddenSignals.length === 1 ? "line" : "lines"}: ${hiddenSignals.at(-1)}`,
|
|
729
|
-
...lines.slice(-4),
|
|
730
|
-
];
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
function compactWorkflowError(error: string): string {
|
|
734
|
-
const outputMatch = error.match(/(?:^|\n)Output:\s*([\s\S]+)/);
|
|
735
|
-
if (!outputMatch) return oneLine(error);
|
|
736
|
-
const prefix = oneLine(error.slice(0, outputMatch.index)).replace(/:$/, "") || "Failed";
|
|
737
|
-
const outputLines = outputMatch[1]!.split(/\r?\n/).map(oneLine).filter(Boolean);
|
|
738
|
-
const allOutputLinesAreNoisy = outputLines.length > 0 && outputLines.every(isNoisyStatusLine);
|
|
739
|
-
const latest = outputLines.at(-1);
|
|
740
|
-
return allOutputLinesAreNoisy && latest
|
|
741
|
-
? `${prefix} · latest: ${latestActivityText(latest)}`
|
|
742
|
-
: `${prefix} · ${oneLine(outputMatch[1] ?? "")}`;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
const WORKFLOW_LIVE_ROW_LIMIT = 8;
|
|
746
|
-
|
|
747
|
-
function visibleWorkflowRows(rows: WorkflowChatProgressRow[]): { rows: WorkflowChatProgressRow[]; hiddenRows: number } {
|
|
748
|
-
if (rows.length <= WORKFLOW_LIVE_ROW_LIMIT) return { rows, hiddenRows: 0 };
|
|
749
|
-
const selected = new Set<string>();
|
|
750
|
-
const add = (row: WorkflowChatProgressRow): void => {
|
|
751
|
-
if (selected.size >= WORKFLOW_LIVE_ROW_LIMIT || selected.has(row.key)) return;
|
|
752
|
-
selected.add(row.key);
|
|
753
|
-
};
|
|
754
|
-
for (const row of [...rows].reverse()) {
|
|
755
|
-
if (row.state === "failed" || row.state === "detached") add(row);
|
|
756
|
-
}
|
|
757
|
-
for (const row of [...rows].reverse()) add(row);
|
|
758
|
-
return {
|
|
759
|
-
rows: rows.filter((row) => selected.has(row.key)),
|
|
760
|
-
hiddenRows: rows.length - selected.size,
|
|
761
|
-
};
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
function snapshotNowForProgress(progress: Pick<AgentProgress, "currentToolStartedAt" | "durationMs" | "lastActivityAt">): number | undefined {
|
|
765
|
-
if (progress.currentToolStartedAt !== undefined && progress.durationMs !== undefined) return progress.currentToolStartedAt + progress.durationMs;
|
|
766
|
-
return progress.lastActivityAt;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
function renderToolArgsPreview(value: string, maxLength: number, expanded: boolean): string {
|
|
770
|
-
const normalized = sanitizeDisplayText(value);
|
|
771
|
-
if (expanded || normalized.length <= maxLength) return normalized;
|
|
772
|
-
return `${truncateDisplayText(normalized, maxLength)}...`;
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
function formatCurrentToolLine(
|
|
776
|
-
progress: Pick<AgentProgress, "currentTool" | "currentToolArgs" | "currentToolStartedAt">,
|
|
777
|
-
availableWidth: number,
|
|
778
|
-
expanded: boolean,
|
|
779
|
-
snapshotNow?: number,
|
|
780
|
-
): string | undefined {
|
|
781
|
-
if (!progress.currentTool) return undefined;
|
|
782
|
-
const maxToolArgsLen = Math.max(50, availableWidth - 20);
|
|
783
|
-
const toolArgsPreview = progress.currentToolArgs
|
|
784
|
-
? renderToolArgsPreview(progress.currentToolArgs, maxToolArgsLen, expanded)
|
|
785
|
-
: "";
|
|
786
|
-
const durationSuffix = progress.currentToolStartedAt !== undefined && snapshotNow !== undefined
|
|
787
|
-
? ` | ${formatDuration(Math.max(0, snapshotNow - progress.currentToolStartedAt))}`
|
|
788
|
-
: "";
|
|
789
|
-
return toolArgsPreview
|
|
790
|
-
? `${progress.currentTool}: ${toolArgsPreview}${durationSuffix}`
|
|
791
|
-
: `${progress.currentTool}${durationSuffix}`;
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
function buildLiveStatusLine(progress: Pick<AgentProgress, "activityState" | "lastActivityAt">, snapshotNow?: number): string | undefined {
|
|
795
|
-
if (progress.lastActivityAt !== undefined && snapshotNow !== undefined) return formatActivityLabel(progress.lastActivityAt, progress.activityState, snapshotNow);
|
|
796
|
-
if (progress.activityState === "needs_attention") return "needs attention";
|
|
797
|
-
if (progress.activityState === "active_long_running") return "active but long-running";
|
|
798
|
-
if (progress.lastActivityAt !== undefined) return "active";
|
|
799
|
-
return undefined;
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
function themeBold(theme: Theme, text: string): string {
|
|
803
|
-
return ((theme as { bold?: (value: string) => string }).bold?.(text)) ?? text;
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
function statJoin(theme: Theme, parts: string[]): string {
|
|
807
|
-
return parts.filter(Boolean).map((part) => theme.fg("dim", part)).join(` ${theme.fg("dim", "·")} `);
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
function formatTokenStat(tokens: number): string {
|
|
811
|
-
return `${formatTokens(tokens)} token`;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
function formatToolUseStat(count: number): string {
|
|
815
|
-
return `${count} tool use${count === 1 ? "" : "s"}`;
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
function formatTotalCostStat(totalCost: Details["totalCost"] | undefined): string {
|
|
819
|
-
if (!totalCost || (totalCost.inputTokens === 0 && totalCost.outputTokens === 0 && totalCost.costUsd === 0)) return "";
|
|
820
|
-
const parts: string[] = [];
|
|
821
|
-
if (totalCost.inputTokens) parts.push(`in:${formatTokens(totalCost.inputTokens)}`);
|
|
822
|
-
if (totalCost.outputTokens) parts.push(`out:${formatTokens(totalCost.outputTokens)}`);
|
|
823
|
-
if (totalCost.costUsd) parts.push(`$${totalCost.costUsd.toFixed(4)}`);
|
|
824
|
-
return parts.join(" ");
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
function formatProgressStats(theme: Theme, progress: Pick<AgentProgress, "toolCount" | "tokens" | "durationMs"> | undefined, includeDuration = true): string {
|
|
828
|
-
if (!progress) return "";
|
|
829
|
-
const parts: string[] = [];
|
|
830
|
-
if (progress.toolCount > 0) parts.push(formatToolUseStat(progress.toolCount));
|
|
831
|
-
if (progress.tokens > 0) parts.push(formatTokenStat(progress.tokens));
|
|
832
|
-
if (includeDuration && progress.durationMs > 0) parts.push(formatDuration(progress.durationMs));
|
|
833
|
-
return statJoin(theme, parts);
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
function firstOutputLine(text: string): string {
|
|
837
|
-
return text.split("\n").find((line) => line.trim())?.trim() ?? "";
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
function resultStatusLine(result: Details["results"][number], output: string): string {
|
|
841
|
-
if (result.detached) return result.detachedReason ? `Detached: ${result.detachedReason}` : "Detached";
|
|
842
|
-
if (result.stopped) return "Stopped";
|
|
843
|
-
if (result.interrupted) return "Paused";
|
|
844
|
-
if (result.exitCode !== 0) return `Error: ${result.error ?? (firstOutputLine(output) || `exit ${result.exitCode}`)}`;
|
|
845
|
-
if (result.acceptance?.status && result.acceptance.status !== "not-required") return `Done · acceptance: ${result.acceptance.status}`;
|
|
846
|
-
if (hasEmptyTextOutputWithoutOutputTarget(result.task, output)) return "Done (no text output)";
|
|
847
|
-
return "Done";
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
type ResultPresentation = {
|
|
851
|
-
glyph: string;
|
|
852
|
-
label: "running" | "detached" | "stopped" | "paused" | "failed" | "partial" | "completed";
|
|
853
|
-
tone: "accent" | "warning" | "error" | "success";
|
|
854
|
-
};
|
|
855
|
-
|
|
856
|
-
function semanticResultPresentation(input: {
|
|
857
|
-
running?: boolean;
|
|
858
|
-
detached?: boolean;
|
|
859
|
-
stopped?: boolean;
|
|
860
|
-
interrupted?: boolean;
|
|
861
|
-
failed?: boolean;
|
|
862
|
-
partial?: boolean;
|
|
863
|
-
completedWithoutOutput?: boolean;
|
|
864
|
-
seed?: number;
|
|
865
|
-
frame?: number;
|
|
866
|
-
}): ResultPresentation {
|
|
867
|
-
if (input.running) {
|
|
868
|
-
const glyph = input.frame !== undefined ? runningGlyph((input.seed ?? 0) + input.frame) : runningGlyph(input.seed);
|
|
869
|
-
return { glyph, label: "running", tone: "accent" };
|
|
870
|
-
}
|
|
871
|
-
if (input.detached) return { glyph: "■", label: "detached", tone: "warning" };
|
|
872
|
-
if (input.stopped) return { glyph: "■", label: "stopped", tone: "warning" };
|
|
873
|
-
if (input.interrupted) return { glyph: "■", label: "paused", tone: "warning" };
|
|
874
|
-
if (input.failed) return { glyph: "✗", label: "failed", tone: "error" };
|
|
875
|
-
if (input.partial) return { glyph: "■", label: "partial", tone: "warning" };
|
|
876
|
-
return { glyph: "✓", label: "completed", tone: input.completedWithoutOutput ? "warning" : "success" };
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
function hasTerminalResultFlag(result: Details["results"][number]): boolean {
|
|
880
|
-
return Boolean(result.detached || result.stopped || result.interrupted);
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
function hasTerminalResult(result: Details["results"][number]): boolean {
|
|
884
|
-
if (hasTerminalResultFlag(result)) return true;
|
|
885
|
-
const status = result.progress?.status;
|
|
886
|
-
if (status === "running" || status === "pending") return false;
|
|
887
|
-
return result.exitCode !== undefined;
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
function isResultRunning(result: Details["results"][number], status = result.progress?.status): boolean {
|
|
891
|
-
return status === "running" && !hasTerminalResultFlag(result);
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
function detailsHaveRunningResult(details: Details): boolean {
|
|
895
|
-
return details.progress?.some((progress) => {
|
|
896
|
-
if (progress.status !== "running") return false;
|
|
897
|
-
const result = details.results.find((entry) => entry.progress?.index === progress.index) ?? details.results[progress.index];
|
|
898
|
-
return !result || !hasTerminalResultFlag(result);
|
|
899
|
-
})
|
|
900
|
-
|| details.results.some((result) => isResultRunning(result))
|
|
901
|
-
|| workflowGraphHasStatus(details, ["running"]);
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
function resultPresentation(result: Details["results"][number], output: string, running = isResultRunning(result), seed = progressRunningSeed(result.progress ?? result.progressSummary), frame?: number): ResultPresentation {
|
|
905
|
-
return semanticResultPresentation({
|
|
906
|
-
running,
|
|
907
|
-
detached: result.detached,
|
|
908
|
-
stopped: result.stopped,
|
|
909
|
-
interrupted: result.interrupted,
|
|
910
|
-
failed: result.exitCode !== 0,
|
|
911
|
-
completedWithoutOutput: hasEmptyTextOutputWithoutOutputTarget(result.task, output),
|
|
912
|
-
seed,
|
|
913
|
-
frame,
|
|
914
|
-
});
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
function resultGlyph(result: Details["results"][number], output: string, theme: Theme, running = isResultRunning(result), seed = progressRunningSeed(result.progress ?? result.progressSummary), frame?: number): string {
|
|
918
|
-
const presentation = resultPresentation(result, output, running, seed, frame);
|
|
919
|
-
return theme.fg(presentation.tone, presentation.glyph);
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
function styledResultPresentation(presentation: ResultPresentation, theme: Theme): { glyph: string; label: string } {
|
|
923
|
-
return {
|
|
924
|
-
glyph: theme.fg(presentation.tone, presentation.glyph),
|
|
925
|
-
label: theme.fg(presentation.tone, presentation.label),
|
|
926
|
-
};
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
function compactCurrentActivity(progress: AgentProgress): string {
|
|
930
|
-
const snapshotNow = snapshotNowForProgress(progress);
|
|
931
|
-
return formatCurrentToolLine(progress, getTermWidth() - 4, false, snapshotNow) ?? buildLiveStatusLine(progress, snapshotNow) ?? "thinking…";
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
function textDigest(text: string): string {
|
|
935
|
-
return createHash("sha256").update(text).digest("hex").slice(0, 16);
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
function displayTextRenderKey(text: string): unknown[] {
|
|
939
|
-
const normalized = sanitizeDisplayText(text);
|
|
940
|
-
return [normalized.length, textDigest(normalized)];
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
function expandedStepActivityRenderKey(step: AsyncJobStep): unknown[] {
|
|
944
|
-
return [
|
|
945
|
-
step.recentTools?.slice(-3).map((tool) => [tool.tool, displayTextRenderKey(tool.args), tool.endMs]),
|
|
946
|
-
compactRecentOutputLines(step.recentOutput).map(displayTextRenderKey),
|
|
947
|
-
];
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
function widgetStepRenderKey(step: AsyncJobStep, index: number, expanded = false): unknown[] {
|
|
951
|
-
return [
|
|
952
|
-
step.index ?? index,
|
|
953
|
-
step.agent,
|
|
954
|
-
step.sessionName,
|
|
955
|
-
step.workflowKey,
|
|
956
|
-
step.phase,
|
|
957
|
-
step.label,
|
|
958
|
-
step.status,
|
|
959
|
-
step.activityState,
|
|
960
|
-
step.lastActivityAt,
|
|
961
|
-
step.currentTool,
|
|
962
|
-
step.currentToolArgs,
|
|
963
|
-
step.currentToolStartedAt,
|
|
964
|
-
step.currentPath,
|
|
965
|
-
step.turnCount,
|
|
966
|
-
step.toolCount,
|
|
967
|
-
step.startedAt,
|
|
968
|
-
step.endedAt,
|
|
969
|
-
step.durationMs,
|
|
970
|
-
step.tokens?.total,
|
|
971
|
-
step.model,
|
|
972
|
-
step.thinking,
|
|
973
|
-
step.context,
|
|
974
|
-
step.description,
|
|
975
|
-
step.outputName,
|
|
976
|
-
step.structured,
|
|
977
|
-
step.acceptance?.status,
|
|
978
|
-
step.acceptance?.reviewResult?.status,
|
|
979
|
-
step.review?.status,
|
|
980
|
-
step.toolBudgetBlocked,
|
|
981
|
-
step.turnBudgetExceeded,
|
|
982
|
-
step.timedOut,
|
|
983
|
-
step.stopped,
|
|
984
|
-
step.execution?.status,
|
|
985
|
-
step.execution?.error,
|
|
986
|
-
step.execution?.timedOut,
|
|
987
|
-
step.execution?.interrupted,
|
|
988
|
-
step.execution?.stopped,
|
|
989
|
-
step.execution?.detached,
|
|
990
|
-
step.watchdog?.phase,
|
|
991
|
-
step.error,
|
|
992
|
-
expanded ? expandedStepActivityRenderKey(step) : undefined,
|
|
993
|
-
nestedRenderKey(step.children, expanded),
|
|
994
|
-
];
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
function nestedRenderKey(children: NestedRunSummary[] | undefined, expanded = false): unknown[] {
|
|
998
|
-
return (children ?? []).map((child) => [
|
|
999
|
-
child.id,
|
|
1000
|
-
child.state,
|
|
1001
|
-
child.agent,
|
|
1002
|
-
child.sessionName,
|
|
1003
|
-
child.model,
|
|
1004
|
-
child.thinking,
|
|
1005
|
-
child.activityState,
|
|
1006
|
-
child.lastActivityAt,
|
|
1007
|
-
child.currentTool,
|
|
1008
|
-
child.currentToolStartedAt,
|
|
1009
|
-
child.currentPath,
|
|
1010
|
-
child.turnCount,
|
|
1011
|
-
child.toolCount,
|
|
1012
|
-
child.startedAt,
|
|
1013
|
-
child.endedAt,
|
|
1014
|
-
child.lastUpdate,
|
|
1015
|
-
child.error,
|
|
1016
|
-
child.totalTokens?.total,
|
|
1017
|
-
child.steps?.map((step, index) => widgetStepRenderKey({ ...step, agent: step.agent, status: step.status }, index, expanded)),
|
|
1018
|
-
nestedRenderKey(child.children, expanded),
|
|
1019
|
-
]);
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
function hostStepRenderKey(row: AsyncStatusWorkflowRow): unknown[] {
|
|
1023
|
-
return [
|
|
1024
|
-
row.kind,
|
|
1025
|
-
row.name,
|
|
1026
|
-
row.state,
|
|
1027
|
-
row.provider,
|
|
1028
|
-
row.role,
|
|
1029
|
-
row.verdict,
|
|
1030
|
-
row.reasonCode,
|
|
1031
|
-
row.detail,
|
|
1032
|
-
row.target,
|
|
1033
|
-
row.freshness,
|
|
1034
|
-
row.reportPath,
|
|
1035
|
-
];
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
export function widgetRenderKey(job: AsyncJobState, expanded = false): string {
|
|
1039
|
-
const projection = buildWorkflowWidgetProjection(job);
|
|
1040
|
-
return JSON.stringify({
|
|
1041
|
-
asyncDir: job.asyncDir,
|
|
1042
|
-
status: job.status,
|
|
1043
|
-
activityState: job.activityState,
|
|
1044
|
-
lastActivityAt: job.lastActivityAt,
|
|
1045
|
-
currentTool: job.currentTool,
|
|
1046
|
-
currentToolStartedAt: job.currentToolStartedAt,
|
|
1047
|
-
currentPath: job.currentPath,
|
|
1048
|
-
turnCount: job.turnCount,
|
|
1049
|
-
toolCount: job.toolCount,
|
|
1050
|
-
mode: job.mode,
|
|
1051
|
-
agents: job.agents,
|
|
1052
|
-
currentStep: job.currentStep,
|
|
1053
|
-
chainStepCount: job.chainStepCount,
|
|
1054
|
-
parallelGroups: job.parallelGroups,
|
|
1055
|
-
workflowHostSteps: projectAsyncWorkflowRows([], job.hostSteps).map(hostStepRenderKey),
|
|
1056
|
-
workflowGraph: job.mode === "workflow" && job.workflowGraph ? {
|
|
1057
|
-
currentNodeId: job.workflowGraph.currentNodeId,
|
|
1058
|
-
stages: projection.stages.map((node) => [node.id, node.status, node.agent, node.phase, node.label, node.flatIndex, node.outputName, node.structured, node.error]),
|
|
1059
|
-
} : undefined,
|
|
1060
|
-
preflight: expanded ? job.preflight : job.preflight ? formatWorkflowPreflightPlanSummary(job.preflight) : undefined,
|
|
1061
|
-
preflightWarnings: expanded ? job.workflow?.preflightWarnings : job.workflow?.preflightWarnings?.length || undefined,
|
|
1062
|
-
steps: job.steps?.map((step, index) => widgetStepRenderKey(step, index, expanded)),
|
|
1063
|
-
nestedChildren: nestedRenderKey(job.nestedChildren, expanded),
|
|
1064
|
-
lane: laneRenderKey(job, projection),
|
|
1065
|
-
stepsTotal: job.stepsTotal,
|
|
1066
|
-
runningSteps: job.runningSteps,
|
|
1067
|
-
completedSteps: job.completedSteps,
|
|
1068
|
-
activeParallelGroup: job.activeParallelGroup,
|
|
1069
|
-
startedAt: job.startedAt,
|
|
1070
|
-
updatedAt: job.updatedAt,
|
|
1071
|
-
timedOut: job.timedOut,
|
|
1072
|
-
stopped: job.stopped,
|
|
1073
|
-
totalTokens: job.totalTokens,
|
|
1074
|
-
});
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
function formatWidgetAgents(agents: string[]): string {
|
|
1078
|
-
const distinct = [...new Set(agents)];
|
|
1079
|
-
if (distinct.length === 1 && agents.length > 1) return `${distinct[0]} ×${agents.length}`;
|
|
1080
|
-
if (agents.length > 3) return `${agents.slice(0, 2).join(", ")} +${agents.length - 2} more`;
|
|
1081
|
-
return agents.join(", ");
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
function widgetJobName(job: AsyncJobState): string {
|
|
1085
|
-
if (job.mode === "parallel") return "parallel";
|
|
1086
|
-
if (job.mode === "chain") return "chain";
|
|
1087
|
-
if (job.mode === "single" && job.agents?.length === 1) return job.agents[0]!;
|
|
1088
|
-
if (job.agents?.length) return formatWidgetAgents(job.agents);
|
|
1089
|
-
return job.mode ?? "subagent";
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
function isSingleChildAsyncJob(job: AsyncJobState): boolean {
|
|
1093
|
-
return job.mode === "single"
|
|
1094
|
-
&& job.steps?.length === 1
|
|
1095
|
-
&& shouldSuppressSingleStep(job.chainStepCount, job.stepsTotal);
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
function isCompletedWidgetStepStatus(status: AsyncJobStep["status"]): boolean {
|
|
1099
|
-
return status === "complete" || status === "completed";
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
function singleChildAgentName(job: AsyncJobState, step: AsyncJobStep): string {
|
|
1103
|
-
return job.agents?.length === 1 ? job.agents[0]! : step.agent || widgetJobName(job);
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
function hasSingleChildDetailEvidence(job: AsyncJobState, step: AsyncJobStep): boolean {
|
|
1107
|
-
return Boolean(
|
|
1108
|
-
step.error?.trim()
|
|
1109
|
-
|| step.execution?.error?.trim()
|
|
1110
|
-
|| step.phase?.trim()
|
|
1111
|
-
|| step.label?.trim()
|
|
1112
|
-
|| step.workflowKey?.trim()
|
|
1113
|
-
|| step.outputName?.trim()
|
|
1114
|
-
|| step.lane
|
|
1115
|
-
|| job.workflowKey?.trim()
|
|
1116
|
-
|| job.lane
|
|
1117
|
-
|| laneTraceForJob(job)?.phase?.trim()
|
|
1118
|
-
|| laneTraceForJob(job)?.label?.trim()
|
|
1119
|
-
|| step.timedOut
|
|
1120
|
-
|| step.stopped
|
|
1121
|
-
|| step.execution?.timedOut
|
|
1122
|
-
|| step.execution?.interrupted
|
|
1123
|
-
|| step.execution?.stopped
|
|
1124
|
-
|| step.execution?.detached
|
|
1125
|
-
|| job.timedOut
|
|
1126
|
-
|| job.stopped
|
|
1127
|
-
|| ["failed", "partial", "paused", "stopped", "detached"].includes(step.execution?.status ?? "")
|
|
1128
|
-
|| step.acceptance?.status === "rejected"
|
|
1129
|
-
|| step.acceptance?.reviewResult?.status === "blockers"
|
|
1130
|
-
|| step.review?.status === "blockers",
|
|
1131
|
-
);
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
function shouldCollapseSingleChildDetails(job: AsyncJobState, step: AsyncJobStep): boolean {
|
|
1135
|
-
if (!isSingleChildAsyncJob(job) || hasSingleChildDetailEvidence(job, step)) return false;
|
|
1136
|
-
if (job.status === "running") return step.status === "running";
|
|
1137
|
-
if (job.status === "complete") return isCompletedWidgetStepStatus(step.status);
|
|
1138
|
-
return false;
|
|
1139
|
-
}
|
|
1140
|
-
|
|
1141
|
-
function singleChildTask(job: AsyncJobState, step: AsyncJobStep): string | undefined {
|
|
1142
|
-
const task = compactTaskText(step.description, step.label);
|
|
1143
|
-
if (task) return task;
|
|
1144
|
-
const sessionName = step.sessionName?.trim();
|
|
1145
|
-
if (!sessionName) return undefined;
|
|
1146
|
-
const agentName = singleChildAgentName(job, step);
|
|
1147
|
-
const sessionTask = stripRepeatedAgentPrefix(sessionName, agentName);
|
|
1148
|
-
return sessionTask === agentName ? undefined : compactTaskText(sessionTask);
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
function widgetActivity(job: AsyncJobState): string {
|
|
1152
|
-
const facts: string[] = [];
|
|
1153
|
-
if (job.currentTool && job.currentToolStartedAt !== undefined && job.updatedAt !== undefined) facts.push(`${job.currentTool} ${formatDuration(Math.max(0, job.updatedAt - job.currentToolStartedAt))}`);
|
|
1154
|
-
else if (job.currentTool) facts.push(job.currentTool);
|
|
1155
|
-
if (job.currentPath) facts.push(shortenPath(job.currentPath));
|
|
1156
|
-
if (job.turnCount !== undefined) facts.push(`${job.turnCount} turns`);
|
|
1157
|
-
if (job.toolCount !== undefined) facts.push(`${job.toolCount} tools`);
|
|
1158
|
-
const activity = buildLiveStatusLine(job, job.updatedAt);
|
|
1159
|
-
if (activity && facts.length) return `${activity} · ${facts.join(" · ")}`;
|
|
1160
|
-
if (activity) return activity;
|
|
1161
|
-
if (facts.length) return facts.join(" · ");
|
|
1162
|
-
if (job.status === "running") return "thinking…";
|
|
1163
|
-
if (job.status === "queued") return "queued…";
|
|
1164
|
-
if (job.status === "paused") return "Paused";
|
|
1165
|
-
if (job.status === "stopped") return "Stopped";
|
|
1166
|
-
if (job.status === "partial") return "Partial";
|
|
1167
|
-
if (job.status === "failed") return "Failed";
|
|
1168
|
-
return "Done";
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
function widgetStepRunningSeed(step: NonNullable<AsyncJobState["steps"]>[number], fallbackIndex?: number): number | undefined {
|
|
1172
|
-
return runningSeed(
|
|
1173
|
-
fallbackIndex,
|
|
1174
|
-
step.index,
|
|
1175
|
-
step.toolCount,
|
|
1176
|
-
step.turnCount,
|
|
1177
|
-
step.tokens?.total,
|
|
1178
|
-
step.lastActivityAt,
|
|
1179
|
-
step.currentToolStartedAt,
|
|
1180
|
-
step.durationMs,
|
|
1181
|
-
);
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
function widgetStepsRunningSeed(steps: Array<NonNullable<AsyncJobState["steps"]>[number]> | undefined): number | undefined {
|
|
1185
|
-
let seed: number | undefined;
|
|
1186
|
-
for (const [index, step] of (steps ?? []).entries()) seed = runningSeed(seed, widgetStepRunningSeed(step, index));
|
|
1187
|
-
return seed;
|
|
1188
|
-
}
|
|
1189
|
-
|
|
1190
|
-
function widgetJobRunningSeed(job: AsyncJobState): number | undefined {
|
|
1191
|
-
return runningSeed(
|
|
1192
|
-
job.updatedAt,
|
|
1193
|
-
job.lastActivityAt,
|
|
1194
|
-
job.toolCount,
|
|
1195
|
-
job.turnCount,
|
|
1196
|
-
job.totalTokens?.total,
|
|
1197
|
-
job.currentStep,
|
|
1198
|
-
job.runningSteps,
|
|
1199
|
-
job.completedSteps,
|
|
1200
|
-
widgetStepsRunningSeed(job.steps),
|
|
1201
|
-
);
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
function widgetJobsRunningSeed(jobs: AsyncJobState[]): number | undefined {
|
|
1205
|
-
let seed: number | undefined;
|
|
1206
|
-
for (const job of jobs) seed = runningSeed(seed, widgetJobRunningSeed(job));
|
|
1207
|
-
return seed;
|
|
1208
|
-
}
|
|
1209
|
-
|
|
1210
|
-
function widgetStatusGlyph(job: AsyncJobState, theme: Theme, frame?: number): string {
|
|
1211
|
-
if (job.status === "running") return theme.fg("accent", runningGlyph(animatedSeed(widgetJobRunningSeed(job), frame)));
|
|
1212
|
-
if (job.status === "queued") return theme.fg("muted", "◦");
|
|
1213
|
-
if (job.status === "complete") return theme.fg("success", "✓");
|
|
1214
|
-
if (job.status === "paused") return theme.fg("warning", "■");
|
|
1215
|
-
if (job.status === "stopped") return theme.fg("warning", "■");
|
|
1216
|
-
return theme.fg("error", "✗");
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
function widgetStepGlyph(status: AsyncJobStep["status"], theme: Theme, seed?: number, frame?: number): string {
|
|
1220
|
-
if (status === "running") return theme.fg("accent", runningGlyph(animatedSeed(seed, frame)));
|
|
1221
|
-
if (status === "complete" || status === "completed") return theme.fg("success", "✓");
|
|
1222
|
-
if (status === "failed") return theme.fg("error", "✗");
|
|
1223
|
-
if (status === "paused") return theme.fg("warning", "■");
|
|
1224
|
-
if (status === "stopped") return theme.fg("warning", "■");
|
|
1225
|
-
return theme.fg("muted", "◦");
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
function widgetStepStatus(status: AsyncJobStep["status"], theme: Theme): string {
|
|
1229
|
-
if (status === "running") return theme.fg("accent", "running");
|
|
1230
|
-
if (status === "complete" || status === "completed") return theme.fg("success", "complete");
|
|
1231
|
-
if (status === "failed") return theme.fg("error", "failed");
|
|
1232
|
-
if (status === "paused") return theme.fg("warning", "paused");
|
|
1233
|
-
if (status === "stopped") return theme.fg("warning", "stopped");
|
|
1234
|
-
return theme.fg("dim", status);
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
function widgetStepActivity(step: NonNullable<AsyncJobState["steps"]>[number], snapshotNow?: number): string {
|
|
1238
|
-
const facts: string[] = [];
|
|
1239
|
-
if (step.currentTool && step.currentToolStartedAt !== undefined && snapshotNow !== undefined) facts.push(`${step.currentTool} ${formatDuration(Math.max(0, snapshotNow - step.currentToolStartedAt))}`);
|
|
1240
|
-
else if (step.currentTool) facts.push(step.currentTool);
|
|
1241
|
-
if (step.currentPath) facts.push(shortenPath(step.currentPath));
|
|
1242
|
-
if (step.turnCount !== undefined) facts.push(`${step.turnCount} turns`);
|
|
1243
|
-
if (step.toolCount !== undefined) facts.push(`${step.toolCount} tools`);
|
|
1244
|
-
if (step.tokens?.total) facts.push(formatTokenUsage(step.tokens, "token"));
|
|
1245
|
-
const activity = buildLiveStatusLine(step, snapshotNow);
|
|
1246
|
-
if (activity && facts.length) return `${activity} · ${facts.join(" · ")}`;
|
|
1247
|
-
if (activity) return activity;
|
|
1248
|
-
return facts.join(" · ");
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
function widgetChainDetails(job: AsyncJobState, theme: Theme, expanded = false, width = getTermWidth(), frame?: number): string[] {
|
|
1253
|
-
if (!job.steps?.length) return [];
|
|
1254
|
-
const total = job.chainStepCount ?? job.steps.length;
|
|
1255
|
-
const lines: string[] = [];
|
|
1256
|
-
for (const span of buildAsyncChainStepSpans(total, job.steps.length, job.parallelGroups)) {
|
|
1257
|
-
const steps = job.steps.slice(span.start, span.start + span.count);
|
|
1258
|
-
if (span.isParallel) {
|
|
1259
|
-
lines.push(...parallelWidgetGroupDetails(job, theme, { steps, total: span.count, stepIndex: span.stepIndex, chainTotal: total }, expanded, width, frame, false));
|
|
1260
|
-
continue;
|
|
1261
|
-
}
|
|
1262
|
-
const step = steps[0];
|
|
1263
|
-
if (!step) {
|
|
1264
|
-
lines.push(` ${theme.fg("dim", `◦ Step ${span.stepIndex + 1}/${total}: pending`)}`);
|
|
1265
|
-
continue;
|
|
1266
|
-
}
|
|
1267
|
-
lines.push(...foregroundStyleWidgetStepLines(job, theme, step, "Step", span.stepIndex + 1, total, expanded, width, frame));
|
|
1268
|
-
}
|
|
1269
|
-
return lines;
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
function widgetParallelAgentDetails(job: AsyncJobState, theme: Theme, expanded = false, width = getTermWidth(), frame?: number): string[] {
|
|
1273
|
-
if (!job.steps?.length) return [];
|
|
1274
|
-
if (job.mode !== "parallel" && job.mode !== "chain") return [];
|
|
1275
|
-
if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length) return widgetChainDetails(job, theme, expanded, width, frame);
|
|
1276
|
-
const group = activeParallelWidgetGroup(job);
|
|
1277
|
-
if (group) return parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup));
|
|
1278
|
-
const total = job.stepsTotal ?? job.steps.length;
|
|
1279
|
-
const lines: string[] = [];
|
|
1280
|
-
for (const [index, step] of job.steps.entries()) {
|
|
1281
|
-
const marker = index === job.steps.length - 1 ? "└" : "├";
|
|
1282
|
-
const activity = widgetStepActivity(step, job.updatedAt);
|
|
1283
|
-
const itemTitle = job.mode === "parallel" || job.activeParallelGroup ? "Agent" : "Step";
|
|
1284
|
-
const modelDisplay = modelThinkingBadge(theme, step.model, step.thinking);
|
|
1285
|
-
const label = compactTaskText(step.description, step.label);
|
|
1286
|
-
const display = step.sessionName?.trim() || (label ? `${label} (${step.agent})` : step.agent);
|
|
1287
|
-
lines.push(` ${theme.fg("dim", `${marker} ${widgetStepGlyph(step.status, theme, widgetStepRunningSeed(step, index), frame)} ${itemTitle} ${index + 1}/${total}: ${display} · ${widgetStepStatus(step.status, theme)}${modelDisplay}${activity ? ` · ${activity}` : ""}`)}`);
|
|
1288
|
-
const lane = projectAsyncLane(job, step);
|
|
1289
|
-
if (lane) lines.push(...formatLaneProjectionLines(lane, theme, " "));
|
|
1290
|
-
for (const nestedLine of formatNestedWidgetLines(step.children, theme, width, expanded, job.updatedAt, expanded ? 8 : 6)) lines.push(` ${nestedLine}`);
|
|
1291
|
-
}
|
|
1292
|
-
return lines;
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
function parseParallelGroupAgentCount(label: string | undefined): number | undefined {
|
|
1296
|
-
if (!label || !label.startsWith("[") || !label.endsWith("]")) return undefined;
|
|
1297
|
-
const inner = label.slice(1, -1).trim();
|
|
1298
|
-
if (!inner) return 0;
|
|
1299
|
-
return inner.split("+").map((part) => part.trim()).filter(Boolean).length;
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
interface ChainStepSpan {
|
|
1303
|
-
stepIndex: number;
|
|
1304
|
-
start: number;
|
|
1305
|
-
count: number;
|
|
1306
|
-
isParallel: boolean;
|
|
1307
|
-
status?: WorkflowNodeStatus;
|
|
1308
|
-
label?: string;
|
|
1309
|
-
error?: string;
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
function buildChainStepSpans(details: Pick<Details, "chainAgents" | "workflowGraph">): ChainStepSpan[] {
|
|
1313
|
-
if (details.workflowGraph?.nodes?.length) {
|
|
1314
|
-
const spans: ChainStepSpan[] = [];
|
|
1315
|
-
let flatCursor = 0;
|
|
1316
|
-
for (const node of details.workflowGraph.nodes) {
|
|
1317
|
-
if (node.stepIndex === undefined) continue;
|
|
1318
|
-
if (node.kind === "parallel-group" || node.kind === "dynamic-parallel-group") {
|
|
1319
|
-
const childFlatIndexes = (node.children ?? [])
|
|
1320
|
-
.map((child) => child.flatIndex)
|
|
1321
|
-
.filter((value): value is number => typeof value === "number");
|
|
1322
|
-
const start = childFlatIndexes.length ? Math.min(...childFlatIndexes) : flatCursor;
|
|
1323
|
-
const count = node.children?.length ?? 0;
|
|
1324
|
-
spans.push({ stepIndex: node.stepIndex, start, count, isParallel: true, status: node.status, label: node.label, error: node.error });
|
|
1325
|
-
flatCursor = Math.max(flatCursor, start + count);
|
|
1326
|
-
continue;
|
|
1327
|
-
}
|
|
1328
|
-
const start = node.flatIndex ?? flatCursor;
|
|
1329
|
-
spans.push({ stepIndex: node.stepIndex, start, count: 1, isParallel: false, status: node.status, label: node.label, error: node.error });
|
|
1330
|
-
flatCursor = Math.max(flatCursor, start + 1);
|
|
1331
|
-
}
|
|
1332
|
-
if (spans.length) return spans.sort((left, right) => left.stepIndex - right.stepIndex);
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
if (!details.chainAgents?.length) return [];
|
|
1336
|
-
const spans: ChainStepSpan[] = [];
|
|
1337
|
-
let start = 0;
|
|
1338
|
-
for (let stepIndex = 0; stepIndex < details.chainAgents.length; stepIndex++) {
|
|
1339
|
-
const label = details.chainAgents[stepIndex]!;
|
|
1340
|
-
const parsedCount = parseParallelGroupAgentCount(label);
|
|
1341
|
-
const count = parsedCount ?? 1;
|
|
1342
|
-
spans.push({ stepIndex, start, count, isParallel: parsedCount !== undefined });
|
|
1343
|
-
start += count;
|
|
1344
|
-
}
|
|
1345
|
-
return spans;
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1348
|
-
function buildAsyncChainStepSpans(total: number, stepCount: number, parallelGroups: AsyncParallelGroupStatus[] = []): ChainStepSpan[] {
|
|
1349
|
-
const groupsByStep = new Map<number, AsyncParallelGroupStatus>();
|
|
1350
|
-
for (const group of parallelGroups) {
|
|
1351
|
-
if (!groupsByStep.has(group.stepIndex)) groupsByStep.set(group.stepIndex, group);
|
|
1352
|
-
}
|
|
1353
|
-
const spans: ChainStepSpan[] = [];
|
|
1354
|
-
let flatIndex = 0;
|
|
1355
|
-
for (let stepIndex = 0; stepIndex < total; stepIndex++) {
|
|
1356
|
-
const group = groupsByStep.get(stepIndex);
|
|
1357
|
-
if (group) {
|
|
1358
|
-
spans.push({ stepIndex, start: group.start, count: group.count, isParallel: true });
|
|
1359
|
-
flatIndex = Math.max(flatIndex, group.start + group.count);
|
|
1360
|
-
continue;
|
|
1361
|
-
}
|
|
1362
|
-
spans.push({ stepIndex, start: flatIndex, count: flatIndex < stepCount ? 1 : 0, isParallel: false });
|
|
1363
|
-
flatIndex++;
|
|
1364
|
-
}
|
|
1365
|
-
return spans;
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
|
-
interface ParallelWidgetGroup {
|
|
1369
|
-
steps: AsyncJobStep[];
|
|
1370
|
-
total: number;
|
|
1371
|
-
stepIndex?: number;
|
|
1372
|
-
chainTotal?: number;
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1375
|
-
interface ParallelWidgetStepRow {
|
|
1376
|
-
step: AsyncJobStep;
|
|
1377
|
-
index: number;
|
|
1378
|
-
rowLabel: string;
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
|
-
function normalizedParallelDisplayText(value: string | undefined): string | undefined {
|
|
1382
|
-
if (!value?.trim()) return undefined;
|
|
1383
|
-
const normalized = oneLine(value);
|
|
1384
|
-
return normalized && normalized !== PROMPT_REDACTED ? normalized : undefined;
|
|
1385
|
-
}
|
|
1386
|
-
|
|
1387
|
-
function parallelWidgetStepDisplayName(step: AsyncJobStep): string {
|
|
1388
|
-
const agent = normalizedParallelDisplayText(step.agent);
|
|
1389
|
-
const explicitLabel = normalizedParallelDisplayText(step.label);
|
|
1390
|
-
if (explicitLabel) {
|
|
1391
|
-
const label = compactTaskText(step.description, explicitLabel) ?? explicitLabel;
|
|
1392
|
-
return agent ? `${label} (${agent})` : label;
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
const sessionName = normalizedParallelDisplayText(step.sessionName);
|
|
1396
|
-
if (sessionName) {
|
|
1397
|
-
const sessionTask = stripRepeatedAgentPrefix(sessionName, agent);
|
|
1398
|
-
if (sessionTask && sessionTask !== PROMPT_REDACTED && sessionTask.toLowerCase() !== agent?.toLowerCase()) return sessionTask;
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
return compactTaskText(step.description) ?? agent ?? "subagent";
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
function parallelWidgetStepPriority(step: AsyncJobStep): number {
|
|
1405
|
-
if (step.status === "running" || step.activityState === "needs_attention") return 0;
|
|
1406
|
-
switch (step.status) {
|
|
1407
|
-
case "failed":
|
|
1408
|
-
case "rejected":
|
|
1409
|
-
case "partial":
|
|
1410
|
-
case "stopped":
|
|
1411
|
-
case "paused":
|
|
1412
|
-
return 1;
|
|
1413
|
-
case "complete":
|
|
1414
|
-
case "completed":
|
|
1415
|
-
return 2;
|
|
1416
|
-
default:
|
|
1417
|
-
return 3;
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
|
|
1421
|
-
function parallelWidgetStepRows(steps: AsyncJobStep[], total: number, prioritizeActive: boolean): ParallelWidgetStepRow[] {
|
|
1422
|
-
const indexed = steps.map((step, index) => ({ step, index, displayName: parallelWidgetStepDisplayName(step) }));
|
|
1423
|
-
if (prioritizeActive) indexed.sort((left, right) => parallelWidgetStepPriority(left.step) - parallelWidgetStepPriority(right.step) || left.index - right.index);
|
|
1424
|
-
return withDuplicateLabelDiscriminators(indexed, total).map(({ displayName, ...row }) => row);
|
|
1425
|
-
}
|
|
1426
|
-
|
|
1427
|
-
function activeParallelWidgetGroup(job: AsyncJobState): ParallelWidgetGroup | undefined {
|
|
1428
|
-
const steps = job.steps ?? [];
|
|
1429
|
-
if (!steps.length) return undefined;
|
|
1430
|
-
if (job.mode === "parallel") return { steps, total: job.stepsTotal ?? steps.length };
|
|
1431
|
-
if (job.mode !== "chain" || !job.activeParallelGroup) return undefined;
|
|
1432
|
-
|
|
1433
|
-
const chainTotal = job.chainStepCount ?? job.stepsTotal ?? steps.length;
|
|
1434
|
-
const spans = buildAsyncChainStepSpans(chainTotal, steps.length, job.parallelGroups);
|
|
1435
|
-
const currentStep = job.currentStep;
|
|
1436
|
-
const activeSpan = currentStep === undefined
|
|
1437
|
-
? spans.find((span) => span.isParallel)
|
|
1438
|
-
: spans.find((span) => span.isParallel
|
|
1439
|
-
&& currentStep >= span.start
|
|
1440
|
-
&& currentStep < span.start + span.count);
|
|
1441
|
-
return {
|
|
1442
|
-
steps,
|
|
1443
|
-
total: activeSpan?.count ?? job.stepsTotal ?? steps.length,
|
|
1444
|
-
stepIndex: activeSpan?.stepIndex,
|
|
1445
|
-
chainTotal,
|
|
1446
|
-
};
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
|
-
function parallelWidgetGroupHeader(
|
|
1450
|
-
group: ParallelWidgetGroup,
|
|
1451
|
-
theme: Theme,
|
|
1452
|
-
frame?: number,
|
|
1453
|
-
): string {
|
|
1454
|
-
const status = aggregateStepStatus(group.steps);
|
|
1455
|
-
const label = group.stepIndex !== undefined && group.chainTotal !== undefined
|
|
1456
|
-
? `Step ${group.stepIndex + 1}/${group.chainTotal}: parallel group`
|
|
1457
|
-
: "parallel group";
|
|
1458
|
-
return ` ${widgetStepGlyph(status, theme, widgetStepsRunningSeed(group.steps), frame)} ${themeBold(theme, label)} ${theme.fg("dim", "·")} ${theme.fg("dim", formatParallelOutcome(group.steps, group.total))}`;
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
function parallelWidgetGroupDetails(
|
|
1462
|
-
job: AsyncJobState,
|
|
1463
|
-
theme: Theme,
|
|
1464
|
-
group: ParallelWidgetGroup,
|
|
1465
|
-
expanded: boolean,
|
|
1466
|
-
width: number,
|
|
1467
|
-
frame: number | undefined,
|
|
1468
|
-
prioritizeActive: boolean,
|
|
1469
|
-
): string[] {
|
|
1470
|
-
const lines = [parallelWidgetGroupHeader(group, theme, frame)];
|
|
1471
|
-
const rows = parallelWidgetStepRows(group.steps, group.total, prioritizeActive);
|
|
1472
|
-
for (const [rowIndex, row] of rows.entries()) {
|
|
1473
|
-
const marker = rowIndex === rows.length - 1 && rows.length >= group.total ? "└─" : "├─";
|
|
1474
|
-
lines.push(...foregroundStyleWidgetStepLines(job, theme, row.step, "Agent", row.index + 1, group.total, expanded, width, frame, {
|
|
1475
|
-
rowLabel: row.rowLabel,
|
|
1476
|
-
rowIndent: " ",
|
|
1477
|
-
detailIndent: " ",
|
|
1478
|
-
rowMarker: marker,
|
|
1479
|
-
includeCurrentPath: true,
|
|
1480
|
-
}));
|
|
1481
|
-
}
|
|
1482
|
-
for (let index = rows.length; index < group.total; index++) {
|
|
1483
|
-
const marker = index === group.total - 1 ? "└─" : "├─";
|
|
1484
|
-
lines.push(` ${marker} ${theme.fg("muted", "◦")} ${theme.fg("dim", "pending")}`);
|
|
1485
|
-
}
|
|
1486
|
-
return lines;
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
function isDoneResult(result: Details["results"][number]): boolean {
|
|
1490
|
-
const status = result.progress?.status;
|
|
1491
|
-
if (status === "completed") return true;
|
|
1492
|
-
if (status === "running" || status === "pending") return false;
|
|
1493
|
-
if (result.interrupted || result.detached) return false;
|
|
1494
|
-
return result.exitCode === 0;
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
function workflowGraphHasStatus(details: Pick<Details, "workflowGraph">, statuses: WorkflowNodeStatus[]): boolean {
|
|
1498
|
-
return details.workflowGraph?.nodes.some((node) => statuses.includes(node.status)) ?? false;
|
|
1499
|
-
}
|
|
1500
|
-
|
|
1501
|
-
interface ChainRenderResultEntry {
|
|
1502
|
-
kind: "result";
|
|
1503
|
-
resultIndex: number;
|
|
1504
|
-
rowNumber: number;
|
|
1505
|
-
rowLabel?: string;
|
|
1506
|
-
agentName: string;
|
|
1507
|
-
displayIndex: number;
|
|
1508
|
-
isParallel?: boolean;
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
|
-
interface ChainRenderGroupEntry {
|
|
1512
|
-
kind: "group";
|
|
1513
|
-
stepLabel: string;
|
|
1514
|
-
groupLabel?: string;
|
|
1515
|
-
status: WorkflowNodeStatus;
|
|
1516
|
-
error?: string;
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
|
-
type ChainRenderEntry = ChainRenderResultEntry | ChainRenderGroupEntry;
|
|
1520
|
-
|
|
1521
|
-
function chainSpanStatus(details: Details, span: ChainStepSpan): WorkflowNodeStatus {
|
|
1522
|
-
if (span.status) return span.status;
|
|
1523
|
-
const results = details.results.slice(span.start, span.start + span.count);
|
|
1524
|
-
if (results.some((result) => isResultRunning(result))) return "running";
|
|
1525
|
-
if (results.some((result) => !hasTerminalResultFlag(result) && (result.progress?.status === "failed" || result.exitCode !== 0) && !isResultRunning(result))) return "failed";
|
|
1526
|
-
if (results.some((result) => result.stopped)) return "stopped";
|
|
1527
|
-
if (results.some((result) => result.interrupted)) return "paused";
|
|
1528
|
-
if (results.some((result) => result.detached || result.progress?.status === "detached")) return "detached";
|
|
1529
|
-
if (results.length < span.count) return "pending";
|
|
1530
|
-
if (results.length > 0 && results.every(isDoneResult)) return "completed";
|
|
1531
|
-
return "pending";
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
function withDuplicateForegroundLabels(entries: ChainRenderResultEntry[], total: number): ChainRenderResultEntry[] {
|
|
1535
|
-
return withDuplicateLabelDiscriminators(
|
|
1536
|
-
entries.map((entry) => ({ ...entry, index: entry.displayIndex, displayName: entry.agentName })),
|
|
1537
|
-
total,
|
|
1538
|
-
).map(({ displayName, rowLabel, ...entry }) => ({
|
|
1539
|
-
...entry,
|
|
1540
|
-
rowLabel: rowLabel === displayName ? undefined : rowLabel.slice(0, -(displayName.length + 2)),
|
|
1541
|
-
}));
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
function buildChainRenderEntries(details: Details, label: MultiProgressLabel): ChainRenderEntry[] | undefined {
|
|
1545
|
-
if (details.mode !== "chain" || !label.hasParallelInChain || label.showActiveGroupOnly) return undefined;
|
|
1546
|
-
const entries: ChainRenderEntry[] = [];
|
|
1547
|
-
for (const span of buildChainStepSpans(details)) {
|
|
1548
|
-
if (span.isParallel) {
|
|
1549
|
-
entries.push({
|
|
1550
|
-
kind: "group",
|
|
1551
|
-
stepLabel: `Step ${span.stepIndex + 1}/${label.logicalStepCount}: parallel group`,
|
|
1552
|
-
groupLabel: span.label?.trim() || undefined,
|
|
1553
|
-
status: chainSpanStatus(details, span),
|
|
1554
|
-
error: span.error,
|
|
1555
|
-
});
|
|
1556
|
-
const groupEntries: ChainRenderResultEntry[] = [];
|
|
1557
|
-
for (let index = span.start; index < span.start + span.count; index++) {
|
|
1558
|
-
const result = details.results[index];
|
|
1559
|
-
const localIndex = foregroundResultIndex(details, index);
|
|
1560
|
-
const displayIndex = localIndex >= span.start && localIndex < span.start + span.count
|
|
1561
|
-
? localIndex - span.start
|
|
1562
|
-
: index - span.start;
|
|
1563
|
-
groupEntries.push({
|
|
1564
|
-
kind: "result",
|
|
1565
|
-
resultIndex: index,
|
|
1566
|
-
rowNumber: index - span.start + 1,
|
|
1567
|
-
agentName: foregroundResultDisplayName(details, index, result, `agent-${displayIndex + 1}`),
|
|
1568
|
-
displayIndex,
|
|
1569
|
-
isParallel: true,
|
|
1570
|
-
});
|
|
1571
|
-
}
|
|
1572
|
-
entries.push(...withDuplicateForegroundLabels(groupEntries, span.count));
|
|
1573
|
-
continue;
|
|
1574
|
-
}
|
|
1575
|
-
for (let index = span.start; index < span.start + span.count; index++) {
|
|
1576
|
-
const result = details.results[index];
|
|
1577
|
-
entries.push({
|
|
1578
|
-
kind: "result",
|
|
1579
|
-
resultIndex: index,
|
|
1580
|
-
rowNumber: span.stepIndex + 1,
|
|
1581
|
-
rowLabel: resultRowLabel(label, span.stepIndex + 1),
|
|
1582
|
-
agentName: foregroundResultDisplayName(details, index, result, details.chainAgents?.[span.stepIndex] ?? `step-${span.stepIndex + 1}`),
|
|
1583
|
-
displayIndex: foregroundResultIndex(details, index),
|
|
1584
|
-
});
|
|
1585
|
-
}
|
|
1586
|
-
}
|
|
1587
|
-
return entries;
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
|
-
interface MultiProgressLabel {
|
|
1591
|
-
headerLabel: string;
|
|
1592
|
-
itemTitle: "Step" | "Agent";
|
|
1593
|
-
totalCount: number;
|
|
1594
|
-
hasParallelInChain: boolean;
|
|
1595
|
-
activeParallelGroup: boolean;
|
|
1596
|
-
groupStartIndex: number;
|
|
1597
|
-
groupEndIndex: number;
|
|
1598
|
-
showActiveGroupOnly: boolean;
|
|
1599
|
-
logicalStepCount: number;
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
|
-
function buildMultiProgressLabel(details: Pick<Details, "mode" | "results" | "progress" | "totalSteps" | "currentStepIndex" | "chainAgents" | "workflowGraph">, hasRunning: boolean): MultiProgressLabel {
|
|
1603
|
-
const stepSpans = buildChainStepSpans(details);
|
|
1604
|
-
const hasParallelInChain = details.mode === "chain" && stepSpans.some((span) => span.isParallel);
|
|
1605
|
-
const activeParallelGroup = details.mode === "chain"
|
|
1606
|
-
&& details.currentStepIndex !== undefined
|
|
1607
|
-
&& stepSpans.some((span) => span.stepIndex === details.currentStepIndex && span.isParallel);
|
|
1608
|
-
const itemTitle: "Step" | "Agent" = details.mode === "parallel" || activeParallelGroup ? "Agent" : "Step";
|
|
1609
|
-
|
|
1610
|
-
if (details.mode === "parallel") {
|
|
1611
|
-
const totalCount = details.totalSteps ?? details.results.length;
|
|
1612
|
-
const statuses = new Array(totalCount).fill("pending") as Array<"pending" | "running" | "completed" | "failed" | "stopped" | "detached">;
|
|
1613
|
-
for (const progress of details.progress ?? []) {
|
|
1614
|
-
if (progress.index >= 0 && progress.index < totalCount) statuses[progress.index] = progress.status;
|
|
1615
|
-
}
|
|
1616
|
-
for (let i = 0; i < details.results.length; i++) {
|
|
1617
|
-
const result = details.results[i]!;
|
|
1618
|
-
const progressFromArray = details.progress?.find((progress) => progress.index === i)
|
|
1619
|
-
|| details.progress?.find((progress) => progress.agent === result.agent && progress.status === "running");
|
|
1620
|
-
const index = result.progress?.index ?? progressFromArray?.index ?? i;
|
|
1621
|
-
if (index < 0 || index >= totalCount) continue;
|
|
1622
|
-
const status = result.stopped
|
|
1623
|
-
? "stopped"
|
|
1624
|
-
: result.interrupted || result.detached
|
|
1625
|
-
? "detached"
|
|
1626
|
-
: result.progress?.status
|
|
1627
|
-
?? (result.exitCode === 0 ? "completed" : "failed");
|
|
1628
|
-
statuses[index] = status;
|
|
1629
|
-
}
|
|
1630
|
-
const running = statuses.filter((status) => status === "running").length;
|
|
1631
|
-
const done = statuses.filter((status) => status === "completed").length;
|
|
1632
|
-
const headerLabel = hasRunning
|
|
1633
|
-
? `${formatAgentRunningLabel(running)} · ${done}/${totalCount} done`
|
|
1634
|
-
: `${done}/${totalCount} done`;
|
|
1635
|
-
return { headerLabel, itemTitle, totalCount, hasParallelInChain, activeParallelGroup, groupStartIndex: 0, groupEndIndex: totalCount, showActiveGroupOnly: false, logicalStepCount: totalCount };
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1638
|
-
if (activeParallelGroup) {
|
|
1639
|
-
const currentStepIndex = details.currentStepIndex!;
|
|
1640
|
-
const span = stepSpans[currentStepIndex];
|
|
1641
|
-
const groupSize = span?.count ?? 1;
|
|
1642
|
-
const groupStart = span?.start ?? 0;
|
|
1643
|
-
const groupEnd = groupStart + groupSize;
|
|
1644
|
-
let running = 0;
|
|
1645
|
-
let done = 0;
|
|
1646
|
-
for (let index = groupStart; index < groupEnd; index++) {
|
|
1647
|
-
const progressEntry = details.progress?.find((progress) => progress.index === index);
|
|
1648
|
-
const resultEntry = details.results.find((result) => result.progress?.index === index) ?? details.results[index];
|
|
1649
|
-
if (progressEntry?.status === "running" && (!resultEntry || !hasTerminalResultFlag(resultEntry))) {
|
|
1650
|
-
running++;
|
|
1651
|
-
continue;
|
|
1652
|
-
}
|
|
1653
|
-
if (progressEntry?.status === "completed") {
|
|
1654
|
-
done++;
|
|
1655
|
-
continue;
|
|
1656
|
-
}
|
|
1657
|
-
if (resultEntry && isDoneResult(resultEntry)) done++;
|
|
1658
|
-
}
|
|
1659
|
-
const totalSteps = details.totalSteps ?? details.chainAgents?.length ?? 1;
|
|
1660
|
-
const headerLabel = hasRunning
|
|
1661
|
-
? `step ${currentStepIndex + 1}/${totalSteps} · parallel group: ${formatAgentRunningLabel(running)} · ${done}/${groupSize} done`
|
|
1662
|
-
: `step ${currentStepIndex + 1}/${totalSteps} · parallel group: ${done}/${groupSize} done`;
|
|
1663
|
-
return { headerLabel, itemTitle, totalCount: groupSize, hasParallelInChain, activeParallelGroup, groupStartIndex: groupStart, groupEndIndex: groupEnd, showActiveGroupOnly: true, logicalStepCount: totalSteps };
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1666
|
-
if (details.mode === "chain" && details.chainAgents?.length) {
|
|
1667
|
-
const totalCount = details.totalSteps ?? details.chainAgents.length;
|
|
1668
|
-
const doneLogical = stepSpans.filter((span) => {
|
|
1669
|
-
if (span.status && span.status !== "completed") return false;
|
|
1670
|
-
if (span.count === 0) return span.status === "completed";
|
|
1671
|
-
for (let index = span.start; index < span.start + span.count; index++) {
|
|
1672
|
-
const progressEntry = details.progress?.find((progress) => progress.index === index);
|
|
1673
|
-
const resultEntry = details.results.find((result) => result.progress?.index === index) ?? details.results[index];
|
|
1674
|
-
if (progressEntry?.status === "running" || progressEntry?.status === "pending" || progressEntry?.status === "failed") return false;
|
|
1675
|
-
if (!resultEntry || !isDoneResult(resultEntry)) return false;
|
|
1676
|
-
}
|
|
1677
|
-
return true;
|
|
1678
|
-
}).length;
|
|
1679
|
-
const currentStep = details.currentStepIndex !== undefined ? details.currentStepIndex + 1 : Math.min(totalCount, doneLogical + (hasRunning ? 1 : 0));
|
|
1680
|
-
const headerLabel = hasRunning ? `step ${currentStep}/${totalCount}` : `step ${doneLogical}/${totalCount}`;
|
|
1681
|
-
return { headerLabel, itemTitle, totalCount, hasParallelInChain, activeParallelGroup, groupStartIndex: 0, groupEndIndex: details.results.length, showActiveGroupOnly: false, logicalStepCount: totalCount };
|
|
1682
|
-
}
|
|
1683
|
-
|
|
1684
|
-
const totalCount = details.totalSteps ?? details.results.length;
|
|
1685
|
-
const currentStep = details.currentStepIndex !== undefined ? details.currentStepIndex + 1 : Math.min(totalCount, details.results.filter(isDoneResult).length + (hasRunning ? 1 : 0));
|
|
1686
|
-
const done = details.results.filter(isDoneResult).length;
|
|
1687
|
-
const headerLabel = hasRunning ? `step ${currentStep}/${totalCount}` : `step ${done}/${totalCount}`;
|
|
1688
|
-
return { headerLabel, itemTitle, totalCount, hasParallelInChain, activeParallelGroup, groupStartIndex: 0, groupEndIndex: details.results.length, showActiveGroupOnly: false, logicalStepCount: totalCount };
|
|
1689
|
-
}
|
|
1690
|
-
|
|
1691
|
-
function resultRowLabel(label: MultiProgressLabel, stepNumber: number): string | undefined {
|
|
1692
|
-
if (label.itemTitle === "Agent") return undefined;
|
|
1693
|
-
if (shouldSuppressSingleStep(label.logicalStepCount)) return undefined;
|
|
1694
|
-
return `Step ${stepNumber}/${label.logicalStepCount}`;
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
|
-
function buildForegroundResultEntries(
|
|
1698
|
-
details: Details,
|
|
1699
|
-
label: MultiProgressLabel,
|
|
1700
|
-
displayStart: number,
|
|
1701
|
-
displayEnd: number,
|
|
1702
|
-
useResultsDirectly: boolean,
|
|
1703
|
-
): ChainRenderResultEntry[] {
|
|
1704
|
-
const fallbackLabel = label.itemTitle.toLowerCase();
|
|
1705
|
-
const entries = Array.from({ length: displayEnd - displayStart }, (_, offset): ChainRenderResultEntry => {
|
|
1706
|
-
const index = displayStart + offset;
|
|
1707
|
-
const result = details.results[index];
|
|
1708
|
-
const stableIndex = foregroundResultIndex(details, index);
|
|
1709
|
-
const rowNumber = label.showActiveGroupOnly ? index - label.groupStartIndex + 1 : stableIndex + 1;
|
|
1710
|
-
const fallbackAgent = useResultsDirectly
|
|
1711
|
-
? (result?.agent || `${fallbackLabel}-${rowNumber}`)
|
|
1712
|
-
: (details.chainAgents![index] || result?.agent || `${fallbackLabel}-${rowNumber}`);
|
|
1713
|
-
const displayIndex = label.activeParallelGroup && stableIndex >= label.groupStartIndex && stableIndex < label.groupEndIndex
|
|
1714
|
-
? stableIndex - label.groupStartIndex
|
|
1715
|
-
: label.activeParallelGroup ? index - label.groupStartIndex : stableIndex;
|
|
1716
|
-
return {
|
|
1717
|
-
kind: "result",
|
|
1718
|
-
resultIndex: index,
|
|
1719
|
-
rowNumber,
|
|
1720
|
-
rowLabel: resultRowLabel(label, rowNumber),
|
|
1721
|
-
agentName: foregroundResultDisplayName(details, index, result, fallbackAgent),
|
|
1722
|
-
displayIndex,
|
|
1723
|
-
};
|
|
1724
|
-
});
|
|
1725
|
-
return label.itemTitle === "Agent" ? withDuplicateForegroundLabels(entries, label.totalCount) : entries;
|
|
1726
|
-
}
|
|
1727
|
-
|
|
1728
|
-
function widgetStats(job: AsyncJobState, theme: Theme, projection = buildWorkflowWidgetProjection(job)): string {
|
|
1729
|
-
const parts: string[] = [];
|
|
1730
|
-
const { stageProgress } = projection;
|
|
1731
|
-
const stepsTotal = stageProgress?.total ?? job.stepsTotal ?? (job.agents?.length ?? 1);
|
|
1732
|
-
const isSingleChild = isSingleChildAsyncJob(job);
|
|
1733
|
-
if (stageProgress) {
|
|
1734
|
-
const currentStage = stageProgress.current !== undefined ? projection.stages[stageProgress.current] : undefined;
|
|
1735
|
-
const focus = currentStage
|
|
1736
|
-
? [compactTaskText(undefined, currentStage.label) ?? boundedLaneValue(currentStage.id), currentStage.agent ? boundedLaneValue(currentStage.agent) : "", workflowNodeStatusLabel(currentStage.status)].filter(Boolean)
|
|
1737
|
-
: [];
|
|
1738
|
-
parts.push(["staged lane", stageProgress.current !== undefined ? `stage ${stageProgress.current + 1}/${stageProgress.total}` : `${stageProgress.total} stages`, ...focus].join(" · "));
|
|
1739
|
-
} else if (job.activeParallelGroup) {
|
|
1740
|
-
const running = job.runningSteps ?? (job.status === "running" ? 1 : 0);
|
|
1741
|
-
const done = job.completedSteps ?? (job.status === "complete" ? stepsTotal : 0);
|
|
1742
|
-
if (job.mode === "parallel") {
|
|
1743
|
-
if (job.status === "running" && running > 0) parts.push(formatAgentRunningLabel(running));
|
|
1744
|
-
if (stepsTotal > 0) parts.push(`${done}/${stepsTotal} done`);
|
|
1745
|
-
} else {
|
|
1746
|
-
const activeGroup = job.currentStep !== undefined
|
|
1747
|
-
? job.parallelGroups?.find((group) => job.currentStep! >= group.start && job.currentStep! < group.start + group.count)
|
|
1748
|
-
: job.parallelGroups?.find((group) => group.start === 0);
|
|
1749
|
-
const logicalStep = activeGroup?.stepIndex ?? job.currentStep ?? 0;
|
|
1750
|
-
const total = job.chainStepCount ?? stepsTotal;
|
|
1751
|
-
const groupParts = [`${done}/${stepsTotal} done`];
|
|
1752
|
-
if (job.status === "running" && running > 0) groupParts.unshift(formatAgentRunningLabel(running));
|
|
1753
|
-
parts.push(`step ${logicalStep + 1}/${total} · parallel group: ${groupParts.join(" · ")}`);
|
|
1754
|
-
}
|
|
1755
|
-
} else if (job.currentStep !== undefined) {
|
|
1756
|
-
if (job.mode === "chain") {
|
|
1757
|
-
const total = job.chainStepCount ?? stepsTotal;
|
|
1758
|
-
parts.push(`step ${flatToLogicalStepIndex(job.currentStep, total, job.parallelGroups ?? []) + 1}/${total}`);
|
|
1759
|
-
} else if (!isSingleChild) {
|
|
1760
|
-
parts.push(`step ${job.currentStep + 1}/${stepsTotal}`);
|
|
1761
|
-
}
|
|
1762
|
-
} else if (stepsTotal > 1) {
|
|
1763
|
-
parts.push(`steps ${stepsTotal}`);
|
|
1764
|
-
}
|
|
1765
|
-
if (job.toolCount !== undefined) parts.push(formatToolUseStat(job.toolCount));
|
|
1766
|
-
if (job.totalTokens?.total) parts.push(formatTokenUsage(job.totalTokens, "token"));
|
|
1767
|
-
if (job.startedAt !== undefined && job.updatedAt !== undefined) parts.push(formatDuration(Math.max(0, job.updatedAt - job.startedAt)));
|
|
1768
|
-
return statJoin(theme, parts);
|
|
1769
|
-
}
|
|
1770
|
-
|
|
1771
|
-
function widgetStepStats(theme: Theme, step: NonNullable<AsyncJobState["steps"]>[number]): string {
|
|
1772
|
-
return statJoin(theme, [
|
|
1773
|
-
step.turnCount !== undefined ? `${step.turnCount} turns` : "",
|
|
1774
|
-
step.toolCount !== undefined ? formatToolUseStat(step.toolCount) : "",
|
|
1775
|
-
step.tokens
|
|
1776
|
-
? step.contextLimit !== undefined
|
|
1777
|
-
? formatContextUsage(step.tokens, step.contextLimit) ?? formatTokenUsage(step.tokens, "token")
|
|
1778
|
-
: step.tokens.total ? formatTokenUsage(step.tokens, "token") : ""
|
|
1779
|
-
: "",
|
|
1780
|
-
step.durationMs !== undefined ? formatDuration(step.durationMs) : "",
|
|
1781
|
-
]);
|
|
1782
|
-
}
|
|
1783
|
-
|
|
1784
|
-
function modelThinkingBadge(theme: Theme, model?: string, thinking?: string): string {
|
|
1785
|
-
const label = formatModelThinking(model, thinking);
|
|
1786
|
-
return label ? theme.fg("dim", ` (${label})`) : "";
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1789
|
-
function widgetStepActivityLine(step: NonNullable<AsyncJobState["steps"]>[number], width: number, expanded: boolean, snapshotNow?: number): string {
|
|
1790
|
-
const toolLine = formatCurrentToolLine(step, width, expanded, snapshotNow);
|
|
1791
|
-
if (toolLine) return toolLine;
|
|
1792
|
-
const activity = buildLiveStatusLine(step, snapshotNow);
|
|
1793
|
-
if (activity) return activity;
|
|
1794
|
-
if (step.status === "running") return "thinking…";
|
|
1795
|
-
return "";
|
|
1796
|
-
}
|
|
1797
|
-
|
|
1798
|
-
function widgetOutputPath(job: AsyncJobState, step: NonNullable<AsyncJobState["steps"]>[number]): string | undefined {
|
|
1799
|
-
if (typeof step.index !== "number") return undefined;
|
|
1800
|
-
return path.join(job.asyncDir, `output-${step.index}.log`);
|
|
1801
|
-
}
|
|
1802
|
-
|
|
1803
|
-
function nestedRunName(run: NestedRunSummary): string {
|
|
1804
|
-
if (run.sessionName?.trim()) return run.sessionName.trim();
|
|
1805
|
-
if (run.agent) return run.agent;
|
|
1806
|
-
if (run.agents?.length) return formatWidgetAgents(run.agents);
|
|
1807
|
-
return run.id;
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
function nestedStatusGlyph(state: NestedRunSummary["state"] | NestedStepSummary["status"], theme: Theme, seed?: number): string {
|
|
1811
|
-
if (state === "running") return theme.fg("accent", runningGlyph(seed));
|
|
1812
|
-
if (state === "complete" || state === "completed") return theme.fg("success", "✓");
|
|
1813
|
-
if (state === "failed") return theme.fg("error", "✗");
|
|
1814
|
-
if (state === "partial") return theme.fg("warning", "■");
|
|
1815
|
-
if (state === "paused") return theme.fg("warning", "■");
|
|
1816
|
-
if (state === "stopped") return theme.fg("warning", "■");
|
|
1817
|
-
return theme.fg("muted", "◦");
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
function nestedRunSeed(run: NestedRunSummary): number | undefined {
|
|
1821
|
-
return runningSeed(run.lastUpdate, run.lastActivityAt, run.currentStep, run.toolCount, run.turnCount, run.totalTokens?.total, run.currentToolStartedAt);
|
|
1822
|
-
}
|
|
1823
|
-
|
|
1824
|
-
function formatClockTime(ms: number | undefined): string | undefined {
|
|
1825
|
-
if (ms === undefined || !Number.isFinite(ms)) return undefined;
|
|
1826
|
-
const date = new Date(ms);
|
|
1827
|
-
const pad = (value: number) => value.toString().padStart(2, "0");
|
|
1828
|
-
return `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
|
|
1829
|
-
}
|
|
1830
|
-
|
|
1831
|
-
function nestedRunEventTime(run: NestedRunSummary): number | undefined {
|
|
1832
|
-
return run.state === "running"
|
|
1833
|
-
? (run.lastActivityAt ?? run.currentToolStartedAt ?? run.lastUpdate ?? run.startedAt)
|
|
1834
|
-
: (run.endedAt ?? run.lastUpdate ?? run.lastActivityAt ?? run.startedAt);
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
function nestedStepTimestamp(step: NestedStepSummary, fallback?: number): string | undefined {
|
|
1838
|
-
return formatClockTime(step.status === "running"
|
|
1839
|
-
? (step.lastActivityAt ?? step.currentToolStartedAt ?? fallback ?? step.startedAt)
|
|
1840
|
-
: (step.endedAt ?? step.lastActivityAt ?? fallback ?? step.startedAt));
|
|
1841
|
-
}
|
|
1842
|
-
|
|
1843
|
-
function nestedTimestampPrefix(timestamp: string | undefined): string {
|
|
1844
|
-
return timestamp ? `[${timestamp}] ` : "";
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
|
-
function nestedActivity(input: Pick<NestedRunSummary | NestedStepSummary, "activityState" | "lastActivityAt" | "currentTool" | "currentToolStartedAt" | "currentPath" | "turnCount" | "toolCount">, state: NestedRunSummary["state"] | NestedStepSummary["status"], snapshotNow?: number): string {
|
|
1848
|
-
const facts: string[] = [];
|
|
1849
|
-
if (input.currentTool && input.currentToolStartedAt !== undefined && snapshotNow !== undefined) facts.push(`${input.currentTool} ${formatDuration(Math.max(0, snapshotNow - input.currentToolStartedAt))}`);
|
|
1850
|
-
else if (input.currentTool) facts.push(input.currentTool);
|
|
1851
|
-
if (input.currentPath) facts.push(shortenPath(input.currentPath));
|
|
1852
|
-
if (input.turnCount !== undefined) facts.push(`${input.turnCount} turns`);
|
|
1853
|
-
if (input.toolCount !== undefined) facts.push(`${input.toolCount} tools`);
|
|
1854
|
-
const activity = buildLiveStatusLine(input, snapshotNow);
|
|
1855
|
-
if (activity && facts.length) return `${activity} · ${facts.join(" · ")}`;
|
|
1856
|
-
if (activity) return activity;
|
|
1857
|
-
if (facts.length) return facts.join(" · ");
|
|
1858
|
-
if (state === "running") return "thinking…";
|
|
1859
|
-
if (state === "queued" || state === "pending") return "queued…";
|
|
1860
|
-
if (state === "paused") return "Paused";
|
|
1861
|
-
if (state === "stopped") return "Stopped";
|
|
1862
|
-
if (state === "partial") return "Partial";
|
|
1863
|
-
if (state === "failed") return "Failed";
|
|
1864
|
-
return "Done";
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
|
-
function formatNestedWidgetLines(children: NestedRunSummary[] | undefined, theme: Theme, width: number, expanded: boolean, snapshotNow?: number, lineBudget = expanded ? 12 : 1): string[] {
|
|
1868
|
-
if (!children?.length || lineBudget <= 0) return [];
|
|
1869
|
-
if (!expanded) {
|
|
1870
|
-
type CollapsedRow = { text: string; prefix: string };
|
|
1871
|
-
const rows: CollapsedRow[] = [];
|
|
1872
|
-
const maxLeaves = 4;
|
|
1873
|
-
const maxLines = Math.min(6, lineBudget);
|
|
1874
|
-
let leaves = 0;
|
|
1875
|
-
let overflow = 0;
|
|
1876
|
-
const appendLeaf = (step: NestedStepSummary | NestedRunSummary, prefix: string, fallback?: number): void => {
|
|
1877
|
-
if (leaves >= maxLeaves) {
|
|
1878
|
-
overflow++;
|
|
1879
|
-
return;
|
|
1880
|
-
}
|
|
1881
|
-
leaves++;
|
|
1882
|
-
const state = "status" in step ? step.status : step.state;
|
|
1883
|
-
const modelThinking = formatModelThinking(step.model, step.thinking);
|
|
1884
|
-
const activity = nestedActivity(step, state, snapshotNow ?? fallback);
|
|
1885
|
-
const timestamp = "status" in step ? nestedStepTimestamp(step, fallback) : formatClockTime(nestedRunEventTime(step));
|
|
1886
|
-
const error = step.error ? ` · ${step.error}` : "";
|
|
1887
|
-
const name = "status" in step ? childDisplayName(step) : nestedRunName(step);
|
|
1888
|
-
rows.push({
|
|
1889
|
-
prefix,
|
|
1890
|
-
text: `${nestedTimestampPrefix(timestamp)}${nestedStatusGlyph(state, theme)} ${name} · ${state}${modelThinking ? ` · ${modelThinking}` : ""}${activity ? ` · ${activity}` : ""}${error}`,
|
|
1891
|
-
});
|
|
1892
|
-
};
|
|
1893
|
-
for (const child of children) {
|
|
1894
|
-
const steps = (child.mode === "parallel" || child.mode === "chain") ? child.steps ?? [] : [];
|
|
1895
|
-
if (steps.length > 0) {
|
|
1896
|
-
const ownerModelThinking = formatModelThinking(child.model, child.thinking);
|
|
1897
|
-
const ownerActivity = nestedActivity(child, child.state, snapshotNow ?? child.lastUpdate);
|
|
1898
|
-
const ownerError = child.error ? ` · ${child.error}` : "";
|
|
1899
|
-
rows.push({
|
|
1900
|
-
prefix: "↳ ",
|
|
1901
|
-
text: `OWNER ${nestedStatusGlyph(child.state, theme, nestedRunSeed(child))} ${nestedRunName(child)} · ${child.state}${ownerModelThinking ? ` · ${ownerModelThinking}` : ""}${ownerActivity ? ` · ${ownerActivity}` : ""}${ownerError}`,
|
|
1902
|
-
});
|
|
1903
|
-
for (const step of steps) appendLeaf(step, "↳ │ ", child.lastUpdate);
|
|
1904
|
-
} else {
|
|
1905
|
-
appendLeaf(child, "↳ ", child.lastUpdate);
|
|
1906
|
-
}
|
|
1907
|
-
}
|
|
1908
|
-
if (overflow > 0) rows.push({ prefix: "↳ ", text: `… +${overflow} more nested leaves` });
|
|
1909
|
-
const visibleRows = rows.length <= maxLines
|
|
1910
|
-
? rows
|
|
1911
|
-
: overflow > 0
|
|
1912
|
-
? [...rows.slice(0, Math.max(0, maxLines - 1)), rows.at(-1)!]
|
|
1913
|
-
: rows.slice(0, maxLines);
|
|
1914
|
-
return visibleRows.map((row, index) => {
|
|
1915
|
-
const marker = index === visibleRows.length - 1 ? "└─" : "├─";
|
|
1916
|
-
const prefix = row.prefix;
|
|
1917
|
-
const text = row.text.startsWith("OWNER ") ? row.text.slice("OWNER ".length) : row.text;
|
|
1918
|
-
return truncLine(theme.fg("dim", `${prefix}${marker} ${text}`), width);
|
|
1919
|
-
});
|
|
1920
|
-
}
|
|
1921
|
-
const lines: string[] = [];
|
|
1922
|
-
const maxDepth = 2;
|
|
1923
|
-
const append = (items: NestedRunSummary[] | undefined, depth: number, prefix: string): void => {
|
|
1924
|
-
if (!items?.length || lines.length >= lineBudget) return;
|
|
1925
|
-
if (depth > maxDepth) {
|
|
1926
|
-
const aggregate = formatNestedAggregate(items);
|
|
1927
|
-
if (aggregate && lines.length < lineBudget) lines.push(theme.fg("dim", `${prefix}↳ ${aggregate}`));
|
|
1928
|
-
return;
|
|
1929
|
-
}
|
|
1930
|
-
for (let index = 0; index < items.length; index++) {
|
|
1931
|
-
const child = items[index]!;
|
|
1932
|
-
if (lines.length >= lineBudget) {
|
|
1933
|
-
const aggregate = formatNestedAggregate(items.slice(index));
|
|
1934
|
-
if (aggregate) lines[lines.length - 1] = theme.fg("dim", `${prefix}↳ ${aggregate}`);
|
|
1935
|
-
return;
|
|
1936
|
-
}
|
|
1937
|
-
const activity = nestedActivity(child, child.state, snapshotNow ?? child.lastUpdate);
|
|
1938
|
-
const error = child.error ? ` · ${child.error}` : "";
|
|
1939
|
-
const modelThinking = formatModelThinking(child.model, child.thinking);
|
|
1940
|
-
lines.push(theme.fg("dim", `${prefix}↳ ${nestedTimestampPrefix(formatClockTime(nestedRunEventTime(child)))}${nestedStatusGlyph(child.state, theme, nestedRunSeed(child))} ${nestedRunName(child)} · ${child.state}${modelThinking ? ` · ${modelThinking}` : ""} · ${activity}${error}`));
|
|
1941
|
-
if (depth === maxDepth) {
|
|
1942
|
-
const aggregate = formatNestedAggregate([...(child.steps?.flatMap((step) => step.children ?? []) ?? []), ...(child.children ?? [])]);
|
|
1943
|
-
if (aggregate && lines.length < lineBudget) lines.push(theme.fg("dim", `${prefix} ↳ ${aggregate}`));
|
|
1944
|
-
continue;
|
|
1945
|
-
}
|
|
1946
|
-
for (const step of child.steps ?? []) {
|
|
1947
|
-
if (lines.length >= lineBudget) return;
|
|
1948
|
-
const modelThinking = formatModelThinking(step.model, step.thinking);
|
|
1949
|
-
lines.push(theme.fg("dim", `${prefix} ↳ ${nestedTimestampPrefix(nestedStepTimestamp(step, child.lastUpdate))}${nestedStatusGlyph(step.status, theme)} ${childDisplayName(step)} · ${step.status}${modelThinking ? ` · ${modelThinking}` : ""} · ${nestedActivity(step, step.status, snapshotNow ?? child.lastUpdate)}`));
|
|
1950
|
-
append(step.children, depth + 1, `${prefix} `);
|
|
1951
|
-
}
|
|
1952
|
-
append(child.children, depth + 1, `${prefix} `);
|
|
1953
|
-
}
|
|
1954
|
-
};
|
|
1955
|
-
append(children, 0, "");
|
|
1956
|
-
return lines.map((line) => truncLine(line, width));
|
|
1957
|
-
}
|
|
1958
|
-
|
|
1959
|
-
function foregroundStyleWidgetStepLines(
|
|
1960
|
-
job: AsyncJobState,
|
|
1961
|
-
theme: Theme,
|
|
1962
|
-
step: NonNullable<AsyncJobState["steps"]>[number],
|
|
1963
|
-
itemTitle: "Agent" | "Stage" | "Step",
|
|
1964
|
-
index: number,
|
|
1965
|
-
total: number,
|
|
1966
|
-
expanded: boolean,
|
|
1967
|
-
width: number,
|
|
1968
|
-
frame?: number,
|
|
1969
|
-
options?: { rowLabel?: string; rowIndent?: string; detailIndent?: string; rowMarker?: string; includeCurrentPath?: boolean },
|
|
1970
|
-
): string[] {
|
|
1971
|
-
const rowIndent = options?.rowIndent ?? " ";
|
|
1972
|
-
const detailIndent = options?.detailIndent ?? " ";
|
|
1973
|
-
const status = widgetStepStatus(step.status, theme);
|
|
1974
|
-
const stats = widgetStepStats(theme, step);
|
|
1975
|
-
const modelDisplay = modelThinkingBadge(theme, step.model, step.thinking);
|
|
1976
|
-
const collapseDetails = shouldCollapseSingleChildDetails(job, step);
|
|
1977
|
-
const displayName = collapseDetails ? singleChildAgentName(job, step) : childDisplayName(step);
|
|
1978
|
-
const stageName = itemTitle === "Stage"
|
|
1979
|
-
? compactTaskText(undefined, step.label) ?? boundedLaneValue(step.workflowKey) ?? displayName
|
|
1980
|
-
: undefined;
|
|
1981
|
-
const stageIdentity = stageName && stageName !== displayName ? `${stageName} (${displayName})` : stageName ?? displayName;
|
|
1982
|
-
const rowLabel = collapseDetails ? displayName : (options?.rowLabel ?? `${itemTitle} ${index}/${total}: ${itemTitle === "Stage" ? stageIdentity : displayName}`);
|
|
1983
|
-
const rowMarker = options?.rowMarker ? `${options.rowMarker} ` : "";
|
|
1984
|
-
const lines = [`${rowIndent}${rowMarker}${widgetStepGlyph(step.status, theme, widgetStepRunningSeed(step, index - 1), frame)} ${themeBold(theme, rowLabel)}${contextModeBadge(theme, step.context)} ${theme.fg("dim", "·")} ${status}${modelDisplay}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`];
|
|
1985
|
-
const lane = projectAsyncLane(job, step);
|
|
1986
|
-
if (lane) lines.push(...formatLaneProjectionLines(lane, theme, detailIndent));
|
|
1987
|
-
const task = collapseDetails ? singleChildTask(job, step) : compactTaskText(step.description, step.label);
|
|
1988
|
-
if (task) lines.push(`${detailIndent}${theme.fg("dim", `task: ${task}`)}`);
|
|
1989
|
-
const activity = widgetStepActivityLine(step, width, expanded, job.updatedAt);
|
|
1990
|
-
const currentPath = options?.includeCurrentPath && step.currentPath ? shortenPath(step.currentPath) : undefined;
|
|
1991
|
-
const activityWithPath = currentPath && activity && !activity.includes(currentPath)
|
|
1992
|
-
? `${activity} · ${currentPath}`
|
|
1993
|
-
: activity ?? currentPath;
|
|
1994
|
-
if (activityWithPath) lines.push(`${detailIndent}${theme.fg("dim", `⎿ ${activityWithPath}`)}`);
|
|
1995
|
-
for (const nestedLine of formatNestedWidgetLines(step.children, theme, width, expanded, job.updatedAt, expanded ? 12 : 6)) {
|
|
1996
|
-
lines.push(`${detailIndent}${nestedLine}`);
|
|
1997
|
-
}
|
|
1998
|
-
const error = step.error?.trim() || step.execution?.error?.trim();
|
|
1999
|
-
if (error) lines.push(`${detailIndent}${theme.fg("error", `error: ${oneLine(error)}`)}`);
|
|
2000
|
-
if (step.status === "running") {
|
|
2001
|
-
if (!expanded) lines.push(`${detailIndent}${theme.fg("accent", liveDetailHintText())}`);
|
|
2002
|
-
const output = widgetOutputPath(job, step);
|
|
2003
|
-
if (output) lines.push(`${detailIndent}${theme.fg("dim", `output: ${shortenPath(output)}`)}`);
|
|
2004
|
-
if (expanded) {
|
|
2005
|
-
const liveStatus = buildLiveStatusLine(step, job.updatedAt);
|
|
2006
|
-
if (liveStatus && liveStatus !== activity) lines.push(`${detailIndent}${theme.fg("accent", liveStatus)}`);
|
|
2007
|
-
for (const tool of step.recentTools?.slice(-3) ?? []) {
|
|
2008
|
-
const maxArgsLen = Math.max(40, width - 30);
|
|
2009
|
-
const argsPreview = renderToolArgsPreview(tool.args, maxArgsLen, expanded);
|
|
2010
|
-
lines.push(`${detailIndent} ${theme.fg("dim", `${tool.tool}${argsPreview ? `: ${argsPreview}` : ""}`)}`);
|
|
2011
|
-
}
|
|
2012
|
-
for (const line of compactRecentOutputLines(step.recentOutput)) {
|
|
2013
|
-
lines.push(`${detailIndent} ${theme.fg("dim", line)}`);
|
|
2014
|
-
}
|
|
2015
|
-
}
|
|
2016
|
-
}
|
|
2017
|
-
return lines;
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
|
-
function hostStepWidgetLines(job: AsyncJobState, theme: Theme, indent: string): string[] {
|
|
2021
|
-
const rows = projectAsyncWorkflowRows([], job.hostSteps).filter((row) => row.kind);
|
|
2022
|
-
const visible = rows.slice(0, 8);
|
|
2023
|
-
const lines = visible.map((row) => {
|
|
2024
|
-
const state = hostStepVerdictLabel(row.state as HostStepState, row.verdict as HostStepVerdict | undefined);
|
|
2025
|
-
const glyph = state === "running" ? theme.fg("accent", "●")
|
|
2026
|
-
: state === "pending" ? theme.fg("muted", "◦")
|
|
2027
|
-
: state === "pass" ? theme.fg("success", "✓")
|
|
2028
|
-
: state === "fail" || state === "error" ? theme.fg("error", "✗")
|
|
2029
|
-
: theme.fg("warning", "■");
|
|
2030
|
-
const details = [
|
|
2031
|
-
row.provider ? `provider:${row.provider}` : undefined,
|
|
2032
|
-
row.role ? `role:${row.role}` : undefined,
|
|
2033
|
-
row.target,
|
|
2034
|
-
row.detail,
|
|
2035
|
-
row.reasonCode ? `reason:${row.reasonCode}` : undefined,
|
|
2036
|
-
row.freshness?.stale ? "stale" : row.freshness?.observedRef ? `ref:${row.freshness.observedRef}` : undefined,
|
|
2037
|
-
row.reportPath ? `out:${hostStepReportName(row.reportPath)}` : undefined,
|
|
2038
|
-
].filter(Boolean).join(" · ");
|
|
2039
|
-
return `${indent}${glyph} ${row.kind}: ${row.name} · ${state}${details ? ` · ${details}` : ""}`;
|
|
2040
|
-
});
|
|
2041
|
-
if (rows.length > visible.length) lines.push(`${indent}${theme.fg("dim", `… +${rows.length - visible.length} host steps hidden`)}`);
|
|
2042
|
-
return lines;
|
|
2043
|
-
}
|
|
2044
|
-
|
|
2045
|
-
function foregroundStyleWidgetDetails(job: AsyncJobState, theme: Theme, expanded: boolean, width: number, frame?: number, projection = buildWorkflowWidgetProjection(job)): string[] {
|
|
2046
|
-
const { steps } = projection;
|
|
2047
|
-
if (!steps.length) {
|
|
2048
|
-
const lane = projectAsyncLane(job, laneStepForJob(job, steps));
|
|
2049
|
-
return [
|
|
2050
|
-
...workflowPreflightLines(job, expanded),
|
|
2051
|
-
...(lane ? formatLaneProjectionLines(lane, theme, " ") : []),
|
|
2052
|
-
...hostStepWidgetLines(job, theme, " "),
|
|
2053
|
-
` ${theme.fg("dim", `⎿ ${widgetActivity(job)}`)}`,
|
|
2054
|
-
...formatNestedWidgetLines(job.nestedChildren, theme, width, expanded, job.updatedAt, expanded ? 12 : 6).map((line) => ` ${line}`),
|
|
2055
|
-
];
|
|
2056
|
-
}
|
|
2057
|
-
if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length) return widgetChainDetails(job, theme, expanded, width, frame);
|
|
2058
|
-
const lines: string[] = workflowPreflightLines(job, expanded);
|
|
2059
|
-
const group = activeParallelWidgetGroup(job);
|
|
2060
|
-
if (group) {
|
|
2061
|
-
lines.push(...parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup)));
|
|
2062
|
-
} else {
|
|
2063
|
-
const { stageProgress, plannedKeys } = projection;
|
|
2064
|
-
const total = job.mode === "chain"
|
|
2065
|
-
? job.chainStepCount ?? job.stepsTotal ?? steps.length
|
|
2066
|
-
: stageProgress?.total ?? job.stepsTotal ?? steps.length;
|
|
2067
|
-
const stageTotal = stageProgress?.total ?? total;
|
|
2068
|
-
const extraStepCount = plannedKeys
|
|
2069
|
-
? steps.filter((step) => step.workflowKey === undefined || !plannedKeys.has(step.workflowKey)).length
|
|
2070
|
-
: total;
|
|
2071
|
-
let extraStepIndex = 0;
|
|
2072
|
-
for (const [index, step] of steps.entries()) {
|
|
2073
|
-
const isPlannedStage = plannedKeys !== undefined && step.workflowKey !== undefined && plannedKeys.has(step.workflowKey);
|
|
2074
|
-
const itemTitle = isPlannedStage ? "Stage" : "Step";
|
|
2075
|
-
const displayIndex = isPlannedStage ? (step.index ?? index) + 1 : plannedKeys ? ++extraStepIndex : index + 1;
|
|
2076
|
-
const displayTotal = isPlannedStage ? stageTotal : extraStepCount;
|
|
2077
|
-
lines.push(...foregroundStyleWidgetStepLines(job, theme, step, itemTitle, displayIndex, displayTotal, expanded, width, frame));
|
|
2078
|
-
}
|
|
2079
|
-
}
|
|
2080
|
-
lines.push(...hostStepWidgetLines(job, theme, " "));
|
|
2081
|
-
const attached = new Set(steps.flatMap((step) => step.children?.map((child) => child.id) ?? []));
|
|
2082
|
-
const unattached = job.nestedChildren?.filter((child) => !attached.has(child.id)) ?? [];
|
|
2083
|
-
for (const nestedLine of formatNestedWidgetLines(unattached, theme, width, expanded, job.updatedAt, expanded ? 12 : 6)) {
|
|
2084
|
-
lines.push(` ${nestedLine}`);
|
|
2085
|
-
}
|
|
2086
|
-
return lines;
|
|
2087
|
-
}
|
|
2088
|
-
|
|
2089
|
-
function buildSingleWidgetLines(job: AsyncJobState, theme: Theme, width: number, expanded: boolean, frame?: number, projection = buildWorkflowWidgetProjection(job)): string[] {
|
|
2090
|
-
const stats = widgetStats(job, theme, projection);
|
|
2091
|
-
const count = job.mode === "chain" ? job.chainStepCount : projection.stageProgress?.total ?? job.stepsTotal ?? job.agents?.length ?? job.steps?.length;
|
|
2092
|
-
const mode = widgetJobName(job);
|
|
2093
|
-
const title = isSingleChildAsyncJob(job)
|
|
2094
|
-
? "async subagent"
|
|
2095
|
-
: `async subagent ${mode}${count && count > 1 ? ` (${count})` : ""}`;
|
|
2096
|
-
const collapseDetails = job.steps?.length === 1 && shouldCollapseSingleChildDetails(job, job.steps[0]!);
|
|
2097
|
-
const summary = `${widgetStatusGlyph(job, theme, frame)} ${themeBold(theme, mode)}${contextModeBadge(theme, job.context)}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`;
|
|
2098
|
-
return [
|
|
2099
|
-
`${theme.fg("toolTitle", themeBold(theme, title))} ${theme.fg("dim", "· background")}`,
|
|
2100
|
-
...(collapseDetails ? [] : [summary]),
|
|
2101
|
-
...foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projection),
|
|
2102
|
-
].map((line) => truncLine(line, width));
|
|
2103
|
-
}
|
|
2104
|
-
|
|
2105
|
-
function compactSingleWidgetLines(job: AsyncJobState, theme: Theme, width: number, frame?: number, projection = buildWorkflowWidgetProjection(job)): string[] {
|
|
2106
|
-
const fullLines = buildSingleWidgetLines(job, theme, width, false, frame, projection);
|
|
2107
|
-
if (fullLines.length <= 10 || !job.steps?.length || (job.mode !== "parallel" && !job.activeParallelGroup)) return fullLines;
|
|
2108
|
-
|
|
2109
|
-
const group = activeParallelWidgetGroup(job);
|
|
2110
|
-
if (!group) return fullLines;
|
|
2111
|
-
const rows = parallelWidgetStepRows(group.steps, group.total, Boolean(job.activeParallelGroup));
|
|
2112
|
-
const lines = fullLines.slice(0, 2);
|
|
2113
|
-
lines.push(parallelWidgetGroupHeader(group, theme, frame));
|
|
2114
|
-
for (const [rowIndex, row] of rows.entries()) {
|
|
2115
|
-
const step = row.step;
|
|
2116
|
-
const status = widgetStepStatus(step.status, theme);
|
|
2117
|
-
const activity = widgetStepActivityLine(step, width, false, job.updatedAt);
|
|
2118
|
-
const stepStats = widgetStepStats(theme, step);
|
|
2119
|
-
const activitySuffix = activity ? ` ${theme.fg("dim", "·")} ${theme.fg("dim", activity)}` : "";
|
|
2120
|
-
const modelDisplay = modelThinkingBadge(theme, step.model, step.thinking);
|
|
2121
|
-
const task = compactTaskText(step.description, step.label);
|
|
2122
|
-
const taskSuffix = task ? ` ${theme.fg("dim", "·")} ${theme.fg("dim", `task: ${task}`)}` : "";
|
|
2123
|
-
const marker = rowIndex === rows.length - 1 && rowIndex >= group.total - 1 ? "└─" : "├─";
|
|
2124
|
-
lines.push(` ${marker} ${widgetStepGlyph(step.status, theme, widgetStepRunningSeed(step, row.index), frame)} ${themeBold(theme, row.rowLabel)}${contextModeBadge(theme, step.context)} ${theme.fg("dim", "·")} ${status}${modelDisplay}${taskSuffix}${activitySuffix}${stepStats ? ` ${theme.fg("dim", "·")} ${stepStats}` : ""}`);
|
|
2125
|
-
const lane = projectAsyncLane(job, step);
|
|
2126
|
-
if (lane) lines.push(...formatLaneProjectionLines(lane, theme, " "));
|
|
2127
|
-
for (const nestedLine of formatNestedWidgetLines(step.children, theme, width, false, job.updatedAt, 6)) lines.push(` ${nestedLine}`);
|
|
2128
|
-
}
|
|
2129
|
-
lines.push(...hostStepWidgetLines(job, theme, " "));
|
|
2130
|
-
if (job.steps.some((step) => step.status === "running")) lines.push(theme.fg("accent", ` ${liveDetailHintText()}`));
|
|
2131
|
-
return lines.map((line) => truncLine(line, width));
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2134
|
-
type WidgetRenderTier = "full" | "single-line" | "progressive";
|
|
2135
|
-
|
|
2136
|
-
interface WidgetLayoutSession {
|
|
2137
|
-
expanded: boolean;
|
|
2138
|
-
rows: number;
|
|
2139
|
-
columns: number;
|
|
2140
|
-
tier: WidgetRenderTier;
|
|
2141
|
-
lockedRows?: number;
|
|
2142
|
-
visibleJobKeys: string[];
|
|
2143
|
-
}
|
|
2144
|
-
|
|
2145
|
-
const RESERVED_NON_WIDGET_ROWS = 19;
|
|
2146
|
-
|
|
2147
|
-
let widgetLayoutSession: WidgetLayoutSession | undefined;
|
|
2148
|
-
|
|
2149
|
-
function resetWidgetLayoutSession(): void {
|
|
2150
|
-
widgetLayoutSession = undefined;
|
|
2151
|
-
}
|
|
2152
|
-
|
|
2153
|
-
function estimateAvailableWidgetRows(): number {
|
|
2154
|
-
const rows = process.stdout.rows || 30;
|
|
2155
|
-
return Math.max(1, rows - RESERVED_NON_WIDGET_ROWS);
|
|
2156
|
-
}
|
|
2157
|
-
|
|
2158
|
-
function currentTerminalRows(): number {
|
|
2159
|
-
return process.stdout.rows || 30;
|
|
2160
|
-
}
|
|
2161
|
-
|
|
2162
|
-
function currentTerminalColumns(): number {
|
|
2163
|
-
return process.stdout.columns || 120;
|
|
2164
|
-
}
|
|
2165
|
-
|
|
2166
|
-
function widgetSessionMatches(expanded: boolean): boolean {
|
|
2167
|
-
return widgetLayoutSession?.expanded === expanded
|
|
2168
|
-
&& widgetLayoutSession.rows === currentTerminalRows()
|
|
2169
|
-
&& widgetLayoutSession.columns === currentTerminalColumns();
|
|
2170
|
-
}
|
|
2171
|
-
|
|
2172
|
-
function widgetHeaderCounts(jobs: AsyncJobState[]): { running: AsyncJobState[]; queued: AsyncJobState[]; complete: AsyncJobState[]; failed: AsyncJobState[]; paused: AsyncJobState[]; stopped: AsyncJobState[] } {
|
|
2173
|
-
return {
|
|
2174
|
-
running: jobs.filter((job) => job.status === "running"),
|
|
2175
|
-
queued: jobs.filter((job) => job.status === "queued"),
|
|
2176
|
-
complete: jobs.filter((job) => job.status === "complete"),
|
|
2177
|
-
failed: jobs.filter((job) => job.status === "failed"),
|
|
2178
|
-
paused: jobs.filter((job) => job.status === "paused"),
|
|
2179
|
-
stopped: jobs.filter((job) => job.status === "stopped"),
|
|
2180
|
-
};
|
|
2181
|
-
}
|
|
2182
|
-
|
|
2183
|
-
function buildSingleLineWidgetLines(jobs: AsyncJobState[], theme: Theme, width: number, frame?: number): string[] {
|
|
2184
|
-
const counts = widgetHeaderCounts(jobs);
|
|
2185
|
-
const hasActive = counts.running.length > 0 || counts.queued.length > 0;
|
|
2186
|
-
const glyph = counts.running.length > 0 ? runningGlyph(animatedSeed(widgetJobsRunningSeed(counts.running), frame)) : hasActive ? "●" : "○";
|
|
2187
|
-
const parts: string[] = [];
|
|
2188
|
-
if (counts.running.length > 0) parts.push(`${counts.running.length}/${jobs.length} running`);
|
|
2189
|
-
if (counts.queued.length > 0) parts.push(`${counts.queued.length} queued`);
|
|
2190
|
-
if (counts.failed.length > 0) parts.push(`${counts.failed.length} failed`);
|
|
2191
|
-
if (counts.stopped.length > 0) parts.push(`${counts.stopped.length} stopped`);
|
|
2192
|
-
if (counts.paused.length > 0) parts.push(`${counts.paused.length} paused`);
|
|
2193
|
-
if (!hasActive && counts.complete.length > 0) parts.push(`${counts.complete.length}/${jobs.length} done`);
|
|
2194
|
-
return [truncLine(`${theme.fg(hasActive ? "accent" : "dim", glyph)} ${theme.fg(hasActive ? "accent" : "dim", "subagents")} (${parts.join(", ") || `${jobs.length} total`})`, width)];
|
|
2195
|
-
}
|
|
2196
|
-
|
|
2197
|
-
function orderedWidgetJobs(jobs: AsyncJobState[]): AsyncJobState[] {
|
|
2198
|
-
return [
|
|
2199
|
-
...jobs.filter((job) => job.status === "running"),
|
|
2200
|
-
...jobs.filter((job) => job.status === "queued"),
|
|
2201
|
-
...jobs.filter((job) => job.status !== "running" && job.status !== "queued"),
|
|
2202
|
-
];
|
|
2203
|
-
}
|
|
2204
|
-
|
|
2205
|
-
function progressiveJobKey(job: AsyncJobState): string {
|
|
2206
|
-
return job.asyncId;
|
|
2207
|
-
}
|
|
2208
|
-
|
|
2209
|
-
function isProgressiveActiveJob(job: AsyncJobState | undefined): boolean {
|
|
2210
|
-
return job?.status === "running" || job?.status === "queued";
|
|
2211
|
-
}
|
|
2212
|
-
|
|
2213
|
-
function selectProgressiveJobKeys(jobs: AsyncJobState[], previousKeys: string[], bodyRows: number): string[] {
|
|
2214
|
-
if (bodyRows <= 0) return [];
|
|
2215
|
-
const jobsByKey = new Map(jobs.map((job) => [progressiveJobKey(job), job]));
|
|
2216
|
-
const selected: string[] = [];
|
|
2217
|
-
const append = (key: string): void => {
|
|
2218
|
-
if (selected.includes(key) || !jobsByKey.has(key)) return;
|
|
2219
|
-
selected.push(key);
|
|
2220
|
-
};
|
|
2221
|
-
for (const key of previousKeys) {
|
|
2222
|
-
if (!isProgressiveActiveJob(jobsByKey.get(key))) continue;
|
|
2223
|
-
append(key);
|
|
2224
|
-
if (selected.length >= bodyRows) return selected;
|
|
2225
|
-
}
|
|
2226
|
-
for (const job of orderedWidgetJobs(jobs)) {
|
|
2227
|
-
if (!isProgressiveActiveJob(job)) continue;
|
|
2228
|
-
const key = progressiveJobKey(job);
|
|
2229
|
-
append(key);
|
|
2230
|
-
if (selected.length >= bodyRows) break;
|
|
2231
|
-
}
|
|
2232
|
-
if (selected.length >= bodyRows) return selected;
|
|
2233
|
-
for (const key of previousKeys) {
|
|
2234
|
-
if (isProgressiveActiveJob(jobsByKey.get(key))) continue;
|
|
2235
|
-
append(key);
|
|
2236
|
-
if (selected.length >= bodyRows) return selected;
|
|
2237
|
-
}
|
|
2238
|
-
for (const job of orderedWidgetJobs(jobs)) {
|
|
2239
|
-
const key = progressiveJobKey(job);
|
|
2240
|
-
append(key);
|
|
2241
|
-
if (selected.length >= bodyRows) break;
|
|
2242
|
-
}
|
|
2243
|
-
return selected;
|
|
2244
|
-
}
|
|
2245
|
-
|
|
2246
|
-
function progressiveHeaderLine(jobs: AsyncJobState[], theme: Theme, width: number, frame?: number): string {
|
|
2247
|
-
const counts = widgetHeaderCounts(jobs);
|
|
2248
|
-
const hasActive = counts.running.length > 0 || counts.queued.length > 0;
|
|
2249
|
-
const glyph = counts.running.length > 0 ? runningGlyph(animatedSeed(widgetJobsRunningSeed(counts.running), frame)) : hasActive ? "●" : "○";
|
|
2250
|
-
const parts: string[] = [];
|
|
2251
|
-
if (counts.running.length > 0) parts.push(formatAgentRunningLabel(counts.running.length));
|
|
2252
|
-
if (counts.queued.length > 0) parts.push(`${counts.queued.length} queued`);
|
|
2253
|
-
if (!hasActive) {
|
|
2254
|
-
if (counts.failed.length > 0) parts.push(`${counts.failed.length} failed`);
|
|
2255
|
-
if (counts.stopped.length > 0) parts.push(`${counts.stopped.length} stopped`);
|
|
2256
|
-
if (counts.paused.length > 0) parts.push(`${counts.paused.length} paused`);
|
|
2257
|
-
if (counts.complete.length > 0) parts.push(`${counts.complete.length}/${jobs.length} done`);
|
|
2258
|
-
}
|
|
2259
|
-
return truncLine(`${theme.fg(hasActive ? "accent" : "dim", glyph)} ${theme.fg(hasActive ? "accent" : "dim", "Async agents")} ${theme.fg("dim", "·")} ${theme.fg("dim", parts.join(", ") || `${jobs.length} total`)}`, width);
|
|
2260
|
-
}
|
|
2261
|
-
|
|
2262
|
-
function progressiveJobLine(job: AsyncJobState, theme: Theme, width: number, frame?: number, projection = buildWorkflowWidgetProjection(job)): string {
|
|
2263
|
-
const stats = widgetStats(job, theme, projection);
|
|
2264
|
-
const activity = widgetActivity(job);
|
|
2265
|
-
const status = job.status === "complete" ? "done" : job.status;
|
|
2266
|
-
const lane = projectAsyncLane(job, laneStepForJob(job, projection.steps));
|
|
2267
|
-
const laneSummary = lane
|
|
2268
|
-
? [lane.label ?? lane.role, lane.phase ? `phase:${lane.phase}` : undefined, lane.output ? `out:${lane.output}` : undefined, lane.workspace ? `workspace:${lane.workspace}` : `ref:${lane.ref}`].filter(Boolean).join(" · ")
|
|
2269
|
-
: "";
|
|
2270
|
-
const laneSignals = lane
|
|
2271
|
-
? [lane.next ? `next:${lane.next}` : undefined, ...lane.chips.map((chip) => formatLaneChip(chip, theme))].filter(Boolean).join(" · ")
|
|
2272
|
-
: "";
|
|
2273
|
-
const parts = [
|
|
2274
|
-
`${themeBold(theme, widgetJobName(job))}${contextModeBadge(theme, job.context)}`,
|
|
2275
|
-
theme.fg("dim", status),
|
|
2276
|
-
laneSignals ? laneSignals : "",
|
|
2277
|
-
laneSummary ? theme.fg("dim", laneSummary) : "",
|
|
2278
|
-
stats,
|
|
2279
|
-
activity && activity.toLowerCase() !== status ? theme.fg("dim", activity) : "",
|
|
2280
|
-
].filter(Boolean);
|
|
2281
|
-
return truncLine(` ${widgetStatusGlyph(job, theme, frame)} ${parts.join(` ${theme.fg("dim", "·")} `)}`, width);
|
|
2282
|
-
}
|
|
2283
|
-
|
|
2284
|
-
function progressiveHiddenLine(hiddenJobs: AsyncJobState[], theme: Theme, width: number): string {
|
|
2285
|
-
const counts = widgetHeaderCounts(hiddenJobs);
|
|
2286
|
-
const parts: string[] = [];
|
|
2287
|
-
if (counts.running.length > 0) parts.push(`${counts.running.length} running`);
|
|
2288
|
-
if (counts.queued.length > 0) parts.push(`${counts.queued.length} queued`);
|
|
2289
|
-
const finished = counts.complete.length + counts.failed.length + counts.paused.length + counts.stopped.length;
|
|
2290
|
-
if (finished > 0) parts.push(`${finished} finished`);
|
|
2291
|
-
return truncLine(theme.fg("dim", ` +${hiddenJobs.length} more${parts.length ? ` (${parts.join(", ")})` : ""}`), width);
|
|
2292
|
-
}
|
|
2293
|
-
|
|
2294
|
-
function buildProgressiveWidgetLines(jobs: AsyncJobState[], theme: Theme, width: number, lockedRows: number, previousKeys: string[], frame?: number, projectionFor: WorkflowWidgetProjectionLookup = workflowWidgetProjectionLookup()): { lines: string[]; visibleJobKeys: string[] } {
|
|
2295
|
-
const rowCount = Math.max(1, lockedRows);
|
|
2296
|
-
if (rowCount === 1) return { lines: buildSingleLineWidgetLines(jobs, theme, width, frame), visibleJobKeys: [] };
|
|
2297
|
-
|
|
2298
|
-
const bodyRows = rowCount - 1;
|
|
2299
|
-
let visibleJobKeys = selectProgressiveJobKeys(jobs, previousKeys, bodyRows);
|
|
2300
|
-
const jobsByKey = new Map(jobs.map((job) => [progressiveJobKey(job), job]));
|
|
2301
|
-
let visibleJobs = visibleJobKeys.map((key) => jobsByKey.get(key)).filter((job): job is AsyncJobState => Boolean(job));
|
|
2302
|
-
let hiddenJobs = jobs.filter((job) => !visibleJobKeys.includes(progressiveJobKey(job)));
|
|
2303
|
-
const needsHiddenLine = hiddenJobs.length > 0;
|
|
2304
|
-
|
|
2305
|
-
if (needsHiddenLine && visibleJobs.length >= bodyRows && bodyRows > 0) {
|
|
2306
|
-
visibleJobs = visibleJobs.slice(0, bodyRows - 1);
|
|
2307
|
-
visibleJobKeys = visibleJobs.map(progressiveJobKey);
|
|
2308
|
-
hiddenJobs = jobs.filter((job) => !visibleJobKeys.includes(progressiveJobKey(job)));
|
|
2309
|
-
}
|
|
2310
|
-
|
|
2311
|
-
const lines = [
|
|
2312
|
-
progressiveHeaderLine(jobs, theme, width, frame),
|
|
2313
|
-
...visibleJobs.map((job) => progressiveJobLine(job, theme, width, frame, projectionFor(job))),
|
|
2314
|
-
];
|
|
2315
|
-
if (hiddenJobs.length > 0 && lines.length < rowCount) lines.push(progressiveHiddenLine(hiddenJobs, theme, width));
|
|
2316
|
-
while (lines.length < rowCount) lines.push(" ");
|
|
2317
|
-
return { lines: lines.slice(0, rowCount), visibleJobKeys };
|
|
2318
|
-
}
|
|
2319
|
-
|
|
2320
|
-
function collapsedWidgetLineBudget(rows: number): number {
|
|
2321
|
-
return Math.max(10, Math.min(14, Math.floor(rows * 0.35)));
|
|
2322
|
-
}
|
|
2323
|
-
|
|
2324
|
-
function paddedWidgetLine(line: string, width: number): string {
|
|
2325
|
-
if (width <= 2) return " ".repeat(Math.max(0, width));
|
|
2326
|
-
const text = ` ${truncLine(line, width - 2)} `;
|
|
2327
|
-
return `${text}${" ".repeat(Math.max(0, width - visibleWidth(text)))}`;
|
|
2328
|
-
}
|
|
2329
|
-
|
|
2330
|
-
function fitWidgetLineBudget(lines: string[], theme: Theme, width: number, expanded: boolean): string[] {
|
|
2331
|
-
const rows = process.stdout.rows || 30;
|
|
2332
|
-
const budget = expanded
|
|
2333
|
-
? Math.max(12, Math.min(24, Math.floor(rows * 0.55)))
|
|
2334
|
-
: collapsedWidgetLineBudget(rows);
|
|
2335
|
-
if (lines.length <= budget) return lines;
|
|
2336
|
-
const visibleLines = Math.max(1, budget - 1);
|
|
2337
|
-
const hiddenCount = lines.length - visibleLines;
|
|
2338
|
-
const hint = expanded
|
|
2339
|
-
? `… ${hiddenCount} live-detail lines hidden`
|
|
2340
|
-
: `… ${hiddenCount} lines hidden · ${liveDetailKeyText()} expands`;
|
|
2341
|
-
return [...lines.slice(0, visibleLines), truncLine(theme.fg("dim", hint), width)];
|
|
2342
|
-
}
|
|
2343
|
-
|
|
2344
|
-
function fitAdaptiveWidgetLines(jobs: AsyncJobState[], buildLines: () => string[], theme: Theme, width: number, expanded: boolean, frame?: number, projectionFor?: WorkflowWidgetProjectionLookup): string[] {
|
|
2345
|
-
if (expanded) {
|
|
2346
|
-
resetWidgetLayoutSession();
|
|
2347
|
-
return fitWidgetLineBudget(buildLines(), theme, width, true);
|
|
2348
|
-
}
|
|
2349
|
-
|
|
2350
|
-
const hasMatchingSession = widgetSessionMatches(expanded);
|
|
2351
|
-
const rows = currentTerminalRows();
|
|
2352
|
-
const columns = currentTerminalColumns();
|
|
2353
|
-
const availableRows = estimateAvailableWidgetRows();
|
|
2354
|
-
|
|
2355
|
-
if (hasMatchingSession && widgetLayoutSession?.tier === "single-line") {
|
|
2356
|
-
return buildSingleLineWidgetLines(jobs, theme, width, frame);
|
|
2357
|
-
}
|
|
2358
|
-
|
|
2359
|
-
if (hasMatchingSession && widgetLayoutSession?.tier === "progressive" && widgetLayoutSession.lockedRows !== undefined) {
|
|
2360
|
-
const rendered = buildProgressiveWidgetLines(jobs, theme, width, widgetLayoutSession.lockedRows, widgetLayoutSession.visibleJobKeys, frame, projectionFor);
|
|
2361
|
-
widgetLayoutSession.visibleJobKeys = rendered.visibleJobKeys;
|
|
2362
|
-
return rendered.lines;
|
|
2363
|
-
}
|
|
2364
|
-
|
|
2365
|
-
const lines = buildLines();
|
|
2366
|
-
if (lines.length <= availableRows) {
|
|
2367
|
-
widgetLayoutSession = { expanded, rows, columns, tier: "full", visibleJobKeys: [] };
|
|
2368
|
-
return fitWidgetLineBudget(lines, theme, width, false);
|
|
2369
|
-
}
|
|
2370
|
-
if (availableRows > 2 && jobs.length === 1 && projectionFor?.(jobs[0]!).stageProgress) {
|
|
2371
|
-
widgetLayoutSession = { expanded, rows, columns, tier: "full", visibleJobKeys: [] };
|
|
2372
|
-
return fitWidgetLineBudget(lines, theme, width, false);
|
|
2373
|
-
}
|
|
2374
|
-
|
|
2375
|
-
if (availableRows <= 2) {
|
|
2376
|
-
widgetLayoutSession = { expanded, rows, columns, tier: "single-line", visibleJobKeys: [] };
|
|
2377
|
-
return buildSingleLineWidgetLines(jobs, theme, width, frame);
|
|
2378
|
-
}
|
|
2379
|
-
|
|
2380
|
-
const lockedRows = Math.min(availableRows, collapsedWidgetLineBudget(rows));
|
|
2381
|
-
const rendered = buildProgressiveWidgetLines(jobs, theme, width, lockedRows, [], frame, projectionFor);
|
|
2382
|
-
widgetLayoutSession = { expanded, rows, columns, tier: "progressive", lockedRows, visibleJobKeys: rendered.visibleJobKeys };
|
|
2383
|
-
return rendered.lines;
|
|
2384
|
-
}
|
|
2385
|
-
|
|
2386
|
-
function buildWidgetComponent(jobs: AsyncJobState[], isExpanded: () => boolean): (_tui: unknown, theme: Theme) => Component {
|
|
2387
|
-
return (_tui, theme) => {
|
|
2388
|
-
const container = new Container();
|
|
2389
|
-
let cachedRenderWidth: number | undefined;
|
|
2390
|
-
let cachedFrame: number | undefined;
|
|
2391
|
-
let cachedExpanded: boolean | undefined;
|
|
2392
|
-
let cachedLines: string[] | undefined;
|
|
2393
|
-
container.render = (renderWidth: number): string[] => {
|
|
2394
|
-
const frame = Math.floor(Date.now() / WIDGET_ANIMATION_INTERVAL_MS);
|
|
2395
|
-
const expanded = isExpanded();
|
|
2396
|
-
if (cachedLines && cachedRenderWidth === renderWidth && cachedFrame === frame && cachedExpanded === expanded) return cachedLines;
|
|
2397
|
-
const width = Math.max(0, renderWidth - 2);
|
|
2398
|
-
const projectionFor = workflowWidgetProjectionLookup();
|
|
2399
|
-
const buildLines = (): string[] => expanded
|
|
2400
|
-
? buildWidgetLinesWithProjection(jobs, theme, width, true, frame, projectionFor)
|
|
2401
|
-
: jobs.length === 1
|
|
2402
|
-
? compactSingleWidgetLines(jobs[0]!, theme, width, frame, projectionFor(jobs[0]!))
|
|
2403
|
-
: buildWidgetLinesWithProjection(jobs, theme, width, false, frame, projectionFor);
|
|
2404
|
-
cachedRenderWidth = renderWidth;
|
|
2405
|
-
cachedFrame = frame;
|
|
2406
|
-
cachedExpanded = expanded;
|
|
2407
|
-
cachedLines = fitAdaptiveWidgetLines(jobs, buildLines, theme, width, expanded, frame, projectionFor).map((line) => paddedWidgetLine(line, renderWidth));
|
|
2408
|
-
return cachedLines;
|
|
2409
|
-
};
|
|
2410
|
-
return container;
|
|
2411
|
-
};
|
|
2412
|
-
}
|
|
2413
|
-
|
|
2414
|
-
function buildWidgetLinesWithProjection(jobs: AsyncJobState[], theme: Theme, width = getTermWidth(), expanded = false, frame?: number, projectionFor: WorkflowWidgetProjectionLookup = workflowWidgetProjectionLookup()): string[] {
|
|
2415
|
-
if (jobs.length === 0) return [];
|
|
2416
|
-
if (jobs.length === 1) return buildSingleWidgetLines(jobs[0]!, theme, width, expanded, frame, projectionFor(jobs[0]!));
|
|
2417
|
-
const running = jobs.filter((job) => job.status === "running");
|
|
2418
|
-
const queued = jobs.filter((job) => job.status === "queued");
|
|
2419
|
-
const finished = jobs.filter((job) => job.status !== "running" && job.status !== "queued");
|
|
2420
|
-
|
|
2421
|
-
const lines: string[] = [];
|
|
2422
|
-
const hasActive = running.length > 0 || queued.length > 0;
|
|
2423
|
-
const headerGlyph = running.length > 0 ? runningGlyph(animatedSeed(widgetJobsRunningSeed(running), frame)) : hasActive ? "●" : "○";
|
|
2424
|
-
lines.push(truncLine(`${theme.fg(hasActive ? "accent" : "dim", headerGlyph)} ${theme.fg(hasActive ? "accent" : "dim", "Async agents")} ${theme.fg("dim", "· background")}`, width));
|
|
2425
|
-
|
|
2426
|
-
const items: string[][] = [];
|
|
2427
|
-
let hiddenRunning = 0;
|
|
2428
|
-
let hiddenFinished = 0;
|
|
2429
|
-
let queuedSummaryShown = false;
|
|
2430
|
-
let slots = MAX_WIDGET_JOBS;
|
|
2431
|
-
const appendJob = (job: AsyncJobState): void => {
|
|
2432
|
-
const projection = projectionFor(job);
|
|
2433
|
-
const stats = widgetStats(job, theme, projection);
|
|
2434
|
-
items.push([
|
|
2435
|
-
`${widgetStatusGlyph(job, theme, frame)} ${themeBold(theme, widgetJobName(job))}${contextModeBadge(theme, job.context)}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`,
|
|
2436
|
-
` ${theme.fg("dim", `⎿ ${widgetActivity(job)}`)}`,
|
|
2437
|
-
...widgetLaneDetailLines(job, theme, projection),
|
|
2438
|
-
...widgetParallelAgentDetails(job, theme, expanded, width, frame),
|
|
2439
|
-
]);
|
|
2440
|
-
};
|
|
2441
|
-
|
|
2442
|
-
for (const job of running) {
|
|
2443
|
-
if (slots <= 0) { hiddenRunning++; continue; }
|
|
2444
|
-
appendJob(job);
|
|
2445
|
-
slots--;
|
|
2446
|
-
}
|
|
2447
|
-
|
|
2448
|
-
if (queued.length > 0 && slots > 0) {
|
|
2449
|
-
items.push([`${theme.fg("muted", "◦")} ${theme.fg("dim", `${queued.length} queued`)}`]);
|
|
2450
|
-
queuedSummaryShown = true;
|
|
2451
|
-
slots--;
|
|
2452
|
-
}
|
|
2453
|
-
|
|
2454
|
-
for (const job of finished) {
|
|
2455
|
-
if (slots <= 0) { hiddenFinished++; continue; }
|
|
2456
|
-
appendJob(job);
|
|
2457
|
-
slots--;
|
|
2458
|
-
}
|
|
2459
|
-
|
|
2460
|
-
const hiddenQueued = queued.length > 0 && !queuedSummaryShown ? queued.length : 0;
|
|
2461
|
-
const hiddenTotal = hiddenRunning + hiddenFinished + hiddenQueued;
|
|
2462
|
-
if (hiddenTotal > 0) {
|
|
2463
|
-
const parts: string[] = [];
|
|
2464
|
-
if (hiddenRunning > 0) parts.push(`${hiddenRunning} running`);
|
|
2465
|
-
if (hiddenQueued > 0) parts.push(`${hiddenQueued} queued`);
|
|
2466
|
-
if (hiddenFinished > 0) parts.push(`${hiddenFinished} finished`);
|
|
2467
|
-
items.push([theme.fg("dim", `+${hiddenTotal} more (${parts.join(", ")})`)]);
|
|
2468
|
-
}
|
|
2469
|
-
|
|
2470
|
-
for (let i = 0; i < items.length; i++) {
|
|
2471
|
-
const item = items[i]!;
|
|
2472
|
-
const last = i === items.length - 1;
|
|
2473
|
-
const branch = last ? "└─" : "├─";
|
|
2474
|
-
const continuation = last ? " " : "│ ";
|
|
2475
|
-
lines.push(truncLine(`${theme.fg("dim", branch)} ${item[0]}`, width));
|
|
2476
|
-
for (const detail of item.slice(1)) {
|
|
2477
|
-
lines.push(truncLine(`${theme.fg("dim", continuation)} ${detail}`, width));
|
|
2478
|
-
}
|
|
2479
|
-
}
|
|
2480
|
-
|
|
2481
|
-
return lines;
|
|
2482
|
-
}
|
|
2483
|
-
|
|
2484
|
-
export function buildWidgetLines(jobs: AsyncJobState[], theme: Theme, width = getTermWidth(), expanded = false, frame?: number): string[] {
|
|
2485
|
-
return buildWidgetLinesWithProjection(jobs, theme, width, expanded, frame);
|
|
2486
|
-
}
|
|
2487
|
-
|
|
2488
|
-
/**
|
|
2489
|
-
* Render the async jobs widget
|
|
2490
|
-
*/
|
|
2491
|
-
export function renderWidget(ctx: ExtensionContext, jobs: AsyncJobState[]): void {
|
|
2492
|
-
if (jobs.length === 0) {
|
|
2493
|
-
resetWidgetLayoutSession();
|
|
2494
|
-
if (ctx.hasUI) ctx.ui.setWidget(WIDGET_KEY, undefined);
|
|
2495
|
-
return;
|
|
2496
|
-
}
|
|
2497
|
-
if (!ctx.hasUI) return;
|
|
2498
|
-
if ((ctx as { mode?: string }).mode === "rpc") {
|
|
2499
|
-
ctx.ui.setWidget(WIDGET_KEY, encodeAsyncStatusSnapshotWidget(jobs));
|
|
2500
|
-
return;
|
|
2501
|
-
}
|
|
2502
|
-
ctx.ui.setWidget(WIDGET_KEY, buildWidgetComponent(jobs, () => ctx.ui.getToolsExpanded?.() ?? false));
|
|
2503
|
-
}
|
|
2504
|
-
|
|
2505
|
-
function renderSingleCompact(
|
|
2506
|
-
d: Details,
|
|
2507
|
-
r: Details["results"][number],
|
|
2508
|
-
theme: Theme,
|
|
2509
|
-
layout: MainWindowRenderLayout,
|
|
2510
|
-
frame?: number,
|
|
2511
|
-
foregroundDetachShortcut?: string,
|
|
2512
|
-
): Component {
|
|
2513
|
-
const output = r.truncation?.text || getSingleResultOutput(r);
|
|
2514
|
-
const progress = r.progress || r.progressSummary;
|
|
2515
|
-
const isRunning = isResultRunning(r);
|
|
2516
|
-
const contextBadge = contextModeBadge(theme, r.context ?? d.context);
|
|
2517
|
-
const stats = statJoin(theme, [
|
|
2518
|
-
r.usage?.turns ? `⟳ ${r.usage.turns}` : "",
|
|
2519
|
-
formatProgressStats(theme, progress),
|
|
2520
|
-
]);
|
|
2521
|
-
const c = new Container();
|
|
2522
|
-
const width = getTermWidth() - 4;
|
|
2523
|
-
const detailIndent = mainWindowIndent(layout, 1);
|
|
2524
|
-
const continuationIndent = mainWindowIndent(layout, 2) + (layout.horizontalSpacing > 0 ? " " : "");
|
|
2525
|
-
const modelDisplay = modelThinkingBadge(theme, r.model ?? r.progress?.model, r.thinking ?? r.progress?.thinking);
|
|
2526
|
-
c.addChild(new Text(truncLine(`${resultGlyph(r, output, theme, isRunning, undefined, frame)} ${theme.fg("toolTitle", theme.bold(foregroundSingleDisplayName(r)))}${modelDisplay}${contextBadge}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`, width), 0, 0));
|
|
2527
|
-
|
|
2528
|
-
if (isRunning && r.progress) {
|
|
2529
|
-
const task = compactTaskText(r.task);
|
|
2530
|
-
if (task) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}task: ${task}`), width), 0, 0));
|
|
2531
|
-
const progressSnapshotNow = snapshotNowForProgress(r.progress);
|
|
2532
|
-
const activity = compactCurrentActivity(r.progress);
|
|
2533
|
-
c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}⎿ ${activity}`), width), 0, 0));
|
|
2534
|
-
const liveStatus = buildLiveStatusLine(r.progress, progressSnapshotNow);
|
|
2535
|
-
if (liveStatus && liveStatus !== activity) c.addChild(new Text(truncLine(theme.fg("dim", `${continuationIndent}${liveStatus}`), width), 0, 0));
|
|
2536
|
-
for (const nestedLine of formatNestedWidgetLines(r.children, theme, width, false, progressSnapshotNow)) {
|
|
2537
|
-
c.addChild(new Text(truncLine(`${detailIndent}${nestedLine}`, width), 0, 0));
|
|
2538
|
-
}
|
|
2539
|
-
c.addChild(new Text(truncLine(theme.fg("accent", `${detailIndent}${foregroundSingleHintText(foregroundDetachShortcut)}`), width), 0, 0));
|
|
2540
|
-
if (r.artifactPaths) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}output: ${shortenPath(r.artifactPaths.outputPath)}`), width), 0, 0));
|
|
2541
|
-
return c;
|
|
2542
|
-
}
|
|
2543
|
-
|
|
2544
|
-
for (const nestedLine of formatNestedWidgetLines(r.children, theme, width, false, r.progress?.lastActivityAt)) {
|
|
2545
|
-
c.addChild(new Text(truncLine(`${detailIndent}${nestedLine}`, width), 0, 0));
|
|
2546
|
-
}
|
|
2547
|
-
c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}⎿ ${resultStatusLine(r, output)}`), width), 0, 0));
|
|
2548
|
-
const preview = firstOutputLine(output);
|
|
2549
|
-
if (preview && r.exitCode === 0 && !hasEmptyTextOutputWithoutOutputTarget(r.task, output)) {
|
|
2550
|
-
c.addChild(new Text(truncLine(theme.fg("dim", `${continuationIndent}${preview}`), width), 0, 0));
|
|
2551
|
-
}
|
|
2552
|
-
if (r.sessionFile) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}session: ${shortenPath(r.sessionFile)}`), width), 0, 0));
|
|
2553
|
-
if (r.artifactPaths) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}output: ${shortenPath(r.artifactPaths.outputPath)}`), width), 0, 0));
|
|
2554
|
-
if (r.truncation?.artifactPath) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}full output: ${shortenPath(r.truncation.artifactPath)}`), width), 0, 0));
|
|
2555
|
-
return c;
|
|
2556
|
-
}
|
|
2557
|
-
|
|
2558
|
-
function workflowRowGlyph(row: WorkflowChatProgressRow, theme: Theme, frame?: number): string {
|
|
2559
|
-
if (row.state === "planned") return theme.fg("muted", "◦");
|
|
2560
|
-
if (row.state === "running") return theme.fg("accent", runningGlyph(frame));
|
|
2561
|
-
if (row.state === "complete") return theme.fg("success", "✓");
|
|
2562
|
-
if (row.state === "detached" || row.state === "stopped") return theme.fg("warning", "■");
|
|
2563
|
-
return theme.fg("error", "✗");
|
|
2564
|
-
}
|
|
2565
|
-
|
|
2566
|
-
function workflowRowStateLabel(row: WorkflowChatProgressRow, theme: Theme): string {
|
|
2567
|
-
const label = (row.state === "complete" ? "complete" : row.state).padEnd(8);
|
|
2568
|
-
if (row.state === "planned") return theme.fg("dim", label);
|
|
2569
|
-
if (row.state === "running") return theme.fg("accent", label);
|
|
2570
|
-
if (row.state === "complete") return theme.fg("success", label);
|
|
2571
|
-
if (row.state === "detached" || row.state === "stopped") return theme.fg("warning", label);
|
|
2572
|
-
return theme.fg("error", label);
|
|
2573
|
-
}
|
|
2574
|
-
|
|
2575
|
-
function workflowOverallState(rows: WorkflowChatProgressRow[], hasTerminalValue: boolean, isError?: boolean): "running" | "complete" | "failed" | "paused" {
|
|
2576
|
-
if (rows.some((row) => row.state === "failed")) return "failed";
|
|
2577
|
-
if (rows.some((row) => row.state === "detached")) return "paused";
|
|
2578
|
-
if (isError) return "failed";
|
|
2579
|
-
if ((rows.length > 0 && rows.every((row) => row.state === "complete")) || hasTerminalValue) return "complete";
|
|
2580
|
-
return "running";
|
|
2581
|
-
}
|
|
2582
|
-
|
|
2583
|
-
function renderWorkflowChatProgress(d: Details, result: AgentToolResult<Details>, theme: Theme, layout: MainWindowRenderLayout, frame?: number, expanded = false): Component {
|
|
2584
|
-
const workflow = d.workflow;
|
|
2585
|
-
const rows = workflow ? buildWorkflowChatProgressRows(workflow.trace, d.preflight) : d.preflight ? buildWorkflowChatProgressRows([], d.preflight) : [];
|
|
2586
|
-
const state = workflowOverallState(rows, workflow?.value !== undefined, result.isError);
|
|
2587
|
-
const glyph = state === "running" ? theme.fg("accent", runningGlyph(frame)) : state === "complete" ? theme.fg("success", "✓") : state === "paused" ? theme.fg("warning", "■") : theme.fg("error", "✗");
|
|
2588
|
-
const width = getTermWidth() - 4;
|
|
2589
|
-
const runId = d.runId ? d.runId.slice(0, 12) : "workflow";
|
|
2590
|
-
const repoLabel = d.chatProgress?.repoLabel ?? (d.chatProgress?.repoRelation === "same" ? "same repo" : "other repo");
|
|
2591
|
-
const phase = rows.find((row) => row.state === "running" && row.phase)?.phase ?? [...rows].reverse().find((row) => row.phase)?.phase;
|
|
2592
|
-
const c = new Container();
|
|
2593
|
-
const rowIndent = mainWindowIndent(layout, 1);
|
|
2594
|
-
c.addChild(new Text(truncLine(`${glyph} ${theme.fg("toolTitle", theme.bold("workflow"))} ${runId} ${theme.fg("dim", "·")} ${d.chatProgress?.repoRelation === "same" ? "same repo" : "other repo"} ${theme.fg("dim", "·")} ${state}`, width), 0, 0));
|
|
2595
|
-
c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}Repo ${repoLabel}`), width), 0, 0));
|
|
2596
|
-
if (d.preflight) c.addChild(new Text(truncLine(theme.fg("dim", formatWorkflowPreflightPlanSummary(d.preflight, { indent: rowIndent })), width), 0, 0));
|
|
2597
|
-
if (phase) c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}Phase ${phase}`), width), 0, 0));
|
|
2598
|
-
if (rows.length === 0) {
|
|
2599
|
-
c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}◦ waiting for workflow child launches`), width), 0, 0));
|
|
2600
|
-
return c;
|
|
2601
|
-
}
|
|
2602
|
-
const visible = visibleWorkflowRows(rows);
|
|
2603
|
-
if (visible.hiddenRows > 0) c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}… ${visible.hiddenRows} older workflow rows hidden`), width), 0, 0));
|
|
2604
|
-
for (const row of visible.rows) {
|
|
2605
|
-
const status = workflowRowStateLabel(row, theme);
|
|
2606
|
-
const label = row.label && row.label !== row.key ? ` ${oneLine(row.label)}` : "";
|
|
2607
|
-
const duration = row.durationMs !== undefined ? ` ${theme.fg("dim", `· ${formatDuration(row.durationMs)}`)}` : "";
|
|
2608
|
-
const run = row.runId ? ` ${theme.fg("dim", `[${row.runId.slice(0, 8)}]`)}` : "";
|
|
2609
|
-
const error = row.error ? ` ${theme.fg(row.state === "detached" ? "warning" : "error", `· ${compactWorkflowError(row.error)}`)}` : "";
|
|
2610
|
-
const hints = expanded && row.preflight ? [
|
|
2611
|
-
row.preflight.mode ? `mode:${row.preflight.mode}` : undefined,
|
|
2612
|
-
row.preflight.decision ? `decision:${row.preflight.decision}` : undefined,
|
|
2613
|
-
row.preflight.claims?.length ? `claims:${row.preflight.claims.join(",")}` : undefined,
|
|
2614
|
-
row.preflight.expectedOutput ? `expected:${row.preflight.expectedOutput}` : undefined,
|
|
2615
|
-
row.preflight.independence ? `independence:${row.preflight.independence}` : undefined,
|
|
2616
|
-
].filter((value): value is string => Boolean(value)).join(" · ") : "";
|
|
2617
|
-
c.addChild(new Text(truncLine(`${rowIndent}${workflowRowGlyph(row, theme, frame)} ${status} ${theme.bold(row.key)}${label}${run}${duration}${error}${hints ? ` ${theme.fg("dim", `· ${hints}`)}` : ""}`, width), 0, 0));
|
|
2618
|
-
}
|
|
2619
|
-
if (workflow?.preflightWarnings?.length) {
|
|
2620
|
-
const warningLines = expanded
|
|
2621
|
-
? formatWorkflowPreflightWarnings(workflow.preflightWarnings, { indent: rowIndent }).split("\n")
|
|
2622
|
-
: [formatWorkflowPreflightWarningSummary(workflow.preflightWarnings, { indent: rowIndent, hint: "expand for debug" })];
|
|
2623
|
-
for (const warningLine of warningLines) c.addChild(new Text(truncLine(theme.fg("warning", warningLine), width), 0, 0));
|
|
2624
|
-
}
|
|
2625
|
-
if (workflow?.emits.length) c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}Emits ${workflow.emits.length}`), width), 0, 0));
|
|
2626
|
-
return c;
|
|
2627
|
-
}
|
|
2628
|
-
|
|
2629
|
-
function renderMultiCompact(d: Details, theme: Theme, layout: MainWindowRenderLayout, frame?: number): Component {
|
|
2630
|
-
const hasRunning = detailsHaveRunningResult(d);
|
|
2631
|
-
const detached = d.results.some((r) => r.detached)
|
|
2632
|
-
|| workflowGraphHasStatus(d, ["detached"]);
|
|
2633
|
-
const stopped = d.results.some((r) => r.stopped)
|
|
2634
|
-
|| workflowGraphHasStatus(d, ["stopped"]);
|
|
2635
|
-
const failed = d.results.some((r) => !hasTerminalResultFlag(r) && r.exitCode !== 0 && !isResultRunning(r))
|
|
2636
|
-
|| workflowGraphHasStatus(d, ["failed"]);
|
|
2637
|
-
const paused = d.results.some((r) => r.interrupted)
|
|
2638
|
-
|| workflowGraphHasStatus(d, ["paused"]);
|
|
2639
|
-
const partial = workflowGraphHasStatus(d, ["partial"]);
|
|
2640
|
-
let totalSummary = d.progressSummary;
|
|
2641
|
-
if (!totalSummary) {
|
|
2642
|
-
let sawProgress = false;
|
|
2643
|
-
const summary = { toolCount: 0, tokens: 0, durationMs: 0 };
|
|
2644
|
-
for (const r of d.results) {
|
|
2645
|
-
const prog = r.progress || r.progressSummary;
|
|
2646
|
-
if (!prog) continue;
|
|
2647
|
-
sawProgress = true;
|
|
2648
|
-
summary.toolCount += prog.toolCount;
|
|
2649
|
-
summary.tokens += prog.tokens;
|
|
2650
|
-
summary.durationMs = d.mode === "chain" ? summary.durationMs + prog.durationMs : Math.max(summary.durationMs, prog.durationMs);
|
|
2651
|
-
}
|
|
2652
|
-
if (sawProgress) totalSummary = summary;
|
|
2653
|
-
}
|
|
2654
|
-
const multiLabel = buildMultiProgressLabel(d, hasRunning);
|
|
2655
|
-
const itemTitle = multiLabel.itemTitle;
|
|
2656
|
-
const stats = statJoin(theme, [multiLabel.headerLabel, formatProgressStats(theme, totalSummary), formatTotalCostStat(d.totalCost)]);
|
|
2657
|
-
const aggregatePresentation = semanticResultPresentation({
|
|
2658
|
-
running: hasRunning,
|
|
2659
|
-
detached,
|
|
2660
|
-
stopped,
|
|
2661
|
-
interrupted: paused,
|
|
2662
|
-
failed,
|
|
2663
|
-
partial,
|
|
2664
|
-
seed: runningSeed(progressRunningSeed(totalSummary), d.currentStepIndex),
|
|
2665
|
-
frame,
|
|
2666
|
-
});
|
|
2667
|
-
const glyph = theme.fg(aggregatePresentation.tone, aggregatePresentation.glyph);
|
|
2668
|
-
const contextBadge = contextModeBadge(theme, d.context);
|
|
2669
|
-
const c = new Container();
|
|
2670
|
-
const width = getTermWidth() - 4;
|
|
2671
|
-
const rowIndent = mainWindowIndent(layout, 1);
|
|
2672
|
-
const detailIndent = mainWindowIndent(layout, 2);
|
|
2673
|
-
c.addChild(new Text(truncLine(`${glyph} ${theme.fg("toolTitle", theme.bold(d.mode))}${contextBadge}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`, width), 0, 0));
|
|
2674
|
-
|
|
2675
|
-
const useResultsDirectly = multiLabel.hasParallelInChain || !d.chainAgents?.length;
|
|
2676
|
-
const displayStart = multiLabel.showActiveGroupOnly ? multiLabel.groupStartIndex : 0;
|
|
2677
|
-
const displayEnd = multiLabel.showActiveGroupOnly ? multiLabel.groupEndIndex : (useResultsDirectly ? d.results.length : d.chainAgents!.length);
|
|
2678
|
-
const chainEntries = buildChainRenderEntries(d, multiLabel);
|
|
2679
|
-
const renderEntries = chainEntries ?? buildForegroundResultEntries(d, multiLabel, displayStart, displayEnd, useResultsDirectly);
|
|
2680
|
-
for (const entry of renderEntries) {
|
|
2681
|
-
if (entry.kind === "group") {
|
|
2682
|
-
const glyph = widgetStepGlyph(entry.status as AsyncJobStep["status"], theme);
|
|
2683
|
-
const statusLabel = widgetStepStatus(entry.status as AsyncJobStep["status"], theme);
|
|
2684
|
-
const groupLabel = entry.groupLabel ? ` (${compactTaskText(undefined, entry.groupLabel) ?? entry.groupLabel})` : "";
|
|
2685
|
-
c.addChild(new Text(truncLine(`${rowIndent}${glyph} ${entry.stepLabel}${groupLabel} ${theme.fg("dim", "·")} ${statusLabel}`, width), 0, 0));
|
|
2686
|
-
if (entry.error) c.addChild(new Text(truncLine(theme.fg("error", `${detailIndent}⎿ Error: ${entry.error}`), width), 0, 0));
|
|
2687
|
-
continue;
|
|
2688
|
-
}
|
|
2689
|
-
const i = entry.resultIndex;
|
|
2690
|
-
const r = d.results[i];
|
|
2691
|
-
const rowNumber = entry.rowNumber;
|
|
2692
|
-
const agentName = entry.agentName;
|
|
2693
|
-
if (!r) {
|
|
2694
|
-
const pendingLabel = entry.rowLabel ?? (entry.isParallel ? "" : `${itemTitle} ${rowNumber}`);
|
|
2695
|
-
const labelPrefix = pendingLabel ? `${pendingLabel}: ` : "";
|
|
2696
|
-
c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}◦ ${labelPrefix}${agentName} · pending`), width), 0, 0));
|
|
2697
|
-
continue;
|
|
2698
|
-
}
|
|
2699
|
-
const output = getSingleResultOutput(r);
|
|
2700
|
-
const progressFromArray = foregroundProgressForResult(d, i);
|
|
2701
|
-
const rProg = r.progress || progressFromArray || r.progressSummary;
|
|
2702
|
-
const rRunning = rProg && "status" in rProg && isResultRunning(r, rProg.status);
|
|
2703
|
-
const rPending = rProg && "status" in rProg && rProg.status === "pending";
|
|
2704
|
-
const stepStats = formatProgressStats(theme, rProg);
|
|
2705
|
-
const glyph = rPending ? theme.fg("dim", "◦") : resultGlyph(r, output, theme, rRunning, progressRunningSeed(rProg), frame);
|
|
2706
|
-
const pendingLabel = rPending ? ` ${theme.fg("dim", "· pending")}` : "";
|
|
2707
|
-
const stepLabel = entry.rowLabel;
|
|
2708
|
-
const rowProgressModel = rProg && "status" in rProg ? rProg : undefined;
|
|
2709
|
-
const rowModelDisplay = modelThinkingBadge(theme, r.model ?? rowProgressModel?.model, r.thinking ?? rowProgressModel?.thinking);
|
|
2710
|
-
const labelPrefix = stepLabel ? `${stepLabel}: ` : "";
|
|
2711
|
-
const line = `${glyph} ${labelPrefix}${themeBold(theme, agentName)}${contextModeBadge(theme, r.context)}${rowModelDisplay}${stepStats ? ` ${theme.fg("dim", "·")} ${stepStats}` : ""}${pendingLabel}`;
|
|
2712
|
-
c.addChild(new Text(truncLine(`${rowIndent}${line}`, width), 0, 0));
|
|
2713
|
-
if (rRunning || rPending) {
|
|
2714
|
-
const task = compactTaskText(r.task, workflowLabelForResult(d, i));
|
|
2715
|
-
if (task) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}task: ${task}`), width), 0, 0));
|
|
2716
|
-
}
|
|
2717
|
-
if (rRunning && rProg && "status" in rProg) {
|
|
2718
|
-
const liveProgress = rProg as AgentProgress;
|
|
2719
|
-
const activity = compactCurrentActivity(liveProgress);
|
|
2720
|
-
c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}⎿ ${activity}`), width), 0, 0));
|
|
2721
|
-
for (const nestedLine of formatNestedWidgetLines(r.children, theme, width, false, snapshotNowForProgress(liveProgress))) {
|
|
2722
|
-
c.addChild(new Text(truncLine(`${detailIndent}${nestedLine}`, width), 0, 0));
|
|
2723
|
-
}
|
|
2724
|
-
c.addChild(new Text(truncLine(theme.fg("accent", `${detailIndent}${liveDetailHintText()}`), width), 0, 0));
|
|
2725
|
-
} else if (!rPending && (r.exitCode !== 0 || r.interrupted || r.detached || hasEmptyTextOutputWithoutOutputTarget(r.task, output))) {
|
|
2726
|
-
c.addChild(new Text(truncLine(theme.fg(r.exitCode !== 0 ? "error" : "dim", `${detailIndent}⎿ ${resultStatusLine(r, output)}`), width), 0, 0));
|
|
2727
|
-
}
|
|
2728
|
-
if (!rRunning && !rPending) {
|
|
2729
|
-
for (const nestedLine of formatNestedWidgetLines(r.children, theme, width, false, r.progress?.lastActivityAt)) {
|
|
2730
|
-
c.addChild(new Text(truncLine(`${detailIndent}${nestedLine}`, width), 0, 0));
|
|
2731
|
-
}
|
|
2732
|
-
}
|
|
2733
|
-
const outputTarget = extractOutputTarget(r.task);
|
|
2734
|
-
if (outputTarget) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}output: ${outputTarget}`), width), 0, 0));
|
|
2735
|
-
if (r.artifactPaths) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}output: ${shortenPath(r.artifactPaths.outputPath)}`), width), 0, 0));
|
|
2736
|
-
}
|
|
2737
|
-
if (d.artifacts) c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}artifacts: ${shortenPath(d.artifacts.dir)}`), width), 0, 0));
|
|
2738
|
-
return c;
|
|
2739
|
-
}
|
|
2740
|
-
|
|
2741
|
-
export function renderSubagentSummary(
|
|
2742
|
-
result: AgentToolResult<Details>,
|
|
2743
|
-
options: { isPartial?: boolean },
|
|
2744
|
-
theme: Theme,
|
|
2745
|
-
): Component {
|
|
2746
|
-
const details = result.details;
|
|
2747
|
-
const results = details?.results ?? [];
|
|
2748
|
-
const hasSingleTerminalResult = results.length === 1 && hasTerminalResult(results[0]!);
|
|
2749
|
-
const hasOnlyTerminalResults = results.length > 0 && results.every(hasTerminalResult);
|
|
2750
|
-
const running = !hasSingleTerminalResult && !hasOnlyTerminalResults && (
|
|
2751
|
-
options.isPartial === true
|
|
2752
|
-
|| Boolean(details?.asyncId && details.mode !== "management")
|
|
2753
|
-
|| Boolean(details && detailsHaveRunningResult(details))
|
|
2754
|
-
);
|
|
2755
|
-
const stopped = results.some((entry) => entry.stopped)
|
|
2756
|
-
|| Boolean(details && workflowGraphHasStatus(details, ["stopped"]));
|
|
2757
|
-
const paused = results.some((entry) => entry.interrupted || entry.detached)
|
|
2758
|
-
|| Boolean(details && workflowGraphHasStatus(details, ["paused", "detached"]));
|
|
2759
|
-
const failed = result.isError === true
|
|
2760
|
-
|| results.some((entry) => !hasTerminalResultFlag(entry) && entry.exitCode !== 0 && !isResultRunning(entry))
|
|
2761
|
-
|| Boolean(details && workflowGraphHasStatus(details, ["failed"]));
|
|
2762
|
-
const partial = Boolean(details && workflowGraphHasStatus(details, ["partial"]));
|
|
2763
|
-
const state = running ? "running" : failed ? "failed" : stopped ? "stopped" : paused ? "paused" : partial ? "partial" : "completed";
|
|
2764
|
-
const glyph = state === "running"
|
|
2765
|
-
? theme.fg("accent", STATIC_RUNNING_GLYPH)
|
|
2766
|
-
: state === "completed"
|
|
2767
|
-
? theme.fg("success", "✓")
|
|
2768
|
-
: state === "failed"
|
|
2769
|
-
? theme.fg("error", "✗")
|
|
2770
|
-
: theme.fg("warning", "■");
|
|
2771
|
-
const label = details?.mode === "single" && results.length === 1
|
|
2772
|
-
? foregroundSingleDisplayName(results[0])
|
|
2773
|
-
: details?.mode || "subagent";
|
|
2774
|
-
return new Text(
|
|
2775
|
-
truncLine(`${glyph} ${theme.fg("toolTitle", theme.bold(label))} ${theme.fg("dim", "·")} ${theme.fg(state === "failed" ? "error" : state === "completed" ? "success" : state === "running" ? "accent" : "warning", state)}`, getTermWidth() - 4),
|
|
2776
|
-
0,
|
|
2777
|
-
0,
|
|
2778
|
-
);
|
|
2779
|
-
}
|
|
2780
|
-
|
|
2781
|
-
/**
|
|
2782
|
-
* Render a subagent result
|
|
2783
|
-
*/
|
|
2784
|
-
export function renderSubagentResult(
|
|
2785
|
-
result: AgentToolResult<Details>,
|
|
2786
|
-
options: { expanded: boolean },
|
|
2787
|
-
theme: Theme,
|
|
2788
|
-
frame?: number,
|
|
2789
|
-
rendererConfig?: MainWindowRendererConfig,
|
|
2790
|
-
foregroundDetachShortcut?: string,
|
|
2791
|
-
): Component {
|
|
2792
|
-
const layout = resolveMainWindowRenderLayout(rendererConfig);
|
|
2793
|
-
const compact = (component: Component): Component => capCompactMainWindowResult(component, layout, theme, !options.expanded);
|
|
2794
|
-
const d = result.details;
|
|
2795
|
-
if (d?.mode === "workflow" && d.chatProgress?.mode === "live-card" && d.workflow?.value === undefined && (!result.isError || (d.workflow?.trace.length ?? 0) > 0)) {
|
|
2796
|
-
return compact(renderWorkflowChatProgress(d, result, theme, options.expanded ? resolveMainWindowRenderLayout() : layout, frame, options.expanded));
|
|
2797
|
-
}
|
|
2798
|
-
if (!d || !d.results.length) {
|
|
2799
|
-
const t = result.content[0];
|
|
2800
|
-
const text = t?.type === "text" ? t.text : "(no output)";
|
|
2801
|
-
const contextPrefix = contextModePrefix(theme, d?.context);
|
|
2802
|
-
const width = getTermWidth() - 4;
|
|
2803
|
-
if (!text.includes("\n")) return compact(new Text(truncLine(`${contextPrefix}${text}`, width), 0, 0));
|
|
2804
|
-
if (d && !options.expanded && !result.isError) {
|
|
2805
|
-
const lines = text.split(/\r?\n/);
|
|
2806
|
-
const firstNonEmptyLine = lines.find((line) => line.trim())?.trim() || "(no output)";
|
|
2807
|
-
const compactLine = d.mode === "workflow" && d.preflight
|
|
2808
|
-
? formatWorkflowPreflightPlanSummary(d.preflight)
|
|
2809
|
-
: firstNonEmptyLine;
|
|
2810
|
-
const c = new Container();
|
|
2811
|
-
const detailIndent = mainWindowIndent(layout, 1);
|
|
2812
|
-
c.addChild(new Text(truncLine(`${contextPrefix}${compactLine} · ${lines.length} lines`, width), 0, 0));
|
|
2813
|
-
c.addChild(new Text(truncLine(theme.fg("accent", `${detailIndent}Press ${liveDetailKeyText()} for full output`), width), 0, 0));
|
|
2814
|
-
return compact(c);
|
|
2815
|
-
}
|
|
2816
|
-
const c = new Container();
|
|
2817
|
-
const wrapped = wrapPlainText(`${contextPrefix}${text}`, width);
|
|
2818
|
-
for (const line of wrapped) c.addChild(new Text(line, 0, 0));
|
|
2819
|
-
return c;
|
|
2820
|
-
}
|
|
2821
|
-
|
|
2822
|
-
const expanded = options.expanded;
|
|
2823
|
-
const mdTheme = getMarkdownTheme();
|
|
2824
|
-
|
|
2825
|
-
if (d.mode === "single" && d.results.length === 1) {
|
|
2826
|
-
const r = d.results[0];
|
|
2827
|
-
const detachableShortcut = d.asyncId || d.background ? undefined : foregroundDetachShortcut;
|
|
2828
|
-
if (!r) return compact(renderMultiCompact(d, theme, layout, frame));
|
|
2829
|
-
if (!expanded) return compact(renderSingleCompact(d, r, theme, layout, frame, detachableShortcut));
|
|
2830
|
-
const isRunning = isResultRunning(r);
|
|
2831
|
-
const contextBadge = contextModeBadge(theme, r.context ?? d.context);
|
|
2832
|
-
const output = r.truncation?.text || getSingleResultOutput(r);
|
|
2833
|
-
const presentation = styledResultPresentation(resultPresentation(r, output, isRunning, undefined, frame), theme);
|
|
2834
|
-
|
|
2835
|
-
const progressInfo = isRunning && r.progress
|
|
2836
|
-
? ` | ${r.progress.toolCount} tools, ${formatTokens(r.progress.tokens)} tok, ${formatDuration(r.progress.durationMs)}`
|
|
2837
|
-
: r.progressSummary
|
|
2838
|
-
? ` | ${r.progressSummary.toolCount} tools, ${formatTokens(r.progressSummary.tokens)} tok, ${formatDuration(r.progressSummary.durationMs)}`
|
|
2839
|
-
: "";
|
|
2840
|
-
|
|
2841
|
-
const w = getTermWidth() - 4;
|
|
2842
|
-
const fit = (text: string) => expanded ? text : truncLine(text, w);
|
|
2843
|
-
const toolCallLines = getToolCallLines(r, expanded);
|
|
2844
|
-
const c = new Container();
|
|
2845
|
-
c.addChild(new Text(fit(`${presentation.glyph} ${theme.fg("toolTitle", theme.bold(foregroundSingleDisplayName(r)))}${contextBadge}${progressInfo} ${theme.fg("dim", "·")} ${presentation.label}`), 0, 0));
|
|
2846
|
-
c.addChild(new Spacer(1));
|
|
2847
|
-
const taskMaxLen = Math.max(20, w - 8);
|
|
2848
|
-
const taskPreview = expanded || r.task.length <= taskMaxLen
|
|
2849
|
-
? r.task
|
|
2850
|
-
: `${r.task.slice(0, taskMaxLen)}...`;
|
|
2851
|
-
c.addChild(
|
|
2852
|
-
new Text(fit(theme.fg("dim", `Task: ${taskPreview}`)), 0, 0),
|
|
2853
|
-
);
|
|
2854
|
-
c.addChild(new Spacer(1));
|
|
2855
|
-
if (!isRunning && (r.exitCode !== 0 || r.interrupted || r.detached || r.stopped)) {
|
|
2856
|
-
c.addChild(new Text(fit(theme.fg(r.exitCode !== 0 ? "error" : "dim", ` ⎿ ${resultStatusLine(r, output)}`)), 0, 0));
|
|
2857
|
-
}
|
|
2858
|
-
|
|
2859
|
-
if (isRunning && r.progress) {
|
|
2860
|
-
const progressSnapshotNow = snapshotNowForProgress(r.progress);
|
|
2861
|
-
for (const nestedLine of formatNestedWidgetLines(r.children, theme, w, true, progressSnapshotNow, 12)) {
|
|
2862
|
-
c.addChild(new Text(fit(` ${nestedLine}`), 0, 0));
|
|
2863
|
-
}
|
|
2864
|
-
const toolLine = formatCurrentToolLine(r.progress, w, expanded, progressSnapshotNow);
|
|
2865
|
-
if (toolLine) {
|
|
2866
|
-
c.addChild(new Text(fit(theme.fg("warning", `> ${toolLine}`)), 0, 0));
|
|
2867
|
-
}
|
|
2868
|
-
const liveStatusLine = buildLiveStatusLine(r.progress, progressSnapshotNow);
|
|
2869
|
-
if (liveStatusLine) {
|
|
2870
|
-
c.addChild(new Text(fit(theme.fg("accent", liveStatusLine)), 0, 0));
|
|
2871
|
-
}
|
|
2872
|
-
c.addChild(new Text(fit(theme.fg("accent", foregroundSingleHintText(detachableShortcut))), 0, 0));
|
|
2873
|
-
if (r.artifactPaths) {
|
|
2874
|
-
c.addChild(new Text(fit(theme.fg("dim", `Artifacts: ${shortenPath(r.artifactPaths.outputPath)}`)), 0, 0));
|
|
2875
|
-
}
|
|
2876
|
-
if (r.progress.recentTools?.length) {
|
|
2877
|
-
for (const t of r.progress.recentTools.slice(-3)) {
|
|
2878
|
-
const maxArgsLen = Math.max(40, w - 24);
|
|
2879
|
-
const argsPreview = renderToolArgsPreview(t.args, maxArgsLen, expanded);
|
|
2880
|
-
c.addChild(new Text(fit(theme.fg("dim", `${t.tool}: ${argsPreview}`)), 0, 0));
|
|
2881
|
-
}
|
|
2882
|
-
}
|
|
2883
|
-
for (const line of compactRecentOutputLines(r.progress.recentOutput)) {
|
|
2884
|
-
c.addChild(new Text(fit(theme.fg("dim", ` ${line}`)), 0, 0));
|
|
2885
|
-
}
|
|
2886
|
-
if (toolLine || liveStatusLine || r.progress.recentTools?.length || r.progress.recentOutput?.length || r.artifactPaths) {
|
|
2887
|
-
c.addChild(new Spacer(1));
|
|
2888
|
-
}
|
|
2889
|
-
} else {
|
|
2890
|
-
for (const nestedLine of formatNestedWidgetLines(r.children, theme, w, true, r.progress?.lastActivityAt, 8)) {
|
|
2891
|
-
c.addChild(new Text(fit(` ${nestedLine}`), 0, 0));
|
|
2892
|
-
}
|
|
2893
|
-
}
|
|
2894
|
-
|
|
2895
|
-
if (expanded) {
|
|
2896
|
-
for (const line of toolCallLines) {
|
|
2897
|
-
c.addChild(new Text(fit(theme.fg("muted", line)), 0, 0));
|
|
2898
|
-
}
|
|
2899
|
-
if (toolCallLines.length) c.addChild(new Spacer(1));
|
|
2900
|
-
}
|
|
2901
|
-
|
|
2902
|
-
if (output) c.addChild(new Markdown(output, 0, 0, mdTheme));
|
|
2903
|
-
c.addChild(new Spacer(1));
|
|
2904
|
-
if (r.skills?.length) {
|
|
2905
|
-
c.addChild(new Text(fit(theme.fg("dim", `Skills: ${r.skills.join(", ")}`)), 0, 0));
|
|
2906
|
-
}
|
|
2907
|
-
if (r.skillsWarning) {
|
|
2908
|
-
c.addChild(new Text(fit(theme.fg("warning", `Warning: ${r.skillsWarning}`)), 0, 0));
|
|
2909
|
-
}
|
|
2910
|
-
if (r.attemptedModels && r.attemptedModels.length > 1) {
|
|
2911
|
-
c.addChild(new Text(fit(theme.fg("dim", `Fallbacks: ${r.attemptedModels.join(" → ")}`)), 0, 0));
|
|
2912
|
-
}
|
|
2913
|
-
c.addChild(new Text(fit(theme.fg("dim", formatUsage(r.usage, r.model))), 0, 0));
|
|
2914
|
-
if (r.sessionFile) {
|
|
2915
|
-
c.addChild(new Text(fit(theme.fg("dim", `Session: ${shortenPath(r.sessionFile)}`)), 0, 0));
|
|
2916
|
-
}
|
|
2917
|
-
|
|
2918
|
-
if (!isRunning && r.artifactPaths) {
|
|
2919
|
-
c.addChild(new Spacer(1));
|
|
2920
|
-
c.addChild(new Text(fit(theme.fg("dim", `Artifacts: ${shortenPath(r.artifactPaths.outputPath)}`)), 0, 0));
|
|
2921
|
-
}
|
|
2922
|
-
return c;
|
|
2923
|
-
}
|
|
2924
|
-
|
|
2925
|
-
if (!expanded) return compact(renderMultiCompact(d, theme, layout, frame));
|
|
2926
|
-
|
|
2927
|
-
const hasRunning = detailsHaveRunningResult(d);
|
|
2928
|
-
const detached = d.results.some((r) => r.detached)
|
|
2929
|
-
|| workflowGraphHasStatus(d, ["detached"]);
|
|
2930
|
-
const stopped = d.results.some((r) => r.stopped)
|
|
2931
|
-
|| workflowGraphHasStatus(d, ["stopped"]);
|
|
2932
|
-
const failed = d.results.some((r) => !hasTerminalResultFlag(r) && r.exitCode !== 0 && !isResultRunning(r))
|
|
2933
|
-
|| workflowGraphHasStatus(d, ["failed"]);
|
|
2934
|
-
const paused = d.results.some((r) => r.interrupted)
|
|
2935
|
-
|| workflowGraphHasStatus(d, ["paused"]);
|
|
2936
|
-
const partial = workflowGraphHasStatus(d, ["partial"]);
|
|
2937
|
-
const completedWithoutOutput = d.results.some((r) =>
|
|
2938
|
-
!hasTerminalResultFlag(r)
|
|
2939
|
-
&& r.exitCode === 0
|
|
2940
|
-
&& !isResultRunning(r)
|
|
2941
|
-
&& hasEmptyTextOutputWithoutOutputTarget(r.task, getSingleResultOutput(r)),
|
|
2942
|
-
);
|
|
2943
|
-
const presentation = styledResultPresentation(semanticResultPresentation({
|
|
2944
|
-
running: hasRunning,
|
|
2945
|
-
detached,
|
|
2946
|
-
stopped,
|
|
2947
|
-
interrupted: paused,
|
|
2948
|
-
failed,
|
|
2949
|
-
partial,
|
|
2950
|
-
completedWithoutOutput,
|
|
2951
|
-
frame,
|
|
2952
|
-
}), theme);
|
|
2953
|
-
|
|
2954
|
-
const totalSummary =
|
|
2955
|
-
d.progressSummary ||
|
|
2956
|
-
d.results.reduce(
|
|
2957
|
-
(acc, r) => {
|
|
2958
|
-
const prog = r.progress || r.progressSummary;
|
|
2959
|
-
if (prog) {
|
|
2960
|
-
acc.toolCount += prog.toolCount;
|
|
2961
|
-
acc.tokens += prog.tokens;
|
|
2962
|
-
acc.durationMs =
|
|
2963
|
-
d.mode === "chain"
|
|
2964
|
-
? acc.durationMs + prog.durationMs
|
|
2965
|
-
: Math.max(acc.durationMs, prog.durationMs);
|
|
2966
|
-
}
|
|
2967
|
-
return acc;
|
|
2968
|
-
},
|
|
2969
|
-
{ toolCount: 0, tokens: 0, durationMs: 0 },
|
|
2970
|
-
);
|
|
2971
|
-
|
|
2972
|
-
const summaryParts = [
|
|
2973
|
-
totalSummary.toolCount || totalSummary.tokens
|
|
2974
|
-
? `${totalSummary.toolCount} tools, ${formatTokens(totalSummary.tokens)} tok, ${formatDuration(totalSummary.durationMs)}`
|
|
2975
|
-
: "",
|
|
2976
|
-
formatTotalCostStat(d.totalCost),
|
|
2977
|
-
].filter(Boolean);
|
|
2978
|
-
const summaryStr = summaryParts.length ? ` | ${summaryParts.join(", ")}` : "";
|
|
2979
|
-
|
|
2980
|
-
const modeLabel = d.mode;
|
|
2981
|
-
const contextBadge = contextModeBadge(theme, d.context);
|
|
2982
|
-
const multiLabel = buildMultiProgressLabel(d, hasRunning);
|
|
2983
|
-
const itemTitle = multiLabel.itemTitle;
|
|
2984
|
-
|
|
2985
|
-
const chainVis = d.chainAgents?.length && !multiLabel.hasParallelInChain
|
|
2986
|
-
? d.chainAgents
|
|
2987
|
-
.map((agent, i) => {
|
|
2988
|
-
const result = d.results[i];
|
|
2989
|
-
const displayName = foregroundResultDisplayName(d, i, result, agent);
|
|
2990
|
-
const isCurrent = i === (d.currentStepIndex ?? d.results.length);
|
|
2991
|
-
const stepPresentation = result
|
|
2992
|
-
? styledResultPresentation(resultPresentation(result, getSingleResultOutput(result), isCurrent && hasRunning && !hasTerminalResultFlag(result)), theme)
|
|
2993
|
-
: undefined;
|
|
2994
|
-
const stepStatus = stepPresentation
|
|
2995
|
-
? `${stepPresentation.glyph} ${stepPresentation.label}`
|
|
2996
|
-
: theme.fg("dim", "◦ pending");
|
|
2997
|
-
return `${stepStatus} ${displayName}${contextModeBadge(theme, result?.context)}`;
|
|
2998
|
-
})
|
|
2999
|
-
.join(theme.fg("dim", " → "))
|
|
3000
|
-
: null;
|
|
3001
|
-
|
|
3002
|
-
const w = getTermWidth() - 4;
|
|
3003
|
-
const fit = (text: string) => expanded ? text : truncLine(text, w);
|
|
3004
|
-
const c = new Container();
|
|
3005
|
-
c.addChild(
|
|
3006
|
-
new Text(
|
|
3007
|
-
fit(`${presentation.glyph} ${theme.fg("toolTitle", theme.bold(modeLabel))}${contextBadge} · ${multiLabel.headerLabel}${summaryStr} ${theme.fg("dim", "·")} ${presentation.label}`),
|
|
3008
|
-
0,
|
|
3009
|
-
0,
|
|
3010
|
-
),
|
|
3011
|
-
);
|
|
3012
|
-
if (chainVis) {
|
|
3013
|
-
c.addChild(new Text(fit(` ${chainVis}`), 0, 0));
|
|
3014
|
-
}
|
|
3015
|
-
|
|
3016
|
-
const useResultsDirectly = multiLabel.hasParallelInChain || !d.chainAgents?.length;
|
|
3017
|
-
const displayStart = multiLabel.showActiveGroupOnly ? multiLabel.groupStartIndex : 0;
|
|
3018
|
-
const displayEnd = multiLabel.showActiveGroupOnly ? multiLabel.groupEndIndex : (useResultsDirectly ? d.results.length : d.chainAgents!.length);
|
|
3019
|
-
const chainEntries = buildChainRenderEntries(d, multiLabel);
|
|
3020
|
-
const renderEntries = chainEntries ?? buildForegroundResultEntries(d, multiLabel, displayStart, displayEnd, useResultsDirectly);
|
|
3021
|
-
|
|
3022
|
-
c.addChild(new Spacer(1));
|
|
3023
|
-
|
|
3024
|
-
for (const entry of renderEntries) {
|
|
3025
|
-
if (entry.kind === "group") {
|
|
3026
|
-
const statusLabel = widgetStepStatus(entry.status as AsyncJobStep["status"], theme);
|
|
3027
|
-
const groupLabel = entry.groupLabel ? ` (${compactTaskText(undefined, entry.groupLabel) ?? entry.groupLabel})` : "";
|
|
3028
|
-
c.addChild(new Text(fit(` ${statusLabel} ${entry.stepLabel}${groupLabel}`), 0, 0));
|
|
3029
|
-
c.addChild(new Text(theme.fg(entry.status === "failed" ? "error" : "dim", ` status: ${entry.status}`), 0, 0));
|
|
3030
|
-
if (entry.error) c.addChild(new Text(theme.fg("error", ` error: ${entry.error}`), 0, 0));
|
|
3031
|
-
c.addChild(new Spacer(1));
|
|
3032
|
-
continue;
|
|
3033
|
-
}
|
|
3034
|
-
const i = entry.resultIndex;
|
|
3035
|
-
const r = d.results[i];
|
|
3036
|
-
const rowNumber = entry.rowNumber;
|
|
3037
|
-
const agentName = entry.agentName;
|
|
3038
|
-
|
|
3039
|
-
if (!r) {
|
|
3040
|
-
const pendingLabel = entry.rowLabel ?? (entry.isParallel ? "" : `${itemTitle} ${rowNumber}`);
|
|
3041
|
-
const labelPrefix = pendingLabel ? `${pendingLabel}: ` : "";
|
|
3042
|
-
c.addChild(new Text(fit(theme.fg("dim", ` ${labelPrefix}${agentName}`)), 0, 0));
|
|
3043
|
-
c.addChild(new Text(theme.fg("dim", ` status: pending`), 0, 0));
|
|
3044
|
-
c.addChild(new Spacer(1));
|
|
3045
|
-
continue;
|
|
3046
|
-
}
|
|
3047
|
-
|
|
3048
|
-
const progressFromArray = foregroundProgressForResult(d, i);
|
|
3049
|
-
const rProg = r.progress || progressFromArray || r.progressSummary;
|
|
3050
|
-
const rRunning = isResultRunning(r, rProg?.status);
|
|
3051
|
-
|
|
3052
|
-
const resultOutput = getSingleResultOutput(r);
|
|
3053
|
-
const rowPresentation = styledResultPresentation(resultPresentation(r, resultOutput, rRunning, progressRunningSeed(rProg), frame), theme);
|
|
3054
|
-
const stats = rProg ? ` | ${rProg.toolCount} tools, ${formatDuration(rProg.durationMs)}` : "";
|
|
3055
|
-
const modelDisplay = modelThinkingBadge(theme, r.model ?? rProg?.model, r.thinking ?? rProg?.thinking);
|
|
3056
|
-
const stepLabel = entry.rowLabel;
|
|
3057
|
-
const contextBadge = contextModeBadge(theme, r.context);
|
|
3058
|
-
const labelPrefix = stepLabel ? `${stepLabel}: ` : "";
|
|
3059
|
-
const stepHeader = rRunning
|
|
3060
|
-
? `${rowPresentation.glyph} ${labelPrefix}${theme.bold(theme.fg("warning", agentName))}${contextBadge}${modelDisplay}${stats} ${theme.fg("dim", "·")} ${rowPresentation.label}`
|
|
3061
|
-
: `${rowPresentation.glyph} ${labelPrefix}${theme.bold(agentName)}${contextBadge}${modelDisplay}${stats} ${theme.fg("dim", "·")} ${rowPresentation.label}`;
|
|
3062
|
-
const toolCallLines = getToolCallLines(r, expanded);
|
|
3063
|
-
c.addChild(new Text(fit(stepHeader), 0, 0));
|
|
3064
|
-
|
|
3065
|
-
const taskMaxLen = Math.max(20, w - 12);
|
|
3066
|
-
const taskPreview = expanded || r.task.length <= taskMaxLen
|
|
3067
|
-
? r.task
|
|
3068
|
-
: `${r.task.slice(0, taskMaxLen)}...`;
|
|
3069
|
-
c.addChild(new Text(fit(theme.fg("dim", ` task: ${taskPreview}`)), 0, 0));
|
|
3070
|
-
|
|
3071
|
-
const outputTarget = extractOutputTarget(r.task);
|
|
3072
|
-
if (outputTarget) {
|
|
3073
|
-
c.addChild(new Text(fit(theme.fg("dim", ` output: ${outputTarget}`)), 0, 0));
|
|
3074
|
-
}
|
|
3075
|
-
if (!rRunning && (r.exitCode !== 0 || r.interrupted || r.detached || r.stopped)) {
|
|
3076
|
-
c.addChild(new Text(fit(theme.fg(r.exitCode !== 0 ? "error" : "dim", ` ⎿ ${resultStatusLine(r, resultOutput)}`)), 0, 0));
|
|
3077
|
-
}
|
|
3078
|
-
|
|
3079
|
-
if (r.skills?.length) {
|
|
3080
|
-
c.addChild(new Text(fit(theme.fg("dim", ` skills: ${r.skills.join(", ")}`)), 0, 0));
|
|
3081
|
-
}
|
|
3082
|
-
if (r.skillsWarning) {
|
|
3083
|
-
c.addChild(new Text(fit(theme.fg("warning", ` Warning: ${r.skillsWarning}`)), 0, 0));
|
|
3084
|
-
}
|
|
3085
|
-
if (r.attemptedModels && r.attemptedModels.length > 1) {
|
|
3086
|
-
c.addChild(new Text(fit(theme.fg("dim", ` fallbacks: ${r.attemptedModels.join(" → ")}`)), 0, 0));
|
|
3087
|
-
}
|
|
3088
|
-
|
|
3089
|
-
if (rRunning && rProg) {
|
|
3090
|
-
if (rProg.skills?.length) {
|
|
3091
|
-
c.addChild(new Text(fit(theme.fg("accent", ` skills: ${rProg.skills.join(", ")}`)), 0, 0));
|
|
3092
|
-
}
|
|
3093
|
-
const progressSnapshotNow = snapshotNowForProgress(rProg);
|
|
3094
|
-
const toolLine = formatCurrentToolLine(rProg, w, expanded, progressSnapshotNow);
|
|
3095
|
-
if (toolLine) {
|
|
3096
|
-
c.addChild(new Text(fit(theme.fg("warning", ` > ${toolLine}`)), 0, 0));
|
|
3097
|
-
}
|
|
3098
|
-
const liveStatusLine = buildLiveStatusLine(rProg, progressSnapshotNow);
|
|
3099
|
-
if (liveStatusLine) {
|
|
3100
|
-
c.addChild(new Text(fit(theme.fg("accent", ` ${liveStatusLine}`)), 0, 0));
|
|
3101
|
-
}
|
|
3102
|
-
for (const nestedLine of formatNestedWidgetLines(r.children, theme, w, true, progressSnapshotNow, 8)) {
|
|
3103
|
-
c.addChild(new Text(fit(` ${nestedLine}`), 0, 0));
|
|
3104
|
-
}
|
|
3105
|
-
c.addChild(new Text(fit(theme.fg("accent", ` ${liveDetailHintText()}`)), 0, 0));
|
|
3106
|
-
if (r.artifactPaths) {
|
|
3107
|
-
c.addChild(new Text(fit(theme.fg("dim", ` artifacts: ${shortenPath(r.artifactPaths.outputPath)}`)), 0, 0));
|
|
3108
|
-
}
|
|
3109
|
-
if (rProg.recentTools?.length) {
|
|
3110
|
-
for (const t of rProg.recentTools.slice(-3)) {
|
|
3111
|
-
const maxArgsLen = Math.max(40, w - 30);
|
|
3112
|
-
const argsPreview = renderToolArgsPreview(t.args, maxArgsLen, expanded);
|
|
3113
|
-
c.addChild(new Text(fit(theme.fg("dim", ` ${t.tool}: ${argsPreview}`)), 0, 0));
|
|
3114
|
-
}
|
|
3115
|
-
}
|
|
3116
|
-
for (const line of compactRecentOutputLines(rProg.recentOutput)) {
|
|
3117
|
-
c.addChild(new Text(fit(theme.fg("dim", ` ${line}`)), 0, 0));
|
|
3118
|
-
}
|
|
3119
|
-
}
|
|
3120
|
-
|
|
3121
|
-
if (!rRunning) {
|
|
3122
|
-
for (const nestedLine of formatNestedWidgetLines(r.children, theme, w, true, r.progress?.lastActivityAt, 8)) {
|
|
3123
|
-
c.addChild(new Text(fit(` ${nestedLine}`), 0, 0));
|
|
3124
|
-
}
|
|
3125
|
-
}
|
|
3126
|
-
|
|
3127
|
-
if (!rRunning && r.artifactPaths) {
|
|
3128
|
-
c.addChild(new Text(fit(theme.fg("dim", ` artifacts: ${shortenPath(r.artifactPaths.outputPath)}`)), 0, 0));
|
|
3129
|
-
}
|
|
3130
|
-
|
|
3131
|
-
if (expanded && !rRunning) {
|
|
3132
|
-
for (const line of toolCallLines) {
|
|
3133
|
-
c.addChild(new Text(fit(theme.fg("muted", ` ${line}`)), 0, 0));
|
|
3134
|
-
}
|
|
3135
|
-
if (toolCallLines.length) c.addChild(new Spacer(1));
|
|
3136
|
-
}
|
|
3137
|
-
|
|
3138
|
-
c.addChild(new Spacer(1));
|
|
3139
|
-
}
|
|
3140
|
-
|
|
3141
|
-
if (d.artifacts) {
|
|
3142
|
-
c.addChild(new Spacer(1));
|
|
3143
|
-
c.addChild(new Text(fit(theme.fg("dim", `Artifacts dir: ${shortenPath(d.artifacts.dir)}`)), 0, 0));
|
|
3144
|
-
}
|
|
3145
|
-
return c;
|
|
3146
|
-
}
|