@selesai/code 0.12.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/core/agent-session.d.ts +1 -1
- package/dist/core/agent-session.js +1 -1
- package/dist/core/sdk.d.ts +2 -2
- package/dist/core/sdk.js +1 -1
- package/dist/core/system-prompt.d.ts +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/usage-totals.d.ts +2 -0
- package/dist/core/usage-totals.js +10 -0
- package/dist/extensions/ascii.txt +9 -0
- package/dist/extensions/package.json +1 -2
- package/dist/extensions/pi-hermes-memory/CHANGELOG.md +371 -0
- package/dist/extensions/pi-hermes-memory/LICENSE +21 -0
- package/dist/extensions/pi-hermes-memory/README.md +643 -0
- package/dist/extensions/pi-hermes-memory/docs/0.1/TASKS.md +197 -0
- package/dist/extensions/pi-hermes-memory/docs/0.2/PLAN.md +290 -0
- package/dist/extensions/pi-hermes-memory/docs/0.2/TASKS.md +134 -0
- package/dist/extensions/pi-hermes-memory/docs/0.2/TEST-PLAN.md +216 -0
- package/dist/extensions/pi-hermes-memory/docs/0.3/PLAN.md +330 -0
- package/dist/extensions/pi-hermes-memory/docs/0.3/TASKS.md +125 -0
- package/dist/extensions/pi-hermes-memory/docs/0.4/PLAN.md +160 -0
- package/dist/extensions/pi-hermes-memory/docs/0.4/TASKS.md +113 -0
- package/dist/extensions/pi-hermes-memory/docs/0.6/CHANGELOG.md +57 -0
- package/dist/extensions/pi-hermes-memory/docs/0.6/PLAN.md +202 -0
- package/dist/extensions/pi-hermes-memory/docs/0.6/TASKS.md +144 -0
- package/dist/extensions/pi-hermes-memory/docs/0.7/PLAN.md +349 -0
- package/dist/extensions/pi-hermes-memory/docs/0.7/TASKS.md +110 -0
- package/dist/extensions/pi-hermes-memory/docs/PUBLISHING.md +149 -0
- package/dist/extensions/pi-hermes-memory/docs/ROADMAP.md +468 -0
- package/dist/extensions/pi-hermes-memory/docs/images/memory-architecture.svg +1 -0
- package/dist/extensions/pi-hermes-memory/docs/images/pi-logo.svg +22 -0
- package/dist/extensions/pi-hermes-memory/docs/images/pi_memory.png +0 -0
- package/dist/extensions/pi-hermes-memory/docs/images/pi_memory.svg +19 -0
- package/dist/extensions/pi-hermes-memory/docs/images/security-flow.svg +1 -0
- package/dist/extensions/pi-hermes-memory/docs/images/session-lifecycle.svg +1 -0
- package/dist/extensions/pi-hermes-memory/docs/images/source-architecture.svg +1 -0
- package/dist/extensions/pi-hermes-memory/docs/mermaid/memory-architecture.mmd +49 -0
- package/dist/extensions/pi-hermes-memory/docs/mermaid/security-flow.mmd +40 -0
- package/dist/extensions/pi-hermes-memory/docs/mermaid/session-lifecycle.mmd +56 -0
- package/dist/extensions/pi-hermes-memory/docs/mermaid/source-architecture.mmd +54 -0
- package/dist/extensions/pi-hermes-memory/package-lock.json +3799 -0
- package/dist/extensions/pi-hermes-memory/package.json +66 -0
- package/dist/extensions/pi-hermes-memory/scripts/check-min-sdk.mjs +99 -0
- package/dist/extensions/pi-hermes-memory/scripts/ensure-dev.mjs +57 -0
- package/dist/extensions/pi-hermes-memory/src/auto-consolidation-warning.ts +6 -0
- package/dist/extensions/pi-hermes-memory/src/config.ts +178 -0
- package/dist/extensions/pi-hermes-memory/src/constants.ts +424 -0
- package/dist/extensions/pi-hermes-memory/src/extension-root-migration.ts +639 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/auto-consolidate.ts +401 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/background-review.ts +297 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/child-process-watchdog.mjs +90 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/correction-detector.ts +300 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/index-sessions.ts +86 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/insights.ts +78 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/interview.ts +37 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/learn-memory.ts +186 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/message-parts.ts +27 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/pi-child-process.ts +485 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/preview-context.ts +105 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/review-memory-ops.ts +506 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/session-backfill.ts +145 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/session-flush.ts +151 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/session-live-index.ts +94 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/skills-command.ts +1334 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/standing-pin.ts +111 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/switch-project.ts +75 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/sync-markdown-memories.ts +266 -0
- package/dist/extensions/pi-hermes-memory/src/index.ts +378 -0
- package/dist/extensions/pi-hermes-memory/src/lifecycle-timing.ts +54 -0
- package/dist/extensions/pi-hermes-memory/src/paths.ts +61 -0
- package/dist/extensions/pi-hermes-memory/src/project-context.ts +13 -0
- package/dist/extensions/pi-hermes-memory/src/project-memory-migration.ts +93 -0
- package/dist/extensions/pi-hermes-memory/src/project.ts +157 -0
- package/dist/extensions/pi-hermes-memory/src/prompt-context.ts +55 -0
- package/dist/extensions/pi-hermes-memory/src/store/atomic-lock-coordinator.ts +375 -0
- package/dist/extensions/pi-hermes-memory/src/store/canonical-storage-path.ts +54 -0
- package/dist/extensions/pi-hermes-memory/src/store/content-scanner.ts +101 -0
- package/dist/extensions/pi-hermes-memory/src/store/db.ts +1180 -0
- package/dist/extensions/pi-hermes-memory/src/store/fts-query.ts +101 -0
- package/dist/extensions/pi-hermes-memory/src/store/markdown-mutation-lock.ts +38 -0
- package/dist/extensions/pi-hermes-memory/src/store/memory-lookup.ts +24 -0
- package/dist/extensions/pi-hermes-memory/src/store/memory-store.ts +1191 -0
- package/dist/extensions/pi-hermes-memory/src/store/recovery-maintenance.ts +66 -0
- package/dist/extensions/pi-hermes-memory/src/store/schema.ts +118 -0
- package/dist/extensions/pi-hermes-memory/src/store/session-anchor-search.ts +472 -0
- package/dist/extensions/pi-hermes-memory/src/store/session-indexer.ts +511 -0
- package/dist/extensions/pi-hermes-memory/src/store/session-parser.ts +213 -0
- package/dist/extensions/pi-hermes-memory/src/store/session-search.ts +234 -0
- package/dist/extensions/pi-hermes-memory/src/store/skill-store.ts +950 -0
- package/dist/extensions/pi-hermes-memory/src/store/skill-utils.ts +133 -0
- package/dist/extensions/pi-hermes-memory/src/store/sqlite-memory-store.ts +1002 -0
- package/dist/extensions/pi-hermes-memory/src/store/sqlite-native.ts +241 -0
- package/dist/extensions/pi-hermes-memory/src/store/standing-instructions.ts +247 -0
- package/dist/extensions/pi-hermes-memory/src/tools/memory-search-tool.ts +95 -0
- package/dist/extensions/pi-hermes-memory/src/tools/memory-tool.ts +469 -0
- package/dist/extensions/pi-hermes-memory/src/tools/session-search-tool.ts +246 -0
- package/dist/extensions/pi-hermes-memory/src/tools/shared-output-view.ts +170 -0
- package/dist/extensions/pi-hermes-memory/src/tools/skill-tool.ts +333 -0
- package/dist/extensions/pi-hermes-memory/src/tools/tool-result-views.ts +105 -0
- package/dist/extensions/pi-hermes-memory/src/types.ts +214 -0
- package/dist/extensions/pi-hermes-memory/tests/config.test.ts +434 -0
- package/dist/extensions/pi-hermes-memory/tests/extension-root-migration.test.ts +368 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/auto-consolidate.test.ts +984 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/background-review.test.ts +950 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/correction-detector.test.ts +671 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/insights.test.ts +157 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/interview.test.ts +127 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/pi-child-process.test.ts +905 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/preview-context.test.ts +152 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/prompt-context.test.ts +166 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/resources-discover.test.ts +71 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/review-memory-ops.test.ts +614 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-backfill.test.ts +192 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-flush.test.ts +677 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-live-index.test.ts +225 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/skills-command.test.ts +827 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/standing-pin.test.ts +134 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/sync-markdown-memories.test.ts +491 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/system-prompt.test.ts +199 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/thinking-max.test.ts +64 -0
- package/dist/extensions/pi-hermes-memory/tests/index.test.ts +30 -0
- package/dist/extensions/pi-hermes-memory/tests/integration/flow.test.ts +126 -0
- package/dist/extensions/pi-hermes-memory/tests/lifecycle-timing.test.ts +76 -0
- package/dist/extensions/pi-hermes-memory/tests/paths.test.ts +23 -0
- package/dist/extensions/pi-hermes-memory/tests/project-memory-migration.test.ts +80 -0
- package/dist/extensions/pi-hermes-memory/tests/project-rebinding.test.ts +115 -0
- package/dist/extensions/pi-hermes-memory/tests/project.test.ts +120 -0
- package/dist/extensions/pi-hermes-memory/tests/run-all-timeout.test.ts +107 -0
- package/dist/extensions/pi-hermes-memory/tests/run-all.sh +45 -0
- package/dist/extensions/pi-hermes-memory/tests/store/atomic-lock-coordinator.test.ts +381 -0
- package/dist/extensions/pi-hermes-memory/tests/store/content-scanner.test.ts +388 -0
- package/dist/extensions/pi-hermes-memory/tests/store/db.test.ts +1046 -0
- package/dist/extensions/pi-hermes-memory/tests/store/markdown-mutation-lock.test.ts +34 -0
- package/dist/extensions/pi-hermes-memory/tests/store/memory-store.test.ts +2150 -0
- package/dist/extensions/pi-hermes-memory/tests/store/recovery-maintenance.test.ts +170 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-anchor-search.test.ts +210 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-indexer.test.ts +643 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-parser.test.ts +282 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-search.test.ts +287 -0
- package/dist/extensions/pi-hermes-memory/tests/store/skill-store.test.ts +678 -0
- package/dist/extensions/pi-hermes-memory/tests/store/skill-utils.test.ts +21 -0
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-lazy-load.test.ts +78 -0
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-memory-store.test.ts +543 -0
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-native.test.ts +164 -0
- package/dist/extensions/pi-hermes-memory/tests/store/standing-instructions.test.ts +171 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/memory-search-tool.test.ts +84 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/memory-tool.test.ts +709 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/session-search-tool.test.ts +345 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/shared-output-view.test.ts +362 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/skill-tool.test.ts +478 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/tool-result-renderer-wiring.test.ts +40 -0
- package/dist/extensions/pi-hermes-memory/tsconfig.json +19 -0
- package/dist/extensions/pi-subagents/.oxlintrc.json +43 -0
- package/dist/extensions/pi-subagents/AGENTS.md +5 -0
- package/dist/extensions/pi-subagents/CHANGELOG.md +157 -0
- package/dist/extensions/pi-subagents/README.md +12 -6
- package/dist/extensions/pi-subagents/VISION.md +81 -0
- package/dist/extensions/pi-subagents/agents/claude-code-writer.md +15 -0
- package/dist/extensions/pi-subagents/agents/claude-code.md +15 -0
- package/dist/extensions/pi-subagents/agents/codex-exec-writer.md +15 -0
- package/dist/extensions/pi-subagents/agents/codex-exec.md +15 -0
- package/dist/extensions/pi-subagents/agents/cursor-agent-writer.md +14 -0
- package/dist/extensions/pi-subagents/agents/cursor-agent.md +14 -0
- package/dist/extensions/pi-subagents/agents/reviewer.md +1 -3
- package/dist/extensions/pi-subagents/docs/agents.md +488 -0
- package/dist/extensions/pi-subagents/docs/configuration.md +46 -9
- package/dist/extensions/pi-subagents/docs/extension-api.md +42 -3
- package/dist/extensions/pi-subagents/docs/models.md +27 -4
- package/dist/extensions/pi-subagents/docs/observability.md +10 -9
- package/dist/extensions/pi-subagents/docs/tool-reference.md +102 -6
- package/dist/extensions/pi-subagents/docs/workflows.md +135 -0
- package/dist/extensions/pi-subagents/package-lock.json +389 -2
- package/dist/extensions/pi-subagents/package.json +3 -1
- package/dist/extensions/pi-subagents/prompts/review-loop.md +2 -2
- package/dist/extensions/pi-subagents/skills/council-mode/SKILL.md +1 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +3 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +7 -3
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +2 -2
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +26 -5
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +41 -22
- package/dist/extensions/pi-subagents/src/agents/agent-refinements.ts +4 -4
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +9 -2
- package/dist/extensions/pi-subagents/src/agents/agents.ts +322 -75
- package/dist/extensions/pi-subagents/src/agents/builtin-names.ts +6 -0
- package/dist/extensions/pi-subagents/src/agents/runtime-agent-events.ts +70 -0
- package/dist/extensions/pi-subagents/src/agents/runtime-agent-registry.ts +27 -20
- package/dist/extensions/pi-subagents/src/api/agents.ts +10 -5
- package/dist/extensions/pi-subagents/src/api/background-work.ts +5 -1
- package/dist/extensions/pi-subagents/src/api/delegation.ts +0 -7
- package/dist/extensions/pi-subagents/src/api/preflight.ts +34 -12
- package/dist/extensions/pi-subagents/src/extension/config.ts +70 -0
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +3 -3
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +5 -3
- package/dist/extensions/pi-subagents/src/extension/index.ts +83 -30
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +44 -15
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +55 -19
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +41 -15
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +28 -31
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +2 -1
- package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +2 -10
- package/dist/extensions/pi-subagents/src/inspectors/herdr/session-roots-codec.ts +42 -0
- package/dist/extensions/pi-subagents/src/integrations/herdr-status.ts +51 -3
- package/dist/extensions/pi-subagents/src/intercom/result-intercom.ts +2 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +5 -6
- package/dist/extensions/pi-subagents/src/runs/background/active-async-capacity.ts +77 -10
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +176 -53
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +19 -12
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +29 -27
- package/dist/extensions/pi-subagents/src/runs/background/async-retention.ts +20 -3
- package/dist/extensions/pi-subagents/src/runs/background/async-status-snapshot.ts +23 -261
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +73 -7
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +8 -3
- package/dist/extensions/pi-subagents/src/runs/background/chain-root-attachment.ts +74 -8
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +37 -21
- package/dist/extensions/pi-subagents/src/runs/background/inspect-rpc.ts +8 -8
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +184 -9
- package/dist/extensions/pi-subagents/src/runs/background/result-delivery-ownership.ts +45 -0
- package/dist/extensions/pi-subagents/src/runs/background/result-files.ts +28 -14
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +38 -15
- package/dist/extensions/pi-subagents/src/runs/background/resume-guidance.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/background/retained-children.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +50 -13
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +93 -8
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +10 -4
- package/dist/extensions/pi-subagents/src/runs/background/steering.ts +4 -14
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +549 -377
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +58 -10
- package/dist/extensions/pi-subagents/src/runs/background/terminal-run-index.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +26 -1
- package/dist/extensions/pi-subagents/src/runs/background/wait-config.ts +23 -9
- package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +9 -2
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +2 -2
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +204 -129
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-control.ts +9 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +23 -1
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +773 -311
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-detach-reconcile.ts +140 -115
- package/dist/extensions/pi-subagents/src/runs/shared/abort-recovery.ts +119 -0
- package/dist/extensions/pi-subagents/src/runs/shared/async-status-projection.ts +463 -0
- package/dist/extensions/pi-subagents/src/runs/shared/child-identity.ts +19 -4
- package/dist/extensions/pi-subagents/src/runs/shared/child-launch-plan.ts +151 -0
- package/dist/extensions/pi-subagents/src/runs/shared/child-protocol.ts +21 -7
- package/dist/extensions/pi-subagents/src/runs/shared/claude-code-adapter.ts +129 -0
- package/dist/extensions/pi-subagents/src/runs/shared/codex-exec-adapter.ts +129 -0
- package/dist/extensions/pi-subagents/src/runs/shared/completion-evidence.ts +89 -0
- package/dist/extensions/pi-subagents/src/runs/shared/completion-guard.ts +5 -4
- package/dist/extensions/pi-subagents/src/runs/shared/cursor-agent-adapter.ts +114 -0
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-contract.ts +167 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-preflight.ts +122 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +348 -55
- package/dist/extensions/pi-subagents/src/runs/shared/fast-mode-extension.ts +5 -5
- package/dist/extensions/pi-subagents/src/runs/shared/host-step-status.ts +230 -0
- package/dist/extensions/pi-subagents/src/runs/shared/lane-metadata.ts +105 -0
- package/dist/extensions/pi-subagents/src/runs/shared/launch-cwd.ts +16 -0
- package/dist/extensions/pi-subagents/src/runs/shared/long-running-guard.ts +2 -1
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-config-sources.ts +422 -0
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +221 -158
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-grant.ts +197 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-exclusions.ts +69 -7
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +47 -6
- package/dist/extensions/pi-subagents/src/runs/shared/mutation-evidence.ts +7 -2
- package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +9 -3
- package/dist/extensions/pi-subagents/src/runs/shared/nested-render.ts +9 -5
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +419 -7
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +15 -1
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +81 -8
- package/dist/extensions/pi-subagents/src/runs/shared/process-signal.ts +13 -0
- package/dist/extensions/pi-subagents/src/runs/shared/run-history.ts +21 -1
- package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +44 -4
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +98 -13
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-startup-retry.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/worktree-cleanup-plan.ts +847 -0
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +18 -0
- package/dist/extensions/pi-subagents/src/shared/child-session-name.ts +46 -0
- package/dist/extensions/pi-subagents/src/shared/extension-context.ts +24 -0
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +21 -0
- package/dist/extensions/pi-subagents/src/shared/formatters.ts +18 -3
- package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +5 -1
- package/dist/extensions/pi-subagents/src/shared/pruned-fork.ts +450 -0
- package/dist/extensions/pi-subagents/src/shared/session-file-trust.ts +19 -0
- package/dist/extensions/pi-subagents/src/shared/session-tokens.ts +14 -3
- package/dist/extensions/pi-subagents/src/shared/settings.ts +19 -105
- package/dist/extensions/pi-subagents/src/shared/shortcuts.ts +17 -0
- package/dist/extensions/pi-subagents/src/shared/types.ts +359 -40
- package/dist/extensions/pi-subagents/src/shared/utils.ts +41 -84
- package/dist/extensions/pi-subagents/src/shared/workflow-child-permit.ts +116 -0
- package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +1 -9
- package/dist/extensions/pi-subagents/src/slash/delegation-request.ts +0 -4
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +1 -2
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +378 -88
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +22 -11
- package/dist/extensions/pi-subagents/src/slash/subagents-admin.ts +3 -0
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +147 -79
- package/dist/extensions/pi-subagents/src/tui/fleet-transcript.ts +11 -5
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +39 -18
- package/dist/extensions/pi-subagents/src/tui/render.ts +369 -46
- package/dist/extensions/pi-subagents/src/watchdog/turn-delta.ts +1 -1
- package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +6 -3
- package/dist/extensions/pi-subagents/src/workflows/host-command.ts +230 -0
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +740 -58
- package/dist/extensions/pi-subagents/src/workflows/workflow-child-summary.ts +121 -0
- package/dist/extensions/pi-subagents/src/workflows/workflow-preflight.ts +270 -0
- package/dist/extensions/pi-subagents/src/workflows/workflow-receipt.ts +195 -6
- package/dist/extensions/pi-subagents/src/workflows/workflow-settlement.ts +246 -0
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +1114 -260
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +34 -0
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +150 -3
- package/dist/extensions/pi-subagents/test/integration/claude-code-smoke.test.ts +52 -0
- package/dist/extensions/pi-subagents/test/integration/claude-code-writer-smoke.test.ts +55 -0
- package/dist/extensions/pi-subagents/test/integration/codex-exec-smoke.test.ts +53 -0
- package/dist/extensions/pi-subagents/test/integration/codex-exec-writer-smoke.test.ts +57 -0
- package/dist/extensions/pi-subagents/test/integration/cursor-agent-smoke.test.ts +59 -0
- package/dist/extensions/pi-subagents/test/integration/cursor-agent-writer-smoke.test.ts +62 -0
- package/dist/extensions/pi-subagents/test/integration/error-handling.test.ts +57 -1
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +20 -0
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +4 -3
- package/dist/extensions/pi-subagents/test/integration/orca-progress-tabs.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +54 -4
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +482 -4
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +157 -9
- package/dist/extensions/pi-subagents/test/integration/session-tokens.test.ts +5 -5
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +1508 -291
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +423 -1
- package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +8 -0
- package/dist/extensions/pi-subagents/test/support/cursor-smoke-inputs.ts +51 -0
- package/dist/extensions/pi-subagents/test/support/helpers.ts +2 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +5 -5
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +6 -6
- package/dist/extensions/pi-subagents/test/unit/abort-recovery.test.ts +152 -0
- package/dist/extensions/pi-subagents/test/unit/active-async-capacity.test.ts +48 -0
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +184 -6
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +66 -6
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +77 -0
- package/dist/extensions/pi-subagents/test/unit/agent-refinements.test.ts +18 -0
- package/dist/extensions/pi-subagents/test/unit/anti-slop-oxlint.test.ts +86 -0
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +101 -1
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +121 -0
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +28 -0
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +14 -7
- package/dist/extensions/pi-subagents/test/unit/async-retention.test.ts +53 -0
- package/dist/extensions/pi-subagents/test/unit/async-status-projection.test.ts +190 -0
- package/dist/extensions/pi-subagents/test/unit/async-status-snapshot.test.ts +42 -0
- package/dist/extensions/pi-subagents/test/unit/auto-drain.test.ts +8 -4
- package/dist/extensions/pi-subagents/test/unit/background-work.test.ts +23 -0
- package/dist/extensions/pi-subagents/test/unit/chain-root-attachment.test.ts +78 -1
- package/dist/extensions/pi-subagents/test/unit/child-launch-plan.test.ts +94 -0
- package/dist/extensions/pi-subagents/test/unit/child-protocol.test.ts +21 -0
- package/dist/extensions/pi-subagents/test/unit/child-session-name.test.ts +50 -0
- package/dist/extensions/pi-subagents/test/unit/claude-code-adapter.test.ts +245 -0
- package/dist/extensions/pi-subagents/test/unit/codex-exec-adapter.test.ts +192 -0
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +27 -0
- package/dist/extensions/pi-subagents/test/unit/completion-evidence.test.ts +150 -0
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +21 -0
- package/dist/extensions/pi-subagents/test/unit/cursor-agent-adapter.test.ts +259 -0
- package/dist/extensions/pi-subagents/test/unit/cursor-smoke-inputs.test.ts +77 -0
- package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +1 -4
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/extension-context.test.ts +27 -0
- package/dist/extensions/pi-subagents/test/unit/external-cli-runner.test.ts +223 -0
- package/dist/extensions/pi-subagents/test/unit/fast-mode-extension.test.ts +27 -0
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +208 -2
- package/dist/extensions/pi-subagents/test/unit/fleet-transcript.test.ts +29 -1
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +110 -1
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +10 -0
- package/dist/extensions/pi-subagents/test/unit/formatters.test.ts +14 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +18 -9
- package/dist/extensions/pi-subagents/test/unit/herdr-session-roots-codec.test.ts +63 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-shell-command.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +132 -0
- package/dist/extensions/pi-subagents/test/unit/host-command.test.ts +156 -0
- package/dist/extensions/pi-subagents/test/unit/host-step-status.test.ts +98 -0
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +178 -26
- package/dist/extensions/pi-subagents/test/unit/index-segment.test.ts +2 -1
- package/dist/extensions/pi-subagents/test/unit/inspect-rpc.test.ts +21 -0
- package/dist/extensions/pi-subagents/test/unit/mcp-direct-tool-grant.test.ts +138 -0
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/model-exclusions.test.ts +91 -0
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +72 -7
- package/dist/extensions/pi-subagents/test/unit/mutation-evidence.test.ts +21 -0
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +20 -2
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +129 -1
- package/dist/extensions/pi-subagents/test/unit/orca-progress-tabs.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +4 -0
- package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +358 -0
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +574 -21
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +109 -1
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +71 -1
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +7 -7
- package/dist/extensions/pi-subagents/test/unit/pruned-fork.test.ts +214 -0
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +29 -8
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +53 -0
- package/dist/extensions/pi-subagents/test/unit/result-delivery-ownership.test.ts +34 -0
- package/dist/extensions/pi-subagents/test/unit/result-files.test.ts +101 -3
- package/dist/extensions/pi-subagents/test/unit/retained-children.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +10 -8
- package/dist/extensions/pi-subagents/test/unit/run-fanout-budget.test.ts +71 -1
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +41 -7
- package/dist/extensions/pi-subagents/test/unit/runtime-agent-registration.test.ts +136 -2
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +137 -0
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +33 -12
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +504 -1
- package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +8 -0
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +12 -1
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +3 -5
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +5 -6
- package/dist/extensions/pi-subagents/test/unit/subagent-action-recovery.test.ts +0 -8
- package/dist/extensions/pi-subagents/test/unit/subagent-guide.test.ts +5 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +157 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-startup-retry.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +63 -4
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +27 -23
- package/dist/extensions/pi-subagents/test/unit/wait-completions.test.ts +44 -0
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/unit/widget-nested-render.test.ts +7 -5
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +106 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-detach-reconcile.test.ts +484 -9
- package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +38 -4
- package/dist/extensions/pi-subagents/test/unit/workflow-preflight.test.ts +155 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-receipt.test.ts +318 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-resume-hint.test.ts +365 -0
- package/dist/extensions/pi-subagents/test/unit/worktree-cleanup-plan.test.ts +349 -0
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +21 -0
- package/dist/extensions/pi-subagents/test/unit/writer-budget-guidance.test.ts +2 -7
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/effect/index.ts +13 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/effect/rules/no-service-constructor-imports.ts +52 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/index.ts +41 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-chained-type-assertions.ts +77 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-conditional-empty-object-spread.ts +49 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-known-value-widening.ts +247 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-module-mocking.ts +91 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-object-parameters.ts +126 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-reflect-apply.ts +28 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-reflect-get.ts +28 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-runtime-typeof.ts +67 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-shape-in-symbol-names.ts +39 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-parameters.ts +83 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-returns.ts +115 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-type-aliases.ts +72 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unsafe-dictionary-type.ts +134 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-widen-then-assert.ts +366 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/require-safety-comment-for-type-assertion.ts +62 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/dictionary-types.ts +502 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/lexical-type-parameters.ts +60 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/reflect-method.ts +35 -0
- package/dist/extensions/pi-tool-display/tests/capabilities.test.ts +1 -1
- package/dist/extensions/pi-tool-display/tests/settings-inspector.test.ts +2 -2
- package/dist/extensions/pi-tool-display/tests/tool-overrides-mcp.test.ts +1 -1
- package/dist/extensions/pi-zentui/extensions/zentui/format.ts +2 -1
- package/dist/extensions/pi-zentui/test/format.test.ts +15 -1
- package/dist/modes/interactive/components/footer.js +2 -2
- package/dist/modes/interactive/interactive-mode.js +11 -11
- package/dist/skills/workflow/SKILL.md +65 -50
- package/package.json +112 -110
- package/dist/extensions/enable-readonly-tools.test.ts +0 -63
- package/dist/extensions/enable-readonly-tools.ts +0 -24
- package/dist/extensions/model-prompt-injector/config.json +0 -16
- package/dist/extensions/model-prompt-injector/index.test.ts +0 -102
- package/dist/extensions/model-prompt-injector/index.ts +0 -148
- package/dist/extensions/pi-subagents/src/runs/shared/turn-budget.ts +0 -98
- package/dist/extensions/pi-subagents/test/unit/turn-budget.test.ts +0 -250
|
@@ -3,10 +3,13 @@ import { describe, it } from "node:test";
|
|
|
3
3
|
import { visibleWidth } from "@earendil-works/pi-tui";
|
|
4
4
|
import { extractToolArgsPreview } from "../../src/shared/utils.ts";
|
|
5
5
|
|
|
6
|
-
const { buildWidgetLines, clearLegacyResultAnimationTimer, renderWidget } = await import("../../src/tui/render.ts") as {
|
|
6
|
+
const { buildWidgetLines, clearLegacyResultAnimationTimer, compactTaskText, projectAsyncLane, renderWidget, widgetRenderKey } = await import("../../src/tui/render.ts") as {
|
|
7
7
|
buildWidgetLines: (jobs: Array<Record<string, unknown>>, theme: { fg(name: string, text: string): string; bold(text: string): string }, width?: number, expanded?: boolean, frame?: number) => string[];
|
|
8
8
|
clearLegacyResultAnimationTimer: (context: { state: { subagentResultAnimationTimer?: ReturnType<typeof setInterval> } }) => void;
|
|
9
|
+
compactTaskText: (task: string | undefined, label?: string) => string | undefined;
|
|
10
|
+
projectAsyncLane: (job: Record<string, unknown>) => { label?: string; role: string; phase?: string; state: string; gate?: string; next?: string; output?: string; workspace?: string; ref: string; chips: string[] } | undefined;
|
|
9
11
|
renderWidget: (ctx: Record<string, unknown>, jobs: Array<Record<string, unknown>>) => void;
|
|
12
|
+
widgetRenderKey: (job: Record<string, unknown>, expanded?: boolean) => string;
|
|
10
13
|
};
|
|
11
14
|
|
|
12
15
|
const theme = {
|
|
@@ -88,6 +91,350 @@ function resetWidgetLayout(): void {
|
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
describe("subagent async widget rendering", () => {
|
|
94
|
+
it("renders compact workflow plan status by default and keeps details expanded", () => {
|
|
95
|
+
const job = {
|
|
96
|
+
asyncId: "workflow-preflight",
|
|
97
|
+
asyncDir: "/tmp/workflow-preflight",
|
|
98
|
+
status: "running",
|
|
99
|
+
mode: "workflow",
|
|
100
|
+
preflight: {
|
|
101
|
+
version: 1,
|
|
102
|
+
coverage: "partial",
|
|
103
|
+
lanes: [{ key: "review", mode: "review", claims: ["src/tui"], expectedOutput: "review.md" }],
|
|
104
|
+
},
|
|
105
|
+
workflow: {
|
|
106
|
+
trace: [],
|
|
107
|
+
emits: [],
|
|
108
|
+
console: [],
|
|
109
|
+
preflightWarnings: ["Preflight advisory: workflow key 'review.extra' launched without a declared lane."],
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
const compact = buildWidgetLines([job], theme, 180).join("\n");
|
|
113
|
+
assert.match(compact, /Plan: 1 lane · review/);
|
|
114
|
+
assert.match(compact, /Plan note: 1 preflight mismatch · expand for debug\./);
|
|
115
|
+
assert.doesNotMatch(compact, /key \| mode \| decision \| claims \| expected output \| independence/);
|
|
116
|
+
assert.doesNotMatch(compact, /review \| review \|/);
|
|
117
|
+
assert.doesNotMatch(compact, /Preflight advisory/);
|
|
118
|
+
|
|
119
|
+
const expanded = buildWidgetLines([job], theme, 180, true).join("\n");
|
|
120
|
+
assert.match(expanded, /Preflight: v1 · partial · 1 lane/);
|
|
121
|
+
assert.match(expanded, /review \| review \|/);
|
|
122
|
+
assert.match(expanded, /expected output \| independence/);
|
|
123
|
+
assert.match(expanded, /Preflight warnings:/);
|
|
124
|
+
assert.match(expanded, /review\.extra.*without a declared lane/);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it("projects known workflow metadata into a compact lane row", () => {
|
|
128
|
+
const job = {
|
|
129
|
+
asyncId: "lane-run-123456",
|
|
130
|
+
asyncDir: "/tmp/lane-run",
|
|
131
|
+
status: "running",
|
|
132
|
+
mode: "parallel",
|
|
133
|
+
agents: ["reviewer", "writer"],
|
|
134
|
+
steps: [
|
|
135
|
+
{
|
|
136
|
+
index: 0,
|
|
137
|
+
agent: "reviewer",
|
|
138
|
+
status: "running",
|
|
139
|
+
phase: "fresh-review",
|
|
140
|
+
label: "Review #1610",
|
|
141
|
+
workflowKey: "review",
|
|
142
|
+
description: "Inspect the current status surface",
|
|
143
|
+
outputName: "review.md",
|
|
144
|
+
context: "fresh",
|
|
145
|
+
review: { status: "review-required" },
|
|
146
|
+
},
|
|
147
|
+
{ index: 1, agent: "writer", status: "pending", phase: "implementation", label: "Fix candidate", workflowKey: "writer", outputName: "fix.md" },
|
|
148
|
+
],
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
assert.deepEqual(projectAsyncLane(job), {
|
|
152
|
+
label: "Review #1610 — Inspect the current status surface",
|
|
153
|
+
role: "reviewer",
|
|
154
|
+
phase: "fresh-review",
|
|
155
|
+
state: "running",
|
|
156
|
+
gate: "review required",
|
|
157
|
+
next: "review output",
|
|
158
|
+
output: "review.md",
|
|
159
|
+
ref: "review",
|
|
160
|
+
chips: ["fresh"],
|
|
161
|
+
});
|
|
162
|
+
const text = buildWidgetLines([job], theme, 180).join("\n");
|
|
163
|
+
assert.match(text, /Review #1610 — Inspect the current status surface · role:reviewer · running/);
|
|
164
|
+
assert.match(text, /phase:fresh-review · gate:review required · next:review output · out:review\.md · ref:review · \[fresh\]/);
|
|
165
|
+
assert.match(text, /Fix candidate/);
|
|
166
|
+
assert.match(text, /Fix candidate · role:writer · pending/);
|
|
167
|
+
assert.match(text, /phase:implementation · next:await launch · out:fix\.md/);
|
|
168
|
+
assert.doesNotMatch(text, /lane:/);
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it("prefers bounded loaded workspace context over repeated internal lane refs", () => {
|
|
172
|
+
const workspacePath = `/tmp/workspaces/${"project-".repeat(16)}`;
|
|
173
|
+
const job = {
|
|
174
|
+
asyncId: "workspace-run",
|
|
175
|
+
asyncDir: "/tmp/workspace-run",
|
|
176
|
+
cwd: workspacePath,
|
|
177
|
+
status: "running",
|
|
178
|
+
mode: "single",
|
|
179
|
+
agents: ["reviewer"],
|
|
180
|
+
workflowKey: "internal-workflow-key",
|
|
181
|
+
steps: [{ index: 0, agent: "reviewer", status: "running", workflowKey: "internal-workflow-key" }],
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const lane = projectAsyncLane(job);
|
|
185
|
+
assert.equal(lane?.ref, "internal-workflow-key");
|
|
186
|
+
assert.ok(lane?.workspace);
|
|
187
|
+
assert.ok((lane.workspace?.length ?? 0) <= 48, "workspace display should stay bounded");
|
|
188
|
+
assert.match(lane?.workspace ?? "", /^\/tmp\/workspaces\/project-/);
|
|
189
|
+
assert.match(lane?.workspace ?? "", /\.\.\.$/);
|
|
190
|
+
|
|
191
|
+
const text = buildWidgetLines([job], theme, 180, true).join("\n");
|
|
192
|
+
assert.match(text, /workspace:\/tmp\/workspaces\/project-/);
|
|
193
|
+
assert.doesNotMatch(text, /ref:internal-workflow-key/);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it("shows workspace context in expanded single and parallel/chain rows", () => {
|
|
197
|
+
for (const mode of ["single", "parallel", "chain"] as const) {
|
|
198
|
+
const workflowKey = `${mode}-workflow-key`;
|
|
199
|
+
const workspace = `/tmp/${mode}-workspace`;
|
|
200
|
+
const job = {
|
|
201
|
+
asyncId: `${mode}-workspace-run`,
|
|
202
|
+
asyncDir: `/tmp/${mode}-workspace-run`,
|
|
203
|
+
cwd: workspace,
|
|
204
|
+
status: "running",
|
|
205
|
+
mode,
|
|
206
|
+
agents: ["worker"],
|
|
207
|
+
steps: [{ index: 0, agent: "worker", status: "running", workflowKey }],
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
const text = buildWidgetLines([job], theme, 180, true).join("\n");
|
|
211
|
+
assert.match(text, new RegExp(`workspace:${escapeRegExp(workspace)}`));
|
|
212
|
+
assert.doesNotMatch(text, new RegExp(`ref:${escapeRegExp(workflowKey)}`));
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
it("keeps the bounded workflow-key fallback when no workspace is loaded", () => {
|
|
217
|
+
const workflowKey = `internal-${"workflow-key-".repeat(8)}`;
|
|
218
|
+
const job = {
|
|
219
|
+
asyncId: "fallback-ref-run",
|
|
220
|
+
asyncDir: "/tmp/fallback-ref-run",
|
|
221
|
+
status: "running",
|
|
222
|
+
mode: "single",
|
|
223
|
+
agents: ["worker"],
|
|
224
|
+
workflowKey,
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const lane = projectAsyncLane(job);
|
|
228
|
+
assert.equal(lane?.workspace, undefined);
|
|
229
|
+
assert.ok(lane?.ref);
|
|
230
|
+
assert.ok((lane.ref.length) <= 24, "workflow-key fallback should stay bounded");
|
|
231
|
+
const text = buildWidgetLines([job], theme, 180, true).join("\n");
|
|
232
|
+
assert.match(text, new RegExp(`ref:${escapeRegExp(lane?.ref ?? "")}`));
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
it("uses workspace context in compact progressive lane headers", () => {
|
|
236
|
+
resetWidgetLayout();
|
|
237
|
+
withStdoutSize(22, 120, () => {
|
|
238
|
+
const workspace = "/tmp/compact-workspace";
|
|
239
|
+
const job = {
|
|
240
|
+
asyncId: "compact-workspace-run",
|
|
241
|
+
asyncDir: "/tmp/compact-workspace-run",
|
|
242
|
+
cwd: workspace,
|
|
243
|
+
status: "running",
|
|
244
|
+
mode: "single",
|
|
245
|
+
agents: ["worker"],
|
|
246
|
+
workflowKey: "compact-workflow-key",
|
|
247
|
+
currentTool: "read",
|
|
248
|
+
};
|
|
249
|
+
const ui = createUiContext();
|
|
250
|
+
renderWidget(ui.ctx as never, [job]);
|
|
251
|
+
const text = renderWidgetLines(ui.widgets.at(-1)).join("\n");
|
|
252
|
+
assert.match(text, new RegExp(`workspace:${escapeRegExp(workspace)}`));
|
|
253
|
+
assert.doesNotMatch(text, /ref:compact-workflow-key/);
|
|
254
|
+
});
|
|
255
|
+
resetWidgetLayout();
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it("refreshes widget render keys when loaded workspace changes", () => {
|
|
259
|
+
const base = {
|
|
260
|
+
asyncId: "render-key-workspace-run",
|
|
261
|
+
asyncDir: "/tmp/render-key-workspace-run",
|
|
262
|
+
status: "running",
|
|
263
|
+
mode: "single",
|
|
264
|
+
agents: ["worker"],
|
|
265
|
+
workflowKey: "render-key-workflow",
|
|
266
|
+
};
|
|
267
|
+
assert.notEqual(
|
|
268
|
+
widgetRenderKey({ ...base, cwd: "/tmp/workspace-one" }),
|
|
269
|
+
widgetRenderKey({ ...base, cwd: "/tmp/workspace-two" }),
|
|
270
|
+
);
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
it("renders loaded host CI and gate nodes without creating child lanes", () => {
|
|
274
|
+
const job = {
|
|
275
|
+
asyncId: "host-run",
|
|
276
|
+
asyncDir: "/tmp/host-run",
|
|
277
|
+
status: "running",
|
|
278
|
+
mode: "workflow",
|
|
279
|
+
agents: [],
|
|
280
|
+
hostSteps: [
|
|
281
|
+
{
|
|
282
|
+
version: 1,
|
|
283
|
+
kind: "host-step",
|
|
284
|
+
monitorKind: "ci",
|
|
285
|
+
id: "ci-1",
|
|
286
|
+
label: "CI checks",
|
|
287
|
+
provider: "local-tests",
|
|
288
|
+
state: "running",
|
|
289
|
+
target: "PR #1614",
|
|
290
|
+
updatedAt: 10,
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
version: 1,
|
|
294
|
+
kind: "host-step",
|
|
295
|
+
monitorKind: "gate",
|
|
296
|
+
id: "gate-1",
|
|
297
|
+
label: "Review gate",
|
|
298
|
+
provider: "opaque-provider",
|
|
299
|
+
state: "done",
|
|
300
|
+
verdict: "inconclusive",
|
|
301
|
+
reasonCode: "stale-head",
|
|
302
|
+
freshness: { expectedRef: "old", observedRef: "new", stale: true },
|
|
303
|
+
reportPath: "/tmp/reports/gate.json",
|
|
304
|
+
updatedAt: 20,
|
|
305
|
+
},
|
|
306
|
+
],
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
const text = buildWidgetLines([job], theme, 180).join("\n");
|
|
310
|
+
assert.match(text, /ci: CI checks · running · provider:local-tests · PR #1614/);
|
|
311
|
+
assert.match(text, /gate: Review gate · inconclusive · provider:opaque-provider · reason:stale-head · stale · out:gate.json/);
|
|
312
|
+
assert.doesNotMatch(text, /async subagent .*CI checks/);
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
it("keeps simple one-off async rows on the existing fallback projection", () => {
|
|
316
|
+
const job = {
|
|
317
|
+
asyncId: "simple-run",
|
|
318
|
+
asyncDir: "/tmp/simple-run",
|
|
319
|
+
cwd: "/repo/simple",
|
|
320
|
+
status: "running",
|
|
321
|
+
mode: "single",
|
|
322
|
+
agents: ["scout"],
|
|
323
|
+
description: "Explore the repository",
|
|
324
|
+
outputFile: "/tmp/simple-run/output-0.log",
|
|
325
|
+
currentTool: "read",
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
assert.equal(projectAsyncLane(job), undefined);
|
|
329
|
+
const text = buildWidgetLines([job], theme, 180).join("\n");
|
|
330
|
+
assert.match(text, /async subagent scout · background/);
|
|
331
|
+
assert.match(text, /⎿ read/);
|
|
332
|
+
assert.doesNotMatch(text, /lane:/);
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
it("keeps lane state and next-action signals distinct for terminal and attention states", () => {
|
|
336
|
+
const states = [
|
|
337
|
+
{ status: "complete", expectedState: "complete", expectedNext: "inspect output" },
|
|
338
|
+
{ status: "failed", expectedState: "failed", expectedNext: "inspect failure" },
|
|
339
|
+
{ status: "paused", expectedState: "paused", expectedNext: "inspect paused state" },
|
|
340
|
+
{ status: "stopped", expectedState: "stopped", expectedNext: "inspect stopped state" },
|
|
341
|
+
] as const;
|
|
342
|
+
for (const [index, candidate] of states.entries()) {
|
|
343
|
+
const lane = projectAsyncLane({
|
|
344
|
+
asyncId: `state-${index}`,
|
|
345
|
+
asyncDir: `/tmp/state-${index}`,
|
|
346
|
+
status: candidate.status,
|
|
347
|
+
mode: "single",
|
|
348
|
+
agents: ["worker"],
|
|
349
|
+
workflowKey: "stateful",
|
|
350
|
+
description: "stateful work item",
|
|
351
|
+
steps: [{ agent: "worker", status: candidate.status, outputName: "result.md" }],
|
|
352
|
+
});
|
|
353
|
+
assert.equal(lane?.state, candidate.expectedState);
|
|
354
|
+
assert.equal(lane?.next, candidate.expectedNext);
|
|
355
|
+
}
|
|
356
|
+
const attention = projectAsyncLane({
|
|
357
|
+
asyncId: "attention",
|
|
358
|
+
asyncDir: "/tmp/attention",
|
|
359
|
+
status: "running",
|
|
360
|
+
mode: "single",
|
|
361
|
+
agents: ["reviewer"],
|
|
362
|
+
steps: [{ agent: "reviewer", status: "running", label: "Review", activityState: "needs_attention" }],
|
|
363
|
+
});
|
|
364
|
+
assert.equal(attention?.next, "inspect attention");
|
|
365
|
+
assert.deepEqual(attention?.chips, ["attention"]);
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
it("surfaces stale and tool/turn budget blocked states", () => {
|
|
369
|
+
const staleJob = {
|
|
370
|
+
asyncId: "stale-run",
|
|
371
|
+
asyncDir: "/tmp/stale-run",
|
|
372
|
+
status: "running",
|
|
373
|
+
mode: "single",
|
|
374
|
+
agents: ["worker"],
|
|
375
|
+
steps: [{ agent: "worker", status: "running", label: "Stale work", watchdog: { phase: "stale" } }],
|
|
376
|
+
};
|
|
377
|
+
const stale = projectAsyncLane(staleJob);
|
|
378
|
+
assert.equal(stale?.next, "inspect stale state");
|
|
379
|
+
assert.deepEqual(stale?.chips, ["stale"]);
|
|
380
|
+
|
|
381
|
+
const blockedJobs: Array<Record<string, unknown>> = [];
|
|
382
|
+
for (const [index, field] of (["toolBudgetBlocked", "turnBudgetExceeded"] as const).entries()) {
|
|
383
|
+
const blockedJob = {
|
|
384
|
+
asyncId: `blocked-run-${index}`,
|
|
385
|
+
asyncDir: `/tmp/blocked-run-${index}`,
|
|
386
|
+
status: "running",
|
|
387
|
+
mode: "single",
|
|
388
|
+
agents: ["worker"],
|
|
389
|
+
steps: [{ agent: "worker", status: "running", label: "Blocked work", [field]: true }],
|
|
390
|
+
};
|
|
391
|
+
blockedJobs.push(blockedJob);
|
|
392
|
+
const blocked = projectAsyncLane(blockedJob);
|
|
393
|
+
assert.equal(blocked?.next, "inspect blocked state");
|
|
394
|
+
assert.deepEqual(blocked?.chips, ["blocked"]);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
const text = buildWidgetLines([staleJob, ...blockedJobs], theme, 180).join("\n");
|
|
398
|
+
assert.match(text, /next:inspect stale state/);
|
|
399
|
+
assert.match(text, /\[stale\]/);
|
|
400
|
+
assert.match(text, /next:inspect blocked state/);
|
|
401
|
+
assert.match(text, /\[blocked\]/);
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
it("keeps stale and blocked lane signals in crowded progressive rows", () => {
|
|
405
|
+
resetWidgetLayout();
|
|
406
|
+
withStdoutSize(22, 120, () => {
|
|
407
|
+
const jobs = [
|
|
408
|
+
{
|
|
409
|
+
asyncId: "progressive-stale",
|
|
410
|
+
asyncDir: "/tmp/progressive-stale",
|
|
411
|
+
status: "running",
|
|
412
|
+
mode: "single",
|
|
413
|
+
agents: ["watcher"],
|
|
414
|
+
steps: [{ agent: "watcher", status: "running", label: "Stale lane", watchdog: { phase: "stale" } }],
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
asyncId: "progressive-blocked",
|
|
418
|
+
asyncDir: "/tmp/progressive-blocked",
|
|
419
|
+
status: "running",
|
|
420
|
+
mode: "single",
|
|
421
|
+
agents: ["budgeter"],
|
|
422
|
+
steps: [{ agent: "budgeter", status: "running", label: "Blocked lane", toolBudgetBlocked: true }],
|
|
423
|
+
},
|
|
424
|
+
];
|
|
425
|
+
const ui = createUiContext();
|
|
426
|
+
renderWidget(ui.ctx as never, jobs);
|
|
427
|
+
const lines = renderWidgetLines(ui.widgets.at(-1));
|
|
428
|
+
assert.equal(lines.length, 3, "22 terminal rows should select the collapsed progressive tier");
|
|
429
|
+
const text = lines.join("\n");
|
|
430
|
+
assert.match(text, /next:inspect stale state/);
|
|
431
|
+
assert.match(text, /\[stale\]/);
|
|
432
|
+
assert.match(text, /next:inspect blocked state/);
|
|
433
|
+
assert.match(text, /\[blocked\]/);
|
|
434
|
+
});
|
|
435
|
+
resetWidgetLayout();
|
|
436
|
+
});
|
|
437
|
+
|
|
91
438
|
it("orders running jobs before queued summaries and completions", () => {
|
|
92
439
|
const lines = buildWidgetLines([
|
|
93
440
|
{ asyncId: "done-1", asyncDir: "/tmp/done", status: "complete", agents: ["reviewer"], startedAt: 0, updatedAt: 1000 },
|
|
@@ -176,6 +523,66 @@ describe("subagent async widget rendering", () => {
|
|
|
176
523
|
assert.doesNotMatch(text, /reviewer → reviewer → reviewer/);
|
|
177
524
|
});
|
|
178
525
|
|
|
526
|
+
it("distinguishes same-agent parallel rows with explicit labels", () => {
|
|
527
|
+
const lines = buildWidgetLines([{
|
|
528
|
+
asyncId: "run-labels",
|
|
529
|
+
asyncDir: "/tmp/labels",
|
|
530
|
+
status: "running",
|
|
531
|
+
mode: "parallel",
|
|
532
|
+
agents: ["reviewer", "reviewer"],
|
|
533
|
+
activeParallelGroup: true,
|
|
534
|
+
runningSteps: 2,
|
|
535
|
+
completedSteps: 0,
|
|
536
|
+
stepsTotal: 2,
|
|
537
|
+
steps: [
|
|
538
|
+
{ index: 0, agent: "reviewer", label: "Review auth", description: "private auth task", status: "running" },
|
|
539
|
+
{ index: 1, agent: "reviewer", label: "Review billing", description: "private billing task", status: "running" },
|
|
540
|
+
],
|
|
541
|
+
}, {
|
|
542
|
+
asyncId: "done",
|
|
543
|
+
asyncDir: "/tmp/done",
|
|
544
|
+
status: "complete",
|
|
545
|
+
mode: "single",
|
|
546
|
+
agents: ["worker"],
|
|
547
|
+
startedAt: 0,
|
|
548
|
+
updatedAt: 1,
|
|
549
|
+
}], theme, 120);
|
|
550
|
+
|
|
551
|
+
const text = lines.join("\n");
|
|
552
|
+
assert.match(text, /Agent 1\/2: Review auth — private auth task \(reviewer\) · running/);
|
|
553
|
+
assert.match(text, /Agent 2\/2: Review billing — private billing task \(reviewer\) · running/);
|
|
554
|
+
assert.equal(compactTaskText(" [prompt redacted] ", "Review auth"), "Review auth");
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
it("shows peak context usage and falls back to token usage without a limit", () => {
|
|
558
|
+
const step = {
|
|
559
|
+
index: 0,
|
|
560
|
+
agent: "reviewer",
|
|
561
|
+
status: "running" as const,
|
|
562
|
+
tokens: { input: 31_000, output: 10_000, total: 44_000, window: 31_000, windowPeak: 32_000 },
|
|
563
|
+
};
|
|
564
|
+
const withLimit = buildWidgetLines([{
|
|
565
|
+
asyncId: "run-context",
|
|
566
|
+
asyncDir: "/tmp/context",
|
|
567
|
+
status: "running" as const,
|
|
568
|
+
mode: "single" as const,
|
|
569
|
+
agents: ["reviewer"],
|
|
570
|
+
steps: [{ ...step, contextLimit: 128_000 }],
|
|
571
|
+
}], theme, 180).join("\n");
|
|
572
|
+
assert.match(withLimit, /ctx 32k\/128k \(25%\)/);
|
|
573
|
+
|
|
574
|
+
const withoutLimit = buildWidgetLines([{
|
|
575
|
+
asyncId: "run-context-fallback",
|
|
576
|
+
asyncDir: "/tmp/context-fallback",
|
|
577
|
+
status: "running" as const,
|
|
578
|
+
mode: "single" as const,
|
|
579
|
+
agents: ["reviewer"],
|
|
580
|
+
steps: [step],
|
|
581
|
+
}], theme, 180).join("\n");
|
|
582
|
+
assert.match(withoutLimit, /31k window · 44k spent/);
|
|
583
|
+
assert.doesNotMatch(withoutLimit, /ctx 32k\/128k/);
|
|
584
|
+
});
|
|
585
|
+
|
|
179
586
|
it("renders a compact component widget for three active parallel agents without core truncation", () => {
|
|
180
587
|
const now = Date.now();
|
|
181
588
|
const ui = createUiContext();
|
|
@@ -341,6 +748,48 @@ describe("subagent async widget rendering", () => {
|
|
|
341
748
|
resetWidgetLayout();
|
|
342
749
|
});
|
|
343
750
|
|
|
751
|
+
it("selects the current flat-indexed member from a collapsed parallel group", () => {
|
|
752
|
+
resetWidgetLayout();
|
|
753
|
+
withStdoutSize(22, 120, () => {
|
|
754
|
+
const parallelGroupJob = {
|
|
755
|
+
asyncId: "run-parallel-slice",
|
|
756
|
+
asyncDir: "/tmp/run-parallel-slice",
|
|
757
|
+
status: "running",
|
|
758
|
+
mode: "chain",
|
|
759
|
+
agents: ["producer", "reviewer", "worker"],
|
|
760
|
+
activeParallelGroup: true,
|
|
761
|
+
currentStep: 3,
|
|
762
|
+
chainStepCount: 2,
|
|
763
|
+
parallelGroups: [{ start: 2, count: 2, stepIndex: 1 }],
|
|
764
|
+
steps: [
|
|
765
|
+
{ index: 2, agent: "reviewer", status: "complete", label: "First parallel member", description: "First member task", phase: "first-phase", workflowKey: "first-ref", outputName: "first.md" },
|
|
766
|
+
{ index: 3, agent: "worker", status: "running", label: "Current parallel member", description: "Current member task", phase: "current-phase", workflowKey: "current-ref", outputName: "current.md" },
|
|
767
|
+
],
|
|
768
|
+
};
|
|
769
|
+
const direct = projectAsyncLane(parallelGroupJob);
|
|
770
|
+
assert.equal(direct?.label, "Current parallel member — Current member task");
|
|
771
|
+
assert.equal(direct?.role, "worker");
|
|
772
|
+
assert.equal(direct?.phase, "current-phase");
|
|
773
|
+
assert.equal(direct?.output, "current.md");
|
|
774
|
+
assert.equal(direct?.ref, "current-ref");
|
|
775
|
+
|
|
776
|
+
const ui = createUiContext();
|
|
777
|
+
renderWidget(ui.ctx as never, [parallelGroupJob, {
|
|
778
|
+
asyncId: "run-parallel-sibling",
|
|
779
|
+
asyncDir: "/tmp/run-parallel-sibling",
|
|
780
|
+
status: "running",
|
|
781
|
+
mode: "single",
|
|
782
|
+
agents: ["sibling"],
|
|
783
|
+
currentTool: "read",
|
|
784
|
+
}]);
|
|
785
|
+
const lines = renderWidgetLines(ui.widgets.at(-1));
|
|
786
|
+
const text = lines.join("\n");
|
|
787
|
+
assert.match(text, /Current parallel member — Current member task/);
|
|
788
|
+
assert.doesNotMatch(text, /First parallel member — First member task/);
|
|
789
|
+
});
|
|
790
|
+
resetWidgetLayout();
|
|
791
|
+
});
|
|
792
|
+
|
|
344
793
|
it("keeps constrained progressive slots focused on active jobs", () => {
|
|
345
794
|
resetWidgetLayout();
|
|
346
795
|
withStdoutSize(22, 120, () => {
|
|
@@ -428,7 +877,7 @@ describe("subagent async widget rendering", () => {
|
|
|
428
877
|
stepsTotal: 3,
|
|
429
878
|
updatedAt: now,
|
|
430
879
|
steps: [
|
|
431
|
-
{ agent: "reviewer", status: "running", lastActivityAt: now, toolCount: 2 },
|
|
880
|
+
{ agent: "reviewer", sessionName: " reviewer: Inspect the first row ", status: "running", lastActivityAt: now, toolCount: 2 },
|
|
432
881
|
{ agent: "reviewer", status: "running", currentTool: "read", currentToolStartedAt: now - 2000 },
|
|
433
882
|
{ agent: "reviewer", status: "complete", tokens: { input: 1000, output: 500, cache: 0, total: 1500 } },
|
|
434
883
|
],
|
|
@@ -438,13 +887,41 @@ describe("subagent async widget rendering", () => {
|
|
|
438
887
|
const text = lines.join("\n");
|
|
439
888
|
assert.match(text, /async subagent parallel \(3\) · background/);
|
|
440
889
|
assert.match(text, /parallel · 2 agents running · 1\/3 done/);
|
|
441
|
-
assert.match(text, /Agent 1\/3: reviewer · running · 2 tool uses/);
|
|
890
|
+
assert.match(text, /Agent 1\/3: reviewer: Inspect the first row · running · 2 tool uses/);
|
|
442
891
|
assert.match(text, /⎿ active now/);
|
|
443
892
|
assert.match(text, /Agent 2\/3: reviewer · running\n\s+⎿ read \| 2\.0s/);
|
|
444
893
|
assert.match(text, /Press configured-expand-key for live detail/);
|
|
445
894
|
assert.match(text, /Agent 3\/3: reviewer · complete · 1\.5k token/);
|
|
446
895
|
});
|
|
447
896
|
|
|
897
|
+
it("prefers session names in multi-job widget step rows", () => {
|
|
898
|
+
const text = buildWidgetLines([
|
|
899
|
+
{
|
|
900
|
+
asyncId: "run-multi-a",
|
|
901
|
+
asyncDir: "/tmp/multi-a",
|
|
902
|
+
status: "running",
|
|
903
|
+
mode: "parallel",
|
|
904
|
+
agents: ["reviewer"],
|
|
905
|
+
stepsTotal: 1,
|
|
906
|
+
runningSteps: 1,
|
|
907
|
+
completedSteps: 0,
|
|
908
|
+
steps: [{ index: 0, agent: "reviewer", sessionName: " reviewer: Inspect the multi-job row ", status: "running" }],
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
asyncId: "run-multi-b",
|
|
912
|
+
asyncDir: "/tmp/multi-b",
|
|
913
|
+
status: "complete",
|
|
914
|
+
mode: "single",
|
|
915
|
+
agents: ["worker"],
|
|
916
|
+
stepsTotal: 1,
|
|
917
|
+
steps: [{ index: 0, agent: "worker", status: "complete" }],
|
|
918
|
+
},
|
|
919
|
+
], theme, 180).join("\n");
|
|
920
|
+
|
|
921
|
+
assert.match(text, /Agent 1\/1: reviewer: Inspect the multi-job row · running/);
|
|
922
|
+
assert.doesNotMatch(text, /Agent 1\/1: reviewer · running/);
|
|
923
|
+
});
|
|
924
|
+
|
|
448
925
|
it("shows async job and step context badges", () => {
|
|
449
926
|
const now = Date.now();
|
|
450
927
|
const text = buildWidgetLines([
|
|
@@ -733,6 +1210,7 @@ describe("subagent async widget rendering", () => {
|
|
|
733
1210
|
{
|
|
734
1211
|
index: 0,
|
|
735
1212
|
agent: "worker",
|
|
1213
|
+
sessionName: " worker: Read the widget ",
|
|
736
1214
|
status: "running",
|
|
737
1215
|
currentTool: "read",
|
|
738
1216
|
currentToolArgs: "src/tui/render.ts",
|
|
@@ -744,7 +1222,7 @@ describe("subagent async widget rendering", () => {
|
|
|
744
1222
|
|
|
745
1223
|
const collapsedText = buildWidgetLines([job], theme, 180).join("\n");
|
|
746
1224
|
assert.match(collapsedText, /async subagent worker · background/);
|
|
747
|
-
assert.match(collapsedText, /Step 1\/1: worker · running/);
|
|
1225
|
+
assert.match(collapsedText, /Step 1\/1: worker: Read the widget · running/);
|
|
748
1226
|
assert.match(collapsedText, /⎿ read: src\/tui\/render\.ts \| 2\.0s/);
|
|
749
1227
|
assert.match(collapsedText, /Press configured-expand-key for live detail/);
|
|
750
1228
|
assert.match(collapsedText, outputPathPattern("/tmp/single-run/output-0.log"));
|