@ashx-j/lunr-dev 0.2.16-dev.9.1 → 0.2.21-dev.12.1
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 +67 -1
- package/README.md +7 -1
- package/dist/builtin-extensions/ashxj-thinking.d.ts +1 -0
- package/dist/builtin-extensions/ashxj-thinking.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-thinking.js +44 -19
- package/dist/builtin-extensions/ashxj-thinking.js.map +1 -1
- package/dist/builtin-extensions/index.d.ts.map +1 -1
- package/dist/builtin-extensions/index.js +1 -2
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/lunr-computer-use.d.ts +3 -0
- package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-computer-use.js +158 -0
- package/dist/builtin-extensions/lunr-computer-use.js.map +1 -0
- package/dist/builtin-extensions/lunr-todos.d.ts +6 -5
- package/dist/builtin-extensions/lunr-todos.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-todos.js +9 -7
- package/dist/builtin-extensions/lunr-todos.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts +6 -4
- package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/broker/spawn.js +114 -61
- package/dist/builtin-extensions/pi-intercom/broker/spawn.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.js +360 -351
- package/dist/builtin-extensions/pi-intercom/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js +10 -3
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts +5 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js +26 -4
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.js +37 -27
- package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts +6 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js +33 -8
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.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 +2 -2
- 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 +8 -6
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +179 -79
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts +18 -8
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +44 -15
- 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 +4 -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 +24 -14
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts +8 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js +247 -18
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts +29 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js +179 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts +89 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js +541 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +11 -1
- 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 +38 -12
- 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-job-tracker.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js +3 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts +2 -1
- 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 +35 -8
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts +7 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js +26 -4
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js +55 -38
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts +100 -0
- 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 +46 -31
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts +3 -6
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js +64 -5
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts +15 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js +14 -4
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +7 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
- 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 +21 -8
- 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.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts +10 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js +38 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts +0 -1
- 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 +74 -41
- 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 -0
- 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 +75 -18
- 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 +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts +13 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js +67 -11
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts +1 -0
- 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 +3 -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 +7 -2
- 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 +13 -3
- 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 +5 -10
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.js +3 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts +3 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js +68 -11
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts +12 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js +21 -2
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +21 -4
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts +7 -0
- 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 +11 -7
- 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 +6 -0
- 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 +46 -29
- 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 +47 -4
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +428 -431
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts +2 -13
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js +5 -91
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.js +103 -102
- package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +1 -1
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/computer-use/adapter.d.ts +23 -0
- package/dist/core/computer-use/adapter.d.ts.map +1 -0
- package/dist/core/computer-use/adapter.js +116 -0
- package/dist/core/computer-use/adapter.js.map +1 -0
- package/dist/core/computer-use/image.d.ts +26 -0
- package/dist/core/computer-use/image.d.ts.map +1 -0
- package/dist/core/computer-use/image.js +64 -0
- package/dist/core/computer-use/image.js.map +1 -0
- package/dist/core/computer-use/lease.d.ts +18 -0
- package/dist/core/computer-use/lease.d.ts.map +1 -0
- package/dist/core/computer-use/lease.js +129 -0
- package/dist/core/computer-use/lease.js.map +1 -0
- package/dist/core/computer-use/macos-runtime.d.ts +14 -0
- package/dist/core/computer-use/macos-runtime.d.ts.map +1 -0
- package/dist/core/computer-use/macos-runtime.js +148 -0
- package/dist/core/computer-use/macos-runtime.js.map +1 -0
- package/dist/core/computer-use/policy.d.ts +19 -0
- package/dist/core/computer-use/policy.d.ts.map +1 -0
- package/dist/core/computer-use/policy.js +62 -0
- package/dist/core/computer-use/policy.js.map +1 -0
- package/dist/core/computer-use/release.generated.d.ts +31 -0
- package/dist/core/computer-use/release.generated.d.ts.map +1 -0
- package/dist/core/computer-use/release.generated.js +36 -0
- package/dist/core/computer-use/release.generated.js.map +1 -0
- package/dist/core/computer-use/runtime.d.ts +13 -0
- package/dist/core/computer-use/runtime.d.ts.map +1 -0
- package/dist/core/computer-use/runtime.js +158 -0
- package/dist/core/computer-use/runtime.js.map +1 -0
- package/dist/core/computer-use/schemas.d.ts +91 -0
- package/dist/core/computer-use/schemas.d.ts.map +1 -0
- package/dist/core/computer-use/schemas.js +71 -0
- package/dist/core/computer-use/schemas.js.map +1 -0
- package/dist/core/computer-use/windows-desktop.d.ts +3 -0
- package/dist/core/computer-use/windows-desktop.d.ts.map +1 -0
- package/dist/core/computer-use/windows-desktop.js +48 -0
- package/dist/core/computer-use/windows-desktop.js.map +1 -0
- package/dist/core/computer-use/workflow.d.ts +32 -0
- package/dist/core/computer-use/workflow.d.ts.map +1 -0
- package/dist/core/computer-use/workflow.js +341 -0
- package/dist/core/computer-use/workflow.js.map +1 -0
- package/dist/core/customize.d.ts +2 -0
- package/dist/core/customize.d.ts.map +1 -1
- package/dist/core/customize.js +3 -0
- package/dist/core/customize.js.map +1 -1
- package/dist/core/keybindings.d.ts +2 -2
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +2 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-runtime.d.ts +0 -3
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +1 -10
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +1 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/permissions.d.ts +2 -1
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +31 -11
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +9 -5
- package/dist/core/plan-mode.js.map +1 -1
- package/dist/core/rollback.d.ts.map +1 -1
- package/dist/core/rollback.js +13 -90
- package/dist/core/rollback.js.map +1 -1
- package/dist/core/runtime-bridges.d.ts.map +1 -1
- package/dist/core/runtime-bridges.js +0 -2
- package/dist/core/runtime-bridges.js.map +1 -1
- package/dist/core/session-manager.d.ts +0 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +21 -79
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +10 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +30 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/subagent-cancellation.d.ts +21 -0
- package/dist/core/subagent-cancellation.d.ts.map +1 -0
- package/dist/core/subagent-cancellation.js +53 -0
- package/dist/core/subagent-cancellation.js.map +1 -0
- package/dist/core/subagent-spinner-setting.d.ts +6 -0
- package/dist/core/subagent-spinner-setting.d.ts.map +1 -0
- package/dist/core/subagent-spinner-setting.js +12 -0
- package/dist/core/subagent-spinner-setting.js.map +1 -0
- package/dist/core/subagent-spinner.d.ts +4 -0
- package/dist/core/subagent-spinner.d.ts.map +1 -0
- package/dist/core/subagent-spinner.js +6 -0
- package/dist/core/subagent-spinner.js.map +1 -0
- package/dist/dev-cli.js +0 -0
- package/dist/gateway/agent-bridge.d.ts +6 -1
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +23 -6
- package/dist/gateway/agent-bridge.js.map +1 -1
- package/dist/gateway/cron.d.ts +1 -1
- package/dist/gateway/cron.d.ts.map +1 -1
- package/dist/gateway/cron.js +23 -7
- package/dist/gateway/cron.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +12 -18
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +4 -2
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +23 -32
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/processes-selector.d.ts +2 -3
- package/dist/modes/interactive/components/processes-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/processes-selector.js +5 -10
- package/dist/modes/interactive/components/processes-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +8 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +93 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +12 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/extension-widget-order.d.ts +8 -0
- package/dist/modes/interactive/extension-widget-order.d.ts.map +1 -0
- package/dist/modes/interactive/extension-widget-order.js +37 -0
- package/dist/modes/interactive/extension-widget-order.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +58 -26
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/thinking-level-slash.d.ts +4 -0
- package/dist/modes/interactive/thinking-level-slash.d.ts.map +1 -0
- package/dist/modes/interactive/thinking-level-slash.js +23 -0
- package/dist/modes/interactive/thinking-level-slash.js.map +1 -0
- package/dist/node-runtime/adapter-AZMY335J.js +279 -0
- package/dist/node-runtime/{agent-session-services-IFJMSX7Z.js → agent-session-services-QANFGM2V.js} +15 -11
- package/dist/node-runtime/{builtin-extensions-LYZ3BFWQ.js → builtin-extensions-SRCYQPZ6.js} +5 -3
- package/dist/node-runtime/chunk-2IDTZAG5.js +1415 -0
- package/dist/node-runtime/chunk-3ONQTOMR.js +68 -0
- package/dist/node-runtime/{chunk-TQNSPERU.js → chunk-5SQDLSZJ.js} +1 -1
- package/dist/node-runtime/chunk-5ZH3ZFIZ.js +308 -0
- package/dist/node-runtime/{chunk-PBC2Y6GS.js → chunk-6UB6NKA3.js} +29 -72
- package/dist/node-runtime/{chunk-A2KQXUJD.js → chunk-7AFOFSDY.js} +1 -1
- package/dist/node-runtime/chunk-A3KMVBZV.js +60 -0
- package/dist/node-runtime/{chunk-N77MY65L.js → chunk-BJ6H7DPI.js} +25 -25
- package/dist/node-runtime/{chunk-PGAJ5MO5.js → chunk-BYQ2MOFI.js} +6 -6
- package/dist/node-runtime/{chunk-QH42CDX3.js → chunk-CZUBYPFP.js} +234 -124
- package/dist/node-runtime/{chunk-LZAW4ZX3.js → chunk-D466UAID.js} +34 -13
- package/dist/node-runtime/{chunk-ZKMFUD3Q.js → chunk-GT5F3OKM.js} +3 -3
- package/dist/node-runtime/chunk-H2BI7G7T.js +73 -0
- package/dist/node-runtime/{chunk-5P7PZMRU.js → chunk-HRS4HMDX.js} +1 -1
- package/dist/node-runtime/{chunk-IPA627GP.js → chunk-HXJS2PJM.js} +4 -4
- package/dist/node-runtime/chunk-JZHEUQRL.js +180 -0
- package/dist/node-runtime/chunk-LISUTZS3.js +19 -0
- package/dist/node-runtime/chunk-LOYUC2ID.js +2185 -0
- package/dist/node-runtime/{chunk-2QKLKMKC.js → chunk-LTXUQJI4.js} +1 -1
- package/dist/node-runtime/{chunk-YF63P5ZT.js → chunk-LTYWTR3V.js} +1 -426
- package/dist/node-runtime/{chunk-MKKH27PH.js → chunk-LWJXTA6Z.js} +274 -2416
- package/dist/node-runtime/chunk-MW2XJZIK.js +108 -0
- package/dist/node-runtime/{chunk-CDFZEWPU.js → chunk-N3PNL74S.js} +537 -262
- package/dist/node-runtime/{chunk-4TLO4PO2.js → chunk-U6C7VTR5.js} +7 -1401
- package/dist/node-runtime/chunk-URD2SLIT.js +1019 -0
- package/dist/node-runtime/{chunk-HQCKFM2O.js → chunk-VGYZ3APQ.js} +3 -0
- package/dist/node-runtime/{chunk-AJX357CL.js → chunk-VQ4UBWSA.js} +30 -1013
- package/dist/node-runtime/{chunk-F4VQFJI2.js → chunk-VTGEKB7R.js} +2 -2
- package/dist/node-runtime/{chunk-AD6VXAO7.js → chunk-VTPM5V35.js} +5 -100
- package/dist/node-runtime/chunk-W3SILANP.js +24 -0
- package/dist/node-runtime/{chunk-WOVTOV5P.js → chunk-XAUQOKYK.js} +421 -63
- package/dist/node-runtime/{chunk-ECD5L7YI.js → chunk-XSRCAQK2.js} +390 -16
- package/dist/node-runtime/{chunk-PCGNAY2O.js → chunk-ZOIIMEN6.js} +54 -433
- package/dist/node-runtime/{chunk-EDBJNRSM.js → chunk-ZVSORYRM.js} +1 -1
- package/dist/node-runtime/cli-runtime.js +1 -1
- package/dist/node-runtime/{command-L3LAHDIH.js → command-ZURZJDXF.js} +1 -1
- package/dist/node-runtime/{commands-RL5YBW5I.js → commands-BZGSLIP7.js} +4 -2
- package/dist/node-runtime/{customize-XEXL2DGQ.js → customize-LF5VST47.js} +1 -1
- package/dist/node-runtime/{direct-tool-executor-JVDXTO7A.js → direct-tool-executor-BSZDHIYR.js} +7 -4
- package/dist/node-runtime/{export-html-KR26FOUZ.js → export-html-E4DT6ZJQ.js} +1 -1
- package/dist/node-runtime/{gateway-X2TI5X7F.js → gateway-FWHRIBK5.js} +24 -369
- package/dist/node-runtime/index.js +49 -42
- package/dist/node-runtime/{init-NJV2T55N.js → init-DVJUAOUO.js} +4 -2
- package/dist/node-runtime/{interactive-mode-KOM35YF2.js → interactive-mode-BBASNWHN.js} +23 -17
- package/dist/node-runtime/{interactive-view-U6OILKF3.js → interactive-view-N6F4KUIT.js} +3 -5
- package/dist/node-runtime/lunr-computer-use-TJNDAMWM.js +135 -0
- package/dist/node-runtime/{lunr-cron-YJ5UHYRD.js → lunr-cron-J64I72C6.js} +7 -1
- package/dist/node-runtime/main.js +25 -20
- package/dist/node-runtime/{mcp-auth-flow-QIXHW6QN.js → mcp-auth-flow-YL6RWPYG.js} +2 -1
- package/dist/node-runtime/{package-manager-cli-TZZHJCVI.js → package-manager-cli-VMYX4Y2S.js} +10 -7
- package/dist/node-runtime/{pi-intercom-EEMBGQID.js → pi-intercom-NV2LW6X7.js} +108 -87
- package/dist/node-runtime/{pi-mcp-adapter-QFB37AVN.js → pi-mcp-adapter-JLB5YL2F.js} +31 -25
- package/dist/node-runtime/{pi-subagents-7XJ4H53P.js → pi-subagents-WEHV3W7H.js} +1321 -631
- package/dist/node-runtime/{pi-web-access-DPGAVKOA.js → pi-web-access-FN5YC5T6.js} +67 -64
- package/dist/node-runtime/{proxy-modes-HEEFK4KC.js → proxy-modes-OR7ISBXK.js} +7 -4
- package/dist/node-runtime/rpc-entry.js +25 -20
- package/dist/node-runtime/runtime-3SB5ATHQ.js +21 -0
- package/dist/node-runtime/{runtime-bridges-PPHNBFWL.js → runtime-bridges-2VQTLPOZ.js} +3 -5
- package/dist/node-runtime/{session-manager-MQNBYACL.js → session-manager-QEMZBMTM.js} +3 -5
- package/dist/node-runtime/{session-selector-5AZLJS6U.js → session-selector-URVJLOTK.js} +2 -2
- package/dist/node-runtime/{settings-manager-5LF2VQWC.js → settings-manager-3CCU326G.js} +4 -1
- package/dist/node-runtime/{src-Y7JSCK64.js → src-BPQFJR76.js} +27 -7
- package/dist/node-runtime/{subagent-executor-5RNDEPIJ.js → subagent-executor-CXKXQDHH.js} +189 -284
- package/dist/node-runtime/{update-cli-A253SZ7P.js → update-cli-NM7B4CKL.js} +4 -1
- package/dist/node-runtime/workflow-C26QCUTW.js +468 -0
- package/dist/rpc.d.ts +3 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +18 -0
- package/dist/rpc.js.map +1 -0
- package/dist/startup/interactive-view.d.ts.map +1 -1
- package/dist/startup/interactive-view.js +1 -2
- package/dist/startup/interactive-view.js.map +1 -1
- package/docs/computer-use.md +242 -0
- package/docs/development.md +0 -32
- package/docs/features.md +24 -6
- package/docs/interactive-startup.md +10 -3
- package/docs/keybindings.md +5 -3
- package/docs/settings.md +3 -2
- package/docs/terminal-setup.md +1 -1
- package/docs/usage.md +1 -1
- 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/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/hidden-thinking-label.ts +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/install-lock/package-lock.json +3827 -0
- package/install-lock/package.json +18 -0
- package/native/computer-use/LICENSE.md +21 -0
- package/npm-shrinkwrap.json +3808 -0
- package/package.json +16 -10
- package/dist/builtin-extensions/lunr-settings-tools.d.ts +0 -4
- package/dist/builtin-extensions/lunr-settings-tools.d.ts.map +0 -1
- package/dist/builtin-extensions/lunr-settings-tools.js +0 -120
- package/dist/builtin-extensions/lunr-settings-tools.js.map +0 -1
- package/dist/core/settings-tools-bridge.d.ts +0 -35
- package/dist/core/settings-tools-bridge.d.ts.map +0 -1
- package/dist/core/settings-tools-bridge.js +0 -56
- package/dist/core/settings-tools-bridge.js.map +0 -1
- package/dist/node-runtime/chunk-AHSTJBIB.js +0 -64
- package/dist/startup/interactive-shell.d.ts +0 -55
- package/dist/startup/interactive-shell.d.ts.map +0 -1
- package/dist/startup/interactive-shell.js +0 -264
- package/dist/startup/interactive-shell.js.map +0 -1
- package/dist/node-runtime/{chunk-YSKSB3BJ.js → chunk-CH6OL6P2.js} +2 -2
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
PI_CODING_AGENT_PACKAGE_ROOT_ENV,
|
|
15
15
|
RESULTS_DIR,
|
|
16
16
|
SUBAGENT_ACTIONS,
|
|
17
|
+
SUBAGENT_ASYNC_GUIDANCE,
|
|
17
18
|
SUBAGENT_ASYNC_STARTED_EVENT,
|
|
18
19
|
SUBAGENT_CONTROL_EVENT,
|
|
19
20
|
SUBAGENT_CONTROL_INTERCOM_EVENT,
|
|
@@ -21,7 +22,6 @@ import {
|
|
|
21
22
|
SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
|
|
22
23
|
Semaphore,
|
|
23
24
|
TEMP_ROOT_DIR,
|
|
24
|
-
THINKING_LEVELS,
|
|
25
25
|
acceptChildWatchdogEvent,
|
|
26
26
|
acceptanceFailureMessage,
|
|
27
27
|
aggregateAcceptanceReport,
|
|
@@ -30,7 +30,6 @@ import {
|
|
|
30
30
|
appendTurnBudgetSystemPrompt,
|
|
31
31
|
applyIntercomBridgeToAgent,
|
|
32
32
|
applyThinkingSuffix,
|
|
33
|
-
assertSafeNestedId,
|
|
34
33
|
attachNestedChildrenToResultChildren,
|
|
35
34
|
attachRootChildrenToSteps,
|
|
36
35
|
buildChainInstructions,
|
|
@@ -69,11 +68,9 @@ import {
|
|
|
69
68
|
expectsImplementationMutation,
|
|
70
69
|
extractTextFromContent,
|
|
71
70
|
extractToolArgsPreview,
|
|
72
|
-
findAsyncRunPrefixMatches,
|
|
73
71
|
findLatestSessionFile,
|
|
74
72
|
findModelInfo,
|
|
75
73
|
findNestedRouteForRootId,
|
|
76
|
-
findNestedRunMatchesById,
|
|
77
74
|
flatToLogicalStepIndex,
|
|
78
75
|
formatAcceptancePrompt,
|
|
79
76
|
formatActivityLabel,
|
|
@@ -116,7 +113,6 @@ import {
|
|
|
116
113
|
normalizeChildSpec,
|
|
117
114
|
normalizeParallelGroups,
|
|
118
115
|
normalizeSkillInput,
|
|
119
|
-
parseWatchdogThinkingInput,
|
|
120
116
|
projectNestedRegistryForRoot,
|
|
121
117
|
readChildToolDiagnosticError,
|
|
122
118
|
readNestedControlResults,
|
|
@@ -140,6 +136,7 @@ import {
|
|
|
140
136
|
resolveEffectiveAcceptance,
|
|
141
137
|
resolveEffectiveSubagentModel,
|
|
142
138
|
resolveEffectiveThinking,
|
|
139
|
+
resolveExecutableChildModel,
|
|
143
140
|
resolveInheritedNestedRouteFromEnv,
|
|
144
141
|
resolveIntercomBridge,
|
|
145
142
|
resolveIntercomSessionTarget,
|
|
@@ -148,22 +145,25 @@ import {
|
|
|
148
145
|
resolveNestedAsyncDir,
|
|
149
146
|
resolveNestedParentAddressFromEnv,
|
|
150
147
|
resolveParallelBehaviors,
|
|
151
|
-
resolveRequiredTierModel,
|
|
152
148
|
resolveSkillsWithFallback,
|
|
153
149
|
resolveStepBehavior,
|
|
154
150
|
resolveSubagentIntercomTarget,
|
|
151
|
+
resolveSubagentRequestParams,
|
|
155
152
|
resolveSubagentResultStatus,
|
|
153
|
+
resolveSubagentRunId,
|
|
156
154
|
resolveTopLevelParallelConcurrency,
|
|
157
155
|
resolveTopLevelParallelMaxTasks,
|
|
158
156
|
resolveTurnBudgetConfig,
|
|
159
157
|
resolveWatchdogConfig,
|
|
160
158
|
resolveWatchdogModelInput,
|
|
159
|
+
restorePersistedAcceptance,
|
|
161
160
|
shouldAbortForTurnBudget,
|
|
162
161
|
shouldNotifyControlEvent,
|
|
163
162
|
splitKnownThinkingSuffix,
|
|
164
163
|
splitThinkingSuffix,
|
|
165
164
|
stripAcceptanceReport,
|
|
166
165
|
stripDetailsOutputsForIntercomReceipt,
|
|
166
|
+
subagentLaunchRunsAsync,
|
|
167
167
|
sumResultsCost,
|
|
168
168
|
sumResultsUsage,
|
|
169
169
|
suppressProgressForReadOnlyTask,
|
|
@@ -186,25 +186,26 @@ import {
|
|
|
186
186
|
writeMetadata,
|
|
187
187
|
writeNestedControlRequest,
|
|
188
188
|
writeNestedEvent,
|
|
189
|
-
writePrivateAtomicJson
|
|
190
|
-
|
|
191
|
-
} from "./chunk-CDFZEWPU.js";
|
|
189
|
+
writePrivateAtomicJson
|
|
190
|
+
} from "./chunk-N3PNL74S.js";
|
|
192
191
|
import {
|
|
193
192
|
PLAN_MODE_WRITE_SPAWN_ERROR,
|
|
194
193
|
resolveChildPermissions,
|
|
195
194
|
snapshotParentPermissionMode
|
|
196
|
-
} from "./chunk-
|
|
197
|
-
import "./chunk-
|
|
198
|
-
import "./chunk-AD6VXAO7.js";
|
|
199
|
-
import "./chunk-LZAW4ZX3.js";
|
|
200
|
-
import "./chunk-M3LZLQW2.js";
|
|
195
|
+
} from "./chunk-ZVSORYRM.js";
|
|
196
|
+
import "./chunk-GT5F3OKM.js";
|
|
201
197
|
import "./chunk-53YJI7JU.js";
|
|
202
198
|
import "./chunk-GZQHMEWL.js";
|
|
203
199
|
import "./chunk-ZCHMJ34K.js";
|
|
204
200
|
import {
|
|
205
201
|
SessionManager
|
|
206
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-6UB6NKA3.js";
|
|
207
203
|
import "./chunk-FVDOXRUD.js";
|
|
204
|
+
import "./chunk-MW2XJZIK.js";
|
|
205
|
+
import "./chunk-D466UAID.js";
|
|
206
|
+
import "./chunk-M3LZLQW2.js";
|
|
207
|
+
import "./chunk-VTPM5V35.js";
|
|
208
|
+
import "./chunk-3ONQTOMR.js";
|
|
208
209
|
import "./chunk-RQ2Q5IYR.js";
|
|
209
210
|
import "./chunk-C4O2RSQQ.js";
|
|
210
211
|
import "./chunk-MX3GJNXJ.js";
|
|
@@ -214,8 +215,8 @@ import "./chunk-BRJX2PRC.js";
|
|
|
214
215
|
|
|
215
216
|
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js
|
|
216
217
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
217
|
-
import * as
|
|
218
|
-
import * as
|
|
218
|
+
import * as fs15 from "node:fs";
|
|
219
|
+
import * as path15 from "node:path";
|
|
219
220
|
|
|
220
221
|
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.js
|
|
221
222
|
import { matchesKey, visibleWidth, truncateToWidth } from "@ashx-j/lunr-tui";
|
|
@@ -1199,7 +1200,7 @@ function hasMutationToolCall(messages) {
|
|
|
1199
1200
|
return !1;
|
|
1200
1201
|
}
|
|
1201
1202
|
function evaluateCompletionMutationGuard(input) {
|
|
1202
|
-
let expectedMutation = hasMutationToolCapability(input.tools, input.mcpDirectTools) ? expectsImplementationMutation(input.
|
|
1203
|
+
let expectedMutation = hasMutationToolCapability(input.tools, input.mcpDirectTools) ? expectsImplementationMutation(input.permissions, input.task) : !1, attemptedMutation = hasMutationToolCall(input.messages);
|
|
1203
1204
|
return {
|
|
1204
1205
|
expectedMutation,
|
|
1205
1206
|
attemptedMutation,
|
|
@@ -1232,20 +1233,20 @@ function resolvePiPackageRoot() {
|
|
|
1232
1233
|
return;
|
|
1233
1234
|
}
|
|
1234
1235
|
}
|
|
1235
|
-
function isRunnableNodeScript(filePath,
|
|
1236
|
-
return
|
|
1236
|
+
function isRunnableNodeScript(filePath, existsSync11) {
|
|
1237
|
+
return existsSync11(filePath) ? /\.(?:mjs|cjs|js)$/i.test(filePath) : !1;
|
|
1237
1238
|
}
|
|
1238
1239
|
function normalizePath(filePath) {
|
|
1239
1240
|
return path2.isAbsolute(filePath) ? filePath : path2.resolve(filePath);
|
|
1240
1241
|
}
|
|
1241
1242
|
function resolvePiCliScript(deps = {}) {
|
|
1242
|
-
let
|
|
1243
|
+
let existsSync11 = deps.existsSync ?? fs2.existsSync, realpathSync5 = deps.realpathSync ?? fs2.realpathSync, readFileSync8 = deps.readFileSync ?? ((filePath, encoding) => fs2.readFileSync(filePath, encoding)), argv1 = deps.argv1 ?? process.argv[1];
|
|
1243
1244
|
if (argv1) {
|
|
1244
1245
|
let argvPath = normalizePath(argv1);
|
|
1245
|
-
if (isRunnableNodeScript(argvPath,
|
|
1246
|
+
if (isRunnableNodeScript(argvPath, existsSync11))
|
|
1246
1247
|
try {
|
|
1247
1248
|
let canonicalArgvPath = realpathSync5(argvPath);
|
|
1248
|
-
if (isRunnableNodeScript(canonicalArgvPath,
|
|
1249
|
+
if (isRunnableNodeScript(canonicalArgvPath, existsSync11) && findPiPackageRootFromEntry(canonicalArgvPath))
|
|
1249
1250
|
return canonicalArgvPath;
|
|
1250
1251
|
} catch {
|
|
1251
1252
|
}
|
|
@@ -1263,7 +1264,7 @@ function resolvePiCliScript(deps = {}) {
|
|
|
1263
1264
|
if (!binPath)
|
|
1264
1265
|
return;
|
|
1265
1266
|
let candidate = path2.resolve(path2.dirname(packageJsonPath), binPath);
|
|
1266
|
-
if (isRunnableNodeScript(candidate,
|
|
1267
|
+
if (isRunnableNodeScript(candidate, existsSync11))
|
|
1267
1268
|
return candidate;
|
|
1268
1269
|
} catch {
|
|
1269
1270
|
return;
|
|
@@ -2136,7 +2137,7 @@ ${fullOutput}` : timeoutMessage;
|
|
|
2136
2137
|
${fullOutput}` : note;
|
|
2137
2138
|
}
|
|
2138
2139
|
if ((result2.exitCode === 0 && !result2.error ? evaluateCompletionMutationGuard({
|
|
2139
|
-
|
|
2140
|
+
permissions: spec.effectivePermissions,
|
|
2140
2141
|
task: shared.originalTask ?? task,
|
|
2141
2142
|
messages: result2.messages,
|
|
2142
2143
|
tools: spec.effectivePermissions === "read-only" ? ["read", "grep", "find", "ls", "bash"] : void 0
|
|
@@ -3266,10 +3267,13 @@ function resolveChainToolBudget(input) {
|
|
|
3266
3267
|
return { toolBudget: resolved.budget, error: resolved.error };
|
|
3267
3268
|
}
|
|
3268
3269
|
async function runParallelChainTasks(input) {
|
|
3269
|
-
let concurrency = input.step.concurrency ?? MAX_CONCURRENCY, failFast = input.step.failFast ?? !1, aborted = !1, effectiveModels = input.step.parallel.map((task) => {
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3270
|
+
let concurrency = input.step.concurrency ?? MAX_CONCURRENCY, failFast = input.step.failFast ?? !1, aborted = !1, effectiveModels = input.step.parallel.map((task) => resolveExecutableChildModel({
|
|
3271
|
+
model: task.model,
|
|
3272
|
+
tier: task.tier,
|
|
3273
|
+
thinking: task.thinking,
|
|
3274
|
+
availableModels: input.availableModels,
|
|
3275
|
+
preferredProvider: input.ctx.model?.provider
|
|
3276
|
+
}));
|
|
3273
3277
|
for (let taskIndex = 0; taskIndex < input.step.parallel.length; taskIndex++) {
|
|
3274
3278
|
let task = input.step.parallel[taskIndex];
|
|
3275
3279
|
input.sessionFileForTask?.(task.agent, input.globalTaskIndex + taskIndex, effectiveModels[taskIndex]);
|
|
@@ -3299,9 +3303,10 @@ async function runParallelChainTasks(input) {
|
|
|
3299
3303
|
task: taskStr,
|
|
3300
3304
|
description: task.description,
|
|
3301
3305
|
permissions: task.permissions,
|
|
3302
|
-
model:
|
|
3306
|
+
model: task.model,
|
|
3303
3307
|
tier: task.tier,
|
|
3304
|
-
|
|
3308
|
+
thinking: task.thinking,
|
|
3309
|
+
modelSelection: captureModelSelection({ model: task.model, tier: task.tier }),
|
|
3305
3310
|
skill: task.skill,
|
|
3306
3311
|
cwd: taskCwd,
|
|
3307
3312
|
output: task.output,
|
|
@@ -3806,7 +3811,13 @@ ${failureSummary}`;
|
|
|
3806
3811
|
stepTask = stepTask.replace(/\{task\}/g, originalTask), stepTask = stepTask.replace(/\{previous\}/g, prev), stepTask = stepTask.replace(/\{chain_dir\}/g, chainDir);
|
|
3807
3812
|
let cleanTask = stepTask;
|
|
3808
3813
|
stepTask = prefix + stepTask + suffix;
|
|
3809
|
-
let effectiveModel =
|
|
3814
|
+
let effectiveModel = resolveExecutableChildModel({
|
|
3815
|
+
model: seqStep.model,
|
|
3816
|
+
tier: seqStep.tier,
|
|
3817
|
+
thinking: seqStep.thinking,
|
|
3818
|
+
availableModels,
|
|
3819
|
+
preferredProvider: ctx.model?.provider
|
|
3820
|
+
}), outputPath = typeof behavior.output == "string" ? path6.isAbsolute(behavior.output) ? behavior.output : path6.join(chainDir, behavior.output) : void 0;
|
|
3810
3821
|
stepTask = injectSingleOutputInstruction(stepTask, outputPath, agentConfig);
|
|
3811
3822
|
let validationError = validateFileOnlyOutputMode(behavior.outputMode, outputPath, `Chain step ${stepIndex + 1} (${seqStep.agent})`);
|
|
3812
3823
|
if (validationError)
|
|
@@ -3835,9 +3846,10 @@ ${failureSummary}`;
|
|
|
3835
3846
|
task: stepTask,
|
|
3836
3847
|
description: seqStep.description,
|
|
3837
3848
|
permissions: seqStep.permissions,
|
|
3838
|
-
model:
|
|
3849
|
+
model: seqStep.model,
|
|
3839
3850
|
tier: seqStep.tier,
|
|
3840
|
-
|
|
3851
|
+
thinking: seqStep.thinking,
|
|
3852
|
+
modelSelection: captureModelSelection({ model: seqStep.model, tier: seqStep.tier }),
|
|
3841
3853
|
skill: seqStep.skill,
|
|
3842
3854
|
cwd: seqStep.cwd,
|
|
3843
3855
|
output: seqStep.output,
|
|
@@ -3998,9 +4010,8 @@ function formatAsyncStartedMessage(headline) {
|
|
|
3998
4010
|
return [
|
|
3999
4011
|
headline,
|
|
4000
4012
|
"",
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
'Use subagent({ action: "status", id: "..." }) when you need a one-shot status/result or to inspect a blocked/stale run. To block until completion, prefer subagent_wait(). Do not poll in a loop just to wait.'
|
|
4013
|
+
SUBAGENT_ASYNC_GUIDANCE,
|
|
4014
|
+
'For one-time inspection or recovery of a blocked or stale run, use subagent({ action: "status", id: "..." }).'
|
|
4004
4015
|
].join(`
|
|
4005
4016
|
`);
|
|
4006
4017
|
}
|
|
@@ -4236,7 +4247,14 @@ ${injection}` : injection;
|
|
|
4236
4247
|
taskTemplate = taskTemplate.replace(/\{task\}/g, originalTask ?? ""), taskTemplate = taskTemplate.replace(/\{chain_dir\}/g, runnerCwd);
|
|
4237
4248
|
let taskText = `${readInstructions.prefix}${taskTemplate}${progressInstructions.suffix}`, task = namespaceOutputPath ? taskText : injectSingleOutputInstruction(taskText, outputPath, {
|
|
4238
4249
|
tools: spec.effectivePermissions === "read-only" ? ["read", "grep", "find", "ls", "bash"] : void 0
|
|
4239
|
-
}), primaryModel =
|
|
4250
|
+
}), primaryModel = resolveExecutableChildModel({
|
|
4251
|
+
modelSelection: spec.modelSelection,
|
|
4252
|
+
model: spec.model,
|
|
4253
|
+
tier: spec.tier,
|
|
4254
|
+
thinking: spec.thinking,
|
|
4255
|
+
availableModels,
|
|
4256
|
+
preferredProvider: ctx.currentModelProvider
|
|
4257
|
+
}), thinkingOverride = flatIndex === void 0 ? void 0 : thinkingOverridesByFlatIndex?.[flatIndex], effectiveThinking = thinkingOverride, model = applyThinkingSuffix(primaryModel, effectiveThinking, thinkingOverride !== void 0);
|
|
4240
4258
|
return {
|
|
4241
4259
|
parentSessionId: ctx.parentSessionId ?? ctx.currentSessionId,
|
|
4242
4260
|
parentPermissionMode: snapshotParentPermissionMode(ctx.parentSessionId ?? ctx.currentSessionId),
|
|
@@ -4528,6 +4546,16 @@ function executeAsyncChain(id, params) {
|
|
|
4528
4546
|
details: { mode: resultMode, runId: id, results: [], asyncId: id, asyncDir, workflowGraph, ...params.timeoutMs !== void 0 ? { timeoutMs: params.timeoutMs, deadlineAt } : {}, ...params.turnBudget ? { turnBudget: params.turnBudget } : {}, ...params.toolBudget ? { toolBudget: params.toolBudget } : {} }
|
|
4529
4547
|
};
|
|
4530
4548
|
}
|
|
4549
|
+
function resolveAsyncSingleAcceptance(input) {
|
|
4550
|
+
return input.restoredAcceptance ? input.restoredAcceptance : resolveEffectiveAcceptance({
|
|
4551
|
+
explicit: input.launchAcceptance,
|
|
4552
|
+
agentName: input.agentName,
|
|
4553
|
+
permissions: input.permissions,
|
|
4554
|
+
task: input.task,
|
|
4555
|
+
mode: "single",
|
|
4556
|
+
async: !0
|
|
4557
|
+
});
|
|
4558
|
+
}
|
|
4531
4559
|
function executeAsyncSingle(id, params) {
|
|
4532
4560
|
let { spec, ctx, cwd, maxOutput, artifactsDir, artifactConfig, shareEnabled, sessionRoot, sessionFile, maxSubagentDepth, worktreeSetupHook, worktreeSetupHookTimeoutMs, worktreeBaseDir, controlConfig, controlIntercomTarget, childIntercomTarget, nestedRoute } = params, agent = spec.description, task = spec.task, runnerCwd = resolveChildCwd(ctx.cwd, cwd), skillNames = params.skills ?? (spec.skill === !1 ? [] : normalizeSkillInput(spec.skill) ?? []), availableModels = params.availableModels, { resolved: resolvedSkills, missing: missingSkills } = resolveSkillsWithFallback(skillNames, runnerCwd, ctx.cwd, void 0, runnerCwd);
|
|
4533
4561
|
if (missingSkills.includes("pi-subagents"))
|
|
@@ -4555,19 +4583,25 @@ ${injection}` : injection;
|
|
|
4555
4583
|
let outputMode = params.outputMode ?? spec.outputMode ?? "inline", validationError = validateFileOnlyOutputMode(outputMode, outputPath, `Async single run (${agent})`);
|
|
4556
4584
|
if (validationError)
|
|
4557
4585
|
return formatAsyncStartError("single", validationError);
|
|
4558
|
-
let taskWithOutputInstruction = injectSingleOutputInstruction(task, outputPath, childToolShape), primaryModel =
|
|
4586
|
+
let taskWithOutputInstruction = injectSingleOutputInstruction(task, outputPath, childToolShape), primaryModel = resolveExecutableChildModel({
|
|
4587
|
+
modelSelection: spec.modelSelection,
|
|
4588
|
+
model: spec.model,
|
|
4589
|
+
tier: spec.tier,
|
|
4590
|
+
thinking: spec.thinking,
|
|
4591
|
+
availableModels,
|
|
4592
|
+
preferredProvider: ctx.currentModelProvider
|
|
4593
|
+
}), effectiveThinking = params.thinkingOverride, model = applyThinkingSuffix(primaryModel, effectiveThinking, params.thinkingOverride !== void 0), toolBudgetInput = params.toolBudget ?? spec.toolBudget ?? params.configToolBudget, resolvedToolBudget = validateToolBudgetConfig(toolBudgetInput, params.toolBudget || spec.toolBudget ? "toolBudget" : "config.toolBudget");
|
|
4559
4594
|
if (resolvedToolBudget.error)
|
|
4560
4595
|
return formatAsyncStartError("single", resolvedToolBudget.error);
|
|
4561
4596
|
let deadlineAt = params.absoluteDeadlineAt ?? (params.timeoutMs !== void 0 ? Date.now() + params.timeoutMs : void 0), timeoutMs = params.absoluteDeadlineAt !== void 0 && deadlineAt !== void 0 ? deadlineAt - Date.now() : params.timeoutMs;
|
|
4562
4597
|
if (timeoutMs !== void 0 && timeoutMs <= 0)
|
|
4563
4598
|
return formatAsyncStartError("single", "The source run's absolute deadline expired before recovery could launch.");
|
|
4564
|
-
let initialTurnBudget = params.turnBudget ? initialTurnBudgetState(params.turnBudget) : void 0, resolvedSessionDir = params.sessionDir ?? (sessionRoot ? path7.join(sessionRoot, `async-${id}`) : void 0), resolvedAcceptance =
|
|
4565
|
-
|
|
4599
|
+
let initialTurnBudget = params.turnBudget ? initialTurnBudgetState(params.turnBudget) : void 0, resolvedSessionDir = params.sessionDir ?? (sessionRoot ? path7.join(sessionRoot, `async-${id}`) : void 0), resolvedAcceptance = resolveAsyncSingleAcceptance({
|
|
4600
|
+
restoredAcceptance: params.restoredAcceptance,
|
|
4601
|
+
launchAcceptance: params.acceptance ?? spec.acceptance,
|
|
4566
4602
|
agentName: agent,
|
|
4567
4603
|
permissions: spec.effectivePermissions,
|
|
4568
|
-
task
|
|
4569
|
-
mode: "single",
|
|
4570
|
-
async: !0
|
|
4604
|
+
task
|
|
4571
4605
|
}), recoveryDescriptor = {
|
|
4572
4606
|
version: 4,
|
|
4573
4607
|
lifecycleArtifactVersion: SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
|
|
@@ -4579,8 +4613,8 @@ ${injection}` : injection;
|
|
|
4579
4613
|
...sessionFile ? { sessionFile } : {},
|
|
4580
4614
|
cwd: runnerCwd,
|
|
4581
4615
|
...model ? { model } : {},
|
|
4582
|
-
tier: spec.tier,
|
|
4583
|
-
...effectiveThinking ? { thinking: resolveEffectiveThinking(model, effectiveThinking) } : {},
|
|
4616
|
+
...spec.tier ? { tier: spec.tier } : {},
|
|
4617
|
+
...effectiveThinking || spec.thinking ? { thinking: resolveEffectiveThinking(model, effectiveThinking ?? spec.thinking) } : {},
|
|
4584
4618
|
...spec.modelSelection ? { modelSelection: spec.modelSelection } : {},
|
|
4585
4619
|
...resolvedSkills.length ? { skills: resolvedSkills.map((skill) => skill.name) } : {},
|
|
4586
4620
|
...outputPath ? { outputPath } : {},
|
|
@@ -4615,6 +4649,7 @@ ${injection}` : injection;
|
|
|
4615
4649
|
permissions: spec.effectivePermissions,
|
|
4616
4650
|
agent,
|
|
4617
4651
|
task: taskWithOutputInstruction,
|
|
4652
|
+
completionTask: params.completionTask ?? task,
|
|
4618
4653
|
cwd: runnerCwd,
|
|
4619
4654
|
model,
|
|
4620
4655
|
thinking: resolveEffectiveThinking(model, effectiveThinking),
|
|
@@ -4859,62 +4894,13 @@ function result(text, isError = !1) {
|
|
|
4859
4894
|
function messageFromError(error) {
|
|
4860
4895
|
return error instanceof Error ? error.message : String(error);
|
|
4861
4896
|
}
|
|
4862
|
-
function parseScope(raw) {
|
|
4863
|
-
if (raw === void 0 || raw === "session")
|
|
4864
|
-
return "session";
|
|
4865
|
-
if (raw === "user" || raw === "project")
|
|
4866
|
-
return raw;
|
|
4867
|
-
throw new Error("watchdog.configure scope must be 'session', 'user', or 'project'.");
|
|
4868
|
-
}
|
|
4869
|
-
function parseTarget(params) {
|
|
4870
|
-
let target = params.target ?? "main";
|
|
4871
|
-
if (target === "main")
|
|
4872
|
-
return { kind: "main" };
|
|
4873
|
-
if (target === "children")
|
|
4874
|
-
return { kind: "children" };
|
|
4875
|
-
if (target === "child") {
|
|
4876
|
-
if (!params.agent?.trim())
|
|
4877
|
-
throw new Error("watchdog.configure target='child' requires agent.");
|
|
4878
|
-
return { kind: "child", agent: params.agent.trim() };
|
|
4879
|
-
}
|
|
4880
|
-
throw new Error("watchdog.configure target must be 'main', 'children', or 'child'.");
|
|
4881
|
-
}
|
|
4882
|
-
function parseThinking(raw) {
|
|
4883
|
-
if (raw !== void 0)
|
|
4884
|
-
return raw === "inherit" ? null : parseWatchdogThinkingInput(raw, "watchdog.configure thinking") ?? void 0;
|
|
4885
|
-
}
|
|
4886
|
-
function resolveConfiguredValue(ctx, params) {
|
|
4887
|
-
let thinking = parseThinking(params.thinking), rawModel = params.model?.trim();
|
|
4888
|
-
if (!rawModel) {
|
|
4889
|
-
if (thinking === void 0)
|
|
4890
|
-
throw new Error("watchdog.configure requires model, thinking, or both.");
|
|
4891
|
-
return { thinking, description: `thinking ${thinking === null ? "inherit" : thinking === !1 ? "off" : thinking}` };
|
|
4892
|
-
}
|
|
4893
|
-
if (rawModel === "inherit")
|
|
4894
|
-
return { model: null, thinking: thinking ?? null, description: "inherit" };
|
|
4895
|
-
if (rawModel === "recommended") {
|
|
4896
|
-
let recommendation = recommendStrongWatchdogModel(ctx);
|
|
4897
|
-
return {
|
|
4898
|
-
model: recommendation.model,
|
|
4899
|
-
thinking: recommendation.thinking,
|
|
4900
|
-
description: `${recommendation.model}:${recommendation.thinking}`
|
|
4901
|
-
};
|
|
4902
|
-
}
|
|
4903
|
-
let resolved = resolveWatchdogModelInput(ctx, rawModel);
|
|
4904
|
-
return {
|
|
4905
|
-
model: resolved.model,
|
|
4906
|
-
thinking: resolved.thinking ?? thinking,
|
|
4907
|
-
description: `${resolved.model}${resolved.thinking ?? thinking ? `:${resolved.thinking ?? thinking}` : ""}`
|
|
4908
|
-
};
|
|
4909
|
-
}
|
|
4910
4897
|
function buildRecommendationText(ctx) {
|
|
4911
4898
|
let recommendation = recommendStrongWatchdogModel(ctx);
|
|
4912
4899
|
return [
|
|
4913
4900
|
"Subagent watchdog recommended model",
|
|
4914
4901
|
`Recommended: ${recommendation.model}:${recommendation.thinking}`,
|
|
4915
4902
|
`Reason: ${recommendation.reason}`,
|
|
4916
|
-
|
|
4917
|
-
'Persist with scope: "project" or scope: "user" only when the user asks for that scope.'
|
|
4903
|
+
"Watchdog settings are user-managed through /subagents-watchdog."
|
|
4918
4904
|
].join(`
|
|
4919
4905
|
`);
|
|
4920
4906
|
}
|
|
@@ -4941,44 +4927,14 @@ function buildCheckText(runtime, ctx) {
|
|
|
4941
4927
|
return lines.join(`
|
|
4942
4928
|
`);
|
|
4943
4929
|
}
|
|
4944
|
-
function handleWatchdogToolAction(action,
|
|
4930
|
+
function handleWatchdogToolAction(action, _params, ctx, runtime) {
|
|
4945
4931
|
try {
|
|
4946
|
-
|
|
4947
|
-
return runtime ? result(buildWatchdogStatus(runtime.getSnapshot(ctx.cwd), ctx)) : result("Subagent watchdog runtime is unavailable.", !0);
|
|
4948
|
-
if (action === "watchdog.recommend-model")
|
|
4949
|
-
return result(buildRecommendationText(ctx));
|
|
4950
|
-
if (action === "watchdog.check")
|
|
4951
|
-
return result(buildCheckText(runtime, ctx));
|
|
4952
|
-
if (action !== "watchdog.configure")
|
|
4953
|
-
return result(`Unknown watchdog action: ${action}`, !0);
|
|
4954
|
-
let scope = parseScope(params.scope), target = parseTarget(params), value = resolveConfiguredValue(ctx, params);
|
|
4955
|
-
if (scope === "session")
|
|
4956
|
-
return runtime ? target.kind !== "main" ? result("Session-scoped watchdog.configure currently supports target='main' only.", !0) : (runtime.setSessionModel({ model: value.model, thinking: value.thinking }, ctx.cwd), result([
|
|
4957
|
-
`Subagent watchdog session model configured: ${value.description}.`,
|
|
4958
|
-
"No settings files were changed.",
|
|
4959
|
-
"",
|
|
4960
|
-
buildWatchdogStatus(runtime.getSnapshot(ctx.cwd), ctx)
|
|
4961
|
-
].join(`
|
|
4962
|
-
`))) : result("Subagent watchdog runtime is unavailable.", !0);
|
|
4963
|
-
let settingsPath = writeWatchdogModelSettings({
|
|
4964
|
-
scope,
|
|
4965
|
-
cwd: ctx.cwd,
|
|
4966
|
-
target,
|
|
4967
|
-
model: value.model,
|
|
4968
|
-
thinking: value.thinking
|
|
4969
|
-
});
|
|
4970
|
-
runtime?.refreshConfig(ctx.cwd);
|
|
4971
|
-
let targetLabel = target.kind === "child" ? `child ${target.agent}` : target.kind;
|
|
4972
|
-
return result([
|
|
4973
|
-
`Subagent watchdog ${targetLabel} model configured: ${value.description}.`,
|
|
4974
|
-
`Updated: ${settingsPath}`
|
|
4975
|
-
].join(`
|
|
4976
|
-
`));
|
|
4932
|
+
return action === "watchdog.status" ? runtime ? result(buildWatchdogStatus(runtime.getSnapshot(ctx.cwd), ctx)) : result("Subagent watchdog runtime is unavailable.", !0) : action === "watchdog.recommend-model" ? result(buildRecommendationText(ctx)) : action === "watchdog.check" ? result(buildCheckText(runtime, ctx)) : result(`Unknown watchdog action: ${action}`, !0);
|
|
4977
4933
|
} catch (error) {
|
|
4978
4934
|
return result(`Subagent watchdog action failed: ${messageFromError(error)}`, !0);
|
|
4979
4935
|
}
|
|
4980
4936
|
}
|
|
4981
|
-
var WATCHDOG_TOOL_ACTIONS = ["watchdog.status", "watchdog.check", "watchdog.
|
|
4937
|
+
var WATCHDOG_TOOL_ACTIONS = ["watchdog.status", "watchdog.check", "watchdog.recommend-model"];
|
|
4982
4938
|
|
|
4983
4939
|
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.js
|
|
4984
4940
|
import { randomUUID } from "node:crypto";
|
|
@@ -5460,81 +5416,11 @@ function resolveAsyncRootResultPath(resultsDir, runId) {
|
|
|
5460
5416
|
return path13.join(resultsDir, `${runId}.json`);
|
|
5461
5417
|
}
|
|
5462
5418
|
|
|
5463
|
-
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/background/run-
|
|
5419
|
+
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js
|
|
5464
5420
|
import * as fs14 from "node:fs";
|
|
5465
5421
|
import * as path14 from "node:path";
|
|
5466
|
-
function exactAsyncLocation(id, asyncDirRoot, resultsDir) {
|
|
5467
|
-
let asyncDir = path14.join(asyncDirRoot, id), resultPath = path14.join(resultsDir, `${id}.json`);
|
|
5468
|
-
if (!(!fs14.existsSync(asyncDir) && !fs14.existsSync(resultPath)))
|
|
5469
|
-
return {
|
|
5470
|
-
asyncDir: fs14.existsSync(asyncDir) ? asyncDir : null,
|
|
5471
|
-
resultPath: fs14.existsSync(resultPath) ? resultPath : null,
|
|
5472
|
-
resolvedId: id
|
|
5473
|
-
};
|
|
5474
|
-
}
|
|
5475
|
-
function foregroundIds(state) {
|
|
5476
|
-
if (!state)
|
|
5477
|
-
return [];
|
|
5478
|
-
let remembered = state.currentSessionId ? [...state.foregroundRuns?.values() ?? []].filter((run) => run.sessionId === state.currentSessionId).map((run) => run.runId) : [];
|
|
5479
|
-
return [.../* @__PURE__ */ new Set([...state.foregroundControls.keys(), ...remembered])];
|
|
5480
|
-
}
|
|
5481
|
-
function hasExactForegroundId(state, id) {
|
|
5482
|
-
if (!state)
|
|
5483
|
-
return !1;
|
|
5484
|
-
if (state.foregroundControls.has(id))
|
|
5485
|
-
return !0;
|
|
5486
|
-
let remembered = state.foregroundRuns?.get(id);
|
|
5487
|
-
return !!(remembered && state.currentSessionId && remembered.sessionId === state.currentSessionId);
|
|
5488
|
-
}
|
|
5489
|
-
function nestedScopeFromState(state) {
|
|
5490
|
-
if (!state)
|
|
5491
|
-
return;
|
|
5492
|
-
let routes = [], seen = /* @__PURE__ */ new Set(), add = (route) => {
|
|
5493
|
-
if (!route)
|
|
5494
|
-
return;
|
|
5495
|
-
let key = `${route.rootRunId}:${route.eventSink}:${route.controlInbox}`;
|
|
5496
|
-
seen.has(key) || (seen.add(key), routes.push(route));
|
|
5497
|
-
};
|
|
5498
|
-
for (let control of state.foregroundControls.values())
|
|
5499
|
-
add(control.nestedRoute);
|
|
5500
|
-
for (let job of state.asyncJobs.values())
|
|
5501
|
-
add(job.nestedRoute);
|
|
5502
|
-
return { routes };
|
|
5503
|
-
}
|
|
5504
|
-
function asyncPrefixMatches(prefix, asyncDirRoot, resultsDir) {
|
|
5505
|
-
return findAsyncRunPrefixMatches(prefix, asyncDirRoot, resultsDir);
|
|
5506
|
-
}
|
|
5507
|
-
function resolveSubagentRunId(id, deps = {}) {
|
|
5508
|
-
assertSafeNestedId("id", id);
|
|
5509
|
-
let asyncDirRoot = deps.asyncDirRoot ?? ASYNC_DIR, resultsDir = deps.resultsDir ?? RESULTS_DIR, nestedScope = deps.nested ?? nestedScopeFromState(deps.state);
|
|
5510
|
-
if (hasExactForegroundId(deps.state, id))
|
|
5511
|
-
return { kind: "foreground", id };
|
|
5512
|
-
let exactAsync = exactAsyncLocation(id, asyncDirRoot, resultsDir);
|
|
5513
|
-
if (exactAsync)
|
|
5514
|
-
return { kind: "async", id, location: exactAsync };
|
|
5515
|
-
let exactNested = findNestedRunMatchesById(id, nestedScope ? { scope: nestedScope } : {});
|
|
5516
|
-
if (exactNested.length > 1)
|
|
5517
|
-
throw new Error(`Nested run id '${id}' is ambiguous across authorized registries. Provide the full id after stale registries are cleaned up.`);
|
|
5518
|
-
if (exactNested[0])
|
|
5519
|
-
return { kind: "nested", id, match: exactNested[0] };
|
|
5520
|
-
let matches = [];
|
|
5521
|
-
for (let foregroundId of foregroundIds(deps.state).filter((candidate) => candidate.startsWith(id)))
|
|
5522
|
-
matches.push({ kind: "foreground", id: foregroundId });
|
|
5523
|
-
for (let match of asyncPrefixMatches(id, asyncDirRoot, resultsDir))
|
|
5524
|
-
matches.push({ kind: "async", id: match.id, location: match.location });
|
|
5525
|
-
for (let match of findNestedRunMatchesById(id, nestedScope ? { prefix: !0, scope: nestedScope } : { prefix: !0 }))
|
|
5526
|
-
matches.push({ kind: "nested", id: match.run.id, match });
|
|
5527
|
-
let values = [...new Map(matches.map((match) => [`${match.kind}:${match.id}`, match])).values()];
|
|
5528
|
-
if (values.length > 1)
|
|
5529
|
-
throw new Error(`Ambiguous subagent run id prefix '${id}' matched: ${values.map((match) => `${match.kind}:${match.id}`).join(", ")}. Provide a longer id.`);
|
|
5530
|
-
return values[0];
|
|
5531
|
-
}
|
|
5532
|
-
|
|
5533
|
-
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js
|
|
5534
|
-
import * as fs15 from "node:fs";
|
|
5535
|
-
import * as path15 from "node:path";
|
|
5536
5422
|
function hasExistingSessionFile(value) {
|
|
5537
|
-
return typeof value == "string" &&
|
|
5423
|
+
return typeof value == "string" && fs14.existsSync(value);
|
|
5538
5424
|
}
|
|
5539
5425
|
function formatResumeGuidance(runId, children, fallbackSessionFile, options = {}) {
|
|
5540
5426
|
if (options.stopped)
|
|
@@ -5570,9 +5456,9 @@ function formatSteeringSummary(input) {
|
|
|
5570
5456
|
}
|
|
5571
5457
|
function rememberedForegroundChildOutput(child) {
|
|
5572
5458
|
let outputPath = child.artifactPaths?.outputPath ?? child.savedOutputPath;
|
|
5573
|
-
if (outputPath &&
|
|
5459
|
+
if (outputPath && fs14.existsSync(outputPath))
|
|
5574
5460
|
try {
|
|
5575
|
-
let artifactOutput =
|
|
5461
|
+
let artifactOutput = fs14.readFileSync(outputPath, "utf-8").trim();
|
|
5576
5462
|
if (artifactOutput)
|
|
5577
5463
|
return artifactOutput;
|
|
5578
5464
|
} catch {
|
|
@@ -5745,7 +5631,7 @@ function inspectSubagentStatus(params, deps = {}) {
|
|
|
5745
5631
|
details: { mode: "single", results: [] }
|
|
5746
5632
|
};
|
|
5747
5633
|
}
|
|
5748
|
-
let status = reconciliation.status, effectiveRunId = status?.runId ?? resolvedId ?? "unknown", logPath =
|
|
5634
|
+
let status = reconciliation.status, effectiveRunId = status?.runId ?? resolvedId ?? "unknown", logPath = path14.join(asyncDir, `subagent-log-${effectiveRunId}.md`), eventsPath = path14.join(asyncDir, "events.jsonl");
|
|
5749
5635
|
if (status) {
|
|
5750
5636
|
if (params.view === "transcript") {
|
|
5751
5637
|
if (currentSessionId && status.sessionId !== currentSessionId)
|
|
@@ -5789,22 +5675,22 @@ function inspectSubagentStatus(params, deps = {}) {
|
|
|
5789
5675
|
`Dir: ${asyncDir}`,
|
|
5790
5676
|
outputPath ? `Output: ${outputPath}` : void 0,
|
|
5791
5677
|
reconciliation.message ? `Diagnosis: ${reconciliation.message}` : void 0,
|
|
5792
|
-
reconciliation.resultPath &&
|
|
5678
|
+
reconciliation.resultPath && fs14.existsSync(reconciliation.resultPath) ? `Result: ${reconciliation.resultPath}` : void 0
|
|
5793
5679
|
].filter((line) => !!line);
|
|
5794
5680
|
for (let [index, step] of (status.steps ?? []).entries()) {
|
|
5795
5681
|
let stepActivityText = step.status === "running" ? formatActivityLabel(step.lastActivityAt, step.activityState) : void 0, modelThinking = formatModelSelection(step.modelSelection, step.model, step.thinking), modelText = modelThinking ? ` (${modelThinking})` : "", steeringText2 = formatSteeringSummary(step), steeringSuffix = steeringText2 ? `, steering: ${steeringText2}` : "", errorText2 = step.error ? `, error: ${step.error}` : "", acceptanceText = step.acceptance?.status ? `, acceptance: ${step.acceptance.status}` : "", budgetText = step.turnBudget ? `, turn budget: ${step.turnBudget.turnCount}/${step.turnBudget.maxTurns}+${step.turnBudget.graceTurns} (${step.turnBudget.outcome})` : "", display = step.label ? `${step.label} (${step.agent})` : step.agent, phase = step.phase ? `[${step.phase}] ` : "";
|
|
5796
5682
|
lines.push(`${stepLineLabel(status, index)}: ${phase}${display} ${step.status}${modelText}${stepActivityText ? `, ${stepActivityText}` : ""}${steeringSuffix}${acceptanceText}${budgetText}${errorText2}`), lines.push(...formatNestedRunStatusLines(step.children, { indent: " ", commandHints: !0, maxLines: 20 }));
|
|
5797
|
-
let stepOutputPath =
|
|
5798
|
-
stepOutputPath !== outputPath &&
|
|
5683
|
+
let stepOutputPath = path14.join(asyncDir, `output-${index}.log`);
|
|
5684
|
+
stepOutputPath !== outputPath && fs14.existsSync(stepOutputPath) && lines.push(` Output: ${stepOutputPath}`), step.status === "running" && (lines.push(` Intercom target: ${resolveSubagentIntercomTarget(status.runId, step.childId ?? step.agent, index)} (if registered)`), lines.push(` Steer: subagent({ action: "steer", id: "${status.runId}", index: ${index}, message: "..." })`));
|
|
5799
5685
|
}
|
|
5800
5686
|
let attached = new Set((status.steps ?? []).flatMap((step) => step.children?.map((child) => child.id) ?? [])), unattached = nestedChildren.filter((child) => !attached.has(child.id));
|
|
5801
|
-
return lines.push(...formatNestedRunStatusLines(unattached, { indent: "", commandHints: !0, maxLines: 20 })), nestedWarning && lines.push(`Warning: ${nestedWarning}`), status.sessionFile && lines.push(`Session: ${status.sessionFile}`), status.state === "running" && lines.push(`Steer running child: subagent({ action: "steer", id: "${status.runId}", message: "..." })`), status.state !== "running" && lines.push(formatResumeGuidance(status.runId, status.steps ?? [], status.sessionFile, { stopped: status.state === "stopped" || status.stopped === !0 })),
|
|
5687
|
+
return lines.push(...formatNestedRunStatusLines(unattached, { indent: "", commandHints: !0, maxLines: 20 })), nestedWarning && lines.push(`Warning: ${nestedWarning}`), status.sessionFile && lines.push(`Session: ${status.sessionFile}`), status.state === "running" && lines.push(`Steer running child: subagent({ action: "steer", id: "${status.runId}", message: "..." })`), status.state !== "running" && lines.push(formatResumeGuidance(status.runId, status.steps ?? [], status.sessionFile, { stopped: status.state === "stopped" || status.stopped === !0 })), fs14.existsSync(logPath) && lines.push(`Log: ${logPath}`), fs14.existsSync(eventsPath) && lines.push(`Events: ${eventsPath}`), { content: [{ type: "text", text: lines.join(`
|
|
5802
5688
|
`) }], details: { mode: "single", results: [] } };
|
|
5803
5689
|
}
|
|
5804
5690
|
}
|
|
5805
5691
|
if (resultPath)
|
|
5806
5692
|
try {
|
|
5807
|
-
let raw =
|
|
5693
|
+
let raw = fs14.readFileSync(resultPath, "utf-8"), data = JSON.parse(raw);
|
|
5808
5694
|
if (params.view === "transcript")
|
|
5809
5695
|
try {
|
|
5810
5696
|
return { content: [{ type: "text", text: formatAsyncResultTranscript(data, resultPath, { index: params.index, lines: params.lines }) }], details: { mode: "single", results: [] } };
|
|
@@ -5828,15 +5714,10 @@ function inspectSubagentStatus(params, deps = {}) {
|
|
|
5828
5714
|
};
|
|
5829
5715
|
}
|
|
5830
5716
|
|
|
5831
|
-
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js
|
|
5832
|
-
function applyForceTopLevelAsyncOverride(params, depth, forceTopLevelAsync) {
|
|
5833
|
-
return params.foregroundOnly || !(depth === 0 && forceTopLevelAsync) ? params : { ...params, async: !0, clarify: !1 };
|
|
5834
|
-
}
|
|
5835
|
-
|
|
5836
5717
|
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js
|
|
5837
|
-
var MUTATING_MANAGEMENT_ACTIONS = /* @__PURE__ */ new Set(["create", "update", "delete", "eject", "disable", "enable", "reset"
|
|
5718
|
+
var MUTATING_MANAGEMENT_ACTIONS = /* @__PURE__ */ new Set(["create", "update", "delete", "eject", "disable", "enable", "reset"]);
|
|
5838
5719
|
function resolveRequestedCwd(runtimeCwd, requestedCwd) {
|
|
5839
|
-
return requestedCwd ?
|
|
5720
|
+
return requestedCwd ? path15.resolve(runtimeCwd, requestedCwd) : runtimeCwd;
|
|
5840
5721
|
}
|
|
5841
5722
|
function getForegroundControl(state, runId) {
|
|
5842
5723
|
if (runId)
|
|
@@ -5868,7 +5749,7 @@ function nestedResolutionScopeForExecutor(deps) {
|
|
|
5868
5749
|
};
|
|
5869
5750
|
}
|
|
5870
5751
|
function trustedSessionRootsForStatus(ctx, deps) {
|
|
5871
|
-
let roots = deps.config.defaultSessionDir ? [
|
|
5752
|
+
let roots = deps.config.defaultSessionDir ? [path15.resolve(deps.expandTilde(deps.config.defaultSessionDir))] : [], parentSessionFile = ctx.sessionManager.getSessionFile() ?? null;
|
|
5872
5753
|
return parentSessionFile && roots.push(deps.getSubagentSessionRoot(parentSessionFile)), [...new Set(roots)];
|
|
5873
5754
|
}
|
|
5874
5755
|
function reserveSubagentSpawns(input) {
|
|
@@ -6015,10 +5896,10 @@ function resolveForegroundResumeTarget(params, state) {
|
|
|
6015
5896
|
let child = run.children[index];
|
|
6016
5897
|
if (!child.sessionFile)
|
|
6017
5898
|
throw new Error(`Foreground run '${run.runId}' child ${index} does not have a persisted session file to resume from.`);
|
|
6018
|
-
if (
|
|
5899
|
+
if (path15.extname(child.sessionFile) !== ".jsonl")
|
|
6019
5900
|
throw new Error(`Foreground run '${run.runId}' child ${index} session file must be a .jsonl file: ${child.sessionFile}`);
|
|
6020
|
-
let sessionFile =
|
|
6021
|
-
if (!
|
|
5901
|
+
let sessionFile = path15.resolve(child.sessionFile);
|
|
5902
|
+
if (!fs15.existsSync(sessionFile))
|
|
6022
5903
|
throw new Error(`Foreground run '${run.runId}' child ${index} session file does not exist: ${child.sessionFile}`);
|
|
6023
5904
|
return { runId: run.runId, mode: run.mode, state: "complete", agent: child.agent, index, intercomTarget: resolveSubagentIntercomTarget(run.runId, child.agent, index), cwd: run.cwd, sessionFile };
|
|
6024
5905
|
}
|
|
@@ -6073,7 +5954,7 @@ function resolveResumeTarget(params, state, options = {}) {
|
|
|
6073
5954
|
function getAsyncInterruptTarget(state, runId, location, options = {}) {
|
|
6074
5955
|
if (location?.asyncDir)
|
|
6075
5956
|
return {
|
|
6076
|
-
asyncId: location.resolvedId ?? runId ??
|
|
5957
|
+
asyncId: location.resolvedId ?? runId ?? path15.basename(location.asyncDir),
|
|
6077
5958
|
asyncDir: location.asyncDir
|
|
6078
5959
|
};
|
|
6079
5960
|
if (runId) {
|
|
@@ -6338,27 +6219,27 @@ function nestedRunAgent(run) {
|
|
|
6338
6219
|
return run.agent ?? run.agents?.[0] ?? (run.steps?.length === 1 ? run.steps[0]?.agent : void 0);
|
|
6339
6220
|
}
|
|
6340
6221
|
function pathWithin(base, candidate) {
|
|
6341
|
-
let resolvedBase =
|
|
6342
|
-
return resolvedCandidate === resolvedBase || resolvedCandidate.startsWith(`${resolvedBase}${
|
|
6222
|
+
let resolvedBase = path15.resolve(base), resolvedCandidate = path15.resolve(candidate);
|
|
6223
|
+
return resolvedCandidate === resolvedBase || resolvedCandidate.startsWith(`${resolvedBase}${path15.sep}`);
|
|
6343
6224
|
}
|
|
6344
6225
|
function validateNestedSessionFile(run, trustedSessionRoots) {
|
|
6345
6226
|
let sessionFile = nestedRunSessionFile(run);
|
|
6346
6227
|
if (!sessionFile)
|
|
6347
6228
|
throw new Error(`Nested run '${run.id}' does not have a persisted session file to resume from.`);
|
|
6348
|
-
if (
|
|
6229
|
+
if (path15.extname(sessionFile) !== ".jsonl")
|
|
6349
6230
|
throw new Error(`Nested run '${run.id}' session file must be a .jsonl file: ${sessionFile}`);
|
|
6350
|
-
let resolved =
|
|
6351
|
-
if (!
|
|
6231
|
+
let resolved = path15.resolve(sessionFile);
|
|
6232
|
+
if (!path15.isAbsolute(sessionFile))
|
|
6352
6233
|
throw new Error(`Nested run '${run.id}' session file must be absolute: ${sessionFile}`);
|
|
6353
|
-
if (!
|
|
6234
|
+
if (!fs15.existsSync(resolved))
|
|
6354
6235
|
throw new Error(`Nested run '${run.id}' session file does not exist: ${sessionFile}`);
|
|
6355
|
-
let stat =
|
|
6236
|
+
let stat = fs15.lstatSync(resolved);
|
|
6356
6237
|
if (!stat.isFile() || stat.isSymbolicLink())
|
|
6357
6238
|
throw new Error(`Nested run '${run.id}' session file is not a regular file: ${sessionFile}`);
|
|
6358
|
-
let realSessionFile =
|
|
6359
|
-
if (!trustedSessionRoots.filter((root) =>
|
|
6239
|
+
let realSessionFile = fs15.realpathSync(resolved);
|
|
6240
|
+
if (!trustedSessionRoots.filter((root) => fs15.existsSync(root)).map((root) => fs15.realpathSync(root)).some((root) => pathWithin(root, realSessionFile)))
|
|
6360
6241
|
throw new Error(`Nested run '${run.id}' session file is outside trusted nested session roots: ${sessionFile}`);
|
|
6361
|
-
if (!realSessionFile.split(
|
|
6242
|
+
if (!realSessionFile.split(path15.sep).includes(run.id))
|
|
6362
6243
|
throw new Error(`Nested run '${run.id}' session file is not under that nested run's session directory: ${sessionFile}`);
|
|
6363
6244
|
return realSessionFile;
|
|
6364
6245
|
}
|
|
@@ -6378,7 +6259,7 @@ function resolveNestedResumeTarget(match, trustedSessionRoots) {
|
|
|
6378
6259
|
agent,
|
|
6379
6260
|
index: 0,
|
|
6380
6261
|
intercomTarget: resolveSubagentIntercomTarget(run.id, agent, 0),
|
|
6381
|
-
cwd: asyncDir ?
|
|
6262
|
+
cwd: asyncDir ? path15.dirname(asyncDir) : void 0,
|
|
6382
6263
|
sessionFile: validateNestedSessionFile(run, trustedSessionRoots)
|
|
6383
6264
|
};
|
|
6384
6265
|
}
|
|
@@ -6405,7 +6286,7 @@ function directNestedAsyncInterrupt(target) {
|
|
|
6405
6286
|
let run = target.match.run, asyncDir = resolveNestedAsyncDir(target.match.rootRunId, run);
|
|
6406
6287
|
if (!asyncDir)
|
|
6407
6288
|
return;
|
|
6408
|
-
let status = reconcileAsyncRun(asyncDir, { resultsDir:
|
|
6289
|
+
let status = reconcileAsyncRun(asyncDir, { resultsDir: path15.join(RESULTS_DIR, "nested", target.match.rootRunId) }).status, pid = typeof status?.pid == "number" && status.pid > 0 ? status.pid : run.pid;
|
|
6409
6290
|
if (!(!status || status.state !== "running" || typeof pid != "number" || pid <= 0))
|
|
6410
6291
|
try {
|
|
6411
6292
|
return deliverInterruptRequest({ asyncDir, pid, source: "nested-interrupt" }), { content: [{ type: "text", text: `Interrupt requested for nested async run ${run.id}.` }], details: { mode: "management", results: [] } };
|
|
@@ -6418,7 +6299,7 @@ async function directNestedAsyncSteer(input) {
|
|
|
6418
6299
|
let run = input.target.match.run, asyncDir = resolveNestedAsyncDir(input.target.match.rootRunId, run);
|
|
6419
6300
|
if (!asyncDir)
|
|
6420
6301
|
return;
|
|
6421
|
-
let status = reconcileAsyncRun(asyncDir, { resultsDir:
|
|
6302
|
+
let status = reconcileAsyncRun(asyncDir, { resultsDir: path15.join(RESULTS_DIR, "nested", input.target.match.rootRunId) }).status;
|
|
6422
6303
|
if (!status || status.state !== "running" && status.state !== "queued")
|
|
6423
6304
|
return;
|
|
6424
6305
|
let steps = status.steps ?? [];
|
|
@@ -6512,7 +6393,7 @@ async function resumeAsyncRun(input) {
|
|
|
6512
6393
|
if (resolved.match.run.state === "running" || resolved.match.run.state === "queued")
|
|
6513
6394
|
return resumeLiveNestedRun({ target: resolved, message: followUp });
|
|
6514
6395
|
let trustedSessionRoots = [
|
|
6515
|
-
...input.deps.config.defaultSessionDir ? [
|
|
6396
|
+
...input.deps.config.defaultSessionDir ? [path15.resolve(input.deps.expandTilde(input.deps.config.defaultSessionDir))] : [],
|
|
6516
6397
|
...parentSessionFile ? [input.deps.getSubagentSessionRoot(parentSessionFile)] : []
|
|
6517
6398
|
];
|
|
6518
6399
|
target = resolveNestedResumeTarget(resolved, trustedSessionRoots);
|
|
@@ -6577,7 +6458,7 @@ ${followUp}`, 500, { source: "async-resume", runId: target.runId, agent: target.
|
|
|
6577
6458
|
goal,
|
|
6578
6459
|
attachRoot: {
|
|
6579
6460
|
runId: target.runId,
|
|
6580
|
-
asyncDir: target.asyncDir ??
|
|
6461
|
+
asyncDir: target.asyncDir ?? path15.join(ASYNC_DIR, target.runId),
|
|
6581
6462
|
resultPath: resolveAsyncRootResultPath(RESULTS_DIR, target.runId),
|
|
6582
6463
|
index: target.index,
|
|
6583
6464
|
agent: target.agent,
|
|
@@ -6623,32 +6504,43 @@ ${followUp}`, 500, { source: "async-resume", runId: target.runId, agent: target.
|
|
|
6623
6504
|
return { content: [{ type: "text", text: formatAsyncStartedMessage(lines2.join(`
|
|
6624
6505
|
`)) }], details: result3.details };
|
|
6625
6506
|
}
|
|
6626
|
-
let runId = randomUUID4().slice(0, 8), artifactConfig = recoveryDescriptor?.artifactConfig ?? { ...DEFAULT_ARTIFACT_CONFIG, enabled: input.params.artifacts !== !1 }, artifactsDir = recoveryDescriptor?.artifactsDir ?? getArtifactsDir(parentSessionFile, effectiveCwd), availableModels = input.ctx.modelRegistry.getAvailable().map(toModelInfo),
|
|
6507
|
+
let runId = randomUUID4().slice(0, 8), artifactConfig = recoveryDescriptor?.artifactConfig ?? { ...DEFAULT_ARTIFACT_CONFIG, enabled: input.params.artifacts !== !1 }, artifactsDir = recoveryDescriptor?.artifactsDir ?? getArtifactsDir(parentSessionFile, effectiveCwd), availableModels = input.ctx.modelRegistry.getAvailable().map(toModelInfo), restoredAcceptance;
|
|
6508
|
+
if (recoveryDescriptor?.acceptance !== void 0 && input.params.acceptance === void 0)
|
|
6509
|
+
try {
|
|
6510
|
+
restoredAcceptance = restorePersistedAcceptance(recoveryDescriptor.acceptance, "recoveryDescriptor.acceptance");
|
|
6511
|
+
} catch (error) {
|
|
6512
|
+
return { content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }], isError: !0, details: { mode: "management", results: [] } };
|
|
6513
|
+
}
|
|
6514
|
+
let recoverySpec;
|
|
6627
6515
|
try {
|
|
6516
|
+
let recoverySelection = recoveryDescriptor?.modelSelection ?? target.modelSelection, recoveryIsExplicitModel = recoverySelection?.kind === "model";
|
|
6628
6517
|
recoverySpec = normalizeChildSpec({
|
|
6629
6518
|
task: buildRevivedAsyncTask(target, followUp),
|
|
6630
6519
|
description: recoveryDescriptor?.description ?? target.description ?? target.agent,
|
|
6631
6520
|
permissions: recoveryDescriptor?.permissions ?? target.permissions ?? "read-only",
|
|
6632
|
-
model: recoveryDescriptor?.model ?? target.model,
|
|
6633
|
-
tier: input.params.tier ??
|
|
6634
|
-
|
|
6521
|
+
model: recoveryIsExplicitModel ? recoverySelection.model ?? recoveryDescriptor?.model ?? target.model : void 0,
|
|
6522
|
+
tier: recoveryIsExplicitModel ? void 0 : input.params.tier ?? recoverySelection?.tier ?? recoveryDescriptor?.tier,
|
|
6523
|
+
thinking: recoveryIsExplicitModel ? recoveryDescriptor?.thinking ?? target.thinking : void 0,
|
|
6524
|
+
modelSelection: recoverySelection,
|
|
6635
6525
|
skill: recoveryDescriptor?.skills,
|
|
6636
6526
|
cwd: effectiveCwd,
|
|
6637
6527
|
output: recoveryDescriptor?.outputPath,
|
|
6638
6528
|
outputMode: recoveryDescriptor?.outputMode,
|
|
6639
|
-
acceptance: input.params.acceptance
|
|
6529
|
+
acceptance: input.params.acceptance,
|
|
6640
6530
|
toolBudget: recoveryDescriptor?.initialToolBudget
|
|
6641
6531
|
}, {
|
|
6642
6532
|
parentMode: snapshotParentPermissionMode(input.deps.state.currentSessionId),
|
|
6643
6533
|
runId,
|
|
6644
6534
|
index: 0,
|
|
6645
|
-
childId: recoveryDescriptor?.childId ?? target.childId ?? `${runId}-0
|
|
6535
|
+
childId: recoveryDescriptor?.childId ?? target.childId ?? `${runId}-0`,
|
|
6536
|
+
resolvedModelIsRuntime: !recoveryIsExplicitModel && !!(recoveryDescriptor?.model ?? target.model)
|
|
6646
6537
|
});
|
|
6647
6538
|
} catch (error) {
|
|
6648
6539
|
return { content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }], isError: !0, details: { mode: "management", results: [] } };
|
|
6649
6540
|
}
|
|
6650
6541
|
let result2 = executeAsyncSingle(runId, {
|
|
6651
6542
|
spec: recoverySpec,
|
|
6543
|
+
completionTask: followUp,
|
|
6652
6544
|
goal: followUp,
|
|
6653
6545
|
ctx: {
|
|
6654
6546
|
pi: input.deps.pi,
|
|
@@ -6688,7 +6580,7 @@ ${followUp}`, 500, { source: "async-resume", runId: target.runId, agent: target.
|
|
|
6688
6580
|
output: recoveryDescriptor?.outputPath,
|
|
6689
6581
|
outputMode: recoveryDescriptor?.outputMode,
|
|
6690
6582
|
...recoveryDescriptor?.skills ? { skills: [...recoveryDescriptor.skills] } : {},
|
|
6691
|
-
...
|
|
6583
|
+
...restoredAcceptance ? { restoredAcceptance } : {},
|
|
6692
6584
|
...input.params.timeoutMs !== void 0 ? { timeoutMs: input.params.timeoutMs } : {},
|
|
6693
6585
|
...input.absoluteDeadlineAt !== void 0 ? { absoluteDeadlineAt: input.absoluteDeadlineAt } : {},
|
|
6694
6586
|
...input.params.turnBudget !== void 0 ? { turnBudget: input.params.turnBudget } : {},
|
|
@@ -6956,6 +6848,7 @@ function internalizePromptDrivenChildren(params, options) {
|
|
|
6956
6848
|
cwd: params.cwd,
|
|
6957
6849
|
model: params.model,
|
|
6958
6850
|
tier: params.tier,
|
|
6851
|
+
thinking: params.thinking,
|
|
6959
6852
|
skill: params.skill,
|
|
6960
6853
|
output: params.output,
|
|
6961
6854
|
outputMode: params.outputMode,
|
|
@@ -7300,13 +7193,21 @@ function runAsyncPath(data, deps) {
|
|
|
7300
7193
|
isError: !0,
|
|
7301
7194
|
details: { mode: "single", results: [] }
|
|
7302
7195
|
};
|
|
7303
|
-
let rawOutput = params.output !== void 0 ? params.output : a.output, effectiveOutput = normalizeSingleOutputOverride(rawOutput, a.output), effectiveOutputMode = params.outputMode ?? "inline", normalizedSkills = normalizeSkillInput(params.skill), skills = normalizedSkills === !1 ? [] : normalizedSkills, maxSubagentDepth = resolveChildMaxSubagentDepth(currentMaxSubagentDepth, a.maxSubagentDepth),
|
|
7196
|
+
let rawOutput = params.output !== void 0 ? params.output : a.output, effectiveOutput = normalizeSingleOutputOverride(rawOutput, a.output), effectiveOutputMode = params.outputMode ?? "inline", normalizedSkills = normalizeSkillInput(params.skill), skills = normalizedSkills === !1 ? [] : normalizedSkills, maxSubagentDepth = resolveChildMaxSubagentDepth(currentMaxSubagentDepth, a.maxSubagentDepth), modelSelection = captureModelSelection({ model: params.model, tier: params.tier }), modelOverride = resolveExecutableChildModel({
|
|
7197
|
+
modelSelection,
|
|
7198
|
+
model: params.model,
|
|
7199
|
+
tier: params.tier,
|
|
7200
|
+
thinking: params.thinking,
|
|
7201
|
+
availableModels,
|
|
7202
|
+
preferredProvider: currentProvider
|
|
7203
|
+
}), spec = normalizeChildSpec({
|
|
7304
7204
|
task: shouldForkAgent(contextPolicy, params.agent) ? wrapForkTask(params.task ?? "") : params.task ?? "",
|
|
7305
7205
|
description: params.description,
|
|
7306
7206
|
permissions: params.permissions,
|
|
7307
|
-
model:
|
|
7207
|
+
model: params.model,
|
|
7308
7208
|
tier: params.tier,
|
|
7309
|
-
|
|
7209
|
+
thinking: params.thinking,
|
|
7210
|
+
modelSelection,
|
|
7310
7211
|
skill: params.skill,
|
|
7311
7212
|
cwd: effectiveCwd,
|
|
7312
7213
|
output: effectiveOutput,
|
|
@@ -7492,7 +7393,7 @@ function buildParallelWorktreeTaskCwdError(tasks, sharedCwd) {
|
|
|
7492
7393
|
return formatWorktreeTaskCwdConflict(conflict, sharedCwd);
|
|
7493
7394
|
}
|
|
7494
7395
|
function resolveSingleRunOutputBaseDir(deps, artifactsDir, runId) {
|
|
7495
|
-
return deps.config.singleRunOutputBaseDir ?
|
|
7396
|
+
return deps.config.singleRunOutputBaseDir ? path15.resolve(deps.expandTilde(deps.config.singleRunOutputBaseDir)) : path15.join(artifactsDir, "outputs", runId);
|
|
7496
7397
|
}
|
|
7497
7398
|
function buildChainWorktreeTaskCwdError(chain, sharedCwd) {
|
|
7498
7399
|
for (let stepIndex = 0; stepIndex < chain.length; stepIndex++) {
|
|
@@ -7512,7 +7413,7 @@ function resolveParallelTaskCwd(task, paramsCwd, worktreeSetup, index) {
|
|
|
7512
7413
|
function buildParallelWorktreeSuffix(worktreeSetup, artifactsDir, tasks) {
|
|
7513
7414
|
if (!worktreeSetup)
|
|
7514
7415
|
return "";
|
|
7515
|
-
let diffsDir =
|
|
7416
|
+
let diffsDir = path15.join(artifactsDir, "worktree-diffs"), diffs = diffWorktrees(worktreeSetup, tasks.map((task) => task.agent), diffsDir);
|
|
7516
7417
|
return formatWorktreeDiffSummary(diffs);
|
|
7517
7418
|
}
|
|
7518
7419
|
function findDuplicateParallelOutputPath(input) {
|
|
@@ -7535,13 +7436,16 @@ async function runForegroundParallelTasks(input) {
|
|
|
7535
7436
|
input.sessionFileForTask(input.tasks[i].agent, i, input.modelOverrides[i]);
|
|
7536
7437
|
return mapConcurrent(input.tasks, input.concurrencyLimit, async (task, index) => {
|
|
7537
7438
|
let behavior = input.behaviors[index], effectiveSkills = behavior?.skills, taskCwd = resolveParallelTaskCwd(task, input.paramsCwd, input.worktreeSetup, index), readInstructions = behavior ? buildChainInstructions({ ...behavior, output: !1, progress: !1 }, taskCwd, !1) : { prefix: "", suffix: "" }, progressInstructions = behavior ? buildChainInstructions({ ...behavior, output: !1, reads: !1 }, input.progressDir, index === input.firstProgressIndex) : { prefix: "", suffix: "" }, outputPath = resolveSingleOutputPath(behavior?.output, input.ctx.cwd, taskCwd, input.outputBaseDir), agentConfig = input.agents.find((agent) => agent.name === task.agent), taskText = injectSingleOutputInstruction(`${readInstructions.prefix}${input.taskTexts[index]}${progressInstructions.suffix}`, outputPath, agentConfig), interruptController = new AbortController();
|
|
7538
|
-
|
|
7439
|
+
input.foregroundControl && (input.foregroundControl.currentAgent = task.description || task.agent, input.foregroundControl.currentChildId = task.agent, input.foregroundControl.currentIndex = index, input.foregroundControl.currentActivityState = void 0, input.foregroundControl.updatedAt = Date.now(), input.foregroundControl.interrupt = () => interruptController.signal.aborted ? !1 : (interruptController.abort(), input.foregroundControl.currentActivityState = void 0, input.foregroundControl.updatedAt = Date.now(), !0));
|
|
7440
|
+
let modelSelection = input.modelSelections[index] ?? captureModelSelection({ model: task.model, tier: task.tier });
|
|
7441
|
+
return runSync(input.ctx.cwd, normalizeChildSpec({
|
|
7539
7442
|
task: taskText,
|
|
7540
7443
|
description: task.description,
|
|
7541
7444
|
permissions: task.permissions,
|
|
7542
|
-
model:
|
|
7445
|
+
model: task.model,
|
|
7543
7446
|
tier: task.tier,
|
|
7544
|
-
|
|
7447
|
+
thinking: task.thinking,
|
|
7448
|
+
modelSelection,
|
|
7545
7449
|
skill: task.skill,
|
|
7546
7450
|
cwd: taskCwd,
|
|
7547
7451
|
output: task.output,
|
|
@@ -7646,7 +7550,14 @@ async function runParallelPath(data, deps) {
|
|
|
7646
7550
|
...task.reads !== void 0 && task.reads !== !0 ? { reads: task.reads } : {},
|
|
7647
7551
|
...task.progress !== void 0 ? { progress: task.progress } : {},
|
|
7648
7552
|
...skillOverrides[index] !== void 0 ? { skills: skillOverrides[index] } : {}
|
|
7649
|
-
})),
|
|
7553
|
+
})), modelSelections = tasks.map((task) => captureModelSelection({ model: task.model, tier: task.tier })), modelOverrides = tasks.map((task, index) => resolveExecutableChildModel({
|
|
7554
|
+
modelSelection: modelSelections[index],
|
|
7555
|
+
model: task.model,
|
|
7556
|
+
tier: task.tier,
|
|
7557
|
+
thinking: task.thinking,
|
|
7558
|
+
availableModels,
|
|
7559
|
+
preferredProvider: currentProvider
|
|
7560
|
+
}));
|
|
7650
7561
|
if (params.clarify === !0 && ctx.hasUI) {
|
|
7651
7562
|
let behaviors2 = agentConfigs.map((_c, i) => resolveStepBehavior(behaviorOverrides[i])), availableSkills = discoverAvailableSkills(effectiveCwd), result2 = await ctx.ui.custom((tui, theme, _kb, done) => new ChainClarifyComponent(tui, theme, agentConfigs, taskTexts, "", void 0, behaviors2, availableModels, currentProvider, availableSkills, done, "parallel"), { overlay: !0, overlayOptions: { anchor: "center", width: 84, maxHeight: "80%" } });
|
|
7652
7563
|
if (!result2 || !result2.confirmed)
|
|
@@ -7722,7 +7633,7 @@ async function runParallelPath(data, deps) {
|
|
|
7722
7633
|
if (errorResult)
|
|
7723
7634
|
return errorResult;
|
|
7724
7635
|
try {
|
|
7725
|
-
let outputBaseDir =
|
|
7636
|
+
let outputBaseDir = path15.join(artifactsDir, "outputs", runId), duplicateOutputError = findDuplicateParallelOutputPath({
|
|
7726
7637
|
tasks,
|
|
7727
7638
|
behaviors,
|
|
7728
7639
|
paramsCwd: effectiveCwd,
|
|
@@ -7737,7 +7648,7 @@ async function runParallelPath(data, deps) {
|
|
|
7737
7648
|
if (validationError)
|
|
7738
7649
|
return buildParallelModeError(validationError);
|
|
7739
7650
|
}
|
|
7740
|
-
let parallelProgressPrecreated = firstProgressIndex !== -1, parallelProgressDir =
|
|
7651
|
+
let parallelProgressPrecreated = firstProgressIndex !== -1, parallelProgressDir = path15.join(artifactsDir, "progress", runId);
|
|
7741
7652
|
parallelProgressPrecreated && writeInitialProgressFile(parallelProgressDir);
|
|
7742
7653
|
for (let i = 0; i < taskTexts.length; i++)
|
|
7743
7654
|
shouldForkAgent(contextPolicy, tasks[i].agent) && (taskTexts[i] = wrapForkTask(taskTexts[i]));
|
|
@@ -7855,7 +7766,9 @@ async function runSinglePath(data, deps) {
|
|
|
7855
7766
|
task: params.task,
|
|
7856
7767
|
description: params.description,
|
|
7857
7768
|
permissions: params.permissions,
|
|
7769
|
+
model: params.model,
|
|
7858
7770
|
tier: params.tier,
|
|
7771
|
+
thinking: params.thinking,
|
|
7859
7772
|
skill: params.skill,
|
|
7860
7773
|
cwd: effectiveCwd,
|
|
7861
7774
|
output: params.output,
|
|
@@ -7884,7 +7797,14 @@ async function runSinglePath(data, deps) {
|
|
|
7884
7797
|
}, effectiveToolBudget = resolveEffectiveToolBudget({ runBudget: data.toolBudget, agentBudget: spec.toolBudget, configBudget: data.configToolBudget });
|
|
7885
7798
|
if (effectiveToolBudget.error)
|
|
7886
7799
|
return toExecutionErrorResult(params, new Error(effectiveToolBudget.error));
|
|
7887
|
-
let currentProvider = ctx.model?.provider, availableModels = ctx.modelRegistry.getAvailable().map(toModelInfo), task = params.task ?? "",
|
|
7800
|
+
let currentProvider = ctx.model?.provider, availableModels = ctx.modelRegistry.getAvailable().map(toModelInfo), task = params.task ?? "", modelSelection = captureModelSelection({ model: params.model, tier: params.tier }), modelOverride = resolveExecutableChildModel({
|
|
7801
|
+
modelSelection,
|
|
7802
|
+
model: params.model,
|
|
7803
|
+
tier: params.tier,
|
|
7804
|
+
thinking: params.thinking,
|
|
7805
|
+
availableModels,
|
|
7806
|
+
preferredProvider: currentProvider
|
|
7807
|
+
}), skillOverride = normalizeSkillInput(params.skill), rawOutput = params.output !== void 0 ? params.output : agentConfig.output, effectiveOutput = normalizeSingleOutputOverride(rawOutput, agentConfig.output), effectiveOutputMode = params.outputMode ?? "inline", currentMaxSubagentDepth = resolveCurrentMaxSubagentDepth(deps.config.maxSubagentDepth), maxSubagentDepth = resolveChildMaxSubagentDepth(currentMaxSubagentDepth, agentConfig.maxSubagentDepth);
|
|
7888
7808
|
if (params.clarify === !0 && ctx.hasUI) {
|
|
7889
7809
|
let behavior = resolveStepBehavior({ output: effectiveOutput, skills: skillOverride }), availableSkills = discoverAvailableSkills(effectiveCwd), result2 = await ctx.ui.custom((tui, theme, _kb, done) => new ChainClarifyComponent(tui, theme, [agentConfig], [task], task, void 0, [behavior], availableModels, currentProvider, availableSkills, done, "single"), { overlay: !0, overlayOptions: { anchor: "center", width: 84, maxHeight: "80%" } });
|
|
7890
7810
|
if (!result2 || !result2.confirmed)
|
|
@@ -8056,28 +7976,16 @@ function foregroundCapacityResult(params, inFlight, limit) {
|
|
|
8056
7976
|
return {
|
|
8057
7977
|
content: [{
|
|
8058
7978
|
type: "text",
|
|
8059
|
-
text: `Foreground subagent capacity reached (${inFlight}/${limit} running). Wait for a child to finish,
|
|
7979
|
+
text: `Foreground subagent capacity reached (${inFlight}/${limit} running). Wait for a child to finish, combine work in ONE tasks call, or launch without async:false or clarify:true when foreground execution is unnecessary.`
|
|
8060
7980
|
}],
|
|
8061
7981
|
isError: !0,
|
|
8062
7982
|
details: { mode: inferExecutionMode(params), results: [] }
|
|
8063
7983
|
};
|
|
8064
7984
|
}
|
|
8065
|
-
function omitExecutionModeActionAlias(params) {
|
|
8066
|
-
let action = params.action?.toLowerCase();
|
|
8067
|
-
if (action === "single" && params.task !== void 0) {
|
|
8068
|
-
let rest = { ...params };
|
|
8069
|
-
return delete rest.action, rest;
|
|
8070
|
-
}
|
|
8071
|
-
if ((action === "parallel" || action === "tasks") && (params.tasks?.length ?? 0) > 0) {
|
|
8072
|
-
let rest = { ...params };
|
|
8073
|
-
return delete rest.action, rest;
|
|
8074
|
-
}
|
|
8075
|
-
return params;
|
|
8076
|
-
}
|
|
8077
7985
|
function createSubagentExecutor(deps) {
|
|
8078
7986
|
let execute = async (_id, params, signal, onUpdate, ctx) => {
|
|
8079
7987
|
deps.state.baseCwd = ctx.cwd, deps.state.foregroundRuns ??= /* @__PURE__ */ new Map(), deps.state.foregroundControls ??= /* @__PURE__ */ new Map(), deps.state.lastForegroundControlId ??= null;
|
|
8080
|
-
let requestParams =
|
|
7988
|
+
let requestParams = resolveSubagentRequestParams(params), requestCwd = resolveRequestedCwd(ctx.cwd, requestParams.cwd), paramsWithResolvedCwd = requestParams.cwd === void 0 ? requestParams : { ...requestParams, cwd: requestCwd }, action = paramsWithResolvedCwd.action;
|
|
8081
7989
|
if (action) {
|
|
8082
7990
|
if (WATCHDOG_TOOL_ACTIONS.includes(action))
|
|
8083
7991
|
return deps.allowMutatingManagementActions === !1 && MUTATING_MANAGEMENT_ACTIONS.has(action) ? {
|
|
@@ -8158,7 +8066,7 @@ function createSubagentExecutor(deps) {
|
|
|
8158
8066
|
let targetRunId = paramsWithResolvedCwd.runId ?? paramsWithResolvedCwd.id;
|
|
8159
8067
|
if (paramsWithResolvedCwd.dir)
|
|
8160
8068
|
try {
|
|
8161
|
-
let location = resolveAsyncRunLocation(paramsWithResolvedCwd, ASYNC_DIR, RESULTS_DIR), runId2 = location.resolvedId ?? targetRunId ??
|
|
8069
|
+
let location = resolveAsyncRunLocation(paramsWithResolvedCwd, ASYNC_DIR, RESULTS_DIR), runId2 = location.resolvedId ?? targetRunId ?? path15.basename(location.asyncDir ?? paramsWithResolvedCwd.dir);
|
|
8162
8070
|
return steerAsyncRun({ state: deps.state, runId: runId2, message, index: paramsWithResolvedCwd.index, kill: deps.kill, location, signal, recover: ({ absoluteDeadlineAt, ...limits }) => resumeAsyncRun({ params: { ...limits, action: "resume", id: runId2, message }, requestCwd, ctx, deps, absoluteDeadlineAt }) });
|
|
8163
8071
|
} catch (error) {
|
|
8164
8072
|
return { content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }], isError: !0, details: { mode: "management", results: [] } };
|
|
@@ -8186,7 +8094,7 @@ function createSubagentExecutor(deps) {
|
|
|
8186
8094
|
if (paramsWithResolvedCwd.dir)
|
|
8187
8095
|
try {
|
|
8188
8096
|
let location = resolveAsyncRunLocation(paramsWithResolvedCwd, ASYNC_DIR, RESULTS_DIR);
|
|
8189
|
-
return stopAsyncRun(deps.state, location.resolvedId ?? targetRunId ??
|
|
8097
|
+
return stopAsyncRun(deps.state, location.resolvedId ?? targetRunId ?? path15.basename(location.asyncDir ?? paramsWithResolvedCwd.dir), deps.kill, location);
|
|
8190
8098
|
} catch (error) {
|
|
8191
8099
|
return { content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }], isError: !0, details: { mode: "management", results: [] } };
|
|
8192
8100
|
}
|
|
@@ -8256,7 +8164,7 @@ function createSubagentExecutor(deps) {
|
|
|
8256
8164
|
let normalized = normalizeRepeatedParallelCounts(paramsWithResolvedCwd);
|
|
8257
8165
|
if (normalized.error)
|
|
8258
8166
|
return normalized.error;
|
|
8259
|
-
let
|
|
8167
|
+
let effectiveParams = normalized.params, runToolBudget = resolveToolBudget(effectiveParams.toolBudget, "toolBudget");
|
|
8260
8168
|
if (runToolBudget.error)
|
|
8261
8169
|
return buildRequestedModeError(effectiveParams, runToolBudget.error);
|
|
8262
8170
|
let configToolBudget = resolveToolBudget(deps.config.toolBudget, "config.toolBudget");
|
|
@@ -8307,23 +8215,23 @@ function createSubagentExecutor(deps) {
|
|
|
8307
8215
|
} catch (error) {
|
|
8308
8216
|
return toExecutionErrorResult(effectiveParams, error);
|
|
8309
8217
|
}
|
|
8310
|
-
let
|
|
8218
|
+
let backgroundRequestedWhileClarifying = (hasChain || hasTasks) && effectiveParams.async === !0 && effectiveParams.clarify === !0, effectiveAsync = subagentLaunchRunsAsync(effectiveParams), controlConfig = resolveControlConfig(deps.config.control, effectiveParams.control), artifactConfig = {
|
|
8311
8219
|
...DEFAULT_ARTIFACT_CONFIG,
|
|
8312
8220
|
enabled: effectiveParams.artifacts !== !1
|
|
8313
8221
|
}, artifactsDir = getArtifactsDir(parentSessionFile, effectiveCwd), sessionRoot;
|
|
8314
8222
|
if (effectiveParams.sessionDir)
|
|
8315
|
-
sessionRoot =
|
|
8223
|
+
sessionRoot = path15.resolve(deps.expandTilde(effectiveParams.sessionDir));
|
|
8316
8224
|
else {
|
|
8317
|
-
let baseSessionRoot = deps.config.defaultSessionDir ?
|
|
8318
|
-
sessionRoot =
|
|
8225
|
+
let baseSessionRoot = deps.config.defaultSessionDir ? path15.resolve(deps.expandTilde(deps.config.defaultSessionDir)) : deps.getSubagentSessionRoot(parentSessionFile);
|
|
8226
|
+
sessionRoot = path15.join(baseSessionRoot, runId);
|
|
8319
8227
|
}
|
|
8320
8228
|
try {
|
|
8321
|
-
|
|
8229
|
+
fs15.mkdirSync(sessionRoot, { recursive: !0 });
|
|
8322
8230
|
} catch (error) {
|
|
8323
8231
|
let message = error instanceof Error ? error.message : String(error);
|
|
8324
8232
|
return toExecutionErrorResult(effectiveParams, new Error(`Failed to create session directory '${sessionRoot}': ${message}`));
|
|
8325
8233
|
}
|
|
8326
|
-
let sessionDirForIndex = (idx) =>
|
|
8234
|
+
let sessionDirForIndex = (idx) => path15.join(sessionRoot, `run-${idx ?? 0}`), forkSessionFileForTask = (agentName, idx = 0, modelOverride) => {
|
|
8327
8235
|
if (shouldForkAgent(contextPolicy, agentName))
|
|
8328
8236
|
return prepareForkThinking(agentName, idx, modelOverride), forkSessionFileForIndex(idx);
|
|
8329
8237
|
}, forkThinkingOverrideForTask = (agentName, idx = 0, modelOverride) => {
|
|
@@ -8332,7 +8240,7 @@ function createSubagentExecutor(deps) {
|
|
|
8332
8240
|
prepareForkThinking(agentName, idx, modelOverride);
|
|
8333
8241
|
let override = forkThinkingOverrideForIndex(idx);
|
|
8334
8242
|
return override === "off" && forkThinkingDowngrades.set(idx, agentName), override;
|
|
8335
|
-
}, childSessionFileForTask = (agentName, idx, modelOverride) => forkSessionFileForTask(agentName, idx, modelOverride) ??
|
|
8243
|
+
}, childSessionFileForTask = (agentName, idx, modelOverride) => forkSessionFileForTask(agentName, idx, modelOverride) ?? path15.join(sessionDirForIndex(idx), "session.jsonl"), childSessionFileForIndex = (idx) => path15.join(sessionDirForIndex(idx), "session.jsonl");
|
|
8336
8244
|
try {
|
|
8337
8245
|
effectiveParams.clarify === !0 && ctx.hasUI || preflightForkSessionsForStaticTasks(effectiveParams, contextPolicy, forkSessionFileForTask, deps.config.chain?.dynamicFanout?.maxItems);
|
|
8338
8246
|
} catch (error) {
|
|
@@ -8461,11 +8369,8 @@ function createSubagentExecutor(deps) {
|
|
|
8461
8369
|
}, effectiveParams.context);
|
|
8462
8370
|
};
|
|
8463
8371
|
return { execute: async (id, params, signal, onUpdate, ctx) => {
|
|
8464
|
-
let requestParams =
|
|
8465
|
-
if (requestParams.action)
|
|
8466
|
-
return execute(id, requestParams, signal, onUpdate, ctx);
|
|
8467
|
-
let { depth } = checkSubagentDepth(deps.config.maxSubagentDepth), dispatchParams = applyForceTopLevelAsyncOverride(requestParams, depth, deps.config.forceTopLevelAsync === !0);
|
|
8468
|
-
if (!(dispatchParams.clarify === !0 || (dispatchParams.async ?? deps.asyncByDefault) !== !0))
|
|
8372
|
+
let requestParams = resolveSubagentRequestParams(params);
|
|
8373
|
+
if (requestParams.action || !!subagentLaunchRunsAsync(requestParams))
|
|
8469
8374
|
return execute(id, requestParams, signal, onUpdate, ctx);
|
|
8470
8375
|
let limit = resolveTopLevelParallelConcurrency(void 0, deps.config.parallel?.concurrency), inFlight = deps.state.foregroundSubagentInFlight ?? 0;
|
|
8471
8376
|
if (inFlight >= limit)
|