@selesai/code 0.6.3 → 0.8.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 +22 -1
- package/README.md +5 -3
- 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/agent-browser.test.ts +195 -0
- package/dist/extensions/agent-browser.ts +158 -0
- package/dist/extensions/inline-skills.test.ts +27 -13
- package/dist/extensions/inline-skills.ts +18 -11
- package/dist/extensions/package.json +2 -1
- package/dist/extensions/pi-powerline-footer/.github/workflows/test.yml +27 -0
- package/dist/extensions/pi-powerline-footer/CHANGELOG.md +153 -0
- package/dist/extensions/pi-powerline-footer/CONTRIBUTING.md +16 -0
- package/dist/extensions/pi-powerline-footer/README.md +192 -44
- package/dist/extensions/pi-powerline-footer/bash-mode/completion.ts +19 -4
- package/dist/extensions/pi-powerline-footer/bash-mode/editor.ts +80 -25
- package/dist/extensions/pi-powerline-footer/bash-mode/history.ts +81 -29
- package/dist/extensions/pi-powerline-footer/bash-mode/types.ts +1 -1
- package/dist/extensions/pi-powerline-footer/cd-command.ts +190 -0
- package/dist/extensions/pi-powerline-footer/colors.ts +2 -1
- package/dist/extensions/pi-powerline-footer/context-usage.ts +121 -6
- package/dist/extensions/pi-powerline-footer/currency-rates.ts +142 -0
- package/dist/extensions/pi-powerline-footer/editor-composition.ts +32 -0
- package/dist/extensions/pi-powerline-footer/git-status.ts +108 -6
- package/dist/extensions/pi-powerline-footer/icons.ts +11 -2
- package/dist/extensions/pi-powerline-footer/index.ts +1056 -324
- package/dist/extensions/pi-powerline-footer/lifecycle.ts +10 -0
- package/dist/extensions/pi-powerline-footer/package.json +10 -6
- package/dist/extensions/pi-powerline-footer/paths.ts +22 -0
- package/dist/extensions/pi-powerline-footer/powerline-config.ts +297 -15
- package/dist/extensions/pi-powerline-footer/presets.ts +6 -25
- package/dist/extensions/pi-powerline-footer/queue/store.ts +361 -0
- package/dist/extensions/pi-powerline-footer/queue/types.ts +54 -0
- package/dist/extensions/pi-powerline-footer/render-scheduler.ts +12 -7
- package/dist/extensions/pi-powerline-footer/segments.ts +114 -107
- package/dist/extensions/pi-powerline-footer/session-usage.ts +1 -1
- package/dist/extensions/pi-powerline-footer/shortcuts.ts +17 -3
- package/dist/extensions/pi-powerline-footer/tests/bash-mode.test.ts +189 -17
- package/dist/extensions/pi-powerline-footer/tests/cd-command.test.ts +144 -0
- package/dist/extensions/pi-powerline-footer/tests/context-usage.test.ts +120 -2
- package/dist/extensions/pi-powerline-footer/tests/custom-items.test.ts +245 -22
- package/dist/extensions/pi-powerline-footer/tests/editor-composition.test.ts +48 -0
- package/dist/extensions/pi-powerline-footer/tests/editor-responsiveness.test.ts +34 -0
- package/dist/extensions/pi-powerline-footer/tests/fixed-editor-border.test.ts +39 -0
- package/dist/extensions/pi-powerline-footer/tests/git-status.test.ts +92 -0
- package/dist/extensions/pi-powerline-footer/tests/guide.test.ts +4 -1
- package/dist/extensions/pi-powerline-footer/tests/jump-shortcuts.test.ts +33 -197
- package/dist/extensions/pi-powerline-footer/tests/mode-aware-trigger.test.ts +79 -0
- package/dist/extensions/pi-powerline-footer/tests/paths.test.ts +63 -0
- package/dist/extensions/pi-powerline-footer/tests/queue-store.test.ts +195 -0
- package/dist/extensions/pi-powerline-footer/tests/quit-cursor.test.ts +14 -0
- package/dist/extensions/pi-powerline-footer/tests/remaining-regressions.test.ts +167 -0
- package/dist/extensions/pi-powerline-footer/tests/stash-shortcut.test.ts +23 -18
- package/dist/extensions/pi-powerline-footer/tests/thinking-segment.test.ts +16 -1
- package/dist/extensions/pi-powerline-footer/tests/token-stats.test.ts +249 -0
- package/dist/extensions/pi-powerline-footer/tests/usage-display.test.ts +237 -0
- package/dist/extensions/pi-powerline-footer/tests/welcome.test.ts +199 -0
- package/dist/extensions/pi-powerline-footer/tests/working-vibes.test.ts +191 -100
- package/dist/extensions/pi-powerline-footer/theme.ts +32 -18
- package/dist/extensions/pi-powerline-footer/token-stats.ts +304 -0
- package/dist/extensions/pi-powerline-footer/tsconfig.json +13 -0
- package/dist/extensions/pi-powerline-footer/types.ts +74 -29
- package/dist/extensions/pi-powerline-footer/welcome-dismiss.ts +34 -0
- package/dist/extensions/pi-powerline-footer/welcome.ts +65 -10
- package/dist/extensions/pi-powerline-footer/working-vibes.ts +44 -11
- 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 +136 -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 +127 -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/ponytail/index.js +1 -31
- package/dist/extensions/ponytail/test/extension.test.js +5 -22
- package/dist/extensions/rtk.test.ts +141 -0
- package/dist/extensions/rtk.ts +78 -36
- 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 +3 -2
- 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
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
events,
|
|
26
26
|
} from "../support/helpers.ts";
|
|
27
27
|
import { INTERCOM_DETACH_REQUEST_EVENT } from "../../src/shared/types.ts";
|
|
28
|
+
import { PERMISSION_AUDIT_PATH_ENV, PERMISSION_POLICY_ENV } from "../../src/runs/shared/permissions.ts";
|
|
28
29
|
|
|
29
30
|
interface TestSequentialStep {
|
|
30
31
|
agent: string;
|
|
@@ -220,12 +221,12 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
220
221
|
it("pauses foreground chains at approval checkpoints without launching the next child", async () => {
|
|
221
222
|
mockPi.onCall({ output: "analysis done" });
|
|
222
223
|
mockPi.onCall({ output: "should not run" });
|
|
223
|
-
const agents = [makeAgent("analyst"), makeAgent("
|
|
224
|
+
const agents = [makeAgent("analyst"), makeAgent("builder")];
|
|
224
225
|
|
|
225
226
|
const result = await executeChain!(makeChainParams([
|
|
226
227
|
{ agent: "analyst", task: "Analyze" },
|
|
227
228
|
{ checkpoint: "review", message: "Approve implementation?" },
|
|
228
|
-
{ agent: "
|
|
229
|
+
{ agent: "builder", task: "Implement" },
|
|
229
230
|
], agents));
|
|
230
231
|
|
|
231
232
|
assert.equal(result.isError, undefined);
|
|
@@ -238,6 +239,22 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
238
239
|
assert.equal(mockPi.callCount(), 1);
|
|
239
240
|
});
|
|
240
241
|
|
|
242
|
+
it("applies global permissions to foreground chain children", async () => {
|
|
243
|
+
mockPi.onCall({ echoEnv: [PERMISSION_POLICY_ENV, PERMISSION_AUDIT_PATH_ENV] });
|
|
244
|
+
const agents = [makeAgent("builder")];
|
|
245
|
+
|
|
246
|
+
const result = await executeChain!(makeChainParams(
|
|
247
|
+
[{ agent: "builder", task: "Work" }],
|
|
248
|
+
agents,
|
|
249
|
+
{ permissions: { rules: { write: "ask" } } },
|
|
250
|
+
));
|
|
251
|
+
|
|
252
|
+
assert.equal(result.isError, undefined);
|
|
253
|
+
const env = JSON.parse(result.details.results[0]?.finalOutput ?? "{}") as Record<string, string | null>;
|
|
254
|
+
assert.equal(env[PERMISSION_POLICY_ENV], JSON.stringify({ write: "ask" }));
|
|
255
|
+
assert.match(env[PERMISSION_AUDIT_PATH_ENV] ?? "", /permission-audit\.jsonl$/);
|
|
256
|
+
});
|
|
257
|
+
|
|
241
258
|
it("runs a 2-step chain", async () => {
|
|
242
259
|
mockPi.onCall({ output: "Analysis complete: found 3 issues" });
|
|
243
260
|
const agents = [makeAgent("analyst"), makeAgent("reporter")];
|
|
@@ -367,9 +384,8 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
367
384
|
assert.doesNotMatch(firstTaskArg, /\[Write to:|Write your findings to exactly this path/);
|
|
368
385
|
assert.ok(result.details.results[0]?.savedOutputPath);
|
|
369
386
|
assert.equal(fs.readFileSync(result.details.results[0].savedOutputPath, "utf-8"), "full chain output\nwith details");
|
|
370
|
-
assert.
|
|
371
|
-
assert.
|
|
372
|
-
assert.doesNotMatch(result.details.results[0]?.outputReference?.message ?? "", /full chain output/);
|
|
387
|
+
assert.match(result.details.results[0]?.finalOutput ?? "", /Output saved to:/);
|
|
388
|
+
assert.doesNotMatch(result.details.results[0]?.finalOutput ?? "", /full chain output/);
|
|
373
389
|
const secondTaskArg = readCallArgs(1).at(-1) ?? "";
|
|
374
390
|
assert.match(secondTaskArg, /Output saved to:/);
|
|
375
391
|
assert.match(secondTaskArg, /2 lines/);
|
|
@@ -394,19 +410,18 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
394
410
|
"```",
|
|
395
411
|
].join("\n"),
|
|
396
412
|
});
|
|
397
|
-
const agents = [makeAgent("
|
|
413
|
+
const agents = [makeAgent("builder", { completionGuard: false })];
|
|
398
414
|
|
|
399
415
|
const result = await executeChain(
|
|
400
416
|
makeChainParams(
|
|
401
|
-
[{ agent: "
|
|
417
|
+
[{ agent: "builder", task: "Implement fix", output: "accepted.md", outputMode: "file-only", acceptance: { level: "checked", criteria: ["Patch bug"] } }],
|
|
402
418
|
agents,
|
|
403
419
|
{ chainDir: tempDir },
|
|
404
420
|
),
|
|
405
421
|
);
|
|
406
422
|
|
|
407
423
|
assert.ok(!result.isError, `chain should succeed: ${JSON.stringify(result.content)}`);
|
|
408
|
-
assert.
|
|
409
|
-
assert.match(result.details.results[0]?.outputReference?.message ?? "", /Output saved to:/);
|
|
424
|
+
assert.match(result.details.results[0]?.finalOutput ?? "", /Output saved to:/);
|
|
410
425
|
assert.equal(result.details.results[0]?.acceptance?.status, "checked");
|
|
411
426
|
assert.ok(result.details.results[0]?.acceptance?.childReport);
|
|
412
427
|
|
|
@@ -427,7 +442,7 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
427
442
|
|
|
428
443
|
const failed = await executeChain(
|
|
429
444
|
makeChainParams(
|
|
430
|
-
[{ agent: "
|
|
445
|
+
[{ agent: "builder", task: "Implement fix", acceptance: { level: "checked" } }],
|
|
431
446
|
agents,
|
|
432
447
|
),
|
|
433
448
|
);
|
|
@@ -452,11 +467,11 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
452
467
|
"```",
|
|
453
468
|
].join("\n");
|
|
454
469
|
mockPi.onCall({ output: acceptanceReport });
|
|
455
|
-
const agents = [makeAgent("
|
|
470
|
+
const agents = [makeAgent("builder", { completionGuard: false })];
|
|
456
471
|
|
|
457
472
|
const result = await executeChain(
|
|
458
473
|
makeChainParams(
|
|
459
|
-
[{ agent: "
|
|
474
|
+
[{ agent: "builder", task: "Implement fix", acceptance: { level: "verified", verify: [{ id: "runtime-pass", command: "node -e \"process.exit(0)\"" }] } }],
|
|
460
475
|
agents,
|
|
461
476
|
),
|
|
462
477
|
);
|
|
@@ -467,7 +482,7 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
467
482
|
mockPi.onCall({ output: acceptanceReport });
|
|
468
483
|
const failed = await executeChain(
|
|
469
484
|
makeChainParams(
|
|
470
|
-
[{ agent: "
|
|
485
|
+
[{ agent: "builder", task: "Implement fix", acceptance: { level: "verified", verify: [{ id: "runtime-fail", command: "node -e \"process.exit(5)\"" }] } }],
|
|
471
486
|
agents,
|
|
472
487
|
),
|
|
473
488
|
);
|
|
@@ -545,8 +560,8 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
545
560
|
|
|
546
561
|
const result = await executeChain(
|
|
547
562
|
makeChainParams(
|
|
548
|
-
[{ agent: "
|
|
549
|
-
[makeAgent("
|
|
563
|
+
[{ agent: "builder", task: "Do work" }],
|
|
564
|
+
[makeAgent("builder")],
|
|
550
565
|
{
|
|
551
566
|
ctx: {
|
|
552
567
|
...makeMinimalCtx(tempDir),
|
|
@@ -567,8 +582,8 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
567
582
|
|
|
568
583
|
const result = await executeChain(
|
|
569
584
|
makeChainParams(
|
|
570
|
-
[{ agent: "
|
|
571
|
-
[makeAgent("
|
|
585
|
+
[{ agent: "builder", task: "Do work", model: "inherit" }],
|
|
586
|
+
[makeAgent("builder")],
|
|
572
587
|
{
|
|
573
588
|
ctx: {
|
|
574
589
|
...makeMinimalCtx(tempDir),
|
|
@@ -586,11 +601,11 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
586
601
|
|
|
587
602
|
it("suppresses progress for {task} chain templates when the top-level task is review-only", async () => {
|
|
588
603
|
mockPi.onCall({ output: "Review done" });
|
|
589
|
-
const agents = [makeAgent("
|
|
604
|
+
const agents = [makeAgent("commentator", { defaultProgress: true })];
|
|
590
605
|
|
|
591
606
|
await executeChain(
|
|
592
607
|
makeChainParams(
|
|
593
|
-
[{ agent: "
|
|
608
|
+
[{ agent: "commentator" }],
|
|
594
609
|
agents,
|
|
595
610
|
{ task: "Review-only. Do not edit files. Return findings." },
|
|
596
611
|
),
|
|
@@ -603,13 +618,13 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
603
618
|
|
|
604
619
|
it("foreground chains still resolve defaultProgress inside the chain directory", async () => {
|
|
605
620
|
mockPi.onCall({ output: "Progress done" });
|
|
606
|
-
const agents = [makeAgent("
|
|
621
|
+
const agents = [makeAgent("commentator", { defaultProgress: true })];
|
|
607
622
|
const chainDir = path.join(tempDir, "chain-progress");
|
|
608
623
|
const runId = "chain-progress-run";
|
|
609
624
|
|
|
610
625
|
await executeChain(
|
|
611
626
|
makeChainParams(
|
|
612
|
-
[{ agent: "
|
|
627
|
+
[{ agent: "commentator", task: "Track chain work" }],
|
|
613
628
|
agents,
|
|
614
629
|
{ chainDir, runId },
|
|
615
630
|
),
|
|
@@ -632,13 +647,10 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
632
647
|
|
|
633
648
|
assert.ok(!result.isError);
|
|
634
649
|
const step2Task = result.details.results[1].task;
|
|
635
|
-
// Reference-first handoff: {previous} carries the saved-output reference and
|
|
636
|
-
// the step reads the named path instead of re-inlined prose.
|
|
637
650
|
assert.ok(
|
|
638
|
-
step2Task.includes("
|
|
639
|
-
`step 2 task should contain
|
|
651
|
+
step2Task.includes("MARKER_ABC_123"),
|
|
652
|
+
`step 2 task should contain step 1 output via {previous}: ${step2Task.slice(0, 200)}`,
|
|
640
653
|
);
|
|
641
|
-
assert.doesNotMatch(step2Task, /MARKER_ABC_123/);
|
|
642
654
|
});
|
|
643
655
|
|
|
644
656
|
it("passes named sequential outputs through {outputs.name}", async () => {
|
|
@@ -657,8 +669,7 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
657
669
|
);
|
|
658
670
|
|
|
659
671
|
assert.ok(!result.isError);
|
|
660
|
-
assert.match(readCallArgs(1).at(-1) ?? "", /
|
|
661
|
-
assert.doesNotMatch(readCallArgs(1).at(-1) ?? "", /CTX_123/);
|
|
672
|
+
assert.match(readCallArgs(1).at(-1) ?? "", /CTX_123/);
|
|
662
673
|
assert.equal(result.details.workflowGraph?.nodes[0]?.outputName, "contextOutput");
|
|
663
674
|
});
|
|
664
675
|
|
|
@@ -670,16 +681,16 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
670
681
|
mockPi.onCall({ output: "review-a", structuredOutput: { ok: "a" } });
|
|
671
682
|
mockPi.onCall({ output: "review-b", structuredOutput: { ok: "b" } });
|
|
672
683
|
mockPi.onCall({ output: "synthesized" });
|
|
673
|
-
const agents = [makeAgent("
|
|
684
|
+
const agents = [makeAgent("explorer"), makeAgent("commentator"), makeAgent("writer")];
|
|
674
685
|
|
|
675
686
|
const result = await executeChain(
|
|
676
687
|
makeChainParams(
|
|
677
688
|
[
|
|
678
|
-
{ agent: "
|
|
689
|
+
{ agent: "explorer", task: "Return targets", as: "targets", outputSchema: { type: "object" } },
|
|
679
690
|
{
|
|
680
691
|
expand: { from: { output: "targets", path: "/items" }, item: "target", key: "/path", maxItems: 4 },
|
|
681
692
|
parallel: {
|
|
682
|
-
agent: "
|
|
693
|
+
agent: "commentator",
|
|
683
694
|
task: "Review {target.path}",
|
|
684
695
|
label: "Review {target.path}",
|
|
685
696
|
outputSchema: { type: "object" },
|
|
@@ -698,15 +709,47 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
698
709
|
assert.match(readCallArgs(1).at(-1) ?? "", /Review src\/a\.ts/);
|
|
699
710
|
assert.match(readCallArgs(2).at(-1) ?? "", /Review src\/b\.ts/);
|
|
700
711
|
assert.match(readCallArgs(3).at(-1) ?? "", /"key":"src\/a\.ts"/);
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
assert.
|
|
704
|
-
assert.equal(result.details.outputs?.reviews?.structured, undefined);
|
|
712
|
+
const collected = result.details.outputs?.reviews?.structured as Array<{ key: string; structured: unknown }>;
|
|
713
|
+
assert.deepEqual(collected.map((item) => item.key), ["src/a.ts", "src/b.ts"]);
|
|
714
|
+
assert.deepEqual(collected.map((item) => item.structured), [{ ok: "a" }, { ok: "b" }]);
|
|
705
715
|
const dynamicNode = result.details.workflowGraph?.nodes[1];
|
|
706
716
|
assert.equal(dynamicNode?.kind, "dynamic-parallel-group");
|
|
707
717
|
assert.deepEqual(dynamicNode?.children?.map((child) => child.itemKey), ["src/a.ts", "src/b.ts"]);
|
|
708
718
|
});
|
|
709
719
|
|
|
720
|
+
it("applies global permissions to materialized dynamic parallel children", async () => {
|
|
721
|
+
mockPi.onCall({
|
|
722
|
+
output: "targets",
|
|
723
|
+
structuredOutput: { items: [{ path: "src/a.ts" }, { path: "src/b.ts" }] },
|
|
724
|
+
});
|
|
725
|
+
mockPi.onCall({ echoEnv: [PERMISSION_POLICY_ENV, PERMISSION_AUDIT_PATH_ENV], structuredOutput: { ok: "a" } });
|
|
726
|
+
mockPi.onCall({ echoEnv: [PERMISSION_POLICY_ENV, PERMISSION_AUDIT_PATH_ENV], structuredOutput: { ok: "b" } });
|
|
727
|
+
const agents = [makeAgent("explorer"), makeAgent("commentator")];
|
|
728
|
+
|
|
729
|
+
const result = await executeChain!(makeChainParams(
|
|
730
|
+
[
|
|
731
|
+
{ agent: "explorer", task: "Return targets", as: "targets", outputSchema: { type: "object" } },
|
|
732
|
+
{
|
|
733
|
+
expand: { from: { output: "targets", path: "/items" }, key: "/path", maxItems: 4 },
|
|
734
|
+
parallel: { agent: "commentator", task: "Review {item.path}", outputSchema: { type: "object" } },
|
|
735
|
+
collect: { as: "reviews" },
|
|
736
|
+
concurrency: 1,
|
|
737
|
+
},
|
|
738
|
+
],
|
|
739
|
+
agents,
|
|
740
|
+
{ permissions: { rules: { write: "ask" } } },
|
|
741
|
+
));
|
|
742
|
+
|
|
743
|
+
assert.equal(result.isError, undefined);
|
|
744
|
+
const reviewerResults = result.details.results.filter((entry) => entry.agent === "commentator");
|
|
745
|
+
assert.equal(reviewerResults.length, 2);
|
|
746
|
+
for (const child of reviewerResults) {
|
|
747
|
+
const env = JSON.parse(child.finalOutput ?? "{}") as Record<string, string | null>;
|
|
748
|
+
assert.equal(env[PERMISSION_POLICY_ENV], JSON.stringify({ write: "ask" }));
|
|
749
|
+
assert.match(env[PERMISSION_AUDIT_PATH_ENV] ?? "", /permission-audit\.jsonl$/);
|
|
750
|
+
}
|
|
751
|
+
});
|
|
752
|
+
|
|
710
753
|
it("persists checked child evidence and pending aggregate review for dynamic fanout", async () => {
|
|
711
754
|
mockPi.onCall({
|
|
712
755
|
output: "targets",
|
|
@@ -714,15 +757,15 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
714
757
|
});
|
|
715
758
|
mockPi.onCall({ output: acceptanceReport({ changedFiles: ["src/a.ts"] }), structuredOutput: { ok: "a" } });
|
|
716
759
|
mockPi.onCall({ output: acceptanceReport({ changedFiles: ["src/b.ts"] }), structuredOutput: { ok: "b" } });
|
|
717
|
-
const agents = [makeAgent("
|
|
760
|
+
const agents = [makeAgent("explorer"), makeAgent("commentator", { completionGuard: false })];
|
|
718
761
|
|
|
719
762
|
const result = await executeChain(
|
|
720
763
|
makeChainParams(
|
|
721
764
|
[
|
|
722
|
-
{ agent: "
|
|
765
|
+
{ agent: "explorer", task: "Return targets", as: "targets", outputSchema: { type: "object" } },
|
|
723
766
|
{
|
|
724
767
|
expand: { from: { output: "targets", path: "/items" }, key: "/path", maxItems: 4 },
|
|
725
|
-
parallel: { agent: "
|
|
768
|
+
parallel: { agent: "commentator", task: "Review {item.path}", outputSchema: { type: "object" }, acceptance: { level: "checked" } },
|
|
726
769
|
collect: { as: "reviews" },
|
|
727
770
|
acceptance: { level: "checked" },
|
|
728
771
|
concurrency: 1,
|
|
@@ -736,7 +779,7 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
736
779
|
const dynamicNode = result.details.workflowGraph?.nodes[1];
|
|
737
780
|
assert.equal(dynamicNode?.acceptanceStatus, "review-required");
|
|
738
781
|
assert.deepEqual(dynamicNode?.children?.map((child) => child.acceptanceStatus), ["checked", "checked"]);
|
|
739
|
-
assert.deepEqual(result.details.results.filter((child) => child.agent === "
|
|
782
|
+
assert.deepEqual(result.details.results.filter((child) => child.agent === "commentator").map((child) => child.acceptance?.evidenceStatus), ["checked", "checked"]);
|
|
740
783
|
});
|
|
741
784
|
|
|
742
785
|
it("applies read-only acceptance roles to dynamic children and their aggregate group", async () => {
|
|
@@ -753,15 +796,15 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
753
796
|
});
|
|
754
797
|
mockPi.onCall({ output: readOnlyReport, structuredOutput: { ok: "a" } });
|
|
755
798
|
mockPi.onCall({ output: readOnlyReport, structuredOutput: { ok: "b" } });
|
|
756
|
-
const agents = [makeAgent("
|
|
799
|
+
const agents = [makeAgent("explorer"), makeAgent("recapper", { acceptanceRole: "read-only" })];
|
|
757
800
|
|
|
758
801
|
const result = await executeChain(
|
|
759
802
|
makeChainParams(
|
|
760
803
|
[
|
|
761
|
-
{ agent: "
|
|
804
|
+
{ agent: "explorer", task: "Return targets", as: "targets", outputSchema: { type: "object" } },
|
|
762
805
|
{
|
|
763
806
|
expand: { from: { output: "targets", path: "/items" }, key: "/path", maxItems: 4 },
|
|
764
|
-
parallel: { agent: "
|
|
807
|
+
parallel: { agent: "recapper", task: "Explore {item.path}", outputSchema: { type: "object" } },
|
|
765
808
|
collect: { as: "reviews" },
|
|
766
809
|
concurrency: 1,
|
|
767
810
|
},
|
|
@@ -771,7 +814,7 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
771
814
|
);
|
|
772
815
|
|
|
773
816
|
assert.ok(!result.isError, `chain should succeed: ${JSON.stringify(result.content)}`);
|
|
774
|
-
const explorerResults = result.details.results.filter((child) => child.agent === "
|
|
817
|
+
const explorerResults = result.details.results.filter((child) => child.agent === "recapper");
|
|
775
818
|
assert.deepEqual(explorerResults.map((child) => child.acceptance?.effectiveAcceptance.level), ["attested", "attested"]);
|
|
776
819
|
const dynamicNode = result.details.workflowGraph?.nodes[1];
|
|
777
820
|
assert.equal(dynamicNode?.acceptanceStatus, "attested");
|
|
@@ -785,15 +828,15 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
785
828
|
});
|
|
786
829
|
mockPi.onCall({ output: acceptanceReport({ changedFiles: ["src/a.ts"] }), structuredOutput: { ok: "a" } });
|
|
787
830
|
mockPi.onCall({ output: acceptanceReport({ changedFiles: ["src/b.ts"] }), structuredOutput: { ok: "b" } });
|
|
788
|
-
const agents = [makeAgent("
|
|
831
|
+
const agents = [makeAgent("explorer"), makeAgent("recapper", { acceptanceRole: "read-only" })];
|
|
789
832
|
|
|
790
833
|
const result = await executeChain(
|
|
791
834
|
makeChainParams(
|
|
792
835
|
[
|
|
793
|
-
{ agent: "
|
|
836
|
+
{ agent: "explorer", task: "Return targets", as: "targets", outputSchema: { type: "object" } },
|
|
794
837
|
{
|
|
795
838
|
expand: { from: { output: "targets", path: "/items" }, key: "/path", maxItems: 4 },
|
|
796
|
-
parallel: { agent: "
|
|
839
|
+
parallel: { agent: "recapper", task: "Patch {item.path}", outputSchema: { type: "object" } },
|
|
797
840
|
collect: { as: "reviews" },
|
|
798
841
|
concurrency: 1,
|
|
799
842
|
},
|
|
@@ -803,7 +846,7 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
803
846
|
);
|
|
804
847
|
|
|
805
848
|
assert.ok(!result.isError, `chain should succeed: ${JSON.stringify(result.content)}`);
|
|
806
|
-
const explorerResults = result.details.results.filter((child) => child.agent === "
|
|
849
|
+
const explorerResults = result.details.results.filter((child) => child.agent === "recapper");
|
|
807
850
|
assert.deepEqual(explorerResults.map((child) => child.acceptance?.effectiveAcceptance.level), ["checked", "checked"]);
|
|
808
851
|
const dynamicNode = result.details.workflowGraph?.nodes[1];
|
|
809
852
|
assert.equal(dynamicNode?.acceptanceStatus, "rejected");
|
|
@@ -817,15 +860,15 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
817
860
|
});
|
|
818
861
|
mockPi.onCall({ output: "review-a", structuredOutput: { ok: "a" } });
|
|
819
862
|
mockPi.onCall({ exitCode: 1, stderr: "review-b failed" });
|
|
820
|
-
const agents = [makeAgent("
|
|
863
|
+
const agents = [makeAgent("explorer"), makeAgent("commentator")];
|
|
821
864
|
|
|
822
865
|
const result = await executeChain(
|
|
823
866
|
makeChainParams(
|
|
824
867
|
[
|
|
825
|
-
{ agent: "
|
|
868
|
+
{ agent: "explorer", task: "Return targets", as: "targets", outputSchema: { type: "object" } },
|
|
826
869
|
{
|
|
827
870
|
expand: { from: { output: "targets", path: "/items" }, key: "/path", maxItems: 4 },
|
|
828
|
-
parallel: { agent: "
|
|
871
|
+
parallel: { agent: "commentator", task: "Review {item.path}", outputSchema: { type: "object" } },
|
|
829
872
|
collect: { as: "reviews" },
|
|
830
873
|
concurrency: 1,
|
|
831
874
|
},
|
|
@@ -842,15 +885,15 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
842
885
|
|
|
843
886
|
it("fails dynamic fanout before spawning children for invalid source arrays", async () => {
|
|
844
887
|
mockPi.onCall({ output: "targets", structuredOutput: { items: [{ path: "a" }, { path: "b" }] } });
|
|
845
|
-
const agents = [makeAgent("
|
|
888
|
+
const agents = [makeAgent("explorer"), makeAgent("commentator")];
|
|
846
889
|
|
|
847
890
|
const result = await executeChain(
|
|
848
891
|
makeChainParams(
|
|
849
892
|
[
|
|
850
|
-
{ agent: "
|
|
893
|
+
{ agent: "explorer", task: "Return targets", as: "targets", outputSchema: { type: "object" } },
|
|
851
894
|
{
|
|
852
895
|
expand: { from: { output: "targets", path: "/items" }, key: "/path", maxItems: 1 },
|
|
853
|
-
parallel: { agent: "
|
|
896
|
+
parallel: { agent: "commentator", task: "Review {item.path}" },
|
|
854
897
|
collect: { as: "reviews" },
|
|
855
898
|
},
|
|
856
899
|
],
|
|
@@ -867,15 +910,15 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
867
910
|
|
|
868
911
|
it("marks dynamic file-only validation failures as failed graph groups before spawning children", async () => {
|
|
869
912
|
mockPi.onCall({ output: "targets", structuredOutput: { items: [{ path: "src/a.ts" }] } });
|
|
870
|
-
const agents = [makeAgent("
|
|
913
|
+
const agents = [makeAgent("explorer"), makeAgent("commentator")];
|
|
871
914
|
|
|
872
915
|
const result = await executeChain(
|
|
873
916
|
makeChainParams(
|
|
874
917
|
[
|
|
875
|
-
{ agent: "
|
|
918
|
+
{ agent: "explorer", task: "Return targets", as: "targets", outputSchema: { type: "object" } },
|
|
876
919
|
{
|
|
877
920
|
expand: { from: { output: "targets", path: "/items" }, key: "/path", maxItems: 4 },
|
|
878
|
-
parallel: { agent: "
|
|
921
|
+
parallel: { agent: "commentator", task: "Review {item.path}", outputMode: "file-only" },
|
|
879
922
|
collect: { as: "reviews" },
|
|
880
923
|
},
|
|
881
924
|
],
|
|
@@ -894,15 +937,15 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
894
937
|
it("marks empty dynamic fanout skip as a completed graph group", async () => {
|
|
895
938
|
mockPi.onCall({ output: "targets", structuredOutput: { items: [] } });
|
|
896
939
|
mockPi.onCall({ output: "used empty reviews" });
|
|
897
|
-
const agents = [makeAgent("
|
|
940
|
+
const agents = [makeAgent("explorer"), makeAgent("commentator"), makeAgent("writer")];
|
|
898
941
|
|
|
899
942
|
const result = await executeChain(
|
|
900
943
|
makeChainParams(
|
|
901
944
|
[
|
|
902
|
-
{ agent: "
|
|
945
|
+
{ agent: "explorer", task: "Return targets", as: "targets", outputSchema: { type: "object" } },
|
|
903
946
|
{
|
|
904
947
|
expand: { from: { output: "targets", path: "/items" }, key: "/path", maxItems: 4, onEmpty: "skip" },
|
|
905
|
-
parallel: { agent: "
|
|
948
|
+
parallel: { agent: "commentator", task: "Review {item.path}" },
|
|
906
949
|
collect: { as: "reviews" },
|
|
907
950
|
},
|
|
908
951
|
{ agent: "writer", task: "Use {outputs.reviews}" },
|
|
@@ -913,8 +956,7 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
913
956
|
|
|
914
957
|
assert.ok(!result.isError, `chain should succeed: ${JSON.stringify(result.content)}`);
|
|
915
958
|
assert.equal(mockPi.callCount(), 2);
|
|
916
|
-
assert.
|
|
917
|
-
assert.equal(result.details.outputs?.reviews?.structured, undefined);
|
|
959
|
+
assert.deepEqual(result.details.outputs?.reviews?.structured, []);
|
|
918
960
|
assert.equal(result.details.workflowGraph?.nodes[1]?.status, "completed");
|
|
919
961
|
assert.deepEqual(result.details.workflowGraph?.nodes[1]?.children, []);
|
|
920
962
|
});
|
|
@@ -922,15 +964,15 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
922
964
|
it("marks dynamic collect schema failures as failed graph groups", async () => {
|
|
923
965
|
mockPi.onCall({ output: "targets", structuredOutput: { items: [{ path: "src/a.ts" }] } });
|
|
924
966
|
mockPi.onCall({ output: "review-a", structuredOutput: { ok: "a" } });
|
|
925
|
-
const agents = [makeAgent("
|
|
967
|
+
const agents = [makeAgent("explorer"), makeAgent("commentator")];
|
|
926
968
|
|
|
927
969
|
const result = await executeChain(
|
|
928
970
|
makeChainParams(
|
|
929
971
|
[
|
|
930
|
-
{ agent: "
|
|
972
|
+
{ agent: "explorer", task: "Return targets", as: "targets", outputSchema: { type: "object" } },
|
|
931
973
|
{
|
|
932
974
|
expand: { from: { output: "targets", path: "/items" }, key: "/path", maxItems: 4 },
|
|
933
|
-
parallel: { agent: "
|
|
975
|
+
parallel: { agent: "commentator", task: "Review {item.path}", outputSchema: { type: "object" } },
|
|
934
976
|
collect: { as: "reviews", outputSchema: { type: "object" } },
|
|
935
977
|
},
|
|
936
978
|
],
|
|
@@ -951,16 +993,16 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
951
993
|
mockPi.onCall({ output: "review-a", structuredOutput: { ok: "a" } });
|
|
952
994
|
mockPi.onCall({ output: "review-b", structuredOutput: { ok: "b" } });
|
|
953
995
|
mockPi.onCall({ steps: [{ jsonl: [events.assistantMessage("writer started")] }] });
|
|
954
|
-
const agents = [makeAgent("
|
|
996
|
+
const agents = [makeAgent("explorer"), makeAgent("commentator"), makeAgent("writer")];
|
|
955
997
|
let writerUpdateChildren: Array<{ itemKey?: string; status?: string }> | undefined;
|
|
956
998
|
|
|
957
999
|
const result = await executeChain(
|
|
958
1000
|
makeChainParams(
|
|
959
1001
|
[
|
|
960
|
-
{ agent: "
|
|
1002
|
+
{ agent: "explorer", task: "Return targets", as: "targets", outputSchema: { type: "object" } },
|
|
961
1003
|
{
|
|
962
1004
|
expand: { from: { output: "targets", path: "/items" }, key: "/path", maxItems: 4 },
|
|
963
|
-
parallel: { agent: "
|
|
1005
|
+
parallel: { agent: "commentator", task: "Review {item.path}", outputSchema: { type: "object" } },
|
|
964
1006
|
collect: { as: "reviews" },
|
|
965
1007
|
concurrency: 1,
|
|
966
1008
|
},
|
|
@@ -1021,10 +1063,10 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
1021
1063
|
properties: { ok: { type: "boolean" }, note: { type: "string" } },
|
|
1022
1064
|
};
|
|
1023
1065
|
mockPi.onCall({ output: "prose", structuredOutput: { ok: true, note: "captured" } });
|
|
1024
|
-
const agents = [makeAgent("
|
|
1066
|
+
const agents = [makeAgent("builder")];
|
|
1025
1067
|
|
|
1026
1068
|
const result = await executeChain(
|
|
1027
|
-
makeChainParams([{ agent: "
|
|
1069
|
+
makeChainParams([{ agent: "builder", task: "Return structured", outputSchema: schema }], agents),
|
|
1028
1070
|
);
|
|
1029
1071
|
|
|
1030
1072
|
assert.ok(!result.isError);
|
|
@@ -1033,7 +1075,7 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
1033
1075
|
mockPi.reset();
|
|
1034
1076
|
mockPi.onCall({ structuredOutput: { ok: true, note: "tool-only" } });
|
|
1035
1077
|
const structuredOnly = await executeChain(
|
|
1036
|
-
makeChainParams([{ agent: "
|
|
1078
|
+
makeChainParams([{ agent: "builder", task: "Return structured", outputSchema: schema }], agents),
|
|
1037
1079
|
);
|
|
1038
1080
|
assert.ok(!structuredOnly.isError);
|
|
1039
1081
|
assert.deepEqual(structuredOnly.details.results[0]?.structuredOutput, { ok: true, note: "tool-only" });
|
|
@@ -1041,7 +1083,7 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
1041
1083
|
mockPi.reset();
|
|
1042
1084
|
mockPi.onCall({ output: "prose only" });
|
|
1043
1085
|
const missing = await executeChain(
|
|
1044
|
-
makeChainParams([{ agent: "
|
|
1086
|
+
makeChainParams([{ agent: "builder", task: "Return structured", outputSchema: schema }], agents),
|
|
1045
1087
|
);
|
|
1046
1088
|
assert.equal(missing.isError, true);
|
|
1047
1089
|
assert.match(missing.details.results[0]?.error ?? "", /Missing structured_output call/);
|
|
@@ -1049,7 +1091,7 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
1049
1091
|
mockPi.reset();
|
|
1050
1092
|
mockPi.onCall({ output: "invalid", structuredOutput: { ok: "yes" } });
|
|
1051
1093
|
const invalid = await executeChain(
|
|
1052
|
-
makeChainParams([{ agent: "
|
|
1094
|
+
makeChainParams([{ agent: "builder", task: "Return structured", outputSchema: schema, phase: "Validate", label: "Structured builder", as: "result" }], agents),
|
|
1053
1095
|
);
|
|
1054
1096
|
assert.equal(invalid.isError, true);
|
|
1055
1097
|
assert.match(invalid.details.results[0]?.error ?? "", /Structured output validation failed/);
|
|
@@ -1060,11 +1102,11 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
1060
1102
|
|
|
1061
1103
|
it("substitutes {task} in templates", async () => {
|
|
1062
1104
|
mockPi.onCall({ output: "Done" });
|
|
1063
|
-
const agents = [makeAgent("
|
|
1105
|
+
const agents = [makeAgent("builder")];
|
|
1064
1106
|
|
|
1065
1107
|
const result = await executeChain(
|
|
1066
1108
|
makeChainParams(
|
|
1067
|
-
[{ agent: "
|
|
1109
|
+
[{ agent: "builder", task: "Review {task} carefully" }],
|
|
1068
1110
|
agents,
|
|
1069
1111
|
{ task: "the authentication module" },
|
|
1070
1112
|
),
|
|
@@ -1080,11 +1122,11 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
1080
1122
|
|
|
1081
1123
|
it("creates and uses chain_dir", async () => {
|
|
1082
1124
|
mockPi.onCall({ output: "Done" });
|
|
1083
|
-
const agents = [makeAgent("
|
|
1125
|
+
const agents = [makeAgent("builder")];
|
|
1084
1126
|
|
|
1085
1127
|
const result = await executeChain(
|
|
1086
1128
|
makeChainParams(
|
|
1087
|
-
[{ agent: "
|
|
1129
|
+
[{ agent: "builder", task: "Write to {chain_dir}" }],
|
|
1088
1130
|
agents,
|
|
1089
1131
|
),
|
|
1090
1132
|
);
|
|
@@ -1131,9 +1173,7 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
1131
1173
|
assert.equal(result.details.results.length, 2);
|
|
1132
1174
|
assert.equal(result.details.results[0]?.acceptance?.status, "rejected");
|
|
1133
1175
|
assert.equal(result.details.results[0]?.exitCode, 0);
|
|
1134
|
-
assert.
|
|
1135
|
-
assert.ok(result.details.results[1]?.savedOutputPath);
|
|
1136
|
-
assert.equal(fs.readFileSync(result.details.results[1]!.savedOutputPath!, "utf-8"), "Step 2 ran");
|
|
1176
|
+
assert.match(result.details.results[1]?.finalOutput ?? "", /Step 2 ran/);
|
|
1137
1177
|
});
|
|
1138
1178
|
|
|
1139
1179
|
it("agent contract v1 chain can gate progression on acceptance", async () => {
|
|
@@ -1159,13 +1199,13 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
1159
1199
|
|
|
1160
1200
|
it("runs a 3-step chain end-to-end", async () => {
|
|
1161
1201
|
mockPi.onCall({ output: "Step output" });
|
|
1162
|
-
const agents = [makeAgent("
|
|
1202
|
+
const agents = [makeAgent("explorer"), makeAgent("architect"), makeAgent("executor")];
|
|
1163
1203
|
|
|
1164
1204
|
const result = await executeChain(
|
|
1165
1205
|
makeChainParams(
|
|
1166
1206
|
[
|
|
1167
|
-
{ agent: "
|
|
1168
|
-
{ agent: "
|
|
1207
|
+
{ agent: "explorer", task: "Survey the codebase" },
|
|
1208
|
+
{ agent: "architect" },
|
|
1169
1209
|
{ agent: "executor" },
|
|
1170
1210
|
],
|
|
1171
1211
|
agents,
|
|
@@ -1177,16 +1217,16 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
1177
1217
|
assert.ok(result.details.results.every((r) => r.exitCode === 0));
|
|
1178
1218
|
});
|
|
1179
1219
|
|
|
1180
|
-
it("runs a 40-step alternating
|
|
1220
|
+
it("runs a 40-step alternating builder and commentator chain", async () => {
|
|
1181
1221
|
const chainLength = 40;
|
|
1182
1222
|
for (let i = 0; i < chainLength; i++) {
|
|
1183
1223
|
mockPi.onCall({ output: `step-${i}-output` });
|
|
1184
1224
|
}
|
|
1185
1225
|
const chain = Array.from({ length: chainLength }, (_, i): TestSequentialStep => ({
|
|
1186
|
-
agent: i % 2 === 0 ? "
|
|
1187
|
-
...(i === 0 ? { task: "Start long
|
|
1226
|
+
agent: i % 2 === 0 ? "builder" : "commentator",
|
|
1227
|
+
...(i === 0 ? { task: "Start long builder/commentator chain" } : {}),
|
|
1188
1228
|
}));
|
|
1189
|
-
const agents = [makeAgent("
|
|
1229
|
+
const agents = [makeAgent("builder"), makeAgent("commentator")];
|
|
1190
1230
|
|
|
1191
1231
|
const result = await executeChain(makeChainParams(chain, agents));
|
|
1192
1232
|
|
|
@@ -1196,7 +1236,7 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
1196
1236
|
assert.equal(result.details.totalSteps, chainLength);
|
|
1197
1237
|
assert.equal(result.details.chainAgents?.length, chainLength);
|
|
1198
1238
|
assert.equal(result.details.workflowGraph?.nodes.length, chainLength);
|
|
1199
|
-
assert.equal(result.details.workflowGraph?.nodes.at(-1)?.agent, "
|
|
1239
|
+
assert.equal(result.details.workflowGraph?.nodes.at(-1)?.agent, "commentator");
|
|
1200
1240
|
assert.equal(result.details.workflowGraph?.nodes.at(-1)?.flatIndex, chainLength - 1);
|
|
1201
1241
|
assert.ok(result.details.results.every((r) => r.exitCode === 0));
|
|
1202
1242
|
assert.deepEqual(
|
|
@@ -1205,18 +1245,17 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
1205
1245
|
);
|
|
1206
1246
|
|
|
1207
1247
|
const finalTaskArg = readCallArgs(chainLength - 1).at(-1) ?? "";
|
|
1208
|
-
assert.match(finalTaskArg, /
|
|
1209
|
-
assert.doesNotMatch(finalTaskArg, /step-38-output/);
|
|
1248
|
+
assert.match(finalTaskArg, /step-38-output/);
|
|
1210
1249
|
assert.doesNotMatch(finalTaskArg, /step-37-output/);
|
|
1211
1250
|
assert.match(result.content[0]?.text ?? "", /40 steps/);
|
|
1212
1251
|
});
|
|
1213
1252
|
|
|
1214
1253
|
it("returns error for unknown agent in chain", async () => {
|
|
1215
|
-
const agents = [makeAgent("
|
|
1254
|
+
const agents = [makeAgent("explorer")];
|
|
1216
1255
|
|
|
1217
1256
|
const result = await executeChain(
|
|
1218
1257
|
makeChainParams(
|
|
1219
|
-
[{ agent: "
|
|
1258
|
+
[{ agent: "explorer", task: "Start" }, { agent: "nonexistent" }],
|
|
1220
1259
|
agents,
|
|
1221
1260
|
),
|
|
1222
1261
|
);
|
|
@@ -1262,12 +1301,12 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
1262
1301
|
|
|
1263
1302
|
it("uses custom chainDir when provided", async () => {
|
|
1264
1303
|
mockPi.onCall({ output: "Done" });
|
|
1265
|
-
const agents = [makeAgent("
|
|
1304
|
+
const agents = [makeAgent("builder")];
|
|
1266
1305
|
const customChainDir = path.join(tempDir, "my-chain");
|
|
1267
1306
|
|
|
1268
1307
|
const result = await executeChain(
|
|
1269
1308
|
makeChainParams(
|
|
1270
|
-
[{ agent: "
|
|
1309
|
+
[{ agent: "builder", task: "Use {chain_dir}" }],
|
|
1271
1310
|
agents,
|
|
1272
1311
|
{ chainDir: customChainDir },
|
|
1273
1312
|
),
|
|
@@ -1284,20 +1323,18 @@ describe("chain execution — sequential", { skip: !available ? "pi packages not
|
|
|
1284
1323
|
delete process.env.SELESAI_SUBAGENT_MAX_DEPTH;
|
|
1285
1324
|
try {
|
|
1286
1325
|
mockPi.onCall({ echoEnv: ["SELESAI_SUBAGENT_DEPTH", "SELESAI_SUBAGENT_MAX_DEPTH"] });
|
|
1287
|
-
const agents = [makeAgent("
|
|
1326
|
+
const agents = [makeAgent("builder", { maxSubagentDepth: 1 })];
|
|
1288
1327
|
|
|
1289
1328
|
const result = await executeChain(
|
|
1290
1329
|
makeChainParams(
|
|
1291
|
-
[{ agent: "
|
|
1330
|
+
[{ agent: "builder", task: "Inspect env" }],
|
|
1292
1331
|
agents,
|
|
1293
1332
|
{ maxSubagentDepth: 3 },
|
|
1294
1333
|
),
|
|
1295
1334
|
);
|
|
1296
1335
|
|
|
1297
1336
|
assert.ok(!result.isError);
|
|
1298
|
-
|
|
1299
|
-
assert.ok(depthChild.savedOutputPath);
|
|
1300
|
-
assert.deepEqual(JSON.parse(fs.readFileSync(depthChild.savedOutputPath, "utf-8")), {
|
|
1337
|
+
assert.deepEqual(JSON.parse(result.details.results[0].finalOutput ?? "{}"), {
|
|
1301
1338
|
SELESAI_SUBAGENT_DEPTH: "1",
|
|
1302
1339
|
SELESAI_SUBAGENT_MAX_DEPTH: "1",
|
|
1303
1340
|
});
|
|
@@ -1379,15 +1416,15 @@ describe("chain execution — parallel steps", { skip: !available ? "pi packages
|
|
|
1379
1416
|
|
|
1380
1417
|
it("runs parallel tasks within a chain step", async () => {
|
|
1381
1418
|
mockPi.onCall({ output: "Parallel task done" });
|
|
1382
|
-
const agents = [makeAgent("
|
|
1419
|
+
const agents = [makeAgent("commentator-a"), makeAgent("commentator-b")];
|
|
1383
1420
|
|
|
1384
1421
|
const result = await executeChain(
|
|
1385
1422
|
makeChainParams(
|
|
1386
1423
|
[
|
|
1387
1424
|
{
|
|
1388
1425
|
parallel: [
|
|
1389
|
-
{ agent: "
|
|
1390
|
-
{ agent: "
|
|
1426
|
+
{ agent: "commentator-a", task: "Review auth module" },
|
|
1427
|
+
{ agent: "commentator-b", task: "Review data layer" },
|
|
1391
1428
|
],
|
|
1392
1429
|
},
|
|
1393
1430
|
],
|
|
@@ -1400,6 +1437,31 @@ describe("chain execution — parallel steps", { skip: !available ? "pi packages
|
|
|
1400
1437
|
assert.deepEqual(result.details.results.map((row) => row.index), [0, 1]);
|
|
1401
1438
|
});
|
|
1402
1439
|
|
|
1440
|
+
it("applies global permissions to foreground static parallel children", async () => {
|
|
1441
|
+
mockPi.onCall({ echoEnv: [PERMISSION_POLICY_ENV, PERMISSION_AUDIT_PATH_ENV] });
|
|
1442
|
+
mockPi.onCall({ echoEnv: [PERMISSION_POLICY_ENV, PERMISSION_AUDIT_PATH_ENV] });
|
|
1443
|
+
const agents = [makeAgent("commentator-a"), makeAgent("commentator-b")];
|
|
1444
|
+
|
|
1445
|
+
const result = await executeChain!(makeChainParams(
|
|
1446
|
+
[{
|
|
1447
|
+
parallel: [
|
|
1448
|
+
{ agent: "commentator-a", task: "Review A" },
|
|
1449
|
+
{ agent: "commentator-b", task: "Review B" },
|
|
1450
|
+
],
|
|
1451
|
+
}],
|
|
1452
|
+
agents,
|
|
1453
|
+
{ permissions: { rules: { write: "ask" } } },
|
|
1454
|
+
));
|
|
1455
|
+
|
|
1456
|
+
assert.equal(result.isError, undefined);
|
|
1457
|
+
assert.equal(result.details.results.length, 2);
|
|
1458
|
+
for (const child of result.details.results) {
|
|
1459
|
+
const env = JSON.parse(child.finalOutput ?? "{}") as Record<string, string | null>;
|
|
1460
|
+
assert.equal(env[PERMISSION_POLICY_ENV], JSON.stringify({ write: "ask" }));
|
|
1461
|
+
assert.match(env[PERMISSION_AUDIT_PATH_ENV] ?? "", /permission-audit\.jsonl$/);
|
|
1462
|
+
}
|
|
1463
|
+
});
|
|
1464
|
+
|
|
1403
1465
|
it("aggregates worktree handoffs across foreground chain groups", { skip: process.platform === "win32" ? "worktree paths differ on Windows" : undefined }, async () => {
|
|
1404
1466
|
git(["init"]);
|
|
1405
1467
|
git(["config", "user.email", "test@example.com"]);
|
|
@@ -1412,8 +1474,8 @@ describe("chain execution — parallel steps", { skip: !available ? "pi packages
|
|
|
1412
1474
|
const artifactsDir = path.join(tempDir, "artifacts");
|
|
1413
1475
|
const result = await executeChain(
|
|
1414
1476
|
makeChainParams(
|
|
1415
|
-
[{ parallel: [{ agent: "
|
|
1416
|
-
[makeAgent("
|
|
1477
|
+
[{ parallel: [{ agent: "commentator-a", task: "Review in isolation" }], worktree: true }],
|
|
1478
|
+
[makeAgent("commentator-a")],
|
|
1417
1479
|
{ runId, artifactsDir },
|
|
1418
1480
|
),
|
|
1419
1481
|
);
|
|
@@ -1426,7 +1488,7 @@ describe("chain execution — parallel steps", { skip: !available ? "pi packages
|
|
|
1426
1488
|
groups: Array<{ stepIndex: number; children: Array<{ agent: string; patch: { path: string } }>; cleanup: { state: string } }>;
|
|
1427
1489
|
};
|
|
1428
1490
|
assert.equal(handoff.groups[0]!.stepIndex, 0);
|
|
1429
|
-
assert.equal(handoff.groups[0]!.children[0]!.agent, "
|
|
1491
|
+
assert.equal(handoff.groups[0]!.children[0]!.agent, "commentator-a");
|
|
1430
1492
|
assert.equal(handoff.groups[0]!.cleanup.state, "complete");
|
|
1431
1493
|
assert.equal(fs.existsSync(handoff.groups[0]!.children[0]!.patch.path), true);
|
|
1432
1494
|
assert.match(handoff.groups[0]!.children[0]!.patch.path, /worktree-diffs\/foreground-chain-handoff\/step-0\//);
|
|
@@ -1434,15 +1496,15 @@ describe("chain execution — parallel steps", { skip: !available ? "pi packages
|
|
|
1434
1496
|
|
|
1435
1497
|
it("aggregates parallel outputs for next sequential step", async () => {
|
|
1436
1498
|
mockPi.onCall({ output: "Review findings here" });
|
|
1437
|
-
const agents = [makeAgent("
|
|
1499
|
+
const agents = [makeAgent("commentator-a"), makeAgent("commentator-b"), makeAgent("synthesizer")];
|
|
1438
1500
|
|
|
1439
1501
|
const result = await executeChain(
|
|
1440
1502
|
makeChainParams(
|
|
1441
1503
|
[
|
|
1442
1504
|
{
|
|
1443
1505
|
parallel: [
|
|
1444
|
-
{ agent: "
|
|
1445
|
-
{ agent: "
|
|
1506
|
+
{ agent: "commentator-a", task: "Review security" },
|
|
1507
|
+
{ agent: "commentator-b", task: "Review performance" },
|
|
1446
1508
|
],
|
|
1447
1509
|
},
|
|
1448
1510
|
{ agent: "synthesizer" },
|
|
@@ -1455,12 +1517,12 @@ describe("chain execution — parallel steps", { skip: !available ? "pi packages
|
|
|
1455
1517
|
assert.equal(result.details.results.length, 3);
|
|
1456
1518
|
const synthTask = result.details.results[2].task;
|
|
1457
1519
|
assert.ok(
|
|
1458
|
-
synthTask.includes("=== Parallel Task 1 (
|
|
1459
|
-
"synthesizer should include
|
|
1520
|
+
synthTask.includes("=== Parallel Task 1 (commentator-a) ==="),
|
|
1521
|
+
"synthesizer should include commentator-a output block",
|
|
1460
1522
|
);
|
|
1461
1523
|
assert.ok(
|
|
1462
|
-
synthTask.includes("=== Parallel Task 2 (
|
|
1463
|
-
"synthesizer should include
|
|
1524
|
+
synthTask.includes("=== Parallel Task 2 (commentator-b) ==="),
|
|
1525
|
+
"synthesizer should include commentator-b output block",
|
|
1464
1526
|
);
|
|
1465
1527
|
});
|
|
1466
1528
|
|
|
@@ -1487,9 +1549,8 @@ describe("chain execution — parallel steps", { skip: !available ? "pi packages
|
|
|
1487
1549
|
|
|
1488
1550
|
assert.ok(!result.isError);
|
|
1489
1551
|
const finalTask = readCallArgs(2).at(-1) ?? "";
|
|
1490
|
-
assert.match(finalTask, /
|
|
1491
|
-
assert.
|
|
1492
|
-
assert.doesNotMatch(finalTask, /Beta named output/);
|
|
1552
|
+
assert.match(finalTask, /Alpha named output/);
|
|
1553
|
+
assert.match(finalTask, /Beta named output/);
|
|
1493
1554
|
});
|
|
1494
1555
|
|
|
1495
1556
|
it("funnels an initial parallel step through one agent, then fans the funnel output back out", async () => {
|
|
@@ -1498,15 +1559,15 @@ describe("chain execution — parallel steps", { skip: !available ? "pi packages
|
|
|
1498
1559
|
mockPi.onCall({ matchArgIncludes: "Synthesize:", output: "Funnel synthesis" });
|
|
1499
1560
|
mockPi.onCall({ matchArgIncludes: "Review funnel A:", output: "Reviewer A done" });
|
|
1500
1561
|
mockPi.onCall({ matchArgIncludes: "Review funnel B:", output: "Reviewer B done" });
|
|
1501
|
-
const agents = [makeAgent("
|
|
1562
|
+
const agents = [makeAgent("explorer-a"), makeAgent("explorer-b"), makeAgent("synthesizer"), makeAgent("review-a"), makeAgent("review-b")];
|
|
1502
1563
|
|
|
1503
1564
|
const result = await executeChain(
|
|
1504
1565
|
makeChainParams(
|
|
1505
1566
|
[
|
|
1506
1567
|
{
|
|
1507
1568
|
parallel: [
|
|
1508
|
-
{ agent: "
|
|
1509
|
-
{ agent: "
|
|
1569
|
+
{ agent: "explorer-a", task: "Scout API" },
|
|
1570
|
+
{ agent: "explorer-b", task: "Scout UI" },
|
|
1510
1571
|
],
|
|
1511
1572
|
},
|
|
1512
1573
|
{ agent: "synthesizer", task: "Synthesize:\n{previous}" },
|
|
@@ -1522,18 +1583,17 @@ describe("chain execution — parallel steps", { skip: !available ? "pi packages
|
|
|
1522
1583
|
);
|
|
1523
1584
|
|
|
1524
1585
|
assert.ok(!result.isError, `should succeed: ${JSON.stringify(result.content)}`);
|
|
1525
|
-
assert.deepEqual(result.details.results.map((entry) => entry.agent), ["
|
|
1586
|
+
assert.deepEqual(result.details.results.map((entry) => entry.agent), ["explorer-a", "explorer-b", "synthesizer", "review-a", "review-b"]);
|
|
1526
1587
|
assert.equal(result.details.totalSteps, 3);
|
|
1527
1588
|
const funnelTask = readCallArgsMatching("Synthesize:").at(-1) ?? "";
|
|
1528
|
-
assert.match(funnelTask, /=== Parallel Task 1 \(
|
|
1529
|
-
assert.match(funnelTask,
|
|
1530
|
-
assert.match(funnelTask,
|
|
1531
|
-
assert.
|
|
1532
|
-
assert.doesNotMatch(funnelTask, /Scout B findings/);
|
|
1589
|
+
assert.match(funnelTask, /=== Parallel Task 1 \(explorer-a\) ===/);
|
|
1590
|
+
assert.match(funnelTask, /Scout A findings/);
|
|
1591
|
+
assert.match(funnelTask, /=== Parallel Task 2 \(explorer-b\) ===/);
|
|
1592
|
+
assert.match(funnelTask, /Scout B findings/);
|
|
1533
1593
|
const fanoutTaskA = readCallArgsMatching("Review funnel A:").at(-1) ?? "";
|
|
1534
1594
|
const fanoutTaskB = readCallArgsMatching("Review funnel B:").at(-1) ?? "";
|
|
1535
|
-
assert.match(fanoutTaskA, /Review funnel A:\
|
|
1536
|
-
assert.match(fanoutTaskB, /Review funnel B:\
|
|
1595
|
+
assert.match(fanoutTaskA, /Review funnel A:\nFunnel synthesis/);
|
|
1596
|
+
assert.match(fanoutTaskB, /Review funnel B:\nFunnel synthesis/);
|
|
1537
1597
|
assert.equal(result.details.workflowGraph?.nodes[0]?.kind, "parallel-group");
|
|
1538
1598
|
assert.equal(result.details.workflowGraph?.nodes[1]?.kind, "step");
|
|
1539
1599
|
assert.equal(result.details.workflowGraph?.nodes[2]?.kind, "parallel-group");
|
|
@@ -1541,15 +1601,15 @@ describe("chain execution — parallel steps", { skip: !available ? "pi packages
|
|
|
1541
1601
|
|
|
1542
1602
|
it("aggregates file-only parallel outputs as file references for the next step", async () => {
|
|
1543
1603
|
mockPi.onCall({ output: "full parallel chain output\nwith details" });
|
|
1544
|
-
const agents = [makeAgent("
|
|
1604
|
+
const agents = [makeAgent("commentator-a"), makeAgent("commentator-b"), makeAgent("synthesizer")];
|
|
1545
1605
|
|
|
1546
1606
|
const result = await executeChain(
|
|
1547
1607
|
makeChainParams(
|
|
1548
1608
|
[
|
|
1549
1609
|
{
|
|
1550
1610
|
parallel: [
|
|
1551
|
-
{ agent: "
|
|
1552
|
-
{ agent: "
|
|
1611
|
+
{ agent: "commentator-a", task: "Review A", output: "a.md", outputMode: "file-only" },
|
|
1612
|
+
{ agent: "commentator-b", task: "Review B", output: "b.md", outputMode: "file-only" },
|
|
1553
1613
|
],
|
|
1554
1614
|
},
|
|
1555
1615
|
{ agent: "synthesizer" },
|
|
@@ -1569,14 +1629,14 @@ describe("chain execution — parallel steps", { skip: !available ? "pi packages
|
|
|
1569
1629
|
});
|
|
1570
1630
|
|
|
1571
1631
|
it("rejects chain parallel file-only output without spawning siblings", async () => {
|
|
1572
|
-
const agents = [makeAgent("
|
|
1632
|
+
const agents = [makeAgent("commentator-a"), makeAgent("commentator-b")];
|
|
1573
1633
|
|
|
1574
1634
|
const result = await executeChain(
|
|
1575
1635
|
makeChainParams(
|
|
1576
1636
|
[{
|
|
1577
1637
|
parallel: [
|
|
1578
|
-
{ agent: "
|
|
1579
|
-
{ agent: "
|
|
1638
|
+
{ agent: "commentator-a", task: "Review A", outputMode: "file-only" },
|
|
1639
|
+
{ agent: "commentator-b", task: "Review B", output: "b.md" },
|
|
1580
1640
|
],
|
|
1581
1641
|
}],
|
|
1582
1642
|
agents,
|
|
@@ -1719,12 +1779,12 @@ describe("chain execution — parallel steps", { skip: !available ? "pi packages
|
|
|
1719
1779
|
|
|
1720
1780
|
it("sequential → parallel → sequential (mixed chain)", async () => {
|
|
1721
1781
|
mockPi.onCall({ output: "Step complete" });
|
|
1722
|
-
const agents = [makeAgent("
|
|
1782
|
+
const agents = [makeAgent("explorer"), makeAgent("rev-a"), makeAgent("rev-b"), makeAgent("writer")];
|
|
1723
1783
|
|
|
1724
1784
|
const result = await executeChain(
|
|
1725
1785
|
makeChainParams(
|
|
1726
1786
|
[
|
|
1727
|
-
{ agent: "
|
|
1787
|
+
{ agent: "explorer", task: "Initial scan" },
|
|
1728
1788
|
{
|
|
1729
1789
|
parallel: [
|
|
1730
1790
|
{ agent: "rev-a", task: "Deep review A" },
|