@selesai/code 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/README.md +1 -1
- package/dist/bun/cli.d.ts +0 -1
- package/dist/bun/cli.js +0 -1
- package/dist/bun/register-bedrock.d.ts +0 -1
- package/dist/bun/register-bedrock.js +0 -1
- package/dist/bun/restore-sandbox-env.d.ts +0 -1
- package/dist/bun/restore-sandbox-env.js +0 -1
- package/dist/cli/args.d.ts +0 -1
- package/dist/cli/args.js +0 -1
- package/dist/cli/config-selector.d.ts +0 -1
- package/dist/cli/config-selector.js +0 -1
- package/dist/cli/credential-print.d.ts +0 -1
- package/dist/cli/credential-print.js +0 -1
- package/dist/cli/file-processor.d.ts +0 -1
- package/dist/cli/file-processor.js +0 -1
- package/dist/cli/initial-message.d.ts +0 -1
- package/dist/cli/initial-message.js +0 -1
- package/dist/cli/list-models.d.ts +0 -1
- package/dist/cli/list-models.js +0 -1
- package/dist/cli/project-trust.d.ts +0 -1
- package/dist/cli/project-trust.js +0 -1
- package/dist/cli/session-picker.d.ts +0 -1
- package/dist/cli/session-picker.js +0 -1
- package/dist/cli/startup-ui.d.ts +0 -1
- package/dist/cli/startup-ui.js +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/core/agent-session-auto-handoff.test.d.ts +0 -1
- package/dist/core/agent-session-auto-handoff.test.js +0 -1
- package/dist/core/agent-session-runtime.d.ts +0 -1
- package/dist/core/agent-session-runtime.js +0 -1
- package/dist/core/agent-session-services.d.ts +0 -1
- package/dist/core/agent-session-services.js +0 -1
- package/dist/core/agent-session-skill-block.test.d.ts +0 -1
- package/dist/core/agent-session-skill-block.test.js +0 -1
- package/dist/core/agent-session.d.ts +0 -1
- package/dist/core/agent-session.js +0 -1
- package/dist/core/agents.d.ts +0 -1
- package/dist/core/agents.js +0 -1
- package/dist/core/auth-guidance.d.ts +0 -1
- package/dist/core/auth-guidance.js +0 -1
- package/dist/core/auth-storage.d.ts +0 -1
- package/dist/core/auth-storage.js +0 -1
- package/dist/core/bash-executor.d.ts +0 -1
- package/dist/core/bash-executor.js +0 -1
- package/dist/core/built-in-extensions.d.ts +0 -1
- package/dist/core/built-in-extensions.js +0 -1
- package/dist/core/cache-stats.d.ts +0 -1
- package/dist/core/cache-stats.js +0 -1
- package/dist/core/compaction/branch-summarization.d.ts +0 -1
- package/dist/core/compaction/branch-summarization.js +0 -1
- package/dist/core/compaction/compaction.d.ts +0 -1
- package/dist/core/compaction/compaction.js +0 -1
- package/dist/core/compaction/index.d.ts +0 -1
- package/dist/core/compaction/index.js +0 -1
- package/dist/core/compaction/utils.d.ts +0 -1
- package/dist/core/compaction/utils.js +0 -1
- package/dist/core/defaults.d.ts +0 -1
- package/dist/core/defaults.js +0 -1
- package/dist/core/diagnostics.d.ts +0 -1
- package/dist/core/diagnostics.js +0 -1
- package/dist/core/event-bus.d.ts +0 -1
- package/dist/core/event-bus.js +0 -1
- package/dist/core/exec.d.ts +0 -1
- package/dist/core/exec.js +0 -1
- package/dist/core/experimental.d.ts +0 -1
- package/dist/core/experimental.js +0 -1
- package/dist/core/export-html/ansi-to-html.d.ts +0 -1
- package/dist/core/export-html/ansi-to-html.js +0 -1
- package/dist/core/export-html/index.d.ts +0 -1
- package/dist/core/export-html/index.js +0 -1
- package/dist/core/export-html/tool-renderer.d.ts +0 -1
- package/dist/core/export-html/tool-renderer.js +0 -1
- package/dist/core/extensions/index.d.ts +0 -1
- package/dist/core/extensions/index.js +0 -1
- package/dist/core/extensions/loader.d.ts +0 -1
- package/dist/core/extensions/loader.js +0 -1
- package/dist/core/extensions/runner.d.ts +0 -1
- package/dist/core/extensions/runner.js +0 -1
- package/dist/core/extensions/types.d.ts +0 -1
- package/dist/core/extensions/types.js +0 -1
- package/dist/core/extensions/wrapper.d.ts +0 -1
- package/dist/core/extensions/wrapper.js +0 -1
- package/dist/core/footer-data-provider.d.ts +0 -1
- package/dist/core/footer-data-provider.js +0 -1
- package/dist/core/git-command.d.ts +0 -1
- package/dist/core/git-command.js +0 -1
- package/dist/core/http-dispatcher.d.ts +0 -1
- package/dist/core/http-dispatcher.js +0 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -1
- package/dist/core/keybindings.d.ts +0 -1
- package/dist/core/keybindings.js +0 -1
- package/dist/core/llama/client.d.ts +0 -1
- package/dist/core/llama/client.js +0 -1
- package/dist/core/llama/huggingface.d.ts +0 -1
- package/dist/core/llama/huggingface.js +0 -1
- package/dist/core/llama/index.d.ts +0 -1
- package/dist/core/llama/index.js +0 -1
- package/dist/core/llama/provider.d.ts +0 -1
- package/dist/core/llama/provider.js +0 -1
- package/dist/core/llama/ui.d.ts +0 -1
- package/dist/core/llama/ui.js +0 -1
- package/dist/core/messages.d.ts +0 -1
- package/dist/core/messages.js +0 -1
- package/dist/core/model-config.d.ts +0 -1
- package/dist/core/model-config.js +0 -1
- package/dist/core/model-registry.d.ts +0 -1
- package/dist/core/model-registry.js +0 -1
- package/dist/core/model-resolver.d.ts +0 -1
- package/dist/core/model-resolver.js +0 -1
- package/dist/core/model-runtime.d.ts +0 -1
- package/dist/core/model-runtime.js +0 -1
- package/dist/core/models-store.d.ts +0 -1
- package/dist/core/models-store.js +0 -1
- package/dist/core/output-guard.d.ts +0 -1
- package/dist/core/output-guard.js +0 -1
- package/dist/core/package-manager.d.ts +0 -1
- package/dist/core/package-manager.js +0 -1
- package/dist/core/package-manager.test.d.ts +0 -1
- package/dist/core/package-manager.test.js +0 -1
- package/dist/core/project-trust.d.ts +0 -1
- package/dist/core/project-trust.js +0 -1
- package/dist/core/prompt-templates.d.ts +0 -1
- package/dist/core/prompt-templates.js +0 -1
- package/dist/core/provider-attribution.d.ts +0 -1
- package/dist/core/provider-attribution.js +0 -1
- package/dist/core/provider-composer.d.ts +0 -1
- package/dist/core/provider-composer.js +0 -1
- package/dist/core/radius.d.ts +0 -1
- package/dist/core/radius.js +0 -1
- package/dist/core/remote-catalog-provider.d.ts +0 -1
- package/dist/core/remote-catalog-provider.js +0 -1
- package/dist/core/resolve-config-value.d.ts +0 -1
- package/dist/core/resolve-config-value.js +0 -1
- package/dist/core/resource-loader.d.ts +0 -1
- package/dist/core/resource-loader.js +0 -1
- package/dist/core/runtime-credentials.d.ts +0 -1
- package/dist/core/runtime-credentials.js +0 -1
- package/dist/core/sdk.d.ts +0 -1
- package/dist/core/sdk.js +0 -1
- package/dist/core/session-cwd.d.ts +0 -1
- package/dist/core/session-cwd.js +0 -1
- package/dist/core/session-manager.d.ts +0 -1
- package/dist/core/session-manager.js +0 -1
- package/dist/core/settings-manager-auto-handoff.test.d.ts +0 -1
- package/dist/core/settings-manager-auto-handoff.test.js +0 -1
- package/dist/core/settings-manager.d.ts +0 -4
- package/dist/core/settings-manager.js +0 -12
- package/dist/core/skills.d.ts +0 -1
- package/dist/core/skills.js +0 -1
- package/dist/core/slash-commands.d.ts +0 -1
- package/dist/core/slash-commands.js +0 -1
- package/dist/core/source-info.d.ts +0 -1
- package/dist/core/source-info.js +0 -1
- package/dist/core/system-prompt.d.ts +0 -1
- package/dist/core/system-prompt.js +0 -1
- package/dist/core/system-prompt.test.d.ts +0 -1
- package/dist/core/system-prompt.test.js +0 -1
- package/dist/core/telemetry.d.ts +0 -1
- package/dist/core/telemetry.js +0 -1
- package/dist/core/timings.d.ts +0 -1
- package/dist/core/timings.js +0 -1
- package/dist/core/tools/bash.d.ts +0 -1
- package/dist/core/tools/bash.js +0 -1
- package/dist/core/tools/edit-diff.d.ts +0 -1
- package/dist/core/tools/edit-diff.js +0 -1
- package/dist/core/tools/edit.d.ts +0 -1
- package/dist/core/tools/edit.js +0 -1
- package/dist/core/tools/file-mutation-queue.d.ts +0 -1
- package/dist/core/tools/file-mutation-queue.js +0 -1
- package/dist/core/tools/find.d.ts +0 -1
- package/dist/core/tools/find.js +0 -1
- package/dist/core/tools/grep.d.ts +0 -1
- package/dist/core/tools/grep.js +0 -1
- package/dist/core/tools/index.d.ts +0 -1
- package/dist/core/tools/index.js +0 -1
- package/dist/core/tools/ls.d.ts +0 -1
- package/dist/core/tools/ls.js +0 -1
- package/dist/core/tools/output-accumulator.d.ts +0 -1
- package/dist/core/tools/output-accumulator.js +0 -1
- package/dist/core/tools/path-utils.d.ts +0 -1
- package/dist/core/tools/path-utils.js +0 -1
- package/dist/core/tools/read.d.ts +0 -1
- package/dist/core/tools/read.js +0 -1
- package/dist/core/tools/render-utils.d.ts +0 -1
- package/dist/core/tools/render-utils.js +0 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +0 -1
- package/dist/core/tools/tool-definition-wrapper.js +0 -1
- package/dist/core/tools/truncate.d.ts +0 -1
- package/dist/core/tools/truncate.js +0 -1
- package/dist/core/tools/write.d.ts +0 -1
- package/dist/core/tools/write.js +0 -1
- package/dist/core/trust-manager.d.ts +0 -1
- package/dist/core/trust-manager.js +0 -1
- package/dist/core/usage-totals.d.ts +0 -1
- package/dist/core/usage-totals.js +0 -1
- package/dist/defaults/models.json +8 -0
- package/dist/defaults/settings.json +6 -7
- package/dist/extensions/inline-skills.test.ts +13 -13
- package/dist/extensions/inline-skills.ts +6 -6
- package/dist/extensions/pi-subagents/CHANGELOG.md +89 -12
- package/dist/extensions/pi-subagents/README.md +339 -604
- package/dist/extensions/pi-subagents/package-lock.json +190 -2079
- package/dist/extensions/pi-subagents/package.json +13 -5
- package/dist/extensions/pi-subagents/prompts/parallel-context-build.md +1 -1
- package/dist/extensions/pi-subagents/prompts/parallel-handoff-plan.md +1 -1
- package/dist/extensions/pi-subagents/prompts/review-loop.md +1 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +10 -10
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +32 -43
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +106 -105
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +3 -3
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +28 -35
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +167 -124
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +19 -0
- package/dist/extensions/pi-subagents/src/agents/agents.ts +163 -75
- package/dist/extensions/pi-subagents/src/agents/chain-serializer.ts +10 -7
- package/dist/extensions/pi-subagents/src/agents/frontmatter.ts +5 -3
- package/dist/extensions/pi-subagents/src/agents/identity.ts +1 -1
- package/dist/extensions/pi-subagents/src/agents/proactive-skills.ts +14 -11
- package/dist/extensions/pi-subagents/src/agents/skills.ts +23 -6
- package/dist/extensions/pi-subagents/src/agents/task-aware-routing.ts +8 -1
- package/dist/extensions/pi-subagents/src/api/control-channel.ts +4 -0
- package/dist/extensions/pi-subagents/src/api/delegation.ts +26 -194
- package/dist/extensions/pi-subagents/src/api/external-runs.ts +129 -0
- package/dist/extensions/pi-subagents/src/api/intercom-bridge.ts +3 -0
- package/dist/extensions/pi-subagents/src/api/pi-args.ts +5 -0
- package/dist/extensions/pi-subagents/src/api/preflight.ts +4 -4
- package/dist/extensions/pi-subagents/src/api/shared-types.ts +19 -0
- package/dist/extensions/pi-subagents/src/extension/config.ts +10 -0
- package/dist/extensions/pi-subagents/src/extension/control-notices.ts +5 -39
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +10 -9
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +7 -4
- package/dist/extensions/pi-subagents/src/extension/index.ts +243 -77
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +18 -6
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +50 -39
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +36 -103
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +229 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/client.ts +130 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +141 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +154 -0
- package/dist/extensions/pi-subagents/src/integrations/herdr-status.ts +330 -0
- package/dist/extensions/pi-subagents/src/intercom/intercom-bridge.ts +3 -2
- package/dist/extensions/pi-subagents/src/intercom/result-intercom.ts +5 -1
- package/dist/extensions/pi-subagents/src/missions/actions.ts +372 -0
- package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +314 -0
- package/dist/extensions/pi-subagents/src/missions/store.ts +442 -0
- package/dist/extensions/pi-subagents/src/missions/types.ts +135 -0
- package/dist/extensions/pi-subagents/src/policy/authority.ts +46 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +32 -6
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +103 -72
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +10 -2
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +6 -6
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +29 -1
- package/dist/extensions/pi-subagents/src/runs/background/auto-drain.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +3 -2
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +9 -7
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +3 -4
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +3 -28
- package/dist/extensions/pi-subagents/src/runs/background/process-terminal.ts +5 -5
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +18 -68
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +35 -8
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +602 -375
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +612 -464
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +50 -9
- package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +253 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +12 -4
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-clarify.ts +8 -4
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +74 -102
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +21 -22
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +1050 -396
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +44 -18
- package/dist/extensions/pi-subagents/src/runs/shared/capability-ceiling.ts +0 -1
- package/dist/extensions/pi-subagents/src/runs/shared/child-protocol.ts +302 -22
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +130 -0
- package/dist/extensions/pi-subagents/src/runs/shared/long-running-guard.ts +42 -1
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +59 -5
- package/dist/extensions/pi-subagents/src/runs/shared/nested-render.ts +9 -4
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +86 -2
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +11 -2
- package/dist/extensions/pi-subagents/src/runs/shared/permissions.ts +95 -0
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +11 -1
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +15 -6
- package/dist/extensions/pi-subagents/src/runs/shared/run-history.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +9 -63
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +37 -6
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-startup-retry.ts +5 -2
- package/dist/extensions/pi-subagents/src/runs/shared/task-intent.ts +2 -23
- package/dist/extensions/pi-subagents/src/runs/shared/turn-budget.ts +6 -6
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +124 -13
- package/dist/extensions/pi-subagents/src/shared/accessible-dir.ts +29 -7
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +18 -1
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +3 -2
- package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +1 -0
- package/dist/extensions/pi-subagents/src/shared/settings.ts +10 -0
- package/dist/extensions/pi-subagents/src/shared/types.ts +158 -55
- package/dist/extensions/pi-subagents/src/shared/utils.ts +16 -66
- package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +33 -199
- package/dist/extensions/pi-subagents/src/slash/delegation-request.ts +43 -126
- package/dist/extensions/pi-subagents/src/slash/inline-subagents.ts +103 -0
- package/dist/extensions/pi-subagents/src/slash/prompt-template-bridge.ts +158 -205
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +22 -58
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +14 -0
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +44 -642
- package/dist/extensions/pi-subagents/src/slash/subagents-admin.ts +18 -14
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +156 -21
- package/dist/extensions/pi-subagents/src/tui/fleet-transcript.ts +110 -5
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +60 -24
- package/dist/extensions/pi-subagents/src/tui/render.ts +296 -140
- package/dist/extensions/pi-subagents/src/types/pi-runtime-compat.d.ts +14 -0
- package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +1 -1
- package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +13 -7
- package/dist/extensions/pi-subagents/src/watchdog/model-selection.ts +2 -2
- package/dist/extensions/pi-subagents/src/watchdog/permission-arbiter.ts +145 -0
- package/dist/extensions/pi-subagents/src/watchdog/register-child.ts +1 -1
- package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +1 -1
- package/dist/extensions/pi-subagents/src/watchdog/review.ts +4 -1
- package/dist/extensions/pi-subagents/src/watchdog/runtime.ts +3 -2
- package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +140 -0
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +415 -0
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +41 -144
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +16 -16
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +415 -298
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +149 -82
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +40 -40
- package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +15 -15
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +193 -133
- package/dist/extensions/pi-subagents/test/integration/detect-error.test.ts +1 -49
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +62 -0
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +56 -58
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +81 -68
- package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +20 -25
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +425 -317
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +73 -73
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +123 -98
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +653 -240
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +20 -1661
- package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/integration/top-level-async.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +8 -5
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +6 -6
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +4 -20
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +25 -4
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +280 -295
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +47 -207
- package/dist/extensions/pi-subagents/test/unit/agent-memory.test.ts +26 -26
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +89 -89
- package/dist/extensions/pi-subagents/test/unit/agent-selection.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +10 -0
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +33 -9
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +24 -2
- package/dist/extensions/pi-subagents/test/unit/async-permission-session.test.ts +11 -9
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +40 -40
- package/dist/extensions/pi-subagents/test/unit/authority-policy.test.ts +22 -0
- package/dist/extensions/pi-subagents/test/unit/background-work.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-agent-allowlist.test.ts +5 -39
- package/dist/extensions/pi-subagents/test/unit/chain-append.test.ts +19 -19
- package/dist/extensions/pi-subagents/test/unit/chain-root-attachment.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/chain-serializer.test.ts +20 -20
- package/dist/extensions/pi-subagents/test/unit/child-protocol.test.ts +99 -0
- package/dist/extensions/pi-subagents/test/unit/child-transcript.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +41 -0
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +35 -5
- package/dist/extensions/pi-subagents/test/unit/config-dir-runtime.test.ts +7 -0
- package/dist/extensions/pi-subagents/test/unit/control-notices.test.ts +16 -82
- package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +162 -620
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +25 -25
- package/dist/extensions/pi-subagents/test/unit/ensure-accessible-dir.test.ts +125 -0
- package/dist/extensions/pi-subagents/test/unit/external-cli-runner.test.ts +94 -0
- package/dist/extensions/pi-subagents/test/unit/external-runs.test.ts +66 -0
- package/dist/extensions/pi-subagents/test/unit/extra-agent-dirs.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +242 -52
- package/dist/extensions/pi-subagents/test/unit/fleet-transcript.test.ts +127 -0
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +197 -36
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +4 -4
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +245 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +494 -0
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +261 -31
- package/dist/extensions/pi-subagents/test/unit/inline-subagents.test.ts +52 -0
- package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +6 -6
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +217 -0
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +182 -0
- package/dist/extensions/pi-subagents/test/unit/mock-pi.test.ts +22 -0
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +10 -10
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +20 -12
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +47 -5
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +49 -55
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +20 -3
- package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +37 -7
- package/dist/extensions/pi-subagents/test/unit/parallel-utils.test.ts +10 -10
- package/dist/extensions/pi-subagents/test/unit/path-handling.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/permissions.test.ts +46 -0
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +31 -10
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +40 -16
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +42 -44
- package/dist/extensions/pi-subagents/test/unit/proactive-skills.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/process-terminal.test.ts +4 -4
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +75 -9
- package/dist/extensions/pi-subagents/test/unit/prompt-template-bridge.test.ts +20 -84
- package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +15 -16
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +28 -28
- package/dist/extensions/pi-subagents/test/unit/result-intercom.test.ts +19 -12
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +37 -21
- package/dist/extensions/pi-subagents/test/unit/run-id-resolver.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +50 -50
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +396 -433
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +76 -153
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +411 -0
- package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +1 -91
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +139 -0
- package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +29 -0
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +35 -35
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +53 -18
- package/dist/extensions/pi-subagents/test/unit/subagent-startup-retry.test.ts +13 -1
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +44 -11
- package/dist/extensions/pi-subagents/test/unit/task-intent.test.ts +2 -26
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +24 -148
- package/dist/extensions/pi-subagents/test/unit/turn-budget.test.ts +11 -9
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +351 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-child-status.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/watchdog-lsp-diagnostics.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/watchdog-permission-arbiter.test.ts +79 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-runtime.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/watchdog-settings.test.ts +8 -8
- package/dist/extensions/pi-subagents/test/unit/widget-nested-render.test.ts +45 -9
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +197 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-graph.test.ts +8 -8
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +142 -12
- package/dist/extensions/pi-subagents/tsconfig.json +15 -0
- package/dist/extensions/pi-web-agent/package.json +1 -1
- package/dist/extensions/rtk.test.ts +126 -0
- package/dist/extensions/rtk.ts +56 -20
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -1
- package/dist/migrations.d.ts +0 -1
- package/dist/migrations.js +0 -1
- package/dist/modes/index.d.ts +0 -1
- package/dist/modes/index.js +0 -1
- package/dist/modes/interactive/components/armin.d.ts +0 -1
- package/dist/modes/interactive/components/armin.js +0 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +0 -1
- package/dist/modes/interactive/components/assistant-message.js +0 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +0 -1
- package/dist/modes/interactive/components/bash-execution.js +0 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts +0 -1
- package/dist/modes/interactive/components/bordered-loader.js +0 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +0 -1
- package/dist/modes/interactive/components/branch-summary-message.js +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +0 -1
- package/dist/modes/interactive/components/config-selector.d.ts +0 -1
- package/dist/modes/interactive/components/config-selector.js +0 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts +0 -1
- package/dist/modes/interactive/components/countdown-timer.js +0 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +0 -1
- package/dist/modes/interactive/components/custom-editor.js +0 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +0 -1
- package/dist/modes/interactive/components/custom-entry.js +0 -1
- package/dist/modes/interactive/components/custom-message.d.ts +0 -1
- package/dist/modes/interactive/components/custom-message.js +0 -1
- package/dist/modes/interactive/components/daxnuts.d.ts +0 -1
- package/dist/modes/interactive/components/daxnuts.js +0 -1
- package/dist/modes/interactive/components/diff.d.ts +0 -1
- package/dist/modes/interactive/components/diff.js +0 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts +0 -1
- package/dist/modes/interactive/components/dynamic-border.js +0 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts +0 -1
- package/dist/modes/interactive/components/earendil-announcement.js +0 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +0 -1
- package/dist/modes/interactive/components/extension-editor.js +0 -1
- package/dist/modes/interactive/components/extension-input.d.ts +0 -1
- package/dist/modes/interactive/components/extension-input.js +0 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +0 -1
- package/dist/modes/interactive/components/extension-selector.js +0 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +0 -1
- package/dist/modes/interactive/components/first-time-setup.js +0 -1
- package/dist/modes/interactive/components/footer.d.ts +0 -1
- package/dist/modes/interactive/components/footer.js +0 -1
- package/dist/modes/interactive/components/index.d.ts +0 -1
- package/dist/modes/interactive/components/index.js +0 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +0 -1
- package/dist/modes/interactive/components/keybinding-hints.js +0 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +0 -1
- package/dist/modes/interactive/components/login-dialog.js +0 -1
- package/dist/modes/interactive/components/model-selector.d.ts +0 -1
- package/dist/modes/interactive/components/model-selector.js +0 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +0 -1
- package/dist/modes/interactive/components/oauth-selector.js +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +0 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts +0 -1
- package/dist/modes/interactive/components/session-selector-search.js +0 -1
- package/dist/modes/interactive/components/session-selector.d.ts +0 -1
- package/dist/modes/interactive/components/session-selector.js +0 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +0 -3
- package/dist/modes/interactive/components/settings-selector.js +1 -14
- package/dist/modes/interactive/components/show-images-selector.d.ts +0 -1
- package/dist/modes/interactive/components/show-images-selector.js +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +0 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +0 -1
- package/dist/modes/interactive/components/status-indicator.js +0 -1
- package/dist/modes/interactive/components/theme-selector.d.ts +0 -1
- package/dist/modes/interactive/components/theme-selector.js +0 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +0 -1
- package/dist/modes/interactive/components/thinking-selector.js +0 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +0 -1
- package/dist/modes/interactive/components/tool-execution.js +0 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +0 -1
- package/dist/modes/interactive/components/tree-selector.js +0 -1
- package/dist/modes/interactive/components/trust-selector.d.ts +0 -1
- package/dist/modes/interactive/components/trust-selector.js +0 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +0 -1
- package/dist/modes/interactive/components/user-message-selector.js +0 -1
- package/dist/modes/interactive/components/user-message.d.ts +0 -1
- package/dist/modes/interactive/components/user-message.js +0 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts +0 -1
- package/dist/modes/interactive/components/visual-truncate.js +0 -1
- package/dist/modes/interactive/external-editor.d.ts +0 -1
- package/dist/modes/interactive/external-editor.js +0 -1
- package/dist/modes/interactive/interactive-mode.d.ts +0 -2
- package/dist/modes/interactive/interactive-mode.js +1 -22
- package/dist/modes/interactive/model-search.d.ts +0 -1
- package/dist/modes/interactive/model-search.js +0 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +0 -1
- package/dist/modes/interactive/theme/theme-controller.js +0 -1
- package/dist/modes/interactive/theme/theme.d.ts +0 -1
- package/dist/modes/interactive/theme/theme.js +0 -1
- package/dist/modes/print-mode.d.ts +0 -1
- package/dist/modes/print-mode.js +0 -1
- package/dist/modes/rpc/jsonl.d.ts +0 -1
- package/dist/modes/rpc/jsonl.js +0 -1
- package/dist/modes/rpc/rpc-client.d.ts +1 -2
- package/dist/modes/rpc/rpc-client.js +1 -2
- package/dist/modes/rpc/rpc-mode.d.ts +0 -1
- package/dist/modes/rpc/rpc-mode.js +0 -9
- package/dist/modes/rpc/rpc-types.d.ts +0 -1
- package/dist/modes/rpc/rpc-types.js +0 -1
- package/dist/package-manager-cli.d.ts +0 -1
- package/dist/package-manager-cli.js +0 -1
- package/dist/rpc-entry.d.ts +0 -1
- package/dist/rpc-entry.js +0 -1
- package/dist/utils/ansi.d.ts +0 -1
- package/dist/utils/ansi.js +0 -1
- package/dist/utils/changelog.d.ts +0 -1
- package/dist/utils/changelog.js +0 -1
- package/dist/utils/child-process.d.ts +0 -1
- package/dist/utils/child-process.js +0 -1
- package/dist/utils/clipboard-image.d.ts +0 -1
- package/dist/utils/clipboard-image.js +0 -1
- package/dist/utils/clipboard-native.d.ts +0 -1
- package/dist/utils/clipboard-native.js +0 -1
- package/dist/utils/clipboard.d.ts +0 -1
- package/dist/utils/clipboard.js +0 -1
- package/dist/utils/deprecation.d.ts +0 -1
- package/dist/utils/deprecation.js +0 -1
- package/dist/utils/exif-orientation.d.ts +0 -1
- package/dist/utils/exif-orientation.js +0 -1
- package/dist/utils/frontmatter.d.ts +0 -1
- package/dist/utils/frontmatter.js +0 -1
- package/dist/utils/fs-watch.d.ts +0 -1
- package/dist/utils/fs-watch.js +0 -1
- package/dist/utils/git.d.ts +0 -1
- package/dist/utils/git.js +0 -1
- package/dist/utils/html.d.ts +0 -1
- package/dist/utils/html.js +0 -1
- package/dist/utils/image-convert.d.ts +0 -1
- package/dist/utils/image-convert.js +0 -1
- package/dist/utils/image-process.d.ts +0 -1
- package/dist/utils/image-process.js +0 -1
- package/dist/utils/image-resize-core.d.ts +0 -1
- package/dist/utils/image-resize-core.js +0 -1
- package/dist/utils/image-resize-worker.d.ts +0 -1
- package/dist/utils/image-resize-worker.js +0 -1
- package/dist/utils/image-resize.d.ts +0 -1
- package/dist/utils/image-resize.js +0 -1
- package/dist/utils/json.d.ts +0 -1
- package/dist/utils/json.js +0 -1
- package/dist/utils/mime.d.ts +0 -1
- package/dist/utils/mime.js +0 -1
- package/dist/utils/open-browser.d.ts +0 -1
- package/dist/utils/open-browser.js +0 -1
- package/dist/utils/paths.d.ts +0 -1
- package/dist/utils/paths.js +0 -1
- package/dist/utils/photon.d.ts +0 -1
- package/dist/utils/photon.js +0 -1
- package/dist/utils/pi-user-agent.d.ts +0 -1
- package/dist/utils/pi-user-agent.js +0 -1
- package/dist/utils/shell.d.ts +0 -1
- package/dist/utils/shell.js +0 -1
- package/dist/utils/sleep.d.ts +0 -1
- package/dist/utils/sleep.js +0 -1
- package/dist/utils/syntax-highlight.d.ts +0 -1
- package/dist/utils/syntax-highlight.js +0 -1
- package/dist/utils/thinking-tags.d.ts +0 -1
- package/dist/utils/thinking-tags.js +0 -1
- package/dist/utils/tools-manager.d.ts +3 -3
- package/dist/utils/tools-manager.js +125 -42
- package/dist/utils/version-check.d.ts +0 -1
- package/dist/utils/version-check.js +0 -1
- package/dist/utils/windows-self-update.d.ts +0 -1
- package/dist/utils/windows-self-update.js +0 -1
- package/docs/rpc.md +1 -2
- package/docs/settings.md +0 -1
- package/docs/skills.md +10 -18
- package/package.json +4 -3
- package/dist/bun/cli.d.ts.map +0 -1
- package/dist/bun/cli.js.map +0 -1
- package/dist/bun/register-bedrock.d.ts.map +0 -1
- package/dist/bun/register-bedrock.js.map +0 -1
- package/dist/bun/restore-sandbox-env.d.ts.map +0 -1
- package/dist/bun/restore-sandbox-env.js.map +0 -1
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/config-selector.d.ts.map +0 -1
- package/dist/cli/config-selector.js.map +0 -1
- package/dist/cli/credential-print.d.ts.map +0 -1
- package/dist/cli/credential-print.js.map +0 -1
- package/dist/cli/file-processor.d.ts.map +0 -1
- package/dist/cli/file-processor.js.map +0 -1
- package/dist/cli/initial-message.d.ts.map +0 -1
- package/dist/cli/initial-message.js.map +0 -1
- package/dist/cli/list-models.d.ts.map +0 -1
- package/dist/cli/list-models.js.map +0 -1
- package/dist/cli/project-trust.d.ts.map +0 -1
- package/dist/cli/project-trust.js.map +0 -1
- package/dist/cli/session-picker.d.ts.map +0 -1
- package/dist/cli/session-picker.js.map +0 -1
- package/dist/cli/startup-ui.d.ts.map +0 -1
- package/dist/cli/startup-ui.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/core/agent-session-auto-handoff.test.d.ts.map +0 -1
- package/dist/core/agent-session-auto-handoff.test.js.map +0 -1
- package/dist/core/agent-session-runtime.d.ts.map +0 -1
- package/dist/core/agent-session-runtime.js.map +0 -1
- package/dist/core/agent-session-services.d.ts.map +0 -1
- package/dist/core/agent-session-services.js.map +0 -1
- package/dist/core/agent-session-skill-block.test.d.ts.map +0 -1
- package/dist/core/agent-session-skill-block.test.js.map +0 -1
- package/dist/core/agent-session.d.ts.map +0 -1
- package/dist/core/agent-session.js.map +0 -1
- package/dist/core/agents.d.ts.map +0 -1
- package/dist/core/agents.js.map +0 -1
- package/dist/core/auth-guidance.d.ts.map +0 -1
- package/dist/core/auth-guidance.js.map +0 -1
- package/dist/core/auth-storage.d.ts.map +0 -1
- package/dist/core/auth-storage.js.map +0 -1
- package/dist/core/bash-executor.d.ts.map +0 -1
- package/dist/core/bash-executor.js.map +0 -1
- package/dist/core/built-in-extensions.d.ts.map +0 -1
- package/dist/core/built-in-extensions.js.map +0 -1
- package/dist/core/cache-stats.d.ts.map +0 -1
- package/dist/core/cache-stats.js.map +0 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +0 -1
- package/dist/core/compaction/branch-summarization.js.map +0 -1
- package/dist/core/compaction/compaction.d.ts.map +0 -1
- package/dist/core/compaction/compaction.js.map +0 -1
- package/dist/core/compaction/index.d.ts.map +0 -1
- package/dist/core/compaction/index.js.map +0 -1
- package/dist/core/compaction/utils.d.ts.map +0 -1
- package/dist/core/compaction/utils.js.map +0 -1
- package/dist/core/defaults.d.ts.map +0 -1
- package/dist/core/defaults.js.map +0 -1
- package/dist/core/diagnostics.d.ts.map +0 -1
- package/dist/core/diagnostics.js.map +0 -1
- package/dist/core/event-bus.d.ts.map +0 -1
- package/dist/core/event-bus.js.map +0 -1
- package/dist/core/exec.d.ts.map +0 -1
- package/dist/core/exec.js.map +0 -1
- package/dist/core/experimental.d.ts.map +0 -1
- package/dist/core/experimental.js.map +0 -1
- package/dist/core/export-html/ansi-to-html.d.ts.map +0 -1
- package/dist/core/export-html/ansi-to-html.js.map +0 -1
- package/dist/core/export-html/index.d.ts.map +0 -1
- package/dist/core/export-html/index.js.map +0 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +0 -1
- package/dist/core/export-html/tool-renderer.js.map +0 -1
- package/dist/core/extensions/index.d.ts.map +0 -1
- package/dist/core/extensions/index.js.map +0 -1
- package/dist/core/extensions/loader.d.ts.map +0 -1
- package/dist/core/extensions/loader.js.map +0 -1
- package/dist/core/extensions/runner.d.ts.map +0 -1
- package/dist/core/extensions/runner.js.map +0 -1
- package/dist/core/extensions/types.d.ts.map +0 -1
- package/dist/core/extensions/types.js.map +0 -1
- package/dist/core/extensions/wrapper.d.ts.map +0 -1
- package/dist/core/extensions/wrapper.js.map +0 -1
- package/dist/core/footer-data-provider.d.ts.map +0 -1
- package/dist/core/footer-data-provider.js.map +0 -1
- package/dist/core/git-command.d.ts.map +0 -1
- package/dist/core/git-command.js.map +0 -1
- package/dist/core/http-dispatcher.d.ts.map +0 -1
- package/dist/core/http-dispatcher.js.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/keybindings.d.ts.map +0 -1
- package/dist/core/keybindings.js.map +0 -1
- package/dist/core/llama/client.d.ts.map +0 -1
- package/dist/core/llama/client.js.map +0 -1
- package/dist/core/llama/huggingface.d.ts.map +0 -1
- package/dist/core/llama/huggingface.js.map +0 -1
- package/dist/core/llama/index.d.ts.map +0 -1
- package/dist/core/llama/index.js.map +0 -1
- package/dist/core/llama/provider.d.ts.map +0 -1
- package/dist/core/llama/provider.js.map +0 -1
- package/dist/core/llama/ui.d.ts.map +0 -1
- package/dist/core/llama/ui.js.map +0 -1
- package/dist/core/messages.d.ts.map +0 -1
- package/dist/core/messages.js.map +0 -1
- package/dist/core/model-config.d.ts.map +0 -1
- package/dist/core/model-config.js.map +0 -1
- package/dist/core/model-registry.d.ts.map +0 -1
- package/dist/core/model-registry.js.map +0 -1
- package/dist/core/model-resolver.d.ts.map +0 -1
- package/dist/core/model-resolver.js.map +0 -1
- package/dist/core/model-runtime.d.ts.map +0 -1
- package/dist/core/model-runtime.js.map +0 -1
- package/dist/core/models-store.d.ts.map +0 -1
- package/dist/core/models-store.js.map +0 -1
- package/dist/core/output-guard.d.ts.map +0 -1
- package/dist/core/output-guard.js.map +0 -1
- package/dist/core/package-manager.d.ts.map +0 -1
- package/dist/core/package-manager.js.map +0 -1
- package/dist/core/package-manager.test.d.ts.map +0 -1
- package/dist/core/package-manager.test.js.map +0 -1
- package/dist/core/project-trust.d.ts.map +0 -1
- package/dist/core/project-trust.js.map +0 -1
- package/dist/core/prompt-templates.d.ts.map +0 -1
- package/dist/core/prompt-templates.js.map +0 -1
- package/dist/core/provider-attribution.d.ts.map +0 -1
- package/dist/core/provider-attribution.js.map +0 -1
- package/dist/core/provider-composer.d.ts.map +0 -1
- package/dist/core/provider-composer.js.map +0 -1
- package/dist/core/radius.d.ts.map +0 -1
- package/dist/core/radius.js.map +0 -1
- package/dist/core/remote-catalog-provider.d.ts.map +0 -1
- package/dist/core/remote-catalog-provider.js.map +0 -1
- package/dist/core/resolve-config-value.d.ts.map +0 -1
- package/dist/core/resolve-config-value.js.map +0 -1
- package/dist/core/resource-loader.d.ts.map +0 -1
- package/dist/core/resource-loader.js.map +0 -1
- package/dist/core/runtime-credentials.d.ts.map +0 -1
- package/dist/core/runtime-credentials.js.map +0 -1
- package/dist/core/sdk.d.ts.map +0 -1
- package/dist/core/sdk.js.map +0 -1
- package/dist/core/session-cwd.d.ts.map +0 -1
- package/dist/core/session-cwd.js.map +0 -1
- package/dist/core/session-manager.d.ts.map +0 -1
- package/dist/core/session-manager.js.map +0 -1
- package/dist/core/settings-manager-auto-handoff.test.d.ts.map +0 -1
- package/dist/core/settings-manager-auto-handoff.test.js.map +0 -1
- package/dist/core/settings-manager.d.ts.map +0 -1
- package/dist/core/settings-manager.js.map +0 -1
- package/dist/core/skills.d.ts.map +0 -1
- package/dist/core/skills.js.map +0 -1
- package/dist/core/slash-commands.d.ts.map +0 -1
- package/dist/core/slash-commands.js.map +0 -1
- package/dist/core/source-info.d.ts.map +0 -1
- package/dist/core/source-info.js.map +0 -1
- package/dist/core/system-prompt.d.ts.map +0 -1
- package/dist/core/system-prompt.js.map +0 -1
- package/dist/core/system-prompt.test.d.ts.map +0 -1
- package/dist/core/system-prompt.test.js.map +0 -1
- package/dist/core/telemetry.d.ts.map +0 -1
- package/dist/core/telemetry.js.map +0 -1
- package/dist/core/timings.d.ts.map +0 -1
- package/dist/core/timings.js.map +0 -1
- package/dist/core/tools/bash.d.ts.map +0 -1
- package/dist/core/tools/bash.js.map +0 -1
- package/dist/core/tools/edit-diff.d.ts.map +0 -1
- package/dist/core/tools/edit-diff.js.map +0 -1
- package/dist/core/tools/edit.d.ts.map +0 -1
- package/dist/core/tools/edit.js.map +0 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +0 -1
- package/dist/core/tools/file-mutation-queue.js.map +0 -1
- package/dist/core/tools/find.d.ts.map +0 -1
- package/dist/core/tools/find.js.map +0 -1
- package/dist/core/tools/grep.d.ts.map +0 -1
- package/dist/core/tools/grep.js.map +0 -1
- package/dist/core/tools/index.d.ts.map +0 -1
- package/dist/core/tools/index.js.map +0 -1
- package/dist/core/tools/ls.d.ts.map +0 -1
- package/dist/core/tools/ls.js.map +0 -1
- package/dist/core/tools/output-accumulator.d.ts.map +0 -1
- package/dist/core/tools/output-accumulator.js.map +0 -1
- package/dist/core/tools/path-utils.d.ts.map +0 -1
- package/dist/core/tools/path-utils.js.map +0 -1
- package/dist/core/tools/read.d.ts.map +0 -1
- package/dist/core/tools/read.js.map +0 -1
- package/dist/core/tools/render-utils.d.ts.map +0 -1
- package/dist/core/tools/render-utils.js.map +0 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +0 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +0 -1
- package/dist/core/tools/truncate.d.ts.map +0 -1
- package/dist/core/tools/truncate.js.map +0 -1
- package/dist/core/tools/write.d.ts.map +0 -1
- package/dist/core/tools/write.js.map +0 -1
- package/dist/core/trust-manager.d.ts.map +0 -1
- package/dist/core/trust-manager.js.map +0 -1
- package/dist/core/usage-totals.d.ts.map +0 -1
- package/dist/core/usage-totals.js.map +0 -1
- package/dist/extensions/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/dist/extensions/pi-subagents/test/unit/slash-chain-groups.test.ts +0 -464
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/migrations.d.ts.map +0 -1
- package/dist/migrations.js.map +0 -1
- package/dist/modes/index.d.ts.map +0 -1
- package/dist/modes/index.js.map +0 -1
- package/dist/modes/interactive/components/armin.d.ts.map +0 -1
- package/dist/modes/interactive/components/armin.js.map +0 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/assistant-message.js.map +0 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +0 -1
- package/dist/modes/interactive/components/bash-execution.js.map +0 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +0 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +0 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +0 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/config-selector.js.map +0 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +0 -1
- package/dist/modes/interactive/components/countdown-timer.js.map +0 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-editor.js.map +0 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-entry.js.map +0 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-message.js.map +0 -1
- package/dist/modes/interactive/components/daxnuts.d.ts.map +0 -1
- package/dist/modes/interactive/components/daxnuts.js.map +0 -1
- package/dist/modes/interactive/components/diff.d.ts.map +0 -1
- package/dist/modes/interactive/components/diff.js.map +0 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +0 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +0 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +0 -1
- package/dist/modes/interactive/components/earendil-announcement.js.map +0 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-editor.js.map +0 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-input.js.map +0 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-selector.js.map +0 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +0 -1
- package/dist/modes/interactive/components/first-time-setup.js.map +0 -1
- package/dist/modes/interactive/components/footer.d.ts.map +0 -1
- package/dist/modes/interactive/components/footer.js.map +0 -1
- package/dist/modes/interactive/components/index.d.ts.map +0 -1
- package/dist/modes/interactive/components/index.js.map +0 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +0 -1
- package/dist/modes/interactive/components/keybinding-hints.js.map +0 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +0 -1
- package/dist/modes/interactive/components/login-dialog.js.map +0 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/model-selector.js.map +0 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/oauth-selector.js.map +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +0 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +0 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +0 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/session-selector.js.map +0 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/settings-selector.js.map +0 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +0 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +0 -1
- package/dist/modes/interactive/components/status-indicator.js.map +0 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/theme-selector.js.map +0 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +0 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +0 -1
- package/dist/modes/interactive/components/tool-execution.js.map +0 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/tree-selector.js.map +0 -1
- package/dist/modes/interactive/components/trust-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/trust-selector.js.map +0 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +0 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/user-message.js.map +0 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +0 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +0 -1
- package/dist/modes/interactive/external-editor.d.ts.map +0 -1
- package/dist/modes/interactive/external-editor.js.map +0 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +0 -1
- package/dist/modes/interactive/interactive-mode.js.map +0 -1
- package/dist/modes/interactive/model-search.d.ts.map +0 -1
- package/dist/modes/interactive/model-search.js.map +0 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme-controller.js.map +0 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme.js.map +0 -1
- package/dist/modes/print-mode.d.ts.map +0 -1
- package/dist/modes/print-mode.js.map +0 -1
- package/dist/modes/rpc/jsonl.d.ts.map +0 -1
- package/dist/modes/rpc/jsonl.js.map +0 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-client.js.map +0 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-mode.js.map +0 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-types.js.map +0 -1
- package/dist/package-manager-cli.d.ts.map +0 -1
- package/dist/package-manager-cli.js.map +0 -1
- package/dist/rpc-entry.d.ts.map +0 -1
- package/dist/rpc-entry.js.map +0 -1
- package/dist/utils/ansi.d.ts.map +0 -1
- package/dist/utils/ansi.js.map +0 -1
- package/dist/utils/changelog.d.ts.map +0 -1
- package/dist/utils/changelog.js.map +0 -1
- package/dist/utils/child-process.d.ts.map +0 -1
- package/dist/utils/child-process.js.map +0 -1
- package/dist/utils/clipboard-image.d.ts.map +0 -1
- package/dist/utils/clipboard-image.js.map +0 -1
- package/dist/utils/clipboard-native.d.ts.map +0 -1
- package/dist/utils/clipboard-native.js.map +0 -1
- package/dist/utils/clipboard.d.ts.map +0 -1
- package/dist/utils/clipboard.js.map +0 -1
- package/dist/utils/deprecation.d.ts.map +0 -1
- package/dist/utils/deprecation.js.map +0 -1
- package/dist/utils/exif-orientation.d.ts.map +0 -1
- package/dist/utils/exif-orientation.js.map +0 -1
- package/dist/utils/frontmatter.d.ts.map +0 -1
- package/dist/utils/frontmatter.js.map +0 -1
- package/dist/utils/fs-watch.d.ts.map +0 -1
- package/dist/utils/fs-watch.js.map +0 -1
- package/dist/utils/git.d.ts.map +0 -1
- package/dist/utils/git.js.map +0 -1
- package/dist/utils/html.d.ts.map +0 -1
- package/dist/utils/html.js.map +0 -1
- package/dist/utils/image-convert.d.ts.map +0 -1
- package/dist/utils/image-convert.js.map +0 -1
- package/dist/utils/image-process.d.ts.map +0 -1
- package/dist/utils/image-process.js.map +0 -1
- package/dist/utils/image-resize-core.d.ts.map +0 -1
- package/dist/utils/image-resize-core.js.map +0 -1
- package/dist/utils/image-resize-worker.d.ts.map +0 -1
- package/dist/utils/image-resize-worker.js.map +0 -1
- package/dist/utils/image-resize.d.ts.map +0 -1
- package/dist/utils/image-resize.js.map +0 -1
- package/dist/utils/json.d.ts.map +0 -1
- package/dist/utils/json.js.map +0 -1
- package/dist/utils/mime.d.ts.map +0 -1
- package/dist/utils/mime.js.map +0 -1
- package/dist/utils/open-browser.d.ts.map +0 -1
- package/dist/utils/open-browser.js.map +0 -1
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/photon.d.ts.map +0 -1
- package/dist/utils/photon.js.map +0 -1
- package/dist/utils/pi-user-agent.d.ts.map +0 -1
- package/dist/utils/pi-user-agent.js.map +0 -1
- package/dist/utils/shell.d.ts.map +0 -1
- package/dist/utils/shell.js.map +0 -1
- package/dist/utils/sleep.d.ts.map +0 -1
- package/dist/utils/sleep.js.map +0 -1
- package/dist/utils/syntax-highlight.d.ts.map +0 -1
- package/dist/utils/syntax-highlight.js.map +0 -1
- package/dist/utils/thinking-tags.d.ts.map +0 -1
- package/dist/utils/thinking-tags.js.map +0 -1
- package/dist/utils/tools-manager.d.ts.map +0 -1
- package/dist/utils/tools-manager.js.map +0 -1
- package/dist/utils/version-check.d.ts.map +0 -1
- package/dist/utils/version-check.js.map +0 -1
- package/dist/utils/windows-self-update.d.ts.map +0 -1
- package/dist/utils/windows-self-update.js.map +0 -1
|
@@ -64,8 +64,8 @@ function child(id: string, state: "queued" | "running" | "complete" | "failed" |
|
|
|
64
64
|
path: [{ runId: parentRunId, stepIndex: 1 }],
|
|
65
65
|
mode: "single" as const,
|
|
66
66
|
state,
|
|
67
|
-
agent: "
|
|
68
|
-
agents: ["
|
|
67
|
+
agent: "commentator",
|
|
68
|
+
agents: ["commentator"],
|
|
69
69
|
startedAt: 10,
|
|
70
70
|
lastUpdate: ts,
|
|
71
71
|
steps: [{ agent: "leaf", status: state === "running" ? "running" as const : "complete" as const }],
|
|
@@ -150,7 +150,7 @@ describe("nested event parsing and projection", () => {
|
|
|
150
150
|
ts: 100,
|
|
151
151
|
parentRunId: "root-run",
|
|
152
152
|
parentStepIndex: 1,
|
|
153
|
-
child: child("nested-a", "running", 100),
|
|
153
|
+
child: { ...child("nested-a", "running", 100), model: "provider/gpt-5.6-luna:medium", thinking: "medium", steps: [{ agent: "leaf", status: "running", model: "provider/leaf", thinking: "low" }], children: [child("nested-grandchild", "running", 100, "nested-a")] },
|
|
154
154
|
});
|
|
155
155
|
writeNestedEvent(route, {
|
|
156
156
|
type: "subagent.nested.updated",
|
|
@@ -176,6 +176,11 @@ describe("nested event parsing and projection", () => {
|
|
|
176
176
|
assert.equal(registry.children[0]?.id, "nested-a");
|
|
177
177
|
assert.equal(registry.children[0]?.state, "complete");
|
|
178
178
|
assert.equal(registry.children[0]?.steps?.[0]?.agent, "leaf");
|
|
179
|
+
assert.equal(registry.children[0]?.model, "provider/gpt-5.6-luna:medium");
|
|
180
|
+
assert.equal(registry.children[0]?.thinking, "medium");
|
|
181
|
+
assert.equal(registry.children[0]?.steps?.[0]?.model, "provider/leaf");
|
|
182
|
+
assert.equal(registry.children[0]?.steps?.[0]?.thinking, "low");
|
|
183
|
+
assert.equal(registry.children[0]?.children?.[0]?.id, "nested-grandchild");
|
|
179
184
|
assert.deepEqual(registry.children[0]?.runtimeAcknowledgedExtensions, {
|
|
180
185
|
version: 1,
|
|
181
186
|
source: "child-runtime",
|
|
@@ -339,6 +344,43 @@ describe("nested event parsing and projection", () => {
|
|
|
339
344
|
});
|
|
340
345
|
|
|
341
346
|
|
|
347
|
+
it("sanitizes nested model bounds and thinking levels", () => {
|
|
348
|
+
const route = trackRoute();
|
|
349
|
+
writeNestedEvent(route, {
|
|
350
|
+
type: "subagent.nested.updated",
|
|
351
|
+
ts: 100,
|
|
352
|
+
parentRunId: "root-run",
|
|
353
|
+
parentStepIndex: 1,
|
|
354
|
+
child: {
|
|
355
|
+
...child("nested-model-bounds", "running", 100),
|
|
356
|
+
model: "m".repeat(600),
|
|
357
|
+
thinking: "turbo",
|
|
358
|
+
steps: [{ agent: "leaf", status: "running", model: "builder", thinking: "xhigh" }],
|
|
359
|
+
},
|
|
360
|
+
});
|
|
361
|
+
const summary = projectNestedEvents(route).children[0]!;
|
|
362
|
+
assert.equal(summary.model?.length, 512);
|
|
363
|
+
assert.equal(summary.thinking, undefined);
|
|
364
|
+
assert.equal(summary.steps?.[0]?.thinking, "xhigh");
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
it("projects effective model and thinking from async status, including a single-step run", () => {
|
|
368
|
+
const summary = nestedSummaryFromAsyncStatus({
|
|
369
|
+
runId: "child-run",
|
|
370
|
+
mode: "single",
|
|
371
|
+
state: "running",
|
|
372
|
+
startedAt: 1,
|
|
373
|
+
steps: [
|
|
374
|
+
{ agent: "builder", status: "running", model: "provider/builder", thinking: "high" },
|
|
375
|
+
],
|
|
376
|
+
}, "/tmp/child-run", { id: "child-run", parentRunId: "parent-run", depth: 1, mode: "single", ts: 2 });
|
|
377
|
+
|
|
378
|
+
assert.equal(summary.model, "provider/builder");
|
|
379
|
+
assert.equal(summary.thinking, "high");
|
|
380
|
+
assert.equal(summary.steps?.[0]?.model, "provider/builder");
|
|
381
|
+
assert.equal(summary.steps?.[0]?.thinking, "high");
|
|
382
|
+
});
|
|
383
|
+
|
|
342
384
|
it("sanitizes malformed process-terminal proofs in nested status summaries", () => {
|
|
343
385
|
const summary = nestedSummaryFromAsyncStatus({
|
|
344
386
|
runId: "child-run",
|
|
@@ -347,7 +389,7 @@ describe("nested event parsing and projection", () => {
|
|
|
347
389
|
startedAt: 1,
|
|
348
390
|
processTerminal: { version: 1, state: "bogus", runId: "child-run", runnerProcessInstanceId: "runner-1" } as never,
|
|
349
391
|
steps: [{
|
|
350
|
-
agent: "
|
|
392
|
+
agent: "builder",
|
|
351
393
|
status: "complete",
|
|
352
394
|
processTerminal: { version: 1, state: "observed", runId: "wrong-run", runnerProcessInstanceId: "runner-1" } as never,
|
|
353
395
|
}],
|
|
@@ -367,7 +409,7 @@ describe("nested event parsing and projection", () => {
|
|
|
367
409
|
startedAt: 1,
|
|
368
410
|
runtimeAcknowledgedExtensions: { version: 1, source: "child-runtime", ids: ["/Users/alice/.secret-extension", "ok-ext", "x".repeat(5000)], omitted: 0 } as never,
|
|
369
411
|
steps: [{
|
|
370
|
-
agent: "
|
|
412
|
+
agent: "builder",
|
|
371
413
|
status: "complete",
|
|
372
414
|
runtimeAcknowledgedExtensions: { version: 1, source: "child-runtime", ids: ["C:/Users/alice/secret"], omitted: 0 } as never,
|
|
373
415
|
}],
|
|
@@ -99,7 +99,7 @@ function createFakeClock() {
|
|
|
99
99
|
function completionResult(overrides: Record<string, unknown> = {}) {
|
|
100
100
|
return {
|
|
101
101
|
id: `notify-${Math.random().toString(36).slice(2)}`,
|
|
102
|
-
agent: "
|
|
102
|
+
agent: "builder",
|
|
103
103
|
success: true,
|
|
104
104
|
summary: "Done",
|
|
105
105
|
exitCode: 0,
|
|
@@ -110,12 +110,12 @@ function completionResult(overrides: Record<string, unknown> = {}) {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
describe("registerSubagentNotify", () => {
|
|
113
|
-
it("
|
|
113
|
+
it("keeps a successful background completion hidden while waking the originating session", () => {
|
|
114
114
|
const { events, sent } = createPi();
|
|
115
115
|
|
|
116
116
|
events.emit(SUBAGENT_ASYNC_COMPLETE_EVENT, {
|
|
117
117
|
id: "notify-empty-1",
|
|
118
|
-
agent: "
|
|
118
|
+
agent: "builder",
|
|
119
119
|
success: true,
|
|
120
120
|
summary: "",
|
|
121
121
|
exitCode: 0,
|
|
@@ -127,8 +127,8 @@ describe("registerSubagentNotify", () => {
|
|
|
127
127
|
assert.deepEqual(sent[0], {
|
|
128
128
|
message: {
|
|
129
129
|
customType: "subagent-notify",
|
|
130
|
-
content: "Background task completed: **
|
|
131
|
-
display:
|
|
130
|
+
content: "Background task completed: **builder**\n\n(no output)",
|
|
131
|
+
display: false,
|
|
132
132
|
},
|
|
133
133
|
options: { triggerTurn: true },
|
|
134
134
|
});
|
|
@@ -140,6 +140,12 @@ describe("registerSubagentNotify", () => {
|
|
|
140
140
|
assert.equal(sent.length, 1);
|
|
141
141
|
});
|
|
142
142
|
|
|
143
|
+
it("does not wake the session when background delivery explicitly disables triggerTurn", async () => {
|
|
144
|
+
const { notifier, sent } = createPi("session-a");
|
|
145
|
+
assert.equal(await notifier.deliver(completionResult({ id: "direct-silent", triggerTurn: false })), true);
|
|
146
|
+
assert.deepEqual(sent[0]!.options, { triggerTurn: false });
|
|
147
|
+
});
|
|
148
|
+
|
|
143
149
|
it("suppresses local delivery after an acknowledged grouped intercom relay", async () => {
|
|
144
150
|
const { notifier, sent } = createPi("session-a");
|
|
145
151
|
assert.equal(await notifier.deliver(completionResult({ id: "intercom-delivered", intercomDelivered: true })), true);
|
|
@@ -163,7 +169,7 @@ describe("registerSubagentNotify", () => {
|
|
|
163
169
|
id: "foreground-run:0",
|
|
164
170
|
runId: "foreground-run",
|
|
165
171
|
source: "foreground",
|
|
166
|
-
agent: "
|
|
172
|
+
agent: "commentator",
|
|
167
173
|
success: true,
|
|
168
174
|
summary: "Recovered final review",
|
|
169
175
|
exitCode: 0,
|
|
@@ -175,7 +181,7 @@ describe("registerSubagentNotify", () => {
|
|
|
175
181
|
assert.deepEqual(sent[0], {
|
|
176
182
|
message: {
|
|
177
183
|
customType: "subagent-notify",
|
|
178
|
-
content: "Detached foreground task completed: **
|
|
184
|
+
content: "Detached foreground task completed: **commentator**\n\nRecovered final review",
|
|
179
185
|
display: true,
|
|
180
186
|
},
|
|
181
187
|
options: { triggerTurn: true },
|
|
@@ -187,7 +193,7 @@ describe("registerSubagentNotify", () => {
|
|
|
187
193
|
events.emit(SUBAGENT_FOREGROUND_COMPLETE_EVENT, {
|
|
188
194
|
id: "foreground-run:0",
|
|
189
195
|
source: "foreground",
|
|
190
|
-
agent: "
|
|
196
|
+
agent: "commentator",
|
|
191
197
|
success: true,
|
|
192
198
|
summary: "Recovered final review",
|
|
193
199
|
timestamp: 123,
|
|
@@ -202,7 +208,7 @@ describe("registerSubagentNotify", () => {
|
|
|
202
208
|
|
|
203
209
|
events.emit(SUBAGENT_ASYNC_COMPLETE_EVENT, {
|
|
204
210
|
id: "notify-summary-1",
|
|
205
|
-
agent: "
|
|
211
|
+
agent: "builder",
|
|
206
212
|
success: true,
|
|
207
213
|
summary,
|
|
208
214
|
exitCode: 0,
|
|
@@ -216,8 +222,8 @@ describe("registerSubagentNotify", () => {
|
|
|
216
222
|
assert.deepEqual(sent[0], {
|
|
217
223
|
message: {
|
|
218
224
|
customType: "subagent-notify",
|
|
219
|
-
content: `Background task completed: **
|
|
220
|
-
display:
|
|
225
|
+
content: `Background task completed: **builder** (2/3)\n\n${summary}`,
|
|
226
|
+
display: false,
|
|
221
227
|
},
|
|
222
228
|
options: { triggerTurn: true },
|
|
223
229
|
});
|
|
@@ -228,7 +234,7 @@ describe("registerSubagentNotify", () => {
|
|
|
228
234
|
|
|
229
235
|
events.emit(SUBAGENT_ASYNC_COMPLETE_EVENT, {
|
|
230
236
|
id: "notify-path-1",
|
|
231
|
-
agent: "
|
|
237
|
+
agent: "builder",
|
|
232
238
|
success: true,
|
|
233
239
|
summary: "Done",
|
|
234
240
|
exitCode: 0,
|
|
@@ -240,8 +246,8 @@ describe("registerSubagentNotify", () => {
|
|
|
240
246
|
assert.deepEqual(sent, [{
|
|
241
247
|
message: {
|
|
242
248
|
customType: "subagent-notify",
|
|
243
|
-
content: "Background task completed: **
|
|
244
|
-
display:
|
|
249
|
+
content: "Background task completed: **builder**\n\nDone\n\nSession file: /tmp/session.jsonl",
|
|
250
|
+
display: false,
|
|
245
251
|
},
|
|
246
252
|
options: { triggerTurn: true },
|
|
247
253
|
}]);
|
|
@@ -252,7 +258,7 @@ describe("registerSubagentNotify", () => {
|
|
|
252
258
|
|
|
253
259
|
events.emit(SUBAGENT_ASYNC_COMPLETE_EVENT, {
|
|
254
260
|
id: "notify-paused-1",
|
|
255
|
-
agent: "
|
|
261
|
+
agent: "builder",
|
|
256
262
|
success: false,
|
|
257
263
|
state: "paused",
|
|
258
264
|
summary: "Paused after interrupt. Waiting for explicit next action.",
|
|
@@ -264,7 +270,7 @@ describe("registerSubagentNotify", () => {
|
|
|
264
270
|
assert.deepEqual(sent[0], {
|
|
265
271
|
message: {
|
|
266
272
|
customType: "subagent-notify",
|
|
267
|
-
content: "Background task paused: **
|
|
273
|
+
content: "Background task paused: **builder**\n\nPaused after interrupt. Waiting for explicit next action.",
|
|
268
274
|
display: true,
|
|
269
275
|
},
|
|
270
276
|
options: { triggerTurn: true },
|
|
@@ -276,7 +282,7 @@ describe("registerSubagentNotify", () => {
|
|
|
276
282
|
|
|
277
283
|
events.emit(SUBAGENT_ASYNC_COMPLETE_EVENT, {
|
|
278
284
|
id: "notify-other-session",
|
|
279
|
-
agent: "
|
|
285
|
+
agent: "builder",
|
|
280
286
|
success: true,
|
|
281
287
|
summary: "Other done",
|
|
282
288
|
timestamp: 100,
|
|
@@ -284,7 +290,7 @@ describe("registerSubagentNotify", () => {
|
|
|
284
290
|
});
|
|
285
291
|
events.emit(SUBAGENT_ASYNC_COMPLETE_EVENT, {
|
|
286
292
|
id: "notify-sessionless",
|
|
287
|
-
agent: "
|
|
293
|
+
agent: "builder",
|
|
288
294
|
success: true,
|
|
289
295
|
summary: "Legacy cwd-scoped done",
|
|
290
296
|
timestamp: 101,
|
|
@@ -327,6 +333,11 @@ describe("registerSubagentNotify", () => {
|
|
|
327
333
|
assert.match(content, /^Background tasks completed \(3\): \*\*alpha\*\*, \*\*beta\*\*, \*\*gamma\*\*/);
|
|
328
334
|
assert.match(content, /1\. alpha\nalpha done/);
|
|
329
335
|
assert.match(content, /3\. gamma\ngamma done/);
|
|
336
|
+
assert.deepEqual(sent[0]!.message, {
|
|
337
|
+
customType: "subagent-notify",
|
|
338
|
+
content,
|
|
339
|
+
display: false,
|
|
340
|
+
});
|
|
330
341
|
assert.deepEqual(sent[0]!.options, { triggerTurn: true });
|
|
331
342
|
});
|
|
332
343
|
|
|
@@ -396,16 +407,16 @@ describe("registerSubagentNotify", () => {
|
|
|
396
407
|
describe("completion formatting helpers", () => {
|
|
397
408
|
it("formats and parses a parallel handoff without folding it into the result preview", () => {
|
|
398
409
|
const content = formatSingleCompletion({
|
|
399
|
-
agent: "
|
|
410
|
+
agent: "builder",
|
|
400
411
|
status: "completed",
|
|
401
412
|
resultPreview: "Done",
|
|
402
413
|
handoffPath: "/tmp/run/handoff.json",
|
|
403
414
|
sessionLabel: "Session file",
|
|
404
415
|
sessionValue: "/tmp/session.jsonl",
|
|
405
416
|
});
|
|
406
|
-
assert.equal(content, "Background task completed: **
|
|
417
|
+
assert.equal(content, "Background task completed: **builder**\n\nDone\n\nParallel handoff: /tmp/run/handoff.json\n\nSession file: /tmp/session.jsonl");
|
|
407
418
|
assert.deepEqual(parseSubagentNotifyContent(content), {
|
|
408
|
-
agent: "
|
|
419
|
+
agent: "builder",
|
|
409
420
|
status: "completed",
|
|
410
421
|
resultPreview: "Done",
|
|
411
422
|
handoffPath: "/tmp/run/handoff.json",
|
|
@@ -414,7 +425,7 @@ describe("completion formatting helpers", () => {
|
|
|
414
425
|
});
|
|
415
426
|
assert.equal(buildCompletionDetails({
|
|
416
427
|
id: "run",
|
|
417
|
-
agent: "
|
|
428
|
+
agent: "builder",
|
|
418
429
|
success: true,
|
|
419
430
|
summary: "Done",
|
|
420
431
|
parallelHandoff: { path: "/tmp/run/handoff.json" },
|
|
@@ -423,32 +434,32 @@ describe("completion formatting helpers", () => {
|
|
|
423
434
|
|
|
424
435
|
it("formatSingleCompletion mirrors the in-handler single message shape", () => {
|
|
425
436
|
const content = formatSingleCompletion({
|
|
426
|
-
agent: "
|
|
437
|
+
agent: "builder",
|
|
427
438
|
status: "completed",
|
|
428
439
|
taskInfo: " (2/3)",
|
|
429
440
|
resultPreview: "Done",
|
|
430
441
|
sessionLabel: "Session file",
|
|
431
442
|
sessionValue: "/tmp/session.jsonl",
|
|
432
443
|
});
|
|
433
|
-
assert.equal(content, "Background task completed: **
|
|
444
|
+
assert.equal(content, "Background task completed: **builder** (2/3)\n\nDone\n\nSession file: /tmp/session.jsonl");
|
|
434
445
|
});
|
|
435
446
|
|
|
436
447
|
it("parses detached foreground notification content for the custom renderer", () => {
|
|
437
448
|
const content = formatSingleCompletion({
|
|
438
|
-
agent: "
|
|
449
|
+
agent: "commentator",
|
|
439
450
|
status: "failed",
|
|
440
451
|
source: "foreground",
|
|
441
452
|
resultPreview: "Acceptance rejected",
|
|
442
453
|
sessionLabel: "Session file",
|
|
443
|
-
sessionValue: "/tmp/
|
|
454
|
+
sessionValue: "/tmp/commentator.jsonl",
|
|
444
455
|
});
|
|
445
456
|
assert.deepEqual(parseSubagentNotifyContent(content), {
|
|
446
|
-
agent: "
|
|
457
|
+
agent: "commentator",
|
|
447
458
|
status: "failed",
|
|
448
459
|
source: "foreground",
|
|
449
460
|
resultPreview: "Acceptance rejected",
|
|
450
461
|
sessionLabel: "session file",
|
|
451
|
-
sessionValue: "/tmp/
|
|
462
|
+
sessionValue: "/tmp/commentator.jsonl",
|
|
452
463
|
});
|
|
453
464
|
});
|
|
454
465
|
|
|
@@ -480,38 +491,21 @@ describe("completion formatting helpers", () => {
|
|
|
480
491
|
assert.equal(buildCompletionDetails({ id: "x", agent: "w", success: true, summary: "ok", exitCode: 0, processSignal: "SIGTERM", timestamp: 1 }).status, "completed");
|
|
481
492
|
});
|
|
482
493
|
|
|
483
|
-
it("
|
|
484
|
-
const details: SubagentNotifyDetails = buildCompletionDetails({ id: "x", agent: null, success: true, summary: "ok", timestamp: 1 });
|
|
485
|
-
assert.equal(details.agent, "unknown");
|
|
486
|
-
assert.equal(details.status, "completed");
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
it("buildCompletionDetails prefers compact child summaries over the run summary", () => {
|
|
494
|
+
it("labels workflow completion and preserves its return/emit/trace preview", () => {
|
|
490
495
|
const details = buildCompletionDetails({
|
|
491
|
-
id: "
|
|
492
|
-
agent: "
|
|
496
|
+
id: "workflow-run",
|
|
497
|
+
agent: "workflow",
|
|
493
498
|
success: true,
|
|
494
|
-
summary: "
|
|
499
|
+
summary: "Workflow completed with 1 child run(s). Return: { answer: 42 } Emitted: ready Trace: 2 event(s).",
|
|
495
500
|
timestamp: 1,
|
|
496
|
-
results: [
|
|
497
|
-
{ agent: "alpha", status: "completed", summary: "Output saved to: /tmp/alpha.md (12 B, 1 line). Read this file if needed." },
|
|
498
|
-
{ agent: "beta", status: "failed", summary: "boom\n\nOutput saved to: /tmp/beta.md (5 B, 1 line). Read this file if needed." },
|
|
499
|
-
],
|
|
500
501
|
});
|
|
501
|
-
assert.
|
|
502
|
-
assert.match(details.resultPreview, /
|
|
503
|
-
assert.doesNotMatch(details.resultPreview, /full child prose that must not leak/);
|
|
502
|
+
assert.equal(details.agent, "workflow");
|
|
503
|
+
assert.match(details.resultPreview, /Return: \{ answer: 42 \}.*Emitted: ready.*Trace: 2 event/);
|
|
504
504
|
});
|
|
505
505
|
|
|
506
|
-
it("buildCompletionDetails
|
|
507
|
-
const details = buildCompletionDetails({
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
success: true,
|
|
511
|
-
summary: "ignored run summary",
|
|
512
|
-
timestamp: 1,
|
|
513
|
-
results: [{ agent: "worker", status: "completed", summary: "Output saved to: /tmp/out.md (8 B, 1 line). Read this file if needed." }],
|
|
514
|
-
});
|
|
515
|
-
assert.equal(details.resultPreview, "Output saved to: /tmp/out.md (8 B, 1 line). Read this file if needed.");
|
|
506
|
+
it("buildCompletionDetails falls back to the unknown agent label", () => {
|
|
507
|
+
const details: SubagentNotifyDetails = buildCompletionDetails({ id: "x", agent: null, success: true, summary: "ok", timestamp: 1 });
|
|
508
|
+
assert.equal(details.agent, "unknown");
|
|
509
|
+
assert.equal(details.status, "completed");
|
|
516
510
|
});
|
|
517
511
|
});
|
|
@@ -26,7 +26,7 @@ const expectedHostPeerRanges = {
|
|
|
26
26
|
const expectedHostDevVersions = {
|
|
27
27
|
"@earendil-works/pi-agent-core": "0.81.0",
|
|
28
28
|
"@earendil-works/pi-ai": "0.81.0",
|
|
29
|
-
"@selesai/code": "0.
|
|
29
|
+
"@selesai/code": "0.7.0",
|
|
30
30
|
"@earendil-works/pi-tui": "0.81.0",
|
|
31
31
|
} satisfies Record<(typeof hostPeerPackages)[number], string>;
|
|
32
32
|
|
|
@@ -56,23 +56,40 @@ test("published extension APIs use supported package entrypoints", async () => {
|
|
|
56
56
|
assert.deepEqual(packageJson.exports, {
|
|
57
57
|
".": "./index.ts",
|
|
58
58
|
"./background-work": "./src/api/background-work.ts",
|
|
59
|
+
"./external-runs": "./src/api/external-runs.ts",
|
|
59
60
|
"./capability-ceiling": "./src/api/capability-ceiling.ts",
|
|
60
61
|
"./delegation": "./src/api/delegation.ts",
|
|
61
62
|
"./preflight": "./src/api/preflight.ts",
|
|
63
|
+
"./control-channel": "./src/api/control-channel.ts",
|
|
64
|
+
"./intercom-bridge": "./src/api/intercom-bridge.ts",
|
|
65
|
+
"./pi-args": "./src/api/pi-args.ts",
|
|
66
|
+
"./shared-types": "./src/api/shared-types.ts",
|
|
62
67
|
});
|
|
63
68
|
const backgroundWork = await import("pi-subagents/background-work");
|
|
64
69
|
assert.equal(backgroundWork.BACKGROUND_WORK_PROTOCOL_VERSION, 1);
|
|
65
70
|
assert.equal(backgroundWork.BACKGROUND_WORK_REGISTRY_KEY, "pi-subagents.background-work.v1");
|
|
71
|
+
const externalRuns = await import("pi-subagents/external-runs");
|
|
72
|
+
assert.equal(externalRuns.EXTERNAL_RUN_REGISTRY_VERSION, 1);
|
|
73
|
+
assert.equal(typeof externalRuns.registerExternalRunProvider, "function");
|
|
66
74
|
const capability = await import("pi-subagents/capability-ceiling");
|
|
67
75
|
assert.equal(capability.SUBAGENT_CAPABILITY_CEILING_VERSION, 1);
|
|
68
76
|
assert.equal(capability.SUBAGENT_CAPABILITY_CEILING_REGISTRY_KEY, "pi-subagents.capability-ceiling.v1");
|
|
69
77
|
const delegation = await import("pi-subagents/delegation");
|
|
70
|
-
assert.equal(delegation.SUBAGENT_DELEGATION_PROTOCOL_VERSION, 1);
|
|
71
|
-
assert.equal(delegation.SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION, 2);
|
|
72
78
|
assert.equal(delegation.SUBAGENT_DELEGATION_REQUEST_EVENT, "prompt-template:subagent:request");
|
|
73
79
|
const preflight = await import("pi-subagents/preflight");
|
|
74
80
|
assert.equal(preflight.SUBAGENT_LAUNCH_CONTRACT_VERSION, 2);
|
|
75
81
|
assert.equal(typeof preflight.resolveSubagentLaunchContract, "function");
|
|
82
|
+
const controlChannel = await import("pi-subagents/control-channel");
|
|
83
|
+
assert.equal(typeof controlChannel.requestAsyncStop, "function");
|
|
84
|
+
const intercomBridge = await import("pi-subagents/intercom-bridge");
|
|
85
|
+
assert.equal(typeof intercomBridge.resolveIntercomSessionTarget, "function");
|
|
86
|
+
const piArgs = await import("pi-subagents/pi-args");
|
|
87
|
+
assert.equal(typeof piArgs.resolvePiLaunchToolPlan, "function");
|
|
88
|
+
assert.equal("buildPiArgs" in piArgs, false);
|
|
89
|
+
const sharedTypes = await import("pi-subagents/shared-types");
|
|
90
|
+
assert.equal(typeof sharedTypes.wrapForkTask, "function");
|
|
91
|
+
assert.equal(typeof sharedTypes.DEFAULT_FORK_PREAMBLE, "string");
|
|
92
|
+
assert.equal("TEMP_ROOT_DIR" in sharedTypes, false);
|
|
76
93
|
});
|
|
77
94
|
|
|
78
95
|
test("direct @earendil-works runtime imports are declared for CI installs", () => {
|
|
@@ -6,6 +6,7 @@ import { describe, it } from "node:test";
|
|
|
6
6
|
import {
|
|
7
7
|
formatParallelHandoffReference,
|
|
8
8
|
writeParallelHandoffGroup,
|
|
9
|
+
writePendingParallelHandoff,
|
|
9
10
|
} from "../../src/runs/shared/parallel-handoff.ts";
|
|
10
11
|
import type { ParallelHandoffManifest } from "../../src/shared/types.ts";
|
|
11
12
|
import type { WorktreeCleanupReport, WorktreeDiff, WorktreeSetup } from "../../src/runs/shared/worktree.ts";
|
|
@@ -46,6 +47,35 @@ function cleanup(state: "complete" | "partial" = "complete"): WorktreeCleanupRep
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
describe("parallel handoff", () => {
|
|
50
|
+
it("journals worktree ownership before child results exist", () => {
|
|
51
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-parallel-handoff-pending-"));
|
|
52
|
+
try {
|
|
53
|
+
const manifestPath = path.join(dir, "handoff.json");
|
|
54
|
+
const reference = writePendingParallelHandoff({
|
|
55
|
+
manifestPath,
|
|
56
|
+
runId: "run-pending",
|
|
57
|
+
mode: "parallel",
|
|
58
|
+
source: "foreground",
|
|
59
|
+
cwd: "/repo",
|
|
60
|
+
stepIndex: 0,
|
|
61
|
+
flatStartIndex: 0,
|
|
62
|
+
setup: {
|
|
63
|
+
...setup("/repo", "base-1"),
|
|
64
|
+
worktrees: [{ path: "/tmp/worktree-0", agentCwd: "/tmp/worktree-0", branch: "branch-0", index: 0, nodeModulesLinked: false, syntheticPaths: [] }],
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
assert.equal(reference.childCount, 0);
|
|
69
|
+
assert.equal(reference.cleanupState, "partial");
|
|
70
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf-8")) as ParallelHandoffManifest;
|
|
71
|
+
assert.equal(manifest.groups[0]?.cleanup.tasks[0]?.path, "/tmp/worktree-0");
|
|
72
|
+
assert.equal(manifest.groups[0]?.cleanup.tasks[0]?.preserved, true);
|
|
73
|
+
assert.match(manifest.groups[0]?.cleanup.tasks[0]?.reason ?? "", /cleanup pending/);
|
|
74
|
+
} finally {
|
|
75
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
49
79
|
it("writes and aggregates versioned worktree handoff groups", () => {
|
|
50
80
|
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-parallel-handoff-"));
|
|
51
81
|
try {
|
|
@@ -59,16 +89,16 @@ describe("parallel handoff", () => {
|
|
|
59
89
|
stepIndex: 2,
|
|
60
90
|
flatStartIndex: 3,
|
|
61
91
|
setup: setup("/repo", "base-1"),
|
|
62
|
-
diffs: [diff(dir, 0, "
|
|
92
|
+
diffs: [diff(dir, 0, "builder", true)],
|
|
63
93
|
cleanup: cleanup(),
|
|
64
94
|
results: [{
|
|
65
|
-
agent: "
|
|
95
|
+
agent: "builder",
|
|
66
96
|
status: "completed",
|
|
67
97
|
summary: "implemented",
|
|
68
98
|
outputPath: "/artifacts/output.md",
|
|
69
99
|
structuredOutput: { ok: true },
|
|
70
100
|
structuredOutputPath: "/artifacts/structured.json",
|
|
71
|
-
sessionPath: "/sessions/
|
|
101
|
+
sessionPath: "/sessions/builder.jsonl",
|
|
72
102
|
}],
|
|
73
103
|
now: 100,
|
|
74
104
|
});
|
|
@@ -90,9 +120,9 @@ describe("parallel handoff", () => {
|
|
|
90
120
|
stepIndex: 1,
|
|
91
121
|
flatStartIndex: 1,
|
|
92
122
|
setup: setup("/repo", "base-1"),
|
|
93
|
-
diffs: [diff(dir, 1, "
|
|
123
|
+
diffs: [diff(dir, 1, "commentator", false)],
|
|
94
124
|
cleanup: cleanup("partial"),
|
|
95
|
-
results: [{ agent: "
|
|
125
|
+
results: [{ agent: "commentator", status: "failed", summary: "blocked" }],
|
|
96
126
|
now: 200,
|
|
97
127
|
});
|
|
98
128
|
assert.equal(second.groupCount, 2);
|
|
@@ -159,9 +189,9 @@ describe("parallel handoff", () => {
|
|
|
159
189
|
stepIndex: 0,
|
|
160
190
|
flatStartIndex: 0,
|
|
161
191
|
setup: setup("/repo", "base-1"),
|
|
162
|
-
diffs: [diff(dir, 0, "
|
|
192
|
+
diffs: [diff(dir, 0, "builder", false)],
|
|
163
193
|
cleanup: cleanup(),
|
|
164
|
-
results: [{ agent: "
|
|
194
|
+
results: [{ agent: "builder", status: "completed" as const, summary: "done" }],
|
|
165
195
|
};
|
|
166
196
|
writeParallelHandoffGroup({ ...common, runId: "run-1" });
|
|
167
197
|
assert.throws(
|
|
@@ -49,11 +49,11 @@ describe("flattenSteps", () => {
|
|
|
49
49
|
|
|
50
50
|
it("expands parallel groups into individual steps", () => {
|
|
51
51
|
const steps: RunnerStep[] = [
|
|
52
|
-
{ agent: "
|
|
52
|
+
{ agent: "explorer", task: "find info" },
|
|
53
53
|
{
|
|
54
54
|
parallel: [
|
|
55
|
-
{ agent: "
|
|
56
|
-
{ agent: "
|
|
55
|
+
{ agent: "commentator-a", task: "review part 1" },
|
|
56
|
+
{ agent: "commentator-b", task: "review part 2" },
|
|
57
57
|
],
|
|
58
58
|
},
|
|
59
59
|
{ agent: "summarizer", task: "combine" },
|
|
@@ -62,7 +62,7 @@ describe("flattenSteps", () => {
|
|
|
62
62
|
assert.equal(flat.length, 4);
|
|
63
63
|
assert.deepEqual(
|
|
64
64
|
flat.map((s) => s.agent),
|
|
65
|
-
["
|
|
65
|
+
["explorer", "commentator-a", "commentator-b", "summarizer"],
|
|
66
66
|
);
|
|
67
67
|
});
|
|
68
68
|
|
|
@@ -149,8 +149,8 @@ describe("mapConcurrent", () => {
|
|
|
149
149
|
// All workers should start nearly simultaneously
|
|
150
150
|
const d1 = startTimes[1]! - startTimes[0]!;
|
|
151
151
|
const d2 = startTimes[2]! - startTimes[0]!;
|
|
152
|
-
assert.ok(d1 < 20, `
|
|
153
|
-
assert.ok(d2 < 20, `
|
|
152
|
+
assert.ok(d1 < 20, `builder 1 should start immediately, got ${d1}ms delay`);
|
|
153
|
+
assert.ok(d2 < 20, `builder 2 should start immediately, got ${d2}ms delay`);
|
|
154
154
|
});
|
|
155
155
|
|
|
156
156
|
it("notifies scheduling settlement only after workers outliving an early rejection stop", async () => {
|
|
@@ -222,12 +222,12 @@ describe("DEFAULT_GLOBAL_CONCURRENCY_LIMIT", () => {
|
|
|
222
222
|
describe("aggregateParallelOutputs", () => {
|
|
223
223
|
it("aggregates successful outputs with headers", () => {
|
|
224
224
|
const result = aggregateParallelOutputs([
|
|
225
|
-
{ agent: "
|
|
226
|
-
{ agent: "
|
|
225
|
+
{ agent: "commentator-a", output: "Looks good", exitCode: 0 },
|
|
226
|
+
{ agent: "commentator-b", output: "Needs fixes", exitCode: 0 },
|
|
227
227
|
]);
|
|
228
|
-
assert.ok(result.includes("=== Parallel Task 1 (
|
|
228
|
+
assert.ok(result.includes("=== Parallel Task 1 (commentator-a) ==="));
|
|
229
229
|
assert.ok(result.includes("Looks good"));
|
|
230
|
-
assert.ok(result.includes("=== Parallel Task 2 (
|
|
230
|
+
assert.ok(result.includes("=== Parallel Task 2 (commentator-b) ==="));
|
|
231
231
|
assert.ok(result.includes("Needs fixes"));
|
|
232
232
|
});
|
|
233
233
|
|
|
@@ -96,7 +96,7 @@ describe("path.join vs template string concatenation", () => {
|
|
|
96
96
|
|
|
97
97
|
it("parallel subdir naming should use path.join", () => {
|
|
98
98
|
// settings.ts:302,306 pattern: `${subdir}/${task.output}`
|
|
99
|
-
const subdir = "parallel-0/0-_code-
|
|
99
|
+
const subdir = "parallel-0/0-_code-commentator";
|
|
100
100
|
const output = "review.md";
|
|
101
101
|
|
|
102
102
|
const templateResult = `${subdir}/${output}`;
|
|
@@ -104,10 +104,10 @@ describe("path.join vs template string concatenation", () => {
|
|
|
104
104
|
|
|
105
105
|
// Both produce forward slashes here (subdir itself uses /).
|
|
106
106
|
// But if subdir comes from path.join on Windows, it would have backslashes.
|
|
107
|
-
const windowsSubdir = path.join("parallel-0", "0-_code-
|
|
107
|
+
const windowsSubdir = path.join("parallel-0", "0-_code-commentator");
|
|
108
108
|
const windowsJoin = path.join(windowsSubdir, output);
|
|
109
109
|
// Consistent: all native separators
|
|
110
|
-
assert.equal(windowsJoin, path.join("parallel-0", "0-_code-
|
|
110
|
+
assert.equal(windowsJoin, path.join("parallel-0", "0-_code-commentator", output));
|
|
111
111
|
});
|
|
112
112
|
});
|
|
113
113
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { describe, it } from "node:test";
|
|
3
|
+
import {
|
|
4
|
+
decodePermissionRules,
|
|
5
|
+
encodePermissionRules,
|
|
6
|
+
permissionArgsPreview,
|
|
7
|
+
permissionDecision,
|
|
8
|
+
resolvePermissionRules,
|
|
9
|
+
validatePermissionConfig,
|
|
10
|
+
validatePermissionRules,
|
|
11
|
+
} from "../../src/runs/shared/permissions.ts";
|
|
12
|
+
|
|
13
|
+
describe("native child permissions", () => {
|
|
14
|
+
it("defaults every unconfigured tool and bash to pass-through", () => {
|
|
15
|
+
assert.equal(permissionDecision(undefined, "write"), "allow");
|
|
16
|
+
assert.equal(permissionDecision({ write: "deny" }, "unknown_tool"), "allow");
|
|
17
|
+
assert.equal(permissionDecision({ write: "deny" }, "bash"), "allow");
|
|
18
|
+
assert.equal(resolvePermissionRules(), undefined);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("merges explicit global and agent rules while removing explicit allow rules", () => {
|
|
22
|
+
assert.deepEqual(resolvePermissionRules(
|
|
23
|
+
{ rules: { write: "ask", edit: "deny" } },
|
|
24
|
+
{ write: "allow", read: "deny" },
|
|
25
|
+
), { edit: "deny", read: "deny" });
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("rejects bash and coordination-tool rules", () => {
|
|
29
|
+
assert.throws(() => validatePermissionRules({ bash: "ask" }, "permissions"), /pi-guard/);
|
|
30
|
+
assert.throws(() => validatePermissionRules({ contact_supervisor: "deny" }, "permissions"), /reserved for child coordination/);
|
|
31
|
+
assert.throws(() => validatePermissionConfig({ rules: { write: "sometimes" } }), /allow, ask, or deny/);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("round-trips only explicit non-allow rules and redacts bounded previews", () => {
|
|
35
|
+
const encoded = encodePermissionRules({ write: "ask" });
|
|
36
|
+
assert.deepEqual(decodePermissionRules(encoded), { write: "ask" });
|
|
37
|
+
const preview = permissionArgsPreview({ token: "secret-value", content: `Bearer abcdefghijklmnop ${"x".repeat(3000)}` });
|
|
38
|
+
assert.doesNotMatch(preview, /secret-value|abcdefghijklmnop/);
|
|
39
|
+
assert.ok(Buffer.byteLength(preview) <= 2048);
|
|
40
|
+
|
|
41
|
+
const multibytePreview = permissionArgsPreview({ content: Array.from({ length: 10 }, () => "😀".repeat(300)) });
|
|
42
|
+
assert.ok(Buffer.byteLength(multibytePreview, "utf-8") <= 2048);
|
|
43
|
+
assert.doesNotMatch(multibytePreview, /�/);
|
|
44
|
+
assert.match(multibytePreview, /…$/);
|
|
45
|
+
});
|
|
46
|
+
});
|