@ashx-j/lunr 0.2.22 → 0.2.24
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 +16 -1
- package/README.md +15 -13
- package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-tui.js +2 -2
- package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
- package/dist/builtin-extensions/lunr-browser.d.ts +7 -1
- package/dist/builtin-extensions/lunr-browser.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-browser.js +116 -3
- package/dist/builtin-extensions/lunr-browser.js.map +1 -1
- package/dist/builtin-extensions/lunr-plan-tools.d.ts +7 -7
- package/dist/builtin-extensions/lunr-plan-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-plan-tools.js +12 -12
- package/dist/builtin-extensions/lunr-plan-tools.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.js +2 -0
- package/dist/builtin-extensions/pi-intercom/index.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.js +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +4 -4
- 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 +6 -4
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js +6 -3
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js +7 -2
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +4 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js +9 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +41 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +5 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +3 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +23 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js +17 -15
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +3 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js +2 -2
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.js +3 -2
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.js.map +1 -1
- package/dist/core/agent-session.d.ts +20 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +235 -107
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/browser/schema.d.ts +1 -1
- package/dist/core/browser/schema.d.ts.map +1 -1
- package/dist/core/browser/schema.js +1 -1
- package/dist/core/browser/schema.js.map +1 -1
- package/dist/core/catalog-cache-scope.d.ts.map +1 -1
- package/dist/core/catalog-cache-scope.js +3 -1
- package/dist/core/catalog-cache-scope.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +3 -2
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/permissions.d.ts +16 -23
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +66 -141
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts +10 -12
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +16 -18
- 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 +2 -0
- package/dist/core/runtime-bridges.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +13 -6
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +9 -2
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +13 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +49 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +4 -4
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/subagent-permission-inherit.d.ts +6 -10
- package/dist/core/subagent-permission-inherit.d.ts.map +1 -1
- package/dist/core/subagent-permission-inherit.js +14 -14
- package/dist/core/subagent-permission-inherit.js.map +1 -1
- package/dist/core/subagent-wait-interruption.d.ts +11 -0
- package/dist/core/subagent-wait-interruption.d.ts.map +1 -0
- package/dist/core/subagent-wait-interruption.js +19 -0
- package/dist/core/subagent-wait-interruption.js.map +1 -0
- package/dist/core/system-prompt.d.ts +2 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +11 -4
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +3 -3
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +3 -3
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/gateway/adapters/discord.d.ts.map +1 -1
- package/dist/gateway/adapters/discord.js +1 -1
- package/dist/gateway/adapters/discord.js.map +1 -1
- package/dist/gateway/approval.d.ts +2 -6
- package/dist/gateway/approval.d.ts.map +1 -1
- package/dist/gateway/approval.js +3 -7
- package/dist/gateway/approval.js.map +1 -1
- package/dist/gateway/mobile-commands.d.ts.map +1 -1
- package/dist/gateway/mobile-commands.js +12 -11
- package/dist/gateway/mobile-commands.js.map +1 -1
- package/dist/gateway/router.d.ts.map +1 -1
- package/dist/gateway/router.js +1 -1
- package/dist/gateway/router.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -2
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +10 -2
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +29 -5
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/copyable-text.d.ts +2 -6
- package/dist/modes/interactive/components/copyable-text.d.ts.map +1 -1
- package/dist/modes/interactive/components/copyable-text.js +26 -35
- package/dist/modes/interactive/components/copyable-text.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +7 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +36 -3
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-tail.d.ts +9 -2
- package/dist/modes/interactive/components/thinking-tail.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-tail.js +43 -1
- package/dist/modes/interactive/components/thinking-tail.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +5 -3
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +44 -45
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +7 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +194 -129
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +1 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +23 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/node-runtime/{agent-session-services-NQ6GKOIK.js → agent-session-services-IEF7LQWD.js} +12 -13
- package/dist/node-runtime/{builtin-extensions-GVC6IFDU.js → builtin-extensions-EBAWTH4M.js} +5 -5
- package/dist/node-runtime/{chunk-XLTL257W.js → chunk-2KIPT4HJ.js} +5 -1
- package/dist/node-runtime/{chunk-IWOWXRWU.js → chunk-5Q3EHOHI.js} +21 -21
- package/dist/node-runtime/{chunk-6B2POMK7.js → chunk-6VYZ5UFP.js} +1 -1
- package/dist/node-runtime/{chunk-TQGPP4SC.js → chunk-CDVHZOOK.js} +1 -1
- package/dist/node-runtime/{chunk-TDL7UWJ7.js → chunk-DE2JB6J5.js} +189 -70
- package/dist/node-runtime/{chunk-YJMMG7C6.js → chunk-DSIKTUPW.js} +1 -1
- package/dist/node-runtime/{chunk-IQIEU7SB.js → chunk-F4FLTQKV.js} +2 -2
- package/dist/node-runtime/{chunk-GMHJCCEN.js → chunk-FU6OODRZ.js} +4 -1
- package/dist/node-runtime/{chunk-5BNJ4JUH.js → chunk-GJ2RDBRL.js} +1 -1
- package/dist/node-runtime/{chunk-GNN7H3B7.js → chunk-GS42T6MX.js} +1 -1
- package/dist/node-runtime/{chunk-OFKSVRV7.js → chunk-GYIXXQAO.js} +1 -1
- package/dist/node-runtime/{chunk-BX2RB477.js → chunk-HFVZUPFJ.js} +1 -1
- package/dist/node-runtime/{chunk-PC2Z5TKZ.js → chunk-HMBGROQK.js} +3 -3
- package/dist/node-runtime/{chunk-AZJHNQKQ.js → chunk-I54LGHWM.js} +1 -1
- package/dist/node-runtime/{chunk-IVXYUAJE.js → chunk-IF24A3FH.js} +1 -1
- package/dist/node-runtime/{chunk-VJPTNWAP.js → chunk-IGV54Q5V.js} +3 -3
- package/dist/node-runtime/{chunk-QDGKKKUM.js → chunk-K5AGHH57.js} +18 -13
- package/dist/node-runtime/{chunk-GS66LV4M.js → chunk-KJ6DWS3K.js} +4 -4
- package/dist/node-runtime/{chunk-EQ63ANHL.js → chunk-L3LX4SNR.js} +310 -192
- package/dist/node-runtime/{chunk-VSELYKWU.js → chunk-LWYIVUGV.js} +2 -1
- package/dist/node-runtime/{chunk-JHYKXIMM.js → chunk-MPKSOJBT.js} +1 -1
- package/dist/node-runtime/{chunk-UAFLNHSH.js → chunk-OF7PWMG4.js} +8 -8
- package/dist/node-runtime/{chunk-CSUZVNYE.js → chunk-OVX6X377.js} +10 -6
- package/dist/node-runtime/{chunk-ORH324EP.js → chunk-PCEW76PM.js} +3 -3
- package/dist/node-runtime/{chunk-6427XAWG.js → chunk-QH6YL7VK.js} +3 -3
- package/dist/node-runtime/{chunk-LMBNLFXQ.js → chunk-QM43FEAE.js} +15 -15
- package/dist/node-runtime/{chunk-7QWNYZDI.js → chunk-RDDAZOMU.js} +16 -0
- package/dist/node-runtime/{chunk-WADV2VDS.js → chunk-RORY2HMJ.js} +46 -5
- package/dist/node-runtime/{chunk-H3XF4UVQ.js → chunk-RWTKOC3B.js} +1 -1
- package/dist/node-runtime/{chunk-V2A7CEXK.js → chunk-WHLRAGUQ.js} +13 -12
- package/dist/node-runtime/{chunk-GJSAD4AB.js → chunk-Y73WPE6S.js} +17 -17
- package/dist/node-runtime/{chunk-VSSXXL36.js → chunk-YDO2F2IA.js} +2 -2
- package/dist/node-runtime/{chunk-BFNXONG3.js → chunk-YVI6L6LU.js} +5 -5
- package/dist/node-runtime/{chunk-5D7LC2ZQ.js → chunk-ZXSGTGJ6.js} +54 -85
- package/dist/node-runtime/cli-runtime.js +1 -1
- package/dist/node-runtime/{command-3JHHXOPX.js → command-7BG7VVTS.js} +3 -3
- package/dist/node-runtime/{commands-KAMO2T6P.js → commands-NZLSOHPE.js} +2 -2
- package/dist/node-runtime/{commands-2JVNFGMQ.js → commands-QFDKNQTL.js} +9 -9
- package/dist/node-runtime/{direct-tool-executor-YAVOLDFY.js → direct-tool-executor-77GW4F5P.js} +3 -3
- package/dist/node-runtime/{export-html-KBFVV63J.js → export-html-VM4J2MNR.js} +2 -2
- package/dist/node-runtime/{extension-input-K24TVKVW.js → extension-input-E7BJZ35H.js} +4 -4
- package/dist/node-runtime/{extension-selector-SPNF7EDR.js → extension-selector-WU42XDTU.js} +4 -4
- package/dist/node-runtime/{gateway-VFO6SFKK.js → gateway-TWR3N65G.js} +14 -14
- package/dist/node-runtime/index.js +26 -27
- package/dist/node-runtime/{init-X2LIUB2H.js → init-HS6NQXSK.js} +2 -2
- package/dist/node-runtime/{install-cli-C3CF7O7N.js → install-cli-VAP6KBFN.js} +1 -1
- package/dist/node-runtime/{interactive-mode-LOM6AIF6.js → interactive-mode-6J5VZ2TT.js} +19 -20
- package/dist/node-runtime/{interactive-view-IDSCPPK7.js → interactive-view-NGFAMHPW.js} +7 -7
- package/dist/node-runtime/lunr-browser-J5ZZYVGM.js +174 -0
- package/dist/node-runtime/{lunr-cron-BKHGNBKT.js → lunr-cron-CXOL37AL.js} +7 -7
- package/dist/node-runtime/main.js +22 -23
- package/dist/node-runtime/{mobile-commands-HMP25WBC.js → mobile-commands-VTBM5DSZ.js} +6 -6
- package/dist/node-runtime/{model-runtime-PLQKAG4B.js → model-runtime-OO5HFLWE.js} +1 -1
- package/dist/node-runtime/{package-manager-cli-VCK4E2RC.js → package-manager-cli-ZLW5DZXF.js} +9 -10
- package/dist/node-runtime/{pi-intercom-HBPK5HSJ.js → pi-intercom-QM53RLTS.js} +2 -0
- package/dist/node-runtime/{pi-mcp-adapter-E6WULBKF.js → pi-mcp-adapter-5UKBZP44.js} +7 -6
- package/dist/node-runtime/{pi-subagents-FEUDLJOE.js → pi-subagents-XPCLLKIM.js} +65 -21
- package/dist/node-runtime/{proxy-modes-OSQCWRBI.js → proxy-modes-LGEUYD7R.js} +3 -3
- package/dist/node-runtime/rpc-entry.js +22 -23
- package/dist/node-runtime/{rpc-mode-P5ODXPEG.js → rpc-mode-O3XV4SID.js} +2 -2
- package/dist/node-runtime/{runtime-bridges-3XUQ46XW.js → runtime-bridges-QYXUX2TG.js} +8 -1
- package/dist/node-runtime/{session-handoff-HC7R5E24.js → session-handoff-GWARVEWT.js} +2 -2
- package/dist/node-runtime/{session-manager-CFN4UFM2.js → session-manager-JB5J6XBN.js} +1 -1
- package/dist/node-runtime/{session-selector-LHRMJOKT.js → session-selector-GIM4DHQ2.js} +4 -4
- package/dist/node-runtime/{settings-manager-UUZ6NUXI.js → settings-manager-WCQDUVQB.js} +7 -4
- package/dist/node-runtime/{setup-NRXVZBLJ.js → setup-YRBKH2LD.js} +2 -2
- package/dist/node-runtime/{subagent-executor-MLUMBWCP.js → subagent-executor-OTNISDQU.js} +47 -10
- package/dist/node-runtime/{theme-U7IGOA7O.js → theme-UOO5RVFN.js} +1 -1
- package/dist/node-runtime/{update-cli-4TP25CNW.js → update-cli-VBR2777K.js} +1 -2
- package/dist/startup/interactive-view.d.ts.map +1 -1
- package/dist/startup/interactive-view.js +5 -1
- package/dist/startup/interactive-view.js.map +1 -1
- package/docs/browser.md +1 -1
- package/docs/features.md +17 -14
- package/docs/index.md +1 -1
- package/docs/keybindings.md +1 -1
- package/docs/providers.md +6 -2
- package/docs/quickstart.md +2 -2
- package/docs/settings.md +2 -1
- package/docs/usage.md +6 -6
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/plan-mode/README.md +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
- package/dist/node-runtime/chunk-LISUTZS3.js +0 -19
- package/dist/node-runtime/lunr-browser-YNW7FTYX.js +0 -87
|
@@ -34,6 +34,7 @@ import { expandPromptTemplate } from "./prompt-templates.js";
|
|
|
34
34
|
import { rollbackSnapshotBeforeWrite } from "./rollback.js";
|
|
35
35
|
import { CURRENT_SESSION_VERSION, getLatestCompactionEntry } from "./session-manager.js";
|
|
36
36
|
import { createSyntheticSourceInfo } from "./source-info.js";
|
|
37
|
+
import { registerSubagentWaitInterruptionOwner, } from "./subagent-wait-interruption.js";
|
|
37
38
|
import { buildSystemPrompt } from "./system-prompt.js";
|
|
38
39
|
import { measureStartup } from "./timings.js";
|
|
39
40
|
import { TODO_TOOL_NAMES } from "./todo-settings.js";
|
|
@@ -90,6 +91,11 @@ export class AgentSession {
|
|
|
90
91
|
_isAgentRunActive = false;
|
|
91
92
|
_idleWaitPromise;
|
|
92
93
|
_resolveIdleWait;
|
|
94
|
+
_activePromptRun;
|
|
95
|
+
_waitPromptHandoff;
|
|
96
|
+
_waitPromptAcceptance = Promise.resolve();
|
|
97
|
+
_waitPromptGeneration = 0;
|
|
98
|
+
_unregisterSubagentWaitInterruptionOwners = [];
|
|
93
99
|
/** Tracks pending steering messages for UI display. Removed when delivered. */
|
|
94
100
|
_steeringMessages = [];
|
|
95
101
|
/** Tracks pending follow-up messages for UI display. Removed when delivered. */
|
|
@@ -140,9 +146,9 @@ export class AgentSession {
|
|
|
140
146
|
_baseSystemPrompt = "";
|
|
141
147
|
_baseSystemPromptOptions;
|
|
142
148
|
_systemPromptOverride;
|
|
143
|
-
// lunr: core-owned system-prompt append (
|
|
149
|
+
// lunr: core-owned system-prompt append (read-only mode addendum) applied on top of base/override
|
|
144
150
|
_systemPromptAppend;
|
|
145
|
-
// lunr: core-owned tool-call gates (
|
|
151
|
+
// lunr: core-owned tool-call gates (read-only mode) checked before extension tool_call handlers
|
|
146
152
|
_toolCallGates = [];
|
|
147
153
|
constructor(config) {
|
|
148
154
|
this.agent = config.agent;
|
|
@@ -161,6 +167,10 @@ export class AgentSession {
|
|
|
161
167
|
this._excludedToolNames = config.excludedToolNames ? new Set(config.excludedToolNames) : undefined;
|
|
162
168
|
this._baseToolsOverride = config.baseToolsOverride;
|
|
163
169
|
this._sessionStartEvent = config.sessionStartEvent ?? { type: "session_start", reason: "startup" };
|
|
170
|
+
const waitInterruptionOwner = { register: () => this._registerSubagentWaitInterruption() };
|
|
171
|
+
for (const identity of new Set([this.sessionId, this.sessionFile].filter((value) => !!value))) {
|
|
172
|
+
this._unregisterSubagentWaitInterruptionOwners.push(registerSubagentWaitInterruptionOwner(identity, waitInterruptionOwner));
|
|
173
|
+
}
|
|
164
174
|
// Always subscribe to agent events for internal handling
|
|
165
175
|
// (session persistence, extensions, auto-compaction, retry logic)
|
|
166
176
|
this._unsubscribeAgent = this.agent.subscribe(this._handleAgentEvent);
|
|
@@ -274,7 +284,7 @@ export class AgentSession {
|
|
|
274
284
|
catch {
|
|
275
285
|
// rollback failures must never block the tool call
|
|
276
286
|
}
|
|
277
|
-
// lunr: core-owned gates (
|
|
287
|
+
// lunr: core-owned gates (read-only mode) run first, even without extension handlers
|
|
278
288
|
for (const gate of this._toolCallGates) {
|
|
279
289
|
const gateResult = gate(toolCall.name, args);
|
|
280
290
|
if (gateResult?.block) {
|
|
@@ -644,6 +654,8 @@ export class AgentSession {
|
|
|
644
654
|
transferring = false;
|
|
645
655
|
setTransferring(value) {
|
|
646
656
|
this.transferring = value;
|
|
657
|
+
if (value)
|
|
658
|
+
this._invalidateWaitPromptHandoffs("Session transfer interrupted the pending prompt.");
|
|
647
659
|
}
|
|
648
660
|
assertCanStartWork() {
|
|
649
661
|
this.sessionManager.assertWritable();
|
|
@@ -651,6 +663,9 @@ export class AgentSession {
|
|
|
651
663
|
throw new Error("Session transfer is in progress. Wait or reclaim the session.");
|
|
652
664
|
}
|
|
653
665
|
dispose() {
|
|
666
|
+
this._invalidateWaitPromptHandoffs("Session closed before the pending prompt could run.");
|
|
667
|
+
for (const unregister of this._unregisterSubagentWaitInterruptionOwners.splice(0))
|
|
668
|
+
unregister();
|
|
654
669
|
try {
|
|
655
670
|
this.abortRetry();
|
|
656
671
|
this.abortCompaction();
|
|
@@ -690,12 +705,16 @@ export class AgentSession {
|
|
|
690
705
|
get isIdle() {
|
|
691
706
|
return !this._isAgentRunActive;
|
|
692
707
|
}
|
|
708
|
+
/** Whether normal Enter is still being reserved for an interrupted wait handoff. */
|
|
709
|
+
get isWaitPromptHandoffActive() {
|
|
710
|
+
return this._waitPromptHandoff?.accepting === true;
|
|
711
|
+
}
|
|
693
712
|
/** Current effective system prompt (includes any per-turn extension modifications) */
|
|
694
713
|
get systemPrompt() {
|
|
695
714
|
return this.agent.state.systemPrompt;
|
|
696
715
|
}
|
|
697
716
|
/**
|
|
698
|
-
* lunr: register a core-owned tool-call gate (
|
|
717
|
+
* lunr: register a core-owned tool-call gate (read-only mode). Gates run before extension
|
|
699
718
|
* tool_call handlers and even when no extension handles tool_call. Returns an
|
|
700
719
|
* unsubscribe function.
|
|
701
720
|
*/
|
|
@@ -868,6 +887,7 @@ export class AgentSession {
|
|
|
868
887
|
this._baseSystemPromptOptions = {
|
|
869
888
|
cwd: this._cwd,
|
|
870
889
|
modelSlug: this.model ? `${this.model.provider}/${this.model.id}` : undefined,
|
|
890
|
+
automaticSubagentDelegation: this.settingsManager.getAutomaticSubagentDelegation(),
|
|
871
891
|
skills: loadedSkills,
|
|
872
892
|
contextFiles,
|
|
873
893
|
customPrompt: loaderSystemPrompt,
|
|
@@ -885,24 +905,67 @@ export class AgentSession {
|
|
|
885
905
|
// =========================================================================
|
|
886
906
|
// Prompting
|
|
887
907
|
// =========================================================================
|
|
908
|
+
_registerSubagentWaitInterruption() {
|
|
909
|
+
const run = this._activePromptRun;
|
|
910
|
+
const ownerSignal = this.agent.signal;
|
|
911
|
+
const wait = run && ownerSignal ? { controller: new AbortController(), interrupted: false, ownerSignal } : undefined;
|
|
912
|
+
if (run && wait) {
|
|
913
|
+
run.waits.add(wait);
|
|
914
|
+
if (run.gracefulStopRequested) {
|
|
915
|
+
wait.interrupted = true;
|
|
916
|
+
wait.controller.abort();
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
const signal = wait?.controller.signal ?? new AbortController().signal;
|
|
920
|
+
return {
|
|
921
|
+
signal,
|
|
922
|
+
wasInterrupted: () => wait?.interrupted === true,
|
|
923
|
+
unregister: () => {
|
|
924
|
+
if (wait)
|
|
925
|
+
run?.waits.delete(wait);
|
|
926
|
+
},
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
_interruptSubagentWaits(run, ownerSignal) {
|
|
930
|
+
for (const wait of run.waits) {
|
|
931
|
+
if (wait.ownerSignal !== ownerSignal)
|
|
932
|
+
continue;
|
|
933
|
+
wait.interrupted = true;
|
|
934
|
+
wait.controller.abort();
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
_invalidateWaitPromptHandoffs(message) {
|
|
938
|
+
this._waitPromptGeneration++;
|
|
939
|
+
const handoff = this._waitPromptHandoff;
|
|
940
|
+
this._waitPromptHandoff = undefined;
|
|
941
|
+
if (!handoff)
|
|
942
|
+
return;
|
|
943
|
+
const error = new Error(message);
|
|
944
|
+
for (const reservation of handoff.reservations.splice(0))
|
|
945
|
+
reservation.reject(error);
|
|
946
|
+
}
|
|
888
947
|
async _runAgentPrompt(messages) {
|
|
948
|
+
const run = { waits: new Set(), gracefulStopRequested: false };
|
|
949
|
+
this._activePromptRun = run;
|
|
889
950
|
this._isAgentRunActive = true;
|
|
890
951
|
try {
|
|
891
952
|
await this.agent.prompt(messages);
|
|
892
|
-
while (await this._handlePostAgentRun()) {
|
|
953
|
+
while (await this._handlePostAgentRun(run)) {
|
|
893
954
|
await this.agent.continue();
|
|
894
955
|
}
|
|
895
956
|
}
|
|
896
957
|
finally {
|
|
958
|
+
if (this._activePromptRun === run)
|
|
959
|
+
this._activePromptRun = undefined;
|
|
897
960
|
this._systemPromptOverride = undefined;
|
|
898
961
|
this._flushPendingBashMessages();
|
|
899
962
|
await this._emitAgentSettled();
|
|
900
963
|
}
|
|
901
964
|
}
|
|
902
|
-
async _handlePostAgentRun() {
|
|
965
|
+
async _handlePostAgentRun(run) {
|
|
903
966
|
const msg = this._lastAssistantMessage;
|
|
904
967
|
this._lastAssistantMessage = undefined;
|
|
905
|
-
if (!msg) {
|
|
968
|
+
if (!msg || run.gracefulStopRequested) {
|
|
906
969
|
return false;
|
|
907
970
|
}
|
|
908
971
|
// lunr: quota-dead or auth-invalid keys rotate immediately — same-key backoff
|
|
@@ -944,130 +1007,193 @@ export class AgentSession {
|
|
|
944
1007
|
*/
|
|
945
1008
|
async prompt(text, options) {
|
|
946
1009
|
this.assertCanStartWork();
|
|
947
|
-
const expandPromptTemplates = options?.expandPromptTemplates ?? true;
|
|
948
1010
|
const preflightResult = options?.preflightResult;
|
|
1011
|
+
let prepared;
|
|
949
1012
|
let messages;
|
|
950
1013
|
try {
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
if (handled) {
|
|
956
|
-
// Extension command executed, no prompt to send
|
|
957
|
-
preflightResult?.(true);
|
|
958
|
-
return;
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
// Emit input event for extension interception (before skill/template expansion)
|
|
962
|
-
let currentText = text;
|
|
963
|
-
let currentImages = options?.images;
|
|
964
|
-
if (this._extensionRunner.hasHandlers("input")) {
|
|
965
|
-
const inputResult = await this._extensionRunner.emitInput(currentText, currentImages, options?.source ?? "interactive", this.isStreaming ? options?.streamingBehavior : undefined);
|
|
966
|
-
if (inputResult.action === "handled") {
|
|
967
|
-
preflightResult?.(true);
|
|
968
|
-
return;
|
|
969
|
-
}
|
|
970
|
-
if (inputResult.action === "transform") {
|
|
971
|
-
currentText = inputResult.text;
|
|
972
|
-
currentImages = inputResult.images ?? currentImages;
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
// Expand skill commands (/skill:name args) and prompt templates (/template args)
|
|
976
|
-
let expandedText = currentText;
|
|
977
|
-
if (expandPromptTemplates) {
|
|
978
|
-
expandedText = this._expandSkillCommand(expandedText);
|
|
979
|
-
expandedText = expandPromptTemplate(expandedText, [...this.promptTemplates]);
|
|
1014
|
+
prepared = await this._preparePromptInput(text, options, this.isStreaming ? options?.streamingBehavior : undefined);
|
|
1015
|
+
if (!prepared) {
|
|
1016
|
+
preflightResult?.(true);
|
|
1017
|
+
return;
|
|
980
1018
|
}
|
|
981
|
-
// If streaming, queue via steer() or followUp() based on option
|
|
982
1019
|
if (this.isStreaming) {
|
|
983
1020
|
if (!options?.streamingBehavior) {
|
|
984
1021
|
throw new Error("Agent is already processing. Specify streamingBehavior ('steer' or 'followUp') to queue the message.");
|
|
985
1022
|
}
|
|
986
1023
|
if (options.streamingBehavior === "followUp") {
|
|
987
|
-
await this._queueFollowUp(
|
|
1024
|
+
await this._queueFollowUp(prepared.text, prepared.images);
|
|
988
1025
|
}
|
|
989
1026
|
else {
|
|
990
|
-
await this._queueSteer(
|
|
1027
|
+
await this._queueSteer(prepared.text, prepared.images);
|
|
991
1028
|
}
|
|
992
1029
|
preflightResult?.(true);
|
|
993
1030
|
return;
|
|
994
1031
|
}
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
if (
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1032
|
+
messages = await this._createPromptMessages(prepared);
|
|
1033
|
+
}
|
|
1034
|
+
catch (error) {
|
|
1035
|
+
preflightResult?.(false);
|
|
1036
|
+
throw error;
|
|
1037
|
+
}
|
|
1038
|
+
preflightResult?.(true);
|
|
1039
|
+
await this._runAgentPrompt(messages);
|
|
1040
|
+
}
|
|
1041
|
+
async _preparePromptInput(text, options, streamingBehavior) {
|
|
1042
|
+
const expandPromptTemplates = options?.expandPromptTemplates ?? true;
|
|
1043
|
+
if (expandPromptTemplates && text.startsWith("/") && (await this._tryExecuteExtensionCommand(text))) {
|
|
1044
|
+
return undefined;
|
|
1045
|
+
}
|
|
1046
|
+
let currentText = text;
|
|
1047
|
+
let currentImages = options?.images;
|
|
1048
|
+
if (this._extensionRunner.hasHandlers("input")) {
|
|
1049
|
+
const inputResult = await this._extensionRunner.emitInput(currentText, currentImages, options?.source ?? "interactive", streamingBehavior);
|
|
1050
|
+
if (inputResult.action === "handled")
|
|
1051
|
+
return undefined;
|
|
1052
|
+
if (inputResult.action === "transform") {
|
|
1053
|
+
currentText = inputResult.text;
|
|
1054
|
+
currentImages = inputResult.images ?? currentImages;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
if (expandPromptTemplates) {
|
|
1058
|
+
currentText = this._expandSkillCommand(currentText);
|
|
1059
|
+
currentText = expandPromptTemplate(currentText, [...this.promptTemplates]);
|
|
1060
|
+
}
|
|
1061
|
+
return { text: currentText, images: currentImages };
|
|
1062
|
+
}
|
|
1063
|
+
async _createPromptMessages(input) {
|
|
1064
|
+
this._flushPendingBashMessages();
|
|
1065
|
+
if (!this.model)
|
|
1066
|
+
throw new Error(formatNoModelSelectedMessage());
|
|
1067
|
+
const hasConfiguredAuth = this._modelRuntime.hasConfiguredAuth(this.model.provider) ||
|
|
1068
|
+
(await this._modelRuntime.checkAuth(this.model.provider)) !== undefined;
|
|
1069
|
+
if (!hasConfiguredAuth) {
|
|
1070
|
+
if (this._modelRuntime.isUsingOAuth(this.model.provider)) {
|
|
1071
|
+
throw new Error(`Authentication failed for "${this.model.provider}". ` +
|
|
1072
|
+
`Credentials may have expired or network is unavailable. ` +
|
|
1073
|
+
`Run '/login ${this.model.provider}' to re-authenticate.`);
|
|
1074
|
+
}
|
|
1075
|
+
throw new Error(formatNoApiKeyFoundMessage(this.model.provider));
|
|
1076
|
+
}
|
|
1077
|
+
const lastAssistant = this._findLastAssistantMessage();
|
|
1078
|
+
if (lastAssistant)
|
|
1079
|
+
await this._checkCompaction(lastAssistant, false);
|
|
1080
|
+
const userContent = [{ type: "text", text: input.text }];
|
|
1081
|
+
if (input.images)
|
|
1082
|
+
userContent.push(...input.images);
|
|
1083
|
+
const messages = [
|
|
1084
|
+
{
|
|
1026
1085
|
role: "user",
|
|
1027
1086
|
content: userContent,
|
|
1028
1087
|
timestamp: Date.now(),
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
content: msg.content ?? [],
|
|
1045
|
-
display: msg.display,
|
|
1046
|
-
details: msg.details,
|
|
1047
|
-
timestamp: Date.now(),
|
|
1048
|
-
});
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
// Apply extension-modified system prompt, or reset to base
|
|
1052
|
-
if (result?.systemPrompt !== undefined) {
|
|
1053
|
-
this._systemPromptOverride = result.systemPrompt;
|
|
1054
|
-
this.agent.state.systemPrompt = this._withSystemPromptAppend(result.systemPrompt);
|
|
1055
|
-
}
|
|
1056
|
-
else {
|
|
1057
|
-
// Ensure we're using the base prompt (in case previous turn had modifications)
|
|
1058
|
-
this._systemPromptOverride = undefined;
|
|
1059
|
-
this.agent.state.systemPrompt = this._withSystemPromptAppend(this._baseSystemPrompt);
|
|
1088
|
+
},
|
|
1089
|
+
...this._pendingNextTurnMessages,
|
|
1090
|
+
];
|
|
1091
|
+
this._pendingNextTurnMessages = [];
|
|
1092
|
+
const result = await this._extensionRunner.emitBeforeAgentStart(input.text, input.images, this._baseSystemPrompt, this._baseSystemPromptOptions);
|
|
1093
|
+
if (result?.messages) {
|
|
1094
|
+
for (const msg of result.messages) {
|
|
1095
|
+
messages.push({
|
|
1096
|
+
role: "custom",
|
|
1097
|
+
customType: msg.customType,
|
|
1098
|
+
content: msg.content ?? [],
|
|
1099
|
+
display: msg.display,
|
|
1100
|
+
details: msg.details,
|
|
1101
|
+
timestamp: Date.now(),
|
|
1102
|
+
});
|
|
1060
1103
|
}
|
|
1061
1104
|
}
|
|
1105
|
+
if (result?.systemPrompt !== undefined) {
|
|
1106
|
+
this._systemPromptOverride = result.systemPrompt;
|
|
1107
|
+
this.agent.state.systemPrompt = this._withSystemPromptAppend(result.systemPrompt);
|
|
1108
|
+
}
|
|
1109
|
+
else {
|
|
1110
|
+
this._systemPromptOverride = undefined;
|
|
1111
|
+
this.agent.state.systemPrompt = this._withSystemPromptAppend(this._baseSystemPrompt);
|
|
1112
|
+
}
|
|
1113
|
+
return messages;
|
|
1114
|
+
}
|
|
1115
|
+
async interruptSubagentWaitWithPrompt(text, options) {
|
|
1116
|
+
const acceptance = this._waitPromptAcceptance.then(() => this._reserveWaitPrompt(text, options));
|
|
1117
|
+
this._waitPromptAcceptance = acceptance.then(() => { }, () => { });
|
|
1118
|
+
return acceptance;
|
|
1119
|
+
}
|
|
1120
|
+
async _reserveWaitPrompt(text, options) {
|
|
1121
|
+
this.assertCanStartWork();
|
|
1122
|
+
const activeRun = this._activePromptRun;
|
|
1123
|
+
const existing = this._waitPromptHandoff;
|
|
1124
|
+
const activeWait = activeRun?.waits.values().next().value;
|
|
1125
|
+
const run = existing?.accepting ? existing.run : activeWait ? activeRun : undefined;
|
|
1126
|
+
const ownerSignal = existing?.accepting ? existing.ownerSignal : activeWait?.ownerSignal;
|
|
1127
|
+
if (!run || !ownerSignal)
|
|
1128
|
+
return undefined;
|
|
1129
|
+
const handoff = existing?.run === run && existing.accepting
|
|
1130
|
+
? existing
|
|
1131
|
+
: {
|
|
1132
|
+
run,
|
|
1133
|
+
ownerSignal,
|
|
1134
|
+
generation: this._waitPromptGeneration,
|
|
1135
|
+
reservations: [],
|
|
1136
|
+
draining: false,
|
|
1137
|
+
accepting: true,
|
|
1138
|
+
};
|
|
1139
|
+
this._waitPromptHandoff = handoff;
|
|
1140
|
+
let prepared;
|
|
1141
|
+
try {
|
|
1142
|
+
prepared = await this._preparePromptInput(text, options, undefined);
|
|
1143
|
+
}
|
|
1062
1144
|
catch (error) {
|
|
1063
|
-
|
|
1145
|
+
if (handoff.reservations.length === 0 && this._waitPromptHandoff === handoff) {
|
|
1146
|
+
this._waitPromptHandoff = undefined;
|
|
1147
|
+
}
|
|
1064
1148
|
throw error;
|
|
1065
1149
|
}
|
|
1066
|
-
if (!
|
|
1067
|
-
|
|
1150
|
+
if (!prepared) {
|
|
1151
|
+
if (handoff.reservations.length === 0 && this._waitPromptHandoff === handoff) {
|
|
1152
|
+
this._waitPromptHandoff = undefined;
|
|
1153
|
+
}
|
|
1154
|
+
return { completion: Promise.resolve() };
|
|
1068
1155
|
}
|
|
1069
|
-
|
|
1070
|
-
|
|
1156
|
+
let resolveCompletion = () => { };
|
|
1157
|
+
let rejectCompletion = (_error) => { };
|
|
1158
|
+
const completion = new Promise((resolve, reject) => {
|
|
1159
|
+
resolveCompletion = resolve;
|
|
1160
|
+
rejectCompletion = reject;
|
|
1161
|
+
});
|
|
1162
|
+
handoff.reservations.push({ input: prepared, resolve: resolveCompletion, reject: rejectCompletion });
|
|
1163
|
+
if (!run.gracefulStopRequested && this.agent.requestGracefulStop(handoff.ownerSignal)) {
|
|
1164
|
+
run.gracefulStopRequested = true;
|
|
1165
|
+
}
|
|
1166
|
+
this._interruptSubagentWaits(run, handoff.ownerSignal);
|
|
1167
|
+
if (!handoff.draining) {
|
|
1168
|
+
handoff.draining = true;
|
|
1169
|
+
void this._drainWaitPromptHandoff(handoff);
|
|
1170
|
+
}
|
|
1171
|
+
return { completion };
|
|
1172
|
+
}
|
|
1173
|
+
async _drainWaitPromptHandoff(handoff) {
|
|
1174
|
+
await this.waitForIdle();
|
|
1175
|
+
while (this._waitPromptHandoff === handoff &&
|
|
1176
|
+
handoff.generation === this._waitPromptGeneration &&
|
|
1177
|
+
handoff.reservations.length > 0) {
|
|
1178
|
+
const reservation = handoff.reservations[0];
|
|
1179
|
+
try {
|
|
1180
|
+
this.assertCanStartWork();
|
|
1181
|
+
const messages = await this._createPromptMessages(reservation.input);
|
|
1182
|
+
handoff.accepting = false;
|
|
1183
|
+
await this._runAgentPrompt(messages);
|
|
1184
|
+
reservation.resolve();
|
|
1185
|
+
}
|
|
1186
|
+
catch (error) {
|
|
1187
|
+
reservation.reject(error);
|
|
1188
|
+
}
|
|
1189
|
+
finally {
|
|
1190
|
+
if (handoff.reservations[0] === reservation)
|
|
1191
|
+
handoff.reservations.shift();
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
handoff.accepting = false;
|
|
1195
|
+
if (this._waitPromptHandoff === handoff)
|
|
1196
|
+
this._waitPromptHandoff = undefined;
|
|
1071
1197
|
}
|
|
1072
1198
|
/**
|
|
1073
1199
|
* Try to execute an extension command. Returns true if command was found and executed.
|
|
@@ -1320,6 +1446,7 @@ export class AgentSession {
|
|
|
1320
1446
|
* Abort current operation and wait for agent to become idle.
|
|
1321
1447
|
*/
|
|
1322
1448
|
async abort() {
|
|
1449
|
+
this._invalidateWaitPromptHandoffs("The active run was aborted before the pending prompt could run.");
|
|
1323
1450
|
this.abortRetry();
|
|
1324
1451
|
this.agent.abort();
|
|
1325
1452
|
await this.waitForIdle();
|
|
@@ -2339,6 +2466,7 @@ export class AgentSession {
|
|
|
2339
2466
|
});
|
|
2340
2467
|
}
|
|
2341
2468
|
async reload(options) {
|
|
2469
|
+
this._invalidateWaitPromptHandoffs("Extensions reloaded before the pending prompt could run.");
|
|
2342
2470
|
const previousFlagValues = this._extensionRunner.getFlagValues();
|
|
2343
2471
|
await emitSessionShutdownEvent(this._extensionRunner, { type: "session_shutdown", reason: "reload" });
|
|
2344
2472
|
await this.settingsManager.reload();
|