@ashx-j/lunr-dev 0.2.16-dev.9.1 → 0.2.21-dev.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -1
- package/README.md +7 -1
- package/dist/builtin-extensions/ashxj-thinking.d.ts +1 -0
- package/dist/builtin-extensions/ashxj-thinking.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-thinking.js +44 -19
- package/dist/builtin-extensions/ashxj-thinking.js.map +1 -1
- package/dist/builtin-extensions/index.d.ts.map +1 -1
- package/dist/builtin-extensions/index.js +1 -2
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/lunr-computer-use.d.ts +3 -0
- package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-computer-use.js +158 -0
- package/dist/builtin-extensions/lunr-computer-use.js.map +1 -0
- package/dist/builtin-extensions/lunr-todos.d.ts +6 -5
- package/dist/builtin-extensions/lunr-todos.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-todos.js +9 -7
- package/dist/builtin-extensions/lunr-todos.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts +6 -4
- package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/broker/spawn.js +114 -61
- package/dist/builtin-extensions/pi-intercom/broker/spawn.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.js +360 -351
- package/dist/builtin-extensions/pi-intercom/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js +10 -3
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts +5 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js +26 -4
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.js +37 -27
- package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts +6 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js +33 -8
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js +2 -2
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +8 -6
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +179 -79
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts +18 -8
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +44 -15
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +4 -3
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +24 -14
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts +8 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js +247 -18
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts +29 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js +179 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts +89 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js +541 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +11 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +38 -12
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js +3 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts +2 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js +35 -8
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts +7 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js +26 -4
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js +55 -38
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts +100 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +46 -31
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts +3 -6
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js +64 -5
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts +15 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js +14 -4
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +7 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +21 -8
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts +10 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js +38 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts +0 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +74 -41
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js +75 -18
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts +13 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js +67 -11
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts +3 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js +7 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +13 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts +2 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js +5 -10
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.js +3 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts +3 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js +68 -11
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts +12 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js +21 -2
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +21 -4
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts +7 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js +11 -7
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +6 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +46 -29
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +47 -4
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +428 -431
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts +2 -13
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js +5 -91
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.js +103 -102
- package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +1 -1
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/computer-use/adapter.d.ts +23 -0
- package/dist/core/computer-use/adapter.d.ts.map +1 -0
- package/dist/core/computer-use/adapter.js +116 -0
- package/dist/core/computer-use/adapter.js.map +1 -0
- package/dist/core/computer-use/image.d.ts +26 -0
- package/dist/core/computer-use/image.d.ts.map +1 -0
- package/dist/core/computer-use/image.js +64 -0
- package/dist/core/computer-use/image.js.map +1 -0
- package/dist/core/computer-use/lease.d.ts +18 -0
- package/dist/core/computer-use/lease.d.ts.map +1 -0
- package/dist/core/computer-use/lease.js +129 -0
- package/dist/core/computer-use/lease.js.map +1 -0
- package/dist/core/computer-use/macos-runtime.d.ts +14 -0
- package/dist/core/computer-use/macos-runtime.d.ts.map +1 -0
- package/dist/core/computer-use/macos-runtime.js +148 -0
- package/dist/core/computer-use/macos-runtime.js.map +1 -0
- package/dist/core/computer-use/policy.d.ts +19 -0
- package/dist/core/computer-use/policy.d.ts.map +1 -0
- package/dist/core/computer-use/policy.js +62 -0
- package/dist/core/computer-use/policy.js.map +1 -0
- package/dist/core/computer-use/release.generated.d.ts +31 -0
- package/dist/core/computer-use/release.generated.d.ts.map +1 -0
- package/dist/core/computer-use/release.generated.js +36 -0
- package/dist/core/computer-use/release.generated.js.map +1 -0
- package/dist/core/computer-use/runtime.d.ts +13 -0
- package/dist/core/computer-use/runtime.d.ts.map +1 -0
- package/dist/core/computer-use/runtime.js +158 -0
- package/dist/core/computer-use/runtime.js.map +1 -0
- package/dist/core/computer-use/schemas.d.ts +91 -0
- package/dist/core/computer-use/schemas.d.ts.map +1 -0
- package/dist/core/computer-use/schemas.js +71 -0
- package/dist/core/computer-use/schemas.js.map +1 -0
- package/dist/core/computer-use/windows-desktop.d.ts +3 -0
- package/dist/core/computer-use/windows-desktop.d.ts.map +1 -0
- package/dist/core/computer-use/windows-desktop.js +48 -0
- package/dist/core/computer-use/windows-desktop.js.map +1 -0
- package/dist/core/computer-use/workflow.d.ts +32 -0
- package/dist/core/computer-use/workflow.d.ts.map +1 -0
- package/dist/core/computer-use/workflow.js +341 -0
- package/dist/core/computer-use/workflow.js.map +1 -0
- package/dist/core/customize.d.ts +2 -0
- package/dist/core/customize.d.ts.map +1 -1
- package/dist/core/customize.js +3 -0
- package/dist/core/customize.js.map +1 -1
- package/dist/core/keybindings.d.ts +2 -2
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +2 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-runtime.d.ts +0 -3
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +1 -10
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +1 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/permissions.d.ts +2 -1
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +31 -11
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +9 -5
- package/dist/core/plan-mode.js.map +1 -1
- package/dist/core/rollback.d.ts.map +1 -1
- package/dist/core/rollback.js +13 -90
- package/dist/core/rollback.js.map +1 -1
- package/dist/core/runtime-bridges.d.ts.map +1 -1
- package/dist/core/runtime-bridges.js +0 -2
- package/dist/core/runtime-bridges.js.map +1 -1
- package/dist/core/session-manager.d.ts +0 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +21 -79
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +10 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +30 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/subagent-cancellation.d.ts +21 -0
- package/dist/core/subagent-cancellation.d.ts.map +1 -0
- package/dist/core/subagent-cancellation.js +53 -0
- package/dist/core/subagent-cancellation.js.map +1 -0
- package/dist/core/subagent-spinner-setting.d.ts +6 -0
- package/dist/core/subagent-spinner-setting.d.ts.map +1 -0
- package/dist/core/subagent-spinner-setting.js +12 -0
- package/dist/core/subagent-spinner-setting.js.map +1 -0
- package/dist/core/subagent-spinner.d.ts +4 -0
- package/dist/core/subagent-spinner.d.ts.map +1 -0
- package/dist/core/subagent-spinner.js +6 -0
- package/dist/core/subagent-spinner.js.map +1 -0
- package/dist/dev-cli.js +0 -0
- package/dist/gateway/agent-bridge.d.ts +6 -1
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +23 -6
- package/dist/gateway/agent-bridge.js.map +1 -1
- package/dist/gateway/cron.d.ts +1 -1
- package/dist/gateway/cron.d.ts.map +1 -1
- package/dist/gateway/cron.js +23 -7
- package/dist/gateway/cron.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +12 -18
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +4 -2
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +23 -32
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/processes-selector.d.ts +2 -3
- package/dist/modes/interactive/components/processes-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/processes-selector.js +5 -10
- package/dist/modes/interactive/components/processes-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +8 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +93 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +12 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/extension-widget-order.d.ts +8 -0
- package/dist/modes/interactive/extension-widget-order.d.ts.map +1 -0
- package/dist/modes/interactive/extension-widget-order.js +37 -0
- package/dist/modes/interactive/extension-widget-order.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +58 -26
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/thinking-level-slash.d.ts +4 -0
- package/dist/modes/interactive/thinking-level-slash.d.ts.map +1 -0
- package/dist/modes/interactive/thinking-level-slash.js +23 -0
- package/dist/modes/interactive/thinking-level-slash.js.map +1 -0
- package/dist/node-runtime/adapter-AZMY335J.js +279 -0
- package/dist/node-runtime/{agent-session-services-IFJMSX7Z.js → agent-session-services-QANFGM2V.js} +15 -11
- package/dist/node-runtime/{builtin-extensions-LYZ3BFWQ.js → builtin-extensions-SRCYQPZ6.js} +5 -3
- package/dist/node-runtime/chunk-2IDTZAG5.js +1415 -0
- package/dist/node-runtime/chunk-3ONQTOMR.js +68 -0
- package/dist/node-runtime/{chunk-TQNSPERU.js → chunk-5SQDLSZJ.js} +1 -1
- package/dist/node-runtime/chunk-5ZH3ZFIZ.js +308 -0
- package/dist/node-runtime/{chunk-PBC2Y6GS.js → chunk-6UB6NKA3.js} +29 -72
- package/dist/node-runtime/{chunk-A2KQXUJD.js → chunk-7AFOFSDY.js} +1 -1
- package/dist/node-runtime/chunk-A3KMVBZV.js +60 -0
- package/dist/node-runtime/{chunk-N77MY65L.js → chunk-BJ6H7DPI.js} +25 -25
- package/dist/node-runtime/{chunk-PGAJ5MO5.js → chunk-BYQ2MOFI.js} +6 -6
- package/dist/node-runtime/{chunk-QH42CDX3.js → chunk-CZUBYPFP.js} +234 -124
- package/dist/node-runtime/{chunk-LZAW4ZX3.js → chunk-D466UAID.js} +34 -13
- package/dist/node-runtime/{chunk-ZKMFUD3Q.js → chunk-GT5F3OKM.js} +3 -3
- package/dist/node-runtime/chunk-H2BI7G7T.js +73 -0
- package/dist/node-runtime/{chunk-5P7PZMRU.js → chunk-HRS4HMDX.js} +1 -1
- package/dist/node-runtime/{chunk-IPA627GP.js → chunk-HXJS2PJM.js} +4 -4
- package/dist/node-runtime/chunk-JZHEUQRL.js +180 -0
- package/dist/node-runtime/chunk-LISUTZS3.js +19 -0
- package/dist/node-runtime/chunk-LOYUC2ID.js +2185 -0
- package/dist/node-runtime/{chunk-2QKLKMKC.js → chunk-LTXUQJI4.js} +1 -1
- package/dist/node-runtime/{chunk-YF63P5ZT.js → chunk-LTYWTR3V.js} +1 -426
- package/dist/node-runtime/{chunk-MKKH27PH.js → chunk-LWJXTA6Z.js} +274 -2416
- package/dist/node-runtime/chunk-MW2XJZIK.js +108 -0
- package/dist/node-runtime/{chunk-CDFZEWPU.js → chunk-N3PNL74S.js} +537 -262
- package/dist/node-runtime/{chunk-4TLO4PO2.js → chunk-U6C7VTR5.js} +7 -1401
- package/dist/node-runtime/chunk-URD2SLIT.js +1019 -0
- package/dist/node-runtime/{chunk-HQCKFM2O.js → chunk-VGYZ3APQ.js} +3 -0
- package/dist/node-runtime/{chunk-AJX357CL.js → chunk-VQ4UBWSA.js} +30 -1013
- package/dist/node-runtime/{chunk-F4VQFJI2.js → chunk-VTGEKB7R.js} +2 -2
- package/dist/node-runtime/{chunk-AD6VXAO7.js → chunk-VTPM5V35.js} +5 -100
- package/dist/node-runtime/chunk-W3SILANP.js +24 -0
- package/dist/node-runtime/{chunk-WOVTOV5P.js → chunk-XAUQOKYK.js} +421 -63
- package/dist/node-runtime/{chunk-ECD5L7YI.js → chunk-XSRCAQK2.js} +390 -16
- package/dist/node-runtime/{chunk-PCGNAY2O.js → chunk-ZOIIMEN6.js} +54 -433
- package/dist/node-runtime/{chunk-EDBJNRSM.js → chunk-ZVSORYRM.js} +1 -1
- package/dist/node-runtime/cli-runtime.js +1 -1
- package/dist/node-runtime/{command-L3LAHDIH.js → command-ZURZJDXF.js} +1 -1
- package/dist/node-runtime/{commands-RL5YBW5I.js → commands-BZGSLIP7.js} +4 -2
- package/dist/node-runtime/{customize-XEXL2DGQ.js → customize-LF5VST47.js} +1 -1
- package/dist/node-runtime/{direct-tool-executor-JVDXTO7A.js → direct-tool-executor-BSZDHIYR.js} +7 -4
- package/dist/node-runtime/{export-html-KR26FOUZ.js → export-html-E4DT6ZJQ.js} +1 -1
- package/dist/node-runtime/{gateway-X2TI5X7F.js → gateway-FWHRIBK5.js} +24 -369
- package/dist/node-runtime/index.js +49 -42
- package/dist/node-runtime/{init-NJV2T55N.js → init-DVJUAOUO.js} +4 -2
- package/dist/node-runtime/{interactive-mode-KOM35YF2.js → interactive-mode-BBASNWHN.js} +23 -17
- package/dist/node-runtime/{interactive-view-U6OILKF3.js → interactive-view-N6F4KUIT.js} +3 -5
- package/dist/node-runtime/lunr-computer-use-TJNDAMWM.js +135 -0
- package/dist/node-runtime/{lunr-cron-YJ5UHYRD.js → lunr-cron-J64I72C6.js} +7 -1
- package/dist/node-runtime/main.js +25 -20
- package/dist/node-runtime/{mcp-auth-flow-QIXHW6QN.js → mcp-auth-flow-YL6RWPYG.js} +2 -1
- package/dist/node-runtime/{package-manager-cli-TZZHJCVI.js → package-manager-cli-VMYX4Y2S.js} +10 -7
- package/dist/node-runtime/{pi-intercom-EEMBGQID.js → pi-intercom-NV2LW6X7.js} +108 -87
- package/dist/node-runtime/{pi-mcp-adapter-QFB37AVN.js → pi-mcp-adapter-JLB5YL2F.js} +31 -25
- package/dist/node-runtime/{pi-subagents-7XJ4H53P.js → pi-subagents-WEHV3W7H.js} +1321 -631
- package/dist/node-runtime/{pi-web-access-DPGAVKOA.js → pi-web-access-FN5YC5T6.js} +67 -64
- package/dist/node-runtime/{proxy-modes-HEEFK4KC.js → proxy-modes-OR7ISBXK.js} +7 -4
- package/dist/node-runtime/rpc-entry.js +25 -20
- package/dist/node-runtime/runtime-3SB5ATHQ.js +21 -0
- package/dist/node-runtime/{runtime-bridges-PPHNBFWL.js → runtime-bridges-2VQTLPOZ.js} +3 -5
- package/dist/node-runtime/{session-manager-MQNBYACL.js → session-manager-QEMZBMTM.js} +3 -5
- package/dist/node-runtime/{session-selector-5AZLJS6U.js → session-selector-URVJLOTK.js} +2 -2
- package/dist/node-runtime/{settings-manager-5LF2VQWC.js → settings-manager-3CCU326G.js} +4 -1
- package/dist/node-runtime/{src-Y7JSCK64.js → src-BPQFJR76.js} +27 -7
- package/dist/node-runtime/{subagent-executor-5RNDEPIJ.js → subagent-executor-CXKXQDHH.js} +189 -284
- package/dist/node-runtime/{update-cli-A253SZ7P.js → update-cli-NM7B4CKL.js} +4 -1
- package/dist/node-runtime/workflow-C26QCUTW.js +468 -0
- package/dist/rpc.d.ts +3 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +18 -0
- package/dist/rpc.js.map +1 -0
- package/dist/startup/interactive-view.d.ts.map +1 -1
- package/dist/startup/interactive-view.js +1 -2
- package/dist/startup/interactive-view.js.map +1 -1
- package/docs/computer-use.md +242 -0
- package/docs/development.md +0 -32
- package/docs/features.md +24 -6
- package/docs/interactive-startup.md +10 -3
- package/docs/keybindings.md +5 -3
- package/docs/settings.md +3 -2
- package/docs/terminal-setup.md +1 -1
- package/docs/usage.md +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/hidden-thinking-label.ts +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/install-lock/package-lock.json +3827 -0
- package/install-lock/package.json +18 -0
- package/native/computer-use/LICENSE.md +21 -0
- package/npm-shrinkwrap.json +3808 -0
- package/package.json +16 -10
- package/dist/builtin-extensions/lunr-settings-tools.d.ts +0 -4
- package/dist/builtin-extensions/lunr-settings-tools.d.ts.map +0 -1
- package/dist/builtin-extensions/lunr-settings-tools.js +0 -120
- package/dist/builtin-extensions/lunr-settings-tools.js.map +0 -1
- package/dist/core/settings-tools-bridge.d.ts +0 -35
- package/dist/core/settings-tools-bridge.d.ts.map +0 -1
- package/dist/core/settings-tools-bridge.js +0 -56
- package/dist/core/settings-tools-bridge.js.map +0 -1
- package/dist/node-runtime/chunk-AHSTJBIB.js +0 -64
- package/dist/startup/interactive-shell.d.ts +0 -55
- package/dist/startup/interactive-shell.d.ts.map +0 -1
- package/dist/startup/interactive-shell.js +0 -264
- package/dist/startup/interactive-shell.js.map +0 -1
- package/dist/node-runtime/{chunk-YSKSB3BJ.js → chunk-CH6OL6P2.js} +2 -2
|
@@ -2,32 +2,33 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Subagent Tool
|
|
4
4
|
*
|
|
5
|
-
* Full-featured subagent with
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
5
|
+
* Full-featured subagent with foreground and async modes.
|
|
6
|
+
* - Async (default): Background execution, emits events when done
|
|
7
|
+
* - Foreground (async:false or clarify:true): Streams output, renders markdown, tracks usage
|
|
8
8
|
*
|
|
9
9
|
* Modes: single (agent + task), parallel (tasks[]), chain (chain[] with {previous})
|
|
10
|
-
* Toggle: async parameter (default: false, configurable via config.json)
|
|
11
10
|
*
|
|
12
11
|
* Config file: ~/.lunr/agent/extensions/subagent/config.json
|
|
13
|
-
* { "
|
|
12
|
+
* { "maxSubagentDepth": 1, "intercomBridge": { "mode": "always", "instructionFile": "./intercom-bridge.md" }, "worktreeSetupHook": "./scripts/setup-worktree.mjs" }
|
|
14
13
|
*/
|
|
15
14
|
import { randomUUID } from "node:crypto";
|
|
15
|
+
import { createSubagentCancellation, registerSubagentCancellation } from "../../../../core/subagent-cancellation.js";
|
|
16
16
|
import * as fs from "node:fs";
|
|
17
17
|
import * as os from "node:os";
|
|
18
18
|
import * as path from "node:path";
|
|
19
|
-
import { keyText } from "../../../../modes/interactive/components/keybinding-hints.js";
|
|
20
19
|
import { awaitWithAbort } from "../../../../utils/await-with-abort.js";
|
|
21
20
|
import { Box, Container, Spacer, Text, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@ashx-j/lunr-tui";
|
|
22
21
|
import { cleanupAllArtifactDirs, cleanupOldArtifacts, getArtifactsDir } from "../shared/artifacts.js";
|
|
23
22
|
import { resolveCurrentSessionId } from "../shared/session-identity.js";
|
|
24
23
|
import { cleanupOldChainDirs } from "../shared/settings.js";
|
|
25
|
-
import { clearLegacyResultAnimationTimer, renderSubagentResult, subagentAnimSink } from "../tui/render.js";
|
|
24
|
+
import { clearLegacyResultAnimationTimer, disposeSubagentWidget, renderSubagentResult, SUBAGENT_PAINT_INTERVAL_MS, subagentAnimSink, } from "../tui/render.js";
|
|
26
25
|
import { SubagentParams } from "./schemas.js";
|
|
27
26
|
import { validateChainInput } from "./chain-validation.js";
|
|
27
|
+
import { resolveSubagentRequestParams } from "../runs/foreground/request-params.js";
|
|
28
28
|
import { createAsyncJobTracker } from "../runs/background/async-job-tracker.js";
|
|
29
29
|
import { createResultWatcher } from "../runs/background/result-watcher.js";
|
|
30
30
|
import { createScheduledRunManager } from "../runs/background/scheduled-runs.js";
|
|
31
|
+
import { isAsyncSubagentExecution, normalizeAsyncLaunchConfig, subagentLaunchRunsAsync } from "../runs/background/top-level-async.js";
|
|
31
32
|
import { registerSlashCommands } from "../slash/slash-commands.js";
|
|
32
33
|
import { registerPromptTemplateDelegationBridge } from "../slash/prompt-template-bridge.js";
|
|
33
34
|
import { registerMainWatchdog } from "../watchdog/register-main.js";
|
|
@@ -41,10 +42,9 @@ import { drainOutstandingWork } from "../runs/background/auto-drain.js";
|
|
|
41
42
|
import registerSubagentNotify, { parseSubagentNotifyContent } from "../runs/background/notify.js";
|
|
42
43
|
import { formatSteeringNotice, handleSubagentSteeringNotice, SUBAGENT_STEERING_MESSAGE_TYPE } from "./steering-notices.js";
|
|
43
44
|
import { SUBAGENT_CHILD_ENV, SUBAGENT_PARENT_SESSION_ENV } from "../runs/shared/pi-args.js";
|
|
44
|
-
import { formatDuration, shortenPath } from "../shared/formatters.js";
|
|
45
45
|
import { loadConfig } from "./config.js";
|
|
46
46
|
import { buildSubagentToolDescription } from "./tool-description.js";
|
|
47
|
-
import { ASYNC_DIR, DEFAULT_ARTIFACT_CONFIG, RESULTS_DIR, SLASH_RESULT_TYPE, SLASH_TEXT_RESULT_TYPE, SUBAGENT_ASYNC_COMPLETE_EVENT, SUBAGENT_ASYNC_STARTED_EVENT, SUBAGENT_CONTROL_EVENT, SUBAGENT_STEERING_NOTICE_EVENT, WIDGET_KEY, } from "../shared/types.js";
|
|
47
|
+
import { ASYNC_DIR, childRowLabel, DEFAULT_ARTIFACT_CONFIG, RESULTS_DIR, SLASH_RESULT_TYPE, SLASH_TEXT_RESULT_TYPE, SUBAGENT_ASYNC_COMPLETE_EVENT, SUBAGENT_ASYNC_STARTED_EVENT, SUBAGENT_CONTROL_EVENT, SUBAGENT_STEERING_NOTICE_EVENT, WIDGET_KEY, } from "../shared/types.js";
|
|
48
48
|
import { clearPendingForegroundControlNotices, formatSubagentControlNotice, handleSubagentControlNotice, SUBAGENT_CONTROL_MESSAGE_TYPE, } from "./control-notices.js";
|
|
49
49
|
export { loadConfig } from "./config.js";
|
|
50
50
|
/**
|
|
@@ -114,23 +114,72 @@ function effectiveParallelTaskCount(tasks) {
|
|
|
114
114
|
return total + count;
|
|
115
115
|
}, 0);
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
function matchingActionJobs(state, requestedId) {
|
|
118
|
+
const jobs = new Map();
|
|
119
|
+
for (const job of state.asyncJobs.values())
|
|
120
|
+
jobs.set(job.asyncId, job);
|
|
121
|
+
for (const job of state.fleetJobs?.values() ?? [])
|
|
122
|
+
jobs.set(job.asyncId, job);
|
|
123
|
+
const exact = jobs.get(requestedId);
|
|
124
|
+
if (exact)
|
|
125
|
+
return [exact];
|
|
126
|
+
return [...jobs.values()].filter((job) => job.asyncId.startsWith(requestedId));
|
|
127
|
+
}
|
|
128
|
+
export function resolveSubagentActionDisplayTitle(args, state) {
|
|
129
|
+
const requestedId = (args.id || args.runId || "").trim();
|
|
130
|
+
if (!requestedId)
|
|
131
|
+
return undefined;
|
|
132
|
+
const matches = matchingActionJobs(state, requestedId);
|
|
133
|
+
if (matches.length !== 1)
|
|
134
|
+
return undefined;
|
|
135
|
+
const job = matches[0];
|
|
136
|
+
const steps = job.steps ?? [];
|
|
137
|
+
if (Number.isInteger(args.index)) {
|
|
138
|
+
const step = steps.find((candidate) => candidate.index === args.index) ?? steps[args.index];
|
|
139
|
+
return step ? childRowLabel(step) : undefined;
|
|
140
|
+
}
|
|
141
|
+
if (steps.length === 1)
|
|
142
|
+
return childRowLabel(steps[0]);
|
|
143
|
+
if (steps.length > 1)
|
|
144
|
+
return `${job.mode ?? "subagent"} run`;
|
|
145
|
+
if (job.agents?.length === 1)
|
|
146
|
+
return job.agents[0];
|
|
147
|
+
if (job.agents?.length)
|
|
148
|
+
return `${job.mode ?? "subagent"} run`;
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
export function renderSubagentCall(rawArgs, theme, context, options) {
|
|
152
|
+
const args = resolveSubagentRequestParams(rawArgs);
|
|
118
153
|
if (args.action) {
|
|
119
|
-
const
|
|
154
|
+
const resultTitle = context?.result?.details?.displayTitle;
|
|
155
|
+
const resolvedTitle = resultTitle || options?.resolveActionTitle?.(args);
|
|
156
|
+
const target = resolvedTitle || args.id || args.runId || "";
|
|
120
157
|
return new Text(`${theme.fg("toolTitle", theme.bold("subagent "))}${args.action}${target ? ` ${theme.fg("accent", target)}` : ""}`, 0, 0);
|
|
121
158
|
}
|
|
122
159
|
const isParallel = (args.tasks?.length ?? 0) > 0;
|
|
123
160
|
const parallelCount = effectiveParallelTaskCount(args.tasks);
|
|
124
|
-
const
|
|
161
|
+
const asyncMark = subagentLaunchRunsAsync(args) ? `${theme.fg("warning", "async")} ` : "";
|
|
125
162
|
if (args.chain?.length) {
|
|
126
|
-
return new Text(`${theme.fg("toolTitle", theme.bold("subagent "))}chain (${args.chain.length})
|
|
163
|
+
return new Text(`${theme.fg("toolTitle", theme.bold("subagent "))}${asyncMark}chain (${args.chain.length})`, 0, 0);
|
|
127
164
|
}
|
|
128
165
|
if (isParallel) {
|
|
129
|
-
return new Text(`${theme.fg("toolTitle", theme.bold("subagent "))}parallel (${parallelCount})
|
|
166
|
+
return new Text(`${theme.fg("toolTitle", theme.bold("subagent "))}${asyncMark}parallel (${parallelCount})`, 0, 0);
|
|
130
167
|
}
|
|
131
|
-
const showDescription = !context?.isPartial && !context?.expanded && !context?.isError;
|
|
168
|
+
const showDescription = !context?.result && !context?.isPartial && !context?.expanded && !context?.isError;
|
|
132
169
|
const description = showDescription ? theme.fg("accent", args.description || args.task || "?") : "";
|
|
133
|
-
|
|
170
|
+
const title = theme.fg("toolTitle", theme.bold("subagent"));
|
|
171
|
+
const rest = [asyncMark.trim() ? theme.fg("warning", "async") : "", description].filter(Boolean).join(" ");
|
|
172
|
+
return new Text(rest ? `${title} ${rest}` : title, 0, 0);
|
|
173
|
+
}
|
|
174
|
+
export function renderSubagentNotify(details, theme) {
|
|
175
|
+
const status = typeof details?.status === "string" ? details.status : "";
|
|
176
|
+
const icon = status === "completed"
|
|
177
|
+
? theme.fg("success", "✓")
|
|
178
|
+
: status === "failed"
|
|
179
|
+
? theme.fg("error", "✗")
|
|
180
|
+
: theme.fg("warning", "■");
|
|
181
|
+
const title = details?.agent || "child";
|
|
182
|
+
return new Text(`${icon} ${theme.bold(title)} ${theme.fg("dim", status)}`, 0, 0);
|
|
134
183
|
}
|
|
135
184
|
function ensureSubagentResultAnimation(context) {
|
|
136
185
|
const state = context.state;
|
|
@@ -141,7 +190,7 @@ function ensureSubagentResultAnimation(context) {
|
|
|
141
190
|
if (state.frame === undefined)
|
|
142
191
|
state.frame = 0;
|
|
143
192
|
state.subagentResultAnimationTimer = setInterval(() => {
|
|
144
|
-
state.frame = (
|
|
193
|
+
state.frame = (state.frame ?? 0) + 1;
|
|
145
194
|
try {
|
|
146
195
|
const entries = state.animEntries;
|
|
147
196
|
if (entries?.length && typeof context.requestRender === "function") {
|
|
@@ -155,7 +204,7 @@ function ensureSubagentResultAnimation(context) {
|
|
|
155
204
|
}
|
|
156
205
|
}
|
|
157
206
|
catch { }
|
|
158
|
-
},
|
|
207
|
+
}, SUBAGENT_PAINT_INTERVAL_MS);
|
|
159
208
|
}
|
|
160
209
|
function isSlashResultError(result) {
|
|
161
210
|
return result.details?.results.some((entry) => entry.exitCode !== 0 && entry.progress?.status !== "running") || false;
|
|
@@ -229,14 +278,14 @@ export default function registerSubagentExtension(pi) {
|
|
|
229
278
|
ensureAccessibleDir(RESULTS_DIR);
|
|
230
279
|
ensureAccessibleDir(ASYNC_DIR);
|
|
231
280
|
cleanupOldChainDirs();
|
|
232
|
-
const config = loadConfig();
|
|
281
|
+
const config = normalizeAsyncLaunchConfig(loadConfig());
|
|
233
282
|
const waitToolConfig = resolveWaitToolConfig(config.waitTool);
|
|
234
|
-
const asyncByDefault = config.asyncByDefault === true;
|
|
235
283
|
const tempArtifactsDir = getArtifactsDir(null);
|
|
236
284
|
cleanupAllArtifactDirs(DEFAULT_ARTIFACT_CONFIG.cleanupDays);
|
|
237
285
|
const state = {
|
|
238
286
|
baseCwd: "",
|
|
239
287
|
currentSessionId: null,
|
|
288
|
+
sessionGeneration: 0,
|
|
240
289
|
foregroundSubagentInFlight: 0,
|
|
241
290
|
subagentSpawns: { sessionId: null, count: 0 },
|
|
242
291
|
asyncJobs: new Map(),
|
|
@@ -263,23 +312,41 @@ export default function registerSubagentExtension(pi) {
|
|
|
263
312
|
primeExistingResults();
|
|
264
313
|
let generation = 0;
|
|
265
314
|
let executorPromise;
|
|
315
|
+
const pendingLaunches = new Set();
|
|
316
|
+
const pendingAsyncLaunches = new Set();
|
|
317
|
+
let unregisterCancellation;
|
|
266
318
|
const runtimeCleanup = () => {
|
|
267
319
|
generation++;
|
|
320
|
+
supervisorChannel.cancelOwnedQuestions("parent runtime replaced");
|
|
321
|
+
state.sessionGeneration = (state.sessionGeneration ?? 0) + 1;
|
|
268
322
|
executorPromise = undefined;
|
|
323
|
+
pendingLaunches.clear();
|
|
324
|
+
pendingAsyncLaunches.clear();
|
|
325
|
+
unregisterCancellation?.();
|
|
269
326
|
mainWatchdog.dispose();
|
|
270
327
|
stopResultWatcher();
|
|
271
328
|
scheduledRunManager.stop();
|
|
272
329
|
supervisorChannel.dispose();
|
|
273
330
|
clearPendingForegroundControlNotices(state);
|
|
331
|
+
disposeSubagentWidget();
|
|
274
332
|
if (state.poller) {
|
|
275
333
|
clearInterval(state.poller);
|
|
276
334
|
state.poller = null;
|
|
277
335
|
}
|
|
278
336
|
};
|
|
279
337
|
globalStore[runtimeCleanupStoreKey] = runtimeCleanup;
|
|
280
|
-
const { ensurePoller, refreshWidget, handleStarted, handleComplete, resetJobs, restoreActiveJobs } = createAsyncJobTracker(pi, state, ASYNC_DIR, {
|
|
338
|
+
const { ensurePoller, refreshWidget, handleStarted, handleComplete: trackComplete, resetJobs, restoreActiveJobs } = createAsyncJobTracker(pi, state, ASYNC_DIR, {
|
|
281
339
|
widgetEnabled: config.asyncWidget !== false,
|
|
282
340
|
});
|
|
341
|
+
const handleComplete = (data) => {
|
|
342
|
+
trackComplete(data);
|
|
343
|
+
const result = data;
|
|
344
|
+
if (typeof state.currentSessionId === "string" && result.sessionId !== state.currentSessionId)
|
|
345
|
+
return;
|
|
346
|
+
if (typeof result.id === "string" && result.id.trim()) {
|
|
347
|
+
supervisorChannel.settleRunQuestions(result.id, "async run settled");
|
|
348
|
+
}
|
|
349
|
+
};
|
|
283
350
|
let executorExecute;
|
|
284
351
|
const scheduledRunManager = createScheduledRunManager({
|
|
285
352
|
config,
|
|
@@ -296,30 +363,53 @@ export default function registerSubagentExtension(pi) {
|
|
|
296
363
|
});
|
|
297
364
|
const executor = {
|
|
298
365
|
async execute(id, params, signal, onUpdate, ctx) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
366
|
+
let resolveLaunchReady;
|
|
367
|
+
let launchReady = false;
|
|
368
|
+
const launchReadyPromise = new Promise((resolve) => {
|
|
369
|
+
resolveLaunchReady = resolve;
|
|
370
|
+
});
|
|
371
|
+
const markLaunchReady = () => {
|
|
372
|
+
if (launchReady)
|
|
373
|
+
return;
|
|
374
|
+
launchReady = true;
|
|
375
|
+
pendingLaunches.delete(launchReadyPromise);
|
|
376
|
+
pendingAsyncLaunches.delete(launchReadyPromise);
|
|
377
|
+
resolveLaunchReady();
|
|
378
|
+
};
|
|
379
|
+
pendingLaunches.add(launchReadyPromise);
|
|
380
|
+
if (isAsyncSubagentExecution(resolveSubagentRequestParams(params)))
|
|
381
|
+
pendingAsyncLaunches.add(launchReadyPromise);
|
|
382
|
+
try {
|
|
383
|
+
const currentGeneration = generation;
|
|
384
|
+
signal?.throwIfAborted();
|
|
385
|
+
if (!executorPromise) {
|
|
386
|
+
const pending = import("../runs/foreground/subagent-executor.js").then(({ createSubagentExecutor }) => {
|
|
387
|
+
if (generation !== currentGeneration)
|
|
388
|
+
throw new Error("Subagent session changed before initialization");
|
|
389
|
+
return createSubagentExecutor({
|
|
390
|
+
pi, state, config,
|
|
391
|
+
waitToolEnabled: waitToolConfig.enabled,
|
|
392
|
+
handleScheduledRunAction: (params, ctx) => scheduledRunManager.handleToolCall(params, ctx),
|
|
393
|
+
watchdog: mainWatchdog, tempArtifactsDir, getSubagentSessionRoot, expandTilde,
|
|
394
|
+
});
|
|
310
395
|
});
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
396
|
+
executorPromise = pending;
|
|
397
|
+
void pending.catch(() => {
|
|
398
|
+
if (executorPromise === pending)
|
|
399
|
+
executorPromise = undefined;
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
const ready = await awaitWithAbort(executorPromise, signal);
|
|
403
|
+
signal?.throwIfAborted();
|
|
404
|
+
if (generation !== currentGeneration)
|
|
405
|
+
throw new Error("Subagent session changed before execution");
|
|
406
|
+
const execution = ready.execute(id, params, signal, onUpdate, ctx);
|
|
407
|
+
markLaunchReady();
|
|
408
|
+
return await execution;
|
|
409
|
+
}
|
|
410
|
+
finally {
|
|
411
|
+
markLaunchReady();
|
|
317
412
|
}
|
|
318
|
-
const ready = await awaitWithAbort(executorPromise, signal);
|
|
319
|
-
signal?.throwIfAborted();
|
|
320
|
-
if (generation !== currentGeneration)
|
|
321
|
-
throw new Error("Subagent session changed before execution");
|
|
322
|
-
return ready.execute(id, params, signal, onUpdate, ctx);
|
|
323
413
|
},
|
|
324
414
|
};
|
|
325
415
|
executorExecute = executor.execute;
|
|
@@ -338,40 +428,12 @@ export default function registerSubagentExtension(pi) {
|
|
|
338
428
|
.join("\n");
|
|
339
429
|
return new Text(content, 0, 0);
|
|
340
430
|
});
|
|
341
|
-
pi.registerMessageRenderer("subagent-notify", (message,
|
|
431
|
+
pi.registerMessageRenderer("subagent-notify", (message, _options, theme) => {
|
|
342
432
|
const content = typeof message.content === "string" ? message.content : "";
|
|
343
433
|
const details = message.details ?? parseSubagentNotifyContent(content);
|
|
344
434
|
if (!details)
|
|
345
435
|
return new Text(content, 0, 0);
|
|
346
|
-
|
|
347
|
-
? theme.fg("success", "✓")
|
|
348
|
-
: details.status === "paused"
|
|
349
|
-
? theme.fg("warning", "■")
|
|
350
|
-
: theme.fg("error", "✗");
|
|
351
|
-
const parts = [];
|
|
352
|
-
if (details.taskInfo)
|
|
353
|
-
parts.push(details.taskInfo);
|
|
354
|
-
if (details.durationMs !== undefined)
|
|
355
|
-
parts.push(formatDuration(details.durationMs));
|
|
356
|
-
const notifyLabel = details.taskInfo || details.agent || "child";
|
|
357
|
-
let text = `${icon} ${theme.bold(notifyLabel)} ${theme.fg("dim", details.status)}`;
|
|
358
|
-
if (parts.length > 0)
|
|
359
|
-
text += ` ${theme.fg("dim", "·")} ${parts.map((part) => theme.fg("dim", part)).join(` ${theme.fg("dim", "·")} `)}`;
|
|
360
|
-
const trimmedPreview = details.resultPreview.trim();
|
|
361
|
-
const previewLines = options.expanded
|
|
362
|
-
? trimmedPreview.split("\n").filter((line) => line.trim())
|
|
363
|
-
: [trimmedPreview.split("\n", 1)[0] ?? ""].filter((line) => line.trim());
|
|
364
|
-
for (const line of previewLines.length > 0 ? previewLines : ["(no output)"]) {
|
|
365
|
-
text += `\n ${theme.fg("dim", `⎿ ${line}`)}`;
|
|
366
|
-
}
|
|
367
|
-
if (!options.expanded && trimmedPreview.includes("\n")) {
|
|
368
|
-
const expandKey = keyText("app.tools.expand");
|
|
369
|
-
text += `\n ${theme.fg("dim", `${expandKey} full notification`)}`;
|
|
370
|
-
}
|
|
371
|
-
if (details.sessionLabel && details.sessionValue) {
|
|
372
|
-
text += `\n ${theme.fg("muted", `${details.sessionLabel}: ${shortenPath(details.sessionValue)}`)}`;
|
|
373
|
-
}
|
|
374
|
-
return new Text(text, 0, 0);
|
|
436
|
+
return renderSubagentNotify(details, theme);
|
|
375
437
|
});
|
|
376
438
|
pi.registerMessageRenderer(SUBAGENT_STEERING_MESSAGE_TYPE, (message, _options, theme) => {
|
|
377
439
|
const details = message.details;
|
|
@@ -380,10 +442,16 @@ export default function registerSubagentExtension(pi) {
|
|
|
380
442
|
return new Text(theme.fg(details.state === "recovered" ? "warning" : "error", formatSteeringNotice(details)), 0, 0);
|
|
381
443
|
});
|
|
382
444
|
pi.registerMessageRenderer(SUBAGENT_CONTROL_MESSAGE_TYPE, () => undefined);
|
|
383
|
-
const executeSubagentCollapsed = (id, params, signal, onUpdate, ctx) => {
|
|
445
|
+
const executeSubagentCollapsed = async (id, params, signal, onUpdate, ctx) => {
|
|
384
446
|
if (ctx.hasUI)
|
|
385
447
|
ctx.ui.setToolsExpanded(false);
|
|
386
|
-
|
|
448
|
+
const displayTitle = params.action === "steer"
|
|
449
|
+
? resolveSubagentActionDisplayTitle(params, state)
|
|
450
|
+
: undefined;
|
|
451
|
+
const result = await executor.execute(id, params, signal, onUpdate, ctx);
|
|
452
|
+
if (displayTitle && result.details)
|
|
453
|
+
result.details.displayTitle = displayTitle;
|
|
454
|
+
return result;
|
|
387
455
|
};
|
|
388
456
|
const slashBridge = registerSlashSubagentBridge({
|
|
389
457
|
events: pi.events,
|
|
@@ -417,7 +485,9 @@ export default function registerSubagentExtension(pi) {
|
|
|
417
485
|
execute(id, params, signal, onUpdate, ctx) {
|
|
418
486
|
return executeSubagentCollapsed(id, params, signal, onUpdate, ctx);
|
|
419
487
|
},
|
|
420
|
-
renderCall: renderSubagentCall,
|
|
488
|
+
renderCall: (args, theme, context) => renderSubagentCall(args, theme, context, {
|
|
489
|
+
resolveActionTitle: (params) => resolveSubagentActionDisplayTitle(params, state),
|
|
490
|
+
}),
|
|
421
491
|
renderResult(result, options, theme, context) {
|
|
422
492
|
if (subagentResultIsRunning(result)) {
|
|
423
493
|
ensureSubagentResultAnimation(context);
|
|
@@ -440,15 +510,20 @@ export default function registerSubagentExtension(pi) {
|
|
|
440
510
|
},
|
|
441
511
|
};
|
|
442
512
|
pi.registerTool(tool);
|
|
443
|
-
// lunr: register a callback so
|
|
444
|
-
// tool description
|
|
513
|
+
// lunr: register a callback so model-tier settings changes rebuild the subagent
|
|
514
|
+
// tool description and refresh the live registry.
|
|
445
515
|
const modelTierBridge = globalThis[Symbol.for("@lunr/model-tiers")];
|
|
446
516
|
modelTierBridge?.registerToolDescriptionRefresher?.(() => {
|
|
447
517
|
tool.description = buildSubagentToolDescription(config);
|
|
448
518
|
// pi.runtime is not on ExtensionAPI; registerTool refreshes the live registry.
|
|
449
519
|
pi.registerTool(tool);
|
|
450
520
|
});
|
|
451
|
-
registerWaitTool(pi, state, waitToolConfig.enabled)
|
|
521
|
+
registerWaitTool(pi, state, waitToolConfig.enabled, async (signal) => {
|
|
522
|
+
const launches = [...pendingLaunches];
|
|
523
|
+
if (launches.length === 0)
|
|
524
|
+
return;
|
|
525
|
+
await awaitWithAbort(Promise.all(launches).then(() => { }), signal);
|
|
526
|
+
});
|
|
452
527
|
pi.on("agent_end", async (_event, ctx) => {
|
|
453
528
|
if (ctx.hasUI)
|
|
454
529
|
return;
|
|
@@ -517,7 +592,12 @@ export default function registerSubagentExtension(pi) {
|
|
|
517
592
|
};
|
|
518
593
|
const resetSessionState = (ctx) => {
|
|
519
594
|
generation++;
|
|
595
|
+
supervisorChannel.cancelOwnedQuestions("parent session replaced");
|
|
596
|
+
state.sessionGeneration = (state.sessionGeneration ?? 0) + 1;
|
|
520
597
|
executorPromise = undefined;
|
|
598
|
+
pendingLaunches.clear();
|
|
599
|
+
pendingAsyncLaunches.clear();
|
|
600
|
+
unregisterCancellation?.();
|
|
521
601
|
state.baseCwd = ctx.cwd;
|
|
522
602
|
state.currentSessionId = resolveCurrentSessionId(ctx.sessionManager);
|
|
523
603
|
state.subagentSpawns = { sessionId: state.currentSessionId, count: 0 };
|
|
@@ -537,6 +617,20 @@ export default function registerSubagentExtension(pi) {
|
|
|
537
617
|
clearPendingForegroundControlNotices(state);
|
|
538
618
|
resetJobs(ctx);
|
|
539
619
|
restoreActiveJobs(ctx);
|
|
620
|
+
const sessionId = state.currentSessionId;
|
|
621
|
+
const sessionGeneration = generation;
|
|
622
|
+
if (sessionId)
|
|
623
|
+
unregisterCancellation = registerSubagentCancellation(sessionId, createSubagentCancellation({
|
|
624
|
+
pendingLaunches: pendingAsyncLaunches,
|
|
625
|
+
isCurrent: () => generation === sessionGeneration && state.currentSessionId === sessionId,
|
|
626
|
+
getActiveRunIds: () => [...state.asyncJobs.values()]
|
|
627
|
+
.filter((job) => job.sessionId === sessionId && (job.status === "queued" || job.status === "running"))
|
|
628
|
+
.map((job) => job.asyncId),
|
|
629
|
+
async stopRun(id) {
|
|
630
|
+
const result = await executor.execute(randomUUID(), { action: "stop", id }, new AbortController().signal, undefined, ctx);
|
|
631
|
+
return !result.isError;
|
|
632
|
+
},
|
|
633
|
+
}));
|
|
540
634
|
scheduledRunManager.bindSession(ctx);
|
|
541
635
|
restoreSlashFinalSnapshots(ctx.sessionManager.getEntries());
|
|
542
636
|
primeExistingResults();
|
|
@@ -548,7 +642,12 @@ export default function registerSubagentExtension(pi) {
|
|
|
548
642
|
});
|
|
549
643
|
pi.on("session_shutdown", () => {
|
|
550
644
|
generation++;
|
|
645
|
+
supervisorChannel.cancelOwnedQuestions("parent session shutdown");
|
|
646
|
+
state.sessionGeneration = (state.sessionGeneration ?? 0) + 1;
|
|
551
647
|
executorPromise = undefined;
|
|
648
|
+
pendingLaunches.clear();
|
|
649
|
+
pendingAsyncLaunches.clear();
|
|
650
|
+
unregisterCancellation?.();
|
|
552
651
|
delete process.env[SUBAGENT_PARENT_SESSION_ENV];
|
|
553
652
|
for (const unsubscribe of eventUnsubscribes) {
|
|
554
653
|
try {
|
|
@@ -581,6 +680,7 @@ export default function registerSubagentExtension(pi) {
|
|
|
581
680
|
if (globalStore[runtimeCleanupStoreKey] === runtimeCleanup) {
|
|
582
681
|
delete globalStore[runtimeCleanupStoreKey];
|
|
583
682
|
}
|
|
683
|
+
disposeSubagentWidget();
|
|
584
684
|
try {
|
|
585
685
|
if (state.lastUiContext?.hasUI) {
|
|
586
686
|
state.lastUiContext.ui.setWidget(WIDGET_KEY, undefined);
|