@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
|
@@ -27,6 +27,8 @@ import {
|
|
|
27
27
|
SUBAGENT_PARENT_SESSION_ENV,
|
|
28
28
|
SUBAGENT_RESULT_INTERCOM_EVENT,
|
|
29
29
|
SUBAGENT_STEERING_NOTICE_EVENT,
|
|
30
|
+
SUPERVISOR_PROGRESS_TYPE,
|
|
31
|
+
SUPERVISOR_REQUEST_TYPE,
|
|
30
32
|
TEMP_ROOT_DIR,
|
|
31
33
|
WIDGET_KEY,
|
|
32
34
|
assertJsonSchemaObject,
|
|
@@ -45,7 +47,6 @@ import {
|
|
|
45
47
|
formatAsyncRunProgressLabel,
|
|
46
48
|
formatAsyncRunTranscript,
|
|
47
49
|
formatCompactModelBadge,
|
|
48
|
-
formatControlNoticeMessage,
|
|
49
50
|
formatDuration,
|
|
50
51
|
formatModelSelection,
|
|
51
52
|
formatNestedAggregate,
|
|
@@ -61,10 +62,12 @@ import {
|
|
|
61
62
|
handleSubagentControlNotice,
|
|
62
63
|
hasLiveNestedDescendants,
|
|
63
64
|
isAsyncSubagentExecution,
|
|
65
|
+
legacySupervisorBody,
|
|
64
66
|
listAsyncRuns,
|
|
65
67
|
normalizeAsyncLaunchConfig,
|
|
66
68
|
normalizeParallelGroups,
|
|
67
69
|
projectNestedRegistryForRoot,
|
|
70
|
+
readCommunication,
|
|
68
71
|
readStatus,
|
|
69
72
|
readSteerCapability,
|
|
70
73
|
reconcileAsyncRun,
|
|
@@ -72,6 +75,7 @@ import {
|
|
|
72
75
|
registerMainWatchdog,
|
|
73
76
|
requestAsyncSteer,
|
|
74
77
|
resolveAsyncRunLocation,
|
|
78
|
+
resolveCommunicationPeer,
|
|
75
79
|
resolveCurrentSessionId,
|
|
76
80
|
resolveSubagentRequestParams,
|
|
77
81
|
resolveSubagentResultStatus,
|
|
@@ -82,6 +86,7 @@ import {
|
|
|
82
86
|
sanitizeChildDescription,
|
|
83
87
|
sanitizeSummary,
|
|
84
88
|
shortenPath,
|
|
89
|
+
stopRequestPath,
|
|
85
90
|
subagentLaunchRunsAsync,
|
|
86
91
|
summarizeAsyncStatus,
|
|
87
92
|
updateAsyncJobNestedProjection,
|
|
@@ -89,32 +94,46 @@ import {
|
|
|
89
94
|
validateExecutionAcceptance,
|
|
90
95
|
validateToolBudgetConfig,
|
|
91
96
|
writeAtomicJson
|
|
92
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-DRJI7ZSC.js";
|
|
93
98
|
import {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
formatControlNoticeMessage
|
|
100
|
+
} from "./chunk-OAR4TYZE.js";
|
|
101
|
+
import {
|
|
102
|
+
getSubagentSpinnerDefinition
|
|
103
|
+
} from "./chunk-US544NN6.js";
|
|
98
104
|
import "./chunk-5ZH3ZFIZ.js";
|
|
99
|
-
import "./chunk-
|
|
100
|
-
import "./chunk-
|
|
105
|
+
import "./chunk-RVOQBXTA.js";
|
|
106
|
+
import "./chunk-33SIKK3Y.js";
|
|
101
107
|
import "./chunk-53YJI7JU.js";
|
|
102
|
-
import "./chunk-
|
|
103
|
-
import "./chunk-
|
|
104
|
-
import "./chunk-
|
|
105
|
-
import
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
import "./chunk-3DKIWPKN.js";
|
|
109
|
+
import "./chunk-XHIRAZ26.js";
|
|
110
|
+
import "./chunk-5Q4A37RB.js";
|
|
111
|
+
import {
|
|
112
|
+
subagentCommunicationEnabled
|
|
113
|
+
} from "./chunk-EOEAQIJV.js";
|
|
114
|
+
import "./chunk-L5LZUGT7.js";
|
|
115
|
+
import "./chunk-2CMV4L24.js";
|
|
116
|
+
import "./chunk-URD2SLIT.js";
|
|
117
|
+
import {
|
|
118
|
+
createSubagentCancellation,
|
|
119
|
+
registerSubagentCancellation
|
|
120
|
+
} from "./chunk-BBUVIEZB.js";
|
|
121
|
+
import "./chunk-AJ6R5VTV.js";
|
|
108
122
|
import "./chunk-M3LZLQW2.js";
|
|
109
|
-
import "./chunk-VTPM5V35.js";
|
|
110
123
|
import "./chunk-3ONQTOMR.js";
|
|
124
|
+
import "./chunk-2BLXLDJR.js";
|
|
125
|
+
import "./chunk-ZCHMJ34K.js";
|
|
126
|
+
import "./chunk-FVDOXRUD.js";
|
|
127
|
+
import "./chunk-UJOCPOMX.js";
|
|
128
|
+
import "./chunk-IMLCWLPI.js";
|
|
111
129
|
import "./chunk-RQ2Q5IYR.js";
|
|
130
|
+
import "./chunk-O2AT4MEU.js";
|
|
112
131
|
import {
|
|
113
132
|
keyText
|
|
114
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-N4TUWAGA.js";
|
|
115
134
|
import {
|
|
116
135
|
getMarkdownTheme
|
|
117
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-PLGA743X.js";
|
|
118
137
|
import "./chunk-PCIGF2XK.js";
|
|
119
138
|
import "./chunk-Q4Q6D4IY.js";
|
|
120
139
|
import "./chunk-BRJX2PRC.js";
|
|
@@ -124,7 +143,7 @@ import { randomUUID as randomUUID4 } from "node:crypto";
|
|
|
124
143
|
import * as fs10 from "node:fs";
|
|
125
144
|
import * as os from "node:os";
|
|
126
145
|
import * as path12 from "node:path";
|
|
127
|
-
import { Box, Container as
|
|
146
|
+
import { Box as Box2, Container as Container3, Spacer as Spacer2, Text as Text3, truncateToWidth as truncateToWidth2, visibleWidth as visibleWidth3, wrapTextWithAnsi as wrapTextWithAnsi2 } from "@ashx-j/lunr-tui";
|
|
128
147
|
|
|
129
148
|
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/tui/render.js
|
|
130
149
|
import { Container, Markdown, Spacer, Text, visibleWidth } from "@ashx-j/lunr-tui";
|
|
@@ -1065,7 +1084,7 @@ var SkillOverride = Type.Unsafe({
|
|
|
1065
1084
|
description: "Required concise single-line UI label (max 80 characters). Presentation metadata only; not used as an identifier."
|
|
1066
1085
|
}), PermissionsField = Type.Optional(Type.String({
|
|
1067
1086
|
enum: ["full", "read-only"],
|
|
1068
|
-
description: "Child permission level. Omit or 'full' for coding tools (read/search/shell/edit/write/web/LSP/MCP). 'read-only' inspects without edit/write.
|
|
1087
|
+
description: "Child permission level. Omit or 'full' for coding tools (read/search/shell/edit/write/web/LSP/MCP). 'read-only' inspects without edit/write. Read-only parents must pass 'read-only'."
|
|
1069
1088
|
})), TaskItem = Type.Object({
|
|
1070
1089
|
task: Type.String({ description: "Complete model-authored prompt sent to the child." }),
|
|
1071
1090
|
description: DescriptionField,
|
|
@@ -4469,6 +4488,7 @@ function parseQuestionRecord(raw) {
|
|
|
4469
4488
|
runId: input.runId.trim(),
|
|
4470
4489
|
childIndex,
|
|
4471
4490
|
childId: input.childId.trim(),
|
|
4491
|
+
...typeof input.childDescription == "string" && input.childDescription.trim() ? { childDescription: input.childDescription.trim() } : {},
|
|
4472
4492
|
parentSessionId: input.parentSessionId.trim(),
|
|
4473
4493
|
parentGeneration,
|
|
4474
4494
|
...incarnation ? { childIncarnation: incarnation } : {}
|
|
@@ -4577,6 +4597,7 @@ function createSupervisorQuestion(input) {
|
|
|
4577
4597
|
runId: input.runId,
|
|
4578
4598
|
childIndex: input.childIndex,
|
|
4579
4599
|
childId: input.childId,
|
|
4600
|
+
...input.childDescription ? { childDescription: input.childDescription } : {},
|
|
4580
4601
|
parentSessionId: input.parentSessionId,
|
|
4581
4602
|
parentGeneration: input.parentGeneration,
|
|
4582
4603
|
...input.childIncarnation ? { childIncarnation: input.childIncarnation } : {}
|
|
@@ -4642,8 +4663,7 @@ function formatParentQuestionForChild(question) {
|
|
|
4642
4663
|
function formatSupervisorQuestionAnswer(question) {
|
|
4643
4664
|
let state = supervisorQuestionPublicState(question), lines = [
|
|
4644
4665
|
state === "answered" ? `Subagent answer (${question.id})` : `Subagent question ${state} (${question.id})`,
|
|
4645
|
-
`
|
|
4646
|
-
`Child: ${question.childId} [#${question.childIndex}]`,
|
|
4666
|
+
`From: ${question.childDescription ?? `Subagent ${question.childIndex + 1}`}`,
|
|
4647
4667
|
`Decision: ${question.reason}`
|
|
4648
4668
|
];
|
|
4649
4669
|
return state === "answered" && question.answer?.trim() ? lines.push("", question.answer.trim()) : question.cancelReason && lines.push("", question.cancelReason), lines.join(`
|
|
@@ -4800,8 +4820,9 @@ function askRunningAsyncChild(input) {
|
|
|
4800
4820
|
let capability = readSteerCapability(resolved.location.asyncDir, child.index);
|
|
4801
4821
|
if (!capability?.supported)
|
|
4802
4822
|
throw new Error("This child is not ready to receive questions. Continue other work until it is ready; no question was queued.");
|
|
4803
|
-
let incarnation = { pid: capability.pid, readyAt: capability.readyAt }, question = createSupervisorQuestion({
|
|
4823
|
+
let incarnation = { pid: capability.pid, readyAt: capability.readyAt }, step = status.steps?.[child.index], childDescription = resolveCommunicationPeer(input.state, status.runId, child.index, child.childId, step?.description ?? child.agent), question = createSupervisorQuestion({
|
|
4804
4824
|
channelDir,
|
|
4825
|
+
childDescription,
|
|
4805
4826
|
reason,
|
|
4806
4827
|
message,
|
|
4807
4828
|
runId: status.runId,
|
|
@@ -4831,16 +4852,54 @@ function askRunningAsyncChild(input) {
|
|
|
4831
4852
|
runId: status.runId,
|
|
4832
4853
|
childIndex: child.index,
|
|
4833
4854
|
childId: child.childId,
|
|
4855
|
+
communication: { direction: "to", peer: childDescription, message, kind: "question" },
|
|
4834
4856
|
delivered: !1,
|
|
4835
4857
|
answered: !1
|
|
4836
4858
|
}
|
|
4837
4859
|
};
|
|
4838
4860
|
}
|
|
4839
4861
|
|
|
4862
|
+
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/tui/communication.js
|
|
4863
|
+
import { Box, Container as Container2, Text as Text2 } from "@ashx-j/lunr-tui";
|
|
4864
|
+
function renderCommunicationBody(communication, theme) {
|
|
4865
|
+
let direction = communication.direction === "from" ? "From" : "To";
|
|
4866
|
+
return new Text2(`${theme.fg("muted", `${direction}: ${communication.peer}`)}
|
|
4867
|
+
|
|
4868
|
+
${communication.message}`, 0, 0);
|
|
4869
|
+
}
|
|
4870
|
+
function renderCommunicationCard(communication, expanded, theme) {
|
|
4871
|
+
let box = new Box(1, 1, (text) => theme.bg("toolSuccessBg", text));
|
|
4872
|
+
return box.addChild(new Text2(theme.fg("toolTitle", theme.bold(`\u25CF subagent ${communication.kind}`)), 0, 0)), expanded && box.addChild(renderCommunicationBody(communication, theme)), box;
|
|
4873
|
+
}
|
|
4874
|
+
function renderCommunicationCall(name, args, theme, context, communication, displayTitle) {
|
|
4875
|
+
let container = new Container2(), details = context?.result?.details, saved = readCommunication(details?.communication) ?? communication, action = args.action ?? (args.reason === "need_decision" ? "request" : args.reason === "interview_request" ? "interview" : args.reason === "progress_update" ? "progress" : args.reason), title = theme.fg("toolTitle", theme.bold(`${name}${action ? ` ${action}` : ""}`));
|
|
4876
|
+
return container.addChild(new Text2(displayTitle ? `${title} ${theme.fg("accent", displayTitle)}` : title, 0, 0)), context?.expanded && saved && container.addChild(renderCommunicationBody(saved, theme)), container;
|
|
4877
|
+
}
|
|
4878
|
+
function renderCommunicationResult(content, details, expanded, isError, theme) {
|
|
4879
|
+
let container = new Container2();
|
|
4880
|
+
if (!expanded)
|
|
4881
|
+
return container;
|
|
4882
|
+
if (isError)
|
|
4883
|
+
container.addChild(new Text2(theme.fg("error", content.filter((part) => part.type === "text").map((part) => part.text ?? "").join(`
|
|
4884
|
+
`)), 0, 0));
|
|
4885
|
+
else {
|
|
4886
|
+
let saved = details;
|
|
4887
|
+
saved?.response ? container.addChild(new Text2(`
|
|
4888
|
+
${theme.fg("muted", "From: Supervisor")}
|
|
4889
|
+
|
|
4890
|
+
${saved.response}`, 0, 0)) : saved?.steering?.state ? container.addChild(new Text2(`
|
|
4891
|
+
Delivery: ${saved.steering.state === "recovered" ? "recovered; replacement launched" : saved.steering.state}`, 0, 0)) : saved?.asyncId && saved.communication ? container.addChild(new Text2(`
|
|
4892
|
+
Continuation launched.`, 0, 0)) : saved?.state && saved.communication ? container.addChild(new Text2(`
|
|
4893
|
+
${saved.state === "pending" ? "Question queued; awaiting an answer." : saved.state}`, 0, 0)) : saved?.communication || container.addChild(new Text2(content.filter((part) => part.type === "text").map((part) => part.text ?? "").join(`
|
|
4894
|
+
`), 0, 0));
|
|
4895
|
+
}
|
|
4896
|
+
return container;
|
|
4897
|
+
}
|
|
4898
|
+
|
|
4840
4899
|
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js
|
|
4841
4900
|
var REQUESTS_DIR = "requests", REPLIES_DIR = "replies", NATIVE_SUPERVISOR_TOOL_NAME = "subagent_supervisor";
|
|
4842
4901
|
var MAX_MESSAGE_BYTES2 = 64 * 1024, DEFAULT_ASK_TIMEOUT_MS2 = 600 * 1e3, CHANNEL_POLL_MS = Math.min(POLL_INTERVAL_MS, 500), STALE_EMPTY_CHANNEL_AGE_MS = 60 * 1e3, STALE_EMPTY_CHANNEL_CLEANUP_INTERVAL_MS = 60 * 1e3, PARENT_ASK_DESCRIPTION = [
|
|
4843
|
-
"Ask a specific running async child, or reply to a child supervisor request.",
|
|
4902
|
+
"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.",
|
|
4844
4903
|
"Ask only when the child owns missing context, the answer changes a concrete next decision, and waiting risks a block or rework.",
|
|
4845
4904
|
"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.",
|
|
4846
4905
|
"Returns a question id immediately. The child's explicit answer is delivered separately from the final run result.",
|
|
@@ -4848,11 +4907,13 @@ var MAX_MESSAGE_BYTES2 = 64 * 1024, DEFAULT_ASK_TIMEOUT_MS2 = 600 * 1e3, CHANNEL
|
|
|
4848
4907
|
"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.",
|
|
4849
4908
|
'Reply: { action: "reply", replyTo: "<requestId>", message: "..." }'
|
|
4850
4909
|
].join(" "), CHILD_CONTACT_DESCRIPTION = [
|
|
4851
|
-
"Contact the
|
|
4910
|
+
"Contact the supervisor for decisions outside your assigned authority, safety concerns, or blockers. Make reversible implementation choices within your scope yourself.",
|
|
4911
|
+
"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.",
|
|
4912
|
+
"Return one self-contained final report with outcomes, verification, blockers, and artifact paths; the runtime delivers it. Routine work already appears in activity indicators.",
|
|
4852
4913
|
"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.",
|
|
4853
4914
|
"Do not open a blocking need_decision while a parent question is already outstanding for this child."
|
|
4854
4915
|
].join(" "), ContactSupervisorParamsSchema = Type2.Object({
|
|
4855
|
-
reason: Type2.Optional(Type2.String({ enum: ["need_decision", "interview_request", "progress_update"] })),
|
|
4916
|
+
reason: Type2.Optional(Type2.String({ enum: ["need_decision", "interview_request", "progress_update", "handoff"] })),
|
|
4856
4917
|
message: Type2.Optional(Type2.String()),
|
|
4857
4918
|
interview: Type2.Optional(Type2.Unsafe({ type: "object", additionalProperties: !0 })),
|
|
4858
4919
|
action: Type2.Optional(Type2.String({ enum: ["reply"] })),
|
|
@@ -4876,6 +4937,40 @@ function safeSegment2(value) {
|
|
|
4876
4937
|
function replyPath(channelDir, requestId) {
|
|
4877
4938
|
return path8.join(channelDir, REPLIES_DIR, `${safeSegment2(requestId)}.json`);
|
|
4878
4939
|
}
|
|
4940
|
+
function communicationKind(reason) {
|
|
4941
|
+
return reason === "progress_update" ? "progress" : reason === "handoff" ? "handoff" : reason === "interview_request" ? "interview" : "request";
|
|
4942
|
+
}
|
|
4943
|
+
function communicationBody(message, interview, protocolVersion) {
|
|
4944
|
+
let body = protocolVersion === 2 ? message : legacySupervisorBody(message);
|
|
4945
|
+
return interview !== void 0 && protocolVersion === 2 ? `${body}
|
|
4946
|
+
|
|
4947
|
+
${JSON.stringify(interview, null, 2)}` : body;
|
|
4948
|
+
}
|
|
4949
|
+
function requestCommunication(request, state) {
|
|
4950
|
+
return {
|
|
4951
|
+
direction: "from",
|
|
4952
|
+
peer: resolveCommunicationPeer(state, request.runId, request.childIndex, request.agent, request.description),
|
|
4953
|
+
message: communicationBody(request.message, request.interview, request.protocolVersion),
|
|
4954
|
+
kind: communicationKind(request.reason)
|
|
4955
|
+
};
|
|
4956
|
+
}
|
|
4957
|
+
function registerSupervisorRenderers(pi, state) {
|
|
4958
|
+
for (let customType of [SUPERVISOR_REQUEST_TYPE, SUBAGENT_SUPERVISOR_ANSWER_TYPE])
|
|
4959
|
+
pi.registerMessageRenderer(customType, (message, options, theme) => {
|
|
4960
|
+
let details = message.details, communication = readCommunication(details?.communication) ?? {
|
|
4961
|
+
direction: "from",
|
|
4962
|
+
peer: details?.runId ? resolveCommunicationPeer(state, details.runId, details.childIndex ?? 0, details.childId ?? details.agent) : "Subagent",
|
|
4963
|
+
message: legacySupervisorBody(typeof message.content == "string" ? message.content : message.content.filter((part) => part.type === "text").map((part) => part.text).join(`
|
|
4964
|
+
`)),
|
|
4965
|
+
kind: customType === SUBAGENT_SUPERVISOR_ANSWER_TYPE ? "answer" : communicationKind(details?.reason)
|
|
4966
|
+
};
|
|
4967
|
+
return renderCommunicationCard(communication, options.expanded, theme);
|
|
4968
|
+
});
|
|
4969
|
+
pi.registerEntryRenderer(SUPERVISOR_PROGRESS_TYPE, (entry, options, theme) => {
|
|
4970
|
+
let communication = readCommunication(entry.data?.communication);
|
|
4971
|
+
return communication ? renderCommunicationCard(communication, options.expanded, theme) : void 0;
|
|
4972
|
+
});
|
|
4973
|
+
}
|
|
4879
4974
|
function askTimeoutMs2() {
|
|
4880
4975
|
let parsed = Number(process.env.PI_INTERCOM_ASK_TIMEOUT_MS);
|
|
4881
4976
|
return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_ASK_TIMEOUT_MS2;
|
|
@@ -4890,7 +4985,7 @@ function hasTool(pi, name) {
|
|
|
4890
4985
|
function parseRequestFile(file, channelDir) {
|
|
4891
4986
|
try {
|
|
4892
4987
|
let parsed = JSON.parse(fs7.readFileSync(file, "utf-8"));
|
|
4893
|
-
return parsed.type !== "subagent.supervisor.request" || parsed.supervisorSessionId !== void 0 && (typeof parsed.supervisorSessionId != "string" || !parsed.supervisorSessionId.trim()) || typeof parsed.id != "string" || !parsed.id || parsed.reason !== "need_decision" && parsed.reason !== "interview_request" && parsed.reason !== "progress_update" || typeof parsed.message != "string" || !parsed.message || typeof parsed.runId != "string" || typeof parsed.agent != "string" || typeof parsed.childIndex != "number" ? void 0 : { ...parsed, channelDir, requestFile: file };
|
|
4988
|
+
return parsed.type !== "subagent.supervisor.request" || parsed.supervisorSessionId !== void 0 && (typeof parsed.supervisorSessionId != "string" || !parsed.supervisorSessionId.trim()) || typeof parsed.id != "string" || !parsed.id || parsed.reason !== "need_decision" && parsed.reason !== "interview_request" && parsed.reason !== "progress_update" && parsed.reason !== "handoff" || parsed.protocolVersion !== void 0 && parsed.protocolVersion !== 2 || parsed.protocolVersion === 2 && parsed.expectsReply !== (parsed.reason === "need_decision" || parsed.reason === "interview_request") || parsed.reason === "handoff" && parsed.protocolVersion !== 2 || parsed.description !== void 0 && typeof parsed.description != "string" || typeof parsed.message != "string" || !parsed.message || typeof parsed.runId != "string" || typeof parsed.agent != "string" || typeof parsed.childIndex != "number" ? void 0 : { ...parsed, channelDir, requestFile: file };
|
|
4894
4989
|
} catch {
|
|
4895
4990
|
return;
|
|
4896
4991
|
}
|
|
@@ -5016,22 +5111,26 @@ function requestExpiresAt(request, now) {
|
|
|
5016
5111
|
let expiresAt = request.expiresAt;
|
|
5017
5112
|
return typeof expiresAt == "number" && Number.isFinite(expiresAt) ? expiresAt : Number.isFinite(request.createdAt) ? request.createdAt + askTimeoutMs2() : now;
|
|
5018
5113
|
}
|
|
5019
|
-
function
|
|
5114
|
+
function requestRunState(request, state) {
|
|
5020
5115
|
if (state.foregroundControls.has(request.runId))
|
|
5021
|
-
return
|
|
5116
|
+
return "active";
|
|
5022
5117
|
let foregroundRun = state.foregroundRuns?.get(request.runId), foregroundChild = foregroundRun?.children.find((child) => child.index === request.childIndex && child.agent === request.agent) ?? foregroundRun?.children[request.childIndex];
|
|
5023
5118
|
if (foregroundChild)
|
|
5024
|
-
return foregroundChild.status
|
|
5025
|
-
let
|
|
5026
|
-
|
|
5027
|
-
return !1;
|
|
5028
|
-
if (asyncJob.status === "complete" || asyncJob.status === "failed" || asyncJob.status === "paused")
|
|
5029
|
-
return !0;
|
|
5030
|
-
let stepStatus = asyncJob.steps?.[request.childIndex]?.status;
|
|
5031
|
-
return stepStatus === "complete" || stepStatus === "completed" || stepStatus === "failed" || stepStatus === "paused";
|
|
5119
|
+
return foregroundChild.status === "stopped" ? "stopped" : foregroundChild.status === "detached" ? "active" : "inactive";
|
|
5120
|
+
let job = state.asyncJobs.get(request.runId) ?? state.fleetJobs?.get(request.runId), asyncDir = job?.asyncDir ?? path8.join(ASYNC_DIR, safeSegment2(request.runId)), status = readStatus(asyncDir), runStatus = status?.state ?? job?.status, stepStatus = (status?.steps ?? job?.steps)?.[request.childIndex]?.status;
|
|
5121
|
+
return fs7.existsSync(stopRequestPath(asyncDir)) || runStatus === "stopped" || job?.status === "stopped" || status?.stopped || stepStatus === "stopped" ? "stopped" : ["complete", "failed", "paused"].includes(runStatus ?? "") || ["complete", "completed", "failed", "paused"].includes(stepStatus ?? "") ? "inactive" : "active";
|
|
5032
5122
|
}
|
|
5033
5123
|
function requestLifecycle(request, state, ctx, now) {
|
|
5034
|
-
|
|
5124
|
+
if (ctx && !requestMatchesContext(request, state, ctx))
|
|
5125
|
+
return "wrong-session";
|
|
5126
|
+
if (!fs7.existsSync(request.requestFile))
|
|
5127
|
+
return "missing";
|
|
5128
|
+
if (request.expectsReply && fs7.existsSync(replyPath(request.channelDir, request.id)))
|
|
5129
|
+
return "resolved";
|
|
5130
|
+
if (request.expectsReply && now > requestExpiresAt(request, now))
|
|
5131
|
+
return "expired";
|
|
5132
|
+
let runState = requestRunState(request, state);
|
|
5133
|
+
return runState === "stopped" || request.expectsReply && runState === "inactive" ? "inactive" : "pending";
|
|
5035
5134
|
}
|
|
5036
5135
|
function cleanupRequestLifecycle(request, lifecycle) {
|
|
5037
5136
|
(lifecycle === "resolved" || lifecycle === "expired" || lifecycle === "inactive") && removeRequestFile(request.requestFile);
|
|
@@ -5047,9 +5146,9 @@ function formatPendingLine(request) {
|
|
|
5047
5146
|
let replyHint = request.expectsReply ? ` Reply: ${NATIVE_SUPERVISOR_TOOL_NAME}({ action: "reply", replyTo: "${request.id}", message: "..." })` : "";
|
|
5048
5147
|
return `- ${request.id}: ${request.agent} [${request.runId}#${request.childIndex}] ${request.reason}.${replyHint}`;
|
|
5049
5148
|
}
|
|
5050
|
-
function requestVisibleText(request) {
|
|
5051
|
-
let lines = [
|
|
5052
|
-
return request.expectsReply && lines.push("", `Reply with: ${NATIVE_SUPERVISOR_TOOL_NAME}({ action: "reply", replyTo: "${request.id}", message: "..." })`), lines.join(`
|
|
5149
|
+
function requestVisibleText(request, communication) {
|
|
5150
|
+
let lines = [`From: ${communication.peer}`, "", communication.message];
|
|
5151
|
+
return request.reason === "interview_request" && lines.push("", "Reply with JSON matching the requested interview shape."), request.expectsReply && lines.push("", `Reply with: ${NATIVE_SUPERVISOR_TOOL_NAME}({ action: "reply", replyTo: "${request.id}", message: "..." })`), lines.join(`
|
|
5053
5152
|
`);
|
|
5054
5153
|
}
|
|
5055
5154
|
function writeReply(request, message) {
|
|
@@ -5098,6 +5197,13 @@ function buildParentIntercomTool(pending, state, name = "intercom") {
|
|
|
5098
5197
|
label: name === "intercom" ? "Intercom" : "Subagent Supervisor",
|
|
5099
5198
|
description: PARENT_ASK_DESCRIPTION,
|
|
5100
5199
|
parameters: ParentSupervisorParamsSchema,
|
|
5200
|
+
renderCall(args, theme, context) {
|
|
5201
|
+
let request = args.action === "reply" ? pending.get(args.replyTo) : void 0, peer = request ? requestCommunication(request, state).peer : args.id ? resolveCommunicationPeer(state, args.id, args.index ?? 0, args.childId) : "Subagent";
|
|
5202
|
+
return renderCommunicationCall(name, args, theme, context, args.message ? { direction: "to", peer, message: args.message, kind: args.action === "ask" ? "question" : "reply" } : void 0);
|
|
5203
|
+
},
|
|
5204
|
+
renderResult(result2, options, theme, context) {
|
|
5205
|
+
return renderCommunicationResult(result2.content, result2.details, options.expanded, context.isError, theme);
|
|
5206
|
+
},
|
|
5101
5207
|
async execute(_id, params) {
|
|
5102
5208
|
refreshPendingRequests(pending, state, state.lastUiContext ?? void 0);
|
|
5103
5209
|
let input = params;
|
|
@@ -5110,10 +5216,10 @@ function buildParentIntercomTool(pending, state, name = "intercom") {
|
|
|
5110
5216
|
}
|
|
5111
5217
|
if (input.action === "reply") {
|
|
5112
5218
|
let request = resolvePendingRequest(pending, input);
|
|
5113
|
-
return writeReply(request, input.message ?? ""), pending.delete(request.id), { content: [{ type: "text", text: `Replied to
|
|
5219
|
+
return writeReply(request, input.message ?? ""), pending.delete(request.id), { 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 } } };
|
|
5114
5220
|
}
|
|
5115
5221
|
if (input.action === "ask")
|
|
5116
|
-
return askRunningAsyncChild({
|
|
5222
|
+
return subagentCommunicationEnabled(process.cwd(), getAgentDir()) ? askRunningAsyncChild({
|
|
5117
5223
|
params: {
|
|
5118
5224
|
id: input.id,
|
|
5119
5225
|
index: input.index,
|
|
@@ -5123,7 +5229,7 @@ function buildParentIntercomTool(pending, state, name = "intercom") {
|
|
|
5123
5229
|
},
|
|
5124
5230
|
state,
|
|
5125
5231
|
childRequests: pending.values()
|
|
5126
|
-
});
|
|
5232
|
+
}) : { content: [{ type: "text", text: "Subagent communication is off in /settings. Wait for the child to complete instead of asking it." }], isError: !0, details: { disabled: !0 } };
|
|
5127
5233
|
throw input.action === "send" ? 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.") : new Error(`Unsupported intercom action: ${input.action}`);
|
|
5128
5234
|
}
|
|
5129
5235
|
};
|
|
@@ -5132,29 +5238,30 @@ function questionMatchesParentContext(question, state, ctx) {
|
|
|
5132
5238
|
let sessionId = currentSupervisorSessionId(state, ctx);
|
|
5133
5239
|
return !(!sessionId || question.parentSessionId !== sessionId || (state.sessionGeneration ?? 0) !== question.parentGeneration);
|
|
5134
5240
|
}
|
|
5135
|
-
function notifyQuestionTerminal(pi, question, channelDir) {
|
|
5241
|
+
function notifyQuestionTerminal(pi, question, channelDir, state) {
|
|
5136
5242
|
if (!supervisorQuestionIsTerminal(question) || question.notifiedAt || (pi.events?.emit(SUBAGENT_QUESTION_EVENT, {
|
|
5137
5243
|
questionId: question.id,
|
|
5138
5244
|
state: supervisorQuestionPublicState(question),
|
|
5139
5245
|
runId: question.runId
|
|
5140
5246
|
}), isQuestionWaitActive(question.id)) || !claimQuestionNotification(channelDir, question.id))
|
|
5141
5247
|
return;
|
|
5142
|
-
let
|
|
5248
|
+
let outcome = supervisorQuestionPublicState(question), communication = { direction: "from", peer: question.childDescription ?? resolveCommunicationPeer(state, question.runId, question.childIndex, question.childId), message: question.answer ?? question.cancelReason ?? outcome, kind: "answer" };
|
|
5143
5249
|
pi.sendMessage({
|
|
5144
5250
|
customType: SUBAGENT_SUPERVISOR_ANSWER_TYPE,
|
|
5145
5251
|
content: formatSupervisorQuestionAnswer(question),
|
|
5146
|
-
display:
|
|
5252
|
+
display: outcome === "answered",
|
|
5147
5253
|
details: {
|
|
5148
5254
|
questionId: question.id,
|
|
5149
|
-
state,
|
|
5255
|
+
state: outcome,
|
|
5256
|
+
communication,
|
|
5150
5257
|
runId: question.runId,
|
|
5151
5258
|
childIndex: question.childIndex,
|
|
5152
5259
|
childId: question.childId,
|
|
5153
5260
|
reason: question.reason,
|
|
5154
|
-
answered:
|
|
5261
|
+
answered: outcome === "answered",
|
|
5155
5262
|
delivered: !!question.deliveredAt
|
|
5156
5263
|
}
|
|
5157
|
-
}, { triggerTurn:
|
|
5264
|
+
}, { triggerTurn: outcome === "answered" });
|
|
5158
5265
|
}
|
|
5159
5266
|
function pollSupervisorQuestions(pi, state, ctx) {
|
|
5160
5267
|
for (let channelDir of listSupervisorChannelDirs())
|
|
@@ -5162,11 +5269,11 @@ function pollSupervisorQuestions(pi, state, ctx) {
|
|
|
5162
5269
|
if (!questionMatchesParentContext(question, state, ctx))
|
|
5163
5270
|
continue;
|
|
5164
5271
|
let current = reconcileAsyncQuestion(channelDir, question, state);
|
|
5165
|
-
notifyQuestionTerminal(pi, current, channelDir);
|
|
5272
|
+
notifyQuestionTerminal(pi, current, channelDir, state);
|
|
5166
5273
|
}
|
|
5167
5274
|
}
|
|
5168
5275
|
function createNativeSupervisorChannel(pi, state) {
|
|
5169
|
-
let pending = /* @__PURE__ */ new Map(), seenFiles = /* @__PURE__ */ new Set(), poller, lastStaleCleanupAt = 0, registerParentTools = () => {
|
|
5276
|
+
let pending = /* @__PURE__ */ new Map(), seenFiles = /* @__PURE__ */ new Set(), deliveredRequests = /* @__PURE__ */ new Set(), poller, lastStaleCleanupAt = 0, registerParentTools = () => {
|
|
5170
5277
|
hasTool(pi, NATIVE_SUPERVISOR_TOOL_NAME) || pi.registerTool(buildParentIntercomTool(pending, state, NATIVE_SUPERVISOR_TOOL_NAME)), hasTool(pi, "intercom") || pi.registerTool(buildParentIntercomTool(pending, state));
|
|
5171
5278
|
}, cleanupStaleChannelsIfDue = () => {
|
|
5172
5279
|
let nowMs = Date.now();
|
|
@@ -5207,19 +5314,25 @@ function createNativeSupervisorChannel(pi, state) {
|
|
|
5207
5314
|
seenFiles.add(file), cleanupRequestLifecycle(request, lifecycle);
|
|
5208
5315
|
continue;
|
|
5209
5316
|
}
|
|
5210
|
-
if (
|
|
5211
|
-
|
|
5212
|
-
|
|
5317
|
+
if (request.expectsReply && pending.set(request.id, request), deliveredRequests.has(request.id)) {
|
|
5318
|
+
seenFiles.add(file);
|
|
5319
|
+
continue;
|
|
5320
|
+
}
|
|
5321
|
+
let communication = requestCommunication(request, state), details = {
|
|
5322
|
+
id: request.id,
|
|
5323
|
+
reason: request.reason,
|
|
5324
|
+
expectsReply: request.expectsReply,
|
|
5325
|
+
runId: request.runId,
|
|
5326
|
+
agent: request.agent,
|
|
5327
|
+
childIndex: request.childIndex,
|
|
5328
|
+
communication
|
|
5329
|
+
};
|
|
5330
|
+
if (request.reason === "progress_update" && request.protocolVersion === 2 ? pi.appendEntry(SUPERVISOR_PROGRESS_TYPE, details) : pi.sendMessage({
|
|
5331
|
+
customType: SUPERVISOR_REQUEST_TYPE,
|
|
5332
|
+
content: requestVisibleText(request, communication),
|
|
5213
5333
|
display: !0,
|
|
5214
|
-
details
|
|
5215
|
-
|
|
5216
|
-
reason: request.reason,
|
|
5217
|
-
expectsReply: request.expectsReply,
|
|
5218
|
-
runId: request.runId,
|
|
5219
|
-
agent: request.agent,
|
|
5220
|
-
childIndex: request.childIndex
|
|
5221
|
-
}
|
|
5222
|
-
}), request.expectsReply) {
|
|
5334
|
+
details
|
|
5335
|
+
}, { triggerTurn: request.expectsReply || request.reason === "handoff" }), deliveredRequests.add(request.id), seenFiles.add(file), request.expectsReply || removeRequestFile(request.requestFile), request.expectsReply) {
|
|
5223
5336
|
let job = state.asyncJobs.get(request.runId);
|
|
5224
5337
|
job && (job.activityState = "needs_attention");
|
|
5225
5338
|
let events = pi.events;
|
|
@@ -5240,10 +5353,17 @@ function createNativeSupervisorChannel(pi, state) {
|
|
|
5240
5353
|
};
|
|
5241
5354
|
return {
|
|
5242
5355
|
start: () => {
|
|
5243
|
-
|
|
5356
|
+
if (!poller) {
|
|
5357
|
+
registerParentTools();
|
|
5358
|
+
for (let entry of state.lastUiContext?.sessionManager.getBranch?.() ?? []) {
|
|
5359
|
+
let data = entry.type === "custom_message" && entry.customType === SUPERVISOR_REQUEST_TYPE ? entry.details : entry.type === "custom" && entry.customType === SUPERVISOR_PROGRESS_TYPE ? entry.data : void 0;
|
|
5360
|
+
data && typeof data == "object" && "id" in data && typeof data.id == "string" && deliveredRequests.add(data.id);
|
|
5361
|
+
}
|
|
5362
|
+
poll(), poller = setInterval(poll, CHANNEL_POLL_MS), poller.unref?.();
|
|
5363
|
+
}
|
|
5244
5364
|
},
|
|
5245
5365
|
dispose: () => {
|
|
5246
|
-
cancelOwnedQuestions("parent supervisor channel disposed"), poller && clearInterval(poller), poller = void 0, pending.clear(), seenFiles.clear();
|
|
5366
|
+
cancelOwnedQuestions("parent supervisor channel disposed"), poller && clearInterval(poller), poller = void 0, pending.clear(), seenFiles.clear(), deliveredRequests.clear();
|
|
5247
5367
|
},
|
|
5248
5368
|
pending,
|
|
5249
5369
|
cancelOwnedQuestions,
|
|
@@ -5724,6 +5844,8 @@ async function waitForDetachedForegroundRun(run, signal, deps, startedAt, now, p
|
|
|
5724
5844
|
let outcome = summarizeForegroundChildren(current, initialDetachedIndices);
|
|
5725
5845
|
return result(`Waited ${formatDuration(now() - startedAt)} for remembered detached foreground run "${run.runId}"; done. Outcome: ${outcome || "no recovered child status"}. Completion event observed; inspect with subagent({ action: "status", id: "${run.runId}" }) for recovered output.`);
|
|
5726
5846
|
}
|
|
5847
|
+
if (deps.wasInterrupted?.())
|
|
5848
|
+
return result("Wait interrupted by user input; background work remains active.");
|
|
5727
5849
|
if (signal?.aborted)
|
|
5728
5850
|
return result(`Wait aborted after ${formatDuration(now() - startedAt)}. Remembered foreground run "${run.runId}" remains detached.`, !0);
|
|
5729
5851
|
if (now() - startedAt >= timeoutMs)
|
|
@@ -5763,6 +5885,8 @@ async function waitForSupervisorQuestion(questionId, signal, deps, startedAt, no
|
|
|
5763
5885
|
}
|
|
5764
5886
|
};
|
|
5765
5887
|
}
|
|
5888
|
+
if (deps.wasInterrupted?.())
|
|
5889
|
+
return result("Wait interrupted by user input; background work remains active.");
|
|
5766
5890
|
if (signal?.aborted)
|
|
5767
5891
|
return result(`Wait aborted after ${formatDuration(now() - startedAt)} for supervisor question "${questionId}".`, !0);
|
|
5768
5892
|
if (now() - startedAt >= timeoutMs)
|
|
@@ -5813,8 +5937,12 @@ async function waitForSubagents(params, signal, deps) {
|
|
|
5813
5937
|
...activeInitialRuns.map((run) => `${run.id} (${run.state})`),
|
|
5814
5938
|
...activeInitialProviderItems.map((item) => `${item.provider}/${item.id}`)
|
|
5815
5939
|
].join(", ");
|
|
5940
|
+
if (deps.wasInterrupted?.())
|
|
5941
|
+
return result("Wait interrupted by user input; background work remains active.");
|
|
5816
5942
|
if (signal?.aborted)
|
|
5817
5943
|
return result(`Wait aborted after ${formatDuration(now() - startedAt)}. Still active: ${stillActive}.`, !0);
|
|
5944
|
+
if (deps.shouldYield?.())
|
|
5945
|
+
return result("Wait yielded for pending session messages; background work remains active.");
|
|
5818
5946
|
if (now() - startedAt >= timeoutMs)
|
|
5819
5947
|
return result(`Wait timed out after ${formatDuration(timeoutMs)} with ${activeInitialRuns.length} async run(s) and ${activeInitialProviderItems.length} provider item(s) still active: ${stillActive}. The work keeps going; call subagent_wait again or inspect subagent status.`, !0);
|
|
5820
5948
|
try {
|
|
@@ -5844,6 +5972,16 @@ async function waitForSubagents(params, signal, deps) {
|
|
|
5844
5972
|
}
|
|
5845
5973
|
|
|
5846
5974
|
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js
|
|
5975
|
+
var WAIT_INTERRUPTION_SYMBOL = /* @__PURE__ */ Symbol.for("@lunr/subagent-wait-interruption");
|
|
5976
|
+
function registerWaitInterruption(sessionId) {
|
|
5977
|
+
return sessionId ? globalThis[WAIT_INTERRUPTION_SYMBOL]?.owners?.get(sessionId)?.register() : void 0;
|
|
5978
|
+
}
|
|
5979
|
+
function interruptedResult() {
|
|
5980
|
+
return {
|
|
5981
|
+
content: [{ type: "text", text: "Wait interrupted by user input; background work remains active." }],
|
|
5982
|
+
details: { mode: "management", results: [] }
|
|
5983
|
+
};
|
|
5984
|
+
}
|
|
5847
5985
|
function registerWaitTool(pi, state, enabled = resolveWaitToolConfig().enabled, waitForPendingLaunches) {
|
|
5848
5986
|
let tool = {
|
|
5849
5987
|
name: "subagent_wait",
|
|
@@ -5863,7 +6001,25 @@ Provider jobs are session-scoped and identified exactly, so replacing one job wi
|
|
|
5863
6001
|
Configured behavior: subagent_wait is disabled by config.waitTool or PI_SUBAGENT_WAIT_TOOL_ENABLED and returns immediately without blocking.`}`,
|
|
5864
6002
|
parameters: SubagentWaitParams,
|
|
5865
6003
|
async execute(_id, params, signal) {
|
|
5866
|
-
|
|
6004
|
+
await Promise.resolve();
|
|
6005
|
+
let interruption = registerWaitInterruption(state.currentSessionId), waitSignal = interruption ? signal ? AbortSignal.any([signal, interruption.signal]) : interruption.signal : signal;
|
|
6006
|
+
try {
|
|
6007
|
+
try {
|
|
6008
|
+
await waitForPendingLaunches?.(waitSignal);
|
|
6009
|
+
} catch (error) {
|
|
6010
|
+
if (interruption?.wasInterrupted())
|
|
6011
|
+
return interruptedResult();
|
|
6012
|
+
throw error;
|
|
6013
|
+
}
|
|
6014
|
+
return interruption?.wasInterrupted() ? interruptedResult() : (signal?.throwIfAborted(), waitForSubagents(params, waitSignal, {
|
|
6015
|
+
state,
|
|
6016
|
+
events: pi.events,
|
|
6017
|
+
enabled,
|
|
6018
|
+
wasInterrupted: interruption?.wasInterrupted
|
|
6019
|
+
}));
|
|
6020
|
+
} finally {
|
|
6021
|
+
interruption?.unregister();
|
|
6022
|
+
}
|
|
5867
6023
|
}
|
|
5868
6024
|
};
|
|
5869
6025
|
pi.registerTool(tool);
|
|
@@ -5890,7 +6046,7 @@ async function drainOutstandingWork(deps) {
|
|
|
5890
6046
|
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0)
|
|
5891
6047
|
throw new Error("Auto-drain timeoutMs must be a positive finite number.");
|
|
5892
6048
|
let deadlineAt = now() + timeoutMs, hasWork = deps.hasWork ?? hasOutstandingWork, wait = deps.wait ?? waitForSubagents;
|
|
5893
|
-
for (; hasWork(sessionId, now()); ) {
|
|
6049
|
+
for (; !deps.hasPendingMessages?.() && hasWork(sessionId, now()); ) {
|
|
5894
6050
|
let remainingMs = deadlineAt - now();
|
|
5895
6051
|
if (remainingMs <= 0)
|
|
5896
6052
|
throw new Error(`Auto-drain timed out after ${timeoutMs}ms with background work still active in session '${sessionId}'.`);
|
|
@@ -5899,6 +6055,7 @@ async function drainOutstandingWork(deps) {
|
|
|
5899
6055
|
events: deps.events,
|
|
5900
6056
|
now,
|
|
5901
6057
|
stopOnAttention: !1,
|
|
6058
|
+
shouldYield: deps.hasPendingMessages,
|
|
5902
6059
|
failOnFailedRuns: !0
|
|
5903
6060
|
});
|
|
5904
6061
|
if (waitResult.isError)
|
|
@@ -6188,16 +6345,18 @@ var CUSTOM_TOOL_DESCRIPTION_FILE = "subagent-tool-description.md", CUSTOM_TOOL_D
|
|
|
6188
6345
|
\u2022 Choose the lowest tier that can reliably complete the task.
|
|
6189
6346
|
\u2022 light: Use for simple, straightforward tasks that require little reasoning. Good for quick checks, finding information, collecting facts for research, inspecting a small amount of code, or verifying a specific fact.
|
|
6190
6347
|
\u2022 standard: Use for moderately difficult work and everyday coding tasks. Good for writing simple code, fixing a clearly described bug, reviewing a focused change, or completing work with clear requirements. Use heavy when the task requires deep architectural understanding or complex reasoning.
|
|
6191
|
-
\u2022 heavy: Use for complex or ambiguous tasks that require deep reasoning and strong code understanding. Good for implementing complex plans, debugging difficult or poorly understood problems, reviewing large or high-risk changes, and making architectural decisions.`, SUBAGENT_SAFETY_GUIDANCE = `SAFETY-CRITICAL SUBAGENT GUIDANCE:
|
|
6348
|
+
\u2022 heavy: Use for complex or ambiguous tasks that require deep reasoning and strong code understanding. Good for implementing complex plans, debugging difficult or poorly understood problems, reviewing large or high-risk changes, and making architectural decisions.`, SUBAGENT_COORDINATION_GUIDANCE = "Define file ownership, local decision authority, and required outputs at launch. Establish shared contracts before dependent parallel work; use chains and artifacts to pass results. When enabled, native child intercom reaches the supervisor only, not siblings. Reserve parent relays for actionable exceptions, not routine progress or implementation approvals.", SUBAGENT_SAFETY_GUIDANCE = `SAFETY-CRITICAL SUBAGENT GUIDANCE:
|
|
6192
6349
|
\u2022 Prompt children directly. There is no agent roster. Every execution task needs task (the full child prompt) and description (a concise UI label).
|
|
6193
6350
|
\u2022 Every executable child chooses exactly one of tier: "light"|"standard"|"heavy" (default) or model: "provider/id" when the user names a model. Do not pass both, and do not use inherit. Missing, disabled, unconfigured, unavailable, or unauthenticated selections fail before launch.
|
|
6194
6351
|
\u2022 Optional thinking (off/minimal/low/medium/high/xhigh/max) is only valid with an explicit model. Tier launches use the configured tier thinking level.
|
|
6195
6352
|
${SUBAGENT_TIER_GUIDANCE}
|
|
6196
|
-
\u2022 permissions is "full" or "read-only". Omitted permissions means full.
|
|
6353
|
+
\u2022 permissions is "full" or "read-only". Omitted permissions means full. Read-only parents must pass permissions: "read-only"; full or omitted launches are rejected.
|
|
6197
6354
|
\u2022 Keep execution and control separate: omit action for SINGLE/PARALLEL/CHAIN execution; use action only for status/interrupt/stop/resume/steer/append-step/doctor/watchdog.status|check|recommend-model/schedule*.
|
|
6198
6355
|
\u2022 ${SUBAGENT_ASYNC_GUIDANCE}
|
|
6199
6356
|
\u2022 Child-safety boundary: ordinary children are not orchestrators and must not run subagents. Only explicitly configured fanout children may use the child-safe subagent tool, still bounded by depth/session limits.
|
|
6200
6357
|
\u2022 Writing/review safety: keep one full-access writer for the same cwd/worktree. Use fresh-context permissions: "read-only" children for independent review, then have the parent synthesize and apply fixes as the sole writer unless an isolated worktree was intentionally requested.
|
|
6358
|
+
\u2022 ${SUBAGENT_COORDINATION_GUIDANCE}
|
|
6359
|
+
\u2022 When Subagent communication is off in /settings, child contact and parent questions/steering are unavailable; final results and subagent_wait still work.
|
|
6201
6360
|
\u2022 Artifacts/status essentials: chain outputs live under {chain_dir}; async runs expose asyncId/asyncDir with status.json, events.jsonl, output logs, and status via { action: "status", id }. Include output paths and residual risks when reporting results.`, FULL_SUBAGENT_TOOL_DESCRIPTION = `Delegate work to generic children by prompting them directly. There are no named agent types.
|
|
6202
6361
|
|
|
6203
6362
|
EXECUTION (use exactly ONE mode):
|
|
@@ -6205,7 +6364,7 @@ EXECUTION (use exactly ONE mode):
|
|
|
6205
6364
|
\u2022 PARALLEL: { tasks: [{task, description, tier|model, thinking?, permissions?, count?, output?, reads?, progress?}, ...], concurrency?: number, worktree?: true } \u2014 one-call concurrent execution (default: all tasks at once; worktree: isolate each task in a git worktree)
|
|
6206
6365
|
\u2022 CHAIN: { chain: [{task, description, tier|model, thinking?, permissions?}, {parallel:[{task, description, tier|model, thinking?, permissions?, count:3}]}] } \u2014 sequential pipeline with optional parallel fan-out. Use chain when a later child needs an earlier result.
|
|
6207
6366
|
\u2022 description is required, single-line, max 80 characters. It is UI metadata only. task is the complete child prompt.
|
|
6208
|
-
\u2022 permissions: "full" (default) or "read-only". Full includes coding tools (read, search, shell, edit, write, web, LSP, MCP) and excludes parent-owned tools (cron, memory, behavior, goals, nested subagents).
|
|
6367
|
+
\u2022 permissions: "full" (default) or "read-only". Full includes coding tools (read, search, shell, edit, write, web, LSP, MCP) and excludes parent-owned tools (cron, memory, behavior, goals, nested subagents). Read-only parents may launch only permissions: "read-only".
|
|
6209
6368
|
\u2022 Model selection: pass tier by default ("light"|"standard"|"heavy"). Pass model: "provider/id" only when the user specifies a model. Exactly one of tier or model. Optional thinking only with model; tier uses configured thinking. Direct model launches do not require tier mode to be enabled. No inherit and no silent fallback for an explicit model.
|
|
6210
6369
|
\u2022 Children always start with a fresh session (no inherited parent transcript).
|
|
6211
6370
|
\u2022 Optional timeout: { timeoutMs } or { maxRuntimeMs } sets a run-level max runtime for foreground and async/background runs
|
|
@@ -6246,9 +6405,11 @@ ${SUBAGENT_SAFETY_GUIDANCE}`, COMPACT_SUBAGENT_TOOL_DESCRIPTION = `Delegate to g
|
|
|
6246
6405
|
|
|
6247
6406
|
EXECUTE:
|
|
6248
6407
|
\u2022 SINGLE {task, description, tier|model, thinking?, permissions?} (same-turn singles overlap); PARALLEL {tasks:[{task,description,tier|model,thinking?,permissions?,count?,output?,reads?,progress?}], concurrency?, worktree?}; CHAIN {chain:[{task,description,tier|model,thinking?,permissions?},{parallel:[...]}]} for sequential work.
|
|
6249
|
-
\u2022 description is required (single-line, max 80 chars, UI only). task is the full child prompt. permissions omitted = full.
|
|
6408
|
+
\u2022 description is required (single-line, max 80 chars, UI only). task is the full child prompt. permissions omitted = full. Read-only parents must pass permissions:"read-only".
|
|
6250
6409
|
\u2022 Exactly one of tier:"light"|"standard"|"heavy" (default) or model:"provider/id" when the user names a model. thinking only with model. No inherit; fail closed on unavailable selections. Children always start fresh. timeoutMs/maxRuntimeMs apply to foreground and async/background runs.
|
|
6251
6410
|
${SUBAGENT_TIER_GUIDANCE}
|
|
6411
|
+
\u2022 ${SUBAGENT_COORDINATION_GUIDANCE}
|
|
6412
|
+
\u2022 When Subagent communication is off in /settings, child contact and parent questions/steering are unavailable; final results and subagent_wait still work.
|
|
6252
6413
|
\u2022 Chain templates may use {task}, {previous}, {chain_dir}, and named outputs. Parallel worktree isolation requires a clean git repo.
|
|
6253
6414
|
\u2022 Chain example: { chain: [{task:"Analyze {task}", description:"Analyze request", tier:"standard"}, {parallel: [{task:"Check {previous}", description:"Check prior result", tier:"light", permissions:"read-only", count: 3}]}] }
|
|
6254
6415
|
|
|
@@ -6421,20 +6582,20 @@ function resolveSubagentActionDisplayTitle(args, state) {
|
|
|
6421
6582
|
function renderSubagentCall(rawArgs, theme, context, options) {
|
|
6422
6583
|
let args = resolveSubagentRequestParams(rawArgs);
|
|
6423
6584
|
if (args.action) {
|
|
6424
|
-
let
|
|
6425
|
-
return new
|
|
6585
|
+
let resolvedTitle = context?.result?.details?.displayTitle || options?.resolveActionTitle?.(args), target = resolvedTitle || args.id || args.runId || "";
|
|
6586
|
+
return (args.action === "steer" || args.action === "resume") && args.message ? renderCommunicationCall("subagent", args, theme, context, { direction: "to", peer: resolvedTitle || "Subagent", kind: "steer", message: args.message }, resolvedTitle) : new Text3(`${theme.fg("toolTitle", theme.bold("subagent "))}${args.action}${target ? ` ${theme.fg("accent", target)}` : ""}`, 0, 0);
|
|
6426
6587
|
}
|
|
6427
6588
|
let isParallel = (args.tasks?.length ?? 0) > 0, parallelCount = effectiveParallelTaskCount(args.tasks), asyncMark = subagentLaunchRunsAsync(args) ? `${theme.fg("warning", "async")} ` : "";
|
|
6428
6589
|
if (args.chain?.length)
|
|
6429
|
-
return new
|
|
6590
|
+
return new Text3(`${theme.fg("toolTitle", theme.bold("subagent "))}${asyncMark}chain (${args.chain.length})`, 0, 0);
|
|
6430
6591
|
if (isParallel)
|
|
6431
|
-
return new
|
|
6592
|
+
return new Text3(`${theme.fg("toolTitle", theme.bold("subagent "))}${asyncMark}parallel (${parallelCount})`, 0, 0);
|
|
6432
6593
|
let description = !context?.result && !context?.isPartial && !context?.expanded && !context?.isError ? theme.fg("accent", args.description || args.task || "?") : "", title = theme.fg("toolTitle", theme.bold("subagent")), rest = [asyncMark.trim() ? theme.fg("warning", "async") : "", description].filter(Boolean).join(" ");
|
|
6433
|
-
return new
|
|
6594
|
+
return new Text3(rest ? `${title} ${rest}` : title, 0, 0);
|
|
6434
6595
|
}
|
|
6435
6596
|
function renderSubagentNotify(details, theme) {
|
|
6436
6597
|
let status = typeof details?.status == "string" ? details.status : "", icon = status === "completed" ? theme.fg("success", "\u2713") : status === "failed" ? theme.fg("error", "\u2717") : theme.fg("warning", "\u25A0"), title = details?.agent || "child";
|
|
6437
|
-
return new
|
|
6598
|
+
return new Text3(`${icon} ${theme.bold(title)} ${theme.fg("dim", status)}`, 0, 0);
|
|
6438
6599
|
}
|
|
6439
6600
|
function ensureSubagentResultAnimation(context) {
|
|
6440
6601
|
let state = context.state;
|
|
@@ -6461,14 +6622,14 @@ function isStaleExtensionContextError(error) {
|
|
|
6461
6622
|
}
|
|
6462
6623
|
function rebuildSlashResultContainer(container, result2, options, theme) {
|
|
6463
6624
|
container.clear(), container.addChild(new Spacer2(1));
|
|
6464
|
-
let boxTheme = isSlashResultRunning(result2) ? "toolPendingBg" : isSlashResultError(result2) ? "toolErrorBg" : "toolSuccessBg", box = new
|
|
6625
|
+
let boxTheme = isSlashResultRunning(result2) ? "toolPendingBg" : isSlashResultError(result2) ? "toolErrorBg" : "toolSuccessBg", box = new Box2(1, 1, (text) => theme.bg(boxTheme, text));
|
|
6465
6626
|
box.addChild(renderSubagentResult(result2, options, theme)), container.addChild(box);
|
|
6466
6627
|
}
|
|
6467
6628
|
function createSlashResultComponent(details, options, theme) {
|
|
6468
|
-
let container = new
|
|
6629
|
+
let container = new Container3(), lastVersion = -1;
|
|
6469
6630
|
return container.render = (width) => {
|
|
6470
6631
|
let snapshot = getSlashRenderableSnapshot(details);
|
|
6471
|
-
return (snapshot.version !== lastVersion || isSlashResultRunning(snapshot.result)) && (lastVersion = snapshot.version, rebuildSlashResultContainer(container, snapshot.result, options, theme)),
|
|
6632
|
+
return (snapshot.version !== lastVersion || isSlashResultRunning(snapshot.result)) && (lastVersion = snapshot.version, rebuildSlashResultContainer(container, snapshot.result, options, theme)), Container3.prototype.render.call(container, width);
|
|
6472
6633
|
}, container;
|
|
6473
6634
|
}
|
|
6474
6635
|
function registerSubagentExtension(pi) {
|
|
@@ -6536,7 +6697,7 @@ function registerSubagentExtension(pi) {
|
|
|
6536
6697
|
try {
|
|
6537
6698
|
let currentGeneration = generation;
|
|
6538
6699
|
if (signal?.throwIfAborted(), !executorPromise) {
|
|
6539
|
-
let pending = import("./subagent-executor-
|
|
6700
|
+
let pending = import("./subagent-executor-2BH76MMS.js").then(({ createSubagentExecutor }) => {
|
|
6540
6701
|
if (generation !== currentGeneration)
|
|
6541
6702
|
throw new Error("Subagent session changed before initialization");
|
|
6542
6703
|
return createSubagentExecutor({
|
|
@@ -6565,27 +6726,31 @@ function registerSubagentExtension(pi) {
|
|
|
6565
6726
|
}
|
|
6566
6727
|
}
|
|
6567
6728
|
};
|
|
6568
|
-
executorExecute = executor.execute, pi.registerMessageRenderer(SLASH_RESULT_TYPE, (message, options, theme) => {
|
|
6729
|
+
executorExecute = executor.execute, registerSupervisorRenderers(pi, state), pi.registerMessageRenderer(SLASH_RESULT_TYPE, (message, options, theme) => {
|
|
6569
6730
|
let details = resolveSlashMessageDetails(message.details);
|
|
6570
6731
|
if (details)
|
|
6571
6732
|
return createSlashResultComponent(details, options, theme);
|
|
6572
6733
|
}), pi.registerMessageRenderer(SLASH_TEXT_RESULT_TYPE, (message, _options, _theme) => {
|
|
6573
6734
|
let content = typeof message.content == "string" ? message.content : message.content.filter((entry) => entry.type === "text").map((entry) => entry.text).join(`
|
|
6574
6735
|
`);
|
|
6575
|
-
return new
|
|
6736
|
+
return new Text3(content, 0, 0);
|
|
6576
6737
|
}), pi.registerMessageRenderer("subagent-notify", (message, _options, theme) => {
|
|
6577
6738
|
let content = typeof message.content == "string" ? message.content : "", details = message.details ?? parseSubagentNotifyContent(content);
|
|
6578
|
-
return details ? renderSubagentNotify(details, theme) : new
|
|
6739
|
+
return details ? renderSubagentNotify(details, theme) : new Text3(content, 0, 0);
|
|
6579
6740
|
}), pi.registerMessageRenderer(SUBAGENT_STEERING_MESSAGE_TYPE, (message, _options, theme) => {
|
|
6580
6741
|
let details = message.details;
|
|
6581
6742
|
if (details)
|
|
6582
|
-
return new
|
|
6743
|
+
return new Text3(theme.fg(details.state === "recovered" ? "warning" : "error", formatSteeringNotice(details)), 0, 0);
|
|
6583
6744
|
}), pi.registerMessageRenderer(SUBAGENT_CONTROL_MESSAGE_TYPE, () => {
|
|
6584
6745
|
});
|
|
6585
6746
|
let executeSubagentCollapsed = async (id, params, signal, onUpdate, ctx) => {
|
|
6586
6747
|
ctx.hasUI && ctx.ui.setToolsExpanded(!1);
|
|
6587
|
-
let
|
|
6588
|
-
|
|
6748
|
+
let isCommunication = (params.action === "steer" || params.action === "resume") && typeof params.message == "string", displayTitle = isCommunication ? resolveSubagentActionDisplayTitle(params, state) : void 0, jobs = isCommunication ? matchingActionJobs(state, (params.id || params.runId || "").trim()) : [], targetNames = new Map(jobs.length === 1 ? jobs[0].steps?.map((step, index) => [step.index ?? index, childRowLabel(step)]) : []), result2 = await executor.execute(id, params, signal, onUpdate, ctx);
|
|
6749
|
+
if (displayTitle && result2.details && (result2.details.displayTitle = displayTitle), isCommunication && result2.details) {
|
|
6750
|
+
let targets = result2.details.steering?.targets.map((target) => targetNames.get(target.index) ?? `Subagent ${target.index + 1}`), peer = targets?.length ? targets.join(", ") : displayTitle || "Subagent";
|
|
6751
|
+
result2.details.communication = { direction: "to", peer, kind: "steer", message: params.message };
|
|
6752
|
+
}
|
|
6753
|
+
return result2;
|
|
6589
6754
|
}, slashBridge = registerSlashSubagentBridge({
|
|
6590
6755
|
events: pi.events,
|
|
6591
6756
|
getContext: () => state.lastUiContext,
|
|
@@ -6615,6 +6780,8 @@ function registerSubagentExtension(pi) {
|
|
|
6615
6780
|
resolveActionTitle: (params) => resolveSubagentActionDisplayTitle(params, state)
|
|
6616
6781
|
}),
|
|
6617
6782
|
renderResult(result2, options, theme, context) {
|
|
6783
|
+
if (result2.details?.communication)
|
|
6784
|
+
return renderCommunicationResult(result2.content, result2.details, options.expanded, context.isError, theme);
|
|
6618
6785
|
subagentResultIsRunning(result2) ? ensureSubagentResultAnimation(context) : clearLegacyResultAnimationTimer(context);
|
|
6619
6786
|
let state2 = context.state, entries = [];
|
|
6620
6787
|
state2.animEntries = entries, subagentAnimSink.current = entries;
|
|
@@ -6632,7 +6799,7 @@ function registerSubagentExtension(pi) {
|
|
|
6632
6799
|
launches.length !== 0 && await awaitWithAbort(Promise.all(launches).then(() => {
|
|
6633
6800
|
}), signal);
|
|
6634
6801
|
}), pi.on("agent_end", async (_event, ctx) => {
|
|
6635
|
-
ctx.hasUI || await drainOutstandingWork({ state, events: pi.events });
|
|
6802
|
+
ctx.hasUI || await drainOutstandingWork({ state, events: pi.events, hasPendingMessages: () => ctx.hasPendingMessages() });
|
|
6636
6803
|
}), registerSlashCommands(pi, state);
|
|
6637
6804
|
let eventUnsubscribeStoreKey = "__piSubagentEventUnsubscribes", controlNoticeSeenStoreKey = "__piSubagentVisibleControlNotices", previousEventUnsubscribes = globalStore[eventUnsubscribeStoreKey];
|
|
6638
6805
|
if (Array.isArray(previousEventUnsubscribes)) {
|