@ashx-j/lunr-dev 0.2.19-dev.10.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 +36 -1
- package/README.md +2 -2
- package/dist/builtin-extensions/index.d.ts.map +1 -1
- package/dist/builtin-extensions/index.js +0 -2
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-computer-use.js +15 -14
- package/dist/builtin-extensions/lunr-computer-use.js.map +1 -1
- package/dist/builtin-extensions/lunr-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-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 +128 -57
- 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 +38 -13
- 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.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +2 -1
- 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/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 +71 -25
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js +75 -18
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/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 +46 -4
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +407 -450
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts +2 -13
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js +5 -91
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js.map +1 -1
- package/dist/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/policy.d.ts.map +1 -1
- package/dist/core/computer-use/policy.js +2 -6
- package/dist/core/computer-use/policy.js.map +1 -1
- package/dist/core/computer-use/schemas.d.ts +13 -10
- package/dist/core/computer-use/schemas.d.ts.map +1 -1
- package/dist/core/computer-use/schemas.js +26 -35
- package/dist/core/computer-use/schemas.js.map +1 -1
- package/dist/core/computer-use/workflow.d.ts +16 -8
- package/dist/core/computer-use/workflow.d.ts.map +1 -1
- package/dist/core/computer-use/workflow.js +271 -260
- package/dist/core/computer-use/workflow.js.map +1 -1
- package/dist/core/customize.d.ts +2 -0
- package/dist/core/customize.d.ts.map +1 -1
- package/dist/core/customize.js +3 -0
- package/dist/core/customize.js.map +1 -1
- package/dist/core/permissions.d.ts +1 -0
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +8 -4
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +0 -5
- package/dist/core/plan-mode.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/settings-manager.d.ts +4 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +11 -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/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/settings-selector.d.ts +4 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +73 -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 +44 -22
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/node-runtime/{agent-session-services-RSGP5GDN.js → agent-session-services-QANFGM2V.js} +14 -13
- package/dist/node-runtime/{builtin-extensions-7STLFW3A.js → builtin-extensions-SRCYQPZ6.js} +4 -3
- package/dist/node-runtime/{chunk-5OLJGVCB.js → chunk-3ONQTOMR.js} +2 -2
- package/dist/node-runtime/chunk-5ZH3ZFIZ.js +308 -0
- package/dist/node-runtime/{chunk-4SJWFTUP.js → chunk-7NBZ5P7I.js} +1 -1
- package/dist/node-runtime/chunk-A3KMVBZV.js +60 -0
- package/dist/node-runtime/{chunk-FLYMHKCS.js → chunk-BJ6H7DPI.js} +25 -25
- package/dist/node-runtime/{chunk-T5GM5BFH.js → chunk-BYQ2MOFI.js} +6 -6
- package/dist/node-runtime/{chunk-W7S2REEG.js → chunk-CZUBYPFP.js} +157 -74
- package/dist/node-runtime/{chunk-ZRDIMBEQ.js → chunk-D466UAID.js} +9 -6
- package/dist/node-runtime/{chunk-K72NVGUB.js → chunk-GT5F3OKM.js} +1 -1
- package/dist/node-runtime/chunk-H2BI7G7T.js +73 -0
- package/dist/node-runtime/{chunk-ISQDQIZN.js → chunk-HXJS2PJM.js} +2 -2
- package/dist/node-runtime/chunk-LISUTZS3.js +19 -0
- package/dist/node-runtime/{chunk-BKAZ6BKX.js → chunk-LOYUC2ID.js} +7 -7
- package/dist/node-runtime/{chunk-OTT6JMPU.js → chunk-LTYWTR3V.js} +1 -369
- package/dist/node-runtime/{chunk-5Q45AVQG.js → chunk-MW2XJZIK.js} +1 -1
- package/dist/node-runtime/{chunk-MUMMMTW4.js → chunk-N3PNL74S.js} +536 -265
- package/dist/node-runtime/{chunk-HQCKFM2O.js → chunk-VGYZ3APQ.js} +3 -0
- package/dist/node-runtime/{chunk-5NWQCSKR.js → chunk-VQ4UBWSA.js} +11 -1
- package/dist/node-runtime/{chunk-6SPPH4FY.js → chunk-VTGEKB7R.js} +4 -4
- package/dist/node-runtime/chunk-W3SILANP.js +24 -0
- package/dist/node-runtime/{chunk-J7QGQD45.js → chunk-WJVFOIB5.js} +1 -1
- package/dist/node-runtime/{chunk-JT6YCS5B.js → chunk-XAUQOKYK.js} +408 -45
- package/dist/node-runtime/{chunk-LCACDWHJ.js → chunk-XSRCAQK2.js} +13 -13
- package/dist/node-runtime/{chunk-TAP7QTUT.js → chunk-ZOIIMEN6.js} +24 -425
- package/dist/node-runtime/{chunk-MGSB2C3M.js → chunk-ZVSORYRM.js} +1 -1
- package/dist/node-runtime/{command-6UXQ6XZN.js → command-ZURZJDXF.js} +1 -1
- package/dist/node-runtime/{commands-LGR5VT5X.js → commands-BZGSLIP7.js} +3 -3
- package/dist/node-runtime/{customize-XEXL2DGQ.js → customize-LF5VST47.js} +1 -1
- package/dist/node-runtime/{direct-tool-executor-TDJS7TBD.js → direct-tool-executor-BSZDHIYR.js} +4 -4
- package/dist/node-runtime/{extract-IUCVZCWC.js → extract-XLQSJN4V.js} +2 -2
- package/dist/node-runtime/{gateway-3OLC4GQN.js → gateway-FWHRIBK5.js} +9 -9
- package/dist/node-runtime/{gemini-search-NCIDF7NE.js → gemini-search-U7SUMPQA.js} +1 -1
- package/dist/node-runtime/{gemini-url-context-OKIN7AIP.js → gemini-url-context-PXWCBQHK.js} +2 -2
- package/dist/node-runtime/index.js +34 -31
- package/dist/node-runtime/{init-EKE277AG.js → init-DVJUAOUO.js} +3 -3
- package/dist/node-runtime/{interactive-mode-S5M26CQ7.js → interactive-mode-BBASNWHN.js} +18 -15
- package/dist/node-runtime/lunr-computer-use-TJNDAMWM.js +135 -0
- package/dist/node-runtime/{lunr-cron-KKBOGAEF.js → lunr-cron-J64I72C6.js} +5 -5
- package/dist/node-runtime/main.js +22 -20
- package/dist/node-runtime/{package-manager-cli-C4EJOO5Q.js → package-manager-cli-VMYX4Y2S.js} +8 -7
- package/dist/node-runtime/{pi-intercom-EEMBGQID.js → pi-intercom-NV2LW6X7.js} +108 -87
- package/dist/node-runtime/{pi-mcp-adapter-DPTJGAAL.js → pi-mcp-adapter-JLB5YL2F.js} +6 -6
- package/dist/node-runtime/{pi-subagents-VKCLYIBY.js → pi-subagents-WEHV3W7H.js} +1267 -604
- package/dist/node-runtime/{pi-web-access-BV6DSZOP.js → pi-web-access-FN5YC5T6.js} +5 -5
- package/dist/node-runtime/{proxy-modes-R64LU6WZ.js → proxy-modes-OR7ISBXK.js} +7 -7
- package/dist/node-runtime/rpc-entry.js +22 -20
- package/dist/node-runtime/{runtime-bridges-UJ5WJJLN.js → runtime-bridges-2VQTLPOZ.js} +3 -5
- package/dist/node-runtime/{settings-manager-K6IPIQTI.js → settings-manager-3CCU326G.js} +3 -2
- package/dist/node-runtime/{subagent-executor-EFLTO32A.js → subagent-executor-CXKXQDHH.js} +186 -299
- package/dist/node-runtime/{update-cli-I6OVDRPL.js → update-cli-NM7B4CKL.js} +3 -2
- package/dist/node-runtime/{video-extract-ETA5RA7U.js → video-extract-OYT5WKS5.js} +2 -2
- package/dist/node-runtime/workflow-C26QCUTW.js +468 -0
- package/dist/node-runtime/{youtube-extract-SRVGNN26.js → youtube-extract-TQYKGFGS.js} +2 -2
- package/docs/computer-use.md +233 -268
- package/docs/features.md +22 -4
- package/docs/keybindings.md +3 -1
- package/docs/settings.md +3 -2
- 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/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 +24 -24
- package/install-lock/package.json +2 -2
- package/npm-shrinkwrap.json +21 -21
- package/package.json +7 -7
- 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-EH2LJQPM.js +0 -64
- package/dist/node-runtime/image-resize-6ZPBFMWW.js +0 -11
- package/dist/node-runtime/lunr-computer-use-4X3KUNF4.js +0 -206
- package/dist/node-runtime/workflow-SA34S4VX.js +0 -325
- package/dist/node-runtime/{chunk-EHMBW7FA.js → chunk-VSELYKWU.js} +3 -3
- package/dist/node-runtime/{chunk-ZSEZY3II.js → chunk-VTPM5V35.js} +0 -0
- package/dist/node-runtime/{src-GPFAU3N6.js → src-BPQFJR76.js} +3 -3
|
@@ -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(),
|
|
@@ -264,24 +313,40 @@ export default function registerSubagentExtension(pi) {
|
|
|
264
313
|
let generation = 0;
|
|
265
314
|
let executorPromise;
|
|
266
315
|
const pendingLaunches = new Set();
|
|
316
|
+
const pendingAsyncLaunches = new Set();
|
|
317
|
+
let unregisterCancellation;
|
|
267
318
|
const runtimeCleanup = () => {
|
|
268
319
|
generation++;
|
|
320
|
+
supervisorChannel.cancelOwnedQuestions("parent runtime replaced");
|
|
321
|
+
state.sessionGeneration = (state.sessionGeneration ?? 0) + 1;
|
|
269
322
|
executorPromise = undefined;
|
|
270
323
|
pendingLaunches.clear();
|
|
324
|
+
pendingAsyncLaunches.clear();
|
|
325
|
+
unregisterCancellation?.();
|
|
271
326
|
mainWatchdog.dispose();
|
|
272
327
|
stopResultWatcher();
|
|
273
328
|
scheduledRunManager.stop();
|
|
274
329
|
supervisorChannel.dispose();
|
|
275
330
|
clearPendingForegroundControlNotices(state);
|
|
331
|
+
disposeSubagentWidget();
|
|
276
332
|
if (state.poller) {
|
|
277
333
|
clearInterval(state.poller);
|
|
278
334
|
state.poller = null;
|
|
279
335
|
}
|
|
280
336
|
};
|
|
281
337
|
globalStore[runtimeCleanupStoreKey] = runtimeCleanup;
|
|
282
|
-
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, {
|
|
283
339
|
widgetEnabled: config.asyncWidget !== false,
|
|
284
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
|
+
};
|
|
285
350
|
let executorExecute;
|
|
286
351
|
const scheduledRunManager = createScheduledRunManager({
|
|
287
352
|
config,
|
|
@@ -308,9 +373,12 @@ export default function registerSubagentExtension(pi) {
|
|
|
308
373
|
return;
|
|
309
374
|
launchReady = true;
|
|
310
375
|
pendingLaunches.delete(launchReadyPromise);
|
|
376
|
+
pendingAsyncLaunches.delete(launchReadyPromise);
|
|
311
377
|
resolveLaunchReady();
|
|
312
378
|
};
|
|
313
379
|
pendingLaunches.add(launchReadyPromise);
|
|
380
|
+
if (isAsyncSubagentExecution(resolveSubagentRequestParams(params)))
|
|
381
|
+
pendingAsyncLaunches.add(launchReadyPromise);
|
|
314
382
|
try {
|
|
315
383
|
const currentGeneration = generation;
|
|
316
384
|
signal?.throwIfAborted();
|
|
@@ -319,7 +387,7 @@ export default function registerSubagentExtension(pi) {
|
|
|
319
387
|
if (generation !== currentGeneration)
|
|
320
388
|
throw new Error("Subagent session changed before initialization");
|
|
321
389
|
return createSubagentExecutor({
|
|
322
|
-
pi, state, config,
|
|
390
|
+
pi, state, config,
|
|
323
391
|
waitToolEnabled: waitToolConfig.enabled,
|
|
324
392
|
handleScheduledRunAction: (params, ctx) => scheduledRunManager.handleToolCall(params, ctx),
|
|
325
393
|
watchdog: mainWatchdog, tempArtifactsDir, getSubagentSessionRoot, expandTilde,
|
|
@@ -360,40 +428,12 @@ export default function registerSubagentExtension(pi) {
|
|
|
360
428
|
.join("\n");
|
|
361
429
|
return new Text(content, 0, 0);
|
|
362
430
|
});
|
|
363
|
-
pi.registerMessageRenderer("subagent-notify", (message,
|
|
431
|
+
pi.registerMessageRenderer("subagent-notify", (message, _options, theme) => {
|
|
364
432
|
const content = typeof message.content === "string" ? message.content : "";
|
|
365
433
|
const details = message.details ?? parseSubagentNotifyContent(content);
|
|
366
434
|
if (!details)
|
|
367
435
|
return new Text(content, 0, 0);
|
|
368
|
-
|
|
369
|
-
? theme.fg("success", "✓")
|
|
370
|
-
: details.status === "paused"
|
|
371
|
-
? theme.fg("warning", "■")
|
|
372
|
-
: theme.fg("error", "✗");
|
|
373
|
-
const parts = [];
|
|
374
|
-
if (details.taskInfo)
|
|
375
|
-
parts.push(details.taskInfo);
|
|
376
|
-
if (details.durationMs !== undefined)
|
|
377
|
-
parts.push(formatDuration(details.durationMs));
|
|
378
|
-
const notifyLabel = details.taskInfo || details.agent || "child";
|
|
379
|
-
let text = `${icon} ${theme.bold(notifyLabel)} ${theme.fg("dim", details.status)}`;
|
|
380
|
-
if (parts.length > 0)
|
|
381
|
-
text += ` ${theme.fg("dim", "·")} ${parts.map((part) => theme.fg("dim", part)).join(` ${theme.fg("dim", "·")} `)}`;
|
|
382
|
-
const trimmedPreview = details.resultPreview.trim();
|
|
383
|
-
const previewLines = options.expanded
|
|
384
|
-
? trimmedPreview.split("\n").filter((line) => line.trim())
|
|
385
|
-
: [trimmedPreview.split("\n", 1)[0] ?? ""].filter((line) => line.trim());
|
|
386
|
-
for (const line of previewLines.length > 0 ? previewLines : ["(no output)"]) {
|
|
387
|
-
text += `\n ${theme.fg("dim", `⎿ ${line}`)}`;
|
|
388
|
-
}
|
|
389
|
-
if (!options.expanded && trimmedPreview.includes("\n")) {
|
|
390
|
-
const expandKey = keyText("app.tools.expand");
|
|
391
|
-
text += `\n ${theme.fg("dim", `${expandKey} full notification`)}`;
|
|
392
|
-
}
|
|
393
|
-
if (details.sessionLabel && details.sessionValue) {
|
|
394
|
-
text += `\n ${theme.fg("muted", `${details.sessionLabel}: ${shortenPath(details.sessionValue)}`)}`;
|
|
395
|
-
}
|
|
396
|
-
return new Text(text, 0, 0);
|
|
436
|
+
return renderSubagentNotify(details, theme);
|
|
397
437
|
});
|
|
398
438
|
pi.registerMessageRenderer(SUBAGENT_STEERING_MESSAGE_TYPE, (message, _options, theme) => {
|
|
399
439
|
const details = message.details;
|
|
@@ -402,10 +442,16 @@ export default function registerSubagentExtension(pi) {
|
|
|
402
442
|
return new Text(theme.fg(details.state === "recovered" ? "warning" : "error", formatSteeringNotice(details)), 0, 0);
|
|
403
443
|
});
|
|
404
444
|
pi.registerMessageRenderer(SUBAGENT_CONTROL_MESSAGE_TYPE, () => undefined);
|
|
405
|
-
const executeSubagentCollapsed = (id, params, signal, onUpdate, ctx) => {
|
|
445
|
+
const executeSubagentCollapsed = async (id, params, signal, onUpdate, ctx) => {
|
|
406
446
|
if (ctx.hasUI)
|
|
407
447
|
ctx.ui.setToolsExpanded(false);
|
|
408
|
-
|
|
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;
|
|
409
455
|
};
|
|
410
456
|
const slashBridge = registerSlashSubagentBridge({
|
|
411
457
|
events: pi.events,
|
|
@@ -439,7 +485,9 @@ export default function registerSubagentExtension(pi) {
|
|
|
439
485
|
execute(id, params, signal, onUpdate, ctx) {
|
|
440
486
|
return executeSubagentCollapsed(id, params, signal, onUpdate, ctx);
|
|
441
487
|
},
|
|
442
|
-
renderCall: renderSubagentCall,
|
|
488
|
+
renderCall: (args, theme, context) => renderSubagentCall(args, theme, context, {
|
|
489
|
+
resolveActionTitle: (params) => resolveSubagentActionDisplayTitle(params, state),
|
|
490
|
+
}),
|
|
443
491
|
renderResult(result, options, theme, context) {
|
|
444
492
|
if (subagentResultIsRunning(result)) {
|
|
445
493
|
ensureSubagentResultAnimation(context);
|
|
@@ -462,8 +510,8 @@ export default function registerSubagentExtension(pi) {
|
|
|
462
510
|
},
|
|
463
511
|
};
|
|
464
512
|
pi.registerTool(tool);
|
|
465
|
-
// lunr: register a callback so
|
|
466
|
-
// tool description
|
|
513
|
+
// lunr: register a callback so model-tier settings changes rebuild the subagent
|
|
514
|
+
// tool description and refresh the live registry.
|
|
467
515
|
const modelTierBridge = globalThis[Symbol.for("@lunr/model-tiers")];
|
|
468
516
|
modelTierBridge?.registerToolDescriptionRefresher?.(() => {
|
|
469
517
|
tool.description = buildSubagentToolDescription(config);
|
|
@@ -544,8 +592,12 @@ export default function registerSubagentExtension(pi) {
|
|
|
544
592
|
};
|
|
545
593
|
const resetSessionState = (ctx) => {
|
|
546
594
|
generation++;
|
|
595
|
+
supervisorChannel.cancelOwnedQuestions("parent session replaced");
|
|
596
|
+
state.sessionGeneration = (state.sessionGeneration ?? 0) + 1;
|
|
547
597
|
executorPromise = undefined;
|
|
548
598
|
pendingLaunches.clear();
|
|
599
|
+
pendingAsyncLaunches.clear();
|
|
600
|
+
unregisterCancellation?.();
|
|
549
601
|
state.baseCwd = ctx.cwd;
|
|
550
602
|
state.currentSessionId = resolveCurrentSessionId(ctx.sessionManager);
|
|
551
603
|
state.subagentSpawns = { sessionId: state.currentSessionId, count: 0 };
|
|
@@ -565,6 +617,20 @@ export default function registerSubagentExtension(pi) {
|
|
|
565
617
|
clearPendingForegroundControlNotices(state);
|
|
566
618
|
resetJobs(ctx);
|
|
567
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
|
+
}));
|
|
568
634
|
scheduledRunManager.bindSession(ctx);
|
|
569
635
|
restoreSlashFinalSnapshots(ctx.sessionManager.getEntries());
|
|
570
636
|
primeExistingResults();
|
|
@@ -576,8 +642,12 @@ export default function registerSubagentExtension(pi) {
|
|
|
576
642
|
});
|
|
577
643
|
pi.on("session_shutdown", () => {
|
|
578
644
|
generation++;
|
|
645
|
+
supervisorChannel.cancelOwnedQuestions("parent session shutdown");
|
|
646
|
+
state.sessionGeneration = (state.sessionGeneration ?? 0) + 1;
|
|
579
647
|
executorPromise = undefined;
|
|
580
648
|
pendingLaunches.clear();
|
|
649
|
+
pendingAsyncLaunches.clear();
|
|
650
|
+
unregisterCancellation?.();
|
|
581
651
|
delete process.env[SUBAGENT_PARENT_SESSION_ENV];
|
|
582
652
|
for (const unsubscribe of eventUnsubscribes) {
|
|
583
653
|
try {
|
|
@@ -610,6 +680,7 @@ export default function registerSubagentExtension(pi) {
|
|
|
610
680
|
if (globalStore[runtimeCleanupStoreKey] === runtimeCleanup) {
|
|
611
681
|
delete globalStore[runtimeCleanupStoreKey];
|
|
612
682
|
}
|
|
683
|
+
disposeSubagentWidget();
|
|
613
684
|
try {
|
|
614
685
|
if (state.lastUiContext?.hasUI) {
|
|
615
686
|
state.lastUiContext.ui.setWidget(WIDGET_KEY, undefined);
|