@ashx-j/lunr-dev 0.2.21-dev.12.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 +25 -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 -0
- 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 +3 -3
- 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.map +1 -1
- package/dist/builtin-extensions/lunr-todos.js +15 -0
- package/dist/builtin-extensions/lunr-todos.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.js +5 -0
- 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/index.d.ts +2 -2
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +18 -5
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +4 -3
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +8 -3
- 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 +4 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js +167 -53
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js +5 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js +3 -2
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +2 -0
- 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 +4 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.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/subagent-runner.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts +3 -0
- 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 +11 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.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 +41 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts +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 +5 -1
- 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 +3 -2
- 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.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +23 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.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/pi-args.d.ts +2 -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 +20 -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 +4 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
- 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 +2 -2
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.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-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 +1 -0
- package/dist/core/computer-use/image.d.ts.map +1 -1
- package/dist/core/computer-use/image.js +8 -0
- package/dist/core/computer-use/image.js.map +1 -1
- package/dist/core/computer-use/schemas.d.ts +1 -0
- package/dist/core/computer-use/schemas.d.ts.map +1 -1
- package/dist/core/computer-use/schemas.js +2 -1
- package/dist/core/computer-use/schemas.js.map +1 -1
- package/dist/core/computer-use/workflow.d.ts.map +1 -1
- package/dist/core/computer-use/workflow.js +89 -23
- package/dist/core/computer-use/workflow.js.map +1 -1
- package/dist/core/customize.d.ts.map +1 -1
- package/dist/core/customize.js +15 -14
- 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 +16 -23
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +71 -142
- 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 -19
- 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 -0
- 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 +20 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +67 -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-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-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 +78 -17
- 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 +12 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +74 -3
- 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 +44 -45
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +10 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +342 -133
- 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-SRCYQPZ6.js → builtin-extensions-4GNDR6U3.js} +7 -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-LTYWTR3V.js → chunk-2MI5OPMN.js} +17 -2
- package/dist/node-runtime/{chunk-W3CVH5RX.js → chunk-2TKODGBZ.js} +11 -6
- package/dist/node-runtime/{chunk-GT5F3OKM.js → chunk-33SIKK3Y.js} +38 -164
- package/dist/node-runtime/{chunk-GZQHMEWL.js → chunk-3DKIWPKN.js} +19 -4
- 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-LOYUC2ID.js → chunk-4SBQAI4T.js} +27 -27
- package/dist/node-runtime/{chunk-CZUBYPFP.js → chunk-53ARRUHA.js} +674 -257
- package/dist/node-runtime/{chunk-VTPM5V35.js → chunk-5Q4A37RB.js} +10 -4
- package/dist/node-runtime/{chunk-SWSN6HAB.js → chunk-5UZOPGE3.js} +1 -1
- package/dist/node-runtime/{chunk-XSRCAQK2.js → chunk-5Z5PCXGY.js} +263 -222
- package/dist/node-runtime/chunk-7JIYPIQU.js +356 -0
- package/dist/node-runtime/{chunk-D466UAID.js → chunk-AJ6R5VTV.js} +60 -88
- package/dist/node-runtime/chunk-ATIF3RX5.js +352 -0
- package/dist/node-runtime/{chunk-A3KMVBZV.js → chunk-BBUVIEZB.js} +1 -10
- 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-N3PNL74S.js → chunk-DRJI7ZSC.js} +63 -163
- package/dist/node-runtime/{chunk-VTGEKB7R.js → chunk-E75WFZ33.js} +1 -1
- package/dist/node-runtime/{chunk-MJQDX3BA.js → chunk-EBB4BJW4.js} +3 -3
- package/dist/node-runtime/{chunk-VQ4UBWSA.js → chunk-EOEAQIJV.js} +63 -6
- 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-BJ6H7DPI.js → chunk-JJWZB7S3.js} +62 -50
- 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-VSELYKWU.js → chunk-LWYIVUGV.js} +2 -1
- package/dist/node-runtime/{chunk-BYQ2MOFI.js → chunk-MFV2LOOX.js} +184 -2192
- 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-7NBZ5P7I.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-H2BI7G7T.js → chunk-QFADHUQV.js} +2 -1
- package/dist/node-runtime/{chunk-W3SILANP.js → chunk-RBZQU6TJ.js} +12 -9
- package/dist/node-runtime/{chunk-ZVSORYRM.js → chunk-RVOQBXTA.js} +10 -6
- package/dist/node-runtime/{chunk-HXJS2PJM.js → chunk-RW4PYFNE.js} +14 -94
- package/dist/node-runtime/chunk-TP7K7YWS.js +2830 -0
- package/dist/node-runtime/{chunk-ZOIIMEN6.js → chunk-TVLBDVTR.js} +32 -21
- 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-WJVFOIB5.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-MW2XJZIK.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-BZGSLIP7.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-LF5VST47.js → customize-VFJV3U6A.js} +2 -1
- package/dist/node-runtime/{direct-tool-executor-BSZDHIYR.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-XLQSJN4V.js → extract-EQJE7FZZ.js} +2 -2
- package/dist/node-runtime/gateway-QENRQA5X.js +1476 -0
- package/dist/node-runtime/{gemini-search-U7SUMPQA.js → gemini-search-35OCRFLN.js} +1 -1
- package/dist/node-runtime/{gemini-url-context-PXWCBQHK.js → gemini-url-context-UQY3PHHW.js} +2 -2
- package/dist/node-runtime/index.js +113 -73
- package/dist/node-runtime/{init-DVJUAOUO.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-TJNDAMWM.js → lunr-computer-use-IAUNXSXH.js} +11 -8
- package/dist/node-runtime/{lunr-cron-J64I72C6.js → lunr-cron-P6ZJGVEF.js} +21 -7
- package/dist/node-runtime/main.js +47 -34
- 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-VMYX4Y2S.js → package-manager-cli-J337RKTI.js} +25 -17
- package/dist/node-runtime/{pi-intercom-NV2LW6X7.js → pi-intercom-QM53RLTS.js} +6 -1
- package/dist/node-runtime/{pi-mcp-adapter-JLB5YL2F.js → pi-mcp-adapter-3PHF4KZ4.js} +8 -7
- package/dist/node-runtime/{pi-subagents-WEHV3W7H.js → pi-subagents-RCHPB6UK.js} +255 -88
- package/dist/node-runtime/{pi-web-access-FN5YC5T6.js → pi-web-access-PNG35XW7.js} +15 -15
- package/dist/node-runtime/process-registry-PVJ44F7H.js +31 -0
- package/dist/node-runtime/{proxy-modes-OR7ISBXK.js → proxy-modes-5FAPSZEZ.js} +11 -11
- package/dist/node-runtime/rpc-entry.js +47 -34
- 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-3CCU326G.js → settings-manager-HIBIUNBK.js} +12 -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-CXKXQDHH.js → subagent-executor-2BH76MMS.js} +64 -23
- 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-NM7B4CKL.js → update-cli-TVTPVUNM.js} +6 -3
- package/dist/node-runtime/usage-service-LFB2SWYV.js +37 -0
- package/dist/node-runtime/{video-extract-OYT5WKS5.js → video-extract-OOZHR7SU.js} +2 -2
- package/dist/node-runtime/{workflow-C26QCUTW.js → workflow-TVJNKKQP.js} +80 -39
- package/dist/node-runtime/{youtube-extract-TQYKGFGS.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 +134 -48
- package/docs/extensions.md +2 -0
- package/docs/features.md +108 -27
- package/docs/index.md +1 -1
- package/docs/interactive-startup.md +2 -1
- package/docs/keybindings.md +1 -1
- package/docs/providers.md +6 -2
- package/docs/quickstart.md +2 -2
- package/docs/sessions.md +10 -0
- package/docs/settings.md +3 -1
- 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/node-runtime/agent-session-services-QANFGM2V.js +0 -40
- package/dist/node-runtime/chunk-LISUTZS3.js +0 -19
- package/dist/node-runtime/chunk-VGYZ3APQ.js +0 -59
- package/dist/node-runtime/chunk-XAUQOKYK.js +0 -6011
- package/dist/node-runtime/command-ZURZJDXF.js +0 -13
- package/dist/node-runtime/gateway-FWHRIBK5.js +0 -2139
- package/dist/node-runtime/interactive-mode-BBASNWHN.js +0 -62
- package/dist/node-runtime/runtime-bridges-2VQTLPOZ.js +0 -12
- 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-BPQFJR76.js → src-IVPNZ2BX.js} +9 -9
|
@@ -3,10 +3,16 @@ 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 { subagentCommunicationEnabled } from "../../../../core/settings-manager.js";
|
|
7
|
+
import { getAgentDir } from "../shared/utils.js";
|
|
6
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";
|
|
7
|
-
import { INTERCOM_DETACH_REQUEST_EVENT, POLL_INTERVAL_MS, SUBAGENT_CONTROL_EVENT } from "../shared/types.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";
|
|
10
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";
|
|
11
17
|
const REQUESTS_DIR = "requests";
|
|
12
18
|
const REPLIES_DIR = "replies";
|
|
@@ -18,7 +24,7 @@ const CHANNEL_POLL_MS = Math.min(POLL_INTERVAL_MS, 500);
|
|
|
18
24
|
const STALE_EMPTY_CHANNEL_AGE_MS = 60 * 1000;
|
|
19
25
|
const STALE_EMPTY_CHANNEL_CLEANUP_INTERVAL_MS = 60 * 1000;
|
|
20
26
|
const PARENT_ASK_DESCRIPTION = [
|
|
21
|
-
"Ask a specific running async child, or reply to a child supervisor request.",
|
|
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.",
|
|
22
28
|
"Ask only when the child owns missing context, the answer changes a concrete next decision, and waiting risks a block or rework.",
|
|
23
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.",
|
|
24
30
|
"Returns a question id immediately. The child's explicit answer is delivered separately from the final run result.",
|
|
@@ -27,12 +33,14 @@ const PARENT_ASK_DESCRIPTION = [
|
|
|
27
33
|
'Reply: { action: "reply", replyTo: "<requestId>", message: "..." }',
|
|
28
34
|
].join(" ");
|
|
29
35
|
const CHILD_CONTACT_DESCRIPTION = [
|
|
30
|
-
"Contact the
|
|
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.",
|
|
31
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.",
|
|
32
40
|
"Do not open a blocking need_decision while a parent question is already outstanding for this child.",
|
|
33
41
|
].join(" ");
|
|
34
42
|
const ContactSupervisorParamsSchema = Type.Object({
|
|
35
|
-
reason: Type.Optional(Type.String({ enum: ["need_decision", "interview_request", "progress_update"] })),
|
|
43
|
+
reason: Type.Optional(Type.String({ enum: ["need_decision", "interview_request", "progress_update", "handoff"] })),
|
|
36
44
|
message: Type.Optional(Type.String()),
|
|
37
45
|
interview: Type.Optional(Type.Unsafe({ type: "object", additionalProperties: true })),
|
|
38
46
|
action: Type.Optional(Type.String({ enum: ["reply"] })),
|
|
@@ -87,6 +95,7 @@ function readChildMetadata() {
|
|
|
87
95
|
orchestratorSessionId,
|
|
88
96
|
supervisorSessionId: readTextEnv(SUBAGENT_SUPERVISOR_SESSION_ID_ENV),
|
|
89
97
|
childTarget: readTextEnv("PI_SUBAGENT_INTERCOM_SESSION_NAME"),
|
|
98
|
+
description: readTextEnv(CHILD_DESCRIPTION_ENV),
|
|
90
99
|
};
|
|
91
100
|
}
|
|
92
101
|
function readChildQuestionOwner(metadata = readChildMetadata()) {
|
|
@@ -124,10 +133,13 @@ function answerParentQuestion(params) {
|
|
|
124
133
|
replyTo: answered.id,
|
|
125
134
|
state: supervisorQuestionPublicState(answered),
|
|
126
135
|
answered: true,
|
|
136
|
+
communication: { direction: "to", peer: "Supervisor", kind: "reply", message },
|
|
127
137
|
},
|
|
128
138
|
};
|
|
129
139
|
}
|
|
130
140
|
function reasonHeading(reason) {
|
|
141
|
+
if (reason === "handoff")
|
|
142
|
+
return "Subagent dependency handoff.";
|
|
131
143
|
if (reason === "interview_request")
|
|
132
144
|
return "Subagent requests a structured supervisor interview.";
|
|
133
145
|
if (reason === "progress_update")
|
|
@@ -153,6 +165,39 @@ function formatChildMessage(input) {
|
|
|
153
165
|
}
|
|
154
166
|
return lines.join("\n").trimEnd();
|
|
155
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
|
+
}
|
|
156
201
|
function parseStructuredReply(message) {
|
|
157
202
|
const trimmed = message.trim();
|
|
158
203
|
const fenced = trimmed.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/i)?.[1]?.trim();
|
|
@@ -214,21 +259,29 @@ async function sendSupervisorRequest(params, signal) {
|
|
|
214
259
|
throw new Error("Native supervisor channel is not available for this subagent.");
|
|
215
260
|
if (!params.reason)
|
|
216
261
|
throw new Error("reason is required for supervisor contact.");
|
|
217
|
-
if (
|
|
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)) {
|
|
218
269
|
throw new Error("A parent question is already outstanding for this child. Answer it with action='reply' before opening a blocking supervisor request.");
|
|
219
270
|
}
|
|
220
|
-
if (
|
|
221
|
-
throw new Error("message is required for supervisor
|
|
271
|
+
if (!params.message?.trim() && params.reason !== "interview_request") {
|
|
272
|
+
throw new Error("message is required for supervisor contact.");
|
|
222
273
|
}
|
|
223
274
|
ensureSupervisorChannelDir(metadata.channelDir);
|
|
224
275
|
const requestId = randomUUID();
|
|
225
|
-
const expectsReply = params.reason !== "progress_update";
|
|
226
276
|
const createdAt = Date.now();
|
|
227
277
|
const replyDeadline = createdAt + askTimeoutMs();
|
|
228
278
|
const expiresAt = expectsReply ? replyDeadline : undefined;
|
|
229
|
-
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) };
|
|
230
281
|
const request = {
|
|
231
282
|
type: "subagent.supervisor.request",
|
|
283
|
+
...(protocolVersion ? { protocolVersion } : {}),
|
|
284
|
+
...(metadata.description ? { description: metadata.description } : {}),
|
|
232
285
|
id: requestId,
|
|
233
286
|
createdAt,
|
|
234
287
|
...(expiresAt !== undefined ? { expiresAt } : {}),
|
|
@@ -255,13 +308,13 @@ async function sendSupervisorRequest(params, signal) {
|
|
|
255
308
|
}
|
|
256
309
|
if (!expectsReply) {
|
|
257
310
|
return {
|
|
258
|
-
content: [{ type: "text", text: "Supervisor progress update queued." }],
|
|
259
|
-
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 },
|
|
260
313
|
};
|
|
261
314
|
}
|
|
262
315
|
try {
|
|
263
316
|
const reply = await waitForReply(metadata.channelDir, requestId, replyDeadline, signal);
|
|
264
|
-
const details = { requestId, reason: params.reason };
|
|
317
|
+
const details = { requestId, reason: params.reason, communication, response: reply.message };
|
|
265
318
|
if (params.reason === "interview_request") {
|
|
266
319
|
const structured = parseStructuredReply(reply.message);
|
|
267
320
|
if (structured.error)
|
|
@@ -288,15 +341,23 @@ function hasTool(pi, name) {
|
|
|
288
341
|
}
|
|
289
342
|
}
|
|
290
343
|
export function registerNativeSupervisorClient(pi, options = {}) {
|
|
291
|
-
if (!readChildMetadata())
|
|
344
|
+
if (process.env.PI_SUBAGENT_COMMUNICATION_ENABLED === "0" || !readChildMetadata())
|
|
292
345
|
return;
|
|
293
346
|
const includeIntercomFallback = options.includeIntercomFallback !== false;
|
|
294
347
|
if (!hasTool(pi, "contact_supervisor")) {
|
|
295
348
|
const tool = {
|
|
296
349
|
name: "contact_supervisor",
|
|
297
350
|
label: "Contact Supervisor",
|
|
298
|
-
description: CHILD_CONTACT_DESCRIPTION
|
|
299
|
-
|
|
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
|
+
},
|
|
300
361
|
execute(_id, params, signal) {
|
|
301
362
|
return sendSupervisorRequest(params, signal);
|
|
302
363
|
},
|
|
@@ -307,8 +368,14 @@ export function registerNativeSupervisorClient(pi, options = {}) {
|
|
|
307
368
|
const tool = {
|
|
308
369
|
name: "intercom",
|
|
309
370
|
label: "Intercom",
|
|
310
|
-
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.",
|
|
311
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
|
+
},
|
|
312
379
|
async execute(_id, params, signal) {
|
|
313
380
|
const action = params.action;
|
|
314
381
|
if (action === "status")
|
|
@@ -334,7 +401,15 @@ function parseRequestFile(file, channelDir) {
|
|
|
334
401
|
return undefined;
|
|
335
402
|
if (typeof parsed.id !== "string" || !parsed.id)
|
|
336
403
|
return undefined;
|
|
337
|
-
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")
|
|
338
413
|
return undefined;
|
|
339
414
|
if (typeof parsed.message !== "string" || !parsed.message)
|
|
340
415
|
return undefined;
|
|
@@ -516,21 +591,24 @@ function requestExpiresAt(request, now) {
|
|
|
516
591
|
return expiresAt;
|
|
517
592
|
return Number.isFinite(request.createdAt) ? request.createdAt + askTimeoutMs() : now;
|
|
518
593
|
}
|
|
519
|
-
function
|
|
594
|
+
function requestRunState(request, state) {
|
|
520
595
|
if (state.foregroundControls.has(request.runId))
|
|
521
|
-
return
|
|
596
|
+
return "active";
|
|
522
597
|
const foregroundRun = state.foregroundRuns?.get(request.runId);
|
|
523
598
|
const foregroundChild = foregroundRun?.children.find((child) => child.index === request.childIndex && child.agent === request.agent)
|
|
524
599
|
?? foregroundRun?.children[request.childIndex];
|
|
525
600
|
if (foregroundChild)
|
|
526
|
-
return foregroundChild.status
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
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";
|
|
534
612
|
}
|
|
535
613
|
function requestLifecycle(request, state, ctx, now) {
|
|
536
614
|
if (ctx && !requestMatchesContext(request, state, ctx))
|
|
@@ -541,7 +619,8 @@ function requestLifecycle(request, state, ctx, now) {
|
|
|
541
619
|
return "resolved";
|
|
542
620
|
if (request.expectsReply && now > requestExpiresAt(request, now))
|
|
543
621
|
return "expired";
|
|
544
|
-
|
|
622
|
+
const runState = requestRunState(request, state);
|
|
623
|
+
if (runState === "stopped" || (request.expectsReply && runState === "inactive"))
|
|
545
624
|
return "inactive";
|
|
546
625
|
return "pending";
|
|
547
626
|
}
|
|
@@ -563,8 +642,10 @@ function formatPendingLine(request) {
|
|
|
563
642
|
const replyHint = request.expectsReply ? ` Reply: ${NATIVE_SUPERVISOR_TOOL_NAME}({ action: "reply", replyTo: "${request.id}", message: "..." })` : "";
|
|
564
643
|
return `- ${request.id}: ${request.agent} [${request.runId}#${request.childIndex}] ${request.reason}.${replyHint}`;
|
|
565
644
|
}
|
|
566
|
-
function requestVisibleText(request) {
|
|
567
|
-
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.");
|
|
568
649
|
if (request.expectsReply) {
|
|
569
650
|
lines.push("", `Reply with: ${NATIVE_SUPERVISOR_TOOL_NAME}({ action: "reply", replyTo: "${request.id}", message: "..." })`);
|
|
570
651
|
}
|
|
@@ -622,6 +703,14 @@ function buildParentIntercomTool(pending, state, name = "intercom") {
|
|
|
622
703
|
label: name === "intercom" ? "Intercom" : "Subagent Supervisor",
|
|
623
704
|
description: PARENT_ASK_DESCRIPTION,
|
|
624
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
|
+
},
|
|
625
714
|
async execute(_id, params) {
|
|
626
715
|
refreshPendingRequests(pending, state, state.lastUiContext ?? undefined);
|
|
627
716
|
const input = params;
|
|
@@ -636,9 +725,12 @@ function buildParentIntercomTool(pending, state, name = "intercom") {
|
|
|
636
725
|
const request = resolvePendingRequest(pending, input);
|
|
637
726
|
writeReply(request, input.message ?? "");
|
|
638
727
|
pending.delete(request.id);
|
|
639
|
-
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 } } };
|
|
640
729
|
}
|
|
641
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
|
+
}
|
|
642
734
|
return askRunningAsyncChild({
|
|
643
735
|
params: {
|
|
644
736
|
id: input.id,
|
|
@@ -666,7 +758,7 @@ function questionMatchesParentContext(question, state, ctx) {
|
|
|
666
758
|
return false;
|
|
667
759
|
return true;
|
|
668
760
|
}
|
|
669
|
-
function notifyQuestionTerminal(pi, question, channelDir) {
|
|
761
|
+
function notifyQuestionTerminal(pi, question, channelDir, state) {
|
|
670
762
|
if (!supervisorQuestionIsTerminal(question) || question.notifiedAt)
|
|
671
763
|
return;
|
|
672
764
|
pi.events?.emit(SUBAGENT_QUESTION_EVENT, {
|
|
@@ -678,22 +770,24 @@ function notifyQuestionTerminal(pi, question, channelDir) {
|
|
|
678
770
|
return;
|
|
679
771
|
if (!claimQuestionNotification(channelDir, question.id))
|
|
680
772
|
return;
|
|
681
|
-
const
|
|
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" };
|
|
682
775
|
pi.sendMessage({
|
|
683
776
|
customType: SUBAGENT_SUPERVISOR_ANSWER_TYPE,
|
|
684
777
|
content: formatSupervisorQuestionAnswer(question),
|
|
685
|
-
display:
|
|
778
|
+
display: outcome === "answered",
|
|
686
779
|
details: {
|
|
687
780
|
questionId: question.id,
|
|
688
|
-
state,
|
|
781
|
+
state: outcome,
|
|
782
|
+
communication,
|
|
689
783
|
runId: question.runId,
|
|
690
784
|
childIndex: question.childIndex,
|
|
691
785
|
childId: question.childId,
|
|
692
786
|
reason: question.reason,
|
|
693
|
-
answered:
|
|
787
|
+
answered: outcome === "answered",
|
|
694
788
|
delivered: Boolean(question.deliveredAt),
|
|
695
789
|
},
|
|
696
|
-
}, { triggerTurn:
|
|
790
|
+
}, { triggerTurn: outcome === "answered" });
|
|
697
791
|
}
|
|
698
792
|
function pollSupervisorQuestions(pi, state, ctx) {
|
|
699
793
|
for (const channelDir of listSupervisorChannelDirs()) {
|
|
@@ -701,13 +795,14 @@ function pollSupervisorQuestions(pi, state, ctx) {
|
|
|
701
795
|
if (!questionMatchesParentContext(question, state, ctx))
|
|
702
796
|
continue;
|
|
703
797
|
const current = reconcileAsyncQuestion(channelDir, question, state);
|
|
704
|
-
notifyQuestionTerminal(pi, current, channelDir);
|
|
798
|
+
notifyQuestionTerminal(pi, current, channelDir, state);
|
|
705
799
|
}
|
|
706
800
|
}
|
|
707
801
|
}
|
|
708
802
|
export function createNativeSupervisorChannel(pi, state) {
|
|
709
803
|
const pending = new Map();
|
|
710
804
|
const seenFiles = new Set();
|
|
805
|
+
const deliveredRequests = new Set();
|
|
711
806
|
let poller;
|
|
712
807
|
let lastStaleCleanupAt = 0;
|
|
713
808
|
const registerParentTools = () => {
|
|
@@ -766,25 +861,37 @@ export function createNativeSupervisorChannel(pi, state) {
|
|
|
766
861
|
cleanupRequestLifecycle(request, lifecycle);
|
|
767
862
|
continue;
|
|
768
863
|
}
|
|
769
|
-
seenFiles.add(file);
|
|
770
864
|
if (request.expectsReply)
|
|
771
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
|
+
}
|
|
772
883
|
else {
|
|
773
|
-
|
|
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" });
|
|
774
890
|
}
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
details: {
|
|
780
|
-
id: request.id,
|
|
781
|
-
reason: request.reason,
|
|
782
|
-
expectsReply: request.expectsReply,
|
|
783
|
-
runId: request.runId,
|
|
784
|
-
agent: request.agent,
|
|
785
|
-
childIndex: request.childIndex,
|
|
786
|
-
},
|
|
787
|
-
});
|
|
891
|
+
deliveredRequests.add(request.id);
|
|
892
|
+
seenFiles.add(file);
|
|
893
|
+
if (!request.expectsReply)
|
|
894
|
+
removeRequestFile(request.requestFile);
|
|
788
895
|
if (request.expectsReply) {
|
|
789
896
|
const job = state.asyncJobs.get(request.runId);
|
|
790
897
|
if (job)
|
|
@@ -811,6 +918,12 @@ export function createNativeSupervisorChannel(pi, state) {
|
|
|
811
918
|
if (poller)
|
|
812
919
|
return;
|
|
813
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
|
+
}
|
|
814
927
|
poll();
|
|
815
928
|
poller = setInterval(poll, CHANNEL_POLL_MS);
|
|
816
929
|
poller.unref?.();
|
|
@@ -822,6 +935,7 @@ export function createNativeSupervisorChannel(pi, state) {
|
|
|
822
935
|
poller = undefined;
|
|
823
936
|
pending.clear();
|
|
824
937
|
seenFiles.clear();
|
|
938
|
+
deliveredRequests.clear();
|
|
825
939
|
},
|
|
826
940
|
pending,
|
|
827
941
|
cancelOwnedQuestions,
|