@selesai/code 0.8.3 → 0.8.4
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 +5 -0
- package/dist/extensions/handoff-new.ts +1 -1
- package/dist/extensions/inline-skills.test.ts +1 -0
- package/dist/extensions/inline-skills.ts +1 -1
- package/dist/extensions/pi-intercom/CHANGELOG.md +25 -3
- package/dist/extensions/pi-intercom/README.md +34 -15
- package/dist/extensions/pi-intercom/broker/broker.ts +38 -141
- package/dist/extensions/pi-intercom/broker/client-liveness.test.ts +173 -0
- package/dist/extensions/pi-intercom/broker/client.ts +78 -150
- package/dist/extensions/pi-intercom/broker/extension-state.ts +18 -7
- package/dist/extensions/pi-intercom/broker/framing.ts +1 -1
- package/dist/extensions/pi-intercom/broker/protocol.ts +182 -0
- package/dist/extensions/pi-intercom/broker/spawn.test.ts +106 -7
- package/dist/extensions/pi-intercom/broker/spawn.ts +37 -11
- package/dist/extensions/pi-intercom/config.test.ts +8 -10
- package/dist/extensions/pi-intercom/config.ts +3 -3
- package/dist/extensions/pi-intercom/index.ts +218 -147
- package/dist/extensions/pi-intercom/intercom.integration.test.ts +891 -103
- package/dist/extensions/pi-intercom/package.json +3 -2
- package/dist/extensions/pi-intercom/project-agent.test.ts +145 -0
- package/dist/extensions/pi-intercom/project-agent.ts +324 -0
- package/dist/extensions/pi-intercom/reply-tracker.test.ts +86 -1
- package/dist/extensions/pi-intercom/reply-tracker.ts +41 -9
- package/dist/extensions/pi-intercom/skills/pi-intercom/SKILL.md +49 -9
- package/dist/extensions/pi-intercom/test/inline-message.test.ts +9 -9
- package/dist/extensions/pi-intercom/types.ts +3 -1
- package/dist/extensions/pi-intercom/ui/inline-message.ts +7 -7
- package/dist/extensions/pi-powerline-footer/.github/workflows/test.yml +2 -2
- package/dist/extensions/pi-powerline-footer/CHANGELOG.md +14 -1
- package/dist/extensions/pi-powerline-footer/README.md +20 -37
- package/dist/extensions/pi-powerline-footer/bash-mode/completion.ts +40 -25
- package/dist/extensions/pi-powerline-footer/bash-mode/editor.ts +149 -18
- package/dist/extensions/pi-powerline-footer/bash-mode/types.ts +1 -0
- package/dist/extensions/pi-powerline-footer/editor-performance.ts +99 -0
- package/dist/extensions/pi-powerline-footer/git-status.ts +15 -0
- package/dist/extensions/pi-powerline-footer/index.ts +394 -317
- package/dist/extensions/pi-powerline-footer/package.json +1 -1
- package/dist/extensions/pi-powerline-footer/powerline-config.ts +0 -12
- package/dist/extensions/pi-powerline-footer/queue/store.ts +8 -56
- package/dist/extensions/pi-powerline-footer/queue/types.ts +1 -2
- package/dist/extensions/pi-powerline-footer/segments.ts +0 -3
- package/dist/extensions/pi-powerline-footer/tests/bash-mode.test.ts +231 -1
- package/dist/extensions/pi-powerline-footer/tests/custom-items.test.ts +5 -19
- package/dist/extensions/pi-powerline-footer/tests/editor-performance.test.ts +43 -0
- package/dist/extensions/pi-powerline-footer/tests/git-optional-locks.test.ts +64 -0
- package/dist/extensions/pi-powerline-footer/tests/jump-shortcuts.test.ts +116 -0
- package/dist/extensions/pi-powerline-footer/tests/queue-store.test.ts +19 -149
- package/dist/extensions/pi-powerline-footer/tests/remaining-regressions.test.ts +6 -0
- package/dist/extensions/pi-powerline-footer/tests/usage-display.test.ts +5 -5
- package/dist/extensions/pi-powerline-footer/types.ts +1 -2
- package/dist/extensions/pi-subagents/CHANGELOG.md +202 -14
- package/dist/extensions/pi-subagents/README.md +65 -1614
- package/dist/extensions/pi-subagents/agents/builder.md +0 -1
- package/dist/extensions/pi-subagents/agents/delegate.md +14 -0
- package/dist/extensions/pi-subagents/agents/oracle.md +74 -0
- package/dist/extensions/pi-subagents/agents/reviewer.md +78 -0
- package/dist/extensions/pi-subagents/agents/scout.md +50 -0
- package/dist/extensions/pi-subagents/agents/worker.md +58 -0
- package/dist/extensions/pi-subagents/docs/configuration.md +328 -0
- package/dist/extensions/pi-subagents/docs/extension-api.md +308 -0
- package/dist/extensions/pi-subagents/docs/missions.md +119 -0
- package/dist/extensions/pi-subagents/docs/models.md +192 -0
- package/dist/extensions/pi-subagents/docs/observability.md +174 -0
- package/dist/extensions/pi-subagents/docs/tool-reference.md +343 -0
- package/dist/extensions/pi-subagents/docs/watchdog.md +176 -0
- package/dist/extensions/pi-subagents/docs/workflows.md +163 -0
- package/dist/extensions/pi-subagents/inspector-runner.mjs +11 -0
- package/dist/extensions/pi-subagents/package-lock.json +152 -194
- package/dist/extensions/pi-subagents/package.json +9 -10
- package/dist/extensions/pi-subagents/prompts/gather-context-and-clarify.md +1 -1
- package/dist/extensions/pi-subagents/prompts/parallel-cleanup.md +9 -9
- package/dist/extensions/pi-subagents/prompts/parallel-research.md +6 -6
- package/dist/extensions/pi-subagents/prompts/parallel-review.md +8 -8
- package/dist/extensions/pi-subagents/prompts/review-loop.md +12 -12
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +22 -17
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +77 -72
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +177 -69
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +28 -8
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +88 -66
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +3 -3
- package/dist/extensions/pi-subagents/src/agents/agent-refinements.ts +624 -0
- package/dist/extensions/pi-subagents/src/agents/agents.ts +29 -16
- package/dist/extensions/pi-subagents/src/agents/frontmatter.ts +7 -3
- package/dist/extensions/pi-subagents/src/agents/proactive-skills.ts +2 -2
- package/dist/extensions/pi-subagents/src/agents/skills.ts +2 -9
- package/dist/extensions/pi-subagents/src/api/delegation.ts +1 -2
- package/dist/extensions/pi-subagents/src/api/project-panes.ts +30 -0
- package/dist/extensions/pi-subagents/src/extension/config.ts +56 -8
- package/dist/extensions/pi-subagents/src/extension/control-notices.ts +2 -2
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +51 -26
- package/dist/extensions/pi-subagents/src/extension/index.ts +119 -50
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +72 -0
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +15 -15
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +58 -21
- package/dist/extensions/pi-subagents/src/extension/subagent-guide.ts +39 -0
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +47 -25
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +3 -3
- package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +460 -64
- package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +102 -4
- package/dist/extensions/pi-subagents/src/missions/actions.ts +77 -16
- package/dist/extensions/pi-subagents/src/missions/goal-driver.ts +162 -0
- package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +65 -14
- package/dist/extensions/pi-subagents/src/missions/store.ts +147 -5
- package/dist/extensions/pi-subagents/src/missions/types.ts +58 -3
- package/dist/extensions/pi-subagents/src/missions/workflow-state.ts +256 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +8 -8
- package/dist/extensions/pi-subagents/src/runs/background/active-run-index.ts +42 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +41 -7
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +294 -134
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +19 -3
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +39 -6
- package/dist/extensions/pi-subagents/src/runs/background/completion-replay.ts +267 -0
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +145 -60
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +114 -6
- package/dist/extensions/pi-subagents/src/runs/background/resume-guidance.ts +33 -0
- package/dist/extensions/pi-subagents/src/runs/background/retained-children.ts +68 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +71 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +21 -2
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +42 -14
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +12 -24
- package/dist/extensions/pi-subagents/src/runs/background/steering.ts +7 -5
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +152 -68
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +17 -4
- package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +146 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +21 -5
- package/dist/extensions/pi-subagents/src/runs/foreground/async-dismiss-action.ts +85 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +43 -18
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-clarify.ts +20 -19
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +3 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +55 -26
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +137 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +798 -112
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +187 -0
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +165 -22
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +2 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +9 -5
- package/dist/extensions/pi-subagents/src/runs/shared/model-scope.ts +12 -2
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +1 -0
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +465 -116
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +10 -10
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +189 -32
- package/dist/extensions/pi-subagents/src/runs/shared/task-intent.ts +2 -2
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +3 -3
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +128 -3
- package/dist/extensions/pi-subagents/src/shared/display-text.ts +100 -0
- package/dist/extensions/pi-subagents/src/shared/file-coalescer.ts +9 -0
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +13 -0
- package/dist/extensions/pi-subagents/src/shared/formatters.ts +4 -6
- package/dist/extensions/pi-subagents/src/shared/prompt-resources.ts +51 -0
- package/dist/extensions/pi-subagents/src/shared/settings.ts +41 -11
- package/dist/extensions/pi-subagents/src/shared/types.ts +100 -3
- package/dist/extensions/pi-subagents/src/shared/utf8.ts +11 -0
- package/dist/extensions/pi-subagents/src/shared/utils.ts +43 -33
- package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +1 -14
- package/dist/extensions/pi-subagents/src/slash/inline-subagents.ts +1 -1
- package/dist/extensions/pi-subagents/src/slash/prompt-template-bridge.ts +14 -12
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +176 -21
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +12 -6
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +52 -18
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +36 -5
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +30 -16
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +151 -31
- package/dist/extensions/pi-subagents/src/tui/render.ts +201 -68
- package/dist/extensions/pi-subagents/src/types/pi-runtime-compat.d.ts +0 -6
- package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +5 -4
- package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +0 -1
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +313 -25
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +15 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/cli.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/args.d.ts +57 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/config-selector.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/file-processor.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/initial-message.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/list-models.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/project-trust.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/session-picker.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/startup-ui.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/config.d.ts +96 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-runtime.d.ts +119 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-services.d.ts +85 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session.d.ts +620 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-guidance.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-storage.d.ts +56 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/bash-executor.d.ts +32 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/cache-stats.d.ts +49 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/branch-summarization.d.ts +93 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/compaction.d.ts +128 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/index.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/utils.d.ts +38 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/defaults.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/diagnostics.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/event-bus.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/exec.d.ts +29 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/experimental.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/index.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/index.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/loader.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/runner.d.ts +171 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/types.d.ts +1261 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/wrapper.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/footer-data-provider.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/index.d.ts +13 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/keybindings.d.ts +358 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/messages.d.ts +77 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-config.d.ts +512 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-registry.d.ts +43 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-resolver.d.ts +121 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-runtime.d.ts +82 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/models-store.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/output-guard.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/package-manager.d.ts +210 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/project-trust.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/prompt-templates.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-attribution.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-composer.d.ts +55 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/radius.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/remote-catalog-provider.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resource-loader.d.ts +206 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/sdk.d.ts +106 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-cwd.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-manager.d.ts +356 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/settings-manager.d.ts +297 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/skills.d.ts +60 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/slash-commands.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/source-info.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/system-prompt.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/telemetry.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/timings.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/bash.d.ts +68 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit-diff.d.ts +106 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit.d.ts +51 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/find.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/grep.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/index.d.ts +40 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/ls.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/read.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/render-utils.d.ts +24 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/truncate.d.ts +70 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/write.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/trust-manager.d.ts +36 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/usage-totals.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/client.d.ts +61 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/huggingface.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/index.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/provider.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/ui.d.ts +42 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/index.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/main.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/migrations.d.ts +33 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/index.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/assistant-message.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bash-execution.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/config-selector.d.ts +102 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-editor.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-selector.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/footer.d.ts +32 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/index.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/login-dialog.d.ts +52 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/model-selector.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/settings-selector.d.ts +77 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/status-indicator.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tool-execution.d.ts +63 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tree-selector.d.ts +94 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/interactive-mode.d.ts +394 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme-controller.d.ts +29 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme.d.ts +120 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/print-mode.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-client.d.ts +246 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-types.d.ts +457 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/package-manager-cli.d.ts +8 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/rpc-entry.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/ansi.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/changelog.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/child-process.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-native.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/deprecation.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/frontmatter.d.ts +8 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/fs-watch.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/git.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/html.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-convert.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-process.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/json.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/mime.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/open-browser.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/paths.d.ts +31 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/photon.d.ts +21 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/pi-user-agent.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/shell.d.ts +31 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/sleep.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/tools-manager.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/version-check.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/index.mjs +84 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/package.json +14 -0
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +15 -15
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +411 -300
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +309 -123
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +99 -56
- package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +62 -16
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +159 -108
- package/dist/extensions/pi-subagents/test/integration/detect-error.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +4 -2
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +56 -56
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +114 -45
- package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +57 -19
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +106 -106
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +416 -106
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +287 -17
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +809 -87
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +107 -20
- package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +26 -6
- package/dist/extensions/pi-subagents/test/integration/top-level-async.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/support/helpers.ts +2 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +1 -1
- package/dist/extensions/pi-subagents/test/support/ts-loader.mjs +0 -8
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +163 -58
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +15 -15
- package/dist/extensions/pi-subagents/test/unit/agent-eject-disable.test.ts +66 -66
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +334 -248
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +52 -52
- package/dist/extensions/pi-subagents/test/unit/agent-memory.test.ts +26 -26
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +99 -99
- package/dist/extensions/pi-subagents/test/unit/agent-refinements.test.ts +160 -0
- package/dist/extensions/pi-subagents/test/unit/agent-selection.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +43 -1
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +36 -10
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +387 -30
- package/dist/extensions/pi-subagents/test/unit/async-permission-session.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +94 -40
- package/dist/extensions/pi-subagents/test/unit/background-work.test.ts +5 -3
- package/dist/extensions/pi-subagents/test/unit/builtin-agent-documentation.test.ts +7 -7
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-agent-allowlist.test.ts +19 -19
- package/dist/extensions/pi-subagents/test/unit/chain-append.test.ts +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-transcript.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +35 -5
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +52 -52
- package/dist/extensions/pi-subagents/test/unit/completion-replay.test.ts +187 -0
- package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +125 -71
- package/dist/extensions/pi-subagents/test/unit/control-notices.test.ts +18 -3
- package/dist/extensions/pi-subagents/test/unit/default-extensions.test.ts +12 -12
- package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +17 -23
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +25 -25
- package/dist/extensions/pi-subagents/test/unit/extra-agent-dirs.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/file-coalescer.test.ts +15 -0
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +62 -44
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +329 -37
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +4 -4
- package/dist/extensions/pi-subagents/test/unit/foreground-tool-call-compaction.test.ts +37 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector-bootstrap.test.ts +69 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +79 -2
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +102 -49
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +98 -32
- package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +5 -5
- package/dist/extensions/pi-subagents/test/unit/mission-goal-driver.test.ts +116 -0
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +55 -7
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +289 -13
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +28 -1
- package/dist/extensions/pi-subagents/test/unit/model-scope-settings.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/model-scope.test.ts +11 -2
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +84 -10
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +122 -8
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +8 -8
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +24 -24
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +16 -2
- package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +7 -7
- package/dist/extensions/pi-subagents/test/unit/parallel-utils.test.ts +10 -10
- package/dist/extensions/pi-subagents/test/unit/path-handling.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/path-resolution.test.ts +26 -17
- package/dist/extensions/pi-subagents/test/unit/pi-args-permission-system.test.ts +405 -0
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +357 -92
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +22 -6
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +6 -6
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +43 -43
- package/dist/extensions/pi-subagents/test/unit/proactive-skills.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/process-terminal.test.ts +4 -4
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +19 -19
- package/dist/extensions/pi-subagents/test/unit/project-panes-public-api.test.ts +243 -0
- package/dist/extensions/pi-subagents/test/unit/prompt-template-bridge.test.ts +68 -168
- package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +58 -15
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +40 -0
- package/dist/extensions/pi-subagents/test/unit/reads-resolution.test.ts +66 -0
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +47 -28
- package/dist/extensions/pi-subagents/test/unit/result-intercom.test.ts +12 -12
- package/dist/extensions/pi-subagents/test/unit/retained-children.test.ts +57 -0
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +107 -27
- 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 +56 -50
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +69 -28
- package/dist/extensions/pi-subagents/test/unit/scheduled-store-root.test.ts +67 -0
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +59 -44
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +424 -49
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +23 -1
- package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +32 -5
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +120 -91
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-action-recovery.test.ts +85 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +35 -35
- package/dist/extensions/pi-subagents/test/unit/subagent-guide.test.ts +24 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +312 -22
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +150 -15
- package/dist/extensions/pi-subagents/test/unit/task-intent.test.ts +26 -26
- package/dist/extensions/pi-subagents/test/unit/timeout-defaults.test.ts +73 -0
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +76 -25
- package/dist/extensions/pi-subagents/test/unit/turn-budget.test.ts +5 -5
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +55 -6
- package/dist/extensions/pi-subagents/test/unit/watchdog-child-status.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/watchdog-lsp-diagnostics.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/watchdog-runtime.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/watchdog-settings.test.ts +8 -8
- package/dist/extensions/pi-subagents/test/unit/widget-nested-render.test.ts +6 -6
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +138 -11
- package/dist/extensions/pi-subagents/test/unit/workflow-graph.test.ts +8 -8
- package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +113 -0
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +7 -7
- package/dist/extensions/pi-subagents/test/unit/writer-budget-guidance.test.ts +6 -6
- package/dist/extensions/workflow/extension.ts +21 -19
- package/dist/extensions/workflow/modes.ts +65 -0
- package/dist/skills/pi-subagents/SKILL.md +20 -15
- package/dist/skills/pi-subagents/references/constraints-and-recipes.md +77 -83
- package/dist/skills/pi-subagents/references/execution-controls.md +215 -106
- package/dist/skills/pi-subagents/references/management-authoring-rpc.md +29 -9
- package/dist/skills/pi-subagents/references/prompting-and-roles.md +58 -43
- package/docs/plans/workflow-autoloop-reference.md +192 -0
- package/docs/plans/workflow-subagent-consolidation-planb.md +374 -0
- package/docs/plans/workflow-subagent-scripted-merge.md +406 -0
- package/package.json +1 -1
- package/dist/extensions/workflow/adapter.ts +0 -949
- package/dist/extensions/workflow/modes/loop.ts +0 -74
- package/dist/extensions/workflow/modes/prototype.ts +0 -170
- package/dist/extensions/workflow/modes/quicktype.ts +0 -150
- package/dist/extensions/workflow/modes/task.ts +0 -105
- package/dist/extensions/workflow/run-state.ts +0 -124
- package/dist/extensions/workflow/state-machine.ts +0 -484
- package/dist/extensions/workflow/validators.ts +0 -42
|
@@ -10,6 +10,9 @@ const { inspect } = require("node:util");
|
|
|
10
10
|
let nextCallId = 0;
|
|
11
11
|
const pending = new Map();
|
|
12
12
|
const runKeyPattern = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
|
|
13
|
+
const trackedPromisePatch = Symbol("trackedPromisePatch");
|
|
14
|
+
const trackedPromiseObservations = new WeakMap();
|
|
15
|
+
let suppressRunObservation = 0;
|
|
13
16
|
|
|
14
17
|
function stableRunJson(value) {
|
|
15
18
|
if (Array.isArray(value)) return "[" + value.map(stableRunJson).join(",") + "]";
|
|
@@ -17,12 +20,124 @@ function stableRunJson(value) {
|
|
|
17
20
|
return JSON.stringify(value) ?? "undefined";
|
|
18
21
|
}
|
|
19
22
|
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
function isDirectWorkflowScriptPromiseHandlerCall() {
|
|
24
|
+
const stack = new Error().stack;
|
|
25
|
+
if (typeof stack !== "string") return false;
|
|
26
|
+
const frame = stack.split("\n").slice(1).map((line) => line.trim()).find((line) =>
|
|
27
|
+
line &&
|
|
28
|
+
!line.includes("isDirectWorkflowScriptPromiseHandlerCall") &&
|
|
29
|
+
!line.includes("markObserved") &&
|
|
30
|
+
!line.includes("promise.then") &&
|
|
31
|
+
!line.includes("promise.catch") &&
|
|
32
|
+
!line.includes("promise.finally")
|
|
33
|
+
);
|
|
34
|
+
return frame ? frame.includes("workflow-script.js") && !frame.includes("at async ") : false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function mergeObservations(...groups) {
|
|
38
|
+
const seen = new Set();
|
|
39
|
+
const merged = [];
|
|
40
|
+
for (const group of groups) {
|
|
41
|
+
for (const observation of group) {
|
|
42
|
+
if (!observation || typeof observation.callId !== "number" || typeof observation.key !== "string" || seen.has(observation.callId)) continue;
|
|
43
|
+
seen.add(observation.callId);
|
|
44
|
+
merged.push(observation);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return merged;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function trackedObservations(value) {
|
|
51
|
+
return value && (typeof value === "object" || typeof value === "function") ? trackedPromiseObservations.get(value) ?? [] : [];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function withSuppressedRunObservation(callback) {
|
|
55
|
+
suppressRunObservation += 1;
|
|
56
|
+
try {
|
|
57
|
+
return callback();
|
|
58
|
+
} finally {
|
|
59
|
+
suppressRunObservation -= 1;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function trackRunObservation(observations, promise) {
|
|
64
|
+
const merged = mergeObservations(trackedObservations(promise), observations);
|
|
65
|
+
if (merged.length === 0 || !promise || typeof promise.then !== "function") return promise;
|
|
66
|
+
trackedPromiseObservations.set(promise, merged);
|
|
67
|
+
if (promise[trackedPromisePatch]) return promise;
|
|
68
|
+
|
|
69
|
+
const observedCallIds = new Set();
|
|
70
|
+
const markObserved = () => {
|
|
71
|
+
if (suppressRunObservation > 0 || isDirectWorkflowScriptPromiseHandlerCall()) return;
|
|
72
|
+
for (const observation of trackedObservations(promise)) {
|
|
73
|
+
if (observedCallIds.has(observation.callId)) continue;
|
|
74
|
+
observedCallIds.add(observation.callId);
|
|
75
|
+
parentPort.postMessage({ type: "runObserved", callId: observation.callId, key: observation.key });
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const originalThen = promise.then.bind(promise);
|
|
79
|
+
const originalCatch = promise.catch.bind(promise);
|
|
80
|
+
const originalFinally = promise.finally.bind(promise);
|
|
81
|
+
Object.defineProperty(promise, trackedPromisePatch, { value: true });
|
|
82
|
+
promise.then = (onFulfilled, onRejected) => {
|
|
83
|
+
markObserved();
|
|
84
|
+
return trackRunObservation(trackedObservations(promise), originalThen(onFulfilled, onRejected));
|
|
85
|
+
};
|
|
86
|
+
promise.catch = (onRejected) => {
|
|
87
|
+
markObserved();
|
|
88
|
+
return trackRunObservation(trackedObservations(promise), originalCatch(onRejected));
|
|
89
|
+
};
|
|
90
|
+
promise.finally = (onFinally) => {
|
|
91
|
+
markObserved();
|
|
92
|
+
return trackRunObservation(trackedObservations(promise), originalFinally(onFinally));
|
|
93
|
+
};
|
|
94
|
+
return promise;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function trackPromiseCombinator(items, createPromise) {
|
|
98
|
+
const values = Array.from(items);
|
|
99
|
+
const observations = mergeObservations(...values.map(trackedObservations));
|
|
100
|
+
const promise = withSuppressedRunObservation(() => createPromise(values));
|
|
101
|
+
return observations.length > 0 ? trackRunObservation(observations, promise) : promise;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const workflowPromise = new Proxy(Promise, {
|
|
105
|
+
construct(target, args) {
|
|
106
|
+
return new target(...args);
|
|
107
|
+
},
|
|
108
|
+
get(target, prop) {
|
|
109
|
+
if (prop === "all") return (items) => trackPromiseCombinator(items, (values) => target.all(values));
|
|
110
|
+
if (prop === "allSettled") return (items) => trackPromiseCombinator(items, (values) => target.allSettled(values));
|
|
111
|
+
if (prop === "race") return (items) => trackPromiseCombinator(items, (values) => target.race(values));
|
|
112
|
+
if (prop === "any") return (items) => trackPromiseCombinator(items, (values) => target.any(values));
|
|
113
|
+
if (prop === "resolve") return (value) => {
|
|
114
|
+
const observations = trackedObservations(value);
|
|
115
|
+
const promise = withSuppressedRunObservation(() => target.resolve(value));
|
|
116
|
+
return observations.length > 0 ? trackRunObservation(observations, promise) : promise;
|
|
117
|
+
};
|
|
118
|
+
const value = target[prop];
|
|
119
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
function hostCall(method, args, observation) {
|
|
124
|
+
const callId = ++nextCallId;
|
|
125
|
+
const promise = new Promise((resolve, reject) => {
|
|
23
126
|
pending.set(callId, { resolve, reject });
|
|
24
127
|
parentPort.postMessage({ type: "call", callId, method, args });
|
|
25
128
|
});
|
|
129
|
+
return observation && typeof observation.key === "string"
|
|
130
|
+
? trackRunObservation([{ key: observation.key, callId }], promise)
|
|
131
|
+
: promise;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function runHostCall(key, params, collectFailure) {
|
|
135
|
+
const callId = ++nextCallId;
|
|
136
|
+
const promise = new Promise((resolve, reject) => {
|
|
137
|
+
pending.set(callId, { resolve, reject });
|
|
138
|
+
parentPort.postMessage({ type: "call", callId, method: "run", args: { key, params, ...(collectFailure ? { collectFailure: true } : {}) } });
|
|
139
|
+
});
|
|
140
|
+
return { key, callId, promise };
|
|
26
141
|
}
|
|
27
142
|
|
|
28
143
|
function formatRef(result) {
|
|
@@ -37,11 +152,17 @@ const runFingerprints = new Map();
|
|
|
37
152
|
function validateRunCall(key, params, label, fingerprints) {
|
|
38
153
|
if (typeof key !== "string" || !runKeyPattern.test(key)) throw new Error(label + " has an invalid key.");
|
|
39
154
|
if (!params || typeof params !== "object" || Array.isArray(params)) throw new Error(label + " requires a params object.");
|
|
40
|
-
if (Object.prototype.hasOwnProperty.call(params, "action") || Object.prototype.hasOwnProperty.call(params, "workflowScript") || Object.prototype.hasOwnProperty.call(params, "tasks") || Object.prototype.hasOwnProperty.call(params, "chain") || Object.prototype.hasOwnProperty.call(params, "concurrency") || Object.prototype.hasOwnProperty.call(params, "chainDir")) {
|
|
155
|
+
if (Object.prototype.hasOwnProperty.call(params, "action") || Object.prototype.hasOwnProperty.call(params, "workflowScript") || Object.prototype.hasOwnProperty.call(params, "tasks") || Object.prototype.hasOwnProperty.call(params, "chain") || Object.prototype.hasOwnProperty.call(params, "parallel") || Object.prototype.hasOwnProperty.call(params, "concurrency") || Object.prototype.hasOwnProperty.call(params, "chainDir")) {
|
|
41
156
|
const hint = label === "runs.run" ? "; use runs.all(...) and JavaScript control flow for orchestration." : ".";
|
|
42
157
|
throw new Error(label + " accepts one child via { agent, task } and execution controls only" + hint);
|
|
43
158
|
}
|
|
44
159
|
if (params.worktree !== undefined && typeof params.worktree !== "boolean") throw new Error(label + " worktree must be true or false.");
|
|
160
|
+
if (params.gate !== undefined && (typeof params.gate !== "string" || !params.gate.trim())) throw new Error(label + " gate must be a non-empty command string.");
|
|
161
|
+
if (params.gate !== undefined && params.acceptance !== undefined) throw new Error(label + " gate cannot be combined with acceptance; use one gate command or acceptance.verify.");
|
|
162
|
+
if (params.gate !== undefined && params.resume !== undefined) throw new Error(label + " gate is not supported with retained resume.");
|
|
163
|
+
if (params.resume !== undefined && (typeof params.resume !== "string" || !params.resume.trim())) throw new Error(label + " resume must be a non-empty retained run id.");
|
|
164
|
+
if (params.resume !== undefined && params.agent !== undefined) throw new Error(label + " resume and agent are mutually exclusive.");
|
|
165
|
+
if (params.resume !== undefined && (typeof params.task !== "string" || !params.task.trim())) throw new Error(label + " resume requires a non-empty task follow-up.");
|
|
45
166
|
assertJsonValue(params, label + " params");
|
|
46
167
|
const fingerprint = stableRunJson(params);
|
|
47
168
|
const existing = fingerprints.get(key);
|
|
@@ -52,7 +173,7 @@ function validateRunCall(key, params, label, fingerprints) {
|
|
|
52
173
|
const runs = Object.freeze({
|
|
53
174
|
run(key, params) {
|
|
54
175
|
validateRunCall(key, params, "runs.run", runFingerprints);
|
|
55
|
-
return hostCall("run", { key, params });
|
|
176
|
+
return hostCall("run", { key, params }, { key });
|
|
56
177
|
},
|
|
57
178
|
all(items) {
|
|
58
179
|
if (!Array.isArray(items)) throw new Error("runs.all(items) requires an array.");
|
|
@@ -67,7 +188,8 @@ const runs = Object.freeze({
|
|
|
67
188
|
calls.push({ key, params });
|
|
68
189
|
}
|
|
69
190
|
for (const { key, params } of calls) runFingerprints.set(key, stableRunJson(params));
|
|
70
|
-
|
|
191
|
+
const launched = calls.map(({ key, params }) => runHostCall(key, params, true));
|
|
192
|
+
return trackRunObservation(launched.map(({ key, callId }) => ({ key, callId })), Promise.all(launched.map(({ promise }) => promise)));
|
|
71
193
|
},
|
|
72
194
|
status(keyOrRunId) { return hostCall("status", { keyOrRunId }); },
|
|
73
195
|
ref: formatRef,
|
|
@@ -77,6 +199,28 @@ const runs = Object.freeze({
|
|
|
77
199
|
},
|
|
78
200
|
});
|
|
79
201
|
|
|
202
|
+
function validateStateKey(key) {
|
|
203
|
+
if (typeof key !== "string" || !runKeyPattern.test(key)) throw new Error("state key must be 1-128 characters using letters, numbers, '.', '_' or '-', and start with a letter or number.");
|
|
204
|
+
return key;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const state = Object.freeze({
|
|
208
|
+
get(key) { return hostCall("state.get", { key: validateStateKey(key) }); },
|
|
209
|
+
set(key, value) {
|
|
210
|
+
const validKey = validateStateKey(key);
|
|
211
|
+
assertJsonValue(value, "state.set('" + validKey + "') value");
|
|
212
|
+
return hostCall("state.set", { key: validKey, value });
|
|
213
|
+
},
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
const prompts = Object.freeze({
|
|
217
|
+
render(ref, vars) {
|
|
218
|
+
if (typeof ref !== "string" || !ref.trim()) throw new Error("prompts.render(ref, vars) requires a non-empty ref string.");
|
|
219
|
+
if (vars !== undefined) assertJsonValue(vars, "prompts.render vars");
|
|
220
|
+
return hostCall("prompts.render", { ref, vars });
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
|
|
80
224
|
let contextObjectPrototype;
|
|
81
225
|
|
|
82
226
|
const capturedConsole = Object.freeze(Object.fromEntries(
|
|
@@ -85,6 +229,17 @@ const capturedConsole = Object.freeze(Object.fromEntries(
|
|
|
85
229
|
}]),
|
|
86
230
|
));
|
|
87
231
|
|
|
232
|
+
function formatWorkflowScriptSyntaxError(error) {
|
|
233
|
+
const details = error && error.stack ? error.stack : String(error);
|
|
234
|
+
return [
|
|
235
|
+
"workflowScript must be valid JavaScript.",
|
|
236
|
+
"If task text contains Markdown fences or backticks, use an array joined with \"\\n\" or escaped strings instead of a raw backtick template literal.",
|
|
237
|
+
"",
|
|
238
|
+
"Original SyntaxError:",
|
|
239
|
+
details,
|
|
240
|
+
].join("\n");
|
|
241
|
+
}
|
|
242
|
+
|
|
88
243
|
function assertJsonValue(value, path = "emit", seen = new Set()) {
|
|
89
244
|
if (value === null || typeof value === "string" || typeof value === "boolean") return;
|
|
90
245
|
if (typeof value === "number") {
|
|
@@ -108,6 +263,25 @@ function assertJsonValue(value, path = "emit", seen = new Set()) {
|
|
|
108
263
|
seen.delete(value);
|
|
109
264
|
}
|
|
110
265
|
|
|
266
|
+
function isPlainWorkflowObject(value) {
|
|
267
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
268
|
+
const prototype = Object.getPrototypeOf(value);
|
|
269
|
+
return prototype === null || prototype === Object.prototype || prototype === contextObjectPrototype;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function omitUndefinedWorkflowValues(value, seen = new Set()) {
|
|
273
|
+
if (value === null || typeof value !== "object") return value;
|
|
274
|
+
if (seen.has(value)) return value;
|
|
275
|
+
seen.add(value);
|
|
276
|
+
const normalized = Array.isArray(value)
|
|
277
|
+
? value.map((entry) => entry === undefined ? null : omitUndefinedWorkflowValues(entry, seen))
|
|
278
|
+
: isPlainWorkflowObject(value) && Object.getOwnPropertySymbols(value).length === 0
|
|
279
|
+
? Object.fromEntries(Object.entries(value).flatMap(([key, entry]) => entry === undefined ? [] : [[key, omitUndefinedWorkflowValues(entry, seen)]]))
|
|
280
|
+
: value;
|
|
281
|
+
seen.delete(value);
|
|
282
|
+
return normalized;
|
|
283
|
+
}
|
|
284
|
+
|
|
111
285
|
parentPort.on("message", async (message) => {
|
|
112
286
|
if (message.type === "response") {
|
|
113
287
|
const entry = pending.get(message.callId);
|
|
@@ -119,12 +293,20 @@ parentPort.on("message", async (message) => {
|
|
|
119
293
|
}
|
|
120
294
|
if (message.type !== "start") return;
|
|
121
295
|
try {
|
|
122
|
-
const sandbox = { runs, emit(value) { assertJsonValue(value); parentPort.postMessage({ type: "emit", value }); }, console: capturedConsole };
|
|
296
|
+
const sandbox = { runs, prompts, Promise: workflowPromise, emit(value) { assertJsonValue(value); parentPort.postMessage({ type: "emit", value }); }, console: capturedConsole };
|
|
297
|
+
if (message.stateEnabled) sandbox.state = state;
|
|
123
298
|
const context = vm.createContext(sandbox, { codeGeneration: { strings: false, wasm: false } });
|
|
124
299
|
contextObjectPrototype = vm.runInContext("Object.prototype", context);
|
|
125
|
-
|
|
300
|
+
let compiled;
|
|
301
|
+
try {
|
|
302
|
+
compiled = new vm.Script("(async () => {\n" + message.script + "\n})()", { filename: "workflow-script.js" });
|
|
303
|
+
} catch (error) {
|
|
304
|
+
if (!(error instanceof SyntaxError)) throw error;
|
|
305
|
+
parentPort.postMessage({ type: "error", error: formatWorkflowScriptSyntaxError(error) });
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
126
308
|
const value = await compiled.runInContext(context);
|
|
127
|
-
const persistedValue = value === undefined ? null : value;
|
|
309
|
+
const persistedValue = value === undefined ? null : omitUndefinedWorkflowValues(value);
|
|
128
310
|
assertJsonValue(persistedValue, "return");
|
|
129
311
|
parentPort.postMessage({ type: "complete", value: persistedValue });
|
|
130
312
|
} catch (error) {
|
|
@@ -136,6 +318,8 @@ parentPort.on("message", async (message) => {
|
|
|
136
318
|
export interface WorkflowScriptChildResult {
|
|
137
319
|
key: string;
|
|
138
320
|
ok: boolean;
|
|
321
|
+
/** Canonical child agent name when launch resolution produced one. */
|
|
322
|
+
agent?: string;
|
|
139
323
|
runId?: string;
|
|
140
324
|
output: string;
|
|
141
325
|
error?: string;
|
|
@@ -148,6 +332,8 @@ export interface WorkflowScriptTraceEntry {
|
|
|
148
332
|
operation: "run" | "status";
|
|
149
333
|
key: string;
|
|
150
334
|
state: "started" | "completed" | "failed" | "reused";
|
|
335
|
+
/** Canonical child agent name when resolved launch or result data is available. */
|
|
336
|
+
agent?: string;
|
|
151
337
|
runId?: string;
|
|
152
338
|
durationMs?: number;
|
|
153
339
|
phase?: string;
|
|
@@ -175,10 +361,17 @@ export class WorkflowScriptError extends Error {
|
|
|
175
361
|
|
|
176
362
|
export interface RunWorkflowScriptOptions {
|
|
177
363
|
script: string;
|
|
178
|
-
timeoutMs
|
|
364
|
+
timeoutMs?: number;
|
|
179
365
|
signal?: AbortSignal;
|
|
180
366
|
launch: (key: string, params: Record<string, unknown>, signal: AbortSignal) => Promise<WorkflowScriptChildResult>;
|
|
181
367
|
status: (keyOrRunId: string, signal: AbortSignal) => Promise<WorkflowScriptChildResult>;
|
|
368
|
+
state?: {
|
|
369
|
+
get: (key: string) => unknown | Promise<unknown>;
|
|
370
|
+
set: (key: string, value: unknown) => void | Promise<void>;
|
|
371
|
+
};
|
|
372
|
+
prompts?: {
|
|
373
|
+
render: (ref: string, vars?: unknown) => string | Promise<string>;
|
|
374
|
+
};
|
|
182
375
|
onTrace?: (trace: WorkflowScriptTraceEntry[]) => void;
|
|
183
376
|
onEmit?: (emits: unknown[]) => void;
|
|
184
377
|
}
|
|
@@ -239,29 +432,56 @@ export function formatWorkflowJsonPreview(value: unknown, maxLength: number): st
|
|
|
239
432
|
}
|
|
240
433
|
}
|
|
241
434
|
|
|
435
|
+
export interface SimpleWorkflowRunPreview {
|
|
436
|
+
agent?: string;
|
|
437
|
+
task?: string;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/** Display-only preview for the exact simple `return runs.run(key, {...})` form. */
|
|
441
|
+
export function previewSimpleWorkflowRun(script: string | undefined): SimpleWorkflowRunPreview | undefined {
|
|
442
|
+
const body = script?.match(/^\s*return\s+(?:await\s+)?runs\.run\s*\(\s*(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`[^`$\\]*`)\s*,\s*\{([\s\S]*)\}\s*\)\s*;?\s*$/)?.[1];
|
|
443
|
+
if (body === undefined) return undefined;
|
|
444
|
+
const readProperty = (name: "agent" | "task"): string | undefined => {
|
|
445
|
+
const match = body.match(new RegExp(`(?:^|,)\\s*(?:${name}|["']${name}["'])\\s*:\\s*("(?:\\\\.|[^"\\\\])*"|'(?:\\\\.|[^'\\\\])*'|\u0060[^\u0060$\\\\]*\u0060)`));
|
|
446
|
+
if (!match?.[1]) return undefined;
|
|
447
|
+
const literal = match[1];
|
|
448
|
+
if (literal.startsWith('"')) {
|
|
449
|
+
try { return JSON.parse(literal) as string; } catch { return undefined; }
|
|
450
|
+
}
|
|
451
|
+
if (literal.slice(1, -1).includes("\\")) return undefined;
|
|
452
|
+
return literal.slice(1, -1);
|
|
453
|
+
};
|
|
454
|
+
const agent = readProperty("agent");
|
|
455
|
+
const task = readProperty("task");
|
|
456
|
+
return { ...(agent !== undefined ? { agent } : {}), ...(task !== undefined ? { task } : {}) };
|
|
457
|
+
}
|
|
458
|
+
|
|
242
459
|
function stableJson(value: unknown): string {
|
|
243
460
|
if (Array.isArray(value)) return `[${value.map(stableJson).join(",")}]`;
|
|
244
461
|
if (isRecord(value)) return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${stableJson(value[key])}`).join(",")}}`;
|
|
245
462
|
return JSON.stringify(value) ?? "undefined";
|
|
246
463
|
}
|
|
247
464
|
|
|
248
|
-
function validateKey(value: unknown): string {
|
|
465
|
+
function validateKey(value: unknown, owner = "runs.run"): string {
|
|
249
466
|
if (typeof value !== "string" || !KEY_PATTERN.test(value)) {
|
|
250
|
-
throw new Error(
|
|
467
|
+
throw new Error(`${owner} key must be 1-128 characters using letters, numbers, '.', '_' or '-', and start with a letter or number.`);
|
|
251
468
|
}
|
|
252
469
|
return value;
|
|
253
470
|
}
|
|
254
471
|
|
|
255
|
-
function workflowStringMetadata(params: Record<string, unknown>): Pick<WorkflowScriptTraceEntry, "phase" | "label"> {
|
|
472
|
+
function workflowStringMetadata(params: Record<string, unknown>): Pick<WorkflowScriptTraceEntry, "phase" | "label" | "agent"> {
|
|
256
473
|
return {
|
|
257
474
|
...(typeof params.phase === "string" && params.phase.trim() ? { phase: params.phase.trim() } : {}),
|
|
258
475
|
...(typeof params.label === "string" && params.label.trim() ? { label: params.label.trim() } : {}),
|
|
476
|
+
// Requested agent name, so a child is identifiable while it runs. Launch
|
|
477
|
+
// resolution overwrites this with the canonical name on the terminal entry.
|
|
478
|
+
...(typeof params.agent === "string" && params.agent.trim() ? { agent: params.agent.trim() } : {}),
|
|
259
479
|
};
|
|
260
480
|
}
|
|
261
481
|
|
|
262
482
|
export async function runWorkflowScript(options: RunWorkflowScriptOptions): Promise<WorkflowScriptResult> {
|
|
263
483
|
if (!options.script.trim()) throw new Error("workflowScript must not be empty.");
|
|
264
|
-
if (!Number.isInteger(options.timeoutMs) || options.timeoutMs < 1) throw new Error("workflow script timeout must be a positive integer.");
|
|
484
|
+
if (options.timeoutMs !== undefined && (!Number.isInteger(options.timeoutMs) || options.timeoutMs < 1)) throw new Error("workflow script timeout must be a positive integer.");
|
|
265
485
|
|
|
266
486
|
const worker = new Worker(WORKER_SOURCE, { eval: true });
|
|
267
487
|
const emits: unknown[] = [];
|
|
@@ -269,7 +489,8 @@ export async function runWorkflowScript(options: RunWorkflowScriptOptions): Prom
|
|
|
269
489
|
const trace: WorkflowScriptTraceEntry[] = [];
|
|
270
490
|
const children = new Map<string, WorkflowScriptChildResult>();
|
|
271
491
|
const childOrder: string[] = [];
|
|
272
|
-
const launches = new Map<string, { fingerprint: string; promise: Promise<WorkflowScriptChildResult
|
|
492
|
+
const launches = new Map<string, { fingerprint: string; promise: Promise<WorkflowScriptChildResult>; observed: boolean }>();
|
|
493
|
+
const observedRunCalls = new Set<number>();
|
|
273
494
|
const childController = new AbortController();
|
|
274
495
|
let settled = false;
|
|
275
496
|
|
|
@@ -283,15 +504,22 @@ export async function runWorkflowScript(options: RunWorkflowScriptOptions): Prom
|
|
|
283
504
|
const finish = (outcome: { value: unknown } | { error: Error }) => {
|
|
284
505
|
if (settled) return;
|
|
285
506
|
settled = true;
|
|
286
|
-
clearTimeout(timer);
|
|
507
|
+
if (timer) clearTimeout(timer);
|
|
287
508
|
options.signal?.removeEventListener("abort", onAbort);
|
|
288
509
|
void worker.terminate();
|
|
289
|
-
|
|
510
|
+
const unobservedKeys = "value" in outcome ? [...launches].filter(([, launch]) => !launch.observed).map(([key]) => key) : [];
|
|
511
|
+
const completionError = unobservedKeys.length > 0
|
|
512
|
+
? new Error(`workflowScript completed with unawaited runs.run launch(es): ${unobservedKeys.map((key) => `'${key}'`).join(", ")}. Await or return each launch.`)
|
|
513
|
+
: undefined;
|
|
514
|
+
childController.abort("error" in outcome ? outcome.error : completionError ?? new Error("Workflow script completed."));
|
|
290
515
|
if ("error" in outcome) reject(new WorkflowScriptError(outcome.error.message, partial()));
|
|
516
|
+
else if (completionError) reject(new WorkflowScriptError(completionError.message, partial()));
|
|
291
517
|
else resolve({ value: outcome.value, ...partial() });
|
|
292
518
|
};
|
|
293
519
|
const onAbort = () => finish({ error: new Error("Workflow script aborted.") });
|
|
294
|
-
const timer =
|
|
520
|
+
const timer = options.timeoutMs === undefined
|
|
521
|
+
? undefined
|
|
522
|
+
: setTimeout(() => finish({ error: new Error(`Workflow script timed out after ${options.timeoutMs}ms.`) }), options.timeoutMs);
|
|
295
523
|
options.signal?.addEventListener("abort", onAbort, { once: true });
|
|
296
524
|
if (options.signal?.aborted) return onAbort();
|
|
297
525
|
|
|
@@ -330,15 +558,55 @@ export async function runWorkflowScript(options: RunWorkflowScriptOptions): Prom
|
|
|
330
558
|
return finish({ value: message.value });
|
|
331
559
|
}
|
|
332
560
|
if (message.type === "error") return finish({ error: new Error(typeof message.error === "string" ? message.error : "Workflow script failed.") });
|
|
561
|
+
if (message.type === "runObserved" && typeof message.callId === "number") {
|
|
562
|
+
const key = typeof message.key === "string" ? message.key : undefined;
|
|
563
|
+
const launch = key ? launches.get(key) : undefined;
|
|
564
|
+
if (launch) launch.observed = true;
|
|
565
|
+
else observedRunCalls.add(message.callId);
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
333
568
|
if (message.type !== "call" || typeof message.callId !== "number" || typeof message.method !== "string" || !isRecord(message.args)) return;
|
|
334
569
|
|
|
335
|
-
const respond = (promise: Promise<
|
|
570
|
+
const respond = (promise: Promise<unknown>) => {
|
|
336
571
|
void promise.then(
|
|
337
|
-
(value) =>
|
|
338
|
-
|
|
572
|
+
(value) => {
|
|
573
|
+
if (!settled) worker.postMessage({ type: "response", callId: message.callId, ok: true, value: omitUndefinedWorkflowValues(value) });
|
|
574
|
+
},
|
|
575
|
+
(error: unknown) => {
|
|
576
|
+
if (!settled) worker.postMessage({ type: "response", callId: message.callId, ok: false, error: error instanceof Error ? error.message : String(error) });
|
|
577
|
+
},
|
|
339
578
|
);
|
|
340
579
|
};
|
|
341
580
|
|
|
581
|
+
if (message.method === "prompts.render") {
|
|
582
|
+
if (!options.prompts) return respond(Promise.reject(new Error("Workflow prompt rendering is unavailable.")));
|
|
583
|
+
const ref = message.args.ref;
|
|
584
|
+
const vars = message.args.vars;
|
|
585
|
+
if (typeof ref !== "string" || !ref.trim()) return respond(Promise.reject(new Error("prompts.render(ref, vars) requires a non-empty ref string.")));
|
|
586
|
+
return respond(Promise.resolve().then(() => options.prompts!.render(ref, vars)).then((rendered) => {
|
|
587
|
+
if (typeof rendered !== "string") throw new Error("prompts.render must return task text.");
|
|
588
|
+
return rendered;
|
|
589
|
+
}));
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
if (message.method === "state.get" || message.method === "state.set") {
|
|
593
|
+
if (!options.state) return respond(Promise.reject(new Error("Workflow state is unavailable without a mission.")));
|
|
594
|
+
let key: string;
|
|
595
|
+
try {
|
|
596
|
+
key = validateKey(message.args.key, "state");
|
|
597
|
+
} catch (error) {
|
|
598
|
+
return respond(Promise.reject(error));
|
|
599
|
+
}
|
|
600
|
+
if (message.method === "state.get") return respond(Promise.resolve().then(() => options.state!.get(key)));
|
|
601
|
+
const value = message.args.value;
|
|
602
|
+
try {
|
|
603
|
+
assertWorkflowJsonValue(value, `state.set('${key}') value`);
|
|
604
|
+
} catch (error) {
|
|
605
|
+
return respond(Promise.reject(error));
|
|
606
|
+
}
|
|
607
|
+
return respond(Promise.resolve().then(() => options.state!.set(key, value)));
|
|
608
|
+
}
|
|
609
|
+
|
|
342
610
|
if (message.method === "status") {
|
|
343
611
|
const keyOrRunId = message.args.keyOrRunId;
|
|
344
612
|
if (typeof keyOrRunId !== "string" || !keyOrRunId.trim()) return respond(Promise.reject(new Error("runs.status(keyOrRunId) requires a non-empty string.")));
|
|
@@ -366,13 +634,32 @@ export async function runWorkflowScript(options: RunWorkflowScriptOptions): Prom
|
|
|
366
634
|
if (!isRecord(params)) return respond(Promise.reject(new Error(`runs.run('${key}', params) requires a params object.`)));
|
|
367
635
|
if (params.action !== undefined) return respond(Promise.reject(new Error(`runs.run('${key}') accepts execution params only; management action is not allowed.`)));
|
|
368
636
|
if (params.workflowScript !== undefined) return respond(Promise.reject(new Error(`runs.run('${key}') cannot start a nested workflow script.`)));
|
|
369
|
-
if (params.tasks !== undefined || params.chain !== undefined || params.concurrency !== undefined || params.chainDir !== undefined) {
|
|
637
|
+
if (params.tasks !== undefined || params.chain !== undefined || params.parallel !== undefined || params.concurrency !== undefined || params.chainDir !== undefined) {
|
|
370
638
|
return respond(Promise.reject(new Error(`runs.run('${key}') accepts one child via { agent, task }; use runs.all(...) and JavaScript control flow for orchestration.`)));
|
|
371
639
|
}
|
|
372
640
|
if (params.worktree !== undefined && typeof params.worktree !== "boolean") {
|
|
373
641
|
return respond(Promise.reject(new Error(`runs.run('${key}') worktree must be true or false.`)));
|
|
374
642
|
}
|
|
643
|
+
if (params.gate !== undefined && (typeof params.gate !== "string" || !params.gate.trim())) {
|
|
644
|
+
return respond(Promise.reject(new Error(`runs.run('${key}') gate must be a non-empty command string.`)));
|
|
645
|
+
}
|
|
646
|
+
if (params.gate !== undefined && params.acceptance !== undefined) {
|
|
647
|
+
return respond(Promise.reject(new Error(`runs.run('${key}') gate cannot be combined with acceptance; use one gate command or acceptance.verify.`)));
|
|
648
|
+
}
|
|
649
|
+
if (params.gate !== undefined && params.resume !== undefined) {
|
|
650
|
+
return respond(Promise.reject(new Error(`runs.run('${key}') gate is not supported with retained resume.`)));
|
|
651
|
+
}
|
|
652
|
+
if (params.resume !== undefined && (typeof params.resume !== "string" || !params.resume.trim())) {
|
|
653
|
+
return respond(Promise.reject(new Error(`runs.run('${key}') resume must be a non-empty retained run id.`)));
|
|
654
|
+
}
|
|
655
|
+
if (params.resume !== undefined && params.agent !== undefined) {
|
|
656
|
+
return respond(Promise.reject(new Error(`runs.run('${key}') resume and agent are mutually exclusive.`)));
|
|
657
|
+
}
|
|
658
|
+
if (params.resume !== undefined && (typeof params.task !== "string" || !params.task.trim())) {
|
|
659
|
+
return respond(Promise.reject(new Error(`runs.run('${key}') resume requires a non-empty task follow-up.`)));
|
|
660
|
+
}
|
|
375
661
|
const collectFailure = message.args.collectFailure === true;
|
|
662
|
+
const callObserved = observedRunCalls.delete(message.callId);
|
|
376
663
|
const deliver = (promise: Promise<WorkflowScriptChildResult>) => collectFailure
|
|
377
664
|
? promise
|
|
378
665
|
: promise.then((result) => {
|
|
@@ -383,6 +670,7 @@ export async function runWorkflowScript(options: RunWorkflowScriptOptions): Prom
|
|
|
383
670
|
const existing = launches.get(key);
|
|
384
671
|
if (existing) {
|
|
385
672
|
if (existing.fingerprint !== fingerprint) return respond(Promise.reject(new Error(`Duplicate workflow key '${key}' used with incompatible launch params.`)));
|
|
673
|
+
if (callObserved) existing.observed = true;
|
|
386
674
|
trace.push({ operation: "run", key, state: "reused", ...workflowStringMetadata(params) });
|
|
387
675
|
traceChanged();
|
|
388
676
|
return respond(deliver(existing.promise));
|
|
@@ -395,7 +683,7 @@ export async function runWorkflowScript(options: RunWorkflowScriptOptions): Prom
|
|
|
395
683
|
const promise = Promise.resolve().then(() => options.launch(key, { ...params, async: params.async ?? false }, childController.signal)).then((result) => {
|
|
396
684
|
const normalized = !result.ok && !result.error ? { ...result, error: result.output } : result;
|
|
397
685
|
children.set(key, normalized);
|
|
398
|
-
trace.push({ operation: "run", key, state: normalized.ok ? "completed" : "failed", durationMs: Date.now() - startedAt, ...workflowStringMetadata(params), ...(normalized.runId ? { runId: normalized.runId } : {}), ...(!normalized.ok ? { error: normalized.error ?? normalized.output } : {}) });
|
|
686
|
+
trace.push({ operation: "run", key, state: normalized.ok ? "completed" : "failed", durationMs: Date.now() - startedAt, ...workflowStringMetadata(params), ...(normalized.agent ? { agent: normalized.agent } : {}), ...(normalized.runId ? { runId: normalized.runId } : {}), ...(!normalized.ok ? { error: normalized.error ?? normalized.output } : {}) });
|
|
399
687
|
traceChanged();
|
|
400
688
|
return normalized;
|
|
401
689
|
}, (error: unknown) => {
|
|
@@ -406,10 +694,10 @@ export async function runWorkflowScript(options: RunWorkflowScriptOptions): Prom
|
|
|
406
694
|
traceChanged();
|
|
407
695
|
return failure;
|
|
408
696
|
});
|
|
409
|
-
launches.set(key, { fingerprint, promise });
|
|
697
|
+
launches.set(key, { fingerprint, promise, observed: callObserved });
|
|
410
698
|
respond(deliver(promise));
|
|
411
699
|
});
|
|
412
700
|
|
|
413
|
-
worker.postMessage({ type: "start", script: options.script });
|
|
701
|
+
worker.postMessage({ type: "start", script: options.script, stateEnabled: options.state !== undefined });
|
|
414
702
|
});
|
|
415
703
|
}
|
|
@@ -18,9 +18,9 @@ import * as path from "node:path";
|
|
|
18
18
|
import { tryImport } from "../support/helpers.ts";
|
|
19
19
|
import type { RealSessionRun } from "../support/real-session-runner.ts";
|
|
20
20
|
|
|
21
|
-
const piCodingAgent = await tryImport<
|
|
21
|
+
const piCodingAgent = await tryImport<{ __piSubagentsTestShim?: boolean }>("@selesai/code");
|
|
22
22
|
const piAi = await tryImport<unknown>("@earendil-works/pi-ai");
|
|
23
|
-
const available = Boolean(piCodingAgent && piAi);
|
|
23
|
+
const available = Boolean(piCodingAgent && !piCodingAgent.__piSubagentsTestShim && piAi);
|
|
24
24
|
|
|
25
25
|
const CHILD_MARKER = "CHILD_REAL_SESSION_OK";
|
|
26
26
|
// Env vars the runner must clear so a parent that was itself spawned as a
|
|
@@ -51,7 +51,7 @@ describe("real Pi-session subagent E2E", { skip: !available ? "pi runtime packag
|
|
|
51
51
|
it("loads requested extension tools in direct and workflow children and diagnoses missing providers", async () => {
|
|
52
52
|
const { runRealSubagentSession, subagentCall, subagentToolResults } = await import("../support/real-session-runner.ts");
|
|
53
53
|
const extensionAgent = `---
|
|
54
|
-
name: extension-
|
|
54
|
+
name: extension-worker
|
|
55
55
|
description: Uses a child-only fixture tool
|
|
56
56
|
tools: read, fixture_search
|
|
57
57
|
subagentOnlyExtensions: ./fixture-extension.ts
|
|
@@ -59,7 +59,7 @@ completionGuard: false
|
|
|
59
59
|
---
|
|
60
60
|
Use the available tools.`;
|
|
61
61
|
const missingAgent = `---
|
|
62
|
-
name: missing-extension-
|
|
62
|
+
name: missing-extension-worker
|
|
63
63
|
description: Requests an extension tool without loading its provider
|
|
64
64
|
tools: read, missing_search
|
|
65
65
|
completionGuard: false
|
|
@@ -80,22 +80,22 @@ Use the available tools.`;
|
|
|
80
80
|
childText: CHILD_MARKER,
|
|
81
81
|
reportChildTools: true,
|
|
82
82
|
projectFiles: {
|
|
83
|
-
".selesai/agents/extension-
|
|
84
|
-
".selesai/agents/missing-extension-
|
|
83
|
+
".selesai/agents/extension-worker.md": extensionAgent,
|
|
84
|
+
".selesai/agents/missing-extension-worker.md": missingAgent,
|
|
85
85
|
"fixture-extension.ts": fixtureExtension,
|
|
86
86
|
},
|
|
87
87
|
respond(context) {
|
|
88
88
|
const resultCount = (context.messages as Array<{ role?: string; toolName?: string }>).filter((message) => message.role === "toolResult" && message.toolName === "subagent").length;
|
|
89
89
|
if (resultCount === 0) {
|
|
90
|
-
return subagentCall({ agent: "extension-
|
|
90
|
+
return subagentCall({ agent: "extension-worker", task: "Report active tools.", context: "fresh", async: false, clarify: false, agentScope: "project" }, "call-direct-extension");
|
|
91
91
|
}
|
|
92
92
|
if (resultCount === 1) {
|
|
93
93
|
return subagentCall({
|
|
94
94
|
workflowScript: `return await runs.all([
|
|
95
|
-
{ key: "extension", agent: "extension-
|
|
95
|
+
{ key: "extension", agent: "extension-worker", task: "Report active tools." },
|
|
96
96
|
{
|
|
97
97
|
key: "structured",
|
|
98
|
-
agent: "extension-
|
|
98
|
+
agent: "extension-worker",
|
|
99
99
|
task: "Submit the required structured marker.",
|
|
100
100
|
outputSchema: {
|
|
101
101
|
type: "object",
|
|
@@ -111,7 +111,7 @@ Use the available tools.`;
|
|
|
111
111
|
}, "call-workflow-extension");
|
|
112
112
|
}
|
|
113
113
|
if (resultCount === 2) {
|
|
114
|
-
return subagentCall({ agent: "missing-extension-
|
|
114
|
+
return subagentCall({ agent: "missing-extension-worker", task: "Report active tools.", context: "fresh", async: false, clarify: false, agentScope: "project" }, "call-missing-extension");
|
|
115
115
|
}
|
|
116
116
|
return "Child tool checks complete.";
|
|
117
117
|
},
|
|
@@ -134,7 +134,7 @@ Use the available tools.`;
|
|
|
134
134
|
it("accepts child tools registered by async before_agent_start hooks", async () => {
|
|
135
135
|
const { runRealSubagentSession, subagentCall, subagentToolResults } = await import("../support/real-session-runner.ts");
|
|
136
136
|
const asyncExtensionAgent = `---
|
|
137
|
-
name: async-extension-
|
|
137
|
+
name: async-extension-worker
|
|
138
138
|
description: Uses a child-only tool registered from before_agent_start
|
|
139
139
|
tools: read, fixture_async_search
|
|
140
140
|
subagentOnlyExtensions: ./fixture-async-extension.ts
|
|
@@ -159,13 +159,13 @@ Report active tools.`;
|
|
|
159
159
|
childText: CHILD_MARKER,
|
|
160
160
|
reportChildTools: true,
|
|
161
161
|
projectFiles: {
|
|
162
|
-
".selesai/agents/async-extension-
|
|
162
|
+
".selesai/agents/async-extension-worker.md": asyncExtensionAgent,
|
|
163
163
|
"fixture-async-extension.ts": fixtureAsyncExtension,
|
|
164
164
|
},
|
|
165
165
|
respond(context) {
|
|
166
166
|
const resultCount = (context.messages as Array<{ role?: string; toolName?: string }>).filter((message) => message.role === "toolResult" && message.toolName === "subagent").length;
|
|
167
167
|
if (resultCount > 0) return "Async child tool check complete.";
|
|
168
|
-
return subagentCall({ agent: "async-extension-
|
|
168
|
+
return subagentCall({ agent: "async-extension-worker", task: "Report active tools.", context: "fresh", async: false, clarify: false, agentScope: "project" }, "call-async-extension");
|
|
169
169
|
},
|
|
170
170
|
timeoutMs: 60_000,
|
|
171
171
|
});
|
|
@@ -191,12 +191,12 @@ Report active tools.`;
|
|
|
191
191
|
|
|
192
192
|
try {
|
|
193
193
|
run = await runRealSubagentSession({
|
|
194
|
-
prompt: "Delegate to a
|
|
194
|
+
prompt: "Delegate to a worker and report its exact result.",
|
|
195
195
|
childText: CHILD_MARKER,
|
|
196
196
|
respond: routeParentThroughSubagent({
|
|
197
197
|
childMarker: CHILD_MARKER,
|
|
198
198
|
subagentArgs: {
|
|
199
|
-
agent: "
|
|
199
|
+
agent: "worker",
|
|
200
200
|
task: "Return the marker from the faux child provider.",
|
|
201
201
|
context: "fresh",
|
|
202
202
|
async: false,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workaround for https://github.com/oven-sh/bun/issues/27802
|
|
3
|
+
*
|
|
4
|
+
* Bun compiled binaries have an empty `process.env` when running inside
|
|
5
|
+
* sandbox environments (e.g. nono on Linux/macOS). On Linux we can recover
|
|
6
|
+
* the environment from `/proc/self/environ`.
|
|
7
|
+
*
|
|
8
|
+
* Keep this in sync with getBunSandboxEnvValue() in
|
|
9
|
+
* packages/ai/src/utils/provider-env.ts. The ai package duplicates the lookup
|
|
10
|
+
* for direct consumers that do not go through this coding-agent entrypoint.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Restore environment variables from `/proc/self/environ` when running
|
|
14
|
+
* inside a sandbox where Bun's `process.env` is empty.
|
|
15
|
+
*/
|
|
16
|
+
export declare function restoreSandboxEnv(): void;
|
|
17
|
+
//# sourceMappingURL=restore-sandbox-env.d.ts.map
|