@ashx-j/lunr-dev 0.2.19-dev.10.1 → 0.2.25-dev.13.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 +60 -2
- package/README.md +2 -2
- package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-tui.js +2 -2
- package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
- package/dist/builtin-extensions/index.d.ts.map +1 -1
- package/dist/builtin-extensions/index.js +1 -2
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/lunr-browser.d.ts +9 -0
- package/dist/builtin-extensions/lunr-browser.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-browser.js +169 -0
- package/dist/builtin-extensions/lunr-browser.js.map +1 -0
- package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-computer-use.js +15 -14
- package/dist/builtin-extensions/lunr-computer-use.js.map +1 -1
- package/dist/builtin-extensions/lunr-plan-tools.d.ts +7 -7
- package/dist/builtin-extensions/lunr-plan-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-plan-tools.js +12 -12
- package/dist/builtin-extensions/lunr-plan-tools.js.map +1 -1
- 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 +24 -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 +365 -351
- package/dist/builtin-extensions/pi-intercom/index.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.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 +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js +5 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.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 +9 -7
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +143 -59
- 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 +39 -14
- 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 +5 -3
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +32 -17
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/communication.d.ts +17 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/communication.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/communication.js +45 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/communication.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js +10 -14
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts +12 -2
- 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 +401 -58
- 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 +184 -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 +91 -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 +542 -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 +13 -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 +42 -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/auto-drain.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js +2 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.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 +47 -32
- 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 +6 -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 +75 -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.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +43 -4
- 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 +1 -0
- 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 +26 -9
- 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 +4 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts +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 +94 -25
- 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 +1 -1
- 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 +5 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js +25 -15
- 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-control.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js +3 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.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 +17 -5
- 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 +70 -13
- 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 +23 -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/communication.d.ts +18 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.js +48 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +46 -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 +407 -450
- 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 +11 -7
- package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +2 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/install-cli.d.ts.map +1 -1
- package/dist/cli/install-cli.js +15 -45
- package/dist/cli/install-cli.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +9 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +126 -29
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +23 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +255 -109
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/browser/network.d.ts +9 -0
- package/dist/core/browser/network.d.ts.map +1 -0
- package/dist/core/browser/network.js +146 -0
- package/dist/core/browser/network.js.map +1 -0
- package/dist/core/browser/runtime.d.ts +24 -0
- package/dist/core/browser/runtime.d.ts.map +1 -0
- package/dist/core/browser/runtime.js +289 -0
- package/dist/core/browser/runtime.js.map +1 -0
- package/dist/core/browser/schema.d.ts +16 -0
- package/dist/core/browser/schema.d.ts.map +1 -0
- package/dist/core/browser/schema.js +36 -0
- package/dist/core/browser/schema.js.map +1 -0
- package/dist/core/browser/settings.d.ts +8 -0
- package/dist/core/browser/settings.d.ts.map +1 -0
- package/dist/core/browser/settings.js +30 -0
- package/dist/core/browser/settings.js.map +1 -0
- package/dist/core/browser/setup.d.ts +2 -0
- package/dist/core/browser/setup.d.ts.map +1 -0
- package/dist/core/browser/setup.js +16 -0
- package/dist/core/browser/setup.js.map +1 -0
- package/dist/core/catalog-cache-scope.d.ts.map +1 -1
- package/dist/core/catalog-cache-scope.js +3 -1
- package/dist/core/catalog-cache-scope.js.map +1 -1
- package/dist/core/computer-use/image.d.ts +27 -0
- package/dist/core/computer-use/image.d.ts.map +1 -0
- package/dist/core/computer-use/image.js +72 -0
- package/dist/core/computer-use/image.js.map +1 -0
- package/dist/core/computer-use/policy.d.ts.map +1 -1
- package/dist/core/computer-use/policy.js +2 -6
- package/dist/core/computer-use/policy.js.map +1 -1
- package/dist/core/computer-use/schemas.d.ts +14 -10
- package/dist/core/computer-use/schemas.d.ts.map +1 -1
- package/dist/core/computer-use/schemas.js +27 -35
- package/dist/core/computer-use/schemas.js.map +1 -1
- package/dist/core/computer-use/workflow.d.ts +16 -8
- package/dist/core/computer-use/workflow.d.ts.map +1 -1
- package/dist/core/computer-use/workflow.js +337 -260
- package/dist/core/computer-use/workflow.js.map +1 -1
- package/dist/core/customize.d.ts +2 -0
- package/dist/core/customize.d.ts.map +1 -1
- package/dist/core/customize.js +17 -13
- package/dist/core/customize.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +1 -1
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +4 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +1 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/install-features.d.ts.map +1 -1
- package/dist/core/install-features.js +10 -8
- package/dist/core/install-features.js.map +1 -1
- package/dist/core/memory-cap.d.ts.map +1 -1
- package/dist/core/memory-cap.js +5 -3
- package/dist/core/memory-cap.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +3 -2
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/model-tiers.d.ts.map +1 -1
- package/dist/core/model-tiers.js +9 -6
- package/dist/core/model-tiers.js.map +1 -1
- package/dist/core/permissions.d.ts +17 -23
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +79 -146
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts +10 -12
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +20 -24
- package/dist/core/plan-mode.js.map +1 -1
- package/dist/core/process-registry.d.ts.map +1 -1
- package/dist/core/process-registry.js +6 -4
- package/dist/core/process-registry.js.map +1 -1
- package/dist/core/runtime-bridges.d.ts.map +1 -1
- package/dist/core/runtime-bridges.js +2 -2
- package/dist/core/runtime-bridges.js.map +1 -1
- package/dist/core/runtime-scope.d.ts +11 -0
- package/dist/core/runtime-scope.d.ts.map +1 -0
- package/dist/core/runtime-scope.js +3 -0
- package/dist/core/runtime-scope.js.map +1 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +26 -6
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-handoff.d.ts +35 -0
- package/dist/core/session-handoff.d.ts.map +1 -0
- package/dist/core/session-handoff.js +214 -0
- package/dist/core/session-handoff.js.map +1 -0
- package/dist/core/session-manager.d.ts +20 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +191 -22
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-ownership.d.ts +28 -0
- package/dist/core/session-ownership.d.ts.map +1 -0
- package/dist/core/session-ownership.js +138 -0
- package/dist/core/session-ownership.js.map +1 -0
- package/dist/core/session-retention.d.ts.map +1 -1
- package/dist/core/session-retention.js +11 -2
- package/dist/core/session-retention.js.map +1 -1
- package/dist/core/settings-manager.d.ts +24 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +78 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +6 -4
- package/dist/core/slash-commands.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-permission-inherit.d.ts +6 -10
- package/dist/core/subagent-permission-inherit.d.ts.map +1 -1
- package/dist/core/subagent-permission-inherit.js +14 -14
- package/dist/core/subagent-permission-inherit.js.map +1 -1
- 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/core/subagent-wait-interruption.d.ts +11 -0
- package/dist/core/subagent-wait-interruption.d.ts.map +1 -0
- package/dist/core/subagent-wait-interruption.js +19 -0
- package/dist/core/subagent-wait-interruption.js.map +1 -0
- package/dist/core/system-prompt.d.ts +2 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +14 -4
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/todo-settings.d.ts +5 -0
- package/dist/core/todo-settings.d.ts.map +1 -0
- package/dist/core/todo-settings.js +7 -0
- package/dist/core/todo-settings.js.map +1 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +4 -4
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +5 -3
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +4 -4
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +4 -4
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +4 -4
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +4 -4
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +14 -5
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +34 -7
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +4 -4
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/usage-service.d.ts.map +1 -1
- package/dist/core/usage-service.js +5 -3
- package/dist/core/usage-service.js.map +1 -1
- package/dist/gateway/adapters/discord.d.ts +12 -1
- package/dist/gateway/adapters/discord.d.ts.map +1 -1
- package/dist/gateway/adapters/discord.js +114 -24
- package/dist/gateway/adapters/discord.js.map +1 -1
- package/dist/gateway/adapters/telegram.d.ts +4 -2
- package/dist/gateway/adapters/telegram.d.ts.map +1 -1
- package/dist/gateway/adapters/telegram.js +41 -11
- package/dist/gateway/adapters/telegram.js.map +1 -1
- package/dist/gateway/agent-bridge.d.ts +18 -4
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +305 -73
- package/dist/gateway/agent-bridge.js.map +1 -1
- package/dist/gateway/approval.d.ts +3 -6
- package/dist/gateway/approval.d.ts.map +1 -1
- package/dist/gateway/approval.js +62 -24
- package/dist/gateway/approval.js.map +1 -1
- package/dist/gateway/authz.d.ts +2 -0
- package/dist/gateway/authz.d.ts.map +1 -1
- package/dist/gateway/authz.js +13 -0
- package/dist/gateway/authz.js.map +1 -1
- package/dist/gateway/buttons.d.ts +3 -1
- package/dist/gateway/buttons.d.ts.map +1 -1
- package/dist/gateway/buttons.js +45 -20
- package/dist/gateway/buttons.js.map +1 -1
- package/dist/gateway/command.d.ts.map +1 -1
- package/dist/gateway/command.js +49 -4
- package/dist/gateway/command.js.map +1 -1
- package/dist/gateway/commands.d.ts +2 -0
- package/dist/gateway/commands.d.ts.map +1 -1
- package/dist/gateway/commands.js +52 -16
- package/dist/gateway/commands.js.map +1 -1
- package/dist/gateway/config.d.ts +6 -0
- package/dist/gateway/config.d.ts.map +1 -1
- package/dist/gateway/config.js +7 -0
- package/dist/gateway/config.js.map +1 -1
- package/dist/gateway/conversations.d.ts +14 -0
- package/dist/gateway/conversations.d.ts.map +1 -0
- package/dist/gateway/conversations.js +30 -0
- package/dist/gateway/conversations.js.map +1 -0
- package/dist/gateway/cron.d.ts +1 -1
- package/dist/gateway/cron.d.ts.map +1 -1
- package/dist/gateway/cron.js +2 -2
- package/dist/gateway/cron.js.map +1 -1
- package/dist/gateway/download.d.ts +2 -0
- package/dist/gateway/download.d.ts.map +1 -0
- package/dist/gateway/download.js +36 -0
- package/dist/gateway/download.js.map +1 -0
- package/dist/gateway/index.d.ts.map +1 -1
- package/dist/gateway/index.js +106 -47
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/mobile-commands.d.ts +24 -0
- package/dist/gateway/mobile-commands.d.ts.map +1 -0
- package/dist/gateway/mobile-commands.js +423 -0
- package/dist/gateway/mobile-commands.js.map +1 -0
- package/dist/gateway/presenter.d.ts +27 -0
- package/dist/gateway/presenter.d.ts.map +1 -0
- package/dist/gateway/presenter.js +308 -0
- package/dist/gateway/presenter.js.map +1 -0
- package/dist/gateway/router.d.ts +6 -5
- package/dist/gateway/router.d.ts.map +1 -1
- package/dist/gateway/router.js +126 -43
- package/dist/gateway/router.js.map +1 -1
- package/dist/gateway/service.d.ts +46 -0
- package/dist/gateway/service.d.ts.map +1 -0
- package/dist/gateway/service.js +404 -0
- package/dist/gateway/service.js.map +1 -0
- package/dist/gateway/setup.d.ts +9 -0
- package/dist/gateway/setup.d.ts.map +1 -0
- package/dist/gateway/setup.js +202 -0
- package/dist/gateway/setup.js.map +1 -0
- package/dist/gateway/stream.d.ts +6 -5
- package/dist/gateway/stream.d.ts.map +1 -1
- package/dist/gateway/stream.js +24 -11
- package/dist/gateway/stream.js.map +1 -1
- package/dist/gateway/types.d.ts +4 -2
- package/dist/gateway/types.d.ts.map +1 -1
- package/dist/gateway/types.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +19 -2
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +90 -35
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/copyable-text.d.ts +27 -0
- package/dist/modes/interactive/components/copyable-text.d.ts.map +1 -0
- package/dist/modes/interactive/components/copyable-text.js +156 -0
- package/dist/modes/interactive/components/copyable-text.js.map +1 -0
- package/dist/modes/interactive/components/custom-entry.d.ts +1 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +8 -0
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +8 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +16 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +16 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +147 -4
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-tail.d.ts +9 -2
- package/dist/modes/interactive/components/thinking-tail.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-tail.js +43 -1
- package/dist/modes/interactive/components/thinking-tail.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +5 -3
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +55 -44
- 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 +11 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +386 -155
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +1 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +23 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/node-runtime/agent-session-services-MQUPZSIN.js +51 -0
- package/dist/node-runtime/{builtin-extensions-7STLFW3A.js → builtin-extensions-4GNDR6U3.js} +8 -6
- package/dist/node-runtime/{chunk-LTXUQJI4.js → chunk-24C5IAJ4.js} +1 -6
- package/dist/node-runtime/chunk-2BLXLDJR.js +144 -0
- package/dist/node-runtime/{chunk-RQ5DNUNG.js → chunk-2CMV4L24.js} +21 -124
- package/dist/node-runtime/{chunk-OTT6JMPU.js → chunk-2MI5OPMN.js} +17 -370
- package/dist/node-runtime/{chunk-W3CVH5RX.js → chunk-2TKODGBZ.js} +11 -6
- package/dist/node-runtime/{chunk-K72NVGUB.js → chunk-33SIKK3Y.js} +38 -164
- package/dist/node-runtime/{chunk-GZQHMEWL.js → chunk-3DKIWPKN.js} +19 -4
- package/dist/node-runtime/{chunk-5OLJGVCB.js → chunk-3ONQTOMR.js} +2 -2
- package/dist/node-runtime/{chunk-3GHXVUAK.js → chunk-3VEY2IYY.js} +1 -1
- package/dist/node-runtime/chunk-4ER2ZV4Z.js +537 -0
- package/dist/node-runtime/chunk-4EULYYR4.js +62 -0
- package/dist/node-runtime/{chunk-BKAZ6BKX.js → chunk-4SBQAI4T.js} +31 -31
- package/dist/node-runtime/{chunk-W7S2REEG.js → chunk-53ARRUHA.js} +785 -285
- package/dist/node-runtime/{chunk-ZSEZY3II.js → chunk-5Q4A37RB.js} +10 -4
- package/dist/node-runtime/{chunk-SWSN6HAB.js → chunk-5UZOPGE3.js} +1 -1
- package/dist/node-runtime/{chunk-LCACDWHJ.js → chunk-5Z5PCXGY.js} +263 -222
- package/dist/node-runtime/chunk-5ZH3ZFIZ.js +308 -0
- package/dist/node-runtime/chunk-7JIYPIQU.js +356 -0
- package/dist/node-runtime/{chunk-ZRDIMBEQ.js → chunk-AJ6R5VTV.js} +66 -91
- package/dist/node-runtime/chunk-ATIF3RX5.js +352 -0
- package/dist/node-runtime/chunk-BBUVIEZB.js +51 -0
- package/dist/node-runtime/chunk-CCCN2UCX.js +14 -0
- package/dist/node-runtime/chunk-CJS4KQFI.js +3412 -0
- package/dist/node-runtime/chunk-DO6PALE2.js +205 -0
- package/dist/node-runtime/{chunk-MUMMMTW4.js → chunk-DRJI7ZSC.js} +572 -401
- package/dist/node-runtime/{chunk-6SPPH4FY.js → chunk-E75WFZ33.js} +4 -4
- package/dist/node-runtime/{chunk-MJQDX3BA.js → chunk-EBB4BJW4.js} +3 -3
- package/dist/node-runtime/{chunk-5NWQCSKR.js → chunk-EOEAQIJV.js} +70 -3
- package/dist/node-runtime/chunk-EOPL2HMM.js +117 -0
- package/dist/node-runtime/chunk-H4K3JDRB.js +47 -0
- package/dist/node-runtime/{chunk-HRS4HMDX.js → chunk-HT2XEJNP.js} +19 -3
- package/dist/node-runtime/chunk-IMLCWLPI.js +9 -0
- package/dist/node-runtime/{chunk-FLYMHKCS.js → chunk-JJWZB7S3.js} +60 -48
- package/dist/node-runtime/chunk-KFFOQR4G.js +672 -0
- package/dist/node-runtime/chunk-L5LZUGT7.js +40 -0
- package/dist/node-runtime/chunk-LV6CEFW2.js +97 -0
- package/dist/node-runtime/{chunk-EHMBW7FA.js → chunk-LWYIVUGV.js} +5 -4
- package/dist/node-runtime/{chunk-T5GM5BFH.js → chunk-MFV2LOOX.js} +186 -2194
- package/dist/node-runtime/{chunk-5SQDLSZJ.js → chunk-MNRO3UCV.js} +2 -2
- package/dist/node-runtime/{chunk-JHYKXIMM.js → chunk-MPKSOJBT.js} +1 -1
- package/dist/node-runtime/{chunk-C4O2RSQQ.js → chunk-N4TUWAGA.js} +1 -1
- package/dist/node-runtime/{chunk-4SJWFTUP.js → chunk-NAY6UUQZ.js} +1 -1
- package/dist/node-runtime/chunk-NKH2QBKF.js +773 -0
- package/dist/node-runtime/chunk-O2AT4MEU.js +124 -0
- package/dist/node-runtime/chunk-OAR4TYZE.js +146 -0
- package/dist/node-runtime/{chunk-DDGMHUOW.js → chunk-OGJN3OZV.js} +2 -1
- package/dist/node-runtime/{chunk-MX3GJNXJ.js → chunk-PLGA743X.js} +23 -0
- package/dist/node-runtime/chunk-Q3FEOEDA.js +1364 -0
- package/dist/node-runtime/chunk-QFADHUQV.js +74 -0
- package/dist/node-runtime/chunk-RBZQU6TJ.js +27 -0
- package/dist/node-runtime/{chunk-MGSB2C3M.js → chunk-RVOQBXTA.js} +10 -6
- package/dist/node-runtime/{chunk-ISQDQIZN.js → chunk-RW4PYFNE.js} +14 -94
- package/dist/node-runtime/chunk-TP7K7YWS.js +2830 -0
- package/dist/node-runtime/{chunk-TAP7QTUT.js → chunk-TVLBDVTR.js} +46 -436
- package/dist/node-runtime/chunk-UAEOTO52.js +119 -0
- package/dist/node-runtime/{chunk-MGWCVY6Y.js → chunk-UDKX3PFN.js} +3 -3
- package/dist/node-runtime/{chunk-AY6CAJSL.js → chunk-UJOCPOMX.js} +6 -3
- package/dist/node-runtime/{chunk-J7QGQD45.js → chunk-UQUCFAJ3.js} +1 -1
- package/dist/node-runtime/chunk-US544NN6.js +13 -0
- package/dist/node-runtime/{chunk-7AFOFSDY.js → chunk-V3HK3FE7.js} +1 -1
- package/dist/node-runtime/{chunk-6UB6NKA3.js → chunk-VIVYOI7C.js} +130 -27
- package/dist/node-runtime/{chunk-5Q45AVQG.js → chunk-XHIRAZ26.js} +1 -1
- package/dist/node-runtime/chunk-YPHAIRZT.js +10 -0
- package/dist/node-runtime/{chunk-3RCWXWAY.js → chunk-YRUY57IN.js} +1 -1
- package/dist/node-runtime/cli-runtime.js +2 -2
- package/dist/node-runtime/command-PYBNGLPP.js +45 -0
- package/dist/node-runtime/{commands-LGR5VT5X.js → commands-EMBQQVVT.js} +13 -13
- package/dist/node-runtime/commands-Y2OUC2T7.js +37 -0
- package/dist/node-runtime/config-7DYMNJUO.js +20 -0
- package/dist/node-runtime/{customize-XEXL2DGQ.js → customize-VFJV3U6A.js} +2 -1
- package/dist/node-runtime/{direct-tool-executor-TDJS7TBD.js → direct-tool-executor-4D7UXYU4.js} +10 -10
- package/dist/node-runtime/{export-html-E4DT6ZJQ.js → export-html-ETFOKW3M.js} +4 -3
- package/dist/node-runtime/{extension-input-RV5N6APL.js → extension-input-7QODTFAS.js} +4 -4
- package/dist/node-runtime/{extension-selector-CPD5LWDD.js → extension-selector-T65JEDJ5.js} +4 -4
- package/dist/node-runtime/{extract-IUCVZCWC.js → extract-EQJE7FZZ.js} +2 -2
- package/dist/node-runtime/gateway-QENRQA5X.js +1476 -0
- package/dist/node-runtime/{gemini-search-NCIDF7NE.js → gemini-search-35OCRFLN.js} +1 -1
- package/dist/node-runtime/{gemini-url-context-OKIN7AIP.js → gemini-url-context-UQY3PHHW.js} +2 -2
- package/dist/node-runtime/index.js +120 -77
- package/dist/node-runtime/{init-EKE277AG.js → init-P5AUV77I.js} +5 -5
- package/dist/node-runtime/{install-cli-TH7IJJQQ.js → install-cli-KHAXYBOO.js} +21 -82
- package/dist/node-runtime/interactive-mode-IN77GQGX.js +74 -0
- package/dist/node-runtime/{interactive-view-N6F4KUIT.js → interactive-view-OMWDFGUQ.js} +10 -10
- package/dist/node-runtime/lunr-browser-VVPRWC3F.js +174 -0
- package/dist/node-runtime/lunr-computer-use-IAUNXSXH.js +138 -0
- package/dist/node-runtime/{lunr-cron-KKBOGAEF.js → lunr-cron-P6ZJGVEF.js} +22 -8
- package/dist/node-runtime/main.js +50 -35
- package/dist/node-runtime/{mcp-auth-flow-YL6RWPYG.js → mcp-auth-flow-QVLFVLEO.js} +2 -2
- package/dist/node-runtime/{memory-cap-3S4XRLNP.js → memory-cap-EL3KL4JJ.js} +2 -1
- package/dist/node-runtime/mobile-commands-WKFSFACZ.js +33 -0
- package/dist/node-runtime/model-runtime-YXGJS5OJ.js +16 -0
- package/dist/node-runtime/{model-tiers-NJLHUEGK.js → model-tiers-OU3U5CZG.js} +2 -1
- package/dist/node-runtime/{package-manager-cli-C4EJOO5Q.js → package-manager-cli-J337RKTI.js} +28 -19
- package/dist/node-runtime/{pi-intercom-EEMBGQID.js → pi-intercom-QM53RLTS.js} +114 -88
- package/dist/node-runtime/{pi-mcp-adapter-DPTJGAAL.js → pi-mcp-adapter-3PHF4KZ4.js} +9 -8
- package/dist/node-runtime/{pi-subagents-VKCLYIBY.js → pi-subagents-RCHPB6UK.js} +1476 -646
- package/dist/node-runtime/{pi-web-access-BV6DSZOP.js → pi-web-access-PNG35XW7.js} +11 -11
- package/dist/node-runtime/process-registry-PVJ44F7H.js +31 -0
- package/dist/node-runtime/{proxy-modes-R64LU6WZ.js → proxy-modes-5FAPSZEZ.js} +14 -14
- package/dist/node-runtime/rpc-entry.js +50 -35
- package/dist/node-runtime/{rpc-mode-SJNSOA4G.js → rpc-mode-SH7VB4RH.js} +2 -2
- package/dist/node-runtime/runtime-4VA6JKNF.js +373 -0
- package/dist/node-runtime/runtime-bridges-3CQHWVVY.js +21 -0
- package/dist/node-runtime/service-HGGU3STY.js +36 -0
- package/dist/node-runtime/session-handoff-IAFIK7QP.js +33 -0
- package/dist/node-runtime/{session-manager-QEMZBMTM.js → session-manager-TCEFDKBL.js} +2 -1
- package/dist/node-runtime/{session-selector-URVJLOTK.js → session-selector-HG5J4BDZ.js} +5 -4
- package/dist/node-runtime/{settings-manager-K6IPIQTI.js → settings-manager-HIBIUNBK.js} +13 -5
- package/dist/node-runtime/setup-JBKOLJ6F.js +18 -0
- package/dist/node-runtime/setup-YU5LKRL3.js +215 -0
- package/dist/node-runtime/{subagent-executor-EFLTO32A.js → subagent-executor-2BH76MMS.js} +242 -314
- package/dist/node-runtime/theme-WTJWZSGD.js +68 -0
- package/dist/node-runtime/trust-manager-6ZQANSBX.js +17 -0
- package/dist/node-runtime/{update-cli-I6OVDRPL.js → update-cli-TVTPVUNM.js} +7 -3
- package/dist/node-runtime/usage-service-LFB2SWYV.js +37 -0
- package/dist/node-runtime/{video-extract-ETA5RA7U.js → video-extract-OOZHR7SU.js} +2 -2
- package/dist/node-runtime/workflow-TVJNKKQP.js +509 -0
- package/dist/node-runtime/{youtube-extract-SRVGNN26.js → youtube-extract-FNPAUNHU.js} +6 -6
- package/dist/startup/interactive-view.d.ts.map +1 -1
- package/dist/startup/interactive-view.js +5 -1
- package/dist/startup/interactive-view.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts +2 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js +10 -0
- package/dist/utils/image-resize-core.js.map +1 -1
- package/docs/browser.md +86 -0
- package/docs/computer-use.md +319 -268
- package/docs/extensions.md +2 -0
- package/docs/features.md +129 -30
- package/docs/index.md +1 -1
- package/docs/interactive-startup.md +2 -1
- package/docs/keybindings.md +4 -2
- package/docs/providers.md +6 -2
- package/docs/quickstart.md +2 -2
- package/docs/sessions.md +10 -0
- package/docs/settings.md +6 -3
- package/docs/tui.md +2 -0
- package/docs/usage.md +20 -4
- 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/plan-mode/README.md +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 +39 -25
- package/install-lock/package.json +2 -2
- package/npm-shrinkwrap.json +36 -22
- package/package.json +10 -7
- package/scripts/install-browser.mjs +20 -0
- 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/agent-session-services-RSGP5GDN.js +0 -39
- package/dist/node-runtime/chunk-EH2LJQPM.js +0 -64
- package/dist/node-runtime/chunk-HQCKFM2O.js +0 -56
- package/dist/node-runtime/chunk-JT6YCS5B.js +0 -5648
- package/dist/node-runtime/command-6UXQ6XZN.js +0 -13
- package/dist/node-runtime/gateway-3OLC4GQN.js +0 -2139
- package/dist/node-runtime/image-resize-6ZPBFMWW.js +0 -11
- package/dist/node-runtime/interactive-mode-S5M26CQ7.js +0 -59
- package/dist/node-runtime/lunr-computer-use-4X3KUNF4.js +0 -206
- package/dist/node-runtime/runtime-bridges-UJ5WJJLN.js +0 -14
- package/dist/node-runtime/workflow-SA34S4VX.js +0 -325
- package/dist/node-runtime/{chunk-U6C7VTR5.js → chunk-7IQGBKBJ.js} +3 -3
- package/dist/node-runtime/{mcp-panel-IIGMXQGP.js → mcp-panel-KTTFXJZ4.js} +3 -3
- package/dist/node-runtime/{src-GPFAU3N6.js → src-IVPNZ2BX.js} +6 -6
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
ASYNC_DIR,
|
|
4
4
|
CHAIN_RUNS_DIR,
|
|
5
5
|
DEFAULT_ARTIFACT_CONFIG,
|
|
6
|
-
DEFAULT_CONTROL_CONFIG,
|
|
7
6
|
DEFAULT_FORK_PREAMBLE,
|
|
8
7
|
DEFAULT_GLOBAL_CONCURRENCY_LIMIT,
|
|
9
8
|
DEFAULT_MAX_OUTPUT,
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
PI_CODING_AGENT_PACKAGE_ROOT_ENV,
|
|
15
14
|
RESULTS_DIR,
|
|
16
15
|
SUBAGENT_ACTIONS,
|
|
16
|
+
SUBAGENT_ASYNC_GUIDANCE,
|
|
17
17
|
SUBAGENT_ASYNC_STARTED_EVENT,
|
|
18
18
|
SUBAGENT_CONTROL_EVENT,
|
|
19
19
|
SUBAGENT_CONTROL_INTERCOM_EVENT,
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
|
|
22
22
|
Semaphore,
|
|
23
23
|
TEMP_ROOT_DIR,
|
|
24
|
-
THINKING_LEVELS,
|
|
25
24
|
acceptChildWatchdogEvent,
|
|
26
25
|
acceptanceFailureMessage,
|
|
27
26
|
aggregateAcceptanceReport,
|
|
@@ -30,12 +29,10 @@ import {
|
|
|
30
29
|
appendTurnBudgetSystemPrompt,
|
|
31
30
|
applyIntercomBridgeToAgent,
|
|
32
31
|
applyThinkingSuffix,
|
|
33
|
-
assertSafeNestedId,
|
|
34
32
|
attachNestedChildrenToResultChildren,
|
|
35
33
|
attachRootChildrenToSteps,
|
|
36
34
|
buildChainInstructions,
|
|
37
35
|
buildChainSummary,
|
|
38
|
-
buildControlEvent,
|
|
39
36
|
buildModelCandidates,
|
|
40
37
|
buildPiArgs,
|
|
41
38
|
buildRevivedAsyncTask,
|
|
@@ -47,7 +44,6 @@ import {
|
|
|
47
44
|
checkSubagentDepth,
|
|
48
45
|
childRowLabel,
|
|
49
46
|
childWatchdogIsActive,
|
|
50
|
-
claimControlNotification,
|
|
51
47
|
cleanupTempDir,
|
|
52
48
|
clearPendingForegroundControlNotices,
|
|
53
49
|
compactForegroundDetails,
|
|
@@ -60,7 +56,6 @@ import {
|
|
|
60
56
|
deliverStopRequest,
|
|
61
57
|
deliverSubagentIntercomMessageEvent,
|
|
62
58
|
deliverSubagentResultIntercomEvent,
|
|
63
|
-
deriveActivityState,
|
|
64
59
|
detectSubagentError,
|
|
65
60
|
diagnoseIntercomBridge,
|
|
66
61
|
discoverAvailableSkills,
|
|
@@ -69,11 +64,9 @@ import {
|
|
|
69
64
|
expectsImplementationMutation,
|
|
70
65
|
extractTextFromContent,
|
|
71
66
|
extractToolArgsPreview,
|
|
72
|
-
findAsyncRunPrefixMatches,
|
|
73
67
|
findLatestSessionFile,
|
|
74
68
|
findModelInfo,
|
|
75
69
|
findNestedRouteForRootId,
|
|
76
|
-
findNestedRunMatchesById,
|
|
77
70
|
flatToLogicalStepIndex,
|
|
78
71
|
formatAcceptancePrompt,
|
|
79
72
|
formatActivityLabel,
|
|
@@ -82,8 +75,6 @@ import {
|
|
|
82
75
|
formatAsyncRunOutputPath,
|
|
83
76
|
formatAsyncRunProgressLabel,
|
|
84
77
|
formatAsyncRunTranscript,
|
|
85
|
-
formatControlIntercomMessage,
|
|
86
|
-
formatControlNoticeMessage,
|
|
87
78
|
formatModelAttemptNote,
|
|
88
79
|
formatModelSelection,
|
|
89
80
|
formatNestedRunStatusLines,
|
|
@@ -116,7 +107,6 @@ import {
|
|
|
116
107
|
normalizeChildSpec,
|
|
117
108
|
normalizeParallelGroups,
|
|
118
109
|
normalizeSkillInput,
|
|
119
|
-
parseWatchdogThinkingInput,
|
|
120
110
|
projectNestedRegistryForRoot,
|
|
121
111
|
readChildToolDiagnosticError,
|
|
122
112
|
readNestedControlResults,
|
|
@@ -134,12 +124,12 @@ import {
|
|
|
134
124
|
resolveChildExcludeTools,
|
|
135
125
|
resolveChildMaxSubagentDepth,
|
|
136
126
|
resolveChildWatchdogConfig,
|
|
137
|
-
resolveControlConfig,
|
|
138
127
|
resolveCurrentMaxSubagentDepth,
|
|
139
128
|
resolveCurrentSessionId,
|
|
140
129
|
resolveEffectiveAcceptance,
|
|
141
130
|
resolveEffectiveSubagentModel,
|
|
142
131
|
resolveEffectiveThinking,
|
|
132
|
+
resolveExecutableChildModel,
|
|
143
133
|
resolveInheritedNestedRouteFromEnv,
|
|
144
134
|
resolveIntercomBridge,
|
|
145
135
|
resolveIntercomSessionTarget,
|
|
@@ -148,22 +138,24 @@ import {
|
|
|
148
138
|
resolveNestedAsyncDir,
|
|
149
139
|
resolveNestedParentAddressFromEnv,
|
|
150
140
|
resolveParallelBehaviors,
|
|
151
|
-
resolveRequiredTierModel,
|
|
152
141
|
resolveSkillsWithFallback,
|
|
153
142
|
resolveStepBehavior,
|
|
154
143
|
resolveSubagentIntercomTarget,
|
|
144
|
+
resolveSubagentRequestParams,
|
|
155
145
|
resolveSubagentResultStatus,
|
|
146
|
+
resolveSubagentRunId,
|
|
156
147
|
resolveTopLevelParallelConcurrency,
|
|
157
148
|
resolveTopLevelParallelMaxTasks,
|
|
158
149
|
resolveTurnBudgetConfig,
|
|
159
150
|
resolveWatchdogConfig,
|
|
160
151
|
resolveWatchdogModelInput,
|
|
152
|
+
restorePersistedAcceptance,
|
|
161
153
|
shouldAbortForTurnBudget,
|
|
162
|
-
shouldNotifyControlEvent,
|
|
163
154
|
splitKnownThinkingSuffix,
|
|
164
155
|
splitThinkingSuffix,
|
|
165
156
|
stripAcceptanceReport,
|
|
166
157
|
stripDetailsOutputsForIntercomReceipt,
|
|
158
|
+
subagentLaunchRunsAsync,
|
|
167
159
|
sumResultsCost,
|
|
168
160
|
sumResultsUsage,
|
|
169
161
|
suppressProgressForReadOnlyTask,
|
|
@@ -186,38 +178,58 @@ import {
|
|
|
186
178
|
writeMetadata,
|
|
187
179
|
writeNestedControlRequest,
|
|
188
180
|
writeNestedEvent,
|
|
189
|
-
writePrivateAtomicJson
|
|
190
|
-
|
|
191
|
-
|
|
181
|
+
writePrivateAtomicJson
|
|
182
|
+
} from "./chunk-DRJI7ZSC.js";
|
|
183
|
+
import {
|
|
184
|
+
DEFAULT_CONTROL_CONFIG,
|
|
185
|
+
buildControlEvent,
|
|
186
|
+
claimControlNotification,
|
|
187
|
+
deriveActivityState,
|
|
188
|
+
formatControlIntercomMessage,
|
|
189
|
+
formatControlNoticeMessage,
|
|
190
|
+
resolveControlConfig,
|
|
191
|
+
shouldNotifyControlEvent
|
|
192
|
+
} from "./chunk-OAR4TYZE.js";
|
|
192
193
|
import {
|
|
193
|
-
|
|
194
|
+
READ_ONLY_WRITE_SPAWN_ERROR,
|
|
194
195
|
resolveChildPermissions,
|
|
195
196
|
snapshotParentPermissionMode
|
|
196
|
-
} from "./chunk-
|
|
197
|
-
import "./chunk-
|
|
197
|
+
} from "./chunk-RVOQBXTA.js";
|
|
198
|
+
import "./chunk-33SIKK3Y.js";
|
|
198
199
|
import "./chunk-53YJI7JU.js";
|
|
199
|
-
import "./chunk-
|
|
200
|
-
import "./chunk-
|
|
201
|
-
import "./chunk-
|
|
202
|
-
import
|
|
200
|
+
import "./chunk-3DKIWPKN.js";
|
|
201
|
+
import "./chunk-XHIRAZ26.js";
|
|
202
|
+
import "./chunk-5Q4A37RB.js";
|
|
203
|
+
import {
|
|
204
|
+
subagentCommunicationEnabled
|
|
205
|
+
} from "./chunk-EOEAQIJV.js";
|
|
206
|
+
import "./chunk-L5LZUGT7.js";
|
|
207
|
+
import "./chunk-2CMV4L24.js";
|
|
208
|
+
import "./chunk-URD2SLIT.js";
|
|
209
|
+
import "./chunk-AJ6R5VTV.js";
|
|
203
210
|
import "./chunk-M3LZLQW2.js";
|
|
204
|
-
import "./chunk-
|
|
211
|
+
import "./chunk-3ONQTOMR.js";
|
|
212
|
+
import "./chunk-2BLXLDJR.js";
|
|
213
|
+
import "./chunk-ZCHMJ34K.js";
|
|
205
214
|
import {
|
|
206
215
|
SessionManager
|
|
207
|
-
} from "./chunk-
|
|
216
|
+
} from "./chunk-VIVYOI7C.js";
|
|
208
217
|
import "./chunk-FVDOXRUD.js";
|
|
209
|
-
import "./chunk-
|
|
218
|
+
import "./chunk-UJOCPOMX.js";
|
|
219
|
+
import "./chunk-IMLCWLPI.js";
|
|
220
|
+
import "./chunk-UAEOTO52.js";
|
|
210
221
|
import "./chunk-RQ2Q5IYR.js";
|
|
211
|
-
import "./chunk-
|
|
212
|
-
import "./chunk-
|
|
222
|
+
import "./chunk-O2AT4MEU.js";
|
|
223
|
+
import "./chunk-N4TUWAGA.js";
|
|
224
|
+
import "./chunk-PLGA743X.js";
|
|
213
225
|
import "./chunk-PCIGF2XK.js";
|
|
214
226
|
import "./chunk-Q4Q6D4IY.js";
|
|
215
227
|
import "./chunk-BRJX2PRC.js";
|
|
216
228
|
|
|
217
229
|
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js
|
|
218
230
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
219
|
-
import * as
|
|
220
|
-
import * as
|
|
231
|
+
import * as fs15 from "node:fs";
|
|
232
|
+
import * as path15 from "node:path";
|
|
221
233
|
|
|
222
234
|
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.js
|
|
223
235
|
import { matchesKey, visibleWidth, truncateToWidth } from "@ashx-j/lunr-tui";
|
|
@@ -900,34 +912,6 @@ var ChainClarifyComponent = class {
|
|
|
900
912
|
}
|
|
901
913
|
};
|
|
902
914
|
|
|
903
|
-
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js
|
|
904
|
-
var LAUNCH_COMPATIBLE_ACTIONS = /* @__PURE__ */ new Set(["schedule", "append-step", "resume", "steer"]);
|
|
905
|
-
function omitExecutionModeActionAlias(params) {
|
|
906
|
-
let action = params.action?.toLowerCase();
|
|
907
|
-
if (action === "single" && params.task !== void 0) {
|
|
908
|
-
let rest = { ...params };
|
|
909
|
-
return delete rest.action, rest;
|
|
910
|
-
}
|
|
911
|
-
if ((action === "parallel" || action === "tasks") && (params.tasks?.length ?? 0) > 0) {
|
|
912
|
-
let rest = { ...params };
|
|
913
|
-
return delete rest.action, rest;
|
|
914
|
-
}
|
|
915
|
-
return params;
|
|
916
|
-
}
|
|
917
|
-
function hasLaunchFields(params) {
|
|
918
|
-
return params.task !== void 0 || Array.isArray(params.tasks) && params.tasks.length > 0 || Array.isArray(params.chain) && params.chain.length > 0;
|
|
919
|
-
}
|
|
920
|
-
function omitConflictingControlAction(params) {
|
|
921
|
-
let action = params.action?.toLowerCase();
|
|
922
|
-
if (!action || LAUNCH_COMPATIBLE_ACTIONS.has(action) || !hasLaunchFields(params))
|
|
923
|
-
return params;
|
|
924
|
-
let rest = { ...params };
|
|
925
|
-
return delete rest.action, typeof rest.task == "string" && rest.task.length > 0 && (delete rest.tasks, delete rest.chain), rest;
|
|
926
|
-
}
|
|
927
|
-
function resolveSubagentRequestParams(params) {
|
|
928
|
-
return omitConflictingControlAction(omitExecutionModeActionAlias(params));
|
|
929
|
-
}
|
|
930
|
-
|
|
931
915
|
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js
|
|
932
916
|
import * as fs7 from "node:fs";
|
|
933
917
|
import * as path6 from "node:path";
|
|
@@ -1229,7 +1213,7 @@ function hasMutationToolCall(messages) {
|
|
|
1229
1213
|
return !1;
|
|
1230
1214
|
}
|
|
1231
1215
|
function evaluateCompletionMutationGuard(input) {
|
|
1232
|
-
let expectedMutation = hasMutationToolCapability(input.tools, input.mcpDirectTools) ? expectsImplementationMutation(input.
|
|
1216
|
+
let expectedMutation = hasMutationToolCapability(input.tools, input.mcpDirectTools) ? expectsImplementationMutation(input.permissions, input.task) : !1, attemptedMutation = hasMutationToolCall(input.messages);
|
|
1233
1217
|
return {
|
|
1234
1218
|
expectedMutation,
|
|
1235
1219
|
attemptedMutation,
|
|
@@ -1262,20 +1246,20 @@ function resolvePiPackageRoot() {
|
|
|
1262
1246
|
return;
|
|
1263
1247
|
}
|
|
1264
1248
|
}
|
|
1265
|
-
function isRunnableNodeScript(filePath,
|
|
1266
|
-
return
|
|
1249
|
+
function isRunnableNodeScript(filePath, existsSync11) {
|
|
1250
|
+
return existsSync11(filePath) ? /\.(?:mjs|cjs|js)$/i.test(filePath) : !1;
|
|
1267
1251
|
}
|
|
1268
1252
|
function normalizePath(filePath) {
|
|
1269
1253
|
return path2.isAbsolute(filePath) ? filePath : path2.resolve(filePath);
|
|
1270
1254
|
}
|
|
1271
1255
|
function resolvePiCliScript(deps = {}) {
|
|
1272
|
-
let
|
|
1256
|
+
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];
|
|
1273
1257
|
if (argv1) {
|
|
1274
1258
|
let argvPath = normalizePath(argv1);
|
|
1275
|
-
if (isRunnableNodeScript(argvPath,
|
|
1259
|
+
if (isRunnableNodeScript(argvPath, existsSync11))
|
|
1276
1260
|
try {
|
|
1277
1261
|
let canonicalArgvPath = realpathSync5(argvPath);
|
|
1278
|
-
if (isRunnableNodeScript(canonicalArgvPath,
|
|
1262
|
+
if (isRunnableNodeScript(canonicalArgvPath, existsSync11) && findPiPackageRootFromEntry(canonicalArgvPath))
|
|
1279
1263
|
return canonicalArgvPath;
|
|
1280
1264
|
} catch {
|
|
1281
1265
|
}
|
|
@@ -1293,7 +1277,7 @@ function resolvePiCliScript(deps = {}) {
|
|
|
1293
1277
|
if (!binPath)
|
|
1294
1278
|
return;
|
|
1295
1279
|
let candidate = path2.resolve(path2.dirname(packageJsonPath), binPath);
|
|
1296
|
-
if (isRunnableNodeScript(candidate,
|
|
1280
|
+
if (isRunnableNodeScript(candidate, existsSync11))
|
|
1297
1281
|
return candidate;
|
|
1298
1282
|
} catch {
|
|
1299
1283
|
return;
|
|
@@ -1716,6 +1700,7 @@ async function runSingleAttempt(runtimeCwd, spec, task, model, options, shared)
|
|
|
1716
1700
|
inheritSkills: !1,
|
|
1717
1701
|
requireReadTool: !!shared.resolvedSkillNames?.length,
|
|
1718
1702
|
excludeTools,
|
|
1703
|
+
communicationEnabled: options.communicationEnabled,
|
|
1719
1704
|
childPermission: spec.effectivePermissions,
|
|
1720
1705
|
childId: spec.childId,
|
|
1721
1706
|
childDescription: spec.description,
|
|
@@ -2166,7 +2151,7 @@ ${fullOutput}` : timeoutMessage;
|
|
|
2166
2151
|
${fullOutput}` : note;
|
|
2167
2152
|
}
|
|
2168
2153
|
if ((result2.exitCode === 0 && !result2.error ? evaluateCompletionMutationGuard({
|
|
2169
|
-
|
|
2154
|
+
permissions: spec.effectivePermissions,
|
|
2170
2155
|
task: shared.originalTask ?? task,
|
|
2171
2156
|
messages: result2.messages,
|
|
2172
2157
|
tools: spec.effectivePermissions === "read-only" ? ["read", "grep", "find", "ls", "bash"] : void 0
|
|
@@ -2201,7 +2186,7 @@ It appears to have returned planning or scratchpad output instead of applying ch
|
|
|
2201
2186
|
async function runSync(runtimeCwd, spec, options) {
|
|
2202
2187
|
let task = spec.task, label = childRowLabel(spec), parentMode = snapshotParentPermissionMode(options.parentSessionId), resolvedPermissions = resolveChildPermissions(parentMode, spec.requestedPermissions);
|
|
2203
2188
|
if (!resolvedPermissions.ok) {
|
|
2204
|
-
let error = resolvedPermissions.error ||
|
|
2189
|
+
let error = resolvedPermissions.error || READ_ONLY_WRITE_SPAWN_ERROR;
|
|
2205
2190
|
return {
|
|
2206
2191
|
childId: spec.childId,
|
|
2207
2192
|
description: spec.description,
|
|
@@ -3296,10 +3281,13 @@ function resolveChainToolBudget(input) {
|
|
|
3296
3281
|
return { toolBudget: resolved.budget, error: resolved.error };
|
|
3297
3282
|
}
|
|
3298
3283
|
async function runParallelChainTasks(input) {
|
|
3299
|
-
let concurrency = input.step.concurrency ?? MAX_CONCURRENCY, failFast = input.step.failFast ?? !1, aborted = !1, effectiveModels = input.step.parallel.map((task) => {
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3284
|
+
let concurrency = input.step.concurrency ?? MAX_CONCURRENCY, failFast = input.step.failFast ?? !1, aborted = !1, effectiveModels = input.step.parallel.map((task) => resolveExecutableChildModel({
|
|
3285
|
+
model: task.model,
|
|
3286
|
+
tier: task.tier,
|
|
3287
|
+
thinking: task.thinking,
|
|
3288
|
+
availableModels: input.availableModels,
|
|
3289
|
+
preferredProvider: input.ctx.model?.provider
|
|
3290
|
+
}));
|
|
3303
3291
|
for (let taskIndex = 0; taskIndex < input.step.parallel.length; taskIndex++) {
|
|
3304
3292
|
let task = input.step.parallel[taskIndex];
|
|
3305
3293
|
input.sessionFileForTask?.(task.agent, input.globalTaskIndex + taskIndex, effectiveModels[taskIndex]);
|
|
@@ -3329,9 +3317,10 @@ async function runParallelChainTasks(input) {
|
|
|
3329
3317
|
task: taskStr,
|
|
3330
3318
|
description: task.description,
|
|
3331
3319
|
permissions: task.permissions,
|
|
3332
|
-
model:
|
|
3320
|
+
model: task.model,
|
|
3333
3321
|
tier: task.tier,
|
|
3334
|
-
|
|
3322
|
+
thinking: task.thinking,
|
|
3323
|
+
modelSelection: captureModelSelection({ model: task.model, tier: task.tier }),
|
|
3335
3324
|
skill: task.skill,
|
|
3336
3325
|
cwd: taskCwd,
|
|
3337
3326
|
output: task.output,
|
|
@@ -3360,6 +3349,7 @@ async function runParallelChainTasks(input) {
|
|
|
3360
3349
|
onControlEvent: input.onControlEvent,
|
|
3361
3350
|
intercomSessionName: input.childIntercomTarget?.(task.agent, input.globalTaskIndex + taskIndex),
|
|
3362
3351
|
orchestratorIntercomTarget: input.orchestratorIntercomTarget,
|
|
3352
|
+
communicationEnabled: input.communicationEnabled,
|
|
3363
3353
|
nestedRoute: input.nestedRoute,
|
|
3364
3354
|
modelOverride: effectiveModel,
|
|
3365
3355
|
availableModels: input.availableModels,
|
|
@@ -3409,7 +3399,7 @@ async function runParallelChainTasks(input) {
|
|
|
3409
3399
|
}, input.globalSemaphore);
|
|
3410
3400
|
}
|
|
3411
3401
|
async function executeChain(params) {
|
|
3412
|
-
let { chain: chainSteps, agents, ctx, signal, runId, cwd, shareEnabled, sessionDirForIndex, sessionFileForIndex, sessionFileForTask, thinkingOverrideForTask, artifactsDir, artifactConfig, includeProgress, clarify, onUpdate, onControlEvent, controlConfig, onDetachedExit, childIntercomTarget, orchestratorIntercomTarget, foregroundControl, intercomEvents, chainSkills: chainSkillsParam, chainDir: chainDirBase, modelScope } = params, chainSkills = chainSkillsParam ?? [], results = [], outputs = {}, dynamicChildren = {}, dynamicGroupStatuses = {}, allProgress = [], allArtifactPaths = [], chainAgents = chainSteps.map((step) => isParallelStep(step) ? `[${step.parallel.map((t) => t.description || t.label || t.agent || "child").join("+")}]` : isDynamicParallelStep(step) ? `expand:${step.parallel.description || step.parallel.label || step.parallel.agent || "child"}` : step.description || step.label || step.agent || "child"), totalSteps = chainSteps.length, makeDetailsInput = (overrides = {}) => ({
|
|
3402
|
+
let { chain: chainSteps, agents, ctx, signal, runId, cwd, shareEnabled, sessionDirForIndex, sessionFileForIndex, sessionFileForTask, thinkingOverrideForTask, artifactsDir, artifactConfig, includeProgress, clarify, onUpdate, onControlEvent, controlConfig, onDetachedExit, childIntercomTarget, orchestratorIntercomTarget, communicationEnabled, foregroundControl, intercomEvents, chainSkills: chainSkillsParam, chainDir: chainDirBase, modelScope } = params, chainSkills = chainSkillsParam ?? [], results = [], outputs = {}, dynamicChildren = {}, dynamicGroupStatuses = {}, allProgress = [], allArtifactPaths = [], chainAgents = chainSteps.map((step) => isParallelStep(step) ? `[${step.parallel.map((t) => t.description || t.label || t.agent || "child").join("+")}]` : isDynamicParallelStep(step) ? `expand:${step.parallel.description || step.parallel.label || step.parallel.agent || "child"}` : step.description || step.label || step.agent || "child"), totalSteps = chainSteps.length, makeDetailsInput = (overrides = {}) => ({
|
|
3413
3403
|
results,
|
|
3414
3404
|
...includeProgress !== void 0 ? { includeProgress } : {},
|
|
3415
3405
|
allProgress,
|
|
@@ -3553,6 +3543,7 @@ async function executeChain(params) {
|
|
|
3553
3543
|
onControlEvent,
|
|
3554
3544
|
childIntercomTarget,
|
|
3555
3545
|
orchestratorIntercomTarget,
|
|
3546
|
+
communicationEnabled,
|
|
3556
3547
|
foregroundControl,
|
|
3557
3548
|
nestedRoute: params.nestedRoute,
|
|
3558
3549
|
worktreeSetup,
|
|
@@ -3724,6 +3715,7 @@ ${failureSummary}`;
|
|
|
3724
3715
|
onControlEvent,
|
|
3725
3716
|
childIntercomTarget,
|
|
3726
3717
|
orchestratorIntercomTarget,
|
|
3718
|
+
communicationEnabled,
|
|
3727
3719
|
foregroundControl,
|
|
3728
3720
|
nestedRoute: params.nestedRoute,
|
|
3729
3721
|
maxSubagentDepth: params.maxSubagentDepth,
|
|
@@ -3836,7 +3828,13 @@ ${failureSummary}`;
|
|
|
3836
3828
|
stepTask = stepTask.replace(/\{task\}/g, originalTask), stepTask = stepTask.replace(/\{previous\}/g, prev), stepTask = stepTask.replace(/\{chain_dir\}/g, chainDir);
|
|
3837
3829
|
let cleanTask = stepTask;
|
|
3838
3830
|
stepTask = prefix + stepTask + suffix;
|
|
3839
|
-
let effectiveModel =
|
|
3831
|
+
let effectiveModel = resolveExecutableChildModel({
|
|
3832
|
+
model: seqStep.model,
|
|
3833
|
+
tier: seqStep.tier,
|
|
3834
|
+
thinking: seqStep.thinking,
|
|
3835
|
+
availableModels,
|
|
3836
|
+
preferredProvider: ctx.model?.provider
|
|
3837
|
+
}), outputPath = typeof behavior.output == "string" ? path6.isAbsolute(behavior.output) ? behavior.output : path6.join(chainDir, behavior.output) : void 0;
|
|
3840
3838
|
stepTask = injectSingleOutputInstruction(stepTask, outputPath, agentConfig);
|
|
3841
3839
|
let validationError = validateFileOnlyOutputMode(behavior.outputMode, outputPath, `Chain step ${stepIndex + 1} (${seqStep.agent})`);
|
|
3842
3840
|
if (validationError)
|
|
@@ -3865,9 +3863,10 @@ ${failureSummary}`;
|
|
|
3865
3863
|
task: stepTask,
|
|
3866
3864
|
description: seqStep.description,
|
|
3867
3865
|
permissions: seqStep.permissions,
|
|
3868
|
-
model:
|
|
3866
|
+
model: seqStep.model,
|
|
3869
3867
|
tier: seqStep.tier,
|
|
3870
|
-
|
|
3868
|
+
thinking: seqStep.thinking,
|
|
3869
|
+
modelSelection: captureModelSelection({ model: seqStep.model, tier: seqStep.tier }),
|
|
3871
3870
|
skill: seqStep.skill,
|
|
3872
3871
|
cwd: seqStep.cwd,
|
|
3873
3872
|
output: seqStep.output,
|
|
@@ -3896,6 +3895,7 @@ ${failureSummary}`;
|
|
|
3896
3895
|
onControlEvent,
|
|
3897
3896
|
intercomSessionName: childIntercomTarget?.(seqStep.agent, childIndex),
|
|
3898
3897
|
orchestratorIntercomTarget,
|
|
3898
|
+
communicationEnabled,
|
|
3899
3899
|
nestedRoute: params.nestedRoute,
|
|
3900
3900
|
modelOverride: effectiveModel,
|
|
3901
3901
|
availableModels,
|
|
@@ -4028,9 +4028,8 @@ function formatAsyncStartedMessage(headline) {
|
|
|
4028
4028
|
return [
|
|
4029
4029
|
headline,
|
|
4030
4030
|
"",
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
'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.'
|
|
4031
|
+
SUBAGENT_ASYNC_GUIDANCE,
|
|
4032
|
+
'For one-time inspection or recovery of a blocked or stale run, use subagent({ action: "status", id: "..." }).'
|
|
4034
4033
|
].join(`
|
|
4035
4034
|
`);
|
|
4036
4035
|
}
|
|
@@ -4156,6 +4155,7 @@ function spawnRunner(cfg, suffix, cwd) {
|
|
|
4156
4155
|
windowsHide: !0,
|
|
4157
4156
|
env: {
|
|
4158
4157
|
...process.env,
|
|
4158
|
+
PI_SUBAGENT_COMMUNICATION_ENABLED: cfg.communicationEnabled ?? subagentCommunicationEnabled(cwd) ? "1" : "0",
|
|
4159
4159
|
...piPackageRoot ? { [PI_CODING_AGENT_PACKAGE_ROOT_ENV]: piPackageRoot } : {}
|
|
4160
4160
|
}
|
|
4161
4161
|
});
|
|
@@ -4266,7 +4266,14 @@ ${injection}` : injection;
|
|
|
4266
4266
|
taskTemplate = taskTemplate.replace(/\{task\}/g, originalTask ?? ""), taskTemplate = taskTemplate.replace(/\{chain_dir\}/g, runnerCwd);
|
|
4267
4267
|
let taskText = `${readInstructions.prefix}${taskTemplate}${progressInstructions.suffix}`, task = namespaceOutputPath ? taskText : injectSingleOutputInstruction(taskText, outputPath, {
|
|
4268
4268
|
tools: spec.effectivePermissions === "read-only" ? ["read", "grep", "find", "ls", "bash"] : void 0
|
|
4269
|
-
}), primaryModel =
|
|
4269
|
+
}), primaryModel = resolveExecutableChildModel({
|
|
4270
|
+
modelSelection: spec.modelSelection,
|
|
4271
|
+
model: spec.model,
|
|
4272
|
+
tier: spec.tier,
|
|
4273
|
+
thinking: spec.thinking,
|
|
4274
|
+
availableModels,
|
|
4275
|
+
preferredProvider: ctx.currentModelProvider
|
|
4276
|
+
}), thinkingOverride = flatIndex === void 0 ? void 0 : thinkingOverridesByFlatIndex?.[flatIndex], effectiveThinking = thinkingOverride, model = applyThinkingSuffix(primaryModel, effectiveThinking, thinkingOverride !== void 0);
|
|
4270
4277
|
return {
|
|
4271
4278
|
parentSessionId: ctx.parentSessionId ?? ctx.currentSessionId,
|
|
4272
4279
|
parentPermissionMode: snapshotParentPermissionMode(ctx.parentSessionId ?? ctx.currentSessionId),
|
|
@@ -4465,6 +4472,7 @@ function executeAsyncChain(id, params) {
|
|
|
4465
4472
|
worktreeSetupHookTimeoutMs,
|
|
4466
4473
|
worktreeBaseDir,
|
|
4467
4474
|
controlConfig,
|
|
4475
|
+
communicationEnabled: params.communicationEnabled,
|
|
4468
4476
|
turnBudget: params.turnBudget,
|
|
4469
4477
|
toolBudget: params.toolBudget,
|
|
4470
4478
|
controlIntercomTarget,
|
|
@@ -4558,6 +4566,16 @@ function executeAsyncChain(id, params) {
|
|
|
4558
4566
|
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 } : {} }
|
|
4559
4567
|
};
|
|
4560
4568
|
}
|
|
4569
|
+
function resolveAsyncSingleAcceptance(input) {
|
|
4570
|
+
return input.restoredAcceptance ? input.restoredAcceptance : resolveEffectiveAcceptance({
|
|
4571
|
+
explicit: input.launchAcceptance,
|
|
4572
|
+
agentName: input.agentName,
|
|
4573
|
+
permissions: input.permissions,
|
|
4574
|
+
task: input.task,
|
|
4575
|
+
mode: "single",
|
|
4576
|
+
async: !0
|
|
4577
|
+
});
|
|
4578
|
+
}
|
|
4561
4579
|
function executeAsyncSingle(id, params) {
|
|
4562
4580
|
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);
|
|
4563
4581
|
if (missingSkills.includes("pi-subagents"))
|
|
@@ -4585,19 +4603,25 @@ ${injection}` : injection;
|
|
|
4585
4603
|
let outputMode = params.outputMode ?? spec.outputMode ?? "inline", validationError = validateFileOnlyOutputMode(outputMode, outputPath, `Async single run (${agent})`);
|
|
4586
4604
|
if (validationError)
|
|
4587
4605
|
return formatAsyncStartError("single", validationError);
|
|
4588
|
-
let taskWithOutputInstruction = injectSingleOutputInstruction(task, outputPath, childToolShape), primaryModel =
|
|
4606
|
+
let taskWithOutputInstruction = injectSingleOutputInstruction(task, outputPath, childToolShape), primaryModel = resolveExecutableChildModel({
|
|
4607
|
+
modelSelection: spec.modelSelection,
|
|
4608
|
+
model: spec.model,
|
|
4609
|
+
tier: spec.tier,
|
|
4610
|
+
thinking: spec.thinking,
|
|
4611
|
+
availableModels,
|
|
4612
|
+
preferredProvider: ctx.currentModelProvider
|
|
4613
|
+
}), 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");
|
|
4589
4614
|
if (resolvedToolBudget.error)
|
|
4590
4615
|
return formatAsyncStartError("single", resolvedToolBudget.error);
|
|
4591
4616
|
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;
|
|
4592
4617
|
if (timeoutMs !== void 0 && timeoutMs <= 0)
|
|
4593
4618
|
return formatAsyncStartError("single", "The source run's absolute deadline expired before recovery could launch.");
|
|
4594
|
-
let initialTurnBudget = params.turnBudget ? initialTurnBudgetState(params.turnBudget) : void 0, resolvedSessionDir = params.sessionDir ?? (sessionRoot ? path7.join(sessionRoot, `async-${id}`) : void 0), resolvedAcceptance =
|
|
4595
|
-
|
|
4619
|
+
let initialTurnBudget = params.turnBudget ? initialTurnBudgetState(params.turnBudget) : void 0, resolvedSessionDir = params.sessionDir ?? (sessionRoot ? path7.join(sessionRoot, `async-${id}`) : void 0), resolvedAcceptance = resolveAsyncSingleAcceptance({
|
|
4620
|
+
restoredAcceptance: params.restoredAcceptance,
|
|
4621
|
+
launchAcceptance: params.acceptance ?? spec.acceptance,
|
|
4596
4622
|
agentName: agent,
|
|
4597
4623
|
permissions: spec.effectivePermissions,
|
|
4598
|
-
task
|
|
4599
|
-
mode: "single",
|
|
4600
|
-
async: !0
|
|
4624
|
+
task
|
|
4601
4625
|
}), recoveryDescriptor = {
|
|
4602
4626
|
version: 4,
|
|
4603
4627
|
lifecycleArtifactVersion: SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
|
|
@@ -4609,8 +4633,8 @@ ${injection}` : injection;
|
|
|
4609
4633
|
...sessionFile ? { sessionFile } : {},
|
|
4610
4634
|
cwd: runnerCwd,
|
|
4611
4635
|
...model ? { model } : {},
|
|
4612
|
-
tier: spec.tier,
|
|
4613
|
-
...effectiveThinking ? { thinking: resolveEffectiveThinking(model, effectiveThinking) } : {},
|
|
4636
|
+
...spec.tier ? { tier: spec.tier } : {},
|
|
4637
|
+
...effectiveThinking || spec.thinking ? { thinking: resolveEffectiveThinking(model, effectiveThinking ?? spec.thinking) } : {},
|
|
4614
4638
|
...spec.modelSelection ? { modelSelection: spec.modelSelection } : {},
|
|
4615
4639
|
...resolvedSkills.length ? { skills: resolvedSkills.map((skill) => skill.name) } : {},
|
|
4616
4640
|
...outputPath ? { outputPath } : {},
|
|
@@ -4645,6 +4669,7 @@ ${injection}` : injection;
|
|
|
4645
4669
|
permissions: spec.effectivePermissions,
|
|
4646
4670
|
agent,
|
|
4647
4671
|
task: taskWithOutputInstruction,
|
|
4672
|
+
completionTask: params.completionTask ?? task,
|
|
4648
4673
|
cwd: runnerCwd,
|
|
4649
4674
|
model,
|
|
4650
4675
|
thinking: resolveEffectiveThinking(model, effectiveThinking),
|
|
@@ -4680,6 +4705,7 @@ ${injection}` : injection;
|
|
|
4680
4705
|
worktreeSetupHookTimeoutMs,
|
|
4681
4706
|
worktreeBaseDir,
|
|
4682
4707
|
controlConfig,
|
|
4708
|
+
communicationEnabled: params.communicationEnabled,
|
|
4683
4709
|
timeoutMs,
|
|
4684
4710
|
deadlineAt,
|
|
4685
4711
|
turnBudget: params.turnBudget,
|
|
@@ -4889,62 +4915,13 @@ function result(text, isError = !1) {
|
|
|
4889
4915
|
function messageFromError(error) {
|
|
4890
4916
|
return error instanceof Error ? error.message : String(error);
|
|
4891
4917
|
}
|
|
4892
|
-
function parseScope(raw) {
|
|
4893
|
-
if (raw === void 0 || raw === "session")
|
|
4894
|
-
return "session";
|
|
4895
|
-
if (raw === "user" || raw === "project")
|
|
4896
|
-
return raw;
|
|
4897
|
-
throw new Error("watchdog.configure scope must be 'session', 'user', or 'project'.");
|
|
4898
|
-
}
|
|
4899
|
-
function parseTarget(params) {
|
|
4900
|
-
let target = params.target ?? "main";
|
|
4901
|
-
if (target === "main")
|
|
4902
|
-
return { kind: "main" };
|
|
4903
|
-
if (target === "children")
|
|
4904
|
-
return { kind: "children" };
|
|
4905
|
-
if (target === "child") {
|
|
4906
|
-
if (!params.agent?.trim())
|
|
4907
|
-
throw new Error("watchdog.configure target='child' requires agent.");
|
|
4908
|
-
return { kind: "child", agent: params.agent.trim() };
|
|
4909
|
-
}
|
|
4910
|
-
throw new Error("watchdog.configure target must be 'main', 'children', or 'child'.");
|
|
4911
|
-
}
|
|
4912
|
-
function parseThinking(raw) {
|
|
4913
|
-
if (raw !== void 0)
|
|
4914
|
-
return raw === "inherit" ? null : parseWatchdogThinkingInput(raw, "watchdog.configure thinking") ?? void 0;
|
|
4915
|
-
}
|
|
4916
|
-
function resolveConfiguredValue(ctx, params) {
|
|
4917
|
-
let thinking = parseThinking(params.thinking), rawModel = params.model?.trim();
|
|
4918
|
-
if (!rawModel) {
|
|
4919
|
-
if (thinking === void 0)
|
|
4920
|
-
throw new Error("watchdog.configure requires model, thinking, or both.");
|
|
4921
|
-
return { thinking, description: `thinking ${thinking === null ? "inherit" : thinking === !1 ? "off" : thinking}` };
|
|
4922
|
-
}
|
|
4923
|
-
if (rawModel === "inherit")
|
|
4924
|
-
return { model: null, thinking: thinking ?? null, description: "inherit" };
|
|
4925
|
-
if (rawModel === "recommended") {
|
|
4926
|
-
let recommendation = recommendStrongWatchdogModel(ctx);
|
|
4927
|
-
return {
|
|
4928
|
-
model: recommendation.model,
|
|
4929
|
-
thinking: recommendation.thinking,
|
|
4930
|
-
description: `${recommendation.model}:${recommendation.thinking}`
|
|
4931
|
-
};
|
|
4932
|
-
}
|
|
4933
|
-
let resolved = resolveWatchdogModelInput(ctx, rawModel);
|
|
4934
|
-
return {
|
|
4935
|
-
model: resolved.model,
|
|
4936
|
-
thinking: resolved.thinking ?? thinking,
|
|
4937
|
-
description: `${resolved.model}${resolved.thinking ?? thinking ? `:${resolved.thinking ?? thinking}` : ""}`
|
|
4938
|
-
};
|
|
4939
|
-
}
|
|
4940
4918
|
function buildRecommendationText(ctx) {
|
|
4941
4919
|
let recommendation = recommendStrongWatchdogModel(ctx);
|
|
4942
4920
|
return [
|
|
4943
4921
|
"Subagent watchdog recommended model",
|
|
4944
4922
|
`Recommended: ${recommendation.model}:${recommendation.thinking}`,
|
|
4945
4923
|
`Reason: ${recommendation.reason}`,
|
|
4946
|
-
|
|
4947
|
-
'Persist with scope: "project" or scope: "user" only when the user asks for that scope.'
|
|
4924
|
+
"Watchdog settings are user-managed through /subagents-watchdog."
|
|
4948
4925
|
].join(`
|
|
4949
4926
|
`);
|
|
4950
4927
|
}
|
|
@@ -4971,44 +4948,14 @@ function buildCheckText(runtime, ctx) {
|
|
|
4971
4948
|
return lines.join(`
|
|
4972
4949
|
`);
|
|
4973
4950
|
}
|
|
4974
|
-
function handleWatchdogToolAction(action,
|
|
4951
|
+
function handleWatchdogToolAction(action, _params, ctx, runtime) {
|
|
4975
4952
|
try {
|
|
4976
|
-
|
|
4977
|
-
return runtime ? result(buildWatchdogStatus(runtime.getSnapshot(ctx.cwd), ctx)) : result("Subagent watchdog runtime is unavailable.", !0);
|
|
4978
|
-
if (action === "watchdog.recommend-model")
|
|
4979
|
-
return result(buildRecommendationText(ctx));
|
|
4980
|
-
if (action === "watchdog.check")
|
|
4981
|
-
return result(buildCheckText(runtime, ctx));
|
|
4982
|
-
if (action !== "watchdog.configure")
|
|
4983
|
-
return result(`Unknown watchdog action: ${action}`, !0);
|
|
4984
|
-
let scope = parseScope(params.scope), target = parseTarget(params), value = resolveConfiguredValue(ctx, params);
|
|
4985
|
-
if (scope === "session")
|
|
4986
|
-
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([
|
|
4987
|
-
`Subagent watchdog session model configured: ${value.description}.`,
|
|
4988
|
-
"No settings files were changed.",
|
|
4989
|
-
"",
|
|
4990
|
-
buildWatchdogStatus(runtime.getSnapshot(ctx.cwd), ctx)
|
|
4991
|
-
].join(`
|
|
4992
|
-
`))) : result("Subagent watchdog runtime is unavailable.", !0);
|
|
4993
|
-
let settingsPath = writeWatchdogModelSettings({
|
|
4994
|
-
scope,
|
|
4995
|
-
cwd: ctx.cwd,
|
|
4996
|
-
target,
|
|
4997
|
-
model: value.model,
|
|
4998
|
-
thinking: value.thinking
|
|
4999
|
-
});
|
|
5000
|
-
runtime?.refreshConfig(ctx.cwd);
|
|
5001
|
-
let targetLabel = target.kind === "child" ? `child ${target.agent}` : target.kind;
|
|
5002
|
-
return result([
|
|
5003
|
-
`Subagent watchdog ${targetLabel} model configured: ${value.description}.`,
|
|
5004
|
-
`Updated: ${settingsPath}`
|
|
5005
|
-
].join(`
|
|
5006
|
-
`));
|
|
4953
|
+
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);
|
|
5007
4954
|
} catch (error) {
|
|
5008
4955
|
return result(`Subagent watchdog action failed: ${messageFromError(error)}`, !0);
|
|
5009
4956
|
}
|
|
5010
4957
|
}
|
|
5011
|
-
var WATCHDOG_TOOL_ACTIONS = ["watchdog.status", "watchdog.check", "watchdog.
|
|
4958
|
+
var WATCHDOG_TOOL_ACTIONS = ["watchdog.status", "watchdog.check", "watchdog.recommend-model"];
|
|
5012
4959
|
|
|
5013
4960
|
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.js
|
|
5014
4961
|
import { randomUUID } from "node:crypto";
|
|
@@ -5490,81 +5437,11 @@ function resolveAsyncRootResultPath(resultsDir, runId) {
|
|
|
5490
5437
|
return path13.join(resultsDir, `${runId}.json`);
|
|
5491
5438
|
}
|
|
5492
5439
|
|
|
5493
|
-
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/background/run-
|
|
5440
|
+
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js
|
|
5494
5441
|
import * as fs14 from "node:fs";
|
|
5495
5442
|
import * as path14 from "node:path";
|
|
5496
|
-
function exactAsyncLocation(id, asyncDirRoot, resultsDir) {
|
|
5497
|
-
let asyncDir = path14.join(asyncDirRoot, id), resultPath = path14.join(resultsDir, `${id}.json`);
|
|
5498
|
-
if (!(!fs14.existsSync(asyncDir) && !fs14.existsSync(resultPath)))
|
|
5499
|
-
return {
|
|
5500
|
-
asyncDir: fs14.existsSync(asyncDir) ? asyncDir : null,
|
|
5501
|
-
resultPath: fs14.existsSync(resultPath) ? resultPath : null,
|
|
5502
|
-
resolvedId: id
|
|
5503
|
-
};
|
|
5504
|
-
}
|
|
5505
|
-
function foregroundIds(state) {
|
|
5506
|
-
if (!state)
|
|
5507
|
-
return [];
|
|
5508
|
-
let remembered = state.currentSessionId ? [...state.foregroundRuns?.values() ?? []].filter((run) => run.sessionId === state.currentSessionId).map((run) => run.runId) : [];
|
|
5509
|
-
return [.../* @__PURE__ */ new Set([...state.foregroundControls.keys(), ...remembered])];
|
|
5510
|
-
}
|
|
5511
|
-
function hasExactForegroundId(state, id) {
|
|
5512
|
-
if (!state)
|
|
5513
|
-
return !1;
|
|
5514
|
-
if (state.foregroundControls.has(id))
|
|
5515
|
-
return !0;
|
|
5516
|
-
let remembered = state.foregroundRuns?.get(id);
|
|
5517
|
-
return !!(remembered && state.currentSessionId && remembered.sessionId === state.currentSessionId);
|
|
5518
|
-
}
|
|
5519
|
-
function nestedScopeFromState(state) {
|
|
5520
|
-
if (!state)
|
|
5521
|
-
return;
|
|
5522
|
-
let routes = [], seen = /* @__PURE__ */ new Set(), add = (route) => {
|
|
5523
|
-
if (!route)
|
|
5524
|
-
return;
|
|
5525
|
-
let key = `${route.rootRunId}:${route.eventSink}:${route.controlInbox}`;
|
|
5526
|
-
seen.has(key) || (seen.add(key), routes.push(route));
|
|
5527
|
-
};
|
|
5528
|
-
for (let control of state.foregroundControls.values())
|
|
5529
|
-
add(control.nestedRoute);
|
|
5530
|
-
for (let job of state.asyncJobs.values())
|
|
5531
|
-
add(job.nestedRoute);
|
|
5532
|
-
return { routes };
|
|
5533
|
-
}
|
|
5534
|
-
function asyncPrefixMatches(prefix, asyncDirRoot, resultsDir) {
|
|
5535
|
-
return findAsyncRunPrefixMatches(prefix, asyncDirRoot, resultsDir);
|
|
5536
|
-
}
|
|
5537
|
-
function resolveSubagentRunId(id, deps = {}) {
|
|
5538
|
-
assertSafeNestedId("id", id);
|
|
5539
|
-
let asyncDirRoot = deps.asyncDirRoot ?? ASYNC_DIR, resultsDir = deps.resultsDir ?? RESULTS_DIR, nestedScope = deps.nested ?? nestedScopeFromState(deps.state);
|
|
5540
|
-
if (hasExactForegroundId(deps.state, id))
|
|
5541
|
-
return { kind: "foreground", id };
|
|
5542
|
-
let exactAsync = exactAsyncLocation(id, asyncDirRoot, resultsDir);
|
|
5543
|
-
if (exactAsync)
|
|
5544
|
-
return { kind: "async", id, location: exactAsync };
|
|
5545
|
-
let exactNested = findNestedRunMatchesById(id, nestedScope ? { scope: nestedScope } : {});
|
|
5546
|
-
if (exactNested.length > 1)
|
|
5547
|
-
throw new Error(`Nested run id '${id}' is ambiguous across authorized registries. Provide the full id after stale registries are cleaned up.`);
|
|
5548
|
-
if (exactNested[0])
|
|
5549
|
-
return { kind: "nested", id, match: exactNested[0] };
|
|
5550
|
-
let matches = [];
|
|
5551
|
-
for (let foregroundId of foregroundIds(deps.state).filter((candidate) => candidate.startsWith(id)))
|
|
5552
|
-
matches.push({ kind: "foreground", id: foregroundId });
|
|
5553
|
-
for (let match of asyncPrefixMatches(id, asyncDirRoot, resultsDir))
|
|
5554
|
-
matches.push({ kind: "async", id: match.id, location: match.location });
|
|
5555
|
-
for (let match of findNestedRunMatchesById(id, nestedScope ? { prefix: !0, scope: nestedScope } : { prefix: !0 }))
|
|
5556
|
-
matches.push({ kind: "nested", id: match.run.id, match });
|
|
5557
|
-
let values = [...new Map(matches.map((match) => [`${match.kind}:${match.id}`, match])).values()];
|
|
5558
|
-
if (values.length > 1)
|
|
5559
|
-
throw new Error(`Ambiguous subagent run id prefix '${id}' matched: ${values.map((match) => `${match.kind}:${match.id}`).join(", ")}. Provide a longer id.`);
|
|
5560
|
-
return values[0];
|
|
5561
|
-
}
|
|
5562
|
-
|
|
5563
|
-
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js
|
|
5564
|
-
import * as fs15 from "node:fs";
|
|
5565
|
-
import * as path15 from "node:path";
|
|
5566
5443
|
function hasExistingSessionFile(value) {
|
|
5567
|
-
return typeof value == "string" &&
|
|
5444
|
+
return typeof value == "string" && fs14.existsSync(value);
|
|
5568
5445
|
}
|
|
5569
5446
|
function formatResumeGuidance(runId, children, fallbackSessionFile, options = {}) {
|
|
5570
5447
|
if (options.stopped)
|
|
@@ -5600,9 +5477,9 @@ function formatSteeringSummary(input) {
|
|
|
5600
5477
|
}
|
|
5601
5478
|
function rememberedForegroundChildOutput(child) {
|
|
5602
5479
|
let outputPath = child.artifactPaths?.outputPath ?? child.savedOutputPath;
|
|
5603
|
-
if (outputPath &&
|
|
5480
|
+
if (outputPath && fs14.existsSync(outputPath))
|
|
5604
5481
|
try {
|
|
5605
|
-
let artifactOutput =
|
|
5482
|
+
let artifactOutput = fs14.readFileSync(outputPath, "utf-8").trim();
|
|
5606
5483
|
if (artifactOutput)
|
|
5607
5484
|
return artifactOutput;
|
|
5608
5485
|
} catch {
|
|
@@ -5775,7 +5652,7 @@ function inspectSubagentStatus(params, deps = {}) {
|
|
|
5775
5652
|
details: { mode: "single", results: [] }
|
|
5776
5653
|
};
|
|
5777
5654
|
}
|
|
5778
|
-
let status = reconciliation.status, effectiveRunId = status?.runId ?? resolvedId ?? "unknown", logPath =
|
|
5655
|
+
let status = reconciliation.status, effectiveRunId = status?.runId ?? resolvedId ?? "unknown", logPath = path14.join(asyncDir, `subagent-log-${effectiveRunId}.md`), eventsPath = path14.join(asyncDir, "events.jsonl");
|
|
5779
5656
|
if (status) {
|
|
5780
5657
|
if (params.view === "transcript") {
|
|
5781
5658
|
if (currentSessionId && status.sessionId !== currentSessionId)
|
|
@@ -5819,22 +5696,22 @@ function inspectSubagentStatus(params, deps = {}) {
|
|
|
5819
5696
|
`Dir: ${asyncDir}`,
|
|
5820
5697
|
outputPath ? `Output: ${outputPath}` : void 0,
|
|
5821
5698
|
reconciliation.message ? `Diagnosis: ${reconciliation.message}` : void 0,
|
|
5822
|
-
reconciliation.resultPath &&
|
|
5699
|
+
reconciliation.resultPath && fs14.existsSync(reconciliation.resultPath) ? `Result: ${reconciliation.resultPath}` : void 0
|
|
5823
5700
|
].filter((line) => !!line);
|
|
5824
5701
|
for (let [index, step] of (status.steps ?? []).entries()) {
|
|
5825
5702
|
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}] ` : "";
|
|
5826
5703
|
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 }));
|
|
5827
|
-
let stepOutputPath =
|
|
5828
|
-
stepOutputPath !== outputPath &&
|
|
5704
|
+
let stepOutputPath = path14.join(asyncDir, `output-${index}.log`);
|
|
5705
|
+
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: "..." })`));
|
|
5829
5706
|
}
|
|
5830
5707
|
let attached = new Set((status.steps ?? []).flatMap((step) => step.children?.map((child) => child.id) ?? [])), unattached = nestedChildren.filter((child) => !attached.has(child.id));
|
|
5831
|
-
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 })),
|
|
5708
|
+
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(`
|
|
5832
5709
|
`) }], details: { mode: "single", results: [] } };
|
|
5833
5710
|
}
|
|
5834
5711
|
}
|
|
5835
5712
|
if (resultPath)
|
|
5836
5713
|
try {
|
|
5837
|
-
let raw =
|
|
5714
|
+
let raw = fs14.readFileSync(resultPath, "utf-8"), data = JSON.parse(raw);
|
|
5838
5715
|
if (params.view === "transcript")
|
|
5839
5716
|
try {
|
|
5840
5717
|
return { content: [{ type: "text", text: formatAsyncResultTranscript(data, resultPath, { index: params.index, lines: params.lines }) }], details: { mode: "single", results: [] } };
|
|
@@ -5858,15 +5735,10 @@ function inspectSubagentStatus(params, deps = {}) {
|
|
|
5858
5735
|
};
|
|
5859
5736
|
}
|
|
5860
5737
|
|
|
5861
|
-
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js
|
|
5862
|
-
function applyForceTopLevelAsyncOverride(params, depth, forceTopLevelAsync) {
|
|
5863
|
-
return params.foregroundOnly || !(depth === 0 && forceTopLevelAsync) ? params : { ...params, async: !0, clarify: !1 };
|
|
5864
|
-
}
|
|
5865
|
-
|
|
5866
5738
|
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js
|
|
5867
|
-
var MUTATING_MANAGEMENT_ACTIONS = /* @__PURE__ */ new Set(["create", "update", "delete", "eject", "disable", "enable", "reset"
|
|
5739
|
+
var MUTATING_MANAGEMENT_ACTIONS = /* @__PURE__ */ new Set(["create", "update", "delete", "eject", "disable", "enable", "reset"]);
|
|
5868
5740
|
function resolveRequestedCwd(runtimeCwd, requestedCwd) {
|
|
5869
|
-
return requestedCwd ?
|
|
5741
|
+
return requestedCwd ? path15.resolve(runtimeCwd, requestedCwd) : runtimeCwd;
|
|
5870
5742
|
}
|
|
5871
5743
|
function getForegroundControl(state, runId) {
|
|
5872
5744
|
if (runId)
|
|
@@ -5898,7 +5770,7 @@ function nestedResolutionScopeForExecutor(deps) {
|
|
|
5898
5770
|
};
|
|
5899
5771
|
}
|
|
5900
5772
|
function trustedSessionRootsForStatus(ctx, deps) {
|
|
5901
|
-
let roots = deps.config.defaultSessionDir ? [
|
|
5773
|
+
let roots = deps.config.defaultSessionDir ? [path15.resolve(deps.expandTilde(deps.config.defaultSessionDir))] : [], parentSessionFile = ctx.sessionManager.getSessionFile() ?? null;
|
|
5902
5774
|
return parentSessionFile && roots.push(deps.getSubagentSessionRoot(parentSessionFile)), [...new Set(roots)];
|
|
5903
5775
|
}
|
|
5904
5776
|
function reserveSubagentSpawns(input) {
|
|
@@ -6045,10 +5917,10 @@ function resolveForegroundResumeTarget(params, state) {
|
|
|
6045
5917
|
let child = run.children[index];
|
|
6046
5918
|
if (!child.sessionFile)
|
|
6047
5919
|
throw new Error(`Foreground run '${run.runId}' child ${index} does not have a persisted session file to resume from.`);
|
|
6048
|
-
if (
|
|
5920
|
+
if (path15.extname(child.sessionFile) !== ".jsonl")
|
|
6049
5921
|
throw new Error(`Foreground run '${run.runId}' child ${index} session file must be a .jsonl file: ${child.sessionFile}`);
|
|
6050
|
-
let sessionFile =
|
|
6051
|
-
if (!
|
|
5922
|
+
let sessionFile = path15.resolve(child.sessionFile);
|
|
5923
|
+
if (!fs15.existsSync(sessionFile))
|
|
6052
5924
|
throw new Error(`Foreground run '${run.runId}' child ${index} session file does not exist: ${child.sessionFile}`);
|
|
6053
5925
|
return { runId: run.runId, mode: run.mode, state: "complete", agent: child.agent, index, intercomTarget: resolveSubagentIntercomTarget(run.runId, child.agent, index), cwd: run.cwd, sessionFile };
|
|
6054
5926
|
}
|
|
@@ -6103,7 +5975,7 @@ function resolveResumeTarget(params, state, options = {}) {
|
|
|
6103
5975
|
function getAsyncInterruptTarget(state, runId, location, options = {}) {
|
|
6104
5976
|
if (location?.asyncDir)
|
|
6105
5977
|
return {
|
|
6106
|
-
asyncId: location.resolvedId ?? runId ??
|
|
5978
|
+
asyncId: location.resolvedId ?? runId ?? path15.basename(location.asyncDir),
|
|
6107
5979
|
asyncDir: location.asyncDir
|
|
6108
5980
|
};
|
|
6109
5981
|
if (runId) {
|
|
@@ -6368,27 +6240,27 @@ function nestedRunAgent(run) {
|
|
|
6368
6240
|
return run.agent ?? run.agents?.[0] ?? (run.steps?.length === 1 ? run.steps[0]?.agent : void 0);
|
|
6369
6241
|
}
|
|
6370
6242
|
function pathWithin(base, candidate) {
|
|
6371
|
-
let resolvedBase =
|
|
6372
|
-
return resolvedCandidate === resolvedBase || resolvedCandidate.startsWith(`${resolvedBase}${
|
|
6243
|
+
let resolvedBase = path15.resolve(base), resolvedCandidate = path15.resolve(candidate);
|
|
6244
|
+
return resolvedCandidate === resolvedBase || resolvedCandidate.startsWith(`${resolvedBase}${path15.sep}`);
|
|
6373
6245
|
}
|
|
6374
6246
|
function validateNestedSessionFile(run, trustedSessionRoots) {
|
|
6375
6247
|
let sessionFile = nestedRunSessionFile(run);
|
|
6376
6248
|
if (!sessionFile)
|
|
6377
6249
|
throw new Error(`Nested run '${run.id}' does not have a persisted session file to resume from.`);
|
|
6378
|
-
if (
|
|
6250
|
+
if (path15.extname(sessionFile) !== ".jsonl")
|
|
6379
6251
|
throw new Error(`Nested run '${run.id}' session file must be a .jsonl file: ${sessionFile}`);
|
|
6380
|
-
let resolved =
|
|
6381
|
-
if (!
|
|
6252
|
+
let resolved = path15.resolve(sessionFile);
|
|
6253
|
+
if (!path15.isAbsolute(sessionFile))
|
|
6382
6254
|
throw new Error(`Nested run '${run.id}' session file must be absolute: ${sessionFile}`);
|
|
6383
|
-
if (!
|
|
6255
|
+
if (!fs15.existsSync(resolved))
|
|
6384
6256
|
throw new Error(`Nested run '${run.id}' session file does not exist: ${sessionFile}`);
|
|
6385
|
-
let stat =
|
|
6257
|
+
let stat = fs15.lstatSync(resolved);
|
|
6386
6258
|
if (!stat.isFile() || stat.isSymbolicLink())
|
|
6387
6259
|
throw new Error(`Nested run '${run.id}' session file is not a regular file: ${sessionFile}`);
|
|
6388
|
-
let realSessionFile =
|
|
6389
|
-
if (!trustedSessionRoots.filter((root) =>
|
|
6260
|
+
let realSessionFile = fs15.realpathSync(resolved);
|
|
6261
|
+
if (!trustedSessionRoots.filter((root) => fs15.existsSync(root)).map((root) => fs15.realpathSync(root)).some((root) => pathWithin(root, realSessionFile)))
|
|
6390
6262
|
throw new Error(`Nested run '${run.id}' session file is outside trusted nested session roots: ${sessionFile}`);
|
|
6391
|
-
if (!realSessionFile.split(
|
|
6263
|
+
if (!realSessionFile.split(path15.sep).includes(run.id))
|
|
6392
6264
|
throw new Error(`Nested run '${run.id}' session file is not under that nested run's session directory: ${sessionFile}`);
|
|
6393
6265
|
return realSessionFile;
|
|
6394
6266
|
}
|
|
@@ -6408,7 +6280,7 @@ function resolveNestedResumeTarget(match, trustedSessionRoots) {
|
|
|
6408
6280
|
agent,
|
|
6409
6281
|
index: 0,
|
|
6410
6282
|
intercomTarget: resolveSubagentIntercomTarget(run.id, agent, 0),
|
|
6411
|
-
cwd: asyncDir ?
|
|
6283
|
+
cwd: asyncDir ? path15.dirname(asyncDir) : void 0,
|
|
6412
6284
|
sessionFile: validateNestedSessionFile(run, trustedSessionRoots)
|
|
6413
6285
|
};
|
|
6414
6286
|
}
|
|
@@ -6435,7 +6307,7 @@ function directNestedAsyncInterrupt(target) {
|
|
|
6435
6307
|
let run = target.match.run, asyncDir = resolveNestedAsyncDir(target.match.rootRunId, run);
|
|
6436
6308
|
if (!asyncDir)
|
|
6437
6309
|
return;
|
|
6438
|
-
let status = reconcileAsyncRun(asyncDir, { resultsDir:
|
|
6310
|
+
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;
|
|
6439
6311
|
if (!(!status || status.state !== "running" || typeof pid != "number" || pid <= 0))
|
|
6440
6312
|
try {
|
|
6441
6313
|
return deliverInterruptRequest({ asyncDir, pid, source: "nested-interrupt" }), { content: [{ type: "text", text: `Interrupt requested for nested async run ${run.id}.` }], details: { mode: "management", results: [] } };
|
|
@@ -6448,7 +6320,7 @@ async function directNestedAsyncSteer(input) {
|
|
|
6448
6320
|
let run = input.target.match.run, asyncDir = resolveNestedAsyncDir(input.target.match.rootRunId, run);
|
|
6449
6321
|
if (!asyncDir)
|
|
6450
6322
|
return;
|
|
6451
|
-
let status = reconcileAsyncRun(asyncDir, { resultsDir:
|
|
6323
|
+
let status = reconcileAsyncRun(asyncDir, { resultsDir: path15.join(RESULTS_DIR, "nested", input.target.match.rootRunId) }).status;
|
|
6452
6324
|
if (!status || status.state !== "running" && status.state !== "queued")
|
|
6453
6325
|
return;
|
|
6454
6326
|
let steps = status.steps ?? [];
|
|
@@ -6542,7 +6414,7 @@ async function resumeAsyncRun(input) {
|
|
|
6542
6414
|
if (resolved.match.run.state === "running" || resolved.match.run.state === "queued")
|
|
6543
6415
|
return resumeLiveNestedRun({ target: resolved, message: followUp });
|
|
6544
6416
|
let trustedSessionRoots = [
|
|
6545
|
-
...input.deps.config.defaultSessionDir ? [
|
|
6417
|
+
...input.deps.config.defaultSessionDir ? [path15.resolve(input.deps.expandTilde(input.deps.config.defaultSessionDir))] : [],
|
|
6546
6418
|
...parentSessionFile ? [input.deps.getSubagentSessionRoot(parentSessionFile)] : []
|
|
6547
6419
|
];
|
|
6548
6420
|
target = resolveNestedResumeTarget(resolved, trustedSessionRoots);
|
|
@@ -6585,6 +6457,7 @@ ${followUp}`, 500, { source: "async-resume", runId: target.runId, agent: target.
|
|
|
6585
6457
|
input.deps.state.currentSessionId = resolveCurrentSessionId(input.ctx.sessionManager);
|
|
6586
6458
|
let effectiveCwd = target.cwd ?? input.requestCwd, modelScope = void 0, sessionName = resolveIntercomSessionTarget(input.deps.pi.getSessionName(), input.ctx.sessionManager.getSessionId()), intercomBridge = resolveIntercomBridge({
|
|
6587
6459
|
config: input.deps.config.intercomBridge,
|
|
6460
|
+
cwd: input.requestCwd,
|
|
6588
6461
|
context: input.params.context,
|
|
6589
6462
|
orchestratorTarget: sessionName
|
|
6590
6463
|
}), recoveryDescriptor = "recoveryDescriptor" in target ? target.recoveryDescriptor : void 0;
|
|
@@ -6607,7 +6480,7 @@ ${followUp}`, 500, { source: "async-resume", runId: target.runId, agent: target.
|
|
|
6607
6480
|
goal,
|
|
6608
6481
|
attachRoot: {
|
|
6609
6482
|
runId: target.runId,
|
|
6610
|
-
asyncDir: target.asyncDir ??
|
|
6483
|
+
asyncDir: target.asyncDir ?? path15.join(ASYNC_DIR, target.runId),
|
|
6611
6484
|
resultPath: resolveAsyncRootResultPath(RESULTS_DIR, target.runId),
|
|
6612
6485
|
index: target.index,
|
|
6613
6486
|
agent: target.agent,
|
|
@@ -6637,6 +6510,7 @@ ${followUp}`, 500, { source: "async-resume", runId: target.runId, agent: target.
|
|
|
6637
6510
|
worktreeSetupHookTimeoutMs: input.deps.config.worktreeSetupHookTimeoutMs,
|
|
6638
6511
|
worktreeBaseDir: input.deps.config.worktreeBaseDir,
|
|
6639
6512
|
controlConfig: resolveControlConfig(input.deps.config.control, input.params.control),
|
|
6513
|
+
communicationEnabled: intercomBridge.communicationEnabled,
|
|
6640
6514
|
controlIntercomTarget: intercomBridge.active ? intercomBridge.orchestratorTarget : void 0,
|
|
6641
6515
|
childIntercomTarget: intercomBridge.active ? (agent, index) => resolveSubagentIntercomTarget(runId2, agent, index) : void 0,
|
|
6642
6516
|
globalConcurrencyLimit: input.deps.config.globalConcurrencyLimit
|
|
@@ -6653,32 +6527,43 @@ ${followUp}`, 500, { source: "async-resume", runId: target.runId, agent: target.
|
|
|
6653
6527
|
return { content: [{ type: "text", text: formatAsyncStartedMessage(lines2.join(`
|
|
6654
6528
|
`)) }], details: result3.details };
|
|
6655
6529
|
}
|
|
6656
|
-
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),
|
|
6530
|
+
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;
|
|
6531
|
+
if (recoveryDescriptor?.acceptance !== void 0 && input.params.acceptance === void 0)
|
|
6532
|
+
try {
|
|
6533
|
+
restoredAcceptance = restorePersistedAcceptance(recoveryDescriptor.acceptance, "recoveryDescriptor.acceptance");
|
|
6534
|
+
} catch (error) {
|
|
6535
|
+
return { content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }], isError: !0, details: { mode: "management", results: [] } };
|
|
6536
|
+
}
|
|
6537
|
+
let recoverySpec;
|
|
6657
6538
|
try {
|
|
6539
|
+
let recoverySelection = recoveryDescriptor?.modelSelection ?? target.modelSelection, recoveryIsExplicitModel = recoverySelection?.kind === "model";
|
|
6658
6540
|
recoverySpec = normalizeChildSpec({
|
|
6659
6541
|
task: buildRevivedAsyncTask(target, followUp),
|
|
6660
6542
|
description: recoveryDescriptor?.description ?? target.description ?? target.agent,
|
|
6661
6543
|
permissions: recoveryDescriptor?.permissions ?? target.permissions ?? "read-only",
|
|
6662
|
-
model: recoveryDescriptor?.model ?? target.model,
|
|
6663
|
-
tier: input.params.tier ??
|
|
6664
|
-
|
|
6544
|
+
model: recoveryIsExplicitModel ? recoverySelection.model ?? recoveryDescriptor?.model ?? target.model : void 0,
|
|
6545
|
+
tier: recoveryIsExplicitModel ? void 0 : input.params.tier ?? recoverySelection?.tier ?? recoveryDescriptor?.tier,
|
|
6546
|
+
thinking: recoveryIsExplicitModel ? recoveryDescriptor?.thinking ?? target.thinking : void 0,
|
|
6547
|
+
modelSelection: recoverySelection,
|
|
6665
6548
|
skill: recoveryDescriptor?.skills,
|
|
6666
6549
|
cwd: effectiveCwd,
|
|
6667
6550
|
output: recoveryDescriptor?.outputPath,
|
|
6668
6551
|
outputMode: recoveryDescriptor?.outputMode,
|
|
6669
|
-
acceptance: input.params.acceptance
|
|
6552
|
+
acceptance: input.params.acceptance,
|
|
6670
6553
|
toolBudget: recoveryDescriptor?.initialToolBudget
|
|
6671
6554
|
}, {
|
|
6672
6555
|
parentMode: snapshotParentPermissionMode(input.deps.state.currentSessionId),
|
|
6673
6556
|
runId,
|
|
6674
6557
|
index: 0,
|
|
6675
|
-
childId: recoveryDescriptor?.childId ?? target.childId ?? `${runId}-0
|
|
6558
|
+
childId: recoveryDescriptor?.childId ?? target.childId ?? `${runId}-0`,
|
|
6559
|
+
resolvedModelIsRuntime: !recoveryIsExplicitModel && !!(recoveryDescriptor?.model ?? target.model)
|
|
6676
6560
|
});
|
|
6677
6561
|
} catch (error) {
|
|
6678
6562
|
return { content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }], isError: !0, details: { mode: "management", results: [] } };
|
|
6679
6563
|
}
|
|
6680
6564
|
let result2 = executeAsyncSingle(runId, {
|
|
6681
6565
|
spec: recoverySpec,
|
|
6566
|
+
completionTask: followUp,
|
|
6682
6567
|
goal: followUp,
|
|
6683
6568
|
ctx: {
|
|
6684
6569
|
pi: input.deps.pi,
|
|
@@ -6712,13 +6597,14 @@ ${followUp}`, 500, { source: "async-resume", runId: target.runId, agent: target.
|
|
|
6712
6597
|
worktreeSetupHookTimeoutMs: input.deps.config.worktreeSetupHookTimeoutMs,
|
|
6713
6598
|
worktreeBaseDir: input.deps.config.worktreeBaseDir,
|
|
6714
6599
|
controlConfig: recoveryDescriptor?.controlConfig ?? resolveControlConfig(input.deps.config.control, input.params.control),
|
|
6600
|
+
communicationEnabled: intercomBridge.communicationEnabled,
|
|
6715
6601
|
controlIntercomTarget: intercomBridge.active ? intercomBridge.orchestratorTarget : void 0,
|
|
6716
6602
|
childIntercomTarget: intercomBridge.active ? (agent, index) => resolveSubagentIntercomTarget(runId, agent, index) : void 0,
|
|
6717
6603
|
availableModels,
|
|
6718
6604
|
output: recoveryDescriptor?.outputPath,
|
|
6719
6605
|
outputMode: recoveryDescriptor?.outputMode,
|
|
6720
6606
|
...recoveryDescriptor?.skills ? { skills: [...recoveryDescriptor.skills] } : {},
|
|
6721
|
-
...
|
|
6607
|
+
...restoredAcceptance ? { restoredAcceptance } : {},
|
|
6722
6608
|
...input.params.timeoutMs !== void 0 ? { timeoutMs: input.params.timeoutMs } : {},
|
|
6723
6609
|
...input.absoluteDeadlineAt !== void 0 ? { absoluteDeadlineAt: input.absoluteDeadlineAt } : {},
|
|
6724
6610
|
...input.params.turnBudget !== void 0 ? { turnBudget: input.params.turnBudget } : {},
|
|
@@ -6986,6 +6872,7 @@ function internalizePromptDrivenChildren(params, options) {
|
|
|
6986
6872
|
cwd: params.cwd,
|
|
6987
6873
|
model: params.model,
|
|
6988
6874
|
tier: params.tier,
|
|
6875
|
+
thinking: params.thinking,
|
|
6989
6876
|
skill: params.skill,
|
|
6990
6877
|
output: params.output,
|
|
6991
6878
|
outputMode: params.outputMode,
|
|
@@ -7244,7 +7131,9 @@ function runAsyncPath(data, deps) {
|
|
|
7244
7131
|
description: task.description,
|
|
7245
7132
|
permissions: task.permissions,
|
|
7246
7133
|
cwd: task.cwd,
|
|
7134
|
+
model: task.model,
|
|
7247
7135
|
tier: task.tier,
|
|
7136
|
+
thinking: task.thinking,
|
|
7248
7137
|
...skillOverrides[index] !== void 0 ? { skill: skillOverrides[index] } : {},
|
|
7249
7138
|
...task.output !== void 0 && task.output !== !0 ? { output: task.output } : {},
|
|
7250
7139
|
...task.outputMode !== void 0 ? { outputMode: task.outputMode } : {},
|
|
@@ -7260,6 +7149,7 @@ function runAsyncPath(data, deps) {
|
|
|
7260
7149
|
worktree: params.worktree
|
|
7261
7150
|
}],
|
|
7262
7151
|
resultMode: "parallel",
|
|
7152
|
+
communicationEnabled: intercomBridge.communicationEnabled,
|
|
7263
7153
|
goal: params.tasks[0]?.task ?? "",
|
|
7264
7154
|
ctx: asyncCtx,
|
|
7265
7155
|
availableModels,
|
|
@@ -7294,6 +7184,7 @@ function runAsyncPath(data, deps) {
|
|
|
7294
7184
|
chain,
|
|
7295
7185
|
task: params.task,
|
|
7296
7186
|
goal: resolveAsyncEventGoal(params.task, rawChain),
|
|
7187
|
+
communicationEnabled: intercomBridge.communicationEnabled,
|
|
7297
7188
|
ctx: asyncCtx,
|
|
7298
7189
|
availableModels,
|
|
7299
7190
|
cwd: effectiveCwd,
|
|
@@ -7330,13 +7221,21 @@ function runAsyncPath(data, deps) {
|
|
|
7330
7221
|
isError: !0,
|
|
7331
7222
|
details: { mode: "single", results: [] }
|
|
7332
7223
|
};
|
|
7333
|
-
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),
|
|
7224
|
+
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({
|
|
7225
|
+
modelSelection,
|
|
7226
|
+
model: params.model,
|
|
7227
|
+
tier: params.tier,
|
|
7228
|
+
thinking: params.thinking,
|
|
7229
|
+
availableModels,
|
|
7230
|
+
preferredProvider: currentProvider
|
|
7231
|
+
}), spec = normalizeChildSpec({
|
|
7334
7232
|
task: shouldForkAgent(contextPolicy, params.agent) ? wrapForkTask(params.task ?? "") : params.task ?? "",
|
|
7335
7233
|
description: params.description,
|
|
7336
7234
|
permissions: params.permissions,
|
|
7337
|
-
model:
|
|
7235
|
+
model: params.model,
|
|
7338
7236
|
tier: params.tier,
|
|
7339
|
-
|
|
7237
|
+
thinking: params.thinking,
|
|
7238
|
+
modelSelection,
|
|
7340
7239
|
skill: params.skill,
|
|
7341
7240
|
cwd: effectiveCwd,
|
|
7342
7241
|
output: effectiveOutput,
|
|
@@ -7373,6 +7272,7 @@ function runAsyncPath(data, deps) {
|
|
|
7373
7272
|
worktreeSetupHookTimeoutMs: deps.config.worktreeSetupHookTimeoutMs,
|
|
7374
7273
|
worktreeBaseDir: deps.config.worktreeBaseDir,
|
|
7375
7274
|
controlConfig,
|
|
7275
|
+
communicationEnabled: intercomBridge.communicationEnabled,
|
|
7376
7276
|
controlIntercomTarget,
|
|
7377
7277
|
childIntercomTarget: childIntercomTarget ? (agent, index) => childIntercomTarget(agent, index) : void 0,
|
|
7378
7278
|
nestedRoute,
|
|
@@ -7410,6 +7310,7 @@ async function runChainPath(data, deps) {
|
|
|
7410
7310
|
controlConfig,
|
|
7411
7311
|
childIntercomTarget: childIntercomTarget ? (agent, index) => childIntercomTarget(runId, agent, index) : void 0,
|
|
7412
7312
|
orchestratorIntercomTarget: data.intercomBridge.active ? data.intercomBridge.orchestratorTarget : void 0,
|
|
7313
|
+
communicationEnabled: data.intercomBridge.communicationEnabled,
|
|
7413
7314
|
foregroundControl,
|
|
7414
7315
|
nestedRoute: foregroundControl?.nestedRoute,
|
|
7415
7316
|
chainSkills,
|
|
@@ -7467,6 +7368,7 @@ async function runChainPath(data, deps) {
|
|
|
7467
7368
|
controlConfig,
|
|
7468
7369
|
controlIntercomTarget: data.intercomBridge.active ? data.intercomBridge.orchestratorTarget : void 0,
|
|
7469
7370
|
childIntercomTarget: data.intercomBridge.active ? (agent, index) => resolveSubagentIntercomTarget(id, agent, index) : void 0,
|
|
7371
|
+
communicationEnabled: data.intercomBridge.communicationEnabled,
|
|
7470
7372
|
nestedRoute: data.nestedRoute,
|
|
7471
7373
|
timeoutMs: data.timeoutMs,
|
|
7472
7374
|
turnBudget: data.turnBudget,
|
|
@@ -7522,7 +7424,7 @@ function buildParallelWorktreeTaskCwdError(tasks, sharedCwd) {
|
|
|
7522
7424
|
return formatWorktreeTaskCwdConflict(conflict, sharedCwd);
|
|
7523
7425
|
}
|
|
7524
7426
|
function resolveSingleRunOutputBaseDir(deps, artifactsDir, runId) {
|
|
7525
|
-
return deps.config.singleRunOutputBaseDir ?
|
|
7427
|
+
return deps.config.singleRunOutputBaseDir ? path15.resolve(deps.expandTilde(deps.config.singleRunOutputBaseDir)) : path15.join(artifactsDir, "outputs", runId);
|
|
7526
7428
|
}
|
|
7527
7429
|
function buildChainWorktreeTaskCwdError(chain, sharedCwd) {
|
|
7528
7430
|
for (let stepIndex = 0; stepIndex < chain.length; stepIndex++) {
|
|
@@ -7542,7 +7444,7 @@ function resolveParallelTaskCwd(task, paramsCwd, worktreeSetup, index) {
|
|
|
7542
7444
|
function buildParallelWorktreeSuffix(worktreeSetup, artifactsDir, tasks) {
|
|
7543
7445
|
if (!worktreeSetup)
|
|
7544
7446
|
return "";
|
|
7545
|
-
let diffsDir =
|
|
7447
|
+
let diffsDir = path15.join(artifactsDir, "worktree-diffs"), diffs = diffWorktrees(worktreeSetup, tasks.map((task) => task.agent), diffsDir);
|
|
7546
7448
|
return formatWorktreeDiffSummary(diffs);
|
|
7547
7449
|
}
|
|
7548
7450
|
function findDuplicateParallelOutputPath(input) {
|
|
@@ -7565,13 +7467,16 @@ async function runForegroundParallelTasks(input) {
|
|
|
7565
7467
|
input.sessionFileForTask(input.tasks[i].agent, i, input.modelOverrides[i]);
|
|
7566
7468
|
return mapConcurrent(input.tasks, input.concurrencyLimit, async (task, index) => {
|
|
7567
7469
|
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();
|
|
7568
|
-
|
|
7470
|
+
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));
|
|
7471
|
+
let modelSelection = input.modelSelections[index] ?? captureModelSelection({ model: task.model, tier: task.tier });
|
|
7472
|
+
return runSync(input.ctx.cwd, normalizeChildSpec({
|
|
7569
7473
|
task: taskText,
|
|
7570
7474
|
description: task.description,
|
|
7571
7475
|
permissions: task.permissions,
|
|
7572
|
-
model:
|
|
7476
|
+
model: task.model,
|
|
7573
7477
|
tier: task.tier,
|
|
7574
|
-
|
|
7478
|
+
thinking: task.thinking,
|
|
7479
|
+
modelSelection,
|
|
7575
7480
|
skill: task.skill,
|
|
7576
7481
|
cwd: taskCwd,
|
|
7577
7482
|
output: task.output,
|
|
@@ -7602,6 +7507,7 @@ async function runForegroundParallelTasks(input) {
|
|
|
7602
7507
|
onDetachedExit: (result2) => updateRememberedForegroundChild(input.state, { runId: input.runId, mode: "parallel", cwd: taskCwd, sessionId: input.parentSessionId, index, result: result2, events: input.intercomEvents }),
|
|
7603
7508
|
intercomSessionName: input.childIntercomTarget?.(task.agent, index),
|
|
7604
7509
|
orchestratorIntercomTarget: input.orchestratorIntercomTarget,
|
|
7510
|
+
communicationEnabled: input.communicationEnabled,
|
|
7605
7511
|
nestedRoute: input.foregroundControl?.nestedRoute,
|
|
7606
7512
|
modelOverride: input.modelOverrides[index],
|
|
7607
7513
|
thinkingOverride: input.thinkingOverrideForTask(task.agent, index, input.modelOverrides[index]),
|
|
@@ -7676,7 +7582,14 @@ async function runParallelPath(data, deps) {
|
|
|
7676
7582
|
...task.reads !== void 0 && task.reads !== !0 ? { reads: task.reads } : {},
|
|
7677
7583
|
...task.progress !== void 0 ? { progress: task.progress } : {},
|
|
7678
7584
|
...skillOverrides[index] !== void 0 ? { skills: skillOverrides[index] } : {}
|
|
7679
|
-
})),
|
|
7585
|
+
})), modelSelections = tasks.map((task) => captureModelSelection({ model: task.model, tier: task.tier })), modelOverrides = tasks.map((task, index) => resolveExecutableChildModel({
|
|
7586
|
+
modelSelection: modelSelections[index],
|
|
7587
|
+
model: task.model,
|
|
7588
|
+
tier: task.tier,
|
|
7589
|
+
thinking: task.thinking,
|
|
7590
|
+
availableModels,
|
|
7591
|
+
preferredProvider: currentProvider
|
|
7592
|
+
}));
|
|
7680
7593
|
if (params.clarify === !0 && ctx.hasUI) {
|
|
7681
7594
|
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%" } });
|
|
7682
7595
|
if (!result2 || !result2.confirmed)
|
|
@@ -7709,7 +7622,9 @@ async function runParallelPath(data, deps) {
|
|
|
7709
7622
|
description: t.description,
|
|
7710
7623
|
permissions: t.permissions,
|
|
7711
7624
|
cwd: t.cwd,
|
|
7625
|
+
model: t.model,
|
|
7712
7626
|
tier: t.tier,
|
|
7627
|
+
thinking: t.thinking,
|
|
7713
7628
|
...skillOverrides[i] !== void 0 ? { skill: skillOverrides[i] } : {},
|
|
7714
7629
|
...behaviorOverrides[i]?.output !== void 0 ? { output: behaviorOverrides[i].output } : {},
|
|
7715
7630
|
...behaviorOverrides[i]?.outputMode !== void 0 ? { outputMode: behaviorOverrides[i].outputMode } : {},
|
|
@@ -7723,6 +7638,7 @@ async function runParallelPath(data, deps) {
|
|
|
7723
7638
|
chain: [{ parallel: parallelTasks, concurrency: parallelConcurrency, worktree: params.worktree }],
|
|
7724
7639
|
resultMode: "parallel",
|
|
7725
7640
|
goal: taskTexts[0] ?? "",
|
|
7641
|
+
communicationEnabled: data.intercomBridge.communicationEnabled,
|
|
7726
7642
|
ctx: asyncCtx,
|
|
7727
7643
|
availableModels,
|
|
7728
7644
|
cwd: effectiveCwd,
|
|
@@ -7752,7 +7668,7 @@ async function runParallelPath(data, deps) {
|
|
|
7752
7668
|
if (errorResult)
|
|
7753
7669
|
return errorResult;
|
|
7754
7670
|
try {
|
|
7755
|
-
let outputBaseDir =
|
|
7671
|
+
let outputBaseDir = path15.join(artifactsDir, "outputs", runId), duplicateOutputError = findDuplicateParallelOutputPath({
|
|
7756
7672
|
tasks,
|
|
7757
7673
|
behaviors,
|
|
7758
7674
|
paramsCwd: effectiveCwd,
|
|
@@ -7767,7 +7683,7 @@ async function runParallelPath(data, deps) {
|
|
|
7767
7683
|
if (validationError)
|
|
7768
7684
|
return buildParallelModeError(validationError);
|
|
7769
7685
|
}
|
|
7770
|
-
let parallelProgressPrecreated = firstProgressIndex !== -1, parallelProgressDir =
|
|
7686
|
+
let parallelProgressPrecreated = firstProgressIndex !== -1, parallelProgressDir = path15.join(artifactsDir, "progress", runId);
|
|
7771
7687
|
parallelProgressPrecreated && writeInitialProgressFile(parallelProgressDir);
|
|
7772
7688
|
for (let i = 0; i < taskTexts.length; i++)
|
|
7773
7689
|
shouldForkAgent(contextPolicy, tasks[i].agent) && (taskTexts[i] = wrapForkTask(taskTexts[i]));
|
|
@@ -7802,6 +7718,7 @@ async function runParallelPath(data, deps) {
|
|
|
7802
7718
|
onControlEvent,
|
|
7803
7719
|
childIntercomTarget: childIntercomTarget ? (agent, index) => childIntercomTarget(runId, agent, index) : void 0,
|
|
7804
7720
|
orchestratorIntercomTarget: data.intercomBridge.active ? data.intercomBridge.orchestratorTarget : void 0,
|
|
7721
|
+
communicationEnabled: data.intercomBridge.communicationEnabled,
|
|
7805
7722
|
foregroundControl,
|
|
7806
7723
|
concurrencyLimit: parallelConcurrency,
|
|
7807
7724
|
globalSemaphore: new Semaphore(deps.config.globalConcurrencyLimit ?? DEFAULT_GLOBAL_CONCURRENCY_LIMIT),
|
|
@@ -7885,7 +7802,9 @@ async function runSinglePath(data, deps) {
|
|
|
7885
7802
|
task: params.task,
|
|
7886
7803
|
description: params.description,
|
|
7887
7804
|
permissions: params.permissions,
|
|
7805
|
+
model: params.model,
|
|
7888
7806
|
tier: params.tier,
|
|
7807
|
+
thinking: params.thinking,
|
|
7889
7808
|
skill: params.skill,
|
|
7890
7809
|
cwd: effectiveCwd,
|
|
7891
7810
|
output: params.output,
|
|
@@ -7914,7 +7833,14 @@ async function runSinglePath(data, deps) {
|
|
|
7914
7833
|
}, effectiveToolBudget = resolveEffectiveToolBudget({ runBudget: data.toolBudget, agentBudget: spec.toolBudget, configBudget: data.configToolBudget });
|
|
7915
7834
|
if (effectiveToolBudget.error)
|
|
7916
7835
|
return toExecutionErrorResult(params, new Error(effectiveToolBudget.error));
|
|
7917
|
-
let currentProvider = ctx.model?.provider, availableModels = ctx.modelRegistry.getAvailable().map(toModelInfo), task = params.task ?? "",
|
|
7836
|
+
let currentProvider = ctx.model?.provider, availableModels = ctx.modelRegistry.getAvailable().map(toModelInfo), task = params.task ?? "", modelSelection = captureModelSelection({ model: params.model, tier: params.tier }), modelOverride = resolveExecutableChildModel({
|
|
7837
|
+
modelSelection,
|
|
7838
|
+
model: params.model,
|
|
7839
|
+
tier: params.tier,
|
|
7840
|
+
thinking: params.thinking,
|
|
7841
|
+
availableModels,
|
|
7842
|
+
preferredProvider: currentProvider
|
|
7843
|
+
}), 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);
|
|
7918
7844
|
if (params.clarify === !0 && ctx.hasUI) {
|
|
7919
7845
|
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%" } });
|
|
7920
7846
|
if (!result2 || !result2.confirmed)
|
|
@@ -7939,6 +7865,7 @@ async function runSinglePath(data, deps) {
|
|
|
7939
7865
|
};
|
|
7940
7866
|
return executeAsyncSingle(id, {
|
|
7941
7867
|
spec: { ...spec, task: shouldForkAgent(contextPolicy, params.agent) ? wrapForkTask(task) : task },
|
|
7868
|
+
communicationEnabled: data.intercomBridge.communicationEnabled,
|
|
7942
7869
|
goal: task,
|
|
7943
7870
|
ctx: asyncCtx,
|
|
7944
7871
|
availableModels,
|
|
@@ -8007,6 +7934,7 @@ async function runSinglePath(data, deps) {
|
|
|
8007
7934
|
onControlEvent,
|
|
8008
7935
|
intercomSessionName: childIntercomTarget,
|
|
8009
7936
|
orchestratorIntercomTarget: data.intercomBridge.active ? data.intercomBridge.orchestratorTarget : void 0,
|
|
7937
|
+
communicationEnabled: data.intercomBridge.communicationEnabled,
|
|
8010
7938
|
nestedRoute: foregroundControl?.nestedRoute,
|
|
8011
7939
|
index: 0,
|
|
8012
7940
|
modelOverride,
|
|
@@ -8086,7 +8014,7 @@ function foregroundCapacityResult(params, inFlight, limit) {
|
|
|
8086
8014
|
return {
|
|
8087
8015
|
content: [{
|
|
8088
8016
|
type: "text",
|
|
8089
|
-
text: `Foreground subagent capacity reached (${inFlight}/${limit} running). Wait for a child to finish,
|
|
8017
|
+
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.`
|
|
8090
8018
|
}],
|
|
8091
8019
|
isError: !0,
|
|
8092
8020
|
details: { mode: inferExecutionMode(params), results: [] }
|
|
@@ -8169,6 +8097,8 @@ function createSubagentExecutor(deps) {
|
|
|
8169
8097
|
if (action === "resume")
|
|
8170
8098
|
return resumeAsyncRun({ params: paramsWithResolvedCwd, requestCwd, ctx, deps });
|
|
8171
8099
|
if (action === "steer") {
|
|
8100
|
+
if (!subagentCommunicationEnabled(requestCwd, getAgentDir()))
|
|
8101
|
+
return { content: [{ type: "text", text: "Subagent communication is off in /settings. Wait for the child to complete instead of steering it." }], isError: !0, details: { mode: "management", results: [] } };
|
|
8172
8102
|
deps.state.currentSessionId = resolveCurrentSessionId(ctx.sessionManager);
|
|
8173
8103
|
let message = (paramsWithResolvedCwd.message ?? paramsWithResolvedCwd.task ?? "").trim();
|
|
8174
8104
|
if (!message)
|
|
@@ -8176,7 +8106,7 @@ function createSubagentExecutor(deps) {
|
|
|
8176
8106
|
let targetRunId = paramsWithResolvedCwd.runId ?? paramsWithResolvedCwd.id;
|
|
8177
8107
|
if (paramsWithResolvedCwd.dir)
|
|
8178
8108
|
try {
|
|
8179
|
-
let location = resolveAsyncRunLocation(paramsWithResolvedCwd, ASYNC_DIR, RESULTS_DIR), runId2 = location.resolvedId ?? targetRunId ??
|
|
8109
|
+
let location = resolveAsyncRunLocation(paramsWithResolvedCwd, ASYNC_DIR, RESULTS_DIR), runId2 = location.resolvedId ?? targetRunId ?? path15.basename(location.asyncDir ?? paramsWithResolvedCwd.dir);
|
|
8180
8110
|
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 }) });
|
|
8181
8111
|
} catch (error) {
|
|
8182
8112
|
return { content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }], isError: !0, details: { mode: "management", results: [] } };
|
|
@@ -8204,7 +8134,7 @@ function createSubagentExecutor(deps) {
|
|
|
8204
8134
|
if (paramsWithResolvedCwd.dir)
|
|
8205
8135
|
try {
|
|
8206
8136
|
let location = resolveAsyncRunLocation(paramsWithResolvedCwd, ASYNC_DIR, RESULTS_DIR);
|
|
8207
|
-
return stopAsyncRun(deps.state, location.resolvedId ?? targetRunId ??
|
|
8137
|
+
return stopAsyncRun(deps.state, location.resolvedId ?? targetRunId ?? path15.basename(location.asyncDir ?? paramsWithResolvedCwd.dir), deps.kill, location);
|
|
8208
8138
|
} catch (error) {
|
|
8209
8139
|
return { content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }], isError: !0, details: { mode: "management", results: [] } };
|
|
8210
8140
|
}
|
|
@@ -8274,7 +8204,7 @@ function createSubagentExecutor(deps) {
|
|
|
8274
8204
|
let normalized = normalizeRepeatedParallelCounts(paramsWithResolvedCwd);
|
|
8275
8205
|
if (normalized.error)
|
|
8276
8206
|
return normalized.error;
|
|
8277
|
-
let
|
|
8207
|
+
let effectiveParams = normalized.params, runToolBudget = resolveToolBudget(effectiveParams.toolBudget, "toolBudget");
|
|
8278
8208
|
if (runToolBudget.error)
|
|
8279
8209
|
return buildRequestedModeError(effectiveParams, runToolBudget.error);
|
|
8280
8210
|
let configToolBudget = resolveToolBudget(deps.config.toolBudget, "config.toolBudget");
|
|
@@ -8303,6 +8233,7 @@ function createSubagentExecutor(deps) {
|
|
|
8303
8233
|
effectiveParams = contextPolicy.params;
|
|
8304
8234
|
let sessionName = resolveIntercomSessionTarget(deps.pi.getSessionName(), ctx.sessionManager.getSessionId()), intercomBridge = resolveIntercomBridge({
|
|
8305
8235
|
config: deps.config.intercomBridge,
|
|
8236
|
+
cwd: ctx.cwd,
|
|
8306
8237
|
context: effectiveParams.context,
|
|
8307
8238
|
orchestratorTarget: sessionName
|
|
8308
8239
|
}), agents = intercomBridge.active ? discoveredAgents.map((agent) => applyIntercomBridgeToAgent(agent, intercomBridge)) : discoveredAgents, inheritedNestedRoute = resolveInheritedNestedRouteFromEnv(), nestedParentAddress = inheritedNestedRoute ? resolveNestedParentAddressFromEnv() : void 0, nestedRoute = inheritedNestedRoute ?? createNestedRoute(runId), shareEnabled = effectiveParams.share === !0, hasChain = (effectiveParams.chain?.length ?? 0) > 0, hasTasks = (effectiveParams.tasks?.length ?? 0) > 0, hasSingle = !hasChain && !hasTasks && !!effectiveParams.task, allowClarifyTaskPrompt = hasChain && effectiveParams.clarify === !0 && ctx.hasUI && !(effectiveParams.chain?.some(isParallelStep) ?? !1), validationError = validateExecutionInput(effectiveParams, hasChain, hasTasks, hasSingle, allowClarifyTaskPrompt);
|
|
@@ -8325,23 +8256,23 @@ function createSubagentExecutor(deps) {
|
|
|
8325
8256
|
} catch (error) {
|
|
8326
8257
|
return toExecutionErrorResult(effectiveParams, error);
|
|
8327
8258
|
}
|
|
8328
|
-
let
|
|
8259
|
+
let backgroundRequestedWhileClarifying = (hasChain || hasTasks) && effectiveParams.async === !0 && effectiveParams.clarify === !0, effectiveAsync = subagentLaunchRunsAsync(effectiveParams), controlConfig = resolveControlConfig(deps.config.control, effectiveParams.control), artifactConfig = {
|
|
8329
8260
|
...DEFAULT_ARTIFACT_CONFIG,
|
|
8330
8261
|
enabled: effectiveParams.artifacts !== !1
|
|
8331
8262
|
}, artifactsDir = getArtifactsDir(parentSessionFile, effectiveCwd), sessionRoot;
|
|
8332
8263
|
if (effectiveParams.sessionDir)
|
|
8333
|
-
sessionRoot =
|
|
8264
|
+
sessionRoot = path15.resolve(deps.expandTilde(effectiveParams.sessionDir));
|
|
8334
8265
|
else {
|
|
8335
|
-
let baseSessionRoot = deps.config.defaultSessionDir ?
|
|
8336
|
-
sessionRoot =
|
|
8266
|
+
let baseSessionRoot = deps.config.defaultSessionDir ? path15.resolve(deps.expandTilde(deps.config.defaultSessionDir)) : deps.getSubagentSessionRoot(parentSessionFile);
|
|
8267
|
+
sessionRoot = path15.join(baseSessionRoot, runId);
|
|
8337
8268
|
}
|
|
8338
8269
|
try {
|
|
8339
|
-
|
|
8270
|
+
fs15.mkdirSync(sessionRoot, { recursive: !0 });
|
|
8340
8271
|
} catch (error) {
|
|
8341
8272
|
let message = error instanceof Error ? error.message : String(error);
|
|
8342
8273
|
return toExecutionErrorResult(effectiveParams, new Error(`Failed to create session directory '${sessionRoot}': ${message}`));
|
|
8343
8274
|
}
|
|
8344
|
-
let sessionDirForIndex = (idx) =>
|
|
8275
|
+
let sessionDirForIndex = (idx) => path15.join(sessionRoot, `run-${idx ?? 0}`), forkSessionFileForTask = (agentName, idx = 0, modelOverride) => {
|
|
8345
8276
|
if (shouldForkAgent(contextPolicy, agentName))
|
|
8346
8277
|
return prepareForkThinking(agentName, idx, modelOverride), forkSessionFileForIndex(idx);
|
|
8347
8278
|
}, forkThinkingOverrideForTask = (agentName, idx = 0, modelOverride) => {
|
|
@@ -8350,7 +8281,7 @@ function createSubagentExecutor(deps) {
|
|
|
8350
8281
|
prepareForkThinking(agentName, idx, modelOverride);
|
|
8351
8282
|
let override = forkThinkingOverrideForIndex(idx);
|
|
8352
8283
|
return override === "off" && forkThinkingDowngrades.set(idx, agentName), override;
|
|
8353
|
-
}, childSessionFileForTask = (agentName, idx, modelOverride) => forkSessionFileForTask(agentName, idx, modelOverride) ??
|
|
8284
|
+
}, childSessionFileForTask = (agentName, idx, modelOverride) => forkSessionFileForTask(agentName, idx, modelOverride) ?? path15.join(sessionDirForIndex(idx), "session.jsonl"), childSessionFileForIndex = (idx) => path15.join(sessionDirForIndex(idx), "session.jsonl");
|
|
8354
8285
|
try {
|
|
8355
8286
|
effectiveParams.clarify === !0 && ctx.hasUI || preflightForkSessionsForStaticTasks(effectiveParams, contextPolicy, forkSessionFileForTask, deps.config.chain?.dynamicFanout?.maxItems);
|
|
8356
8287
|
} catch (error) {
|
|
@@ -8480,10 +8411,7 @@ function createSubagentExecutor(deps) {
|
|
|
8480
8411
|
};
|
|
8481
8412
|
return { execute: async (id, params, signal, onUpdate, ctx) => {
|
|
8482
8413
|
let requestParams = resolveSubagentRequestParams(params);
|
|
8483
|
-
if (requestParams.action)
|
|
8484
|
-
return execute(id, requestParams, signal, onUpdate, ctx);
|
|
8485
|
-
let { depth } = checkSubagentDepth(deps.config.maxSubagentDepth), dispatchParams = applyForceTopLevelAsyncOverride(requestParams, depth, deps.config.forceTopLevelAsync === !0);
|
|
8486
|
-
if (!(dispatchParams.clarify === !0 || (dispatchParams.async ?? deps.asyncByDefault) !== !0))
|
|
8414
|
+
if (requestParams.action || !!subagentLaunchRunsAsync(requestParams))
|
|
8487
8415
|
return execute(id, requestParams, signal, onUpdate, ctx);
|
|
8488
8416
|
let limit = resolveTopLevelParallelConcurrency(void 0, deps.config.parallel?.concurrency), inFlight = deps.state.foregroundSubagentInFlight ?? 0;
|
|
8489
8417
|
if (inFlight >= limit)
|