@selesai/code 0.9.11 → 0.9.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 +17 -0
- package/dist/config.d.ts +4 -6
- package/dist/config.js +10 -14
- package/dist/core/agent-session.d.ts +0 -1
- package/dist/core/agent-session.js +3 -49
- package/dist/core/extensions/types.d.ts +0 -2
- package/dist/core/settings-manager.d.ts +0 -2
- package/dist/core/settings-manager.js +0 -3
- package/dist/core/tools/index.d.ts +0 -1
- package/dist/core/tools/index.js +0 -1
- package/dist/defaults/settings.json +2 -3
- package/dist/extensions/model-prompt-injector/index.test.ts +0 -10
- package/dist/extensions/model-prompt-injector/index.ts +0 -3
- package/dist/extensions/pi-intercom/CHANGELOG.md +53 -16
- package/dist/extensions/pi-intercom/README.md +41 -8
- package/dist/extensions/pi-intercom/banner.png +0 -0
- package/dist/extensions/pi-intercom/broker/broker.ts +498 -215
- package/dist/extensions/pi-intercom/broker/client.ts +39 -12
- package/dist/extensions/pi-intercom/broker/extension.test.ts +102 -3
- package/dist/extensions/pi-intercom/broker/paths.test.ts +2 -2
- package/dist/extensions/pi-intercom/broker/protocol.ts +26 -0
- package/dist/extensions/pi-intercom/broker/spawn.test.ts +5 -20
- package/dist/extensions/pi-intercom/config.test.ts +41 -0
- package/dist/extensions/pi-intercom/config.ts +21 -0
- package/dist/extensions/pi-intercom/extension-api.ts +40 -0
- package/dist/extensions/pi-intercom/index.ts +362 -26
- package/dist/extensions/pi-intercom/intercom.integration.test.ts +819 -13
- package/dist/extensions/pi-intercom/package.json +1 -1
- package/dist/extensions/pi-intercom/project-agent.ts +2 -2
- package/dist/extensions/pi-intercom/skills/pi-intercom/SKILL.md +8 -110
- package/dist/extensions/pi-intercom/types.ts +32 -5
- package/dist/extensions/pi-intercom/ui/inline-message.ts +6 -0
- package/dist/extensions/pi-subagents/.github/assets/subagent-fleet-inspector.png +0 -0
- package/dist/extensions/pi-subagents/.github/workflows/release.yml +28 -0
- package/dist/extensions/pi-subagents/.github/workflows/test.yml +51 -0
- package/dist/extensions/pi-subagents/.greptile/config.json +33 -0
- package/dist/extensions/pi-subagents/.greptile/files.json +8 -0
- package/dist/extensions/pi-subagents/.greptile/rules.md +16 -0
- package/dist/extensions/pi-subagents/CHANGELOG.md +309 -87
- package/dist/extensions/pi-subagents/README.md +15 -17
- package/dist/extensions/pi-subagents/agents/oracle.md +3 -1
- package/dist/extensions/pi-subagents/agents/researcher.md +32 -13
- package/dist/extensions/pi-subagents/agents/reviewer.md +13 -2
- package/dist/extensions/pi-subagents/agents/scout.md +2 -2
- package/dist/extensions/pi-subagents/agents/worker.md +2 -1
- package/dist/extensions/pi-subagents/async-retention-discovery-worker.mjs +180 -0
- package/dist/extensions/pi-subagents/docs/configuration.md +106 -27
- package/dist/extensions/pi-subagents/docs/extension-api.md +85 -21
- package/dist/extensions/pi-subagents/docs/missions.md +41 -4
- package/dist/extensions/pi-subagents/docs/models.md +52 -9
- package/dist/extensions/pi-subagents/docs/observability.md +103 -16
- package/dist/extensions/pi-subagents/docs/tool-reference.md +60 -45
- package/dist/extensions/pi-subagents/docs/watchdog.md +60 -3
- package/dist/extensions/pi-subagents/docs/workflows.md +181 -7
- package/dist/extensions/pi-subagents/index.ts +10 -1
- package/dist/extensions/pi-subagents/install.mjs +4 -4
- package/dist/extensions/pi-subagents/package-lock.json +1483 -1470
- package/dist/extensions/pi-subagents/package.json +6 -3
- package/dist/extensions/pi-subagents/prompts/council.md +60 -0
- package/dist/extensions/pi-subagents/prompts/parallel-review.md +5 -1
- package/dist/extensions/pi-subagents/prompts/review-loop.md +9 -5
- package/dist/extensions/pi-subagents/skills/council-mode/SKILL.md +254 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +18 -17
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +31 -9
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +107 -140
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +9 -12
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/multi-lane-orchestration.md +39 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +44 -92
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +261 -368
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +6 -2
- package/dist/extensions/pi-subagents/src/agents/agents.ts +388 -85
- package/dist/extensions/pi-subagents/src/agents/builtin-names.ts +14 -0
- package/dist/extensions/pi-subagents/src/agents/runtime-agent-registry.ts +418 -0
- package/dist/extensions/pi-subagents/src/agents/skills.ts +1 -1
- package/dist/extensions/pi-subagents/src/api/agents.ts +7 -0
- package/dist/extensions/pi-subagents/src/api/external-job-provider.ts +195 -0
- package/dist/extensions/pi-subagents/src/api/preflight.ts +88 -27
- package/dist/extensions/pi-subagents/src/api/project-panes.ts +2 -0
- package/dist/extensions/pi-subagents/src/api/shared-types.ts +2 -0
- package/dist/extensions/pi-subagents/src/extension/config.ts +20 -11
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +14 -6
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +5 -4
- package/dist/extensions/pi-subagents/src/extension/index.ts +270 -187
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +65 -28
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +120 -11
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +46 -64
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +51 -37
- package/dist/extensions/pi-subagents/src/extension/tool-result.ts +19 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +2 -2
- package/dist/extensions/pi-subagents/src/inspectors/herdr/client.ts +3 -3
- package/dist/extensions/pi-subagents/src/inspectors/herdr/focus.ts +55 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +2 -1
- package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +230 -46
- package/dist/extensions/pi-subagents/src/integrations/herdr-status.ts +26 -4
- package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +32 -10
- package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +6 -1
- package/dist/extensions/pi-subagents/src/missions/store.ts +4 -9
- package/dist/extensions/pi-subagents/src/missions/workflow-state.ts +2 -2
- package/dist/extensions/pi-subagents/src/policy/authority.ts +2 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +3 -1
- package/dist/extensions/pi-subagents/src/runs/background/active-run-index.ts +31 -8
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +210 -52
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +63 -33
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +71 -17
- package/dist/extensions/pi-subagents/src/runs/background/async-retention.ts +886 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-status-snapshot.ts +14 -5
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +49 -56
- package/dist/extensions/pi-subagents/src/runs/background/auto-drain.ts +1 -0
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +3 -33
- package/dist/extensions/pi-subagents/src/runs/background/chain-root-attachment.ts +5 -0
- package/dist/extensions/pi-subagents/src/runs/background/completion-dedupe.ts +5 -1
- package/dist/extensions/pi-subagents/src/runs/background/completion-replay.ts +22 -12
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +105 -71
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +68 -19
- package/dist/extensions/pi-subagents/src/runs/background/index-segment.ts +59 -0
- package/dist/extensions/pi-subagents/src/runs/background/inspect-rpc.ts +443 -0
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +94 -10
- package/dist/extensions/pi-subagents/src/runs/background/result-files.ts +158 -90
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +141 -53
- package/dist/extensions/pi-subagents/src/runs/background/resume-guidance.ts +8 -5
- package/dist/extensions/pi-subagents/src/runs/background/retained-children.ts +14 -4
- package/dist/extensions/pi-subagents/src/runs/background/run-id-query.ts +7 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +13 -14
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +46 -25
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +823 -0
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +9 -3
- package/dist/extensions/pi-subagents/src/runs/background/steering.ts +11 -1
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +594 -216
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +17 -13
- package/dist/extensions/pi-subagents/src/runs/background/terminal-run-index.ts +138 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +23 -4
- package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +82 -4
- package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +5 -3
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +21 -14
- package/dist/extensions/pi-subagents/src/runs/foreground/async-stop-action.ts +23 -2
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +153 -58
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +7 -9
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +1283 -1657
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-detach-reconcile.ts +274 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +6 -5
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +59 -10
- package/dist/extensions/pi-subagents/src/runs/shared/agent-contract.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/chain-outputs.ts +1 -3
- package/dist/extensions/pi-subagents/src/runs/shared/child-identity.ts +36 -0
- package/dist/extensions/pi-subagents/src/runs/shared/completion-guard.ts +52 -2
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/extension-bindings.ts +78 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +2 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-job-bridge.ts +460 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-job-runner.ts +389 -0
- package/dist/extensions/pi-subagents/src/runs/shared/fast-mode-extension.ts +10 -0
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +14 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-exclusions.ts +243 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +201 -85
- package/dist/extensions/pi-subagents/src/runs/shared/model-scope.ts +106 -39
- package/dist/extensions/pi-subagents/src/runs/shared/mutation-evidence.ts +145 -0
- package/dist/extensions/pi-subagents/src/runs/shared/orca-progress-tabs.ts +150 -27
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +46 -4
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +19 -15
- package/dist/extensions/pi-subagents/src/runs/shared/permissions.ts +5 -1
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +86 -2
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +9 -9
- package/dist/extensions/pi-subagents/src/runs/shared/session-lease.ts +0 -6
- package/dist/extensions/pi-subagents/src/runs/shared/structured-output.ts +18 -4
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-control.ts +51 -7
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +62 -21
- package/dist/extensions/pi-subagents/src/runs/shared/tool-availability.ts +1 -3
- package/dist/extensions/pi-subagents/src/runs/shared/tool-timeout.ts +1 -3
- package/dist/extensions/pi-subagents/src/runs/shared/workflow-graph.ts +1 -23
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +14 -2
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +2 -2
- package/dist/extensions/pi-subagents/src/shared/atomic-json.ts +22 -2
- package/dist/extensions/pi-subagents/src/shared/capacity-resilient-json.ts +102 -0
- package/dist/extensions/pi-subagents/src/shared/completion-owner.ts +14 -0
- package/dist/extensions/pi-subagents/src/shared/file-system-retry.ts +49 -1
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +59 -1
- package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +12 -5
- package/dist/extensions/pi-subagents/src/shared/model-info.ts +20 -0
- package/dist/extensions/pi-subagents/src/shared/prompt-resources.ts +0 -40
- package/dist/extensions/pi-subagents/src/shared/settings.ts +11 -30
- package/dist/extensions/pi-subagents/src/shared/thinking-ceiling.ts +52 -0
- package/dist/extensions/pi-subagents/src/shared/types.ts +228 -49
- package/dist/extensions/pi-subagents/src/shared/utils.ts +11 -3
- package/dist/extensions/pi-subagents/src/shared/watch-strategy.ts +10 -0
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +0 -162
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +2 -5
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +105 -13
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +6 -36
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +829 -0
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +1415 -0
- package/dist/extensions/pi-subagents/src/tui/render.ts +78 -7
- package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +1 -1
- package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +1 -0
- package/dist/extensions/pi-subagents/src/watchdog/permission-arbiter.ts +59 -51
- package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +8 -2
- package/dist/extensions/pi-subagents/src/watchdog/tool-actions.ts +2 -1
- package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +4 -4
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +471 -86
- package/dist/extensions/pi-subagents/src/workflows/workflow-receipt.ts +140 -0
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/cli.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/args.d.ts +57 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/config-selector.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/file-processor.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/initial-message.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/list-models.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/project-trust.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/session-picker.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/startup-ui.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/config.d.ts +96 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-runtime.d.ts +119 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-services.d.ts +85 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session.d.ts +620 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-guidance.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-storage.d.ts +56 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/bash-executor.d.ts +32 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/cache-stats.d.ts +49 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/branch-summarization.d.ts +93 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/compaction.d.ts +128 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/index.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/utils.d.ts +38 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/defaults.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/diagnostics.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/event-bus.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/exec.d.ts +29 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/experimental.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/index.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/index.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/loader.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/runner.d.ts +171 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/types.d.ts +1261 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/wrapper.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/footer-data-provider.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/index.d.ts +13 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/keybindings.d.ts +358 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/messages.d.ts +77 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-config.d.ts +512 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-registry.d.ts +43 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-resolver.d.ts +121 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-runtime.d.ts +82 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/models-store.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/output-guard.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/package-manager.d.ts +210 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/project-trust.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/prompt-templates.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-attribution.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-composer.d.ts +55 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/radius.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/remote-catalog-provider.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resource-loader.d.ts +206 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/sdk.d.ts +106 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-cwd.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-manager.d.ts +356 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/settings-manager.d.ts +297 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/skills.d.ts +60 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/slash-commands.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/source-info.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/system-prompt.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/telemetry.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/timings.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/bash.d.ts +68 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit-diff.d.ts +106 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit.d.ts +51 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/find.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/grep.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/index.d.ts +40 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/ls.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/read.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/render-utils.d.ts +24 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/truncate.d.ts +70 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/write.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/trust-manager.d.ts +36 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/usage-totals.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/client.d.ts +61 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/huggingface.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/index.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/provider.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/ui.d.ts +42 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/index.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/main.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/migrations.d.ts +33 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/index.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/assistant-message.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bash-execution.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/config-selector.d.ts +102 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-editor.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-selector.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/footer.d.ts +32 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/index.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/login-dialog.d.ts +52 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/model-selector.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/settings-selector.d.ts +77 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/status-indicator.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tool-execution.d.ts +63 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tree-selector.d.ts +94 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/interactive-mode.d.ts +394 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme-controller.d.ts +29 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme.d.ts +120 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/print-mode.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-client.d.ts +246 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-types.d.ts +457 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/package-manager-cli.d.ts +8 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/rpc-entry.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/ansi.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/changelog.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/child-process.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-native.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/deprecation.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/frontmatter.d.ts +8 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/fs-watch.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/git.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/html.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-convert.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-process.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/json.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/mime.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/open-browser.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/paths.d.ts +31 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/photon.d.ts +21 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/pi-user-agent.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/shell.d.ts +31 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/sleep.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/tools-manager.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/version-check.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/index.mjs +1 -1
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +0 -54
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +1053 -414
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +194 -4
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +59 -4
- package/dist/extensions/pi-subagents/test/integration/error-handling.test.ts +0 -77
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +107 -6
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +211 -897
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +265 -375
- package/dist/extensions/pi-subagents/test/integration/orca-progress-tabs.test.ts +77 -7
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +10 -10
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +547 -30
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +2112 -310
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +274 -34
- package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +20 -3
- package/dist/extensions/pi-subagents/test/support/isolated-temp-root.mjs +9 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +30 -5
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +2 -0
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +4 -2
- package/dist/extensions/pi-subagents/test/support/register-loader.mjs +1 -0
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +197 -0
- package/dist/extensions/pi-subagents/test/unit/agent-contract.test.ts +14 -0
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +204 -27
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +444 -145
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +256 -4
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +9 -7
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +152 -22
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +29 -0
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +205 -23
- package/dist/extensions/pi-subagents/test/unit/async-retention.test.ts +579 -0
- package/dist/extensions/pi-subagents/test/unit/atomic-json.test.ts +24 -0
- package/dist/extensions/pi-subagents/test/unit/authority-policy.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/unit/auto-drain.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/capacity-resilient-json.test.ts +155 -0
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +7 -0
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +123 -0
- package/dist/extensions/pi-subagents/test/unit/completion-replay.test.ts +81 -3
- package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +109 -7
- package/dist/extensions/pi-subagents/test/unit/default-extensions.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +5 -2
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +3 -2
- package/dist/extensions/pi-subagents/test/unit/extension-bindings.test.ts +79 -0
- package/dist/extensions/pi-subagents/test/unit/external-cli-runner.test.ts +22 -0
- package/dist/extensions/pi-subagents/test/unit/external-job-runner.test.ts +961 -0
- package/dist/extensions/pi-subagents/test/unit/file-system-retry.test.ts +64 -0
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +1110 -0
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +1664 -0
- package/dist/extensions/pi-subagents/test/unit/fork-context.test.ts +81 -1
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +138 -11
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +41 -2
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +210 -79
- package/dist/extensions/pi-subagents/test/unit/index-segment.test.ts +95 -0
- package/dist/extensions/pi-subagents/test/unit/inspect-rpc.test.ts +596 -0
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +10 -1
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +3 -5
- package/dist/extensions/pi-subagents/test/unit/model-exclusions.test.ts +167 -0
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +319 -18
- package/dist/extensions/pi-subagents/test/unit/model-info.test.ts +78 -0
- package/dist/extensions/pi-subagents/test/unit/model-scope-settings.test.ts +19 -5
- package/dist/extensions/pi-subagents/test/unit/model-scope.test.ts +44 -0
- package/dist/extensions/pi-subagents/test/unit/mutation-evidence.test.ts +129 -0
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +231 -2
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +28 -1
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +106 -2
- package/dist/extensions/pi-subagents/test/unit/orca-progress-tabs.test.ts +204 -7
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +59 -4
- package/dist/extensions/pi-subagents/test/unit/path-handling.test.ts +2 -6
- package/dist/extensions/pi-subagents/test/unit/pi-args-permission-system.test.ts +34 -2
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +116 -6
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +12 -3
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +56 -61
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +416 -1
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +9 -2
- package/dist/extensions/pi-subagents/test/unit/project-panes-public-api.test.ts +42 -0
- package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +21 -30
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +86 -11
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +49 -1
- package/dist/extensions/pi-subagents/test/unit/result-files.test.ts +233 -5
- package/dist/extensions/pi-subagents/test/unit/retained-children.test.ts +28 -5
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +323 -20
- package/dist/extensions/pi-subagents/test/unit/run-id-resolver.test.ts +66 -10
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +68 -5
- package/dist/extensions/pi-subagents/test/unit/runtime-agent-registration.test.ts +174 -0
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +679 -0
- package/dist/extensions/pi-subagents/test/unit/scheduled-store-root.test.ts +67 -0
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +55 -44
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +399 -84
- package/dist/extensions/pi-subagents/test/unit/session-lease.test.ts +13 -0
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +15 -10
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +11 -7
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +2 -0
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +40 -1
- package/dist/extensions/pi-subagents/test/unit/subagent-action-recovery.test.ts +10 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +38 -3
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +110 -12
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +204 -19
- package/dist/extensions/pi-subagents/test/unit/temp-paths.test.ts +25 -0
- package/dist/extensions/pi-subagents/test/unit/thinking-ceiling.test.ts +73 -0
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +90 -50
- package/dist/extensions/pi-subagents/test/unit/tool-timeout.test.ts +1 -2
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +234 -7
- package/dist/extensions/pi-subagents/test/unit/watch-strategy.test.ts +24 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-permission-arbiter.test.ts +36 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +37 -9
- package/dist/extensions/pi-subagents/test/unit/workflow-detach-reconcile.test.ts +302 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +167 -7
- package/dist/extensions/pi-subagents/test/unit/workflow-receipt.test.ts +113 -0
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +6 -6
- package/dist/extensions/ponytail/index.js +31 -25
- package/dist/extensions/ponytail/ponytail-config.cjs +34 -7
- package/dist/extensions/ponytail/ponytail-instructions.cjs +7 -9
- package/dist/extensions/ponytail/test/extension.test.js +7 -8
- package/dist/extensions/ponytail/test/helpers.test.js +1 -1
- package/dist/skills/brandkit/SKILL.md +799 -0
- package/dist/skills/design-taste-frontend/SKILL.md +1207 -0
- package/dist/skills/design-taste-frontend-v1/SKILL.md +227 -0
- package/dist/skills/full-output-enforcement/SKILL.md +50 -0
- package/dist/skills/gpt-taste/SKILL.md +75 -0
- package/dist/skills/high-end-visual-design/SKILL.md +99 -0
- package/dist/skills/image-to-code/SKILL.md +1229 -0
- package/dist/skills/imagegen-frontend-mobile/SKILL.md +1466 -0
- package/dist/skills/imagegen-frontend-web/SKILL.md +988 -0
- package/dist/skills/industrial-brutalist-ui/SKILL.md +93 -0
- package/dist/skills/minimalist-ui/SKILL.md +86 -0
- package/dist/skills/pi-subagents/SKILL.md +18 -17
- package/dist/skills/pi-subagents/references/constraints-and-recipes.md +31 -9
- package/dist/skills/pi-subagents/references/execution-controls.md +95 -143
- package/dist/skills/pi-subagents/references/management-authoring-rpc.md +9 -12
- package/dist/skills/pi-subagents/references/multi-lane-orchestration.md +39 -0
- package/dist/skills/pi-subagents/references/prompting-and-roles.md +45 -94
- package/dist/skills/ponytail/SKILL.md +12 -8
- package/dist/skills/ponytail-audit/SKILL.md +0 -1
- package/dist/skills/ponytail-debt/SKILL.md +0 -1
- package/dist/skills/ponytail-gain/SKILL.md +0 -1
- package/dist/skills/ponytail-help/SKILL.md +4 -3
- package/dist/skills/ponytail-review/SKILL.md +0 -1
- package/dist/skills/redesign-existing-projects/SKILL.md +179 -0
- package/dist/skills/stitch-design-taste/SKILL.md +185 -0
- package/dist/skills/unlazy/CHANGELOG.md +100 -0
- package/dist/skills/unlazy/CONTRIBUTING.md +66 -0
- package/dist/skills/unlazy/LICENSE +21 -0
- package/dist/skills/unlazy/README.md +242 -0
- package/dist/skills/unlazy/SECURITY.md +70 -0
- package/dist/skills/unlazy/SKILL.md +100 -0
- package/dist/skills/unlazy/package.json +13 -0
- package/dist/skills/unlazy/references/dispatch.md +82 -0
- package/dist/skills/unlazy/references/gates.md +132 -0
- package/dist/skills/unlazy/references/method.md +49 -0
- package/dist/skills/unlazy/references/orchestration.md +99 -0
- package/dist/skills/unlazy/references/parallel.md +123 -0
- package/dist/skills/unlazy/references/token-economy.md +39 -0
- package/dist/skills/unlazy/research/validation-protocol.md +81 -0
- package/dist/skills/unlazy/scripts/dispatch-check.mjs +108 -0
- package/dist/skills/unlazy/scripts/gate-check.mjs +894 -0
- package/dist/skills/unlazy/scripts/gate-lint.mjs +178 -0
- package/dist/skills/unlazy/scripts/install-hooks.mjs +206 -0
- package/dist/skills/unlazy/scripts/lib/check-supervisor.mjs +46 -0
- package/dist/skills/unlazy/scripts/lib/dispatch.mjs +283 -0
- package/dist/skills/unlazy/scripts/lib/gates.mjs +629 -0
- package/dist/skills/unlazy/scripts/lib/process-tree.mjs +161 -0
- package/dist/skills/unlazy/scripts/lib/regex-worker.mjs +9 -0
- package/dist/skills/unlazy/scripts/stop-hook.mjs +174 -0
- package/dist/skills/unlazy/templates/PLAN.md +65 -0
- package/dist/skills/unlazy/templates/gates-leaf.md +51 -0
- package/dist/skills/unlazy/templates/gates-node.md +50 -0
- package/dist/skills/unlazy/tests/contract-tests.mjs +127 -0
- package/dist/skills/unlazy/tests/dispatch-tests.mjs +481 -0
- package/dist/skills/unlazy/tests/hardening-tests.mjs +903 -0
- package/dist/skills/unlazy/tests/lint-tests.mjs +242 -0
- package/dist/skills/unlazy/tests/run-tests.mjs +554 -0
- package/dist/skills/unlazy/tests/self-check.mjs +165 -0
- package/dist/skills/unlazy/tests/stress-tests.mjs +356 -0
- package/dist/skills/web-design-guidelines/SKILL.md +40 -0
- package/docs/settings.md +0 -5
- package/package.json +1 -1
- package/dist/core/tools/schema-prune.d.ts +0 -16
- package/dist/core/tools/schema-prune.js +0 -39
- package/dist/core/tools/schema-prune.test.d.ts +0 -1
- package/dist/core/tools/schema-prune.test.js +0 -111
- package/dist/extensions/pi-subagents/UPSTREAM-V0.50-MAPPING.md +0 -172
- package/dist/extensions/pi-subagents/prompts/parallel-context-build.md +0 -55
- package/dist/extensions/pi-subagents/prompts/parallel-handoff-plan.md +0 -61
- package/dist/extensions/pi-subagents/src/agents/task-aware-routing.ts +0 -132
- package/dist/extensions/pi-subagents/src/extension/chain-validation.ts +0 -181
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-clarify.ts +0 -1354
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +0 -1581
- package/dist/extensions/pi-subagents/src/shared/env.ts +0 -16
- package/dist/extensions/pi-subagents/src/shared/session-lineage.ts +0 -71
- package/dist/extensions/pi-subagents/src/slash/inline-subagents.ts +0 -136
- package/dist/extensions/pi-subagents/src/workflows/workflow-auto-relaunch.ts +0 -41
- package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +0 -466
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +0 -1859
- package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +0 -733
- package/dist/extensions/pi-subagents/test/unit/builtin-agent-documentation.test.ts +0 -63
- package/dist/extensions/pi-subagents/test/unit/chain-validation.test.ts +0 -326
- package/dist/extensions/pi-subagents/test/unit/handoff-adoption.test.ts +0 -103
- package/dist/extensions/pi-subagents/test/unit/inline-subagents.test.ts +0 -127
- package/dist/extensions/pi-subagents/test/unit/session-lineage.test.ts +0 -73
- package/dist/extensions/pi-subagents/test/unit/task-aware-routing.test.ts +0 -213
- package/dist/extensions/pi-subagents/test/unit/workflow-auto-relaunch.test.ts +0 -65
|
@@ -0,0 +1,1110 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { describe, it } from "node:test";
|
|
4
|
+
import { Editor, type EditorComponent, visibleWidth } from "@earendil-works/pi-tui";
|
|
5
|
+
import type { ExtensionContext } from "@selesai/code";
|
|
6
|
+
import type { SubagentState } from "../../src/shared/types.ts";
|
|
7
|
+
import { EXTERNAL_RUN_REGISTRY_KEY, EXTERNAL_RUN_REGISTRY_VERSION, registerExternalRun } from "../../src/api/external-runs.ts";
|
|
8
|
+
import { collectFleetSnapshot } from "../../src/tui/fleet.ts";
|
|
9
|
+
import {
|
|
10
|
+
FLEET_STATUS_WIDGET_KEY,
|
|
11
|
+
SubagentFleetStatus,
|
|
12
|
+
collectFleetStatusEntries,
|
|
13
|
+
formatFleetElapsed,
|
|
14
|
+
formatFleetTokens,
|
|
15
|
+
resolveFleetViewPlacement,
|
|
16
|
+
} from "../../src/tui/fleet-status.ts";
|
|
17
|
+
|
|
18
|
+
function clearExternalRuns(): void {
|
|
19
|
+
delete (globalThis as Record<PropertyKey, unknown>)[Symbol.for(EXTERNAL_RUN_REGISTRY_KEY)];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function stateForTest(): SubagentState {
|
|
23
|
+
return {
|
|
24
|
+
baseCwd: process.cwd(),
|
|
25
|
+
currentSessionId: "session-current",
|
|
26
|
+
asyncJobs: new Map(),
|
|
27
|
+
fleetJobs: new Map(),
|
|
28
|
+
foregroundRuns: new Map(),
|
|
29
|
+
foregroundControls: new Map(),
|
|
30
|
+
lastForegroundControlId: null,
|
|
31
|
+
cleanupTimers: new Map(),
|
|
32
|
+
lastUiContext: null,
|
|
33
|
+
poller: null,
|
|
34
|
+
completionSeen: new Map(),
|
|
35
|
+
watcher: null,
|
|
36
|
+
watcherRestartTimer: null,
|
|
37
|
+
resultFileCoalescer: { schedule: () => false, clear: () => {} },
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const theme = {
|
|
42
|
+
fg: (_name: string, text: string) => text,
|
|
43
|
+
bg: (_name: string, text: string) => text,
|
|
44
|
+
bold: (text: string) => text,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
describe("below-editor subagent FleetView", () => {
|
|
48
|
+
it("formats elapsed time and token counts like the Claude Code fleet", () => {
|
|
49
|
+
assert.equal(formatFleetElapsed(10_600), "11s");
|
|
50
|
+
assert.equal(formatFleetTokens(999), "↓ 999 tokens");
|
|
51
|
+
assert.equal(formatFleetTokens(13_100), "↓ 13.1k tokens");
|
|
52
|
+
assert.equal(formatFleetTokens(1_250_000), "↓ 1.3M tokens");
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("renders cached external jobs with an external marker and elapsed time", () => {
|
|
56
|
+
clearExternalRuns();
|
|
57
|
+
registerExternalRun({
|
|
58
|
+
id: "external-review",
|
|
59
|
+
sessionId: "session-current",
|
|
60
|
+
source: "interactive-shell",
|
|
61
|
+
label: "Dependency review",
|
|
62
|
+
state: "running",
|
|
63
|
+
startedAt: Date.now() - 11_000,
|
|
64
|
+
currentAction: "Inspecting package metadata",
|
|
65
|
+
});
|
|
66
|
+
const state = stateForTest();
|
|
67
|
+
state.activeAsyncCapacity = { used: 0, limit: 0 };
|
|
68
|
+
assert.deepEqual(collectFleetStatusEntries(state).map((entry) => ({ key: entry.key, agent: entry.agent, description: entry.description })), [{
|
|
69
|
+
key: "external:external-review",
|
|
70
|
+
agent: "external · Dependency review",
|
|
71
|
+
description: "Inspecting package metadata",
|
|
72
|
+
}]);
|
|
73
|
+
let widgetFactory: ((tui: unknown, theme: typeof theme) => { render(width: number): string[] }) | undefined;
|
|
74
|
+
const ctx = {
|
|
75
|
+
hasUI: true,
|
|
76
|
+
ui: {
|
|
77
|
+
setWidget(_key: string, content: typeof widgetFactory | undefined) { if (content) widgetFactory = content; },
|
|
78
|
+
onTerminalInput() { return () => {}; },
|
|
79
|
+
getEditorText() { return ""; },
|
|
80
|
+
requestRender() {},
|
|
81
|
+
notify() {},
|
|
82
|
+
theme,
|
|
83
|
+
},
|
|
84
|
+
} as unknown as ExtensionContext;
|
|
85
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
86
|
+
try {
|
|
87
|
+
fleet.setContext(ctx);
|
|
88
|
+
const tui = { requestRender() {}, focusedComponent: Object.create(Editor.prototype) as Editor };
|
|
89
|
+
const component = widgetFactory!(tui, theme);
|
|
90
|
+
const compact = component.render(80)[0]!;
|
|
91
|
+
assert.match(compact, /1 active job/);
|
|
92
|
+
assert.doesNotMatch(compact, /Async runs|tokens/);
|
|
93
|
+
fleet.handleKey("\x1b[B");
|
|
94
|
+
const expanded = component.render(80).join("\n");
|
|
95
|
+
assert.match(expanded, /external · Dependency review · running/);
|
|
96
|
+
assert.match(expanded, /11s/);
|
|
97
|
+
assert.doesNotMatch(expanded.split("\n").find((line) => line.includes("Dependency review"))!, /tokens/);
|
|
98
|
+
} finally {
|
|
99
|
+
fleet.dispose();
|
|
100
|
+
clearExternalRuns();
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it("warns when compact FleetView cannot inspect external jobs", () => {
|
|
105
|
+
clearExternalRuns();
|
|
106
|
+
const warnings: string[] = [];
|
|
107
|
+
const originalWarn = console.warn;
|
|
108
|
+
console.warn = (message?: unknown) => warnings.push(String(message));
|
|
109
|
+
(globalThis as Record<PropertyKey, unknown>)[Symbol.for(EXTERNAL_RUN_REGISTRY_KEY)] = {
|
|
110
|
+
version: EXTERNAL_RUN_REGISTRY_VERSION + 1,
|
|
111
|
+
runs: new Map(),
|
|
112
|
+
};
|
|
113
|
+
try {
|
|
114
|
+
assert.deepEqual(collectFleetStatusEntries(stateForTest()), []);
|
|
115
|
+
assert.match(warnings[0]!, /Failed to inspect external jobs/);
|
|
116
|
+
} finally {
|
|
117
|
+
console.warn = originalWarn;
|
|
118
|
+
clearExternalRuns();
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it("resolves configured FleetView placement with a below-editor fallback", () => {
|
|
123
|
+
assert.equal(resolveFleetViewPlacement(undefined), "belowEditor");
|
|
124
|
+
assert.equal(resolveFleetViewPlacement("belowEditor"), "belowEditor");
|
|
125
|
+
assert.equal(resolveFleetViewPlacement("aboveEditor"), "aboveEditor");
|
|
126
|
+
assert.equal(resolveFleetViewPlacement("side"), "belowEditor");
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it("renders main plus active children below the editor and bounds every line", () => {
|
|
130
|
+
const state = stateForTest();
|
|
131
|
+
state.activeAsyncCapacity = { used: 2, limit: 4 };
|
|
132
|
+
const now = Date.now();
|
|
133
|
+
for (let index = 0; index < 7; index++) {
|
|
134
|
+
state.foregroundControls.set(`run-${index}`, {
|
|
135
|
+
runId: `run-${index}`,
|
|
136
|
+
mode: "single",
|
|
137
|
+
startedAt: now - 11_000 + index,
|
|
138
|
+
updatedAt: now,
|
|
139
|
+
currentAgent: `worker-${index}`,
|
|
140
|
+
description: index === 0 ? "Inspect\nmodule 0" : `Inspect module ${index}`,
|
|
141
|
+
...(index === 0 ? { model: "anthropic/fable-5", thinking: "low" } : {}),
|
|
142
|
+
tokens: index === 0 ? 13_100 : 100,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
let widgetFactory: ((tui: unknown, theme: typeof theme) => { render(width: number): string[] }) | undefined;
|
|
147
|
+
const ctx = {
|
|
148
|
+
hasUI: true,
|
|
149
|
+
ui: {
|
|
150
|
+
setWidget(key: string, content: typeof widgetFactory | undefined, options?: { placement?: string }) {
|
|
151
|
+
assert.equal(key, FLEET_STATUS_WIDGET_KEY);
|
|
152
|
+
if (content) {
|
|
153
|
+
assert.equal(options?.placement, "belowEditor");
|
|
154
|
+
widgetFactory = content;
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
onTerminalInput() { return () => {}; },
|
|
158
|
+
getEditorText() { return ""; },
|
|
159
|
+
requestRender() {},
|
|
160
|
+
notify() {},
|
|
161
|
+
theme,
|
|
162
|
+
},
|
|
163
|
+
} as unknown as ExtensionContext;
|
|
164
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
165
|
+
try {
|
|
166
|
+
fleet.setContext(ctx);
|
|
167
|
+
assert.ok(widgetFactory);
|
|
168
|
+
const tui = {
|
|
169
|
+
requestRender() {},
|
|
170
|
+
focusedComponent: Object.create(Editor.prototype) as Editor,
|
|
171
|
+
};
|
|
172
|
+
const component = widgetFactory!(tui, theme);
|
|
173
|
+
const compactLines = component.render(80);
|
|
174
|
+
assert.equal(compactLines.length, 1);
|
|
175
|
+
assert.ok(compactLines[0]!.includes("7 active agents · Async runs 2/4"));
|
|
176
|
+
assert.ok(compactLines[0]!.includes("↓ 13.7k tokens"));
|
|
177
|
+
assert.ok(compactLines[0]!.includes("↓/← to inspect"));
|
|
178
|
+
assert.ok(visibleWidth(compactLines[0]!) <= 80);
|
|
179
|
+
|
|
180
|
+
assert.deepEqual(fleet.handleKey("\x1b[B"), { consume: true });
|
|
181
|
+
const expandedLines = component.render(80);
|
|
182
|
+
assert.ok(expandedLines.some((line) => line.includes("> main")));
|
|
183
|
+
assert.ok(expandedLines.some((line) => line.includes(" worker-0")), "unselected agents use blank focus space");
|
|
184
|
+
assert.ok(expandedLines.every((line) => !/[⏺◯]/u.test(line)), "selection avoids terminal-ambiguous circle glyphs");
|
|
185
|
+
assert.ok(expandedLines.some((line) => line.includes("worker-0 (fable-5 · thinking low)")));
|
|
186
|
+
assert.ok(expandedLines.some((line) => line.includes("11s · ↓ 13.1k tokens")));
|
|
187
|
+
assert.ok(expandedLines.some((line) => line.includes("↓ 1 more")));
|
|
188
|
+
for (const line of expandedLines) assert.ok(visibleWidth(line) <= 80, `line exceeded width: ${line}`);
|
|
189
|
+
|
|
190
|
+
assert.deepEqual(fleet.handleKey("\x1b"), { consume: true });
|
|
191
|
+
assert.equal(component.render(80).length, 1);
|
|
192
|
+
assert.deepEqual(fleet.handleKey("\x1b[D"), { consume: true });
|
|
193
|
+
assert.ok(component.render(80).length > 1, "Left should also expand the roster");
|
|
194
|
+
} finally {
|
|
195
|
+
fleet.dispose();
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it("keeps occupied capacity visible without active child rows", () => {
|
|
200
|
+
const state = stateForTest();
|
|
201
|
+
state.activeAsyncCapacity = { used: 1, limit: 2 };
|
|
202
|
+
let widgetFactory: ((tui: unknown, theme: typeof theme) => { render(width: number): string[] }) | undefined;
|
|
203
|
+
const ctx = {
|
|
204
|
+
hasUI: true,
|
|
205
|
+
ui: {
|
|
206
|
+
setWidget(_key: string, content: typeof widgetFactory | undefined) { if (content) widgetFactory = content; },
|
|
207
|
+
onTerminalInput() { return () => {}; },
|
|
208
|
+
getEditorText() { return ""; },
|
|
209
|
+
requestRender() {},
|
|
210
|
+
notify() {},
|
|
211
|
+
theme,
|
|
212
|
+
},
|
|
213
|
+
} as unknown as ExtensionContext;
|
|
214
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
215
|
+
try {
|
|
216
|
+
fleet.setContext(ctx);
|
|
217
|
+
assert.ok(widgetFactory);
|
|
218
|
+
assert.deepEqual(widgetFactory!({ requestRender() {} }, theme).render(80), [" Async runs 1/2 · ↓ 0 tokens · ↓/← to inspect"]);
|
|
219
|
+
} finally {
|
|
220
|
+
fleet.dispose();
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it("keeps one queued agent visible in the compact summary", () => {
|
|
225
|
+
const state = stateForTest();
|
|
226
|
+
state.asyncJobs.set("run-worker", {
|
|
227
|
+
asyncId: "run-worker",
|
|
228
|
+
asyncDir: "/tmp/run-worker",
|
|
229
|
+
status: "queued",
|
|
230
|
+
mode: "single",
|
|
231
|
+
startedAt: 10,
|
|
232
|
+
updatedAt: 20,
|
|
233
|
+
totalTokens: { input: 40, output: 2, total: 42 },
|
|
234
|
+
});
|
|
235
|
+
let widgetFactory: ((tui: unknown, theme: typeof theme) => { render(width: number): string[] }) | undefined;
|
|
236
|
+
const ctx = {
|
|
237
|
+
hasUI: true,
|
|
238
|
+
ui: {
|
|
239
|
+
setWidget(_key: string, content: typeof widgetFactory | undefined) { if (content) widgetFactory = content; },
|
|
240
|
+
onTerminalInput() { return () => {}; },
|
|
241
|
+
getEditorText() { return ""; },
|
|
242
|
+
requestRender() {},
|
|
243
|
+
notify() {},
|
|
244
|
+
theme,
|
|
245
|
+
},
|
|
246
|
+
} as unknown as ExtensionContext;
|
|
247
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
248
|
+
try {
|
|
249
|
+
fleet.setContext(ctx);
|
|
250
|
+
const lines = widgetFactory!({ requestRender() {} }, theme).render(50);
|
|
251
|
+
assert.equal(lines.length, 1);
|
|
252
|
+
assert.ok(lines[0]!.includes("1 active agent"));
|
|
253
|
+
assert.ok(lines[0]!.includes("↓ 42 tokens"));
|
|
254
|
+
assert.ok(visibleWidth(lines[0]!) <= 50);
|
|
255
|
+
} finally {
|
|
256
|
+
fleet.dispose();
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
it("counts project panes in compact status", () => {
|
|
261
|
+
const state = stateForTest();
|
|
262
|
+
const projectRoot = path.join("fixtures", "peer-project");
|
|
263
|
+
const asyncDir = path.join("fixtures", "async-run");
|
|
264
|
+
state.asyncJobs.set("run-view", {
|
|
265
|
+
asyncId: "run-view",
|
|
266
|
+
asyncDir,
|
|
267
|
+
status: "running",
|
|
268
|
+
mode: "single",
|
|
269
|
+
agents: ["worker"],
|
|
270
|
+
startedAt: Date.now() - 12_000,
|
|
271
|
+
updatedAt: Date.now() - 1_000,
|
|
272
|
+
});
|
|
273
|
+
state.herdrProjectPanes = new Map([[projectRoot, {
|
|
274
|
+
projectRoot,
|
|
275
|
+
bindingPath: path.join(projectRoot, ".pi-subagents/project-panes/herdr.json"),
|
|
276
|
+
paneId: "w1:p50",
|
|
277
|
+
openedAt: "2026-01-01T00:00:00.000Z",
|
|
278
|
+
state: "open",
|
|
279
|
+
agentStatus: "needs_attention",
|
|
280
|
+
ownership: "verified",
|
|
281
|
+
safeToClose: false,
|
|
282
|
+
refreshedAt: Date.now() - 2_000,
|
|
283
|
+
summary: "worker needs attention",
|
|
284
|
+
}]]);
|
|
285
|
+
|
|
286
|
+
let widgetFactory: ((tui: unknown, theme: typeof theme) => { render(width: number): string[] }) | undefined;
|
|
287
|
+
const ctx = {
|
|
288
|
+
hasUI: true,
|
|
289
|
+
ui: {
|
|
290
|
+
setWidget(_key: string, content: typeof widgetFactory | undefined) { if (content) widgetFactory = content; },
|
|
291
|
+
onTerminalInput() { return () => {}; },
|
|
292
|
+
getEditorText() { return ""; },
|
|
293
|
+
requestRender() {},
|
|
294
|
+
notify() {},
|
|
295
|
+
theme,
|
|
296
|
+
},
|
|
297
|
+
} as unknown as ExtensionContext;
|
|
298
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
299
|
+
try {
|
|
300
|
+
fleet.setContext(ctx);
|
|
301
|
+
const component = widgetFactory!({ requestRender() {}, focusedComponent: Object.create(Editor.prototype) as Editor }, theme);
|
|
302
|
+
const compact = component.render(100)[0]!;
|
|
303
|
+
assert.match(compact, /1 active agent/);
|
|
304
|
+
assert.match(compact, /1 pane \(1 ⚠\)/);
|
|
305
|
+
assert.deepEqual(fleet.handleKey("\x1b[B"), { consume: true });
|
|
306
|
+
const expanded = component.render(100).join("\n");
|
|
307
|
+
assert.match(expanded, /project panes/);
|
|
308
|
+
assert.match(expanded, /peer-project · w1:p50/);
|
|
309
|
+
assert.match(expanded, /worker needs attention/);
|
|
310
|
+
assert.doesNotMatch(expanded, /views/);
|
|
311
|
+
} finally {
|
|
312
|
+
fleet.dispose();
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
it("registers above the editor when configured", () => {
|
|
317
|
+
const state = stateForTest();
|
|
318
|
+
state.foregroundControls.set("run-worker", {
|
|
319
|
+
runId: "run-worker",
|
|
320
|
+
mode: "single",
|
|
321
|
+
startedAt: 10,
|
|
322
|
+
updatedAt: 20,
|
|
323
|
+
currentAgent: "worker",
|
|
324
|
+
});
|
|
325
|
+
let placement: string | undefined;
|
|
326
|
+
const ctx = {
|
|
327
|
+
hasUI: true,
|
|
328
|
+
ui: {
|
|
329
|
+
setWidget(_key: string, content: unknown, options?: { placement?: string }) {
|
|
330
|
+
if (content) placement = options?.placement;
|
|
331
|
+
},
|
|
332
|
+
onTerminalInput() { return () => {}; },
|
|
333
|
+
getEditorText() { return ""; },
|
|
334
|
+
notify() {},
|
|
335
|
+
theme,
|
|
336
|
+
},
|
|
337
|
+
} as unknown as ExtensionContext;
|
|
338
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000, placement: "aboveEditor" });
|
|
339
|
+
try {
|
|
340
|
+
fleet.setContext(ctx);
|
|
341
|
+
assert.equal(placement, "aboveEditor");
|
|
342
|
+
} finally {
|
|
343
|
+
fleet.dispose();
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
it("stops refreshing when the captured extension context becomes stale", () => {
|
|
348
|
+
const state = stateForTest();
|
|
349
|
+
state.foregroundControls.set("run-worker", {
|
|
350
|
+
runId: "run-worker",
|
|
351
|
+
mode: "single",
|
|
352
|
+
startedAt: 10,
|
|
353
|
+
updatedAt: 20,
|
|
354
|
+
currentAgent: "worker",
|
|
355
|
+
});
|
|
356
|
+
let stale = false;
|
|
357
|
+
let contextReads = 0;
|
|
358
|
+
let inputUnsubscribes = 0;
|
|
359
|
+
let widgetRemovals = 0;
|
|
360
|
+
const ctx = {
|
|
361
|
+
get hasUI() {
|
|
362
|
+
contextReads++;
|
|
363
|
+
if (stale) {
|
|
364
|
+
throw new Error("This extension ctx is stale after session replacement or reload.");
|
|
365
|
+
}
|
|
366
|
+
return true;
|
|
367
|
+
},
|
|
368
|
+
ui: {
|
|
369
|
+
setWidget(_key: string, content: unknown) {
|
|
370
|
+
if (content === undefined) widgetRemovals++;
|
|
371
|
+
},
|
|
372
|
+
onTerminalInput() { return () => { inputUnsubscribes++; }; },
|
|
373
|
+
getEditorText() { return ""; },
|
|
374
|
+
notify() {},
|
|
375
|
+
theme,
|
|
376
|
+
},
|
|
377
|
+
} as unknown as ExtensionContext;
|
|
378
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
379
|
+
try {
|
|
380
|
+
fleet.setContext(ctx);
|
|
381
|
+
stale = true;
|
|
382
|
+
assert.doesNotThrow(() => fleet.refresh());
|
|
383
|
+
assert.equal(inputUnsubscribes, 1);
|
|
384
|
+
assert.equal(widgetRemovals, 1);
|
|
385
|
+
assert.equal((fleet as unknown as { timer?: unknown }).timer, undefined);
|
|
386
|
+
const readsAfterStaleRefresh = contextReads;
|
|
387
|
+
fleet.refresh();
|
|
388
|
+
assert.equal(contextReads, readsAfterStaleRefresh, "later refreshes must not reuse the stale context");
|
|
389
|
+
} finally {
|
|
390
|
+
fleet.dispose();
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
it("does not swallow unrelated widget cleanup errors", () => {
|
|
395
|
+
const state = stateForTest();
|
|
396
|
+
state.foregroundControls.set("run-worker", {
|
|
397
|
+
runId: "run-worker",
|
|
398
|
+
mode: "single",
|
|
399
|
+
startedAt: 10,
|
|
400
|
+
updatedAt: 20,
|
|
401
|
+
currentAgent: "worker",
|
|
402
|
+
});
|
|
403
|
+
const ctx = {
|
|
404
|
+
hasUI: true,
|
|
405
|
+
ui: {
|
|
406
|
+
setWidget(_key: string, content: unknown) {
|
|
407
|
+
if (content === undefined) throw new Error("widget cleanup failed");
|
|
408
|
+
},
|
|
409
|
+
onTerminalInput() { return () => {}; },
|
|
410
|
+
getEditorText() { return ""; },
|
|
411
|
+
notify() {},
|
|
412
|
+
theme,
|
|
413
|
+
},
|
|
414
|
+
} as unknown as ExtensionContext;
|
|
415
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
416
|
+
fleet.setContext(ctx);
|
|
417
|
+
assert.throws(() => fleet.dispose(), /widget cleanup failed/);
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
it("preserves multiple unrelated UI cleanup errors", () => {
|
|
421
|
+
const state = stateForTest();
|
|
422
|
+
state.foregroundControls.set("run-worker", {
|
|
423
|
+
runId: "run-worker",
|
|
424
|
+
mode: "single",
|
|
425
|
+
startedAt: 10,
|
|
426
|
+
updatedAt: 20,
|
|
427
|
+
currentAgent: "worker",
|
|
428
|
+
});
|
|
429
|
+
const ctx = {
|
|
430
|
+
hasUI: true,
|
|
431
|
+
ui: {
|
|
432
|
+
setWidget(_key: string, content: unknown) {
|
|
433
|
+
if (content === undefined) throw new Error("widget cleanup failed");
|
|
434
|
+
},
|
|
435
|
+
onTerminalInput() {
|
|
436
|
+
return () => { throw new Error("input cleanup failed"); };
|
|
437
|
+
},
|
|
438
|
+
getEditorText() { return ""; },
|
|
439
|
+
notify() {},
|
|
440
|
+
theme,
|
|
441
|
+
},
|
|
442
|
+
} as unknown as ExtensionContext;
|
|
443
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
444
|
+
fleet.setContext(ctx);
|
|
445
|
+
assert.throws(
|
|
446
|
+
() => fleet.dispose(),
|
|
447
|
+
(error: unknown) => error instanceof AggregateError
|
|
448
|
+
&& error.errors.map(String).join("\n").includes("input cleanup failed")
|
|
449
|
+
&& error.errors.map(String).join("\n").includes("widget cleanup failed"),
|
|
450
|
+
);
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
it("keeps widget ownership through invalidation so an empty refresh removes it", () => {
|
|
454
|
+
const state = stateForTest();
|
|
455
|
+
state.foregroundControls.set("run-worker", {
|
|
456
|
+
runId: "run-worker",
|
|
457
|
+
mode: "single",
|
|
458
|
+
startedAt: 10,
|
|
459
|
+
updatedAt: 20,
|
|
460
|
+
currentAgent: "worker",
|
|
461
|
+
});
|
|
462
|
+
let widgetFactory: ((tui: unknown, theme: typeof theme) => { render(width: number): string[]; invalidate(): void }) | undefined;
|
|
463
|
+
let removals = 0;
|
|
464
|
+
const ctx = {
|
|
465
|
+
hasUI: true,
|
|
466
|
+
ui: {
|
|
467
|
+
setWidget(_key: string, content: typeof widgetFactory | undefined) {
|
|
468
|
+
if (content) widgetFactory = content;
|
|
469
|
+
else removals++;
|
|
470
|
+
},
|
|
471
|
+
onTerminalInput() { return () => {}; },
|
|
472
|
+
getEditorText() { return ""; },
|
|
473
|
+
requestRender() {},
|
|
474
|
+
notify() {},
|
|
475
|
+
theme,
|
|
476
|
+
},
|
|
477
|
+
} as unknown as ExtensionContext;
|
|
478
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
479
|
+
try {
|
|
480
|
+
fleet.setContext(ctx);
|
|
481
|
+
const component = widgetFactory!({ requestRender() {} }, theme);
|
|
482
|
+
component.invalidate();
|
|
483
|
+
state.foregroundControls.clear();
|
|
484
|
+
fleet.refresh();
|
|
485
|
+
assert.equal(removals, 1);
|
|
486
|
+
} finally {
|
|
487
|
+
fleet.dispose();
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
it("removes the dynamic widget while the fleet inspector owns the viewport", () => {
|
|
492
|
+
const state = stateForTest();
|
|
493
|
+
state.foregroundControls.set("run-worker", {
|
|
494
|
+
runId: "run-worker",
|
|
495
|
+
mode: "single",
|
|
496
|
+
startedAt: 10,
|
|
497
|
+
updatedAt: 20,
|
|
498
|
+
currentAgent: "worker",
|
|
499
|
+
});
|
|
500
|
+
const registrations: string[] = [];
|
|
501
|
+
const ctx = {
|
|
502
|
+
hasUI: true,
|
|
503
|
+
ui: {
|
|
504
|
+
setWidget(_key: string, content: unknown) {
|
|
505
|
+
registrations.push(content ? "shown" : "hidden");
|
|
506
|
+
},
|
|
507
|
+
onTerminalInput() { return () => {}; },
|
|
508
|
+
getEditorText() { return ""; },
|
|
509
|
+
requestRender() {},
|
|
510
|
+
notify() {},
|
|
511
|
+
theme,
|
|
512
|
+
},
|
|
513
|
+
} as unknown as ExtensionContext;
|
|
514
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
515
|
+
try {
|
|
516
|
+
fleet.setContext(ctx);
|
|
517
|
+
state.fleetInspectorOpen = true;
|
|
518
|
+
fleet.refresh();
|
|
519
|
+
state.fleetInspectorOpen = false;
|
|
520
|
+
fleet.refresh();
|
|
521
|
+
assert.deepEqual(registrations, ["shown", "hidden", "shown"]);
|
|
522
|
+
} finally {
|
|
523
|
+
fleet.dispose();
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
it("renders retained nested terminal siblings under an active owner with bounded leaves", () => {
|
|
528
|
+
const state = stateForTest();
|
|
529
|
+
state.asyncJobs.set("supervisor", {
|
|
530
|
+
asyncId: "supervisor",
|
|
531
|
+
asyncDir: "/tmp/supervisor",
|
|
532
|
+
status: "running",
|
|
533
|
+
mode: "single",
|
|
534
|
+
startedAt: 10,
|
|
535
|
+
updatedAt: 20,
|
|
536
|
+
steps: [{ agent: "supervisor", index: 0, status: "running" }],
|
|
537
|
+
nestedChildren: [0, 1, 2, 3, 4].map((index) => ({
|
|
538
|
+
id: `nested-${index}`,
|
|
539
|
+
parentRunId: "supervisor",
|
|
540
|
+
parentStepIndex: 0,
|
|
541
|
+
depth: 1,
|
|
542
|
+
path: [{ runId: "supervisor", stepIndex: 0 }],
|
|
543
|
+
state: index === 0 ? "complete" as const : "running" as const,
|
|
544
|
+
agent: `leaf-${index}`,
|
|
545
|
+
model: index === 0 ? "provider/gpt-5.6-luna:medium" : "provider/gpt-5.6-luna",
|
|
546
|
+
thinking: "medium",
|
|
547
|
+
startedAt: 10,
|
|
548
|
+
lastUpdate: 20,
|
|
549
|
+
...(index === 4 ? {
|
|
550
|
+
children: [{
|
|
551
|
+
id: "nested-hidden-child",
|
|
552
|
+
parentRunId: "nested-4",
|
|
553
|
+
depth: 2,
|
|
554
|
+
path: [{ runId: "supervisor", stepIndex: 0 }, { runId: "nested-4" }],
|
|
555
|
+
state: "running" as const,
|
|
556
|
+
agent: "hidden-child",
|
|
557
|
+
}],
|
|
558
|
+
} : {}),
|
|
559
|
+
})),
|
|
560
|
+
});
|
|
561
|
+
let widgetFactory: ((tui: unknown, theme: typeof theme) => { render(width: number): string[] }) | undefined;
|
|
562
|
+
const ctx = {
|
|
563
|
+
hasUI: true,
|
|
564
|
+
ui: {
|
|
565
|
+
setWidget(_key: string, content: typeof widgetFactory | undefined) { if (content) widgetFactory = content; },
|
|
566
|
+
onTerminalInput() { return () => {}; },
|
|
567
|
+
getEditorText() { return ""; },
|
|
568
|
+
requestRender() {},
|
|
569
|
+
notify() {},
|
|
570
|
+
theme,
|
|
571
|
+
},
|
|
572
|
+
} as unknown as ExtensionContext;
|
|
573
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
574
|
+
try {
|
|
575
|
+
fleet.setContext(ctx);
|
|
576
|
+
const tui = { requestRender() {}, focusedComponent: Object.create(Editor.prototype) as Editor };
|
|
577
|
+
const component = widgetFactory!(tui, theme);
|
|
578
|
+
assert.equal(component.render(120).length, 1, "nested activity should stay compact until navigation activates the roster");
|
|
579
|
+
assert.deepEqual(fleet.handleKey("\x1b[B"), { consume: true });
|
|
580
|
+
const lines = component.render(120).join("\n");
|
|
581
|
+
assert.match(lines, /supervisor/);
|
|
582
|
+
for (const [index, state] of ["complete", "running", "running", "running"].entries()) {
|
|
583
|
+
const line = lines.split("\n").find((candidate) => candidate.includes(`leaf-${index}`));
|
|
584
|
+
assert.ok(line);
|
|
585
|
+
assert.match(line!, /gpt-5.6-luna/);
|
|
586
|
+
assert.match(line!, /thinking medium/);
|
|
587
|
+
assert.match(line!, new RegExp(state));
|
|
588
|
+
}
|
|
589
|
+
assert.doesNotMatch(lines, /leaf-4.*running/);
|
|
590
|
+
assert.doesNotMatch(lines, /hidden-child/);
|
|
591
|
+
assert.match(lines, /\+2 nested leaves/);
|
|
592
|
+
} finally {
|
|
593
|
+
fleet.dispose();
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
it("counts hidden nested leaves across multiple parallel children", () => {
|
|
598
|
+
const state = stateForTest();
|
|
599
|
+
state.asyncJobs.set("supervisor", {
|
|
600
|
+
asyncId: "supervisor",
|
|
601
|
+
asyncDir: "/tmp/supervisor",
|
|
602
|
+
status: "running",
|
|
603
|
+
mode: "single",
|
|
604
|
+
startedAt: 10,
|
|
605
|
+
updatedAt: 20,
|
|
606
|
+
steps: [{ agent: "supervisor", index: 0, status: "running" }],
|
|
607
|
+
nestedChildren: [
|
|
608
|
+
{
|
|
609
|
+
id: "nested-a",
|
|
610
|
+
parentRunId: "supervisor",
|
|
611
|
+
parentStepIndex: 0,
|
|
612
|
+
depth: 1,
|
|
613
|
+
path: [{ runId: "supervisor", stepIndex: 0 }],
|
|
614
|
+
state: "running",
|
|
615
|
+
mode: "parallel",
|
|
616
|
+
steps: [0, 1, 2, 3].map((index) => ({ agent: `child-a-${index}`, index, status: "running" as const })),
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
id: "nested-b",
|
|
620
|
+
parentRunId: "supervisor",
|
|
621
|
+
parentStepIndex: 0,
|
|
622
|
+
depth: 1,
|
|
623
|
+
path: [{ runId: "supervisor", stepIndex: 0 }],
|
|
624
|
+
state: "running",
|
|
625
|
+
mode: "parallel",
|
|
626
|
+
steps: [0, 1].map((index) => ({ agent: `child-b-${index}`, index, status: "running" as const })),
|
|
627
|
+
},
|
|
628
|
+
],
|
|
629
|
+
});
|
|
630
|
+
let widgetFactory: ((tui: unknown, theme: typeof theme) => { render(width: number): string[] }) | undefined;
|
|
631
|
+
const ctx = {
|
|
632
|
+
hasUI: true,
|
|
633
|
+
ui: {
|
|
634
|
+
setWidget(_key: string, content: typeof widgetFactory | undefined) { if (content) widgetFactory = content; },
|
|
635
|
+
onTerminalInput() { return () => {}; },
|
|
636
|
+
getEditorText() { return ""; },
|
|
637
|
+
requestRender() {},
|
|
638
|
+
notify() {},
|
|
639
|
+
theme,
|
|
640
|
+
},
|
|
641
|
+
} as unknown as ExtensionContext;
|
|
642
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
643
|
+
try {
|
|
644
|
+
fleet.setContext(ctx);
|
|
645
|
+
const tui = { requestRender() {}, focusedComponent: Object.create(Editor.prototype) as Editor };
|
|
646
|
+
const component = widgetFactory!(tui, theme);
|
|
647
|
+
assert.equal(component.render(120).length, 1, "parallel nested activity should stay compact until activated");
|
|
648
|
+
assert.deepEqual(fleet.handleKey("\x1b[B"), { consume: true });
|
|
649
|
+
const lines = component.render(120).join("\n");
|
|
650
|
+
for (const index of [0, 1, 2, 3]) assert.match(lines, new RegExp(`child-a-${index}`));
|
|
651
|
+
assert.doesNotMatch(lines, /child-b-[01]/);
|
|
652
|
+
assert.match(lines, /\+2 nested leaves/);
|
|
653
|
+
} finally {
|
|
654
|
+
fleet.dispose();
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
it("shows only the current sequential chain step while retaining active parallel siblings", () => {
|
|
659
|
+
const state = stateForTest();
|
|
660
|
+
state.asyncJobs.set("sequential", {
|
|
661
|
+
asyncId: "sequential",
|
|
662
|
+
asyncDir: "/tmp/sequential",
|
|
663
|
+
status: "running",
|
|
664
|
+
mode: "chain",
|
|
665
|
+
currentStep: 1,
|
|
666
|
+
startedAt: 50,
|
|
667
|
+
updatedAt: 200,
|
|
668
|
+
steps: [
|
|
669
|
+
{ agent: "scout", index: 0, status: "complete" },
|
|
670
|
+
{ agent: "worker", index: 1, status: "running" },
|
|
671
|
+
{ agent: "reviewer", index: 2, status: "pending" },
|
|
672
|
+
],
|
|
673
|
+
});
|
|
674
|
+
state.asyncJobs.set("parallel-group", {
|
|
675
|
+
asyncId: "parallel-group",
|
|
676
|
+
asyncDir: "/tmp/parallel-group",
|
|
677
|
+
status: "running",
|
|
678
|
+
mode: "chain",
|
|
679
|
+
currentStep: 3,
|
|
680
|
+
activeParallelGroup: true,
|
|
681
|
+
startedAt: 100,
|
|
682
|
+
updatedAt: 200,
|
|
683
|
+
steps: [
|
|
684
|
+
{ agent: "reviewer", index: 3, status: "running" },
|
|
685
|
+
{ agent: "tester", index: 4, status: "pending" },
|
|
686
|
+
],
|
|
687
|
+
});
|
|
688
|
+
assert.deepEqual(collectFleetStatusEntries(state).map((entry) => entry.key), [
|
|
689
|
+
"async:sequential:1",
|
|
690
|
+
"async:parallel-group:3",
|
|
691
|
+
"async:parallel-group:4",
|
|
692
|
+
]);
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
it("shows every active foreground parallel child", () => {
|
|
696
|
+
const state = stateForTest();
|
|
697
|
+
state.foregroundControls.set("parallel", {
|
|
698
|
+
runId: "parallel",
|
|
699
|
+
mode: "parallel",
|
|
700
|
+
startedAt: 10,
|
|
701
|
+
updatedAt: 30,
|
|
702
|
+
activeChildren: new Map([
|
|
703
|
+
[0, { index: 0, agent: "reviewer", description: "Review correctness", startedAt: 11, updatedAt: 21, tokens: 100 }],
|
|
704
|
+
[1, { index: 1, agent: "reviewer", description: "Review quality", startedAt: 12, updatedAt: 22, tokens: 200 }],
|
|
705
|
+
[2, { index: 2, agent: "reviewer", description: "Review tests", startedAt: 13, updatedAt: 23, tokens: 300 }],
|
|
706
|
+
]),
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
const entries = collectFleetStatusEntries(state);
|
|
710
|
+
assert.deepEqual(entries.map((entry) => entry.key), [
|
|
711
|
+
"foreground-active:parallel:0",
|
|
712
|
+
"foreground-active:parallel:1",
|
|
713
|
+
"foreground-active:parallel:2",
|
|
714
|
+
]);
|
|
715
|
+
assert.deepEqual(entries.map((entry) => entry.description), ["Review correctness", "Review quality", "Review tests"]);
|
|
716
|
+
assert.deepEqual(collectFleetSnapshot(state).items.map((item) => item.key), entries.map((entry) => entry.key));
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
it("labels workflow-owned foreground children", () => {
|
|
720
|
+
const state = stateForTest();
|
|
721
|
+
state.foregroundControls.set("child-1", {
|
|
722
|
+
runId: "child-1",
|
|
723
|
+
parentWorkflowRunId: "workflow-1",
|
|
724
|
+
workflowKey: "review",
|
|
725
|
+
mode: "single",
|
|
726
|
+
startedAt: 10,
|
|
727
|
+
updatedAt: 20,
|
|
728
|
+
activeChildren: new Map([[0, { index: 0, agent: "reviewer", description: "Review the change", startedAt: 10, updatedAt: 20 }]]),
|
|
729
|
+
});
|
|
730
|
+
|
|
731
|
+
assert.deepEqual(collectFleetStatusEntries(state).map((entry) => ({ agent: entry.agent, description: entry.description })), [{
|
|
732
|
+
agent: "reviewer",
|
|
733
|
+
description: "workflow child: workflow-1 (review) · Review the change",
|
|
734
|
+
}]);
|
|
735
|
+
});
|
|
736
|
+
|
|
737
|
+
it("renders a workflow-owned foreground child under its workflow parent", () => {
|
|
738
|
+
const state = stateForTest();
|
|
739
|
+
state.asyncJobs.set("workflow-1", {
|
|
740
|
+
asyncId: "workflow-1",
|
|
741
|
+
asyncDir: "/tmp/workflow-1",
|
|
742
|
+
status: "running",
|
|
743
|
+
mode: "workflow",
|
|
744
|
+
startedAt: 10,
|
|
745
|
+
updatedAt: 20,
|
|
746
|
+
nestedChildren: [{
|
|
747
|
+
id: "owner-nested",
|
|
748
|
+
parentRunId: "workflow-1",
|
|
749
|
+
depth: 1,
|
|
750
|
+
path: [{ runId: "workflow-1" }],
|
|
751
|
+
state: "running",
|
|
752
|
+
agent: "owner-nested",
|
|
753
|
+
}],
|
|
754
|
+
});
|
|
755
|
+
state.foregroundControls.set("child-1", {
|
|
756
|
+
runId: "child-1",
|
|
757
|
+
parentWorkflowRunId: "workflow-1",
|
|
758
|
+
workflowKey: "review",
|
|
759
|
+
mode: "single",
|
|
760
|
+
startedAt: 11,
|
|
761
|
+
updatedAt: 20,
|
|
762
|
+
activeChildren: new Map([[0, { index: 0, agent: "reviewer", startedAt: 11, updatedAt: 20 }]]),
|
|
763
|
+
nestedChildren: [{
|
|
764
|
+
id: "nested-review",
|
|
765
|
+
parentRunId: "child-1",
|
|
766
|
+
parentStepIndex: 0,
|
|
767
|
+
depth: 1,
|
|
768
|
+
path: [{ runId: "child-1", stepIndex: 0 }],
|
|
769
|
+
state: "running",
|
|
770
|
+
agent: "nested-reviewer",
|
|
771
|
+
}],
|
|
772
|
+
});
|
|
773
|
+
state.foregroundControls.set("child-2", {
|
|
774
|
+
runId: "child-2",
|
|
775
|
+
parentWorkflowRunId: "workflow-1",
|
|
776
|
+
workflowKey: "test",
|
|
777
|
+
mode: "single",
|
|
778
|
+
startedAt: 12,
|
|
779
|
+
updatedAt: 20,
|
|
780
|
+
activeChildren: new Map([[0, { index: 0, agent: "tester", startedAt: 12, updatedAt: 20 }]]),
|
|
781
|
+
nestedChildren: [{
|
|
782
|
+
id: "nested-test",
|
|
783
|
+
parentRunId: "child-2",
|
|
784
|
+
parentStepIndex: 0,
|
|
785
|
+
depth: 1,
|
|
786
|
+
path: [{ runId: "child-2", stepIndex: 0 }],
|
|
787
|
+
state: "running",
|
|
788
|
+
agent: "nested-tester",
|
|
789
|
+
}],
|
|
790
|
+
});
|
|
791
|
+
const entries = collectFleetStatusEntries(state);
|
|
792
|
+
assert.deepEqual(entries.map((entry) => [entry.key, entry.parentKey]), [
|
|
793
|
+
["async:workflow-1", undefined],
|
|
794
|
+
["foreground-active:child-1:0", "async:workflow-1"],
|
|
795
|
+
["foreground-active:child-2:0", "async:workflow-1"],
|
|
796
|
+
]);
|
|
797
|
+
|
|
798
|
+
let widgetFactory: ((tui: unknown, theme: typeof theme) => { render(width: number): string[] }) | undefined;
|
|
799
|
+
const ctx = {
|
|
800
|
+
hasUI: true,
|
|
801
|
+
ui: {
|
|
802
|
+
setWidget(_key: string, content: typeof widgetFactory | undefined) { if (content) widgetFactory = content; },
|
|
803
|
+
onTerminalInput() { return () => {}; },
|
|
804
|
+
getEditorText() { return ""; },
|
|
805
|
+
requestRender() {},
|
|
806
|
+
notify() {},
|
|
807
|
+
theme,
|
|
808
|
+
},
|
|
809
|
+
} as unknown as ExtensionContext;
|
|
810
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
811
|
+
try {
|
|
812
|
+
fleet.setContext(ctx);
|
|
813
|
+
const component = widgetFactory!({ requestRender() {}, focusedComponent: Object.create(Editor.prototype) as Editor }, theme);
|
|
814
|
+
const compact = component.render(120);
|
|
815
|
+
assert.match(compact[0]!, /2 active agents/, "workflow wrappers must not be counted as leaf agents");
|
|
816
|
+
assert.doesNotMatch(compact[0]!, /3 active agents/);
|
|
817
|
+
assert.deepEqual(fleet.handleKey("\x1b[B"), { consume: true });
|
|
818
|
+
const lines = component.render(120);
|
|
819
|
+
const workflowIndex = lines.findIndex((line) => line.includes("workflow · running"));
|
|
820
|
+
const childIndex = lines.findIndex((line) => line.includes("reviewer · running"));
|
|
821
|
+
const nestedIndex = lines.findIndex((line) => line.includes("nested-reviewer"));
|
|
822
|
+
const secondChildIndex = lines.findIndex((line) => line.includes("tester · running"));
|
|
823
|
+
const secondNestedIndex = lines.findIndex((line) => line.includes("nested-tester"));
|
|
824
|
+
const ownerNestedIndex = lines.findIndex((line) => line.includes("owner-nested"));
|
|
825
|
+
assert.ok(workflowIndex >= 0 && childIndex > workflowIndex && nestedIndex > childIndex);
|
|
826
|
+
assert.ok(secondChildIndex > nestedIndex && secondNestedIndex > secondChildIndex && ownerNestedIndex > secondNestedIndex);
|
|
827
|
+
assert.match(lines[childIndex]!, /├─.*reviewer/);
|
|
828
|
+
assert.match(lines[nestedIndex]!, /├─.*nested-reviewer/);
|
|
829
|
+
assert.match(lines[secondNestedIndex]!, /├─.*nested-tester/);
|
|
830
|
+
assert.match(lines[ownerNestedIndex]!, /└─.*owner-nested/);
|
|
831
|
+
} finally {
|
|
832
|
+
fleet.dispose();
|
|
833
|
+
}
|
|
834
|
+
});
|
|
835
|
+
|
|
836
|
+
it("renders bounded workflow progress rows under the workflow parent", () => {
|
|
837
|
+
const state = stateForTest();
|
|
838
|
+
const workflowJob = {
|
|
839
|
+
asyncId: "workflow-1",
|
|
840
|
+
asyncDir: "/tmp/workflow-1",
|
|
841
|
+
sessionId: "session-current",
|
|
842
|
+
status: "running" as const,
|
|
843
|
+
mode: "workflow" as const,
|
|
844
|
+
startedAt: 10,
|
|
845
|
+
updatedAt: 20,
|
|
846
|
+
steps: [
|
|
847
|
+
{ agent: "scout", workflowKey: "scan", phase: "Plan", label: "Find seams", status: "complete" as const, index: 0, tokens: { input: 10, output: 5, total: 15 } },
|
|
848
|
+
{ agent: "reviewer", workflowKey: "review", phase: "Review", status: "running" as const, index: 1, currentTool: "grep", tokens: { input: 20, output: 5, total: 25 } },
|
|
849
|
+
{ agent: "tester", workflowKey: "test", phase: "Verify", status: "pending" as const, index: 2 },
|
|
850
|
+
],
|
|
851
|
+
};
|
|
852
|
+
state.asyncJobs.set("workflow-1", workflowJob);
|
|
853
|
+
state.fleetJobs!.set("workflow-1", workflowJob);
|
|
854
|
+
|
|
855
|
+
assert.deepEqual(collectFleetStatusEntries(state).map((entry) => entry.key), ["async:workflow-1"]);
|
|
856
|
+
assert.deepEqual(collectFleetSnapshot(state).items.map((item) => item.key), ["async:workflow-1"]);
|
|
857
|
+
|
|
858
|
+
let widgetFactory: ((tui: unknown, theme: typeof theme) => { render(width: number): string[] }) | undefined;
|
|
859
|
+
const ctx = {
|
|
860
|
+
hasUI: true,
|
|
861
|
+
ui: {
|
|
862
|
+
setWidget(_key: string, content: typeof widgetFactory | undefined) { if (content) widgetFactory = content; },
|
|
863
|
+
onTerminalInput() { return () => {}; },
|
|
864
|
+
getEditorText() { return ""; },
|
|
865
|
+
requestRender() {},
|
|
866
|
+
notify() {},
|
|
867
|
+
theme,
|
|
868
|
+
},
|
|
869
|
+
} as unknown as ExtensionContext;
|
|
870
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000, maxAgentRows: 8 });
|
|
871
|
+
try {
|
|
872
|
+
fleet.setContext(ctx);
|
|
873
|
+
const component = widgetFactory!({ requestRender() {}, focusedComponent: Object.create(Editor.prototype) as Editor }, theme);
|
|
874
|
+
assert.deepEqual(fleet.handleKey("\x1b[B"), { consume: true });
|
|
875
|
+
const lines = component.render(140).join("\n");
|
|
876
|
+
assert.match(lines, /workflow · running/);
|
|
877
|
+
assert.match(lines, /Plan: scan · Find seams \(scout\) · complete/);
|
|
878
|
+
assert.match(lines, /Review: review \(reviewer\) · running · tool grep/);
|
|
879
|
+
assert.match(lines, /Verify: test \(tester\) · pending/);
|
|
880
|
+
} finally {
|
|
881
|
+
fleet.dispose();
|
|
882
|
+
}
|
|
883
|
+
});
|
|
884
|
+
|
|
885
|
+
it("renders recursive nested runs and steps within the existing row budget", () => {
|
|
886
|
+
const state = stateForTest();
|
|
887
|
+
state.asyncJobs.set("supervisor", {
|
|
888
|
+
asyncId: "supervisor",
|
|
889
|
+
asyncDir: "/tmp/supervisor",
|
|
890
|
+
status: "running",
|
|
891
|
+
mode: "single",
|
|
892
|
+
startedAt: 10,
|
|
893
|
+
updatedAt: 20,
|
|
894
|
+
steps: [{ agent: "supervisor", index: 0, status: "running" }],
|
|
895
|
+
nestedChildren: [{
|
|
896
|
+
id: "level-one",
|
|
897
|
+
parentRunId: "supervisor",
|
|
898
|
+
parentStepIndex: 0,
|
|
899
|
+
depth: 1,
|
|
900
|
+
path: [{ runId: "supervisor", stepIndex: 0 }],
|
|
901
|
+
state: "running",
|
|
902
|
+
agent: "level-one",
|
|
903
|
+
children: [{
|
|
904
|
+
id: "level-two",
|
|
905
|
+
parentRunId: "level-one",
|
|
906
|
+
depth: 2,
|
|
907
|
+
path: [{ runId: "supervisor", stepIndex: 0 }, { runId: "level-one" }],
|
|
908
|
+
state: "running",
|
|
909
|
+
mode: "parallel",
|
|
910
|
+
steps: [{
|
|
911
|
+
agent: "level-two",
|
|
912
|
+
status: "running",
|
|
913
|
+
children: [0, 1, 2, 3].map((index) => ({
|
|
914
|
+
id: `leaf-${index}`,
|
|
915
|
+
parentRunId: "level-two",
|
|
916
|
+
depth: 3,
|
|
917
|
+
path: [{ runId: "level-two" }],
|
|
918
|
+
state: "running" as const,
|
|
919
|
+
agent: `leaf-${index}`,
|
|
920
|
+
})),
|
|
921
|
+
}],
|
|
922
|
+
}],
|
|
923
|
+
}],
|
|
924
|
+
});
|
|
925
|
+
let widgetFactory: ((tui: unknown, theme: typeof theme) => { render(width: number): string[] }) | undefined;
|
|
926
|
+
const ctx = {
|
|
927
|
+
hasUI: true,
|
|
928
|
+
ui: {
|
|
929
|
+
setWidget(_key: string, content: typeof widgetFactory | undefined) { if (content) widgetFactory = content; },
|
|
930
|
+
onTerminalInput() { return () => {}; },
|
|
931
|
+
getEditorText() { return ""; },
|
|
932
|
+
requestRender() {},
|
|
933
|
+
notify() {},
|
|
934
|
+
theme,
|
|
935
|
+
},
|
|
936
|
+
} as unknown as ExtensionContext;
|
|
937
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
938
|
+
try {
|
|
939
|
+
fleet.setContext(ctx);
|
|
940
|
+
const component = widgetFactory!({ requestRender() {}, focusedComponent: Object.create(Editor.prototype) as Editor }, theme);
|
|
941
|
+
assert.deepEqual(fleet.handleKey("\x1b[B"), { consume: true });
|
|
942
|
+
const lines = component.render(140).join("\n");
|
|
943
|
+
assert.match(lines, /level-one/);
|
|
944
|
+
assert.match(lines, /level-two/);
|
|
945
|
+
assert.match(lines, /leaf-0/);
|
|
946
|
+
assert.match(lines, /leaf-1/);
|
|
947
|
+
assert.doesNotMatch(lines, /leaf-[23]/);
|
|
948
|
+
assert.match(lines, /\+2 nested leaves/);
|
|
949
|
+
} finally {
|
|
950
|
+
fleet.dispose();
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
|
|
954
|
+
it("uses the same item keys as the full inspector", () => {
|
|
955
|
+
const state = stateForTest();
|
|
956
|
+
state.foregroundControls.set("foreground", {
|
|
957
|
+
runId: "foreground",
|
|
958
|
+
mode: "single",
|
|
959
|
+
startedAt: 10,
|
|
960
|
+
updatedAt: 20,
|
|
961
|
+
currentAgent: "worker",
|
|
962
|
+
currentIndex: 2,
|
|
963
|
+
});
|
|
964
|
+
const asyncJob = {
|
|
965
|
+
asyncId: "background",
|
|
966
|
+
asyncDir: "/tmp/background",
|
|
967
|
+
sessionId: "session-current",
|
|
968
|
+
status: "running" as const,
|
|
969
|
+
mode: "single" as const,
|
|
970
|
+
startedAt: 10,
|
|
971
|
+
updatedAt: 20,
|
|
972
|
+
steps: [{ agent: "reviewer", index: 0, status: "running" as const }],
|
|
973
|
+
};
|
|
974
|
+
state.asyncJobs.set(asyncJob.asyncId, asyncJob);
|
|
975
|
+
state.fleetJobs!.set(asyncJob.asyncId, asyncJob);
|
|
976
|
+
|
|
977
|
+
const statusKeys = collectFleetStatusEntries(state).map((entry) => entry.key).sort();
|
|
978
|
+
const inspectorKeys = collectFleetSnapshot(state).items.map((item) => item.key).sort();
|
|
979
|
+
assert.deepEqual(statusKeys, inspectorKeys);
|
|
980
|
+
});
|
|
981
|
+
|
|
982
|
+
it("hides tracked async task descriptions and shows per-child token totals", () => {
|
|
983
|
+
const state = stateForTest();
|
|
984
|
+
state.asyncJobs.set("async-run", {
|
|
985
|
+
asyncId: "async-run",
|
|
986
|
+
asyncDir: "/tmp/async-run",
|
|
987
|
+
status: "running",
|
|
988
|
+
mode: "parallel",
|
|
989
|
+
description: "Review the authentication changes",
|
|
990
|
+
startedAt: 100,
|
|
991
|
+
updatedAt: 200,
|
|
992
|
+
steps: [
|
|
993
|
+
{ agent: "reviewer", index: 0, status: "running", description: "Review only authentication", startedAt: 120, model: "openai/gpt-5", thinking: "medium", tokens: { input: 4_000, output: 200, total: 4_200 } },
|
|
994
|
+
{ agent: "worker", index: 1, status: "running", description: "Implement only billing", startedAt: 121, tokens: { input: 100, output: 20, total: 120 } },
|
|
995
|
+
],
|
|
996
|
+
});
|
|
997
|
+
const fleet = new SubagentFleetStatus(state, () => {}, { refreshMs: 60_000 });
|
|
998
|
+
let widgetFactory: ((tui: unknown, theme: typeof theme) => { render(width: number): string[] }) | undefined;
|
|
999
|
+
const ctx = {
|
|
1000
|
+
hasUI: true,
|
|
1001
|
+
ui: {
|
|
1002
|
+
setWidget(_key: string, content: typeof widgetFactory | undefined) { if (content) widgetFactory = content; },
|
|
1003
|
+
onTerminalInput() { return () => {}; },
|
|
1004
|
+
getEditorText() { return ""; },
|
|
1005
|
+
requestRender() {},
|
|
1006
|
+
notify() {},
|
|
1007
|
+
theme,
|
|
1008
|
+
},
|
|
1009
|
+
} as unknown as ExtensionContext;
|
|
1010
|
+
try {
|
|
1011
|
+
fleet.setContext(ctx);
|
|
1012
|
+
const tui = { requestRender() {}, focusedComponent: Object.create(Editor.prototype) as Editor };
|
|
1013
|
+
const component = widgetFactory!(tui, theme);
|
|
1014
|
+
assert.deepEqual(fleet.handleKey("\x1b[B"), { consume: true });
|
|
1015
|
+
const lines = component.render(180);
|
|
1016
|
+
assert.ok(lines.some((line) => line.includes("reviewer (gpt-5 · thinking medium)")));
|
|
1017
|
+
assert.ok(lines.some((line) => line.includes("worker")));
|
|
1018
|
+
assert.ok(lines.every((line) => !line.includes("Review only authentication") && !line.includes("Implement only billing") && !line.includes("Review the authentication changes")));
|
|
1019
|
+
assert.ok(lines.some((line) => line.includes("↓ 4.2k tokens")));
|
|
1020
|
+
} finally {
|
|
1021
|
+
fleet.dispose();
|
|
1022
|
+
}
|
|
1023
|
+
});
|
|
1024
|
+
|
|
1025
|
+
it("only captures navigation at an empty editor and opens the selected child", async () => {
|
|
1026
|
+
const state = stateForTest();
|
|
1027
|
+
state.foregroundControls.set("run-worker", {
|
|
1028
|
+
runId: "run-worker",
|
|
1029
|
+
mode: "single",
|
|
1030
|
+
startedAt: Date.now() - 1_000,
|
|
1031
|
+
updatedAt: Date.now(),
|
|
1032
|
+
currentAgent: "worker",
|
|
1033
|
+
description: "Implement FleetView",
|
|
1034
|
+
});
|
|
1035
|
+
let editorText = "draft";
|
|
1036
|
+
let inputHandler: ((data: string) => { consume?: boolean } | undefined) | undefined;
|
|
1037
|
+
let widgetFactory: ((tui: unknown, theme: typeof theme) => { render(width: number): string[] }) | undefined;
|
|
1038
|
+
const opened: string[] = [];
|
|
1039
|
+
let closeInspector: (() => void) | undefined;
|
|
1040
|
+
const ctx = {
|
|
1041
|
+
hasUI: true,
|
|
1042
|
+
ui: {
|
|
1043
|
+
setWidget(_key: string, content: typeof widgetFactory | undefined) { widgetFactory = content; },
|
|
1044
|
+
onTerminalInput(handler: typeof inputHandler) { inputHandler = handler; return () => { inputHandler = undefined; }; },
|
|
1045
|
+
getEditorText() { return editorText; },
|
|
1046
|
+
requestRender() {},
|
|
1047
|
+
notify() {},
|
|
1048
|
+
theme,
|
|
1049
|
+
},
|
|
1050
|
+
} as unknown as ExtensionContext;
|
|
1051
|
+
const fleet = new SubagentFleetStatus(state, (key) => {
|
|
1052
|
+
opened.push(key);
|
|
1053
|
+
return new Promise<void>((resolve) => { closeInspector = resolve; });
|
|
1054
|
+
}, { refreshMs: 60_000 });
|
|
1055
|
+
try {
|
|
1056
|
+
fleet.setContext(ctx);
|
|
1057
|
+
assert.ok(inputHandler);
|
|
1058
|
+
assert.ok(widgetFactory);
|
|
1059
|
+
const tui = { requestRender() {}, focusedComponent: Object.create(Editor.prototype) as Editor };
|
|
1060
|
+
const component = widgetFactory!(tui, theme);
|
|
1061
|
+
|
|
1062
|
+
assert.equal(inputHandler!("\x1b[B"), undefined, "non-empty editor should retain Down");
|
|
1063
|
+
editorText = "";
|
|
1064
|
+
tui.focusedComponent = {
|
|
1065
|
+
render() { return []; },
|
|
1066
|
+
invalidate() {},
|
|
1067
|
+
handleInput() {},
|
|
1068
|
+
} as unknown as Editor;
|
|
1069
|
+
assert.equal(inputHandler!("\x1b[B"), undefined, "non-editor focus should retain Down");
|
|
1070
|
+
|
|
1071
|
+
const crossModuleCustomEditor = {
|
|
1072
|
+
render() { return []; },
|
|
1073
|
+
invalidate() {},
|
|
1074
|
+
handleInput() {},
|
|
1075
|
+
getText() { return ""; },
|
|
1076
|
+
setText() {},
|
|
1077
|
+
} satisfies EditorComponent;
|
|
1078
|
+
assert.equal(crossModuleCustomEditor instanceof Editor, false, "regression setup must cross the instanceof boundary");
|
|
1079
|
+
tui.focusedComponent = crossModuleCustomEditor as unknown as Editor;
|
|
1080
|
+
assert.equal(inputHandler!("j"), undefined, "inactive FleetView should retain printable navigation keys");
|
|
1081
|
+
assert.equal(inputHandler!("k"), undefined, "inactive FleetView should retain printable navigation keys");
|
|
1082
|
+
assert.equal(component.render(100).length, 1, "inactive FleetView should stay compact");
|
|
1083
|
+
assert.deepEqual(inputHandler!("\x1b[B"), { consume: true }, "custom editors should activate FleetView across jiti boundaries");
|
|
1084
|
+
assert.ok(component.render(100).length > 1, "keyboard activation should expand the roster");
|
|
1085
|
+
assert.deepEqual(inputHandler!("j"), { consume: true }, "active FleetView should navigate down with j");
|
|
1086
|
+
assert.ok(component.render(100).some((line) => line.includes("> worker")));
|
|
1087
|
+
assert.deepEqual(inputHandler!("k"), { consume: true }, "active FleetView should navigate up with k");
|
|
1088
|
+
assert.ok(component.render(100).some((line) => line.includes("> main")));
|
|
1089
|
+
|
|
1090
|
+
tui.focusedComponent = Object.create(Editor.prototype) as Editor;
|
|
1091
|
+
assert.deepEqual(inputHandler!("\x1b[B"), { consume: true });
|
|
1092
|
+
assert.ok(component.render(100).some((line) => line.includes("> worker")));
|
|
1093
|
+
assert.deepEqual(inputHandler!("\r"), { consume: true });
|
|
1094
|
+
await Promise.resolve();
|
|
1095
|
+
assert.deepEqual(opened, ["foreground-active:run-worker:0"]);
|
|
1096
|
+
assert.equal(widgetFactory, undefined, "the widget should unregister while the inspector owns the viewport");
|
|
1097
|
+
|
|
1098
|
+
closeInspector!();
|
|
1099
|
+
await new Promise<void>((resolve) => setImmediate(resolve));
|
|
1100
|
+
assert.ok(widgetFactory, "closing should restore the FleetView widget");
|
|
1101
|
+
assert.notEqual(widgetFactory, component, "restoration should install a new component factory");
|
|
1102
|
+
const restoredComponent = widgetFactory!(tui, theme);
|
|
1103
|
+
assert.ok(restoredComponent.render(100).some((line) => line.includes("> worker")), "closing should restore the prior selected roster row");
|
|
1104
|
+
assert.deepEqual(inputHandler!("\x1b"), { consume: true });
|
|
1105
|
+
assert.equal(restoredComponent.render(100).length, 1, "Escape should return to the compact summary");
|
|
1106
|
+
} finally {
|
|
1107
|
+
fleet.dispose();
|
|
1108
|
+
}
|
|
1109
|
+
});
|
|
1110
|
+
});
|