@selesai/code 0.8.3 → 0.8.5
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 +15 -0
- package/README.md +7 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/defaults/models.json +41 -55
- package/dist/defaults/settings.json +7 -8
- package/dist/extensions/handoff-new.ts +1 -1
- package/dist/extensions/inline-skills.test.ts +1 -0
- package/dist/extensions/inline-skills.ts +1 -1
- package/dist/extensions/pi-intercom/CHANGELOG.md +25 -3
- package/dist/extensions/pi-intercom/README.md +34 -15
- package/dist/extensions/pi-intercom/broker/broker.ts +38 -141
- package/dist/extensions/pi-intercom/broker/client-liveness.test.ts +173 -0
- package/dist/extensions/pi-intercom/broker/client.ts +78 -150
- package/dist/extensions/pi-intercom/broker/extension-state.ts +18 -7
- package/dist/extensions/pi-intercom/broker/framing.ts +1 -1
- package/dist/extensions/pi-intercom/broker/protocol.ts +182 -0
- package/dist/extensions/pi-intercom/broker/spawn.test.ts +106 -7
- package/dist/extensions/pi-intercom/broker/spawn.ts +37 -11
- package/dist/extensions/pi-intercom/config.test.ts +8 -10
- package/dist/extensions/pi-intercom/config.ts +3 -3
- package/dist/extensions/pi-intercom/index.ts +218 -147
- package/dist/extensions/pi-intercom/intercom.integration.test.ts +891 -103
- package/dist/extensions/pi-intercom/package.json +3 -2
- package/dist/extensions/pi-intercom/project-agent.test.ts +145 -0
- package/dist/extensions/pi-intercom/project-agent.ts +324 -0
- package/dist/extensions/pi-intercom/reply-tracker.test.ts +86 -1
- package/dist/extensions/pi-intercom/reply-tracker.ts +41 -9
- package/dist/extensions/pi-intercom/skills/pi-intercom/SKILL.md +49 -9
- package/dist/extensions/pi-intercom/test/inline-message.test.ts +9 -9
- package/dist/extensions/pi-intercom/types.ts +3 -1
- package/dist/extensions/pi-intercom/ui/inline-message.ts +7 -7
- package/dist/extensions/pi-powerline-footer/.github/workflows/test.yml +2 -2
- package/dist/extensions/pi-powerline-footer/CHANGELOG.md +14 -1
- package/dist/extensions/pi-powerline-footer/README.md +20 -37
- package/dist/extensions/pi-powerline-footer/bash-mode/completion.ts +40 -25
- package/dist/extensions/pi-powerline-footer/bash-mode/editor.ts +149 -18
- package/dist/extensions/pi-powerline-footer/bash-mode/types.ts +1 -0
- package/dist/extensions/pi-powerline-footer/editor-performance.ts +99 -0
- package/dist/extensions/pi-powerline-footer/git-status.ts +15 -0
- package/dist/extensions/pi-powerline-footer/index.ts +394 -317
- package/dist/extensions/pi-powerline-footer/package.json +1 -1
- package/dist/extensions/pi-powerline-footer/powerline-config.ts +0 -12
- package/dist/extensions/pi-powerline-footer/queue/store.ts +8 -56
- package/dist/extensions/pi-powerline-footer/queue/types.ts +1 -2
- package/dist/extensions/pi-powerline-footer/segments.ts +0 -3
- package/dist/extensions/pi-powerline-footer/tests/bash-mode.test.ts +231 -1
- package/dist/extensions/pi-powerline-footer/tests/custom-items.test.ts +5 -19
- package/dist/extensions/pi-powerline-footer/tests/editor-performance.test.ts +43 -0
- package/dist/extensions/pi-powerline-footer/tests/git-optional-locks.test.ts +64 -0
- package/dist/extensions/pi-powerline-footer/tests/jump-shortcuts.test.ts +116 -0
- package/dist/extensions/pi-powerline-footer/tests/queue-store.test.ts +19 -149
- package/dist/extensions/pi-powerline-footer/tests/remaining-regressions.test.ts +6 -0
- package/dist/extensions/pi-powerline-footer/tests/usage-display.test.ts +5 -5
- package/dist/extensions/pi-powerline-footer/types.ts +1 -2
- package/dist/extensions/pi-subagents/CHANGELOG.md +225 -14
- package/dist/extensions/pi-subagents/README.md +66 -1613
- package/dist/extensions/pi-subagents/agents/builder.md +0 -1
- package/dist/extensions/pi-subagents/agents/delegate.md +14 -0
- package/dist/extensions/pi-subagents/agents/oracle.md +74 -0
- package/dist/extensions/pi-subagents/agents/reviewer.md +78 -0
- package/dist/extensions/pi-subagents/agents/scout.md +50 -0
- package/dist/extensions/pi-subagents/agents/worker.md +58 -0
- package/dist/extensions/pi-subagents/docs/configuration.md +372 -0
- package/dist/extensions/pi-subagents/docs/extension-api.md +308 -0
- package/dist/extensions/pi-subagents/docs/missions.md +119 -0
- package/dist/extensions/pi-subagents/docs/models.md +192 -0
- package/dist/extensions/pi-subagents/docs/observability.md +174 -0
- package/dist/extensions/pi-subagents/docs/tool-reference.md +343 -0
- package/dist/extensions/pi-subagents/docs/watchdog.md +176 -0
- package/dist/extensions/pi-subagents/docs/workflows.md +163 -0
- package/dist/extensions/pi-subagents/inspector-runner.mjs +11 -0
- package/dist/extensions/pi-subagents/package-lock.json +152 -194
- package/dist/extensions/pi-subagents/package.json +9 -10
- package/dist/extensions/pi-subagents/prompts/gather-context-and-clarify.md +1 -1
- package/dist/extensions/pi-subagents/prompts/parallel-cleanup.md +9 -9
- package/dist/extensions/pi-subagents/prompts/parallel-research.md +6 -6
- package/dist/extensions/pi-subagents/prompts/parallel-review.md +8 -8
- package/dist/extensions/pi-subagents/prompts/review-loop.md +12 -12
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +22 -17
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +77 -72
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +177 -69
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +28 -8
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +88 -66
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +3 -3
- package/dist/extensions/pi-subagents/src/agents/agent-refinements.ts +624 -0
- package/dist/extensions/pi-subagents/src/agents/agents.ts +38 -19
- package/dist/extensions/pi-subagents/src/agents/frontmatter.ts +7 -3
- package/dist/extensions/pi-subagents/src/agents/proactive-skills.ts +2 -2
- package/dist/extensions/pi-subagents/src/agents/skills.ts +2 -9
- package/dist/extensions/pi-subagents/src/api/delegation.ts +1 -2
- package/dist/extensions/pi-subagents/src/api/project-panes.ts +30 -0
- package/dist/extensions/pi-subagents/src/extension/config.ts +62 -8
- package/dist/extensions/pi-subagents/src/extension/control-notices.ts +2 -2
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +40 -0
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +51 -26
- package/dist/extensions/pi-subagents/src/extension/index.ts +140 -50
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +77 -0
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +18 -24
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +58 -21
- package/dist/extensions/pi-subagents/src/extension/subagent-guide.ts +39 -0
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +47 -25
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +3 -3
- package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +460 -64
- package/dist/extensions/pi-subagents/src/intercom/intercom-bridge.ts +4 -1
- package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +102 -4
- package/dist/extensions/pi-subagents/src/missions/actions.ts +77 -16
- package/dist/extensions/pi-subagents/src/missions/goal-driver.ts +162 -0
- package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +65 -17
- package/dist/extensions/pi-subagents/src/missions/store.ts +151 -9
- package/dist/extensions/pi-subagents/src/missions/types.ts +58 -3
- package/dist/extensions/pi-subagents/src/missions/workflow-state.ts +260 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +8 -8
- package/dist/extensions/pi-subagents/src/runs/background/active-async-capacity.ts +374 -0
- package/dist/extensions/pi-subagents/src/runs/background/active-run-index.ts +46 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +158 -36
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +294 -134
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +26 -4
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +45 -6
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +33 -15
- package/dist/extensions/pi-subagents/src/runs/background/completion-replay.ts +267 -0
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +145 -60
- package/dist/extensions/pi-subagents/src/runs/background/owned-process-tree.ts +104 -0
- package/dist/extensions/pi-subagents/src/runs/background/process-terminal.ts +17 -3
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +114 -6
- package/dist/extensions/pi-subagents/src/runs/background/resume-guidance.ts +33 -0
- package/dist/extensions/pi-subagents/src/runs/background/retained-children.ts +68 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +71 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +26 -3
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +42 -14
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +12 -24
- package/dist/extensions/pi-subagents/src/runs/background/steering.ts +7 -5
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +233 -101
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +17 -4
- package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +146 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +21 -5
- package/dist/extensions/pi-subagents/src/runs/foreground/async-dismiss-action.ts +85 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +43 -18
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-clarify.ts +20 -19
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +40 -2
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +188 -46
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-control.ts +12 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +137 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/prompt-audit.ts +171 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +1365 -252
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +187 -0
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +178 -26
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/llm-intent-arbiter.ts +286 -0
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +2 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +32 -5
- package/dist/extensions/pi-subagents/src/runs/shared/model-scope.ts +12 -2
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +3 -0
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +509 -117
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +10 -10
- package/dist/extensions/pi-subagents/src/runs/shared/run-fanout-budget.ts +280 -0
- package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +4 -2
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +189 -32
- package/dist/extensions/pi-subagents/src/runs/shared/task-intent.ts +21 -5
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +20 -8
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +128 -3
- package/dist/extensions/pi-subagents/src/shared/display-text.ts +100 -0
- package/dist/extensions/pi-subagents/src/shared/file-coalescer.ts +9 -0
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +13 -0
- package/dist/extensions/pi-subagents/src/shared/formatters.ts +4 -6
- package/dist/extensions/pi-subagents/src/shared/prompt-resources.ts +51 -0
- package/dist/extensions/pi-subagents/src/shared/settings.ts +41 -11
- package/dist/extensions/pi-subagents/src/shared/types.ts +192 -3
- package/dist/extensions/pi-subagents/src/shared/utf8.ts +11 -0
- package/dist/extensions/pi-subagents/src/shared/utils.ts +46 -34
- package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +1 -14
- package/dist/extensions/pi-subagents/src/slash/inline-subagents.ts +1 -1
- package/dist/extensions/pi-subagents/src/slash/prompt-template-bridge.ts +14 -12
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +176 -21
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +12 -6
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +52 -18
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +36 -5
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +37 -21
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +375 -42
- package/dist/extensions/pi-subagents/src/tui/render.ts +201 -68
- package/dist/extensions/pi-subagents/src/types/pi-runtime-compat.d.ts +0 -6
- package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +5 -4
- package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +0 -1
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +332 -27
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +15 -15
- 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 +84 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/package.json +14 -0
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +102 -15
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +507 -306
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +309 -123
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +124 -58
- package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +62 -16
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +167 -113
- package/dist/extensions/pi-subagents/test/integration/detect-error.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +4 -2
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +139 -58
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +324 -59
- package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +98 -22
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +106 -106
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +416 -106
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +287 -17
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +1122 -96
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +107 -20
- package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +26 -6
- package/dist/extensions/pi-subagents/test/integration/top-level-async.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/support/helpers.ts +2 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +1 -1
- package/dist/extensions/pi-subagents/test/support/ts-loader.mjs +0 -8
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +194 -59
- package/dist/extensions/pi-subagents/test/unit/active-async-capacity.test.ts +317 -0
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +15 -15
- package/dist/extensions/pi-subagents/test/unit/agent-eject-disable.test.ts +66 -66
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +334 -248
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +52 -52
- package/dist/extensions/pi-subagents/test/unit/agent-memory.test.ts +26 -26
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +118 -99
- package/dist/extensions/pi-subagents/test/unit/agent-refinements.test.ts +160 -0
- package/dist/extensions/pi-subagents/test/unit/agent-selection.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +43 -1
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +36 -10
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +387 -30
- package/dist/extensions/pi-subagents/test/unit/async-permission-session.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +18 -3
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +99 -40
- package/dist/extensions/pi-subagents/test/unit/background-work.test.ts +5 -3
- package/dist/extensions/pi-subagents/test/unit/builtin-agent-documentation.test.ts +7 -7
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-agent-allowlist.test.ts +19 -19
- package/dist/extensions/pi-subagents/test/unit/chain-append.test.ts +94 -23
- package/dist/extensions/pi-subagents/test/unit/chain-root-attachment.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/chain-serializer.test.ts +20 -20
- package/dist/extensions/pi-subagents/test/unit/child-transcript.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +35 -5
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +70 -52
- package/dist/extensions/pi-subagents/test/unit/completion-replay.test.ts +187 -0
- package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +125 -71
- package/dist/extensions/pi-subagents/test/unit/control-notices.test.ts +18 -3
- package/dist/extensions/pi-subagents/test/unit/default-extensions.test.ts +12 -12
- package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +17 -23
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +30 -2
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +25 -25
- package/dist/extensions/pi-subagents/test/unit/extra-agent-dirs.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/file-coalescer.test.ts +15 -0
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +91 -47
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +468 -38
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +14 -4
- package/dist/extensions/pi-subagents/test/unit/foreground-tool-call-compaction.test.ts +37 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector-bootstrap.test.ts +69 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +79 -2
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +102 -49
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +98 -32
- package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +7 -6
- package/dist/extensions/pi-subagents/test/unit/llm-intent-arbiter.test.ts +171 -0
- package/dist/extensions/pi-subagents/test/unit/mission-goal-driver.test.ts +116 -0
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +81 -7
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +289 -13
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +42 -1
- package/dist/extensions/pi-subagents/test/unit/model-scope-settings.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/model-scope.test.ts +11 -2
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +84 -10
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +122 -8
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +8 -8
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +24 -24
- package/dist/extensions/pi-subagents/test/unit/owned-process-tree.test.ts +69 -0
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +16 -2
- package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +7 -7
- package/dist/extensions/pi-subagents/test/unit/parallel-utils.test.ts +10 -10
- package/dist/extensions/pi-subagents/test/unit/path-handling.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/path-resolution.test.ts +26 -17
- package/dist/extensions/pi-subagents/test/unit/pi-args-permission-system.test.ts +405 -0
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +440 -92
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +24 -8
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +6 -6
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +43 -43
- package/dist/extensions/pi-subagents/test/unit/proactive-skills.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/process-terminal.test.ts +59 -6
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +19 -19
- package/dist/extensions/pi-subagents/test/unit/project-panes-public-api.test.ts +243 -0
- package/dist/extensions/pi-subagents/test/unit/prompt-template-bridge.test.ts +68 -168
- package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +58 -15
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +51 -0
- package/dist/extensions/pi-subagents/test/unit/reads-resolution.test.ts +66 -0
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +47 -28
- package/dist/extensions/pi-subagents/test/unit/result-intercom.test.ts +12 -12
- package/dist/extensions/pi-subagents/test/unit/retained-children.test.ts +57 -0
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +111 -31
- package/dist/extensions/pi-subagents/test/unit/run-fanout-budget.test.ts +121 -0
- package/dist/extensions/pi-subagents/test/unit/run-id-resolver.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +65 -50
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +69 -28
- package/dist/extensions/pi-subagents/test/unit/scheduled-store-root.test.ts +67 -0
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +60 -44
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +424 -49
- package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +28 -0
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +23 -1
- package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +32 -5
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +130 -92
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-action-recovery.test.ts +85 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +35 -35
- package/dist/extensions/pi-subagents/test/unit/subagent-guide.test.ts +24 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +312 -22
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +150 -15
- package/dist/extensions/pi-subagents/test/unit/task-intent.test.ts +65 -26
- package/dist/extensions/pi-subagents/test/unit/timeout-defaults.test.ts +138 -0
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +76 -25
- package/dist/extensions/pi-subagents/test/unit/turn-budget.test.ts +5 -5
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +55 -6
- package/dist/extensions/pi-subagents/test/unit/watchdog-child-status.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/watchdog-lsp-diagnostics.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/watchdog-runtime.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/watchdog-settings.test.ts +8 -8
- package/dist/extensions/pi-subagents/test/unit/widget-nested-render.test.ts +6 -6
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +138 -11
- package/dist/extensions/pi-subagents/test/unit/workflow-graph.test.ts +8 -8
- package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +113 -0
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +68 -7
- package/dist/extensions/pi-subagents/test/unit/writer-budget-guidance.test.ts +6 -6
- package/dist/extensions/workflow/extension.ts +21 -19
- package/dist/extensions/workflow/modes.ts +65 -0
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.js +48 -1
- package/dist/skills/pi-subagents/SKILL.md +20 -15
- package/dist/skills/pi-subagents/references/constraints-and-recipes.md +77 -83
- package/dist/skills/pi-subagents/references/execution-controls.md +215 -106
- package/dist/skills/pi-subagents/references/management-authoring-rpc.md +29 -9
- package/dist/skills/pi-subagents/references/prompting-and-roles.md +58 -43
- package/docs/plans/workflow-autoloop-reference.md +192 -0
- package/docs/plans/workflow-subagent-consolidation-planb.md +374 -0
- package/docs/plans/workflow-subagent-scripted-merge.md +406 -0
- package/docs/quickstart.md +27 -43
- package/docs/settings.md +4 -0
- package/docs/usage.md +1 -0
- package/package.json +2 -1
- package/dist/extensions/workflow/adapter.ts +0 -949
- package/dist/extensions/workflow/modes/loop.ts +0 -74
- package/dist/extensions/workflow/modes/prototype.ts +0 -170
- package/dist/extensions/workflow/modes/quicktype.ts +0 -150
- package/dist/extensions/workflow/modes/task.ts +0 -105
- package/dist/extensions/workflow/run-state.ts +0 -124
- package/dist/extensions/workflow/state-machine.ts +0 -484
- package/dist/extensions/workflow/validators.ts +0 -42
|
@@ -5,9 +5,13 @@ import * as path from "node:path";
|
|
|
5
5
|
import { describe, it } from "node:test";
|
|
6
6
|
import { visibleWidth, type MarkdownTheme } from "@earendil-works/pi-tui";
|
|
7
7
|
import { collectFleetSnapshot, openSubagentFleet, SubagentFleetComponent } from "../../src/tui/fleet.ts";
|
|
8
|
+
import { persistForegroundRunHistory, restoreForegroundRunHistory } from "../../src/runs/foreground/foreground-history.ts";
|
|
8
9
|
import { FLEET_STATUS_WIDGET_KEY } from "../../src/tui/fleet-status.ts";
|
|
10
|
+
import { registerLivePromptAudit, rewritePromptWithGuidance } from "../../src/runs/foreground/prompt-audit.ts";
|
|
9
11
|
import { getArtifactPaths, getArtifactsDir, getProjectArtifactsDir } from "../../src/shared/artifacts.ts";
|
|
10
12
|
import type { SubagentState } from "../../src/shared/types.ts";
|
|
13
|
+
import { fauxAssistantMessage } from "@earendil-works/pi-ai/providers/faux";
|
|
14
|
+
import { createAssistantMessageEventStream } from "@earendil-works/pi-ai";
|
|
11
15
|
|
|
12
16
|
function stateForTest(): SubagentState {
|
|
13
17
|
return {
|
|
@@ -42,7 +46,7 @@ function writeAsyncRun(root: string, input: {
|
|
|
42
46
|
}): string {
|
|
43
47
|
const asyncDir = path.join(root, input.id);
|
|
44
48
|
fs.mkdirSync(asyncDir, { recursive: true });
|
|
45
|
-
const agents = input.agents ?? ["
|
|
49
|
+
const agents = input.agents ?? ["worker"];
|
|
46
50
|
if (input.output !== undefined) fs.writeFileSync(path.join(asyncDir, "output-0.log"), input.output, "utf-8");
|
|
47
51
|
const transcriptPath = input.transcript ? path.join(asyncDir, "transcript-0.jsonl") : undefined;
|
|
48
52
|
if (transcriptPath && input.transcript) fs.writeFileSync(transcriptPath, `${input.transcript.map((record) => JSON.stringify(record)).join("\n")}\n`, "utf-8");
|
|
@@ -91,10 +95,39 @@ const markdownTheme: MarkdownTheme = {
|
|
|
91
95
|
};
|
|
92
96
|
|
|
93
97
|
describe("native subagent fleet", () => {
|
|
98
|
+
it("rewrites an authored prompt from guidance without persistence", async () => {
|
|
99
|
+
const calls: unknown[] = [];
|
|
100
|
+
const streamFn = (_model: never, context: unknown) => {
|
|
101
|
+
calls.push(context);
|
|
102
|
+
const stream = createAssistantMessageEventStream();
|
|
103
|
+
queueMicrotask(() => stream.push({ type: "done", reason: "stop", message: fauxAssistantMessage("Rewritten task", { stopReason: "stop" }) }));
|
|
104
|
+
return stream;
|
|
105
|
+
};
|
|
106
|
+
const model = { provider: "faux", id: "rewrite", api: "faux", input: ["text"], reasoning: false, cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 1000, maxTokens: 100 };
|
|
107
|
+
const ctx = {
|
|
108
|
+
model,
|
|
109
|
+
signal: undefined,
|
|
110
|
+
modelRegistry: {
|
|
111
|
+
async getApiKeyAndHeaders() { return { ok: true as const, apiKey: "test" }; },
|
|
112
|
+
getRegisteredProviderConfig() { return { api: "faux", streamSimple: streamFn }; },
|
|
113
|
+
},
|
|
114
|
+
} as never;
|
|
115
|
+
const rewritten = await rewritePromptWithGuidance({
|
|
116
|
+
ctx,
|
|
117
|
+
authoredTask: "Original task",
|
|
118
|
+
runtimeAdditions: "Runtime context",
|
|
119
|
+
finalEffectivePrompt: "Runtime context\n\nOriginal task",
|
|
120
|
+
guidance: "Make it narrower",
|
|
121
|
+
});
|
|
122
|
+
assert.equal(rewritten, "Rewritten task");
|
|
123
|
+
assert.match(JSON.stringify(calls), /Original task/);
|
|
124
|
+
assert.match(JSON.stringify(calls), /Make it narrower/);
|
|
125
|
+
});
|
|
126
|
+
|
|
94
127
|
it("collects current-session foreground and flattened async children", () => {
|
|
95
128
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-fleet-collect-"));
|
|
96
129
|
try {
|
|
97
|
-
writeAsyncRun(root, { id: "async-current", agents: ["
|
|
130
|
+
writeAsyncRun(root, { id: "async-current", agents: ["worker", "reviewer"], output: "CURRENT OUTPUT" });
|
|
98
131
|
writeAsyncRun(root, { id: "async-other", sessionId: "session-other", output: "OTHER OUTPUT" });
|
|
99
132
|
const state = stateForTest();
|
|
100
133
|
state.foregroundControls.set("foreground-live", {
|
|
@@ -102,7 +135,7 @@ describe("native subagent fleet", () => {
|
|
|
102
135
|
mode: "chain",
|
|
103
136
|
startedAt: 10,
|
|
104
137
|
updatedAt: 30,
|
|
105
|
-
currentAgent: "
|
|
138
|
+
currentAgent: "scout",
|
|
106
139
|
currentIndex: 1,
|
|
107
140
|
});
|
|
108
141
|
state.foregroundRuns!.set("foreground-recent", {
|
|
@@ -111,7 +144,7 @@ describe("native subagent fleet", () => {
|
|
|
111
144
|
cwd: root,
|
|
112
145
|
sessionId: "session-current",
|
|
113
146
|
updatedAt: 20,
|
|
114
|
-
children: [{ agent: "
|
|
147
|
+
children: [{ agent: "planner", index: 0, status: "completed", finalOutput: "PLAN COMPLETE" }],
|
|
115
148
|
});
|
|
116
149
|
state.foregroundRuns!.set("foreground-other", {
|
|
117
150
|
runId: "foreground-other",
|
|
@@ -135,6 +168,112 @@ describe("native subagent fleet", () => {
|
|
|
135
168
|
}
|
|
136
169
|
});
|
|
137
170
|
|
|
171
|
+
it("shows live prompt summaries and opens Prompt Audit with the authored prompt visible", async () => {
|
|
172
|
+
const sentinel = "PROMPT_AUDIT_SENTINEL_1021";
|
|
173
|
+
const secondSentinel = "PROMPT_AUDIT_SECOND_CHILD";
|
|
174
|
+
const state = stateForTest();
|
|
175
|
+
const control = {
|
|
176
|
+
runId: "prompt-run",
|
|
177
|
+
sessionId: "session-current",
|
|
178
|
+
mode: "parallel" as const,
|
|
179
|
+
startedAt: 10,
|
|
180
|
+
updatedAt: 20,
|
|
181
|
+
activeChildren: new Map([
|
|
182
|
+
[0, { index: 0, agent: "worker", startedAt: 10, updatedAt: 20 }],
|
|
183
|
+
[1, { index: 1, agent: "reviewer", startedAt: 11, updatedAt: 21 }],
|
|
184
|
+
]),
|
|
185
|
+
};
|
|
186
|
+
state.foregroundControls.set(control.runId, control);
|
|
187
|
+
registerLivePromptAudit(control, 0, sentinel, `[Read from: context.md]\n\n${sentinel}\n\n---\nRuntime acceptance`, { rerun: { params: { agent: "worker", task: sentinel } } });
|
|
188
|
+
registerLivePromptAudit(control, 1, secondSentinel, secondSentinel);
|
|
189
|
+
assert.doesNotMatch(JSON.stringify(control), new RegExp(sentinel), "live prompts must not enter serializable Fleet state");
|
|
190
|
+
const clipboardWrites: string[] = [];
|
|
191
|
+
const redoCalls: Array<{ runId: string; index: number; guidance: string }> = [];
|
|
192
|
+
const component = new SubagentFleetComponent(
|
|
193
|
+
{ terminal: { rows: 28, columns: 100 }, requestRender() {} } as never,
|
|
194
|
+
theme as never,
|
|
195
|
+
state,
|
|
196
|
+
() => {},
|
|
197
|
+
{
|
|
198
|
+
refreshMs: 60_000,
|
|
199
|
+
markdownTheme,
|
|
200
|
+
copyText: (text) => { clipboardWrites.push(text); },
|
|
201
|
+
actions: {
|
|
202
|
+
async steer() { return { text: "unused" }; },
|
|
203
|
+
stop() { return { text: "unused" }; },
|
|
204
|
+
async redoPrompt(input) {
|
|
205
|
+
redoCalls.push(input);
|
|
206
|
+
return { text: "Prompt redo started redo-run." };
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
);
|
|
211
|
+
try {
|
|
212
|
+
const initialRender = component.render(100).join("\n");
|
|
213
|
+
assert.match(initialRender, new RegExp(`Task: ${sentinel}`));
|
|
214
|
+
assert.match(initialRender, /Prompt audit: 2 live · 3 views · p opens/);
|
|
215
|
+
component.handleInput("p");
|
|
216
|
+
assert.doesNotMatch(component.render(100).join("\n"), /Prompt text hidden|Enter reveal|r hide/);
|
|
217
|
+
assert.match(component.render(100).join("\n"), new RegExp(sentinel));
|
|
218
|
+
component.handleInput("2");
|
|
219
|
+
assert.match(component.render(100).join("\n"), /Read from: context\.md/);
|
|
220
|
+
component.handleInput("3");
|
|
221
|
+
assert.match(component.render(100).join("\n"), /Runtime acceptance/);
|
|
222
|
+
component.handleInput("c");
|
|
223
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
224
|
+
assert.deepEqual(clipboardWrites, [`[Read from: context.md]\n\n${sentinel}\n\n---\nRuntime acceptance`]);
|
|
225
|
+
assert.match(component.render(100).join("\n"), /Copied visible prompt view/);
|
|
226
|
+
component.handleInput("g");
|
|
227
|
+
for (const char of "make narrower") component.handleInput(char);
|
|
228
|
+
component.handleInput("\r");
|
|
229
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
230
|
+
assert.deepEqual(redoCalls, [{ runId: "prompt-run", index: 0, guidance: "make narrower", control }]);
|
|
231
|
+
assert.match(component.render(100).join("\n"), /Prompt redo started redo-run/);
|
|
232
|
+
component.handleInput("j");
|
|
233
|
+
assert.match(component.render(100).join("\n"), /Selected: 2\/2/);
|
|
234
|
+
assert.match(component.render(100).join("\n"), /Agent: reviewer/);
|
|
235
|
+
assert.match(component.render(100).join("\n"), new RegExp(secondSentinel));
|
|
236
|
+
component.handleInput("k");
|
|
237
|
+
component.handleInput("1");
|
|
238
|
+
assert.match(component.render(100).join("\n"), /Selected: 1\/2/);
|
|
239
|
+
assert.match(component.render(100).join("\n"), /Agent: worker/);
|
|
240
|
+
assert.match(component.render(100).join("\n"), new RegExp(sentinel));
|
|
241
|
+
component.handleInput("\x1b");
|
|
242
|
+
assert.match(component.render(100).join("\n"), /Prompt audit: 2 live · 3 views · p opens/);
|
|
243
|
+
} finally {
|
|
244
|
+
component.dispose();
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
it("rejects Prompt Audit for a child owned by another session", () => {
|
|
249
|
+
const state = stateForTest();
|
|
250
|
+
const control = {
|
|
251
|
+
runId: "other-run",
|
|
252
|
+
sessionId: "session-other",
|
|
253
|
+
mode: "single" as const,
|
|
254
|
+
startedAt: 10,
|
|
255
|
+
updatedAt: 20,
|
|
256
|
+
activeChildren: new Map([[0, { index: 0, agent: "worker", startedAt: 10, updatedAt: 20 }]]),
|
|
257
|
+
};
|
|
258
|
+
state.foregroundControls.set(control.runId, control);
|
|
259
|
+
registerLivePromptAudit(control, 0, "SECRET", "SECRET");
|
|
260
|
+
const component = new SubagentFleetComponent(
|
|
261
|
+
{ terminal: { rows: 28, columns: 100 }, requestRender() {} } as never,
|
|
262
|
+
theme as never,
|
|
263
|
+
state,
|
|
264
|
+
() => {},
|
|
265
|
+
{ refreshMs: 60_000, markdownTheme },
|
|
266
|
+
);
|
|
267
|
+
try {
|
|
268
|
+
component.handleInput("p");
|
|
269
|
+
const rendered = component.render(100).join("\n");
|
|
270
|
+
assert.match(rendered, /Prompt Audit is available only/);
|
|
271
|
+
assert.doesNotMatch(rendered, /SECRET/);
|
|
272
|
+
} finally {
|
|
273
|
+
component.dispose();
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
|
|
138
277
|
it("keeps tracked active workflows ahead of older failed terminal history", () => {
|
|
139
278
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-fleet-history-"));
|
|
140
279
|
try {
|
|
@@ -147,7 +286,7 @@ describe("native subagent fleet", () => {
|
|
|
147
286
|
sessionId: "session-current",
|
|
148
287
|
status: "running",
|
|
149
288
|
mode: "workflow",
|
|
150
|
-
agents: ["
|
|
289
|
+
agents: ["worker"],
|
|
151
290
|
startedAt: 100,
|
|
152
291
|
updatedAt: 200,
|
|
153
292
|
}]]);
|
|
@@ -228,6 +367,54 @@ describe("native subagent fleet", () => {
|
|
|
228
367
|
assert.equal(snapshot.items[0]?.agent, "workflow");
|
|
229
368
|
});
|
|
230
369
|
|
|
370
|
+
it("labels workflow-owned foreground children and opens their parent Herdr inspector", async () => {
|
|
371
|
+
const state = stateForTest();
|
|
372
|
+
state.asyncJobs.set("workflow-1", {
|
|
373
|
+
asyncId: "workflow-1",
|
|
374
|
+
asyncDir: "/tmp/workflow-1",
|
|
375
|
+
status: "running",
|
|
376
|
+
mode: "workflow",
|
|
377
|
+
startedAt: 10,
|
|
378
|
+
updatedAt: 20,
|
|
379
|
+
});
|
|
380
|
+
state.foregroundControls.set("child-1", {
|
|
381
|
+
runId: "child-1",
|
|
382
|
+
parentWorkflowRunId: "workflow-1",
|
|
383
|
+
workflowKey: "review",
|
|
384
|
+
mode: "single",
|
|
385
|
+
startedAt: 10,
|
|
386
|
+
updatedAt: 20,
|
|
387
|
+
activeChildren: new Map([[0, { index: 0, agent: "reviewer", startedAt: 10, updatedAt: 20 }]]),
|
|
388
|
+
});
|
|
389
|
+
const snapshot = collectFleetSnapshot(state);
|
|
390
|
+
const child = snapshot.items.find((item) => item.key === "foreground-active:child-1:0");
|
|
391
|
+
assert.equal(child?.kind, "foreground-active");
|
|
392
|
+
const calls: Array<{ runId: string; asyncDir: string; index?: number }> = [];
|
|
393
|
+
const component = new SubagentFleetComponent(
|
|
394
|
+
{ terminal: { rows: 28, columns: 100 }, requestRender() {} } as never,
|
|
395
|
+
theme as never,
|
|
396
|
+
state,
|
|
397
|
+
() => {},
|
|
398
|
+
{
|
|
399
|
+
initialKey: "foreground-active:child-1:0",
|
|
400
|
+
refreshMs: 60_000,
|
|
401
|
+
actions: {
|
|
402
|
+
async steer() { return { text: "unused" }; },
|
|
403
|
+
stop() { return { text: "unused" }; },
|
|
404
|
+
async inspect(input) { calls.push(input); return { text: "Inspector opened." }; },
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
);
|
|
408
|
+
try {
|
|
409
|
+
assert.ok(component.render(100).some((line) => line.includes("Workflow child of: workflow-1 (review)")));
|
|
410
|
+
component.handleInput("H");
|
|
411
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
412
|
+
assert.deepEqual(calls, [{ runId: "workflow-1", asyncDir: "/tmp/workflow-1" }]);
|
|
413
|
+
} finally {
|
|
414
|
+
component.dispose();
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
|
|
231
418
|
it("keeps every active async run ahead of the bounded recent-completion window", () => {
|
|
232
419
|
const state = stateForTest();
|
|
233
420
|
for (let index = 0; index < 22; index++) {
|
|
@@ -238,7 +425,7 @@ describe("native subagent fleet", () => {
|
|
|
238
425
|
sessionId: "session-current",
|
|
239
426
|
status: "complete",
|
|
240
427
|
mode: "single",
|
|
241
|
-
agents: ["
|
|
428
|
+
agents: ["worker"],
|
|
242
429
|
startedAt: index,
|
|
243
430
|
updatedAt: index,
|
|
244
431
|
});
|
|
@@ -249,7 +436,7 @@ describe("native subagent fleet", () => {
|
|
|
249
436
|
sessionId: "session-current",
|
|
250
437
|
status: "running",
|
|
251
438
|
mode: "single",
|
|
252
|
-
agents: ["
|
|
439
|
+
agents: ["scout"],
|
|
253
440
|
startedAt: 0,
|
|
254
441
|
updatedAt: 0,
|
|
255
442
|
});
|
|
@@ -261,6 +448,247 @@ describe("native subagent fleet", () => {
|
|
|
261
448
|
assert.ok(!snapshot.items.some((item) => item.runId === "terminal-0"));
|
|
262
449
|
});
|
|
263
450
|
|
|
451
|
+
it("accepts default Fleet navigation from Kitty CSI-u input", () => {
|
|
452
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-fleet-kitty-default-"));
|
|
453
|
+
try {
|
|
454
|
+
writeAsyncRun(root, { id: "newer", lastUpdate: 300 });
|
|
455
|
+
writeAsyncRun(root, { id: "older", lastUpdate: 200 });
|
|
456
|
+
const component = new SubagentFleetComponent(
|
|
457
|
+
{ terminal: { rows: 28, columns: 100 }, requestRender() {} } as never,
|
|
458
|
+
theme as never,
|
|
459
|
+
stateForTest(),
|
|
460
|
+
() => {},
|
|
461
|
+
{ asyncDirRoot: root, resultsDir: path.join(root, "results"), refreshMs: 60_000 },
|
|
462
|
+
);
|
|
463
|
+
try {
|
|
464
|
+
const selectedLine = () => component.render(100).find((line) => line.includes("›")) ?? "";
|
|
465
|
+
assert.match(selectedLine(), /newer/);
|
|
466
|
+
component.handleInput("\x1b[106;1u");
|
|
467
|
+
assert.match(selectedLine(), /older/);
|
|
468
|
+
} finally {
|
|
469
|
+
component.dispose();
|
|
470
|
+
}
|
|
471
|
+
} finally {
|
|
472
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
it("uses custom Fleet keybindings without applying them inside modal text input", () => {
|
|
477
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-fleet-custom-keys-"));
|
|
478
|
+
try {
|
|
479
|
+
writeAsyncRun(root, { id: "newer", lastUpdate: 300 });
|
|
480
|
+
writeAsyncRun(root, { id: "older", lastUpdate: 200 });
|
|
481
|
+
const state = stateForTest();
|
|
482
|
+
let closed = false;
|
|
483
|
+
const component = new SubagentFleetComponent(
|
|
484
|
+
{ terminal: { rows: 28, columns: 100 }, requestRender() {} } as never,
|
|
485
|
+
theme as never,
|
|
486
|
+
state,
|
|
487
|
+
() => { closed = true; },
|
|
488
|
+
{
|
|
489
|
+
asyncDirRoot: root,
|
|
490
|
+
resultsDir: path.join(root, "results"),
|
|
491
|
+
refreshMs: 60_000,
|
|
492
|
+
fleetKeybindings: {
|
|
493
|
+
selectDown: ["n"],
|
|
494
|
+
selectUp: ["p"],
|
|
495
|
+
steer: ["m"],
|
|
496
|
+
close: ["z"],
|
|
497
|
+
},
|
|
498
|
+
actions: {
|
|
499
|
+
async steer() { return { text: "unused" }; },
|
|
500
|
+
stop() { return { text: "unused" }; },
|
|
501
|
+
},
|
|
502
|
+
},
|
|
503
|
+
);
|
|
504
|
+
try {
|
|
505
|
+
const selectedLine = () => component.render(100).find((line) => line.includes("›")) ?? "";
|
|
506
|
+
assert.match(selectedLine(), /newer/);
|
|
507
|
+
component.handleInput("j");
|
|
508
|
+
assert.match(selectedLine(), /newer/, "default j should not move when selectDown is overridden");
|
|
509
|
+
component.handleInput("\x1b[110;1u");
|
|
510
|
+
assert.match(selectedLine(), /older/, "custom selectDown should accept Kitty CSI-u input");
|
|
511
|
+
component.handleInput("p");
|
|
512
|
+
assert.match(selectedLine(), /newer/);
|
|
513
|
+
component.handleInput("m");
|
|
514
|
+
component.handleInput("m");
|
|
515
|
+
assert.ok(component.render(100).some((line) => line.includes("Steer message (steer): m")));
|
|
516
|
+
component.handleInput("\x1b");
|
|
517
|
+
component.handleInput("z");
|
|
518
|
+
assert.equal(closed, true);
|
|
519
|
+
} finally {
|
|
520
|
+
component.dispose();
|
|
521
|
+
}
|
|
522
|
+
} finally {
|
|
523
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
it("restores current-session completed foreground history from the compact index", () => {
|
|
528
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-fleet-foreground-history-"));
|
|
529
|
+
try {
|
|
530
|
+
const resultsDir = path.join(root, "results");
|
|
531
|
+
const cwd = path.join(root, "project");
|
|
532
|
+
const artifactsRoot = getProjectArtifactsDir(cwd);
|
|
533
|
+
fs.mkdirSync(artifactsRoot, { recursive: true });
|
|
534
|
+
const outputPath = path.join(artifactsRoot, "outputs", "restored", "output.md");
|
|
535
|
+
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
536
|
+
fs.writeFileSync(outputPath, "restored foreground output", "utf-8");
|
|
537
|
+
|
|
538
|
+
const state = stateForTest();
|
|
539
|
+
state.foregroundRuns!.set("restored", {
|
|
540
|
+
runId: "restored",
|
|
541
|
+
mode: "single",
|
|
542
|
+
cwd,
|
|
543
|
+
sessionId: "session-current",
|
|
544
|
+
updatedAt: 200,
|
|
545
|
+
children: [{ agent: "worker", index: 0, status: "completed", finalOutput: "do not persist this when an artifact exists", savedOutputPath: outputPath }],
|
|
546
|
+
});
|
|
547
|
+
state.foregroundRuns!.set("other-session", {
|
|
548
|
+
runId: "other-session",
|
|
549
|
+
mode: "single",
|
|
550
|
+
cwd,
|
|
551
|
+
sessionId: "session-other",
|
|
552
|
+
updatedAt: 300,
|
|
553
|
+
children: [{ agent: "outsider", index: 0, status: "completed", savedOutputPath: outputPath }],
|
|
554
|
+
});
|
|
555
|
+
persistForegroundRunHistory(state, { resultsDir });
|
|
556
|
+
|
|
557
|
+
const restored = stateForTest();
|
|
558
|
+
restored.baseCwd = cwd;
|
|
559
|
+
assert.equal(restoreForegroundRunHistory(restored, { resultsDir }), 1);
|
|
560
|
+
const snapshot = collectFleetSnapshot(restored);
|
|
561
|
+
assert.deepEqual(snapshot.items.map((item) => item.key), ["foreground-recent:restored:0"]);
|
|
562
|
+
|
|
563
|
+
const component = new SubagentFleetComponent(
|
|
564
|
+
{ terminal: { rows: 28, columns: 100 }, requestRender() {} } as never,
|
|
565
|
+
theme as never,
|
|
566
|
+
restored,
|
|
567
|
+
() => {},
|
|
568
|
+
{ refreshMs: 60_000 },
|
|
569
|
+
);
|
|
570
|
+
try {
|
|
571
|
+
const lines = component.render(100);
|
|
572
|
+
assert.ok(lines.some((line) => line.includes("restored foreground output")));
|
|
573
|
+
assert.ok(!lines.some((line) => line.includes("do not persist")));
|
|
574
|
+
} finally {
|
|
575
|
+
component.dispose();
|
|
576
|
+
}
|
|
577
|
+
} finally {
|
|
578
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
|
|
582
|
+
it("does not restore nonterminal foreground history rows", () => {
|
|
583
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-fleet-foreground-terminal-"));
|
|
584
|
+
try {
|
|
585
|
+
const resultsDir = path.join(root, "results");
|
|
586
|
+
fs.mkdirSync(resultsDir, { recursive: true });
|
|
587
|
+
fs.writeFileSync(path.join(resultsDir, "foreground-history.json"), JSON.stringify({
|
|
588
|
+
version: 1,
|
|
589
|
+
runs: [
|
|
590
|
+
{
|
|
591
|
+
runId: "stale-running",
|
|
592
|
+
mode: "single",
|
|
593
|
+
cwd: root,
|
|
594
|
+
sessionId: "session-current",
|
|
595
|
+
updatedAt: 300,
|
|
596
|
+
children: [{ agent: "worker", index: 0, status: "running", currentTool: "bash" }],
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
runId: "terminal",
|
|
600
|
+
mode: "single",
|
|
601
|
+
cwd: root,
|
|
602
|
+
sessionId: "session-current",
|
|
603
|
+
updatedAt: 200,
|
|
604
|
+
children: [{ agent: "reviewer", index: 0, status: "completed", finalOutput: "done" }],
|
|
605
|
+
},
|
|
606
|
+
],
|
|
607
|
+
}, null, 2), "utf-8");
|
|
608
|
+
|
|
609
|
+
const restored = stateForTest();
|
|
610
|
+
restored.baseCwd = root;
|
|
611
|
+
assert.equal(restoreForegroundRunHistory(restored, { resultsDir }), 1);
|
|
612
|
+
assert.deepEqual([...restored.foregroundRuns!.keys()], ["terminal"]);
|
|
613
|
+
assert.deepEqual(collectFleetSnapshot(restored).items.map((item) => item.key), ["foreground-recent:terminal:0"]);
|
|
614
|
+
|
|
615
|
+
const state = stateForTest();
|
|
616
|
+
state.foregroundRuns!.set("stale-running", {
|
|
617
|
+
runId: "stale-running",
|
|
618
|
+
mode: "single",
|
|
619
|
+
cwd: root,
|
|
620
|
+
sessionId: "session-current",
|
|
621
|
+
updatedAt: 400,
|
|
622
|
+
children: [{ agent: "worker", index: 0, status: "running" as never }],
|
|
623
|
+
});
|
|
624
|
+
persistForegroundRunHistory(state, { resultsDir });
|
|
625
|
+
const persisted = JSON.parse(fs.readFileSync(path.join(resultsDir, "foreground-history.json"), "utf-8")) as { runs: Array<{ runId: string }> };
|
|
626
|
+
assert.deepEqual(persisted.runs.map((run) => run.runId), ["terminal"]);
|
|
627
|
+
} finally {
|
|
628
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
it("keeps restored foreground rows when output artifacts are unavailable and bounds history", () => {
|
|
633
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-fleet-foreground-missing-"));
|
|
634
|
+
try {
|
|
635
|
+
const resultsDir = path.join(root, "results");
|
|
636
|
+
const cwd = path.join(root, "project");
|
|
637
|
+
const artifactsRoot = getProjectArtifactsDir(cwd);
|
|
638
|
+
const state = stateForTest();
|
|
639
|
+
for (let index = 0; index < 3; index++) {
|
|
640
|
+
const outputPath = path.join(artifactsRoot, "outputs", `run-${index}`, "output.md");
|
|
641
|
+
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
642
|
+
fs.writeFileSync(outputPath, `output ${index}`, "utf-8");
|
|
643
|
+
state.foregroundRuns!.set(`run-${index}`, {
|
|
644
|
+
runId: `run-${index}`,
|
|
645
|
+
mode: "single",
|
|
646
|
+
cwd,
|
|
647
|
+
sessionId: "session-current",
|
|
648
|
+
updatedAt: index,
|
|
649
|
+
children: [{ agent: "worker", index: 0, status: "completed", savedOutputPath: outputPath }],
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
persistForegroundRunHistory(state, { resultsDir, limit: 2 });
|
|
653
|
+
fs.rmSync(path.join(artifactsRoot, "outputs", "run-2", "output.md"), { force: true });
|
|
654
|
+
|
|
655
|
+
const restored = stateForTest();
|
|
656
|
+
restored.baseCwd = cwd;
|
|
657
|
+
assert.equal(restoreForegroundRunHistory(restored, { resultsDir, limit: 2 }), 2);
|
|
658
|
+
assert.deepEqual([...restored.foregroundRuns!.keys()], ["run-2", "run-1"]);
|
|
659
|
+
|
|
660
|
+
const component = new SubagentFleetComponent(
|
|
661
|
+
{ terminal: { rows: 28, columns: 100 }, requestRender() {} } as never,
|
|
662
|
+
theme as never,
|
|
663
|
+
restored,
|
|
664
|
+
() => {},
|
|
665
|
+
{ initialKey: "foreground-recent:run-2:0", refreshMs: 60_000 },
|
|
666
|
+
);
|
|
667
|
+
try {
|
|
668
|
+
assert.ok(component.render(100).some((line) => line.includes("output artifact unavailable")));
|
|
669
|
+
} finally {
|
|
670
|
+
component.dispose();
|
|
671
|
+
}
|
|
672
|
+
} finally {
|
|
673
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
it("uses the full 85% terminal-height budget for the inspector", () => {
|
|
678
|
+
const component = new SubagentFleetComponent(
|
|
679
|
+
{ terminal: { rows: 60, columns: 100 }, requestRender() {} } as never,
|
|
680
|
+
theme as never,
|
|
681
|
+
stateForTest(),
|
|
682
|
+
() => {},
|
|
683
|
+
{ refreshMs: 60_000 },
|
|
684
|
+
);
|
|
685
|
+
try {
|
|
686
|
+
assert.equal(component.render(100).length, 51);
|
|
687
|
+
} finally {
|
|
688
|
+
component.dispose();
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
|
|
264
692
|
it("renders selectable transcript detail and completed artifact paths within terminal width", () => {
|
|
265
693
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-fleet-render-"));
|
|
266
694
|
try {
|
|
@@ -280,8 +708,8 @@ describe("native subagent fleet", () => {
|
|
|
280
708
|
const lines = component.render(100);
|
|
281
709
|
assert.ok(lines.some((line) => line.includes("FINAL ASYNC OUTPUT")));
|
|
282
710
|
assert.ok(lines.some((line) => line.includes("output-0.log")));
|
|
283
|
-
assert.ok(lines.some((line) => line.includes("
|
|
284
|
-
assert.ok(lines.some((line) => line.includes("
|
|
711
|
+
assert.ok(lines.some((line) => line.includes("worker") && line.includes("[fork]")));
|
|
712
|
+
assert.ok(lines.some((line) => line.includes("worker.jsonl")));
|
|
285
713
|
for (const line of lines) assert.ok(visibleWidth(line) <= 100, `line exceeded width: ${line}`);
|
|
286
714
|
tui.terminal.rows = 10;
|
|
287
715
|
assert.ok(component.render(100).length <= 8, "short-terminal render should fit the overlay's 85% height cap");
|
|
@@ -383,7 +811,7 @@ describe("native subagent fleet", () => {
|
|
|
383
811
|
mode: "single",
|
|
384
812
|
startedAt: 100,
|
|
385
813
|
updatedAt: 200,
|
|
386
|
-
steps: [{ agent: "
|
|
814
|
+
steps: [{ agent: "worker", index: 0, status: "running", transcriptPath }],
|
|
387
815
|
});
|
|
388
816
|
const component = new SubagentFleetComponent(
|
|
389
817
|
{ terminal: { rows: 28, columns: 100 }, requestRender() {} } as never,
|
|
@@ -463,17 +891,17 @@ describe("native subagent fleet", () => {
|
|
|
463
891
|
startedAt: now - 1_000,
|
|
464
892
|
updatedAt: now,
|
|
465
893
|
cwd: effectiveCwd,
|
|
466
|
-
currentAgent: "
|
|
894
|
+
currentAgent: "reviewer",
|
|
467
895
|
currentIndex: 1,
|
|
468
896
|
description: "Review the active task",
|
|
469
897
|
activeChildren: new Map([
|
|
470
|
-
[0, { index: 0, agent: "
|
|
471
|
-
[1, { index: 1, agent: "
|
|
898
|
+
[0, { index: 0, agent: "worker", description: "Implement the active task", startedAt: now - 900, updatedAt: now - 100, tokens: 120, model: "provider/live-model", thinking: "high" }],
|
|
899
|
+
[1, { index: 1, agent: "reviewer", description: "Review the active task", startedAt: now - 800, updatedAt: now, tokens: 240 }],
|
|
472
900
|
]),
|
|
473
901
|
});
|
|
474
902
|
const artifactsRoot = getProjectArtifactsDir(effectiveCwd);
|
|
475
903
|
fs.mkdirSync(artifactsRoot, { recursive: true });
|
|
476
|
-
const transcriptPath = getArtifactPaths(artifactsRoot, "foreground-live", "
|
|
904
|
+
const transcriptPath = getArtifactPaths(artifactsRoot, "foreground-live", "worker", 0).transcriptPath;
|
|
477
905
|
fs.writeFileSync(transcriptPath, `${JSON.stringify({ recordType: "message", role: "assistant", model: "test-model", text: "**Worker live result**" })}\n`, "utf-8");
|
|
478
906
|
const component = new SubagentFleetComponent(
|
|
479
907
|
{ terminal: { rows: 28, columns: 90 }, requestRender() {} } as never,
|
|
@@ -484,11 +912,11 @@ describe("native subagent fleet", () => {
|
|
|
484
912
|
);
|
|
485
913
|
try {
|
|
486
914
|
const lines = component.render(90);
|
|
487
|
-
assert.ok(lines.some((line) => line.includes("
|
|
488
|
-
assert.ok(lines.some((line) => line.includes("
|
|
915
|
+
assert.ok(lines.some((line) => line.includes("worker")));
|
|
916
|
+
assert.ok(lines.some((line) => line.includes("reviewer")));
|
|
489
917
|
assert.ok(lines.some((line) => line.includes("foreground · live")));
|
|
490
918
|
assert.ok(lines.some((line) => line.includes("live-model · thinking high")));
|
|
491
|
-
assert.ok(lines.
|
|
919
|
+
assert.ok(lines.every((line) => !line.includes("Implement the active task") && !line.includes("Review the active task")));
|
|
492
920
|
assert.ok(lines.some((line) => line.includes("Conversation") && line.includes("assistant response")));
|
|
493
921
|
assert.ok(lines.some((line) => line.includes("Worker live result")));
|
|
494
922
|
} finally {
|
|
@@ -519,9 +947,9 @@ describe("native subagent fleet", () => {
|
|
|
519
947
|
const activeId = `${prefix}-active`;
|
|
520
948
|
const recentId = `${prefix}-recent`;
|
|
521
949
|
const asyncId = `${prefix}-async`;
|
|
522
|
-
transcript(activeId, "
|
|
523
|
-
const recentTranscript = transcript(recentId, "
|
|
524
|
-
const asyncTranscript = transcript(asyncId, "
|
|
950
|
+
transcript(activeId, "worker", 0, `${preference} active foreground transcript`);
|
|
951
|
+
const recentTranscript = transcript(recentId, "reviewer", 0, `${preference} completed foreground transcript`);
|
|
952
|
+
const asyncTranscript = transcript(asyncId, "scout", 0, `${preference} async transcript`);
|
|
525
953
|
|
|
526
954
|
const state = stateForTest();
|
|
527
955
|
state.baseCwd = baseCwd;
|
|
@@ -533,7 +961,7 @@ describe("native subagent fleet", () => {
|
|
|
533
961
|
cwd: baseCwd,
|
|
534
962
|
startedAt: 100,
|
|
535
963
|
updatedAt: 300,
|
|
536
|
-
currentAgent: "
|
|
964
|
+
currentAgent: "worker",
|
|
537
965
|
currentIndex: 0,
|
|
538
966
|
});
|
|
539
967
|
state.foregroundRuns!.set(recentId, {
|
|
@@ -542,7 +970,7 @@ describe("native subagent fleet", () => {
|
|
|
542
970
|
cwd: baseCwd,
|
|
543
971
|
sessionId: "session-current",
|
|
544
972
|
updatedAt: 200,
|
|
545
|
-
children: [{ agent: "
|
|
973
|
+
children: [{ agent: "reviewer", index: 0, status: "completed", transcriptPath: recentTranscript, model: "provider/recent-model", thinking: "xhigh" }],
|
|
546
974
|
});
|
|
547
975
|
state.asyncJobs.set(asyncId, {
|
|
548
976
|
asyncId,
|
|
@@ -553,7 +981,7 @@ describe("native subagent fleet", () => {
|
|
|
553
981
|
mode: "single",
|
|
554
982
|
startedAt: 100,
|
|
555
983
|
updatedAt: 250,
|
|
556
|
-
steps: [{ agent: "
|
|
984
|
+
steps: [{ agent: "scout", index: 0, status: "complete", transcriptPath: asyncTranscript }],
|
|
557
985
|
});
|
|
558
986
|
|
|
559
987
|
for (const [initialKey, expected] of [
|
|
@@ -588,7 +1016,7 @@ describe("native subagent fleet", () => {
|
|
|
588
1016
|
it("shows disk-only current-session async runs when the overlay opens", async () => {
|
|
589
1017
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-fleet-overlay-reconcile-"));
|
|
590
1018
|
try {
|
|
591
|
-
writeAsyncRun(root, { id: "disk-only", agents: ["
|
|
1019
|
+
writeAsyncRun(root, { id: "disk-only", agents: ["worker"] });
|
|
592
1020
|
const state = stateForTest();
|
|
593
1021
|
let rendered = "";
|
|
594
1022
|
const ctx = {
|
|
@@ -607,7 +1035,7 @@ describe("native subagent fleet", () => {
|
|
|
607
1035
|
};
|
|
608
1036
|
|
|
609
1037
|
await openSubagentFleet(ctx as never, state, { asyncDirRoot: root, resultsDir: path.join(root, "results") });
|
|
610
|
-
assert.match(rendered, /
|
|
1038
|
+
assert.match(rendered, /worker/);
|
|
611
1039
|
} finally {
|
|
612
1040
|
fs.rmSync(root, { recursive: true, force: true });
|
|
613
1041
|
}
|
|
@@ -640,22 +1068,22 @@ describe("native subagent fleet", () => {
|
|
|
640
1068
|
|
|
641
1069
|
it("focuses the selected child and renders raw foreground model details", () => {
|
|
642
1070
|
const state = stateForTest();
|
|
643
|
-
state.foregroundControls.set("run-
|
|
644
|
-
runId: "run-
|
|
1071
|
+
state.foregroundControls.set("run-worker", {
|
|
1072
|
+
runId: "run-worker",
|
|
645
1073
|
mode: "single",
|
|
646
1074
|
startedAt: 10,
|
|
647
1075
|
updatedAt: 20,
|
|
648
|
-
currentAgent: "
|
|
1076
|
+
currentAgent: "worker",
|
|
649
1077
|
currentIndex: 0,
|
|
650
1078
|
model: "provider/raw-model",
|
|
651
1079
|
thinking: "medium",
|
|
652
1080
|
});
|
|
653
|
-
state.foregroundControls.set("run-
|
|
654
|
-
runId: "run-
|
|
1081
|
+
state.foregroundControls.set("run-reviewer", {
|
|
1082
|
+
runId: "run-reviewer",
|
|
655
1083
|
mode: "single",
|
|
656
1084
|
startedAt: 11,
|
|
657
1085
|
updatedAt: 21,
|
|
658
|
-
currentAgent: "
|
|
1086
|
+
currentAgent: "reviewer",
|
|
659
1087
|
currentIndex: 0,
|
|
660
1088
|
});
|
|
661
1089
|
state.foregroundRuns!.set("run-recent", {
|
|
@@ -664,19 +1092,19 @@ describe("native subagent fleet", () => {
|
|
|
664
1092
|
cwd: process.cwd(),
|
|
665
1093
|
sessionId: "session-current",
|
|
666
1094
|
updatedAt: 19,
|
|
667
|
-
children: [{ agent: "
|
|
1095
|
+
children: [{ agent: "reviewer", index: 0, status: "completed", model: "provider/recent-raw-model", thinking: "xhigh" }],
|
|
668
1096
|
});
|
|
669
1097
|
const component = new SubagentFleetComponent(
|
|
670
1098
|
{ terminal: { rows: 28, columns: 90 }, requestRender() {} } as never,
|
|
671
1099
|
theme as never,
|
|
672
1100
|
state,
|
|
673
1101
|
() => {},
|
|
674
|
-
{ initialKey: "foreground-active:run-
|
|
1102
|
+
{ initialKey: "foreground-active:run-worker:0", refreshMs: 60_000 },
|
|
675
1103
|
);
|
|
676
1104
|
try {
|
|
677
1105
|
const lines = component.render(90);
|
|
678
1106
|
const selectedLine = lines.find((line) => line.includes("›"));
|
|
679
|
-
assert.ok(selectedLine?.includes("
|
|
1107
|
+
assert.ok(selectedLine?.includes("run-work"), `unexpected selected row: ${selectedLine}`);
|
|
680
1108
|
assert.ok(lines.some((line) => line.includes("Model: raw-model · thinking medium")));
|
|
681
1109
|
} finally {
|
|
682
1110
|
component.dispose();
|
|
@@ -699,9 +1127,9 @@ describe("native subagent fleet", () => {
|
|
|
699
1127
|
it("steers the selected async child with an inline message", async () => {
|
|
700
1128
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-fleet-steer-"));
|
|
701
1129
|
try {
|
|
702
|
-
const asyncDir = writeAsyncRun(root, { id: "async-steer", agents: ["
|
|
1130
|
+
const asyncDir = writeAsyncRun(root, { id: "async-steer", agents: ["worker", "reviewer"] });
|
|
703
1131
|
const state = stateForTest();
|
|
704
|
-
const calls: Array<{ runId: string; asyncDir: string; index?: number; message: string }> = [];
|
|
1132
|
+
const calls: Array<{ runId: string; asyncDir: string; index?: number; message: string; mode: string }> = [];
|
|
705
1133
|
const component = new SubagentFleetComponent(
|
|
706
1134
|
{ terminal: { rows: 28, columns: 100 }, requestRender() {} } as never,
|
|
707
1135
|
theme as never,
|
|
@@ -725,11 +1153,13 @@ describe("native subagent fleet", () => {
|
|
|
725
1153
|
);
|
|
726
1154
|
try {
|
|
727
1155
|
component.handleInput("s");
|
|
728
|
-
assert.ok(component.render(100).some((line) => line.includes("Steer message:")));
|
|
1156
|
+
assert.ok(component.render(100).some((line) => line.includes("Steer message (steer):")));
|
|
1157
|
+
component.handleInput("\t");
|
|
1158
|
+
assert.ok(component.render(100).some((line) => line.includes("Steer message (follow_up):")));
|
|
729
1159
|
for (const char of "please continue") component.handleInput(char);
|
|
730
1160
|
component.handleInput("\r");
|
|
731
1161
|
await new Promise((resolve) => setImmediate(resolve));
|
|
732
|
-
assert.deepEqual(calls, [{ runId: "async-steer", asyncDir, index: 0, message: "please continue" }]);
|
|
1162
|
+
assert.deepEqual(calls, [{ runId: "async-steer", asyncDir, index: 0, message: "please continue", mode: "follow_up" }]);
|
|
733
1163
|
assert.ok(component.render(100).some((line) => line.includes("Steering queued.")));
|
|
734
1164
|
} finally {
|
|
735
1165
|
component.dispose();
|