@selesai/code 0.6.2 → 0.7.0
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 +16 -1
- package/README.md +1 -1
- package/dist/bun/cli.d.ts +0 -1
- package/dist/bun/cli.js +0 -1
- package/dist/bun/register-bedrock.d.ts +0 -1
- package/dist/bun/register-bedrock.js +0 -1
- package/dist/bun/restore-sandbox-env.d.ts +0 -1
- package/dist/bun/restore-sandbox-env.js +0 -1
- package/dist/cli/args.d.ts +0 -1
- package/dist/cli/args.js +0 -1
- package/dist/cli/config-selector.d.ts +0 -1
- package/dist/cli/config-selector.js +0 -1
- package/dist/cli/credential-print.d.ts +0 -1
- package/dist/cli/credential-print.js +0 -1
- package/dist/cli/file-processor.d.ts +0 -1
- package/dist/cli/file-processor.js +0 -1
- package/dist/cli/initial-message.d.ts +0 -1
- package/dist/cli/initial-message.js +0 -1
- package/dist/cli/list-models.d.ts +0 -1
- package/dist/cli/list-models.js +0 -1
- package/dist/cli/project-trust.d.ts +0 -1
- package/dist/cli/project-trust.js +0 -1
- package/dist/cli/session-picker.d.ts +0 -1
- package/dist/cli/session-picker.js +0 -1
- package/dist/cli/startup-ui.d.ts +0 -1
- package/dist/cli/startup-ui.js +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/core/agent-session-auto-handoff.test.d.ts +0 -1
- package/dist/core/agent-session-auto-handoff.test.js +0 -1
- package/dist/core/agent-session-runtime.d.ts +0 -1
- package/dist/core/agent-session-runtime.js +0 -1
- package/dist/core/agent-session-services.d.ts +0 -1
- package/dist/core/agent-session-services.js +0 -1
- package/dist/core/agent-session-skill-block.test.d.ts +0 -1
- package/dist/core/agent-session-skill-block.test.js +0 -1
- package/dist/core/agent-session.d.ts +0 -1
- package/dist/core/agent-session.js +0 -1
- package/dist/core/agents.d.ts +0 -1
- package/dist/core/agents.js +0 -1
- package/dist/core/auth-guidance.d.ts +0 -1
- package/dist/core/auth-guidance.js +0 -1
- package/dist/core/auth-storage.d.ts +0 -1
- package/dist/core/auth-storage.js +0 -1
- package/dist/core/bash-executor.d.ts +0 -1
- package/dist/core/bash-executor.js +0 -1
- package/dist/core/built-in-extensions.d.ts +0 -1
- package/dist/core/built-in-extensions.js +0 -1
- package/dist/core/cache-stats.d.ts +0 -1
- package/dist/core/cache-stats.js +0 -1
- package/dist/core/compaction/branch-summarization.d.ts +0 -1
- package/dist/core/compaction/branch-summarization.js +0 -1
- package/dist/core/compaction/compaction.d.ts +0 -1
- package/dist/core/compaction/compaction.js +0 -1
- package/dist/core/compaction/index.d.ts +0 -1
- package/dist/core/compaction/index.js +0 -1
- package/dist/core/compaction/utils.d.ts +0 -1
- package/dist/core/compaction/utils.js +0 -1
- package/dist/core/defaults.d.ts +0 -1
- package/dist/core/defaults.js +0 -1
- package/dist/core/diagnostics.d.ts +0 -1
- package/dist/core/diagnostics.js +0 -1
- package/dist/core/event-bus.d.ts +0 -1
- package/dist/core/event-bus.js +0 -1
- package/dist/core/exec.d.ts +0 -1
- package/dist/core/exec.js +0 -1
- package/dist/core/experimental.d.ts +0 -1
- package/dist/core/experimental.js +0 -1
- package/dist/core/export-html/ansi-to-html.d.ts +0 -1
- package/dist/core/export-html/ansi-to-html.js +0 -1
- package/dist/core/export-html/index.d.ts +0 -1
- package/dist/core/export-html/index.js +0 -1
- package/dist/core/export-html/tool-renderer.d.ts +0 -1
- package/dist/core/export-html/tool-renderer.js +0 -1
- package/dist/core/extensions/index.d.ts +0 -1
- package/dist/core/extensions/index.js +0 -1
- package/dist/core/extensions/loader.d.ts +0 -1
- package/dist/core/extensions/loader.js +0 -1
- package/dist/core/extensions/runner.d.ts +0 -1
- package/dist/core/extensions/runner.js +0 -1
- package/dist/core/extensions/types.d.ts +0 -1
- package/dist/core/extensions/types.js +0 -1
- package/dist/core/extensions/wrapper.d.ts +0 -1
- package/dist/core/extensions/wrapper.js +0 -1
- package/dist/core/footer-data-provider.d.ts +0 -1
- package/dist/core/footer-data-provider.js +0 -1
- package/dist/core/git-command.d.ts +0 -1
- package/dist/core/git-command.js +0 -1
- package/dist/core/http-dispatcher.d.ts +0 -1
- package/dist/core/http-dispatcher.js +0 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -1
- package/dist/core/keybindings.d.ts +0 -1
- package/dist/core/keybindings.js +0 -1
- package/dist/core/llama/client.d.ts +0 -1
- package/dist/core/llama/client.js +0 -1
- package/dist/core/llama/huggingface.d.ts +0 -1
- package/dist/core/llama/huggingface.js +0 -1
- package/dist/core/llama/index.d.ts +0 -1
- package/dist/core/llama/index.js +0 -1
- package/dist/core/llama/provider.d.ts +0 -1
- package/dist/core/llama/provider.js +0 -1
- package/dist/core/llama/ui.d.ts +0 -1
- package/dist/core/llama/ui.js +0 -1
- package/dist/core/messages.d.ts +0 -1
- package/dist/core/messages.js +0 -1
- package/dist/core/model-config.d.ts +0 -1
- package/dist/core/model-config.js +0 -1
- package/dist/core/model-registry.d.ts +0 -1
- package/dist/core/model-registry.js +0 -1
- package/dist/core/model-resolver.d.ts +0 -1
- package/dist/core/model-resolver.js +0 -1
- package/dist/core/model-runtime.d.ts +0 -1
- package/dist/core/model-runtime.js +0 -1
- package/dist/core/models-store.d.ts +0 -1
- package/dist/core/models-store.js +0 -1
- package/dist/core/output-guard.d.ts +0 -1
- package/dist/core/output-guard.js +0 -1
- package/dist/core/package-manager.d.ts +0 -1
- package/dist/core/package-manager.js +0 -1
- package/dist/core/package-manager.test.d.ts +0 -1
- package/dist/core/package-manager.test.js +0 -1
- package/dist/core/project-trust.d.ts +0 -1
- package/dist/core/project-trust.js +0 -1
- package/dist/core/prompt-templates.d.ts +0 -1
- package/dist/core/prompt-templates.js +0 -1
- package/dist/core/provider-attribution.d.ts +0 -1
- package/dist/core/provider-attribution.js +0 -1
- package/dist/core/provider-composer.d.ts +0 -1
- package/dist/core/provider-composer.js +0 -1
- package/dist/core/radius.d.ts +0 -1
- package/dist/core/radius.js +0 -1
- package/dist/core/remote-catalog-provider.d.ts +0 -1
- package/dist/core/remote-catalog-provider.js +0 -1
- package/dist/core/resolve-config-value.d.ts +0 -1
- package/dist/core/resolve-config-value.js +0 -1
- package/dist/core/resource-loader.d.ts +0 -1
- package/dist/core/resource-loader.js +0 -1
- package/dist/core/runtime-credentials.d.ts +0 -1
- package/dist/core/runtime-credentials.js +0 -1
- package/dist/core/sdk.d.ts +0 -1
- package/dist/core/sdk.js +0 -1
- package/dist/core/session-cwd.d.ts +0 -1
- package/dist/core/session-cwd.js +0 -1
- package/dist/core/session-manager.d.ts +0 -1
- package/dist/core/session-manager.js +0 -1
- package/dist/core/settings-manager-auto-handoff.test.d.ts +0 -1
- package/dist/core/settings-manager-auto-handoff.test.js +0 -1
- package/dist/core/settings-manager.d.ts +0 -4
- package/dist/core/settings-manager.js +0 -12
- package/dist/core/skills.d.ts +0 -1
- package/dist/core/skills.js +0 -1
- package/dist/core/slash-commands.d.ts +0 -1
- package/dist/core/slash-commands.js +0 -1
- package/dist/core/source-info.d.ts +0 -1
- package/dist/core/source-info.js +0 -1
- package/dist/core/system-prompt.d.ts +0 -1
- package/dist/core/system-prompt.js +0 -1
- package/dist/core/system-prompt.test.d.ts +0 -1
- package/dist/core/system-prompt.test.js +0 -1
- package/dist/core/telemetry.d.ts +0 -1
- package/dist/core/telemetry.js +0 -1
- package/dist/core/timings.d.ts +0 -1
- package/dist/core/timings.js +0 -1
- package/dist/core/tools/bash.d.ts +0 -1
- package/dist/core/tools/bash.js +0 -1
- package/dist/core/tools/edit-diff.d.ts +0 -1
- package/dist/core/tools/edit-diff.js +0 -1
- package/dist/core/tools/edit.d.ts +0 -1
- package/dist/core/tools/edit.js +0 -1
- package/dist/core/tools/file-mutation-queue.d.ts +0 -1
- package/dist/core/tools/file-mutation-queue.js +0 -1
- package/dist/core/tools/find.d.ts +0 -1
- package/dist/core/tools/find.js +0 -1
- package/dist/core/tools/grep.d.ts +0 -1
- package/dist/core/tools/grep.js +0 -1
- package/dist/core/tools/index.d.ts +0 -1
- package/dist/core/tools/index.js +0 -1
- package/dist/core/tools/ls.d.ts +0 -1
- package/dist/core/tools/ls.js +0 -1
- package/dist/core/tools/output-accumulator.d.ts +0 -1
- package/dist/core/tools/output-accumulator.js +0 -1
- package/dist/core/tools/path-utils.d.ts +0 -1
- package/dist/core/tools/path-utils.js +0 -1
- package/dist/core/tools/read.d.ts +0 -1
- package/dist/core/tools/read.js +0 -1
- package/dist/core/tools/render-utils.d.ts +0 -1
- package/dist/core/tools/render-utils.js +0 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +0 -1
- package/dist/core/tools/tool-definition-wrapper.js +0 -1
- package/dist/core/tools/truncate.d.ts +0 -1
- package/dist/core/tools/truncate.js +0 -1
- package/dist/core/tools/write.d.ts +0 -1
- package/dist/core/tools/write.js +0 -1
- package/dist/core/trust-manager.d.ts +0 -1
- package/dist/core/trust-manager.js +0 -1
- package/dist/core/usage-totals.d.ts +0 -1
- package/dist/core/usage-totals.js +0 -1
- package/dist/defaults/models.json +8 -0
- package/dist/defaults/settings.json +6 -7
- package/dist/extensions/inline-skills.test.ts +13 -13
- package/dist/extensions/inline-skills.ts +6 -6
- package/dist/extensions/pi-subagents/CHANGELOG.md +89 -12
- package/dist/extensions/pi-subagents/README.md +339 -604
- package/dist/extensions/pi-subagents/package-lock.json +190 -2079
- package/dist/extensions/pi-subagents/package.json +13 -5
- package/dist/extensions/pi-subagents/prompts/parallel-context-build.md +1 -1
- package/dist/extensions/pi-subagents/prompts/parallel-handoff-plan.md +1 -1
- package/dist/extensions/pi-subagents/prompts/review-loop.md +1 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +10 -10
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +32 -43
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +106 -105
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +3 -3
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +28 -35
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +167 -124
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +19 -0
- package/dist/extensions/pi-subagents/src/agents/agents.ts +163 -75
- package/dist/extensions/pi-subagents/src/agents/chain-serializer.ts +10 -7
- package/dist/extensions/pi-subagents/src/agents/frontmatter.ts +5 -3
- package/dist/extensions/pi-subagents/src/agents/identity.ts +1 -1
- package/dist/extensions/pi-subagents/src/agents/proactive-skills.ts +14 -11
- package/dist/extensions/pi-subagents/src/agents/skills.ts +23 -6
- package/dist/extensions/pi-subagents/src/agents/task-aware-routing.ts +8 -1
- package/dist/extensions/pi-subagents/src/api/control-channel.ts +4 -0
- package/dist/extensions/pi-subagents/src/api/delegation.ts +26 -194
- package/dist/extensions/pi-subagents/src/api/external-runs.ts +129 -0
- package/dist/extensions/pi-subagents/src/api/intercom-bridge.ts +3 -0
- package/dist/extensions/pi-subagents/src/api/pi-args.ts +5 -0
- package/dist/extensions/pi-subagents/src/api/preflight.ts +4 -4
- package/dist/extensions/pi-subagents/src/api/shared-types.ts +19 -0
- package/dist/extensions/pi-subagents/src/extension/config.ts +10 -0
- package/dist/extensions/pi-subagents/src/extension/control-notices.ts +5 -39
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +10 -9
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +7 -4
- package/dist/extensions/pi-subagents/src/extension/index.ts +243 -77
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +18 -6
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +50 -39
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +36 -103
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +229 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/client.ts +130 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +141 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +154 -0
- package/dist/extensions/pi-subagents/src/integrations/herdr-status.ts +330 -0
- package/dist/extensions/pi-subagents/src/intercom/intercom-bridge.ts +3 -2
- package/dist/extensions/pi-subagents/src/intercom/result-intercom.ts +5 -1
- package/dist/extensions/pi-subagents/src/missions/actions.ts +372 -0
- package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +314 -0
- package/dist/extensions/pi-subagents/src/missions/store.ts +442 -0
- package/dist/extensions/pi-subagents/src/missions/types.ts +135 -0
- package/dist/extensions/pi-subagents/src/policy/authority.ts +46 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +32 -6
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +103 -72
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +10 -2
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +6 -6
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +29 -1
- package/dist/extensions/pi-subagents/src/runs/background/auto-drain.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +3 -2
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +9 -7
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +3 -4
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +3 -28
- package/dist/extensions/pi-subagents/src/runs/background/process-terminal.ts +5 -5
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +18 -68
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +35 -8
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +602 -375
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +612 -464
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +50 -9
- package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +253 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +12 -4
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-clarify.ts +8 -4
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +74 -102
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +21 -22
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +1050 -396
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +44 -18
- package/dist/extensions/pi-subagents/src/runs/shared/capability-ceiling.ts +0 -1
- package/dist/extensions/pi-subagents/src/runs/shared/child-protocol.ts +302 -22
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +130 -0
- package/dist/extensions/pi-subagents/src/runs/shared/long-running-guard.ts +42 -1
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +59 -5
- package/dist/extensions/pi-subagents/src/runs/shared/nested-render.ts +9 -4
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +86 -2
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +11 -2
- package/dist/extensions/pi-subagents/src/runs/shared/permissions.ts +95 -0
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +11 -1
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +15 -6
- package/dist/extensions/pi-subagents/src/runs/shared/run-history.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +9 -63
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +37 -6
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-startup-retry.ts +5 -2
- package/dist/extensions/pi-subagents/src/runs/shared/task-intent.ts +2 -23
- package/dist/extensions/pi-subagents/src/runs/shared/turn-budget.ts +6 -6
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +124 -13
- package/dist/extensions/pi-subagents/src/shared/accessible-dir.ts +29 -7
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +18 -1
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +3 -2
- package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +1 -0
- package/dist/extensions/pi-subagents/src/shared/settings.ts +10 -0
- package/dist/extensions/pi-subagents/src/shared/types.ts +158 -55
- package/dist/extensions/pi-subagents/src/shared/utils.ts +16 -66
- package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +33 -199
- package/dist/extensions/pi-subagents/src/slash/delegation-request.ts +43 -126
- package/dist/extensions/pi-subagents/src/slash/inline-subagents.ts +103 -0
- package/dist/extensions/pi-subagents/src/slash/prompt-template-bridge.ts +158 -205
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +22 -58
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +14 -0
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +44 -642
- package/dist/extensions/pi-subagents/src/slash/subagents-admin.ts +18 -14
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +156 -21
- package/dist/extensions/pi-subagents/src/tui/fleet-transcript.ts +110 -5
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +60 -24
- package/dist/extensions/pi-subagents/src/tui/render.ts +296 -140
- package/dist/extensions/pi-subagents/src/types/pi-runtime-compat.d.ts +14 -0
- package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +1 -1
- package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +13 -7
- package/dist/extensions/pi-subagents/src/watchdog/model-selection.ts +2 -2
- package/dist/extensions/pi-subagents/src/watchdog/permission-arbiter.ts +145 -0
- package/dist/extensions/pi-subagents/src/watchdog/register-child.ts +1 -1
- package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +1 -1
- package/dist/extensions/pi-subagents/src/watchdog/review.ts +4 -1
- package/dist/extensions/pi-subagents/src/watchdog/runtime.ts +3 -2
- package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +140 -0
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +415 -0
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +41 -144
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +16 -16
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +415 -298
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +149 -82
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +40 -40
- package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +15 -15
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +193 -133
- package/dist/extensions/pi-subagents/test/integration/detect-error.test.ts +1 -49
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +62 -0
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +56 -58
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +81 -68
- package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +20 -25
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +425 -317
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +73 -73
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +123 -98
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +653 -240
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +20 -1661
- 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 +3 -3
- package/dist/extensions/pi-subagents/test/integration/top-level-async.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +8 -5
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +6 -6
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +4 -20
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +25 -4
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +280 -295
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +47 -207
- package/dist/extensions/pi-subagents/test/unit/agent-memory.test.ts +26 -26
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +89 -89
- package/dist/extensions/pi-subagents/test/unit/agent-selection.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +10 -0
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +33 -9
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +24 -2
- package/dist/extensions/pi-subagents/test/unit/async-permission-session.test.ts +11 -9
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +40 -40
- package/dist/extensions/pi-subagents/test/unit/authority-policy.test.ts +22 -0
- package/dist/extensions/pi-subagents/test/unit/background-work.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-agent-allowlist.test.ts +5 -39
- package/dist/extensions/pi-subagents/test/unit/chain-append.test.ts +19 -19
- 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-protocol.test.ts +99 -0
- package/dist/extensions/pi-subagents/test/unit/child-transcript.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +41 -0
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +35 -5
- package/dist/extensions/pi-subagents/test/unit/config-dir-runtime.test.ts +7 -0
- package/dist/extensions/pi-subagents/test/unit/control-notices.test.ts +16 -82
- package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +162 -620
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +25 -25
- package/dist/extensions/pi-subagents/test/unit/ensure-accessible-dir.test.ts +125 -0
- package/dist/extensions/pi-subagents/test/unit/external-cli-runner.test.ts +94 -0
- package/dist/extensions/pi-subagents/test/unit/external-runs.test.ts +66 -0
- package/dist/extensions/pi-subagents/test/unit/extra-agent-dirs.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +242 -52
- package/dist/extensions/pi-subagents/test/unit/fleet-transcript.test.ts +127 -0
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +197 -36
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +4 -4
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +245 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +494 -0
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +261 -31
- package/dist/extensions/pi-subagents/test/unit/inline-subagents.test.ts +52 -0
- package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +6 -6
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +217 -0
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +182 -0
- package/dist/extensions/pi-subagents/test/unit/mock-pi.test.ts +22 -0
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +10 -10
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +20 -12
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +47 -5
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +49 -55
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +20 -3
- package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +37 -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/permissions.test.ts +46 -0
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +31 -10
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +40 -16
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +42 -44
- package/dist/extensions/pi-subagents/test/unit/proactive-skills.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/process-terminal.test.ts +4 -4
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +75 -9
- package/dist/extensions/pi-subagents/test/unit/prompt-template-bridge.test.ts +20 -84
- package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +15 -16
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +28 -28
- package/dist/extensions/pi-subagents/test/unit/result-intercom.test.ts +19 -12
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +37 -21
- 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 +50 -50
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +396 -433
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +76 -153
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +411 -0
- package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +1 -91
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +139 -0
- package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +29 -0
- 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 +2 -2
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +35 -35
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +53 -18
- package/dist/extensions/pi-subagents/test/unit/subagent-startup-retry.test.ts +13 -1
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +44 -11
- package/dist/extensions/pi-subagents/test/unit/task-intent.test.ts +2 -26
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +24 -148
- package/dist/extensions/pi-subagents/test/unit/turn-budget.test.ts +11 -9
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +351 -0
- 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-permission-arbiter.test.ts +79 -0
- 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 +45 -9
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +197 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-graph.test.ts +8 -8
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +142 -12
- package/dist/extensions/pi-subagents/tsconfig.json +15 -0
- package/dist/extensions/pi-web-agent/package.json +1 -1
- package/dist/extensions/rtk.test.ts +126 -0
- package/dist/extensions/rtk.ts +56 -20
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -1
- package/dist/migrations.d.ts +0 -1
- package/dist/migrations.js +0 -1
- package/dist/modes/index.d.ts +0 -1
- package/dist/modes/index.js +0 -1
- package/dist/modes/interactive/components/armin.d.ts +0 -1
- package/dist/modes/interactive/components/armin.js +0 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +0 -1
- package/dist/modes/interactive/components/assistant-message.js +0 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +0 -1
- package/dist/modes/interactive/components/bash-execution.js +0 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts +0 -1
- package/dist/modes/interactive/components/bordered-loader.js +0 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +0 -1
- package/dist/modes/interactive/components/branch-summary-message.js +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +0 -1
- package/dist/modes/interactive/components/config-selector.d.ts +0 -1
- package/dist/modes/interactive/components/config-selector.js +0 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts +0 -1
- package/dist/modes/interactive/components/countdown-timer.js +0 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +0 -1
- package/dist/modes/interactive/components/custom-editor.js +0 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +0 -1
- package/dist/modes/interactive/components/custom-entry.js +0 -1
- package/dist/modes/interactive/components/custom-message.d.ts +0 -1
- package/dist/modes/interactive/components/custom-message.js +0 -1
- package/dist/modes/interactive/components/daxnuts.d.ts +0 -1
- package/dist/modes/interactive/components/daxnuts.js +0 -1
- package/dist/modes/interactive/components/diff.d.ts +0 -1
- package/dist/modes/interactive/components/diff.js +0 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts +0 -1
- package/dist/modes/interactive/components/dynamic-border.js +0 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts +0 -1
- package/dist/modes/interactive/components/earendil-announcement.js +0 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +0 -1
- package/dist/modes/interactive/components/extension-editor.js +0 -1
- package/dist/modes/interactive/components/extension-input.d.ts +0 -1
- package/dist/modes/interactive/components/extension-input.js +0 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +0 -1
- package/dist/modes/interactive/components/extension-selector.js +0 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +0 -1
- package/dist/modes/interactive/components/first-time-setup.js +0 -1
- package/dist/modes/interactive/components/footer.d.ts +0 -1
- package/dist/modes/interactive/components/footer.js +0 -1
- package/dist/modes/interactive/components/index.d.ts +0 -1
- package/dist/modes/interactive/components/index.js +0 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +0 -1
- package/dist/modes/interactive/components/keybinding-hints.js +0 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +0 -1
- package/dist/modes/interactive/components/login-dialog.js +0 -1
- package/dist/modes/interactive/components/model-selector.d.ts +0 -1
- package/dist/modes/interactive/components/model-selector.js +0 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +0 -1
- package/dist/modes/interactive/components/oauth-selector.js +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +0 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts +0 -1
- package/dist/modes/interactive/components/session-selector-search.js +0 -1
- package/dist/modes/interactive/components/session-selector.d.ts +0 -1
- package/dist/modes/interactive/components/session-selector.js +0 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +0 -3
- package/dist/modes/interactive/components/settings-selector.js +1 -14
- package/dist/modes/interactive/components/show-images-selector.d.ts +0 -1
- package/dist/modes/interactive/components/show-images-selector.js +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +0 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +0 -1
- package/dist/modes/interactive/components/status-indicator.js +0 -1
- package/dist/modes/interactive/components/theme-selector.d.ts +0 -1
- package/dist/modes/interactive/components/theme-selector.js +0 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +0 -1
- package/dist/modes/interactive/components/thinking-selector.js +0 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +0 -1
- package/dist/modes/interactive/components/tool-execution.js +0 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +0 -1
- package/dist/modes/interactive/components/tree-selector.js +0 -1
- package/dist/modes/interactive/components/trust-selector.d.ts +0 -1
- package/dist/modes/interactive/components/trust-selector.js +0 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +0 -1
- package/dist/modes/interactive/components/user-message-selector.js +0 -1
- package/dist/modes/interactive/components/user-message.d.ts +0 -1
- package/dist/modes/interactive/components/user-message.js +0 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts +0 -1
- package/dist/modes/interactive/components/visual-truncate.js +0 -1
- package/dist/modes/interactive/external-editor.d.ts +0 -1
- package/dist/modes/interactive/external-editor.js +0 -1
- package/dist/modes/interactive/interactive-mode.d.ts +0 -2
- package/dist/modes/interactive/interactive-mode.js +1 -22
- package/dist/modes/interactive/model-search.d.ts +0 -1
- package/dist/modes/interactive/model-search.js +0 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +0 -1
- package/dist/modes/interactive/theme/theme-controller.js +0 -1
- package/dist/modes/interactive/theme/theme.d.ts +0 -1
- package/dist/modes/interactive/theme/theme.js +0 -1
- package/dist/modes/print-mode.d.ts +0 -1
- package/dist/modes/print-mode.js +0 -1
- package/dist/modes/rpc/jsonl.d.ts +0 -1
- package/dist/modes/rpc/jsonl.js +0 -1
- package/dist/modes/rpc/rpc-client.d.ts +1 -2
- package/dist/modes/rpc/rpc-client.js +1 -2
- package/dist/modes/rpc/rpc-mode.d.ts +0 -1
- package/dist/modes/rpc/rpc-mode.js +0 -9
- package/dist/modes/rpc/rpc-types.d.ts +0 -1
- package/dist/modes/rpc/rpc-types.js +0 -1
- package/dist/package-manager-cli.d.ts +0 -1
- package/dist/package-manager-cli.js +0 -1
- package/dist/rpc-entry.d.ts +0 -1
- package/dist/rpc-entry.js +0 -1
- package/dist/utils/ansi.d.ts +0 -1
- package/dist/utils/ansi.js +0 -1
- package/dist/utils/changelog.d.ts +0 -1
- package/dist/utils/changelog.js +0 -1
- package/dist/utils/child-process.d.ts +0 -1
- package/dist/utils/child-process.js +0 -1
- package/dist/utils/clipboard-image.d.ts +0 -1
- package/dist/utils/clipboard-image.js +0 -1
- package/dist/utils/clipboard-native.d.ts +0 -1
- package/dist/utils/clipboard-native.js +0 -1
- package/dist/utils/clipboard.d.ts +0 -1
- package/dist/utils/clipboard.js +0 -1
- package/dist/utils/deprecation.d.ts +0 -1
- package/dist/utils/deprecation.js +0 -1
- package/dist/utils/exif-orientation.d.ts +0 -1
- package/dist/utils/exif-orientation.js +0 -1
- package/dist/utils/frontmatter.d.ts +0 -1
- package/dist/utils/frontmatter.js +0 -1
- package/dist/utils/fs-watch.d.ts +0 -1
- package/dist/utils/fs-watch.js +0 -1
- package/dist/utils/git.d.ts +0 -1
- package/dist/utils/git.js +0 -1
- package/dist/utils/html.d.ts +0 -1
- package/dist/utils/html.js +0 -1
- package/dist/utils/image-convert.d.ts +0 -1
- package/dist/utils/image-convert.js +0 -1
- package/dist/utils/image-process.d.ts +0 -1
- package/dist/utils/image-process.js +0 -1
- package/dist/utils/image-resize-core.d.ts +0 -1
- package/dist/utils/image-resize-core.js +0 -1
- package/dist/utils/image-resize-worker.d.ts +0 -1
- package/dist/utils/image-resize-worker.js +0 -1
- package/dist/utils/image-resize.d.ts +0 -1
- package/dist/utils/image-resize.js +0 -1
- package/dist/utils/json.d.ts +0 -1
- package/dist/utils/json.js +0 -1
- package/dist/utils/mime.d.ts +0 -1
- package/dist/utils/mime.js +0 -1
- package/dist/utils/open-browser.d.ts +0 -1
- package/dist/utils/open-browser.js +0 -1
- package/dist/utils/paths.d.ts +0 -1
- package/dist/utils/paths.js +0 -1
- package/dist/utils/photon.d.ts +0 -1
- package/dist/utils/photon.js +0 -1
- package/dist/utils/pi-user-agent.d.ts +0 -1
- package/dist/utils/pi-user-agent.js +0 -1
- package/dist/utils/shell.d.ts +0 -1
- package/dist/utils/shell.js +0 -1
- package/dist/utils/sleep.d.ts +0 -1
- package/dist/utils/sleep.js +0 -1
- package/dist/utils/syntax-highlight.d.ts +0 -1
- package/dist/utils/syntax-highlight.js +0 -1
- package/dist/utils/thinking-tags.d.ts +0 -1
- package/dist/utils/thinking-tags.js +0 -1
- package/dist/utils/tools-manager.d.ts +3 -3
- package/dist/utils/tools-manager.js +125 -42
- package/dist/utils/version-check.d.ts +0 -1
- package/dist/utils/version-check.js +0 -1
- package/dist/utils/windows-self-update.d.ts +0 -1
- package/dist/utils/windows-self-update.js +0 -1
- package/docs/rpc.md +1 -2
- package/docs/settings.md +0 -1
- package/docs/skills.md +10 -18
- package/package.json +4 -3
- package/dist/bun/cli.d.ts.map +0 -1
- package/dist/bun/cli.js.map +0 -1
- package/dist/bun/register-bedrock.d.ts.map +0 -1
- package/dist/bun/register-bedrock.js.map +0 -1
- package/dist/bun/restore-sandbox-env.d.ts.map +0 -1
- package/dist/bun/restore-sandbox-env.js.map +0 -1
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/config-selector.d.ts.map +0 -1
- package/dist/cli/config-selector.js.map +0 -1
- package/dist/cli/credential-print.d.ts.map +0 -1
- package/dist/cli/credential-print.js.map +0 -1
- package/dist/cli/file-processor.d.ts.map +0 -1
- package/dist/cli/file-processor.js.map +0 -1
- package/dist/cli/initial-message.d.ts.map +0 -1
- package/dist/cli/initial-message.js.map +0 -1
- package/dist/cli/list-models.d.ts.map +0 -1
- package/dist/cli/list-models.js.map +0 -1
- package/dist/cli/project-trust.d.ts.map +0 -1
- package/dist/cli/project-trust.js.map +0 -1
- package/dist/cli/session-picker.d.ts.map +0 -1
- package/dist/cli/session-picker.js.map +0 -1
- package/dist/cli/startup-ui.d.ts.map +0 -1
- package/dist/cli/startup-ui.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/core/agent-session-auto-handoff.test.d.ts.map +0 -1
- package/dist/core/agent-session-auto-handoff.test.js.map +0 -1
- package/dist/core/agent-session-runtime.d.ts.map +0 -1
- package/dist/core/agent-session-runtime.js.map +0 -1
- package/dist/core/agent-session-services.d.ts.map +0 -1
- package/dist/core/agent-session-services.js.map +0 -1
- package/dist/core/agent-session-skill-block.test.d.ts.map +0 -1
- package/dist/core/agent-session-skill-block.test.js.map +0 -1
- package/dist/core/agent-session.d.ts.map +0 -1
- package/dist/core/agent-session.js.map +0 -1
- package/dist/core/agents.d.ts.map +0 -1
- package/dist/core/agents.js.map +0 -1
- package/dist/core/auth-guidance.d.ts.map +0 -1
- package/dist/core/auth-guidance.js.map +0 -1
- package/dist/core/auth-storage.d.ts.map +0 -1
- package/dist/core/auth-storage.js.map +0 -1
- package/dist/core/bash-executor.d.ts.map +0 -1
- package/dist/core/bash-executor.js.map +0 -1
- package/dist/core/built-in-extensions.d.ts.map +0 -1
- package/dist/core/built-in-extensions.js.map +0 -1
- package/dist/core/cache-stats.d.ts.map +0 -1
- package/dist/core/cache-stats.js.map +0 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +0 -1
- package/dist/core/compaction/branch-summarization.js.map +0 -1
- package/dist/core/compaction/compaction.d.ts.map +0 -1
- package/dist/core/compaction/compaction.js.map +0 -1
- package/dist/core/compaction/index.d.ts.map +0 -1
- package/dist/core/compaction/index.js.map +0 -1
- package/dist/core/compaction/utils.d.ts.map +0 -1
- package/dist/core/compaction/utils.js.map +0 -1
- package/dist/core/defaults.d.ts.map +0 -1
- package/dist/core/defaults.js.map +0 -1
- package/dist/core/diagnostics.d.ts.map +0 -1
- package/dist/core/diagnostics.js.map +0 -1
- package/dist/core/event-bus.d.ts.map +0 -1
- package/dist/core/event-bus.js.map +0 -1
- package/dist/core/exec.d.ts.map +0 -1
- package/dist/core/exec.js.map +0 -1
- package/dist/core/experimental.d.ts.map +0 -1
- package/dist/core/experimental.js.map +0 -1
- package/dist/core/export-html/ansi-to-html.d.ts.map +0 -1
- package/dist/core/export-html/ansi-to-html.js.map +0 -1
- package/dist/core/export-html/index.d.ts.map +0 -1
- package/dist/core/export-html/index.js.map +0 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +0 -1
- package/dist/core/export-html/tool-renderer.js.map +0 -1
- package/dist/core/extensions/index.d.ts.map +0 -1
- package/dist/core/extensions/index.js.map +0 -1
- package/dist/core/extensions/loader.d.ts.map +0 -1
- package/dist/core/extensions/loader.js.map +0 -1
- package/dist/core/extensions/runner.d.ts.map +0 -1
- package/dist/core/extensions/runner.js.map +0 -1
- package/dist/core/extensions/types.d.ts.map +0 -1
- package/dist/core/extensions/types.js.map +0 -1
- package/dist/core/extensions/wrapper.d.ts.map +0 -1
- package/dist/core/extensions/wrapper.js.map +0 -1
- package/dist/core/footer-data-provider.d.ts.map +0 -1
- package/dist/core/footer-data-provider.js.map +0 -1
- package/dist/core/git-command.d.ts.map +0 -1
- package/dist/core/git-command.js.map +0 -1
- package/dist/core/http-dispatcher.d.ts.map +0 -1
- package/dist/core/http-dispatcher.js.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/keybindings.d.ts.map +0 -1
- package/dist/core/keybindings.js.map +0 -1
- package/dist/core/llama/client.d.ts.map +0 -1
- package/dist/core/llama/client.js.map +0 -1
- package/dist/core/llama/huggingface.d.ts.map +0 -1
- package/dist/core/llama/huggingface.js.map +0 -1
- package/dist/core/llama/index.d.ts.map +0 -1
- package/dist/core/llama/index.js.map +0 -1
- package/dist/core/llama/provider.d.ts.map +0 -1
- package/dist/core/llama/provider.js.map +0 -1
- package/dist/core/llama/ui.d.ts.map +0 -1
- package/dist/core/llama/ui.js.map +0 -1
- package/dist/core/messages.d.ts.map +0 -1
- package/dist/core/messages.js.map +0 -1
- package/dist/core/model-config.d.ts.map +0 -1
- package/dist/core/model-config.js.map +0 -1
- package/dist/core/model-registry.d.ts.map +0 -1
- package/dist/core/model-registry.js.map +0 -1
- package/dist/core/model-resolver.d.ts.map +0 -1
- package/dist/core/model-resolver.js.map +0 -1
- package/dist/core/model-runtime.d.ts.map +0 -1
- package/dist/core/model-runtime.js.map +0 -1
- package/dist/core/models-store.d.ts.map +0 -1
- package/dist/core/models-store.js.map +0 -1
- package/dist/core/output-guard.d.ts.map +0 -1
- package/dist/core/output-guard.js.map +0 -1
- package/dist/core/package-manager.d.ts.map +0 -1
- package/dist/core/package-manager.js.map +0 -1
- package/dist/core/package-manager.test.d.ts.map +0 -1
- package/dist/core/package-manager.test.js.map +0 -1
- package/dist/core/project-trust.d.ts.map +0 -1
- package/dist/core/project-trust.js.map +0 -1
- package/dist/core/prompt-templates.d.ts.map +0 -1
- package/dist/core/prompt-templates.js.map +0 -1
- package/dist/core/provider-attribution.d.ts.map +0 -1
- package/dist/core/provider-attribution.js.map +0 -1
- package/dist/core/provider-composer.d.ts.map +0 -1
- package/dist/core/provider-composer.js.map +0 -1
- package/dist/core/radius.d.ts.map +0 -1
- package/dist/core/radius.js.map +0 -1
- package/dist/core/remote-catalog-provider.d.ts.map +0 -1
- package/dist/core/remote-catalog-provider.js.map +0 -1
- package/dist/core/resolve-config-value.d.ts.map +0 -1
- package/dist/core/resolve-config-value.js.map +0 -1
- package/dist/core/resource-loader.d.ts.map +0 -1
- package/dist/core/resource-loader.js.map +0 -1
- package/dist/core/runtime-credentials.d.ts.map +0 -1
- package/dist/core/runtime-credentials.js.map +0 -1
- package/dist/core/sdk.d.ts.map +0 -1
- package/dist/core/sdk.js.map +0 -1
- package/dist/core/session-cwd.d.ts.map +0 -1
- package/dist/core/session-cwd.js.map +0 -1
- package/dist/core/session-manager.d.ts.map +0 -1
- package/dist/core/session-manager.js.map +0 -1
- package/dist/core/settings-manager-auto-handoff.test.d.ts.map +0 -1
- package/dist/core/settings-manager-auto-handoff.test.js.map +0 -1
- package/dist/core/settings-manager.d.ts.map +0 -1
- package/dist/core/settings-manager.js.map +0 -1
- package/dist/core/skills.d.ts.map +0 -1
- package/dist/core/skills.js.map +0 -1
- package/dist/core/slash-commands.d.ts.map +0 -1
- package/dist/core/slash-commands.js.map +0 -1
- package/dist/core/source-info.d.ts.map +0 -1
- package/dist/core/source-info.js.map +0 -1
- package/dist/core/system-prompt.d.ts.map +0 -1
- package/dist/core/system-prompt.js.map +0 -1
- package/dist/core/system-prompt.test.d.ts.map +0 -1
- package/dist/core/system-prompt.test.js.map +0 -1
- package/dist/core/telemetry.d.ts.map +0 -1
- package/dist/core/telemetry.js.map +0 -1
- package/dist/core/timings.d.ts.map +0 -1
- package/dist/core/timings.js.map +0 -1
- package/dist/core/tools/bash.d.ts.map +0 -1
- package/dist/core/tools/bash.js.map +0 -1
- package/dist/core/tools/edit-diff.d.ts.map +0 -1
- package/dist/core/tools/edit-diff.js.map +0 -1
- package/dist/core/tools/edit.d.ts.map +0 -1
- package/dist/core/tools/edit.js.map +0 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +0 -1
- package/dist/core/tools/file-mutation-queue.js.map +0 -1
- package/dist/core/tools/find.d.ts.map +0 -1
- package/dist/core/tools/find.js.map +0 -1
- package/dist/core/tools/grep.d.ts.map +0 -1
- package/dist/core/tools/grep.js.map +0 -1
- package/dist/core/tools/index.d.ts.map +0 -1
- package/dist/core/tools/index.js.map +0 -1
- package/dist/core/tools/ls.d.ts.map +0 -1
- package/dist/core/tools/ls.js.map +0 -1
- package/dist/core/tools/output-accumulator.d.ts.map +0 -1
- package/dist/core/tools/output-accumulator.js.map +0 -1
- package/dist/core/tools/path-utils.d.ts.map +0 -1
- package/dist/core/tools/path-utils.js.map +0 -1
- package/dist/core/tools/read.d.ts.map +0 -1
- package/dist/core/tools/read.js.map +0 -1
- package/dist/core/tools/render-utils.d.ts.map +0 -1
- package/dist/core/tools/render-utils.js.map +0 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +0 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +0 -1
- package/dist/core/tools/truncate.d.ts.map +0 -1
- package/dist/core/tools/truncate.js.map +0 -1
- package/dist/core/tools/write.d.ts.map +0 -1
- package/dist/core/tools/write.js.map +0 -1
- package/dist/core/trust-manager.d.ts.map +0 -1
- package/dist/core/trust-manager.js.map +0 -1
- package/dist/core/usage-totals.d.ts.map +0 -1
- package/dist/core/usage-totals.js.map +0 -1
- package/dist/extensions/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/dist/extensions/pi-subagents/test/unit/slash-chain-groups.test.ts +0 -464
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/migrations.d.ts.map +0 -1
- package/dist/migrations.js.map +0 -1
- package/dist/modes/index.d.ts.map +0 -1
- package/dist/modes/index.js.map +0 -1
- package/dist/modes/interactive/components/armin.d.ts.map +0 -1
- package/dist/modes/interactive/components/armin.js.map +0 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/assistant-message.js.map +0 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +0 -1
- package/dist/modes/interactive/components/bash-execution.js.map +0 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +0 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +0 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +0 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/config-selector.js.map +0 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +0 -1
- package/dist/modes/interactive/components/countdown-timer.js.map +0 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-editor.js.map +0 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-entry.js.map +0 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-message.js.map +0 -1
- package/dist/modes/interactive/components/daxnuts.d.ts.map +0 -1
- package/dist/modes/interactive/components/daxnuts.js.map +0 -1
- package/dist/modes/interactive/components/diff.d.ts.map +0 -1
- package/dist/modes/interactive/components/diff.js.map +0 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +0 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +0 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +0 -1
- package/dist/modes/interactive/components/earendil-announcement.js.map +0 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-editor.js.map +0 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-input.js.map +0 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-selector.js.map +0 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +0 -1
- package/dist/modes/interactive/components/first-time-setup.js.map +0 -1
- package/dist/modes/interactive/components/footer.d.ts.map +0 -1
- package/dist/modes/interactive/components/footer.js.map +0 -1
- package/dist/modes/interactive/components/index.d.ts.map +0 -1
- package/dist/modes/interactive/components/index.js.map +0 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +0 -1
- package/dist/modes/interactive/components/keybinding-hints.js.map +0 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +0 -1
- package/dist/modes/interactive/components/login-dialog.js.map +0 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/model-selector.js.map +0 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/oauth-selector.js.map +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +0 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +0 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +0 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/session-selector.js.map +0 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/settings-selector.js.map +0 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +0 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +0 -1
- package/dist/modes/interactive/components/status-indicator.js.map +0 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/theme-selector.js.map +0 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +0 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +0 -1
- package/dist/modes/interactive/components/tool-execution.js.map +0 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/tree-selector.js.map +0 -1
- package/dist/modes/interactive/components/trust-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/trust-selector.js.map +0 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +0 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/user-message.js.map +0 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +0 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +0 -1
- package/dist/modes/interactive/external-editor.d.ts.map +0 -1
- package/dist/modes/interactive/external-editor.js.map +0 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +0 -1
- package/dist/modes/interactive/interactive-mode.js.map +0 -1
- package/dist/modes/interactive/model-search.d.ts.map +0 -1
- package/dist/modes/interactive/model-search.js.map +0 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme-controller.js.map +0 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme.js.map +0 -1
- package/dist/modes/print-mode.d.ts.map +0 -1
- package/dist/modes/print-mode.js.map +0 -1
- package/dist/modes/rpc/jsonl.d.ts.map +0 -1
- package/dist/modes/rpc/jsonl.js.map +0 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-client.js.map +0 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-mode.js.map +0 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-types.js.map +0 -1
- package/dist/package-manager-cli.d.ts.map +0 -1
- package/dist/package-manager-cli.js.map +0 -1
- package/dist/rpc-entry.d.ts.map +0 -1
- package/dist/rpc-entry.js.map +0 -1
- package/dist/utils/ansi.d.ts.map +0 -1
- package/dist/utils/ansi.js.map +0 -1
- package/dist/utils/changelog.d.ts.map +0 -1
- package/dist/utils/changelog.js.map +0 -1
- package/dist/utils/child-process.d.ts.map +0 -1
- package/dist/utils/child-process.js.map +0 -1
- package/dist/utils/clipboard-image.d.ts.map +0 -1
- package/dist/utils/clipboard-image.js.map +0 -1
- package/dist/utils/clipboard-native.d.ts.map +0 -1
- package/dist/utils/clipboard-native.js.map +0 -1
- package/dist/utils/clipboard.d.ts.map +0 -1
- package/dist/utils/clipboard.js.map +0 -1
- package/dist/utils/deprecation.d.ts.map +0 -1
- package/dist/utils/deprecation.js.map +0 -1
- package/dist/utils/exif-orientation.d.ts.map +0 -1
- package/dist/utils/exif-orientation.js.map +0 -1
- package/dist/utils/frontmatter.d.ts.map +0 -1
- package/dist/utils/frontmatter.js.map +0 -1
- package/dist/utils/fs-watch.d.ts.map +0 -1
- package/dist/utils/fs-watch.js.map +0 -1
- package/dist/utils/git.d.ts.map +0 -1
- package/dist/utils/git.js.map +0 -1
- package/dist/utils/html.d.ts.map +0 -1
- package/dist/utils/html.js.map +0 -1
- package/dist/utils/image-convert.d.ts.map +0 -1
- package/dist/utils/image-convert.js.map +0 -1
- package/dist/utils/image-process.d.ts.map +0 -1
- package/dist/utils/image-process.js.map +0 -1
- package/dist/utils/image-resize-core.d.ts.map +0 -1
- package/dist/utils/image-resize-core.js.map +0 -1
- package/dist/utils/image-resize-worker.d.ts.map +0 -1
- package/dist/utils/image-resize-worker.js.map +0 -1
- package/dist/utils/image-resize.d.ts.map +0 -1
- package/dist/utils/image-resize.js.map +0 -1
- package/dist/utils/json.d.ts.map +0 -1
- package/dist/utils/json.js.map +0 -1
- package/dist/utils/mime.d.ts.map +0 -1
- package/dist/utils/mime.js.map +0 -1
- package/dist/utils/open-browser.d.ts.map +0 -1
- package/dist/utils/open-browser.js.map +0 -1
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/photon.d.ts.map +0 -1
- package/dist/utils/photon.js.map +0 -1
- package/dist/utils/pi-user-agent.d.ts.map +0 -1
- package/dist/utils/pi-user-agent.js.map +0 -1
- package/dist/utils/shell.d.ts.map +0 -1
- package/dist/utils/shell.js.map +0 -1
- package/dist/utils/sleep.d.ts.map +0 -1
- package/dist/utils/sleep.js.map +0 -1
- package/dist/utils/syntax-highlight.d.ts.map +0 -1
- package/dist/utils/syntax-highlight.js.map +0 -1
- package/dist/utils/thinking-tags.d.ts.map +0 -1
- package/dist/utils/thinking-tags.js.map +0 -1
- package/dist/utils/tools-manager.d.ts.map +0 -1
- package/dist/utils/tools-manager.js.map +0 -1
- package/dist/utils/version-check.d.ts.map +0 -1
- package/dist/utils/version-check.js.map +0 -1
- package/dist/utils/windows-self-update.d.ts.map +0 -1
- package/dist/utils/windows-self-update.js.map +0 -1
|
@@ -53,18 +53,6 @@ function assistantToolCall(toolName: string): Record<string, unknown> {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
function emptyTerminalAssistant(): Record<string, unknown> {
|
|
57
|
-
return {
|
|
58
|
-
role: "assistant",
|
|
59
|
-
content: [],
|
|
60
|
-
api: "test",
|
|
61
|
-
provider: "test",
|
|
62
|
-
model: "test",
|
|
63
|
-
stopReason: "stop",
|
|
64
|
-
usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, cost: { total: 0 } },
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
56
|
describe("detectSubagentError", { skip: !available ? "utils not importable" : undefined }, () => {
|
|
69
57
|
// ---- Basic detection (must still work) ----
|
|
70
58
|
|
|
@@ -209,42 +197,6 @@ describe("detectSubagentError", { skip: !available ? "utils not importable" : un
|
|
|
209
197
|
"tool-call assistant message without text is not a recovery");
|
|
210
198
|
});
|
|
211
199
|
|
|
212
|
-
it("accepts a successful tool recovery followed by a clean empty terminal stop", () => {
|
|
213
|
-
const messages = [
|
|
214
|
-
toolResult("bash", "error: process exited with code 1", true),
|
|
215
|
-
assistantToolCall("edit"),
|
|
216
|
-
toolResult("edit", "Updated src/file.ts"),
|
|
217
|
-
emptyTerminalAssistant(),
|
|
218
|
-
];
|
|
219
|
-
const result = detectSubagentError(messages);
|
|
220
|
-
assert.equal(result.hasError, false,
|
|
221
|
-
"later successful work plus a clean terminal stop recovers the earlier tool error");
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
it("keeps the final failed tool result despite a clean empty terminal stop", () => {
|
|
225
|
-
const messages = [
|
|
226
|
-
toolResult("edit", "Updated src/file.ts"),
|
|
227
|
-
assistantToolCall("bash"),
|
|
228
|
-
toolResult("bash", "error: process exited with code 2", true),
|
|
229
|
-
emptyTerminalAssistant(),
|
|
230
|
-
];
|
|
231
|
-
const result = detectSubagentError(messages);
|
|
232
|
-
assert.equal(result.hasError, true,
|
|
233
|
-
"a clean terminal stop alone cannot recover the final failed tool result");
|
|
234
|
-
assert.equal(result.exitCode, 2);
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
it("does not recover an earlier tool error after an unsuccessful terminal stop", () => {
|
|
238
|
-
const messages = [
|
|
239
|
-
toolResult("bash", "error: process exited with code 1", true),
|
|
240
|
-
toolResult("edit", "Updated src/file.ts"),
|
|
241
|
-
{ ...emptyTerminalAssistant(), errorMessage: "provider transport failed" },
|
|
242
|
-
];
|
|
243
|
-
const result = detectSubagentError(messages);
|
|
244
|
-
assert.equal(result.hasError, true,
|
|
245
|
-
"the terminal assistant stop must itself be clean");
|
|
246
|
-
});
|
|
247
|
-
|
|
248
200
|
it("does not treat empty/whitespace assistant message as recovery", () => {
|
|
249
201
|
const messages = [
|
|
250
202
|
toolResult("read", "EISDIR: illegal operation on a directory", true),
|
|
@@ -280,7 +232,7 @@ describe("detectSubagentError", { skip: !available ? "utils not importable" : un
|
|
|
280
232
|
// ---- Real-world regression test ----
|
|
281
233
|
|
|
282
234
|
it("real-world: 19-read review run with trailing EISDIR", () => {
|
|
283
|
-
// Simulate the actual _impl-
|
|
235
|
+
// Simulate the actual _impl-commentator run that produced a false positive
|
|
284
236
|
const readResults = Array.from({ length: 18 }, (_, i) =>
|
|
285
237
|
toolResult("read", `contents of file ${i + 1}`),
|
|
286
238
|
);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import * as fs from "node:fs";
|
|
4
|
+
import * as os from "node:os";
|
|
5
|
+
import * as path from "node:path";
|
|
6
|
+
import { afterEach, describe, it } from "node:test";
|
|
7
|
+
|
|
8
|
+
const tempDirs: string[] = [];
|
|
9
|
+
afterEach(() => {
|
|
10
|
+
for (const dir of tempDirs.splice(0)) fs.rmSync(dir, { recursive: true, force: true });
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
function runProcess(command: string, args: string[], cwd: string): Promise<number | null> {
|
|
14
|
+
return new Promise((resolve, reject) => {
|
|
15
|
+
const child = spawn(command, args, { cwd, stdio: "inherit", shell: false, windowsHide: true });
|
|
16
|
+
child.once("error", reject);
|
|
17
|
+
child.once("close", resolve);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
describe("external CLI async lifecycle", () => {
|
|
22
|
+
it("writes status, events, result, output, and external process logs", async () => {
|
|
23
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-external-lifecycle-"));
|
|
24
|
+
tempDirs.push(dir);
|
|
25
|
+
const asyncDir = path.join(dir, "async");
|
|
26
|
+
fs.mkdirSync(asyncDir);
|
|
27
|
+
const resultPath = path.join(dir, "result.json");
|
|
28
|
+
const configPath = path.join(dir, "config.json");
|
|
29
|
+
fs.writeFileSync(configPath, JSON.stringify({
|
|
30
|
+
id: "external-lifecycle",
|
|
31
|
+
steps: [{
|
|
32
|
+
agent: "external",
|
|
33
|
+
task: "Task text",
|
|
34
|
+
runner: { type: "external-cli", command: process.execPath, args: ["-e", "let s='';process.stdin.on('data',c=>s+=c);process.stdin.on('end',()=>process.stdout.write('RESULT:'+s))"] },
|
|
35
|
+
systemPrompt: "System text",
|
|
36
|
+
systemPromptMode: "replace",
|
|
37
|
+
inheritProjectContext: false,
|
|
38
|
+
inheritSkills: false,
|
|
39
|
+
}],
|
|
40
|
+
resultPath,
|
|
41
|
+
cwd: dir,
|
|
42
|
+
placeholder: "{previous}",
|
|
43
|
+
artifactConfig: { enabled: false },
|
|
44
|
+
asyncDir,
|
|
45
|
+
resultMode: "single",
|
|
46
|
+
}));
|
|
47
|
+
const repo = path.resolve(import.meta.dirname, "../..");
|
|
48
|
+
const exitCode = await runProcess(process.execPath, [path.join(repo, "node_modules/jiti/lib/jiti-cli.mjs"), path.join(repo, "src/runs/background/subagent-runner.ts"), configPath], repo);
|
|
49
|
+
assert.equal(exitCode, 0);
|
|
50
|
+
const status = JSON.parse(fs.readFileSync(path.join(asyncDir, "status.json"), "utf-8"));
|
|
51
|
+
assert.equal(status.state, "complete");
|
|
52
|
+
assert.equal(status.steps[0].runner.type, "external-cli");
|
|
53
|
+
assert.equal(status.steps[0].externalProcess.exitCode, 0);
|
|
54
|
+
assert.ok(fs.existsSync(status.steps[0].externalProcess.stdoutPath));
|
|
55
|
+
assert.ok(fs.existsSync(status.steps[0].externalProcess.stderrPath));
|
|
56
|
+
assert.match(fs.readFileSync(path.join(asyncDir, "output-0.log"), "utf-8"), /<System instructions>[\s\S]*System text[\s\S]*<Task>[\s\S]*Task text/);
|
|
57
|
+
assert.match(fs.readFileSync(path.join(asyncDir, "events.jsonl"), "utf-8"), /subagent\.step\.completed/);
|
|
58
|
+
const result = JSON.parse(fs.readFileSync(resultPath, "utf-8"));
|
|
59
|
+
assert.equal(result.success, true);
|
|
60
|
+
assert.equal(result.results[0].runner.type, "external-cli");
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -310,8 +310,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
310
310
|
|
|
311
311
|
assert.equal(result.isError, undefined);
|
|
312
312
|
const args = readCallArgs();
|
|
313
|
-
assert.ok((args.at(-1) ?? "").startsWith("Task: \n\n
|
|
314
|
-
assert.match(args.at(-1) ?? "", /## Acceptance Contract/);
|
|
313
|
+
assert.ok((args.at(-1) ?? "").startsWith("Task: \n\n## Acceptance Contract"));
|
|
315
314
|
});
|
|
316
315
|
|
|
317
316
|
it("does not treat top-level agent as single mode when tasks are present", async () => {
|
|
@@ -328,8 +327,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
328
327
|
|
|
329
328
|
assert.equal(result.isError, undefined);
|
|
330
329
|
const args = readCallArgs();
|
|
331
|
-
assert.ok((args.at(-1) ?? "").startsWith("Task: parallel task\n\n
|
|
332
|
-
assert.match(args.at(-1) ?? "", /## Acceptance Contract/);
|
|
330
|
+
assert.ok((args.at(-1) ?? "").startsWith("Task: parallel task\n\n## Acceptance Contract"));
|
|
333
331
|
});
|
|
334
332
|
|
|
335
333
|
it("uses agent defaultContext fork when launch context is omitted", async () => {
|
|
@@ -337,14 +335,14 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
337
335
|
const { manager, openedPaths, branchedLeafIds } = makeForkingSessionManagerRecorder({ sessionFile: parentSessionFile, leafId: "leaf-current" });
|
|
338
336
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
339
337
|
agents: [
|
|
340
|
-
{ name: "
|
|
338
|
+
{ name: "builder", description: "Worker", defaultContext: "fork" },
|
|
341
339
|
],
|
|
342
340
|
projectAgentsDir: null,
|
|
343
341
|
}));
|
|
344
342
|
|
|
345
343
|
const result = await executor.execute(
|
|
346
344
|
"id",
|
|
347
|
-
{ agent: "
|
|
345
|
+
{ agent: "builder", task: "test" },
|
|
348
346
|
new AbortController().signal,
|
|
349
347
|
undefined,
|
|
350
348
|
makeCtx(manager),
|
|
@@ -378,14 +376,14 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
378
376
|
};
|
|
379
377
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
380
378
|
agents: [
|
|
381
|
-
{ name: "
|
|
379
|
+
{ name: "builder", description: "Worker", defaultContext: "fork", model: "anthropic/claude-sonnet-4-5:high", thinking: "high" },
|
|
382
380
|
],
|
|
383
381
|
projectAgentsDir: null,
|
|
384
382
|
}));
|
|
385
383
|
|
|
386
384
|
const result = await executor.execute(
|
|
387
385
|
"id",
|
|
388
|
-
{ agent: "
|
|
386
|
+
{ agent: "builder", task: "test" },
|
|
389
387
|
new AbortController().signal,
|
|
390
388
|
undefined,
|
|
391
389
|
makeCtx(manager),
|
|
@@ -435,7 +433,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
435
433
|
};
|
|
436
434
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
437
435
|
agents: [
|
|
438
|
-
{ name: "
|
|
436
|
+
{ name: "builder", description: "Worker", defaultContext: "fork", model: "openai/gpt-5-mini:high", fallbackModels: ["anthropic/claude-sonnet-4:low"], thinking: "high" },
|
|
439
437
|
],
|
|
440
438
|
projectAgentsDir: null,
|
|
441
439
|
}));
|
|
@@ -451,7 +449,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
451
449
|
};
|
|
452
450
|
const result = await executor.execute(
|
|
453
451
|
"id",
|
|
454
|
-
{ agent: "
|
|
452
|
+
{ agent: "builder", task: "test" },
|
|
455
453
|
new AbortController().signal,
|
|
456
454
|
undefined,
|
|
457
455
|
ctx,
|
|
@@ -484,7 +482,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
484
482
|
};
|
|
485
483
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
486
484
|
agents: [
|
|
487
|
-
{ name: "
|
|
485
|
+
{ name: "builder", description: "Worker", defaultContext: "fork", model: "openai/gpt-5-mini:high", thinking: "high" },
|
|
488
486
|
],
|
|
489
487
|
projectAgentsDir: null,
|
|
490
488
|
}));
|
|
@@ -497,7 +495,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
497
495
|
};
|
|
498
496
|
const result = await executor.execute(
|
|
499
497
|
"id",
|
|
500
|
-
{ agent: "
|
|
498
|
+
{ agent: "builder", task: "test" },
|
|
501
499
|
new AbortController().signal,
|
|
502
500
|
undefined,
|
|
503
501
|
ctx,
|
|
@@ -518,7 +516,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
518
516
|
const manager = makeSignedThinkingSessionManager(childSessionFile);
|
|
519
517
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
520
518
|
agents: [
|
|
521
|
-
{ name: "
|
|
519
|
+
{ name: "builder", description: "Worker", defaultContext: "fork", model: "openai/gpt-5-mini:high", thinking: "high" },
|
|
522
520
|
],
|
|
523
521
|
projectAgentsDir: null,
|
|
524
522
|
modelScope: { enforce: true, allow: ["anthropic/*"] },
|
|
@@ -535,7 +533,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
535
533
|
try {
|
|
536
534
|
const result = await executor.execute(
|
|
537
535
|
"id",
|
|
538
|
-
{ agent: "
|
|
536
|
+
{ agent: "builder", task: "test" },
|
|
539
537
|
new AbortController().signal,
|
|
540
538
|
undefined,
|
|
541
539
|
ctx,
|
|
@@ -556,7 +554,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
556
554
|
const manager = makeSignedThinkingSessionManager(childSessionFile);
|
|
557
555
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
558
556
|
agents: [
|
|
559
|
-
{ name: "
|
|
557
|
+
{ name: "builder", description: "Worker", defaultContext: "fork", model: "openai/gpt-5-mini", thinking: "high" },
|
|
560
558
|
],
|
|
561
559
|
projectAgentsDir: null,
|
|
562
560
|
modelScope: { enforce: true, allow: ["anthropic/*"] },
|
|
@@ -574,7 +572,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
574
572
|
for (const model of ["", "inherit"]) {
|
|
575
573
|
const result = await executor.execute(
|
|
576
574
|
"id",
|
|
577
|
-
{ agent: "
|
|
575
|
+
{ agent: "builder", task: "test", model },
|
|
578
576
|
new AbortController().signal,
|
|
579
577
|
undefined,
|
|
580
578
|
ctx,
|
|
@@ -614,7 +612,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
614
612
|
};
|
|
615
613
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
616
614
|
agents: [
|
|
617
|
-
{ name: "
|
|
615
|
+
{ name: "builder", description: "Worker", defaultContext: "fork", model: "anthropic/claude-sonnet-4-5:high", thinking: "high" },
|
|
618
616
|
],
|
|
619
617
|
projectAgentsDir: null,
|
|
620
618
|
}));
|
|
@@ -627,7 +625,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
627
625
|
};
|
|
628
626
|
const result = await executor.execute(
|
|
629
627
|
"id",
|
|
630
|
-
{ agent: "
|
|
628
|
+
{ agent: "builder", task: "test" },
|
|
631
629
|
new AbortController().signal,
|
|
632
630
|
undefined,
|
|
633
631
|
ctx,
|
|
@@ -635,7 +633,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
635
633
|
|
|
636
634
|
assert.equal(result.isError, undefined);
|
|
637
635
|
const text = result.content.filter((block) => block.type === "text").map((block) => block.text).join("\n");
|
|
638
|
-
assert.equal(text.includes("fork context forced thinking off for
|
|
636
|
+
assert.equal(text.includes("fork context forced thinking off for builder (child 0)"), true);
|
|
639
637
|
});
|
|
640
638
|
|
|
641
639
|
it("resolves inherit before classifying a forked child", async () => {
|
|
@@ -643,7 +641,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
643
641
|
const manager = makeSignedThinkingSessionManager(childSessionFile);
|
|
644
642
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
645
643
|
agents: [
|
|
646
|
-
{ name: "
|
|
644
|
+
{ name: "builder", description: "Worker", defaultContext: "fork", thinking: "high" },
|
|
647
645
|
],
|
|
648
646
|
projectAgentsDir: null,
|
|
649
647
|
}));
|
|
@@ -657,7 +655,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
657
655
|
|
|
658
656
|
const result = await executor.execute(
|
|
659
657
|
"id",
|
|
660
|
-
{ agent: "
|
|
658
|
+
{ agent: "builder", task: "test", model: "inherit" },
|
|
661
659
|
new AbortController().signal,
|
|
662
660
|
undefined,
|
|
663
661
|
ctx,
|
|
@@ -673,7 +671,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
673
671
|
const manager = makeSignedThinkingSessionManager(childSessionFile);
|
|
674
672
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
675
673
|
agents: [
|
|
676
|
-
{ name: "
|
|
674
|
+
{ name: "builder", description: "Worker", defaultContext: "fork", model: "anthropic/claude-sonnet-4-5", thinking: "high" },
|
|
677
675
|
],
|
|
678
676
|
projectAgentsDir: null,
|
|
679
677
|
}));
|
|
@@ -690,7 +688,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
690
688
|
|
|
691
689
|
const result = await executor.execute(
|
|
692
690
|
"id",
|
|
693
|
-
{ tasks: [{ agent: "
|
|
691
|
+
{ tasks: [{ agent: "builder", task: "test", model: "" }] },
|
|
694
692
|
new AbortController().signal,
|
|
695
693
|
undefined,
|
|
696
694
|
ctx,
|
|
@@ -708,7 +706,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
708
706
|
const manager = makeSignedThinkingSessionManager(childSessionFile);
|
|
709
707
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
710
708
|
agents: [
|
|
711
|
-
{ name: "
|
|
709
|
+
{ name: "builder", description: "Worker", defaultContext: "fork", model: "openai/gpt-5-mini", thinking: "high" },
|
|
712
710
|
],
|
|
713
711
|
projectAgentsDir: null,
|
|
714
712
|
}));
|
|
@@ -721,7 +719,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
721
719
|
|
|
722
720
|
const result = await executor.execute(
|
|
723
721
|
"id",
|
|
724
|
-
{ tasks: [{ agent: "
|
|
722
|
+
{ tasks: [{ agent: "builder", task: "test", model: "" }] },
|
|
725
723
|
new AbortController().signal,
|
|
726
724
|
undefined,
|
|
727
725
|
ctx,
|
|
@@ -739,7 +737,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
739
737
|
const manager = makeSignedThinkingSessionManager(childSessionFile);
|
|
740
738
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
741
739
|
agents: [
|
|
742
|
-
{ name: "
|
|
740
|
+
{ name: "builder", description: "Worker", defaultContext: "fork", model: "anthropic/claude-sonnet-4-5:high", thinking: "high" },
|
|
743
741
|
],
|
|
744
742
|
projectAgentsDir: null,
|
|
745
743
|
}));
|
|
@@ -765,7 +763,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
765
763
|
|
|
766
764
|
const result = await executor.execute(
|
|
767
765
|
"id",
|
|
768
|
-
{ agent: "
|
|
766
|
+
{ agent: "builder", task: "test", clarify: true },
|
|
769
767
|
new AbortController().signal,
|
|
770
768
|
undefined,
|
|
771
769
|
ctx,
|
|
@@ -785,7 +783,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
785
783
|
const manager = makeSignedThinkingSessionManager(childSessionFile);
|
|
786
784
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
787
785
|
agents: [
|
|
788
|
-
{ name: "
|
|
786
|
+
{ name: "builder", description: "Worker", defaultContext: "fork", model: "anthropic/claude-sonnet-4-5:high", thinking: "high" },
|
|
789
787
|
],
|
|
790
788
|
projectAgentsDir: null,
|
|
791
789
|
}));
|
|
@@ -798,7 +796,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
798
796
|
|
|
799
797
|
const result = await executor.execute(
|
|
800
798
|
"id",
|
|
801
|
-
{ agent: "
|
|
799
|
+
{ agent: "builder", task: "test" },
|
|
802
800
|
new AbortController().signal,
|
|
803
801
|
undefined,
|
|
804
802
|
ctx,
|
|
@@ -806,7 +804,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
806
804
|
|
|
807
805
|
assert.equal(result.isError, true);
|
|
808
806
|
const text = result.content.filter((block) => block.text).map((block) => block.text).join("\n");
|
|
809
|
-
assert.equal(text.includes("fork context forced thinking off for
|
|
807
|
+
assert.equal(text.includes("fork context forced thinking off for builder (child 0)"), true);
|
|
810
808
|
});
|
|
811
809
|
|
|
812
810
|
it("keeps default-fork context on run-path errors", async () => {
|
|
@@ -814,7 +812,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
814
812
|
const { manager } = makeForkingSessionManagerRecorder({ sessionFile: parentSessionFile, leafId: "leaf-current" });
|
|
815
813
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
816
814
|
agents: [
|
|
817
|
-
{ name: "
|
|
815
|
+
{ name: "builder", description: "Worker", defaultContext: "fork" },
|
|
818
816
|
],
|
|
819
817
|
projectAgentsDir: null,
|
|
820
818
|
}));
|
|
@@ -826,7 +824,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
826
824
|
|
|
827
825
|
const result = await executor.execute(
|
|
828
826
|
"id",
|
|
829
|
-
{ agent: "
|
|
827
|
+
{ agent: "builder" },
|
|
830
828
|
new AbortController().signal,
|
|
831
829
|
undefined,
|
|
832
830
|
ctx,
|
|
@@ -842,14 +840,14 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
842
840
|
const { manager, openedPaths, branchedLeafIds } = makeForkingSessionManagerRecorder({ sessionFile: parentSessionFile, leafId: "leaf-current" });
|
|
843
841
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
844
842
|
agents: [
|
|
845
|
-
{ name: "
|
|
843
|
+
{ name: "commentator", description: "Oracle", defaultContext: "fork" },
|
|
846
844
|
],
|
|
847
845
|
projectAgentsDir: null,
|
|
848
846
|
}));
|
|
849
847
|
|
|
850
848
|
const result = await executor.execute(
|
|
851
849
|
"id",
|
|
852
|
-
{ agent: "
|
|
850
|
+
{ agent: "commentator", task: "test", context: "fresh" },
|
|
853
851
|
new AbortController().signal,
|
|
854
852
|
undefined,
|
|
855
853
|
makeCtx(manager),
|
|
@@ -868,7 +866,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
868
866
|
const { manager, openedPaths, branchedLeafIds } = makeForkingSessionManagerRecorder({ sessionFile: parentSessionFile, leafId: "leaf-current" });
|
|
869
867
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
870
868
|
agents: [
|
|
871
|
-
{ name: "
|
|
869
|
+
{ name: "builder", description: "Worker", defaultContext: "fork" },
|
|
872
870
|
{ name: "second", description: "Second" },
|
|
873
871
|
],
|
|
874
872
|
projectAgentsDir: null,
|
|
@@ -876,7 +874,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
876
874
|
|
|
877
875
|
const result = await executor.execute(
|
|
878
876
|
"id",
|
|
879
|
-
{ tasks: [{ agent: "
|
|
877
|
+
{ tasks: [{ agent: "builder", task: "one" }, { agent: "second", task: "two" }] },
|
|
880
878
|
new AbortController().signal,
|
|
881
879
|
undefined,
|
|
882
880
|
makeCtx(manager),
|
|
@@ -900,7 +898,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
900
898
|
const { manager, openedPaths } = makeForkingSessionManagerRecorder({ sessionFile: parentSessionFile, leafId: "leaf-current" });
|
|
901
899
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
902
900
|
agents: [
|
|
903
|
-
{ name: "
|
|
901
|
+
{ name: "builder", description: "Worker", defaultContext: "fork" },
|
|
904
902
|
{ name: "second", description: "Second" },
|
|
905
903
|
],
|
|
906
904
|
projectAgentsDir: null,
|
|
@@ -908,7 +906,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
908
906
|
|
|
909
907
|
const result = await executor.execute(
|
|
910
908
|
"id",
|
|
911
|
-
{ tasks: [{ agent: "
|
|
909
|
+
{ tasks: [{ agent: "builder", task: "one" }, { agent: "second", task: "two" }], context: "fresh" },
|
|
912
910
|
new AbortController().signal,
|
|
913
911
|
undefined,
|
|
914
912
|
makeCtx(manager),
|
|
@@ -926,14 +924,14 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
926
924
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
927
925
|
agents: [
|
|
928
926
|
{ name: "echo", description: "Echo" },
|
|
929
|
-
{ name: "
|
|
927
|
+
{ name: "builder", description: "Worker", defaultContext: "fork" },
|
|
930
928
|
],
|
|
931
929
|
projectAgentsDir: null,
|
|
932
930
|
}));
|
|
933
931
|
|
|
934
932
|
const result = await executor.execute(
|
|
935
933
|
"id",
|
|
936
|
-
{ chain: [{ agent: "echo", task: "scan" }, { agent: "
|
|
934
|
+
{ chain: [{ agent: "echo", task: "scan" }, { agent: "builder", task: "write" }], clarify: false },
|
|
937
935
|
new AbortController().signal,
|
|
938
936
|
undefined,
|
|
939
937
|
makeCtx(manager),
|
|
@@ -967,15 +965,15 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
967
965
|
};
|
|
968
966
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
969
967
|
agents: [
|
|
970
|
-
{ name: "
|
|
971
|
-
{ name: "
|
|
968
|
+
{ name: "explorer", description: "Scout", defaultContext: "fresh" },
|
|
969
|
+
{ name: "builder", description: "Worker", defaultContext: "fork" },
|
|
972
970
|
],
|
|
973
971
|
projectAgentsDir: null,
|
|
974
972
|
}));
|
|
975
973
|
|
|
976
974
|
const result = await executor.execute(
|
|
977
975
|
"id",
|
|
978
|
-
{ tasks: [{ agent: "
|
|
976
|
+
{ tasks: [{ agent: "explorer", task: "scan" }, { agent: "builder", task: "write" }] },
|
|
979
977
|
new AbortController().signal,
|
|
980
978
|
undefined,
|
|
981
979
|
makeCtx(manager),
|
|
@@ -1002,8 +1000,8 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
1002
1000
|
};
|
|
1003
1001
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
1004
1002
|
agents: [
|
|
1005
|
-
{ name: "
|
|
1006
|
-
{ name: "
|
|
1003
|
+
{ name: "explorer", description: "Scout", defaultContext: "fresh" },
|
|
1004
|
+
{ name: "builder", description: "Worker", defaultContext: "fork" },
|
|
1007
1005
|
],
|
|
1008
1006
|
projectAgentsDir: null,
|
|
1009
1007
|
}));
|
|
@@ -1012,11 +1010,11 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
1012
1010
|
"id",
|
|
1013
1011
|
{
|
|
1014
1012
|
chain: [
|
|
1015
|
-
{ agent: "
|
|
1016
|
-
{ agent: "
|
|
1013
|
+
{ agent: "explorer", task: "scan" },
|
|
1014
|
+
{ agent: "builder", task: "write" },
|
|
1017
1015
|
{
|
|
1018
1016
|
expand: { from: { output: "items", path: "$" } },
|
|
1019
|
-
parallel: { agent: "
|
|
1017
|
+
parallel: { agent: "explorer", task: "inspect item" },
|
|
1020
1018
|
collect: { as: "inspections" },
|
|
1021
1019
|
},
|
|
1022
1020
|
],
|
|
@@ -1043,7 +1041,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
1043
1041
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
1044
1042
|
agents: [
|
|
1045
1043
|
{ name: "producer", description: "Producer", defaultContext: "fresh" },
|
|
1046
|
-
{ name: "
|
|
1044
|
+
{ name: "builder", description: "Worker", defaultContext: "fork" },
|
|
1047
1045
|
],
|
|
1048
1046
|
projectAgentsDir: null,
|
|
1049
1047
|
}));
|
|
@@ -1055,10 +1053,10 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
1055
1053
|
{ agent: "producer", task: "produce", as: "items", outputSchema: { type: "object" } },
|
|
1056
1054
|
{
|
|
1057
1055
|
expand: { from: { output: "items", path: "/items" }, item: "item", key: "/id", maxItems: 3 },
|
|
1058
|
-
parallel: { agent: "
|
|
1056
|
+
parallel: { agent: "builder", task: "inspect {item.id}" },
|
|
1059
1057
|
collect: { as: "inspections" },
|
|
1060
1058
|
},
|
|
1061
|
-
{ agent: "
|
|
1059
|
+
{ agent: "builder", task: "final" },
|
|
1062
1060
|
],
|
|
1063
1061
|
clarify: false,
|
|
1064
1062
|
},
|
|
@@ -1076,13 +1074,13 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
1076
1074
|
it("reports unknown top-level parallel agents before default-fork preconditions", async () => {
|
|
1077
1075
|
const { manager } = makeSessionManagerRecorder({ sessionFile: undefined, leafId: "leaf-current" });
|
|
1078
1076
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
1079
|
-
agents: [{ name: "
|
|
1077
|
+
agents: [{ name: "builder", description: "Worker", defaultContext: "fork" }],
|
|
1080
1078
|
projectAgentsDir: null,
|
|
1081
1079
|
}));
|
|
1082
1080
|
|
|
1083
1081
|
const result = await executor.execute(
|
|
1084
1082
|
"id",
|
|
1085
|
-
{ tasks: [{ agent: "
|
|
1083
|
+
{ tasks: [{ agent: "builder", task: "one" }, { agent: "missing", task: "two" }] },
|
|
1086
1084
|
new AbortController().signal,
|
|
1087
1085
|
undefined,
|
|
1088
1086
|
makeCtx(manager),
|
|
@@ -1448,7 +1446,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
1448
1446
|
|
|
1449
1447
|
it("keeps inherited model-scope warnings non-fatal in async parallel conversion", { skip: !asyncAvailable ? "jiti not available" : undefined }, async () => {
|
|
1450
1448
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
1451
|
-
agents: [{ name: "
|
|
1449
|
+
agents: [{ name: "builder", description: "Worker", model: "openai/gpt-5-mini" }],
|
|
1452
1450
|
projectAgentsDir: null,
|
|
1453
1451
|
modelScope: { enforce: true, allow: ["anthropic/*"] },
|
|
1454
1452
|
}));
|
|
@@ -1464,7 +1462,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
1464
1462
|
try {
|
|
1465
1463
|
const result = await executor.execute(
|
|
1466
1464
|
"id",
|
|
1467
|
-
{ tasks: [{ agent: "
|
|
1465
|
+
{ tasks: [{ agent: "builder", task: "test" }], async: true },
|
|
1468
1466
|
new AbortController().signal,
|
|
1469
1467
|
undefined,
|
|
1470
1468
|
ctx,
|
|
@@ -1480,7 +1478,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
1480
1478
|
|
|
1481
1479
|
it("keeps inherited model-scope warnings non-fatal after Clarify switches parallel work to background", { skip: !asyncAvailable ? "jiti not available" : undefined }, async () => {
|
|
1482
1480
|
const executor = makeExecutorWithDiscoverAgents(() => ({
|
|
1483
|
-
agents: [{ name: "
|
|
1481
|
+
agents: [{ name: "builder", description: "Worker", model: "openai/gpt-5-mini" }],
|
|
1484
1482
|
projectAgentsDir: null,
|
|
1485
1483
|
modelScope: { enforce: true, allow: ["anthropic/*"] },
|
|
1486
1484
|
}));
|
|
@@ -1505,7 +1503,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
1505
1503
|
try {
|
|
1506
1504
|
const result = await executor.execute(
|
|
1507
1505
|
"id",
|
|
1508
|
-
{ tasks: [{ agent: "
|
|
1506
|
+
{ tasks: [{ agent: "builder", task: "test" }], clarify: true },
|
|
1509
1507
|
new AbortController().signal,
|
|
1510
1508
|
undefined,
|
|
1511
1509
|
ctx,
|
|
@@ -1829,7 +1827,7 @@ describe("fork context execution wiring", { skip: !available ? "subagent executo
|
|
|
1829
1827
|
);
|
|
1830
1828
|
|
|
1831
1829
|
assert.equal(result.isError, undefined);
|
|
1832
|
-
const args = readAllCallArgs().find((callArgs) => (callArgs.at(-1) ?? "").startsWith(`Task: ${task}\n\n
|
|
1830
|
+
const args = readAllCallArgs().find((callArgs) => (callArgs.at(-1) ?? "").startsWith(`Task: ${task}\n\n## Acceptance Contract`));
|
|
1833
1831
|
assert.ok(args, "expected a recorded mock pi call for this test task");
|
|
1834
1832
|
const modelIndex = args.indexOf("--model");
|
|
1835
1833
|
assert.notEqual(modelIndex, -1);
|