@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,38 +3,70 @@ import { randomUUID } from "node:crypto";
|
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
import * as path from "node:path";
|
|
5
5
|
import { Type } from "typebox";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { subagentCommunicationEnabled } from "../../../../core/settings-manager.js";
|
|
7
|
+
import { getAgentDir } from "../shared/utils.js";
|
|
8
|
+
import { SUBAGENT_CHILD_AGENT_ENV, SUBAGENT_CHILD_INDEX_ENV, SUBAGENT_ORCHESTRATOR_SESSION_ID_ENV, SUBAGENT_ORCHESTRATOR_TARGET_ENV, SUBAGENT_RUN_ID_ENV, SUBAGENT_SUPERVISOR_CHANNEL_DIR_ENV, SUBAGENT_SUPERVISOR_SESSION_ID_ENV, } from "../runs/shared/pi-args.js";
|
|
9
|
+
import { ASYNC_DIR, INTERCOM_DETACH_REQUEST_EVENT, POLL_INTERVAL_MS, SUBAGENT_CONTROL_EVENT } from "../shared/types.js";
|
|
8
10
|
import { writeAtomicJson } from "../shared/atomic-json.js";
|
|
9
|
-
|
|
11
|
+
import { askRunningAsyncChild, reconcileAsyncQuestion } from "./supervisor-ask.js";
|
|
12
|
+
import { CHILD_DESCRIPTION_ENV, SUPERVISOR_PROGRESS_TYPE, SUPERVISOR_PROTOCOL_VERSION, SUPERVISOR_REQUEST_TYPE, legacySupervisorBody, readCommunication, resolveCommunicationPeer, supervisorProtocolAvailable } from "./communication.js";
|
|
13
|
+
import { renderCommunicationCall, renderCommunicationCard, renderCommunicationResult } from "../tui/communication.js";
|
|
14
|
+
import { stopRequestPath } from "../runs/background/control-channel.js";
|
|
15
|
+
import { readStatus } from "../shared/utils.js";
|
|
16
|
+
import { answerSupervisorQuestion, cancelPendingSupervisorQuestionsForOwner, cancelSupervisorQuestion, claimQuestionNotification, formatSupervisorQuestionAnswer, hasOutstandingQuestionForChild, isQuestionWaitActive, listSupervisorChannelDirs, listSupervisorQuestions, markSupervisorQuestionDelivered, outstandingQuestionsForChild, pendingSupervisorQuestionsForDelivery, QUESTIONS_DIR, readSupervisorQuestion, resolveSupervisorChannelDir as resolveQuestionChannelDir, SUBAGENT_QUESTION_EVENT, SUBAGENT_SUPERVISOR_ANSWER_TYPE, SUPERVISOR_CHANNEL_ROOT, supervisorQuestionIsTerminal, supervisorQuestionPublicState, } from "./supervisor-questions.js";
|
|
10
17
|
const REQUESTS_DIR = "requests";
|
|
11
18
|
const REPLIES_DIR = "replies";
|
|
12
19
|
export const NATIVE_SUPERVISOR_TOOL_NAME = "subagent_supervisor";
|
|
20
|
+
export const resolveSupervisorChannelDir = resolveQuestionChannelDir;
|
|
13
21
|
const MAX_MESSAGE_BYTES = 64 * 1024;
|
|
14
22
|
const DEFAULT_ASK_TIMEOUT_MS = 10 * 60 * 1000;
|
|
15
23
|
const CHANNEL_POLL_MS = Math.min(POLL_INTERVAL_MS, 500);
|
|
16
24
|
const STALE_EMPTY_CHANNEL_AGE_MS = 60 * 1000;
|
|
17
25
|
const STALE_EMPTY_CHANNEL_CLEANUP_INTERVAL_MS = 60 * 1000;
|
|
26
|
+
const PARENT_ASK_DESCRIPTION = [
|
|
27
|
+
"Ask a specific running async child, or reply to a child supervisor request. Asking is unavailable when Subagent communication is off in /settings; final results still arrive normally.",
|
|
28
|
+
"Ask only when the child owns missing context, the answer changes a concrete next decision, and waiting risks a block or rework.",
|
|
29
|
+
"Use available results first, batch related questions, and keep working while awaiting the answer. Do not use ask for status checks, polling, duplicate queries, or step-by-step supervision. Follow up only when the answer leaves the original decision unresolved.",
|
|
30
|
+
"Returns a question id immediately. The child's explicit answer is delivered separately from the final run result.",
|
|
31
|
+
'Ask: { action: "ask", id: "<runId>", index?: 0, childId?: "...", reason: "<concrete decision>", message: "..." }',
|
|
32
|
+
"Use pending or list to find child requests awaiting your reply; status reports channel availability. Free-form send is unsupported. Asking never revives a child or changes its assignment.",
|
|
33
|
+
'Reply: { action: "reply", replyTo: "<requestId>", message: "..." }',
|
|
34
|
+
].join(" ");
|
|
35
|
+
const CHILD_CONTACT_DESCRIPTION = [
|
|
36
|
+
"Contact the supervisor for decisions outside your assigned authority, safety concerns, or blockers. Make reversible implementation choices within your scope yourself.",
|
|
37
|
+
"need_decision/interview_request wait for a reply: state the blocked decision, evidence, and recommended choice. Consolidate related questions; continue independent work before opening a blocking request.",
|
|
38
|
+
"Return one self-contained final report with outcomes, verification, blockers, and artifact paths; the runtime delivers it. Routine work already appears in activity indicators.",
|
|
39
|
+
"For parent questions use action='reply' with replyTo set to the question id. Answer from current findings and uncertainty; do not start extra investigation just to reply. Continue the assigned task after replying.",
|
|
40
|
+
"Do not open a blocking need_decision while a parent question is already outstanding for this child.",
|
|
41
|
+
].join(" ");
|
|
18
42
|
const ContactSupervisorParamsSchema = Type.Object({
|
|
19
|
-
reason: Type.String({ enum: ["need_decision", "interview_request", "progress_update"] }),
|
|
43
|
+
reason: Type.Optional(Type.String({ enum: ["need_decision", "interview_request", "progress_update", "handoff"] })),
|
|
20
44
|
message: Type.Optional(Type.String()),
|
|
21
45
|
interview: Type.Optional(Type.Unsafe({ type: "object", additionalProperties: true })),
|
|
46
|
+
action: Type.Optional(Type.String({ enum: ["reply"] })),
|
|
47
|
+
replyTo: Type.Optional(Type.String()),
|
|
22
48
|
}, { additionalProperties: false });
|
|
23
49
|
const IntercomParamsSchema = Type.Object({
|
|
24
50
|
action: Type.String({ enum: ["list", "send", "ask", "reply", "pending", "status"] }),
|
|
25
51
|
to: Type.Optional(Type.String()),
|
|
26
52
|
message: Type.Optional(Type.String()),
|
|
27
53
|
replyTo: Type.Optional(Type.String()),
|
|
54
|
+
id: Type.Optional(Type.String({ description: "Async run id for action='ask'." })),
|
|
55
|
+
index: Type.Optional(Type.Integer({ minimum: 0, description: "Zero-based child index for action='ask'. Select index or childId when more than one child is running." })),
|
|
56
|
+
childId: Type.Optional(Type.String({ description: "Private child identity for action='ask'." })),
|
|
57
|
+
reason: Type.Optional(Type.String({ description: "Concrete decision the child's answer will change. Required for action='ask'." })),
|
|
58
|
+
}, { additionalProperties: false });
|
|
59
|
+
const ParentSupervisorParamsSchema = Type.Object({
|
|
60
|
+
...IntercomParamsSchema.properties,
|
|
61
|
+
action: Type.String({ enum: ["list", "ask", "reply", "pending", "status"] }),
|
|
28
62
|
}, { additionalProperties: false });
|
|
29
63
|
function safeSegment(value) {
|
|
30
64
|
return value.trim().replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "unknown";
|
|
31
65
|
}
|
|
32
|
-
export function resolveSupervisorChannelDir(runId, agent, childIndex) {
|
|
33
|
-
return path.join(SUPERVISOR_CHANNEL_ROOT, `${safeSegment(runId)}-${safeSegment(agent)}-${childIndex}`);
|
|
34
|
-
}
|
|
35
66
|
export function ensureSupervisorChannelDir(channelDir) {
|
|
36
67
|
fs.mkdirSync(path.join(channelDir, REQUESTS_DIR), { recursive: true, mode: 0o700 });
|
|
37
68
|
fs.mkdirSync(path.join(channelDir, REPLIES_DIR), { recursive: true, mode: 0o700 });
|
|
69
|
+
fs.mkdirSync(path.join(channelDir, QUESTIONS_DIR), { recursive: true, mode: 0o700 });
|
|
38
70
|
}
|
|
39
71
|
function requestPath(channelDir, requestId) {
|
|
40
72
|
return path.join(channelDir, REQUESTS_DIR, `${safeSegment(requestId)}.json`);
|
|
@@ -61,10 +93,53 @@ function readChildMetadata() {
|
|
|
61
93
|
childIndex: Number(rawIndex),
|
|
62
94
|
orchestratorTarget: readTextEnv(SUBAGENT_ORCHESTRATOR_TARGET_ENV),
|
|
63
95
|
orchestratorSessionId,
|
|
96
|
+
supervisorSessionId: readTextEnv(SUBAGENT_SUPERVISOR_SESSION_ID_ENV),
|
|
64
97
|
childTarget: readTextEnv("PI_SUBAGENT_INTERCOM_SESSION_NAME"),
|
|
98
|
+
description: readTextEnv(CHILD_DESCRIPTION_ENV),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function readChildQuestionOwner(metadata = readChildMetadata()) {
|
|
102
|
+
if (!metadata)
|
|
103
|
+
return undefined;
|
|
104
|
+
const readyAt = Number(process.env.PI_SUBAGENT_STEER_READY_AT);
|
|
105
|
+
if (!Number.isFinite(readyAt) || readyAt <= 0)
|
|
106
|
+
return undefined;
|
|
107
|
+
return {
|
|
108
|
+
runId: metadata.runId,
|
|
109
|
+
childIndex: metadata.childIndex,
|
|
110
|
+
childId: metadata.agent,
|
|
111
|
+
pid: process.pid,
|
|
112
|
+
readyAt,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function answerParentQuestion(params) {
|
|
116
|
+
const metadata = readChildMetadata();
|
|
117
|
+
const owner = readChildQuestionOwner(metadata);
|
|
118
|
+
if (!metadata || !owner)
|
|
119
|
+
throw new Error("Native supervisor channel is not available for this subagent.");
|
|
120
|
+
const replyTo = params.replyTo?.trim();
|
|
121
|
+
if (!replyTo)
|
|
122
|
+
throw new Error("action='reply' requires replyTo with the parent question id.");
|
|
123
|
+
const message = params.message?.trim();
|
|
124
|
+
if (!message)
|
|
125
|
+
throw new Error("message is required for supervisor question replies.");
|
|
126
|
+
const question = readSupervisorQuestion(metadata.channelDir, replyTo);
|
|
127
|
+
if (question?.parentSessionId !== (metadata.supervisorSessionId ?? metadata.orchestratorSessionId))
|
|
128
|
+
throw new Error("Question belongs to a different supervisor session.");
|
|
129
|
+
const answered = answerSupervisorQuestion(metadata.channelDir, replyTo, message, owner);
|
|
130
|
+
return {
|
|
131
|
+
content: [{ type: "text", text: `Replied to parent question ${answered.id}. Continue the assigned task.` }],
|
|
132
|
+
details: {
|
|
133
|
+
replyTo: answered.id,
|
|
134
|
+
state: supervisorQuestionPublicState(answered),
|
|
135
|
+
answered: true,
|
|
136
|
+
communication: { direction: "to", peer: "Supervisor", kind: "reply", message },
|
|
137
|
+
},
|
|
65
138
|
};
|
|
66
139
|
}
|
|
67
140
|
function reasonHeading(reason) {
|
|
141
|
+
if (reason === "handoff")
|
|
142
|
+
return "Subagent dependency handoff.";
|
|
68
143
|
if (reason === "interview_request")
|
|
69
144
|
return "Subagent requests a structured supervisor interview.";
|
|
70
145
|
if (reason === "progress_update")
|
|
@@ -90,6 +165,39 @@ function formatChildMessage(input) {
|
|
|
90
165
|
}
|
|
91
166
|
return lines.join("\n").trimEnd();
|
|
92
167
|
}
|
|
168
|
+
function communicationKind(reason) {
|
|
169
|
+
return reason === "progress_update" ? "progress" : reason === "handoff" ? "handoff" : reason === "interview_request" ? "interview" : "request";
|
|
170
|
+
}
|
|
171
|
+
function communicationBody(message, interview, protocolVersion) {
|
|
172
|
+
const body = protocolVersion === SUPERVISOR_PROTOCOL_VERSION ? message : legacySupervisorBody(message);
|
|
173
|
+
return interview !== undefined && protocolVersion === SUPERVISOR_PROTOCOL_VERSION ? `${body}\n\n${JSON.stringify(interview, null, 2)}` : body;
|
|
174
|
+
}
|
|
175
|
+
function requestCommunication(request, state) {
|
|
176
|
+
return {
|
|
177
|
+
direction: "from",
|
|
178
|
+
peer: resolveCommunicationPeer(state, request.runId, request.childIndex, request.agent, request.description),
|
|
179
|
+
message: communicationBody(request.message, request.interview, request.protocolVersion),
|
|
180
|
+
kind: communicationKind(request.reason),
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
export function registerSupervisorRenderers(pi, state) {
|
|
184
|
+
for (const customType of [SUPERVISOR_REQUEST_TYPE, SUBAGENT_SUPERVISOR_ANSWER_TYPE]) {
|
|
185
|
+
pi.registerMessageRenderer(customType, (message, options, theme) => {
|
|
186
|
+
const details = message.details;
|
|
187
|
+
const communication = readCommunication(details?.communication) ?? {
|
|
188
|
+
direction: "from",
|
|
189
|
+
peer: details?.runId ? resolveCommunicationPeer(state, details.runId, details.childIndex ?? 0, details.childId ?? details.agent) : "Subagent",
|
|
190
|
+
message: legacySupervisorBody(typeof message.content === "string" ? message.content : message.content.filter((part) => part.type === "text").map((part) => part.text).join("\n")),
|
|
191
|
+
kind: customType === SUBAGENT_SUPERVISOR_ANSWER_TYPE ? "answer" : communicationKind(details?.reason),
|
|
192
|
+
};
|
|
193
|
+
return renderCommunicationCard(communication, options.expanded, theme);
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
pi.registerEntryRenderer(SUPERVISOR_PROGRESS_TYPE, (entry, options, theme) => {
|
|
197
|
+
const communication = readCommunication(entry.data?.communication);
|
|
198
|
+
return communication ? renderCommunicationCard(communication, options.expanded, theme) : undefined;
|
|
199
|
+
});
|
|
200
|
+
}
|
|
93
201
|
function parseStructuredReply(message) {
|
|
94
202
|
const trimmed = message.trim();
|
|
95
203
|
const fenced = trimmed.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/i)?.[1]?.trim();
|
|
@@ -143,21 +251,37 @@ async function waitForReply(channelDir, requestId, deadline, signal) {
|
|
|
143
251
|
throw new Error("Timed out waiting for supervisor reply.");
|
|
144
252
|
}
|
|
145
253
|
async function sendSupervisorRequest(params, signal) {
|
|
254
|
+
if (params.action === "reply" || params.replyTo?.trim()) {
|
|
255
|
+
return answerParentQuestion(params);
|
|
256
|
+
}
|
|
146
257
|
const metadata = readChildMetadata();
|
|
147
258
|
if (!metadata)
|
|
148
259
|
throw new Error("Native supervisor channel is not available for this subagent.");
|
|
149
|
-
if (
|
|
150
|
-
throw new Error("
|
|
260
|
+
if (!params.reason)
|
|
261
|
+
throw new Error("reason is required for supervisor contact.");
|
|
262
|
+
if (signal?.aborted)
|
|
263
|
+
throw new Error("Supervisor request cancelled.");
|
|
264
|
+
const protocolVersion = supervisorProtocolAvailable() ? SUPERVISOR_PROTOCOL_VERSION : undefined;
|
|
265
|
+
if (params.reason === "handoff" && !protocolVersion)
|
|
266
|
+
throw new Error("This supervisor uses the legacy protocol. Send actionable findings with progress_update instead.");
|
|
267
|
+
const expectsReply = params.reason === "need_decision" || params.reason === "interview_request";
|
|
268
|
+
if (expectsReply && hasOutstandingQuestionForChild(metadata.channelDir, metadata.childIndex, metadata.agent)) {
|
|
269
|
+
throw new Error("A parent question is already outstanding for this child. Answer it with action='reply' before opening a blocking supervisor request.");
|
|
270
|
+
}
|
|
271
|
+
if (!params.message?.trim() && params.reason !== "interview_request") {
|
|
272
|
+
throw new Error("message is required for supervisor contact.");
|
|
151
273
|
}
|
|
152
274
|
ensureSupervisorChannelDir(metadata.channelDir);
|
|
153
275
|
const requestId = randomUUID();
|
|
154
|
-
const expectsReply = params.reason !== "progress_update";
|
|
155
276
|
const createdAt = Date.now();
|
|
156
277
|
const replyDeadline = createdAt + askTimeoutMs();
|
|
157
278
|
const expiresAt = expectsReply ? replyDeadline : undefined;
|
|
158
|
-
const message = formatChildMessage({ ...metadata, reason: params.reason, message: params.message, interview: params.interview });
|
|
279
|
+
const message = protocolVersion ? params.message?.trim() || "Structured supervisor input requested." : formatChildMessage({ ...metadata, reason: params.reason, message: params.message, interview: params.interview });
|
|
280
|
+
const communication = { direction: "to", peer: "Supervisor", kind: communicationKind(params.reason), message: communicationBody(message, params.interview, protocolVersion) };
|
|
159
281
|
const request = {
|
|
160
282
|
type: "subagent.supervisor.request",
|
|
283
|
+
...(protocolVersion ? { protocolVersion } : {}),
|
|
284
|
+
...(metadata.description ? { description: metadata.description } : {}),
|
|
161
285
|
id: requestId,
|
|
162
286
|
createdAt,
|
|
163
287
|
...(expiresAt !== undefined ? { expiresAt } : {}),
|
|
@@ -166,6 +290,7 @@ async function sendSupervisorRequest(params, signal) {
|
|
|
166
290
|
expectsReply,
|
|
167
291
|
...(metadata.orchestratorTarget ? { orchestratorTarget: metadata.orchestratorTarget } : {}),
|
|
168
292
|
...(metadata.orchestratorSessionId ? { orchestratorSessionId: metadata.orchestratorSessionId } : {}),
|
|
293
|
+
...(metadata.supervisorSessionId ? { supervisorSessionId: metadata.supervisorSessionId } : {}),
|
|
169
294
|
runId: metadata.runId,
|
|
170
295
|
agent: metadata.agent,
|
|
171
296
|
childIndex: metadata.childIndex,
|
|
@@ -176,15 +301,20 @@ async function sendSupervisorRequest(params, signal) {
|
|
|
176
301
|
if (Buffer.byteLength(serialized, "utf-8") > MAX_MESSAGE_BYTES)
|
|
177
302
|
throw new Error("Supervisor request is too large.");
|
|
178
303
|
writeAtomicJson(requestPath(metadata.channelDir, requestId), request);
|
|
304
|
+
if (expectsReply) {
|
|
305
|
+
for (const question of outstandingQuestionsForChild(metadata.channelDir, metadata.childIndex, metadata.agent)) {
|
|
306
|
+
cancelSupervisorQuestion(metadata.channelDir, question.id, "child needs a supervisor decision; reply to its request first");
|
|
307
|
+
}
|
|
308
|
+
}
|
|
179
309
|
if (!expectsReply) {
|
|
180
310
|
return {
|
|
181
|
-
content: [{ type: "text", text: "Supervisor progress update queued." }],
|
|
182
|
-
details: {
|
|
311
|
+
content: [{ type: "text", text: params.reason === "handoff" ? "Dependency handoff queued. Continue independent work." : protocolVersion ? "Progress recorded for the UI only; the supervisor model will not receive it." : "Supervisor progress update queued." }],
|
|
312
|
+
details: { queued: true, requestId, reason: params.reason, communication },
|
|
183
313
|
};
|
|
184
314
|
}
|
|
185
315
|
try {
|
|
186
316
|
const reply = await waitForReply(metadata.channelDir, requestId, replyDeadline, signal);
|
|
187
|
-
const details = { requestId, reason: params.reason };
|
|
317
|
+
const details = { requestId, reason: params.reason, communication, response: reply.message };
|
|
188
318
|
if (params.reason === "interview_request") {
|
|
189
319
|
const structured = parseStructuredReply(reply.message);
|
|
190
320
|
if (structured.error)
|
|
@@ -211,15 +341,23 @@ function hasTool(pi, name) {
|
|
|
211
341
|
}
|
|
212
342
|
}
|
|
213
343
|
export function registerNativeSupervisorClient(pi, options = {}) {
|
|
214
|
-
if (!readChildMetadata())
|
|
344
|
+
if (process.env.PI_SUBAGENT_COMMUNICATION_ENABLED === "0" || !readChildMetadata())
|
|
215
345
|
return;
|
|
216
346
|
const includeIntercomFallback = options.includeIntercomFallback !== false;
|
|
217
347
|
if (!hasTool(pi, "contact_supervisor")) {
|
|
218
348
|
const tool = {
|
|
219
349
|
name: "contact_supervisor",
|
|
220
350
|
label: "Contact Supervisor",
|
|
221
|
-
description:
|
|
222
|
-
|
|
351
|
+
description: `${CHILD_CONTACT_DESCRIPTION} ${supervisorProtocolAvailable()
|
|
352
|
+
? "handoff delivers actionable dependency findings or corrections without waiting: state what changes and consolidate evidence or reference one artifact. progress_update is UI-only and never reaches the supervisor model."
|
|
353
|
+
: "This legacy supervisor delivers progress_update to its model. Reserve it for actionable dependency findings or corrections."}`,
|
|
354
|
+
parameters: supervisorProtocolAvailable() ? ContactSupervisorParamsSchema : Type.Object({ ...ContactSupervisorParamsSchema.properties, reason: Type.Optional(Type.String({ enum: ["need_decision", "interview_request", "progress_update"] })) }, { additionalProperties: false }),
|
|
355
|
+
renderCall(args, theme, context) {
|
|
356
|
+
return renderCommunicationCall("contact_supervisor", args, theme, context, { direction: "to", peer: "Supervisor", kind: args.action === "reply" ? "reply" : communicationKind(args.reason), message: communicationBody(args.message ?? "", args.interview, SUPERVISOR_PROTOCOL_VERSION) });
|
|
357
|
+
},
|
|
358
|
+
renderResult(result, options, theme, context) {
|
|
359
|
+
return renderCommunicationResult(result.content, result.details, options.expanded, context.isError, theme);
|
|
360
|
+
},
|
|
223
361
|
execute(_id, params, signal) {
|
|
224
362
|
return sendSupervisorRequest(params, signal);
|
|
225
363
|
},
|
|
@@ -230,8 +368,14 @@ export function registerNativeSupervisorClient(pi, options = {}) {
|
|
|
230
368
|
const tool = {
|
|
231
369
|
name: "intercom",
|
|
232
370
|
label: "Intercom",
|
|
233
|
-
description: "
|
|
371
|
+
description: "Supervisor-only fallback; sibling discovery and sibling messaging are unavailable. Use contact_supervisor for decisions, replies, and dependency handoffs. list reports no sibling sessions; ask blocks for a supervisor decision; send is progress only.",
|
|
234
372
|
parameters: IntercomParamsSchema,
|
|
373
|
+
renderCall(args, theme, context) {
|
|
374
|
+
return renderCommunicationCall("intercom", args, theme, context, args.message ? { direction: "to", peer: "Supervisor", kind: args.action === "ask" ? "request" : "progress", message: args.message } : undefined);
|
|
375
|
+
},
|
|
376
|
+
renderResult(result, options, theme, context) {
|
|
377
|
+
return renderCommunicationResult(result.content, result.details, options.expanded, context.isError, theme);
|
|
378
|
+
},
|
|
235
379
|
async execute(_id, params, signal) {
|
|
236
380
|
const action = params.action;
|
|
237
381
|
if (action === "status")
|
|
@@ -253,9 +397,19 @@ function parseRequestFile(file, channelDir) {
|
|
|
253
397
|
const parsed = JSON.parse(fs.readFileSync(file, "utf-8"));
|
|
254
398
|
if (parsed.type !== "subagent.supervisor.request")
|
|
255
399
|
return undefined;
|
|
400
|
+
if (parsed.supervisorSessionId !== undefined && (typeof parsed.supervisorSessionId !== "string" || !parsed.supervisorSessionId.trim()))
|
|
401
|
+
return undefined;
|
|
256
402
|
if (typeof parsed.id !== "string" || !parsed.id)
|
|
257
403
|
return undefined;
|
|
258
|
-
if (parsed.reason !== "need_decision" && parsed.reason !== "interview_request" && parsed.reason !== "progress_update")
|
|
404
|
+
if (parsed.reason !== "need_decision" && parsed.reason !== "interview_request" && parsed.reason !== "progress_update" && parsed.reason !== "handoff")
|
|
405
|
+
return undefined;
|
|
406
|
+
if (parsed.protocolVersion !== undefined && parsed.protocolVersion !== SUPERVISOR_PROTOCOL_VERSION)
|
|
407
|
+
return undefined;
|
|
408
|
+
if (parsed.protocolVersion === SUPERVISOR_PROTOCOL_VERSION && parsed.expectsReply !== (parsed.reason === "need_decision" || parsed.reason === "interview_request"))
|
|
409
|
+
return undefined;
|
|
410
|
+
if (parsed.reason === "handoff" && parsed.protocolVersion !== SUPERVISOR_PROTOCOL_VERSION)
|
|
411
|
+
return undefined;
|
|
412
|
+
if (parsed.description !== undefined && typeof parsed.description !== "string")
|
|
259
413
|
return undefined;
|
|
260
414
|
if (typeof parsed.message !== "string" || !parsed.message)
|
|
261
415
|
return undefined;
|
|
@@ -267,6 +421,25 @@ function parseRequestFile(file, channelDir) {
|
|
|
267
421
|
return undefined;
|
|
268
422
|
}
|
|
269
423
|
}
|
|
424
|
+
export function hasPendingBlockingSupervisorRequest(runId, sessionId, now = Date.now()) {
|
|
425
|
+
if (!runId)
|
|
426
|
+
return false;
|
|
427
|
+
for (const { channelDir, file } of listRequestFiles()) {
|
|
428
|
+
const request = parseRequestFile(file, channelDir);
|
|
429
|
+
if (!request?.expectsReply)
|
|
430
|
+
continue;
|
|
431
|
+
if (request.runId !== runId)
|
|
432
|
+
continue;
|
|
433
|
+
if (sessionId && (request.supervisorSessionId ?? request.orchestratorSessionId) !== sessionId)
|
|
434
|
+
continue;
|
|
435
|
+
if (fs.existsSync(replyPath(request.channelDir, request.id)))
|
|
436
|
+
continue;
|
|
437
|
+
if (now > requestExpiresAt(request, now))
|
|
438
|
+
continue;
|
|
439
|
+
return true;
|
|
440
|
+
}
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
270
443
|
function listRequestFiles() {
|
|
271
444
|
let channelEntries;
|
|
272
445
|
try {
|
|
@@ -332,7 +505,8 @@ function removeEmptyDirectory(dir) {
|
|
|
332
505
|
function removeStaleEmptySupervisorChannel(channelDir, nowMs) {
|
|
333
506
|
const requestsDir = path.join(channelDir, REQUESTS_DIR);
|
|
334
507
|
const repliesDir = path.join(channelDir, REPLIES_DIR);
|
|
335
|
-
const
|
|
508
|
+
const questionsPath = path.join(channelDir, QUESTIONS_DIR);
|
|
509
|
+
const newestKnownMtimeMs = Math.max(directoryMtimeMs(channelDir), directoryMtimeMs(requestsDir), directoryMtimeMs(repliesDir), directoryMtimeMs(questionsPath));
|
|
336
510
|
if (nowMs - newestKnownMtimeMs < STALE_EMPTY_CHANNEL_AGE_MS)
|
|
337
511
|
return false;
|
|
338
512
|
const requestEntries = readDirectoryEntries(requestsDir);
|
|
@@ -341,10 +515,15 @@ function removeStaleEmptySupervisorChannel(channelDir, nowMs) {
|
|
|
341
515
|
const replyEntries = readDirectoryEntries(repliesDir);
|
|
342
516
|
if (!replyEntries || replyEntries.length > 0)
|
|
343
517
|
return false;
|
|
518
|
+
const questionEntries = readDirectoryEntries(questionsPath);
|
|
519
|
+
if (!questionEntries || questionEntries.length > 0)
|
|
520
|
+
return false;
|
|
344
521
|
if (!removeEmptyDirectory(requestsDir))
|
|
345
522
|
return false;
|
|
346
523
|
if (!removeEmptyDirectory(repliesDir))
|
|
347
524
|
return false;
|
|
525
|
+
if (!removeEmptyDirectory(questionsPath))
|
|
526
|
+
return false;
|
|
348
527
|
if (!removeEmptyDirectory(channelDir))
|
|
349
528
|
return false;
|
|
350
529
|
return true;
|
|
@@ -384,9 +563,19 @@ function currentContextSessionId(state, ctx) {
|
|
|
384
563
|
}
|
|
385
564
|
return state.currentSessionId ?? undefined;
|
|
386
565
|
}
|
|
566
|
+
function currentSupervisorSessionId(state, ctx) {
|
|
567
|
+
try {
|
|
568
|
+
return ctx.sessionManager.getSessionFile?.() ?? currentContextSessionId(state, ctx);
|
|
569
|
+
}
|
|
570
|
+
catch {
|
|
571
|
+
return state.currentSessionId ?? undefined;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
387
574
|
function requestMatchesContext(request, state, ctx) {
|
|
388
|
-
const currentSessionId =
|
|
389
|
-
|
|
575
|
+
const currentSessionId = request.supervisorSessionId !== undefined
|
|
576
|
+
? currentSupervisorSessionId(state, ctx)
|
|
577
|
+
: currentContextSessionId(state, ctx);
|
|
578
|
+
return Boolean(currentSessionId && (request.supervisorSessionId ?? request.orchestratorSessionId) === currentSessionId);
|
|
390
579
|
}
|
|
391
580
|
function removeRequestFile(file) {
|
|
392
581
|
try {
|
|
@@ -402,21 +591,24 @@ function requestExpiresAt(request, now) {
|
|
|
402
591
|
return expiresAt;
|
|
403
592
|
return Number.isFinite(request.createdAt) ? request.createdAt + askTimeoutMs() : now;
|
|
404
593
|
}
|
|
405
|
-
function
|
|
594
|
+
function requestRunState(request, state) {
|
|
406
595
|
if (state.foregroundControls.has(request.runId))
|
|
407
|
-
return
|
|
596
|
+
return "active";
|
|
408
597
|
const foregroundRun = state.foregroundRuns?.get(request.runId);
|
|
409
598
|
const foregroundChild = foregroundRun?.children.find((child) => child.index === request.childIndex && child.agent === request.agent)
|
|
410
599
|
?? foregroundRun?.children[request.childIndex];
|
|
411
600
|
if (foregroundChild)
|
|
412
|
-
return foregroundChild.status
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
601
|
+
return foregroundChild.status === "stopped" ? "stopped" : foregroundChild.status === "detached" ? "active" : "inactive";
|
|
602
|
+
const job = state.asyncJobs.get(request.runId) ?? state.fleetJobs?.get(request.runId);
|
|
603
|
+
const asyncDir = job?.asyncDir ?? path.join(ASYNC_DIR, safeSegment(request.runId));
|
|
604
|
+
const status = readStatus(asyncDir);
|
|
605
|
+
const runStatus = status?.state ?? job?.status;
|
|
606
|
+
const stepStatus = (status?.steps ?? job?.steps)?.[request.childIndex]?.status;
|
|
607
|
+
if (fs.existsSync(stopRequestPath(asyncDir)) || runStatus === "stopped" || job?.status === "stopped" || status?.stopped || stepStatus === "stopped")
|
|
608
|
+
return "stopped";
|
|
609
|
+
if (["complete", "failed", "paused"].includes(runStatus ?? "") || ["complete", "completed", "failed", "paused"].includes(stepStatus ?? ""))
|
|
610
|
+
return "inactive";
|
|
611
|
+
return "active";
|
|
420
612
|
}
|
|
421
613
|
function requestLifecycle(request, state, ctx, now) {
|
|
422
614
|
if (ctx && !requestMatchesContext(request, state, ctx))
|
|
@@ -427,7 +619,8 @@ function requestLifecycle(request, state, ctx, now) {
|
|
|
427
619
|
return "resolved";
|
|
428
620
|
if (request.expectsReply && now > requestExpiresAt(request, now))
|
|
429
621
|
return "expired";
|
|
430
|
-
|
|
622
|
+
const runState = requestRunState(request, state);
|
|
623
|
+
if (runState === "stopped" || (request.expectsReply && runState === "inactive"))
|
|
431
624
|
return "inactive";
|
|
432
625
|
return "pending";
|
|
433
626
|
}
|
|
@@ -449,8 +642,10 @@ function formatPendingLine(request) {
|
|
|
449
642
|
const replyHint = request.expectsReply ? ` Reply: ${NATIVE_SUPERVISOR_TOOL_NAME}({ action: "reply", replyTo: "${request.id}", message: "..." })` : "";
|
|
450
643
|
return `- ${request.id}: ${request.agent} [${request.runId}#${request.childIndex}] ${request.reason}.${replyHint}`;
|
|
451
644
|
}
|
|
452
|
-
function requestVisibleText(request) {
|
|
453
|
-
const lines = [
|
|
645
|
+
function requestVisibleText(request, communication) {
|
|
646
|
+
const lines = [`From: ${communication.peer}`, "", communication.message];
|
|
647
|
+
if (request.reason === "interview_request")
|
|
648
|
+
lines.push("", "Reply with JSON matching the requested interview shape.");
|
|
454
649
|
if (request.expectsReply) {
|
|
455
650
|
lines.push("", `Reply with: ${NATIVE_SUPERVISOR_TOOL_NAME}({ action: "reply", replyTo: "${request.id}", message: "..." })`);
|
|
456
651
|
}
|
|
@@ -506,10 +701,16 @@ function buildParentIntercomTool(pending, state, name = "intercom") {
|
|
|
506
701
|
return {
|
|
507
702
|
name,
|
|
508
703
|
label: name === "intercom" ? "Intercom" : "Subagent Supervisor",
|
|
509
|
-
description:
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
704
|
+
description: PARENT_ASK_DESCRIPTION,
|
|
705
|
+
parameters: ParentSupervisorParamsSchema,
|
|
706
|
+
renderCall(args, theme, context) {
|
|
707
|
+
const request = args.action === "reply" ? pending.get(args.replyTo) : undefined;
|
|
708
|
+
const peer = request ? requestCommunication(request, state).peer : args.id ? resolveCommunicationPeer(state, args.id, args.index ?? 0, args.childId) : "Subagent";
|
|
709
|
+
return renderCommunicationCall(name, args, theme, context, args.message ? { direction: "to", peer, message: args.message, kind: args.action === "ask" ? "question" : "reply" } : undefined);
|
|
710
|
+
},
|
|
711
|
+
renderResult(result, options, theme, context) {
|
|
712
|
+
return renderCommunicationResult(result.content, result.details, options.expanded, context.isError, theme);
|
|
713
|
+
},
|
|
513
714
|
async execute(_id, params) {
|
|
514
715
|
refreshPendingRequests(pending, state, state.lastUiContext ?? undefined);
|
|
515
716
|
const input = params;
|
|
@@ -524,18 +725,84 @@ function buildParentIntercomTool(pending, state, name = "intercom") {
|
|
|
524
725
|
const request = resolvePendingRequest(pending, input);
|
|
525
726
|
writeReply(request, input.message ?? "");
|
|
526
727
|
pending.delete(request.id);
|
|
527
|
-
return { content: [{ type: "text", text: `Replied to
|
|
728
|
+
return { content: [{ type: "text", text: `Replied to ${requestCommunication(request, state).peer}.` }], details: { replyTo: request.id, runId: request.runId, agent: request.agent, communication: { ...requestCommunication(request, state), direction: "to", kind: "reply", message: input.message } } };
|
|
729
|
+
}
|
|
730
|
+
if (input.action === "ask") {
|
|
731
|
+
if (!subagentCommunicationEnabled(process.cwd(), getAgentDir())) {
|
|
732
|
+
return { content: [{ type: "text", text: "Subagent communication is off in /settings. Wait for the child to complete instead of asking it." }], isError: true, details: { disabled: true } };
|
|
733
|
+
}
|
|
734
|
+
return askRunningAsyncChild({
|
|
735
|
+
params: {
|
|
736
|
+
id: input.id,
|
|
737
|
+
index: input.index,
|
|
738
|
+
childId: input.childId,
|
|
739
|
+
reason: input.reason,
|
|
740
|
+
message: input.message,
|
|
741
|
+
},
|
|
742
|
+
state,
|
|
743
|
+
childRequests: pending.values(),
|
|
744
|
+
});
|
|
528
745
|
}
|
|
529
|
-
if (input.action === "send"
|
|
530
|
-
throw new Error("Native pi-subagents intercom
|
|
746
|
+
if (input.action === "send") {
|
|
747
|
+
throw new Error("Native pi-subagents intercom does not support free-form send. Use action='ask' for a running async child or action='reply' for a pending child request.");
|
|
531
748
|
}
|
|
532
749
|
throw new Error(`Unsupported intercom action: ${input.action}`);
|
|
533
750
|
},
|
|
534
751
|
};
|
|
535
752
|
}
|
|
753
|
+
function questionMatchesParentContext(question, state, ctx) {
|
|
754
|
+
const sessionId = currentSupervisorSessionId(state, ctx);
|
|
755
|
+
if (!sessionId || question.parentSessionId !== sessionId)
|
|
756
|
+
return false;
|
|
757
|
+
if ((state.sessionGeneration ?? 0) !== question.parentGeneration)
|
|
758
|
+
return false;
|
|
759
|
+
return true;
|
|
760
|
+
}
|
|
761
|
+
function notifyQuestionTerminal(pi, question, channelDir, state) {
|
|
762
|
+
if (!supervisorQuestionIsTerminal(question) || question.notifiedAt)
|
|
763
|
+
return;
|
|
764
|
+
pi.events?.emit(SUBAGENT_QUESTION_EVENT, {
|
|
765
|
+
questionId: question.id,
|
|
766
|
+
state: supervisorQuestionPublicState(question),
|
|
767
|
+
runId: question.runId,
|
|
768
|
+
});
|
|
769
|
+
if (isQuestionWaitActive(question.id))
|
|
770
|
+
return;
|
|
771
|
+
if (!claimQuestionNotification(channelDir, question.id))
|
|
772
|
+
return;
|
|
773
|
+
const outcome = supervisorQuestionPublicState(question);
|
|
774
|
+
const communication = { direction: "from", peer: question.childDescription ?? resolveCommunicationPeer(state, question.runId, question.childIndex, question.childId), message: question.answer ?? question.cancelReason ?? outcome, kind: "answer" };
|
|
775
|
+
pi.sendMessage({
|
|
776
|
+
customType: SUBAGENT_SUPERVISOR_ANSWER_TYPE,
|
|
777
|
+
content: formatSupervisorQuestionAnswer(question),
|
|
778
|
+
display: outcome === "answered",
|
|
779
|
+
details: {
|
|
780
|
+
questionId: question.id,
|
|
781
|
+
state: outcome,
|
|
782
|
+
communication,
|
|
783
|
+
runId: question.runId,
|
|
784
|
+
childIndex: question.childIndex,
|
|
785
|
+
childId: question.childId,
|
|
786
|
+
reason: question.reason,
|
|
787
|
+
answered: outcome === "answered",
|
|
788
|
+
delivered: Boolean(question.deliveredAt),
|
|
789
|
+
},
|
|
790
|
+
}, { triggerTurn: outcome === "answered" });
|
|
791
|
+
}
|
|
792
|
+
function pollSupervisorQuestions(pi, state, ctx) {
|
|
793
|
+
for (const channelDir of listSupervisorChannelDirs()) {
|
|
794
|
+
for (const question of listSupervisorQuestions(channelDir)) {
|
|
795
|
+
if (!questionMatchesParentContext(question, state, ctx))
|
|
796
|
+
continue;
|
|
797
|
+
const current = reconcileAsyncQuestion(channelDir, question, state);
|
|
798
|
+
notifyQuestionTerminal(pi, current, channelDir, state);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
536
802
|
export function createNativeSupervisorChannel(pi, state) {
|
|
537
803
|
const pending = new Map();
|
|
538
804
|
const seenFiles = new Set();
|
|
805
|
+
const deliveredRequests = new Set();
|
|
539
806
|
let poller;
|
|
540
807
|
let lastStaleCleanupAt = 0;
|
|
541
808
|
const registerParentTools = () => {
|
|
@@ -556,12 +823,31 @@ export function createNativeSupervisorChannel(pi, state) {
|
|
|
556
823
|
// Supervisor delivery must not fail because best-effort temp cleanup failed.
|
|
557
824
|
}
|
|
558
825
|
};
|
|
826
|
+
const cancelOwnedQuestions = (reason) => {
|
|
827
|
+
if (!state.currentSessionId)
|
|
828
|
+
return;
|
|
829
|
+
cancelPendingSupervisorQuestionsForOwner({
|
|
830
|
+
parentSessionId: state.currentSessionId,
|
|
831
|
+
parentGeneration: state.sessionGeneration ?? 0,
|
|
832
|
+
reason,
|
|
833
|
+
});
|
|
834
|
+
};
|
|
835
|
+
const settleRunQuestions = (runId, reason) => {
|
|
836
|
+
if (!state.currentSessionId)
|
|
837
|
+
return;
|
|
838
|
+
cancelPendingSupervisorQuestionsForOwner({
|
|
839
|
+
parentSessionId: state.currentSessionId,
|
|
840
|
+
runId,
|
|
841
|
+
reason,
|
|
842
|
+
});
|
|
843
|
+
};
|
|
559
844
|
const poll = () => {
|
|
560
845
|
cleanupStaleChannelsIfDue();
|
|
561
846
|
const ctx = state.lastUiContext;
|
|
562
847
|
if (!ctx)
|
|
563
848
|
return;
|
|
564
849
|
refreshPendingRequests(pending, state, ctx);
|
|
850
|
+
pollSupervisorQuestions(pi, state, ctx);
|
|
565
851
|
const now = Date.now();
|
|
566
852
|
for (const { channelDir, file } of listRequestFiles()) {
|
|
567
853
|
if (seenFiles.has(file))
|
|
@@ -575,32 +861,55 @@ export function createNativeSupervisorChannel(pi, state) {
|
|
|
575
861
|
cleanupRequestLifecycle(request, lifecycle);
|
|
576
862
|
continue;
|
|
577
863
|
}
|
|
578
|
-
seenFiles.add(file);
|
|
579
864
|
if (request.expectsReply)
|
|
580
865
|
pending.set(request.id, request);
|
|
866
|
+
if (deliveredRequests.has(request.id)) {
|
|
867
|
+
seenFiles.add(file);
|
|
868
|
+
continue;
|
|
869
|
+
}
|
|
870
|
+
const communication = requestCommunication(request, state);
|
|
871
|
+
const details = {
|
|
872
|
+
id: request.id,
|
|
873
|
+
reason: request.reason,
|
|
874
|
+
expectsReply: request.expectsReply,
|
|
875
|
+
runId: request.runId,
|
|
876
|
+
agent: request.agent,
|
|
877
|
+
childIndex: request.childIndex,
|
|
878
|
+
communication,
|
|
879
|
+
};
|
|
880
|
+
if (request.reason === "progress_update" && request.protocolVersion === SUPERVISOR_PROTOCOL_VERSION) {
|
|
881
|
+
pi.appendEntry(SUPERVISOR_PROGRESS_TYPE, details);
|
|
882
|
+
}
|
|
581
883
|
else {
|
|
582
|
-
|
|
884
|
+
pi.sendMessage({
|
|
885
|
+
customType: SUPERVISOR_REQUEST_TYPE,
|
|
886
|
+
content: requestVisibleText(request, communication),
|
|
887
|
+
display: true,
|
|
888
|
+
details,
|
|
889
|
+
}, { triggerTurn: request.expectsReply || request.reason === "handoff" });
|
|
583
890
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
details: {
|
|
589
|
-
id: request.id,
|
|
590
|
-
reason: request.reason,
|
|
591
|
-
expectsReply: request.expectsReply,
|
|
592
|
-
runId: request.runId,
|
|
593
|
-
agent: request.agent,
|
|
594
|
-
childIndex: request.childIndex,
|
|
595
|
-
},
|
|
596
|
-
});
|
|
891
|
+
deliveredRequests.add(request.id);
|
|
892
|
+
seenFiles.add(file);
|
|
893
|
+
if (!request.expectsReply)
|
|
894
|
+
removeRequestFile(request.requestFile);
|
|
597
895
|
if (request.expectsReply) {
|
|
598
|
-
|
|
896
|
+
const job = state.asyncJobs.get(request.runId);
|
|
897
|
+
if (job)
|
|
898
|
+
job.activityState = "needs_attention";
|
|
899
|
+
const events = pi.events;
|
|
900
|
+
events?.emit(INTERCOM_DETACH_REQUEST_EVENT, {
|
|
599
901
|
requestId: request.id,
|
|
600
902
|
runId: request.runId,
|
|
601
903
|
agent: request.agent,
|
|
602
904
|
childIndex: request.childIndex,
|
|
603
905
|
});
|
|
906
|
+
events?.emit(SUBAGENT_CONTROL_EVENT, {
|
|
907
|
+
type: "needs_attention",
|
|
908
|
+
to: "needs_attention",
|
|
909
|
+
runId: request.runId,
|
|
910
|
+
agent: request.agent,
|
|
911
|
+
index: request.childIndex,
|
|
912
|
+
});
|
|
604
913
|
}
|
|
605
914
|
}
|
|
606
915
|
};
|
|
@@ -609,18 +918,52 @@ export function createNativeSupervisorChannel(pi, state) {
|
|
|
609
918
|
if (poller)
|
|
610
919
|
return;
|
|
611
920
|
registerParentTools();
|
|
921
|
+
for (const entry of state.lastUiContext?.sessionManager.getBranch?.() ?? []) {
|
|
922
|
+
const data = entry.type === "custom_message" && entry.customType === SUPERVISOR_REQUEST_TYPE ? entry.details
|
|
923
|
+
: entry.type === "custom" && entry.customType === SUPERVISOR_PROGRESS_TYPE ? entry.data : undefined;
|
|
924
|
+
if (data && typeof data === "object" && "id" in data && typeof data.id === "string")
|
|
925
|
+
deliveredRequests.add(data.id);
|
|
926
|
+
}
|
|
612
927
|
poll();
|
|
613
928
|
poller = setInterval(poll, CHANNEL_POLL_MS);
|
|
614
929
|
poller.unref?.();
|
|
615
930
|
},
|
|
616
931
|
dispose: () => {
|
|
932
|
+
cancelOwnedQuestions("parent supervisor channel disposed");
|
|
617
933
|
if (poller)
|
|
618
934
|
clearInterval(poller);
|
|
619
935
|
poller = undefined;
|
|
620
936
|
pending.clear();
|
|
621
937
|
seenFiles.clear();
|
|
938
|
+
deliveredRequests.clear();
|
|
622
939
|
},
|
|
623
940
|
pending,
|
|
941
|
+
cancelOwnedQuestions,
|
|
942
|
+
settleRunQuestions,
|
|
624
943
|
};
|
|
625
944
|
}
|
|
945
|
+
export function isPendingQuestionForCurrentChild(questionId) {
|
|
946
|
+
const metadata = readChildMetadata();
|
|
947
|
+
const owner = readChildQuestionOwner(metadata);
|
|
948
|
+
if (!metadata || !owner)
|
|
949
|
+
return false;
|
|
950
|
+
return pendingSupervisorQuestionsForDelivery(metadata.channelDir, owner).some((question) => question.id === questionId && question.parentSessionId === (metadata.supervisorSessionId ?? metadata.orchestratorSessionId));
|
|
951
|
+
}
|
|
952
|
+
export function markDeliveredSupervisorQuestionFromChild(message) {
|
|
953
|
+
const match = message.match(/Parent question \(([^)\s]+)\)/);
|
|
954
|
+
if (!match?.[1])
|
|
955
|
+
return;
|
|
956
|
+
const metadata = readChildMetadata();
|
|
957
|
+
const owner = readChildQuestionOwner(metadata);
|
|
958
|
+
if (!metadata || !owner)
|
|
959
|
+
return;
|
|
960
|
+
if (!isPendingQuestionForCurrentChild(match[1]))
|
|
961
|
+
return;
|
|
962
|
+
try {
|
|
963
|
+
markSupervisorQuestionDelivered(metadata.channelDir, match[1], owner);
|
|
964
|
+
}
|
|
965
|
+
catch {
|
|
966
|
+
// Delivery markers are best-effort; answer ownership still enforces identity.
|
|
967
|
+
}
|
|
968
|
+
}
|
|
626
969
|
//# sourceMappingURL=native-supervisor-channel.js.map
|