@ashx-j/lunr 0.2.11 → 0.2.13
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 +13 -0
- package/README.md +211 -236
- package/dist/builtin-extensions/ashxj-tui.d.ts +3 -0
- package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-tui.js +28 -11
- package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
- package/dist/builtin-extensions/index.d.ts.map +1 -1
- package/dist/builtin-extensions/index.js +0 -2
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/lunr-cron.d.ts +1 -1
- package/dist/builtin-extensions/lunr-cron.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-cron.js +1 -1
- package/dist/builtin-extensions/lunr-cron.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/chain-validation.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/chain-validation.js +3 -3
- package/dist/builtin-extensions/pi-subagents/src/extension/chain-validation.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/doctor.d.ts +0 -2
- package/dist/builtin-extensions/pi-subagents/src/extension/doctor.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/doctor.js +1 -23
- package/dist/builtin-extensions/pi-subagents/src/extension/doctor.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js +6 -7
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +7 -14
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts +12 -9
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +38 -34
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +3 -3
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +32 -47
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts +2 -2
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +7 -10
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +90 -109
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts +3 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js +37 -50
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/scheduled-runs.d.ts +4 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/scheduled-runs.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/scheduled-runs.js +5 -5
- package/dist/builtin-extensions/pi-subagents/src/runs/background/scheduled-runs.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +31 -13
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.d.ts +2 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts +4 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +48 -20
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts +2 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +90 -64
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts +6 -8
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +262 -161
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts +2 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js +24 -33
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts +25 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js +51 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/dynamic-fanout.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/dynamic-fanout.js +20 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/dynamic-fanout.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts +4 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts +5 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js +9 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +2 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts +2 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js +20 -17
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts +70 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js +153 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/settings.d.ts +13 -8
- package/dist/builtin-extensions/pi-subagents/src/shared/settings.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/settings.js +20 -51
- package/dist/builtin-extensions/pi-subagents/src/shared/settings.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +80 -20
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js +10 -2
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts +2 -2
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js +20 -32
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +2 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +23 -449
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +2 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +13 -11
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/runtime.d.ts +2 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/runtime.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/runtime.js +18 -17
- package/dist/builtin-extensions/pi-subagents/src/watchdog/runtime.js.map +1 -1
- package/dist/builtin-extensions/simple-pi-memory.d.ts +2 -2
- package/dist/builtin-extensions/simple-pi-memory.d.ts.map +1 -1
- package/dist/builtin-extensions/simple-pi-memory.js +41 -17
- package/dist/builtin-extensions/simple-pi-memory.js.map +1 -1
- package/dist/catalog/models.json +1 -1
- package/dist/catalog/providers/amazon-bedrock.json +1 -1
- package/dist/catalog/providers/azure-openai-responses.json +1 -1
- package/dist/catalog/providers/cloudflare-ai-gateway.json +1 -1
- package/dist/catalog/providers/cloudflare-workers-ai.json +1 -1
- package/dist/catalog/providers/fireworks.json +1 -1
- package/dist/catalog/providers/github-copilot.json +1 -1
- package/dist/catalog/providers/huggingface.json +1 -1
- package/dist/catalog/providers/minimax-cn.json +1 -1
- package/dist/catalog/providers/minimax.json +1 -1
- package/dist/catalog/providers/mistral.json +1 -1
- package/dist/catalog/providers/nvidia.json +1 -1
- package/dist/catalog/providers/openai.json +1 -1
- package/dist/catalog/providers/opencode-go.json +1 -1
- package/dist/catalog/providers/opencode.json +1 -1
- package/dist/catalog/providers/openrouter.json +1 -1
- package/dist/catalog/providers/qwen-cloud-cn.json +1 -1
- package/dist/catalog/providers/qwen-cloud.json +1 -1
- package/dist/catalog/providers/qwen-token-plan-cn.json +1 -1
- package/dist/catalog/providers/qwen-token-plan.json +1 -1
- package/dist/catalog/providers/together.json +1 -1
- package/dist/catalog/providers/vercel-ai-gateway.json +1 -1
- package/dist/catalog/providers/zai-coding-cn.json +1 -1
- package/dist/catalog/providers/zai.json +1 -1
- package/dist/catalog/publication.json +3 -3
- package/dist/core/agent-session.d.ts +7 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +34 -4
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/context-breakdown.d.ts +3 -1
- package/dist/core/context-breakdown.d.ts.map +1 -1
- package/dist/core/context-breakdown.js +5 -2
- package/dist/core/context-breakdown.js.map +1 -1
- package/dist/core/customize.d.ts +2 -0
- package/dist/core/customize.d.ts.map +1 -1
- package/dist/core/customize.js +6 -0
- package/dist/core/customize.js.map +1 -1
- package/dist/core/memory-cap.d.ts +4 -8
- package/dist/core/memory-cap.d.ts.map +1 -1
- package/dist/core/memory-cap.js +8 -8
- package/dist/core/memory-cap.js.map +1 -1
- package/dist/core/permissions.d.ts +2 -0
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +30 -14
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +1 -9
- package/dist/core/plan-mode.js.map +1 -1
- package/dist/core/rollback.d.ts.map +1 -1
- package/dist/core/rollback.js +1 -1
- package/dist/core/rollback.js.map +1 -1
- package/dist/core/settings-manager.d.ts +16 -5
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +37 -10
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -5
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/subagent-permission-inherit.d.ts +34 -22
- package/dist/core/subagent-permission-inherit.d.ts.map +1 -1
- package/dist/core/subagent-permission-inherit.js +37 -80
- package/dist/core/subagent-permission-inherit.js.map +1 -1
- package/dist/core/swarm.d.ts.map +1 -1
- package/dist/core/swarm.js +13 -7
- package/dist/core/swarm.js.map +1 -1
- package/dist/core/system-prompt.d.ts +6 -4
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +38 -48
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/usage-adapters/openai-codex.d.ts +1 -1
- package/dist/core/usage-adapters/openai-codex.d.ts.map +1 -1
- package/dist/core/usage-adapters/openai-codex.js +22 -17
- package/dist/core/usage-adapters/openai-codex.js.map +1 -1
- package/dist/core/usage-service.d.ts +10 -1
- package/dist/core/usage-service.d.ts.map +1 -1
- package/dist/core/usage-service.js +17 -6
- package/dist/core/usage-service.js.map +1 -1
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +1 -4
- package/dist/gateway/agent-bridge.js.map +1 -1
- package/dist/gateway/cron.d.ts.map +1 -1
- package/dist/gateway/cron.js +1 -4
- package/dist/gateway/cron.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +0 -5
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +2 -0
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +21 -0
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +7 -4
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +122 -162
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/usage-view.d.ts +1 -1
- package/dist/modes/interactive/components/usage-view.d.ts.map +1 -1
- package/dist/modes/interactive/components/usage-view.js +7 -4
- package/dist/modes/interactive/components/usage-view.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +55 -96
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/skill-tag-autocomplete.d.ts +13 -0
- package/dist/modes/interactive/skill-tag-autocomplete.d.ts.map +1 -0
- package/dist/modes/interactive/skill-tag-autocomplete.js +72 -0
- package/dist/modes/interactive/skill-tag-autocomplete.js.map +1 -0
- package/docs/compaction.md +23 -23
- package/docs/containerization.md +24 -24
- package/docs/custom-provider.md +18 -18
- package/docs/development.md +16 -15
- package/docs/docs.json +6 -2
- package/docs/extensions.md +82 -80
- package/docs/features.md +102 -0
- package/docs/index.md +25 -19
- package/docs/json.md +7 -7
- package/docs/keybindings.md +4 -4
- package/docs/models.md +2 -2
- package/docs/packages.md +38 -42
- package/docs/prompt-templates.md +4 -4
- package/docs/providers.md +22 -10
- package/docs/quickstart.md +81 -46
- package/docs/rpc.md +7 -13
- package/docs/sdk.md +43 -41
- package/docs/security.md +18 -18
- package/docs/session-format.md +9 -9
- package/docs/sessions.md +13 -12
- package/docs/settings.md +63 -24
- package/docs/shell-aliases.md +2 -2
- package/docs/skills.md +21 -11
- package/docs/terminal-setup.md +5 -5
- package/docs/termux.md +7 -7
- package/docs/themes.md +12 -14
- package/docs/tmux.md +4 -4
- package/docs/tui.md +23 -23
- package/docs/usage.md +112 -87
- package/docs/windows.md +10 -2
- package/examples/README.md +3 -1
- package/examples/extensions/README.md +6 -6
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/doom-overlay/README.md +2 -2
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/plan-mode/README.md +3 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/subagent/README.md +13 -11
- package/examples/extensions/todo.ts +2 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/README.md +9 -5
- package/package.json +6 -7
- package/dist/builtin-extensions/lunr-behavior.d.ts +0 -44
- package/dist/builtin-extensions/lunr-behavior.d.ts.map +0 -1
- package/dist/builtin-extensions/lunr-behavior.js +0 -213
- package/dist/builtin-extensions/lunr-behavior.js.map +0 -1
- package/dist/builtin-extensions/pi-subagents/agents/context-builder.md +0 -46
- package/dist/builtin-extensions/pi-subagents/agents/deep-researcher.md +0 -36
- package/dist/builtin-extensions/pi-subagents/agents/delegate.md +0 -12
- package/dist/builtin-extensions/pi-subagents/agents/oracle.md +0 -73
- package/dist/builtin-extensions/pi-subagents/agents/planner.md +0 -55
- package/dist/builtin-extensions/pi-subagents/agents/research-writer.md +0 -37
- package/dist/builtin-extensions/pi-subagents/agents/researcher.md +0 -52
- package/dist/builtin-extensions/pi-subagents/agents/reviewer.md +0 -79
- package/dist/builtin-extensions/pi-subagents/agents/scout.md +0 -50
- package/dist/builtin-extensions/pi-subagents/agents/worker.md +0 -55
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-management.d.ts +0 -20
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-management.d.ts.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-management.js +0 -1273
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-management.js.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-memory.d.ts +0 -49
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-memory.d.ts.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-memory.js +0 -252
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-memory.js.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-scope.d.ts +0 -3
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-scope.d.ts.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-scope.js +0 -6
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-scope.js.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-selection.d.ts +0 -3
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-selection.d.ts.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-selection.js +0 -23
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-selection.js.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-serializer.d.ts +0 -8
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-serializer.d.ts.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-serializer.js +0 -143
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-serializer.js.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/agents.d.ts +0 -176
- package/dist/builtin-extensions/pi-subagents/src/agents/agents.d.ts.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/agents.js +0 -1326
- package/dist/builtin-extensions/pi-subagents/src/agents/agents.js.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/chain-serializer.d.ts +0 -7
- package/dist/builtin-extensions/pi-subagents/src/agents/chain-serializer.d.ts.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/chain-serializer.js +0 -307
- package/dist/builtin-extensions/pi-subagents/src/agents/chain-serializer.js.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/identity.d.ts +0 -8
- package/dist/builtin-extensions/pi-subagents/src/agents/identity.d.ts.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/identity.js +0 -30
- package/dist/builtin-extensions/pi-subagents/src/agents/identity.js.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/proactive-skills.d.ts +0 -35
- package/dist/builtin-extensions/pi-subagents/src/agents/proactive-skills.d.ts.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/agents/proactive-skills.js +0 -151
- package/dist/builtin-extensions/pi-subagents/src/agents/proactive-skills.js.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/profiles/profiles.d.ts +0 -131
- package/dist/builtin-extensions/pi-subagents/src/profiles/profiles.d.ts.map +0 -1
- package/dist/builtin-extensions/pi-subagents/src/profiles/profiles.js +0 -491
- package/dist/builtin-extensions/pi-subagents/src/profiles/profiles.js.map +0 -1
- package/dist/core/behavior-preset.d.ts +0 -60
- package/dist/core/behavior-preset.d.ts.map +0 -1
- package/dist/core/behavior-preset.js +0 -257
- package/dist/core/behavior-preset.js.map +0 -1
|
@@ -7,6 +7,7 @@ import * as fs from "node:fs";
|
|
|
7
7
|
import * as path from "node:path";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { createRequire } from "node:module";
|
|
10
|
+
import { normalizeChildSpec } from "../../shared/child-spec.js";
|
|
10
11
|
import { writePrivateAtomicJson } from "../../shared/atomic-json.js";
|
|
11
12
|
import { applyThinkingSuffix } from "../shared/pi-args.js";
|
|
12
13
|
import { snapshotParentPermissionMode } from "../../../../../core/subagent-permission-inherit.js";
|
|
@@ -14,7 +15,6 @@ import { injectOutputPathSystemPrompt, injectSingleOutputInstruction, normalizeS
|
|
|
14
15
|
import { buildChainInstructions, isDynamicParallelStep, isParallelStep, resolveStepBehavior, suppressProgressForReadOnlyTask, writeInitialProgressFile } from "../../shared/settings.js";
|
|
15
16
|
import { resolvePiPackageRoot } from "../shared/pi-spawn.js";
|
|
16
17
|
import { buildSkillInjection, normalizeSkillInput, resolveSkillsWithFallback } from "../../agents/skills.js";
|
|
17
|
-
import { buildAgentMemoryInjection } from "../../agents/agent-memory.js";
|
|
18
18
|
import { PI_CODING_AGENT_PACKAGE_ROOT_ENV, resolveChildCwd } from "../../shared/utils.js";
|
|
19
19
|
import { buildModelCandidates, resolveEffectiveSubagentModel, resolveSubagentModelOverride } from "../shared/model-fallback.js";
|
|
20
20
|
import { resolveEffectiveThinking } from "../../shared/model-info.js";
|
|
@@ -23,7 +23,7 @@ import { buildWorkflowGraphSnapshot } from "../shared/workflow-graph.js";
|
|
|
23
23
|
import { ChainOutputValidationError, validateChainOutputBindings } from "../shared/chain-outputs.js";
|
|
24
24
|
import { createStructuredOutputRuntime } from "../shared/structured-output.js";
|
|
25
25
|
import { resolveEffectiveAcceptance } from "../shared/acceptance.js";
|
|
26
|
-
import { ASYNC_DIR, RESULTS_DIR, SUBAGENT_ASYNC_STARTED_EVENT, SUBAGENT_LIFECYCLE_ARTIFACT_VERSION, TEMP_ROOT_DIR, getAsyncConfigPath,
|
|
26
|
+
import { ASYNC_DIR, RESULTS_DIR, SUBAGENT_ASYNC_STARTED_EVENT, SUBAGENT_LIFECYCLE_ARTIFACT_VERSION, TEMP_ROOT_DIR, getAsyncConfigPath, } from "../../shared/types.js";
|
|
27
27
|
import { nestedResultsPath, resolveInheritedNestedRouteFromEnv, resolveNestedParentAddressFromEnv, writeNestedEvent } from "../shared/nested-events.js";
|
|
28
28
|
import { initialTurnBudgetState } from "../shared/turn-budget.js";
|
|
29
29
|
import { validateToolBudgetConfig } from "../shared/tool-budget.js";
|
|
@@ -333,8 +333,11 @@ class UnavailableSubagentSkillError extends Error {
|
|
|
333
333
|
}
|
|
334
334
|
class AsyncStartValidationError extends Error {
|
|
335
335
|
}
|
|
336
|
+
function childDescription(step) {
|
|
337
|
+
return step.description || step.label || step.agent || "child";
|
|
338
|
+
}
|
|
336
339
|
export function buildAsyncRunnerSteps(id, params) {
|
|
337
|
-
const { chain,
|
|
340
|
+
const { chain, ctx, cwd, sessionFilesByFlatIndex, thinkingOverridesByFlatIndex, maxSubagentDepth, worktreeBaseDir, asyncDir, } = params;
|
|
338
341
|
const outputBaseDir = params.outputBaseDir;
|
|
339
342
|
const resultMode = params.resultMode ?? "chain";
|
|
340
343
|
const chainSkills = params.chainSkills ?? [];
|
|
@@ -368,18 +371,6 @@ export function buildAsyncRunnerSteps(id, params) {
|
|
|
368
371
|
throw error;
|
|
369
372
|
}
|
|
370
373
|
const workflowGraph = buildWorkflowGraphSnapshot({ runId: id, mode: resultMode, steps: graphChain });
|
|
371
|
-
for (const s of chain) {
|
|
372
|
-
const stepAgents = isParallelStep(s)
|
|
373
|
-
? s.parallel.map((t) => t.agent)
|
|
374
|
-
: isDynamicParallelStep(s)
|
|
375
|
-
? [s.parallel.agent]
|
|
376
|
-
: [s.agent];
|
|
377
|
-
for (const agentName of stepAgents) {
|
|
378
|
-
if (!agents.find((x) => x.name === agentName)) {
|
|
379
|
-
return { error: `Unknown agent: ${agentName}` };
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
374
|
let progressInstructionCreated = false;
|
|
384
375
|
const buildStepOverrides = (s) => {
|
|
385
376
|
const stepSkillInput = normalizeSkillInput(s.skill);
|
|
@@ -393,35 +384,39 @@ export function buildAsyncRunnerSteps(id, params) {
|
|
|
393
384
|
};
|
|
394
385
|
};
|
|
395
386
|
const buildSeqStep = (s, sessionFile, behaviorCwd, progressPrecreated = false, resolvedBehavior, flatIndex, parallelOutputNamespace) => {
|
|
396
|
-
const
|
|
397
|
-
const
|
|
398
|
-
|
|
387
|
+
const childIndex = flatIndex ?? parallelOutputNamespace?.stepIndex ?? 0;
|
|
388
|
+
const spec = normalizeChildSpec(s, {
|
|
389
|
+
parentMode: snapshotParentPermissionMode(ctx.parentSessionId ?? ctx.currentSessionId),
|
|
390
|
+
runId: params.childIdRunId ?? id,
|
|
391
|
+
index: childIndex,
|
|
392
|
+
childId: s.childId ?? (s.agent?.trim() ? s.agent : undefined),
|
|
393
|
+
defaultTask: "{previous}",
|
|
394
|
+
fanoutAuthorized: false,
|
|
395
|
+
});
|
|
396
|
+
const toolBudgetInput = spec.toolBudget ?? params.toolBudget ?? params.configToolBudget;
|
|
397
|
+
const resolvedToolBudget = validateToolBudgetConfig(toolBudgetInput, spec.toolBudget ? "toolBudget" : "config.toolBudget");
|
|
399
398
|
if (resolvedToolBudget.error)
|
|
400
399
|
throw new AsyncStartValidationError(resolvedToolBudget.error);
|
|
401
400
|
const stepCwd = resolveChildCwd(runnerCwd, s.cwd);
|
|
402
401
|
const instructionCwd = behaviorCwd ?? stepCwd;
|
|
403
|
-
let behavior = suppressProgressForReadOnlyTask(resolvedBehavior ?? resolveStepBehavior(
|
|
402
|
+
let behavior = suppressProgressForReadOnlyTask(resolvedBehavior ?? resolveStepBehavior(buildStepOverrides(s), chainSkills), s.task, originalTask);
|
|
404
403
|
const inheritedRelativeParallelOutput = parallelOutputNamespace && s.output === undefined && typeof behavior.output === "string" && !path.isAbsolute(behavior.output);
|
|
405
404
|
if (inheritedRelativeParallelOutput && parallelOutputNamespace.taskIndex !== undefined) {
|
|
406
405
|
behavior = {
|
|
407
406
|
...behavior,
|
|
408
|
-
output: path.join(`parallel-${parallelOutputNamespace.stepIndex}`,
|
|
407
|
+
output: path.join(`parallel-${parallelOutputNamespace.stepIndex}`, String(parallelOutputNamespace.taskIndex), behavior.output),
|
|
409
408
|
};
|
|
410
409
|
}
|
|
411
410
|
const namespaceOutputPath = Boolean(inheritedRelativeParallelOutput && parallelOutputNamespace.taskIndex === undefined);
|
|
412
411
|
const skillNames = behavior.skills === false ? [] : behavior.skills;
|
|
413
|
-
const { resolved: resolvedSkills, missing: missingSkills } = resolveSkillsWithFallback(skillNames, stepCwd, ctx.cwd,
|
|
412
|
+
const { resolved: resolvedSkills, missing: missingSkills } = resolveSkillsWithFallback(skillNames, stepCwd, ctx.cwd, undefined, stepCwd);
|
|
414
413
|
if (missingSkills.includes("pi-subagents"))
|
|
415
414
|
throw new UnavailableSubagentSkillError(UNAVAILABLE_SUBAGENT_SKILL_ERROR);
|
|
416
|
-
let systemPrompt =
|
|
415
|
+
let systemPrompt = "";
|
|
417
416
|
if (resolvedSkills.length > 0) {
|
|
418
417
|
const injection = buildSkillInjection(resolvedSkills);
|
|
419
418
|
systemPrompt = systemPrompt ? `${systemPrompt}\n\n${injection}` : injection;
|
|
420
419
|
}
|
|
421
|
-
const memoryInjection = buildAgentMemoryInjection(a, stepCwd);
|
|
422
|
-
if (memoryInjection) {
|
|
423
|
-
systemPrompt = systemPrompt ? `${systemPrompt}\n\n${memoryInjection}` : memoryInjection;
|
|
424
|
-
}
|
|
425
420
|
const readInstructions = buildChainInstructions({ ...behavior, output: false, progress: false }, instructionCwd, false);
|
|
426
421
|
const isFirstProgressAgent = behavior.progress && !progressPrecreated && !progressInstructionCreated;
|
|
427
422
|
if (behavior.progress)
|
|
@@ -429,23 +424,30 @@ export function buildAsyncRunnerSteps(id, params) {
|
|
|
429
424
|
const progressInstructions = buildChainInstructions({ ...behavior, output: false, reads: false }, progressDir, isFirstProgressAgent);
|
|
430
425
|
const outputPath = resolveSingleOutputPath(behavior.output, ctx.cwd, instructionCwd, outputBaseDir);
|
|
431
426
|
if (!namespaceOutputPath)
|
|
432
|
-
systemPrompt = injectOutputPathSystemPrompt(systemPrompt, outputPath,
|
|
433
|
-
|
|
427
|
+
systemPrompt = injectOutputPathSystemPrompt(systemPrompt, outputPath, {
|
|
428
|
+
tools: spec.effectivePermissions === "read-only" ? ["read", "grep", "find", "ls", "bash"] : undefined,
|
|
429
|
+
});
|
|
430
|
+
const validationError = validateFileOnlyOutputMode(behavior.outputMode, outputPath, `Async step (${spec.description})`);
|
|
434
431
|
if (validationError)
|
|
435
432
|
throw new AsyncStartValidationError(validationError);
|
|
436
433
|
let taskTemplate = s.task ?? "{previous}";
|
|
437
434
|
taskTemplate = taskTemplate.replace(/\{task\}/g, originalTask ?? "");
|
|
438
435
|
taskTemplate = taskTemplate.replace(/\{chain_dir\}/g, runnerCwd);
|
|
439
436
|
const taskText = `${readInstructions.prefix}${taskTemplate}${progressInstructions.suffix}`;
|
|
440
|
-
const task = namespaceOutputPath ? taskText : injectSingleOutputInstruction(taskText, outputPath,
|
|
441
|
-
|
|
437
|
+
const task = namespaceOutputPath ? taskText : injectSingleOutputInstruction(taskText, outputPath, {
|
|
438
|
+
tools: spec.effectivePermissions === "read-only" ? ["read", "grep", "find", "ls", "bash"] : undefined,
|
|
439
|
+
});
|
|
440
|
+
const primaryModel = resolveEffectiveSubagentModel(spec.model, undefined, ctx.currentModel, availableModels, ctx.currentModelProvider, { scope: ctx.modelScope });
|
|
442
441
|
const thinkingOverride = flatIndex === undefined ? undefined : thinkingOverridesByFlatIndex?.[flatIndex];
|
|
443
|
-
const effectiveThinking = thinkingOverride
|
|
442
|
+
const effectiveThinking = thinkingOverride;
|
|
444
443
|
const model = applyThinkingSuffix(primaryModel, effectiveThinking, thinkingOverride !== undefined);
|
|
445
444
|
return {
|
|
446
445
|
parentSessionId: ctx.parentSessionId ?? ctx.currentSessionId,
|
|
447
446
|
parentPermissionMode: snapshotParentPermissionMode(ctx.parentSessionId ?? ctx.currentSessionId),
|
|
448
|
-
|
|
447
|
+
childId: spec.childId,
|
|
448
|
+
description: spec.description,
|
|
449
|
+
permissions: spec.effectivePermissions,
|
|
450
|
+
agent: spec.description,
|
|
449
451
|
task,
|
|
450
452
|
phase: s.phase,
|
|
451
453
|
label: s.label,
|
|
@@ -454,34 +456,29 @@ export function buildAsyncRunnerSteps(id, params) {
|
|
|
454
456
|
cwd: stepCwd,
|
|
455
457
|
model,
|
|
456
458
|
thinking: resolveEffectiveThinking(model, effectiveThinking),
|
|
457
|
-
modelCandidates: buildModelCandidates(primaryModel,
|
|
458
|
-
tools: a.tools,
|
|
459
|
-
extensions: a.extensions,
|
|
460
|
-
subagentOnlyExtensions: a.subagentOnlyExtensions,
|
|
461
|
-
mcpDirectTools: a.mcpDirectTools,
|
|
462
|
-
completionGuard: a.completionGuard,
|
|
459
|
+
modelCandidates: buildModelCandidates(primaryModel, undefined, availableModels, ctx.currentModelProvider, { scope: ctx.modelScope }).map((candidate) => applyThinkingSuffix(candidate, effectiveThinking, thinkingOverride !== undefined)),
|
|
463
460
|
systemPrompt,
|
|
464
|
-
systemPromptMode:
|
|
465
|
-
inheritProjectContext:
|
|
466
|
-
inheritSkills:
|
|
461
|
+
systemPromptMode: "append",
|
|
462
|
+
inheritProjectContext: true,
|
|
463
|
+
inheritSkills: false,
|
|
467
464
|
skills: resolvedSkills.map((r) => r.name),
|
|
468
465
|
outputPath,
|
|
469
466
|
...(namespaceOutputPath ? { namespaceOutputPath: true } : {}),
|
|
470
467
|
outputMode: behavior.outputMode,
|
|
471
468
|
sessionFile,
|
|
472
|
-
maxSubagentDepth
|
|
469
|
+
maxSubagentDepth,
|
|
473
470
|
waitToolEnabled: params.waitToolEnabled,
|
|
474
471
|
effectiveAcceptance: resolveEffectiveAcceptance({
|
|
475
472
|
explicit: s.acceptance,
|
|
476
|
-
agentName:
|
|
477
|
-
|
|
473
|
+
agentName: spec.description,
|
|
474
|
+
permissions: spec.effectivePermissions,
|
|
478
475
|
task,
|
|
479
476
|
mode: resultMode,
|
|
480
477
|
async: true,
|
|
481
478
|
dynamic: false,
|
|
482
479
|
}),
|
|
483
480
|
acceptanceInput: s.acceptance,
|
|
484
|
-
acceptanceRole:
|
|
481
|
+
acceptanceRole: spec.effectivePermissions === "read-only" ? "read-only" : "writer",
|
|
485
482
|
...(s.outputSchema ? { structuredOutputSchema: s.outputSchema } : {}),
|
|
486
483
|
...(s.outputSchema ? { structuredOutput: createStructuredOutputRuntime(s.outputSchema, path.join(asyncDir, "structured-output")) } : {}),
|
|
487
484
|
...(resolvedToolBudget.budget ? { toolBudget: resolvedToolBudget.budget } : {}),
|
|
@@ -503,8 +500,7 @@ export function buildAsyncRunnerSteps(id, params) {
|
|
|
503
500
|
const builtSteps = chain.map((s, stepIndex) => {
|
|
504
501
|
if (isParallelStep(s)) {
|
|
505
502
|
const parallelBehaviors = s.parallel.map((task) => {
|
|
506
|
-
|
|
507
|
-
return suppressProgressForReadOnlyTask(resolveStepBehavior(agent, buildStepOverrides(task), chainSkills), task.task, originalTask);
|
|
503
|
+
return suppressProgressForReadOnlyTask(resolveStepBehavior(buildStepOverrides(task), chainSkills), task.task, originalTask);
|
|
508
504
|
});
|
|
509
505
|
const progressPrecreated = parallelBehaviors.some((behavior) => behavior.progress);
|
|
510
506
|
if (progressPrecreated) {
|
|
@@ -532,8 +528,7 @@ export function buildAsyncRunnerSteps(id, params) {
|
|
|
532
528
|
};
|
|
533
529
|
}
|
|
534
530
|
if (isDynamicParallelStep(s)) {
|
|
535
|
-
const
|
|
536
|
-
const behavior = suppressProgressForReadOnlyTask(resolveStepBehavior(agent, buildStepOverrides(s.parallel), chainSkills), s.parallel.task, originalTask);
|
|
531
|
+
const behavior = suppressProgressForReadOnlyTask(resolveStepBehavior(buildStepOverrides(s.parallel), chainSkills), s.parallel.task, originalTask);
|
|
537
532
|
const progressPrecreated = behavior.progress;
|
|
538
533
|
if (progressPrecreated) {
|
|
539
534
|
writeInitialProgressFile(progressDir);
|
|
@@ -554,15 +549,15 @@ export function buildAsyncRunnerSteps(id, params) {
|
|
|
554
549
|
thinkingOverrides: dynamicFlatSteps.map((step) => step.thinkingOverride),
|
|
555
550
|
effectiveAcceptance: resolveEffectiveAcceptance({
|
|
556
551
|
explicit: s.acceptance,
|
|
557
|
-
agentName: s.parallel.
|
|
558
|
-
|
|
552
|
+
agentName: s.parallel.description,
|
|
553
|
+
permissions: s.parallel.permissions === "read-only" ? "read-only" : "full",
|
|
559
554
|
task: parallel.task,
|
|
560
555
|
mode: resultMode,
|
|
561
556
|
async: true,
|
|
562
557
|
dynamicGroup: true,
|
|
563
558
|
}),
|
|
564
559
|
acceptanceInput: s.acceptance,
|
|
565
|
-
acceptanceRole:
|
|
560
|
+
acceptanceRole: s.parallel.permissions === "read-only" ? "read-only" : "writer",
|
|
566
561
|
};
|
|
567
562
|
}
|
|
568
563
|
const staticStep = nextFlatStep();
|
|
@@ -611,7 +606,7 @@ export function buildAsyncRunnerSteps(id, params) {
|
|
|
611
606
|
* Execute a chain asynchronously
|
|
612
607
|
*/
|
|
613
608
|
export function executeAsyncChain(id, params) {
|
|
614
|
-
const { chain,
|
|
609
|
+
const { chain, ctx, cwd, maxOutput, artifactsDir, artifactConfig, shareEnabled, sessionRoot, sessionFilesByFlatIndex, thinkingOverridesByFlatIndex, maxSubagentDepth, worktreeSetupHook, worktreeSetupHookTimeoutMs, worktreeBaseDir, controlConfig, controlIntercomTarget, childIntercomTarget, nestedRoute, } = params;
|
|
615
610
|
const resultMode = params.resultMode ?? "chain";
|
|
616
611
|
const inheritedNestedRoute = resolveInheritedNestedRouteFromEnv();
|
|
617
612
|
const nestedAddress = inheritedNestedRoute ? resolveNestedParentAddressFromEnv() : undefined;
|
|
@@ -634,7 +629,6 @@ export function executeAsyncChain(id, params) {
|
|
|
634
629
|
task: params.task,
|
|
635
630
|
attachRoot: params.attachRoot,
|
|
636
631
|
resultMode,
|
|
637
|
-
agents,
|
|
638
632
|
ctx,
|
|
639
633
|
availableModels: params.availableModels,
|
|
640
634
|
cwd,
|
|
@@ -674,9 +668,9 @@ export function executeAsyncChain(id, params) {
|
|
|
674
668
|
childTargetIndex++;
|
|
675
669
|
return [undefined];
|
|
676
670
|
}
|
|
677
|
-
return step.parallel.map((task) => childIntercomTarget(task.agent, childTargetIndex++));
|
|
671
|
+
return step.parallel.map((task) => childIntercomTarget(task.childId ?? task.agent, childTargetIndex++));
|
|
678
672
|
}
|
|
679
|
-
return [childIntercomTarget(step.agent, childTargetIndex++)];
|
|
673
|
+
return [childIntercomTarget(step.childId ?? step.agent, childTargetIndex++)];
|
|
680
674
|
}) : undefined;
|
|
681
675
|
let spawnResult = {};
|
|
682
676
|
try {
|
|
@@ -728,10 +722,10 @@ export function executeAsyncChain(id, params) {
|
|
|
728
722
|
if (spawnResult.pid) {
|
|
729
723
|
const eventFirstStep = eventChain[0];
|
|
730
724
|
const firstAgents = isParallelStep(eventFirstStep)
|
|
731
|
-
? eventFirstStep.parallel.map(
|
|
725
|
+
? eventFirstStep.parallel.map(childDescription)
|
|
732
726
|
: isDynamicParallelStep(eventFirstStep)
|
|
733
|
-
? [eventFirstStep.parallel
|
|
734
|
-
: [eventFirstStep
|
|
727
|
+
? [childDescription(eventFirstStep.parallel)]
|
|
728
|
+
: [childDescription(eventFirstStep)];
|
|
735
729
|
const firstTask = isParallelStep(eventFirstStep)
|
|
736
730
|
? eventFirstStep.parallel[0]?.task
|
|
737
731
|
: isDynamicParallelStep(eventFirstStep)
|
|
@@ -745,16 +739,16 @@ export function executeAsyncChain(id, params) {
|
|
|
745
739
|
const step = eventChain[stepIndex];
|
|
746
740
|
if (isParallelStep(step)) {
|
|
747
741
|
parallelGroups.push({ start: flatStepStart, count: step.parallel.length, stepIndex });
|
|
748
|
-
flatAgents.push(...step.parallel.map(
|
|
742
|
+
flatAgents.push(...step.parallel.map(childDescription));
|
|
749
743
|
flatStepStart += step.parallel.length;
|
|
750
744
|
}
|
|
751
745
|
else if (isDynamicParallelStep(step)) {
|
|
752
746
|
parallelGroups.push({ start: flatStepStart, count: 1, stepIndex });
|
|
753
|
-
flatAgents.push(step.parallel
|
|
747
|
+
flatAgents.push(childDescription(step.parallel));
|
|
754
748
|
flatStepStart++;
|
|
755
749
|
}
|
|
756
750
|
else {
|
|
757
|
-
flatAgents.push(step
|
|
751
|
+
flatAgents.push(childDescription(step));
|
|
758
752
|
flatStepStart++;
|
|
759
753
|
}
|
|
760
754
|
}
|
|
@@ -805,7 +799,7 @@ export function executeAsyncChain(id, params) {
|
|
|
805
799
|
agents: flatAgents,
|
|
806
800
|
task: firstTask?.slice(0, 50),
|
|
807
801
|
goal: workflowGoal?.slice(0, 120),
|
|
808
|
-
chain: eventChain.map((s) => isParallelStep(s) ? `[${s.parallel.map(
|
|
802
|
+
chain: eventChain.map((s) => isParallelStep(s) ? `[${s.parallel.map(childDescription).join("+")}]` : isDynamicParallelStep(s) ? `expand:${childDescription(s.parallel)}` : childDescription(s)),
|
|
809
803
|
chainStepCount: eventChain.length,
|
|
810
804
|
parallelGroups,
|
|
811
805
|
workflowGraph,
|
|
@@ -817,7 +811,7 @@ export function executeAsyncChain(id, params) {
|
|
|
817
811
|
});
|
|
818
812
|
}
|
|
819
813
|
const chainDesc = chain
|
|
820
|
-
.map((s) => isParallelStep(s) ? `[${s.parallel.map(
|
|
814
|
+
.map((s) => isParallelStep(s) ? `[${s.parallel.map(childDescription).join("+")}]` : isDynamicParallelStep(s) ? `expand:${childDescription(s.parallel)}` : childDescription(s))
|
|
821
815
|
.join(" -> ");
|
|
822
816
|
return {
|
|
823
817
|
content: [{ type: "text", text: formatAsyncStartedMessage(`Async ${resultMode}: ${chainDesc} [${id}]`) }],
|
|
@@ -828,23 +822,20 @@ export function executeAsyncChain(id, params) {
|
|
|
828
822
|
* Execute a single agent asynchronously
|
|
829
823
|
*/
|
|
830
824
|
export function executeAsyncSingle(id, params) {
|
|
831
|
-
const {
|
|
832
|
-
const
|
|
825
|
+
const { spec, ctx, cwd, maxOutput, artifactsDir, artifactConfig, shareEnabled, sessionRoot, sessionFile, maxSubagentDepth, worktreeSetupHook, worktreeSetupHookTimeoutMs, worktreeBaseDir, controlConfig, controlIntercomTarget, childIntercomTarget, nestedRoute, } = params;
|
|
826
|
+
const agent = spec.description;
|
|
827
|
+
const task = spec.task;
|
|
833
828
|
const runnerCwd = resolveChildCwd(ctx.cwd, cwd);
|
|
834
|
-
const skillNames = params.skills ??
|
|
829
|
+
const skillNames = params.skills ?? (spec.skill === false ? [] : normalizeSkillInput(spec.skill) ?? []);
|
|
835
830
|
const availableModels = params.availableModels;
|
|
836
|
-
const { resolved: resolvedSkills, missing: missingSkills } = resolveSkillsWithFallback(skillNames, runnerCwd, ctx.cwd,
|
|
831
|
+
const { resolved: resolvedSkills, missing: missingSkills } = resolveSkillsWithFallback(skillNames, runnerCwd, ctx.cwd, undefined, runnerCwd);
|
|
837
832
|
if (missingSkills.includes("pi-subagents"))
|
|
838
833
|
return formatAsyncStartError("single", UNAVAILABLE_SUBAGENT_SKILL_ERROR);
|
|
839
|
-
let systemPrompt =
|
|
834
|
+
let systemPrompt = "";
|
|
840
835
|
if (resolvedSkills.length > 0) {
|
|
841
836
|
const injection = buildSkillInjection(resolvedSkills);
|
|
842
837
|
systemPrompt = systemPrompt ? `${systemPrompt}\n\n${injection}` : injection;
|
|
843
838
|
}
|
|
844
|
-
const memoryInjection = buildAgentMemoryInjection(agentConfig, runnerCwd);
|
|
845
|
-
if (memoryInjection) {
|
|
846
|
-
systemPrompt = systemPrompt ? `${systemPrompt}\n\n${memoryInjection}` : memoryInjection;
|
|
847
|
-
}
|
|
848
839
|
const inheritedNestedRoute = resolveInheritedNestedRouteFromEnv();
|
|
849
840
|
const nestedAddress = inheritedNestedRoute ? resolveNestedParentAddressFromEnv() : undefined;
|
|
850
841
|
const asyncDir = inheritedNestedRoute
|
|
@@ -861,19 +852,20 @@ export function executeAsyncSingle(id, params) {
|
|
|
861
852
|
details: { mode: "single", results: [] },
|
|
862
853
|
};
|
|
863
854
|
}
|
|
864
|
-
const effectiveOutput = normalizeSingleOutputOverride(params.output,
|
|
855
|
+
const effectiveOutput = normalizeSingleOutputOverride(params.output ?? spec.output, typeof spec.output === "string" ? spec.output : undefined);
|
|
865
856
|
const outputPath = resolveSingleOutputPath(effectiveOutput, ctx.cwd, runnerCwd, params.outputBaseDir ?? (artifactsDir ? path.join(artifactsDir, "outputs", id) : undefined));
|
|
866
|
-
|
|
867
|
-
|
|
857
|
+
const childToolShape = { tools: spec.effectivePermissions === "read-only" ? ["read", "grep", "find", "ls", "bash"] : undefined };
|
|
858
|
+
systemPrompt = injectOutputPathSystemPrompt(systemPrompt, outputPath, childToolShape);
|
|
859
|
+
const outputMode = params.outputMode ?? spec.outputMode ?? "inline";
|
|
868
860
|
const validationError = validateFileOnlyOutputMode(outputMode, outputPath, `Async single run (${agent})`);
|
|
869
861
|
if (validationError)
|
|
870
862
|
return formatAsyncStartError("single", validationError);
|
|
871
|
-
const taskWithOutputInstruction = injectSingleOutputInstruction(task, outputPath,
|
|
872
|
-
const primaryModel = resolveSubagentModelOverride(params.modelOverride ??
|
|
873
|
-
const effectiveThinking = params.thinkingOverride
|
|
863
|
+
const taskWithOutputInstruction = injectSingleOutputInstruction(task, outputPath, childToolShape);
|
|
864
|
+
const primaryModel = resolveSubagentModelOverride(params.modelOverride ?? spec.model, ctx.currentModel, availableModels, ctx.currentModelProvider);
|
|
865
|
+
const effectiveThinking = params.thinkingOverride;
|
|
874
866
|
const model = applyThinkingSuffix(primaryModel, effectiveThinking, params.thinkingOverride !== undefined);
|
|
875
|
-
const toolBudgetInput = params.toolBudget ??
|
|
876
|
-
const resolvedToolBudget = validateToolBudgetConfig(toolBudgetInput, params.toolBudget
|
|
867
|
+
const toolBudgetInput = params.toolBudget ?? spec.toolBudget ?? params.configToolBudget;
|
|
868
|
+
const resolvedToolBudget = validateToolBudgetConfig(toolBudgetInput, params.toolBudget || spec.toolBudget ? "toolBudget" : "config.toolBudget");
|
|
877
869
|
if (resolvedToolBudget.error)
|
|
878
870
|
return formatAsyncStartError("single", resolvedToolBudget.error);
|
|
879
871
|
const deadlineAt = params.absoluteDeadlineAt ?? (params.timeoutMs !== undefined ? Date.now() + params.timeoutMs : undefined);
|
|
@@ -885,35 +877,26 @@ export function executeAsyncSingle(id, params) {
|
|
|
885
877
|
const initialTurnBudget = params.turnBudget ? initialTurnBudgetState(params.turnBudget) : undefined;
|
|
886
878
|
const resolvedSessionDir = params.sessionDir ?? (sessionRoot ? path.join(sessionRoot, `async-${id}`) : undefined);
|
|
887
879
|
const resolvedAcceptance = resolveEffectiveAcceptance({
|
|
888
|
-
explicit: params.acceptance,
|
|
880
|
+
explicit: params.acceptance ?? spec.acceptance,
|
|
889
881
|
agentName: agent,
|
|
890
|
-
|
|
882
|
+
permissions: spec.effectivePermissions,
|
|
891
883
|
task,
|
|
892
884
|
mode: "single",
|
|
893
885
|
async: true,
|
|
894
886
|
});
|
|
895
887
|
const recoveryDescriptor = {
|
|
896
|
-
version:
|
|
888
|
+
version: 3,
|
|
889
|
+
lifecycleArtifactVersion: SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
|
|
897
890
|
sourceRunId: id,
|
|
891
|
+
childId: spec.childId,
|
|
892
|
+
description: spec.description,
|
|
893
|
+
permissions: spec.effectivePermissions,
|
|
898
894
|
agent,
|
|
899
895
|
...(sessionFile ? { sessionFile } : {}),
|
|
900
896
|
cwd: runnerCwd,
|
|
901
897
|
...(model ? { model } : {}),
|
|
902
|
-
...(agentConfig.fallbackModels ? { fallbackModels: [...agentConfig.fallbackModels] } : {}),
|
|
903
898
|
...(effectiveThinking ? { thinking: resolveEffectiveThinking(model, effectiveThinking) } : {}),
|
|
904
|
-
...(agentConfig.tools ? { tools: [...agentConfig.tools] } : {}),
|
|
905
|
-
...(agentConfig.extensions ? { extensions: [...agentConfig.extensions] } : {}),
|
|
906
|
-
...(agentConfig.subagentOnlyExtensions ? { subagentOnlyExtensions: [...agentConfig.subagentOnlyExtensions] } : {}),
|
|
907
|
-
...(agentConfig.mcpDirectTools ? { mcpDirectTools: [...agentConfig.mcpDirectTools] } : {}),
|
|
908
|
-
...(agentConfig.systemPrompt ? { systemPrompt: agentConfig.systemPrompt } : {}),
|
|
909
|
-
systemPromptMode: agentConfig.systemPromptMode,
|
|
910
|
-
inheritProjectContext: agentConfig.inheritProjectContext,
|
|
911
|
-
inheritSkills: agentConfig.inheritSkills,
|
|
912
899
|
...(resolvedSkills.length ? { skills: resolvedSkills.map((skill) => skill.name) } : {}),
|
|
913
|
-
...(agentConfig.skillPath ? { skillPath: [...agentConfig.skillPath] } : {}),
|
|
914
|
-
...(agentConfig.filePath ? { agentFilePath: agentConfig.filePath } : {}),
|
|
915
|
-
...(agentConfig.completionGuard !== undefined ? { completionGuard: agentConfig.completionGuard } : {}),
|
|
916
|
-
...(agentConfig.memory ? { memory: { ...agentConfig.memory } } : {}),
|
|
917
900
|
...(outputPath ? { outputPath } : {}),
|
|
918
901
|
outputMode,
|
|
919
902
|
...(resolvedAcceptance ? { acceptance: resolvedAcceptance } : {}),
|
|
@@ -921,7 +904,7 @@ export function executeAsyncSingle(id, params) {
|
|
|
921
904
|
...(deadlineAt !== undefined ? { absoluteDeadlineAt: deadlineAt } : {}),
|
|
922
905
|
...(params.turnBudget ? { initialTurnBudget: params.turnBudget } : {}),
|
|
923
906
|
...(resolvedToolBudget.budget ? { initialToolBudget: resolvedToolBudget.budget } : {}),
|
|
924
|
-
maxSubagentDepth
|
|
907
|
+
maxSubagentDepth,
|
|
925
908
|
...(maxOutput ? { maxOutput } : {}),
|
|
926
909
|
share: shareEnabled,
|
|
927
910
|
...(resolvedSessionDir ? { sessionDir: resolvedSessionDir } : {}),
|
|
@@ -942,26 +925,24 @@ export function executeAsyncSingle(id, params) {
|
|
|
942
925
|
{
|
|
943
926
|
parentSessionId: ctx.parentSessionId ?? ctx.currentSessionId,
|
|
944
927
|
parentPermissionMode: snapshotParentPermissionMode(ctx.parentSessionId ?? ctx.currentSessionId),
|
|
928
|
+
childId: spec.childId,
|
|
929
|
+
description: spec.description,
|
|
930
|
+
permissions: spec.effectivePermissions,
|
|
945
931
|
agent,
|
|
946
932
|
task: taskWithOutputInstruction,
|
|
947
933
|
cwd: runnerCwd,
|
|
948
934
|
model,
|
|
949
935
|
thinking: resolveEffectiveThinking(model, effectiveThinking),
|
|
950
|
-
modelCandidates: buildModelCandidates(primaryModel,
|
|
951
|
-
tools: agentConfig.tools,
|
|
952
|
-
extensions: agentConfig.extensions,
|
|
953
|
-
subagentOnlyExtensions: agentConfig.subagentOnlyExtensions,
|
|
954
|
-
mcpDirectTools: agentConfig.mcpDirectTools,
|
|
955
|
-
completionGuard: agentConfig.completionGuard,
|
|
936
|
+
modelCandidates: buildModelCandidates(primaryModel, undefined, availableModels, ctx.currentModelProvider, { scope: ctx.modelScope }).map((candidate) => applyThinkingSuffix(candidate, effectiveThinking, params.thinkingOverride !== undefined)),
|
|
956
937
|
systemPrompt,
|
|
957
|
-
systemPromptMode:
|
|
958
|
-
inheritProjectContext:
|
|
959
|
-
inheritSkills:
|
|
938
|
+
systemPromptMode: "append",
|
|
939
|
+
inheritProjectContext: true,
|
|
940
|
+
inheritSkills: false,
|
|
960
941
|
skills: resolvedSkills.map((r) => r.name),
|
|
961
942
|
outputPath,
|
|
962
943
|
outputMode,
|
|
963
944
|
sessionFile,
|
|
964
|
-
maxSubagentDepth
|
|
945
|
+
maxSubagentDepth,
|
|
965
946
|
waitToolEnabled: params.waitToolEnabled,
|
|
966
947
|
effectiveAcceptance: resolvedAcceptance,
|
|
967
948
|
...(resolvedToolBudget.budget ? { toolBudget: resolvedToolBudget.budget } : {}),
|
|
@@ -988,7 +969,7 @@ export function executeAsyncSingle(id, params) {
|
|
|
988
969
|
turnBudget: params.turnBudget,
|
|
989
970
|
toolBudget: params.toolBudget,
|
|
990
971
|
controlIntercomTarget,
|
|
991
|
-
childIntercomTargets: childIntercomTarget ? [childIntercomTarget(
|
|
972
|
+
childIntercomTargets: childIntercomTarget ? [childIntercomTarget(spec.childId, 0)] : undefined,
|
|
992
973
|
resultMode: "single",
|
|
993
974
|
...(params.revivalLease ? { revivalLease: params.revivalLease } : {}),
|
|
994
975
|
nestedRoute: nestedRoute ?? inheritedNestedRoute,
|