@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
|
@@ -31,7 +31,7 @@ import { getModelTiersBridge } from "../../core/model-tiers.js";
|
|
|
31
31
|
import { registerPermissionModeBridge } from "../../core/permission-mode.js";
|
|
32
32
|
import { nextModeForGoal, registerPermissionModeControlBridge } from "../../core/permission-mode-control.js";
|
|
33
33
|
import { AUTO_MODE_ADDENDUM, getPermissionMode, nextPermissionMode, registerApprovalHandler, resetPermissions, restorePermissionModeAfterPlan, setPermissionMode, } from "../../core/permissions.js";
|
|
34
|
-
import {
|
|
34
|
+
import { READ_ONLY_MODE_ADDENDUM } from "../../core/plan-mode.js";
|
|
35
35
|
import * as processRegistry from "../../core/process-registry.js";
|
|
36
36
|
import { captureTreeChanges, clearRollback, disableRollbackForSession, enableRollbackForSession, initRollback, isRollbackEnabled, isRollbackSessionForceEnabled, migrateRollbackSession, peekRollbackTurnsConsumed, beginTurn as rollbackBeginTurn, rollbackLastTurn, setRollbackWarningHandler, } from "../../core/rollback.js";
|
|
37
37
|
import { getSearchCuratorSetting, setSearchCuratorSetting } from "../../core/search-curator.js";
|
|
@@ -123,9 +123,9 @@ function isDeadTerminalError(error) {
|
|
|
123
123
|
const code = error.code;
|
|
124
124
|
return code !== undefined && DEAD_TERMINAL_ERROR_CODES.has(code);
|
|
125
125
|
}
|
|
126
|
-
const ANTHROPIC_SUBSCRIPTION_AUTH_WARNING = "Anthropic subscription
|
|
126
|
+
const ANTHROPIC_SUBSCRIPTION_AUTH_WARNING = "Claude Code handles Anthropic subscription authentication. lunR retains tool execution and conversation state. Check your Claude account for usage and any extra charges.";
|
|
127
127
|
// lunr: pre-connection ToS disclaimer for Anthropic subscription (OAuth) accounts.
|
|
128
|
-
const ANTHROPIC_TOS_DISCLAIMER = "Connecting an Anthropic subscription
|
|
128
|
+
const ANTHROPIC_TOS_DISCLAIMER = "Connecting an Anthropic subscription through Claude Code may be subject to Anthropic's Terms of Service (https://www.anthropic.com/legal/consumer-terms). Claude Code authenticates each lunR generation; lunR keeps its own tools and history. Continue?";
|
|
129
129
|
const INIT_PROMPT = `Analyze this codebase and write a starter AGENTS.md in the project root.
|
|
130
130
|
Scan: package manifests, directory layout, build/test/lint scripts, CI config,
|
|
131
131
|
existing README/docs. Include only: project purpose (one paragraph), build &
|
|
@@ -257,8 +257,10 @@ export class InteractiveMode {
|
|
|
257
257
|
streamingTargetMessage = undefined;
|
|
258
258
|
streamingDisplayedLength = 0;
|
|
259
259
|
smoothStreamingTimer = undefined;
|
|
260
|
+
thinkingAnimationTimer;
|
|
260
261
|
// Tool execution tracking: toolCallId -> component
|
|
261
262
|
pendingTools = new Map();
|
|
263
|
+
browserActivityComponent;
|
|
262
264
|
// Tool output expansion state
|
|
263
265
|
toolOutputExpanded = false;
|
|
264
266
|
// Thinking block visibility state
|
|
@@ -277,8 +279,7 @@ export class InteractiveMode {
|
|
|
277
279
|
signalCleanupHandlers = [];
|
|
278
280
|
// Track if editor is in bash mode (text starts with !)
|
|
279
281
|
isBashMode = false;
|
|
280
|
-
//
|
|
281
|
-
// / `/plan <text>` to leave plan. Shift+Tab and `/mode` pick the destination themselves.
|
|
282
|
+
// Restore the previous mode after approving a plan or leaving read-only via /plan.
|
|
282
283
|
previousPermissionMode;
|
|
283
284
|
// lunr: mode in effect before `/goal` forced session auto. Dedicated so it cannot
|
|
284
285
|
// collide with plan restore.
|
|
@@ -609,23 +610,22 @@ export class InteractiveMode {
|
|
|
609
610
|
time("ui.start");
|
|
610
611
|
void this.maybeNotifyCliUpdate();
|
|
611
612
|
this.startPlanUsagePolling();
|
|
612
|
-
//
|
|
613
|
+
// Plans and large subagent launches use distinct approval dialogs.
|
|
613
614
|
registerApprovalHandler(async (req) => {
|
|
614
615
|
if (req.kind === "large-subagent-launch") {
|
|
615
616
|
return this.showLargeSubagentLaunchApprovalDialog(req);
|
|
616
617
|
}
|
|
617
|
-
//
|
|
618
|
-
// restore runs BEFORE resolving so the model's next tool call already
|
|
619
|
-
// has full access. Decline keeps plan mode active.
|
|
618
|
+
// Approval restores writing access before the model's next tool call.
|
|
620
619
|
if (req.kind === "plan") {
|
|
621
620
|
const resp = await this.showPlanApprovalDialog(req.detail);
|
|
622
621
|
const decision = typeof resp === "string" ? resp : resp.decision;
|
|
623
622
|
if (decision !== "reject") {
|
|
624
|
-
this.
|
|
623
|
+
const target = this.restoreTargetAfterPlan();
|
|
624
|
+
this.applyPermissionMode(target === "read-only" ? "yolo" : target);
|
|
625
625
|
}
|
|
626
626
|
return resp;
|
|
627
627
|
}
|
|
628
|
-
return
|
|
628
|
+
return "reject";
|
|
629
629
|
});
|
|
630
630
|
// lunr: initialize rollback service for this session.
|
|
631
631
|
initRollback(this.settingsManager, this.sessionManager.getSessionId());
|
|
@@ -1386,7 +1386,7 @@ export class InteractiveMode {
|
|
|
1386
1386
|
if (result.cancelled) {
|
|
1387
1387
|
return { cancelled: true };
|
|
1388
1388
|
}
|
|
1389
|
-
this.
|
|
1389
|
+
this.clearChatContainer();
|
|
1390
1390
|
this.renderInitialMessages();
|
|
1391
1391
|
if (result.editorText && !this.editor.getText().trim()) {
|
|
1392
1392
|
this.restoreEditorFromTreeResult(result);
|
|
@@ -1505,7 +1505,7 @@ export class InteractiveMode {
|
|
|
1505
1505
|
renderCurrentSessionState() {
|
|
1506
1506
|
this.ui.setChatScroll(0);
|
|
1507
1507
|
this.loadedResourcesContainer.clear();
|
|
1508
|
-
this.
|
|
1508
|
+
this.clearChatContainer();
|
|
1509
1509
|
this.pendingMessagesContainer.clear();
|
|
1510
1510
|
this.compactionQueuedMessages = [];
|
|
1511
1511
|
this.pendingCompactionRender = undefined;
|
|
@@ -2457,7 +2457,7 @@ export class InteractiveMode {
|
|
|
2457
2457
|
if (text &&
|
|
2458
2458
|
!this.runtimeHost.isDetached &&
|
|
2459
2459
|
(!text.startsWith("/") ||
|
|
2460
|
-
/^\/(?:model|thinking|effort|reasoning|off|minimal|low|medium|high|xhigh|max|mode|plan|
|
|
2460
|
+
/^\/(?:model|thinking|effort|reasoning|off|minimal|low|medium|high|xhigh|max|mode|plan|read|yolo|auto|name|title|undo|edit|redo|tree|compact)(?:\s|$)/.test(text))) {
|
|
2461
2461
|
recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir);
|
|
2462
2462
|
}
|
|
2463
2463
|
if (!text) {
|
|
@@ -2583,9 +2583,9 @@ export class InteractiveMode {
|
|
|
2583
2583
|
this.handleModeCommand(text === "/mode" ? "" : text.slice(6).trim());
|
|
2584
2584
|
return;
|
|
2585
2585
|
}
|
|
2586
|
-
if (text === "/
|
|
2586
|
+
if (text === "/read" || text === "/yolo" || text === "/auto") {
|
|
2587
2587
|
this.editor.setText("");
|
|
2588
|
-
this.applyPermissionMode(text.slice(1));
|
|
2588
|
+
this.applyPermissionMode(text === "/read" ? "read-only" : text.slice(1));
|
|
2589
2589
|
return;
|
|
2590
2590
|
}
|
|
2591
2591
|
if (text === "/processes") {
|
|
@@ -2687,15 +2687,30 @@ export class InteractiveMode {
|
|
|
2687
2687
|
}
|
|
2688
2688
|
return;
|
|
2689
2689
|
}
|
|
2690
|
-
//
|
|
2691
|
-
//
|
|
2692
|
-
if (this.session.isStreaming) {
|
|
2693
|
-
this.
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2690
|
+
// While streaming or settling a wait handoff, reserve normal Enter for subagent_wait when possible.
|
|
2691
|
+
// Extension commands keep their existing path.
|
|
2692
|
+
if (this.session.isStreaming || this.session.isWaitPromptHandoffActive) {
|
|
2693
|
+
if (!this.isExtensionCommand(text)) {
|
|
2694
|
+
await this.awaitDeferredBuiltinsForPrompt();
|
|
2695
|
+
const handoff = await this.session.interruptSubagentWaitWithPrompt(text, { images });
|
|
2696
|
+
if (handoff) {
|
|
2697
|
+
this.editor.addToHistory?.(text);
|
|
2698
|
+
this.editor.setText("");
|
|
2699
|
+
void handoff.completion.catch((error) => {
|
|
2700
|
+
this.showError(error instanceof Error ? error.message : String(error));
|
|
2701
|
+
});
|
|
2702
|
+
this.ui.requestRender();
|
|
2703
|
+
return;
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
if (this.session.isStreaming) {
|
|
2707
|
+
this.editor.addToHistory?.(text);
|
|
2708
|
+
this.editor.setText("");
|
|
2709
|
+
await this.promptAfterDeferredBuiltins(text, { streamingBehavior: "steer", images });
|
|
2710
|
+
this.updatePendingMessagesDisplay();
|
|
2711
|
+
this.ui.requestRender();
|
|
2712
|
+
return;
|
|
2713
|
+
}
|
|
2699
2714
|
}
|
|
2700
2715
|
// Normal message submission
|
|
2701
2716
|
// First, move any pending bash components to chat
|
|
@@ -2714,6 +2729,18 @@ export class InteractiveMode {
|
|
|
2714
2729
|
getSmoothStreamingOptions() {
|
|
2715
2730
|
return { hideThinking: this.hideThinkingBlock };
|
|
2716
2731
|
}
|
|
2732
|
+
setThinkingAnimation(active) {
|
|
2733
|
+
if (!active) {
|
|
2734
|
+
if (this.thinkingAnimationTimer)
|
|
2735
|
+
clearInterval(this.thinkingAnimationTimer);
|
|
2736
|
+
this.thinkingAnimationTimer = undefined;
|
|
2737
|
+
return;
|
|
2738
|
+
}
|
|
2739
|
+
if (this.thinkingAnimationTimer)
|
|
2740
|
+
return;
|
|
2741
|
+
this.thinkingAnimationTimer = setInterval(() => this.ui.requestRender(), 33);
|
|
2742
|
+
this.thinkingAnimationTimer.unref?.();
|
|
2743
|
+
}
|
|
2717
2744
|
clearSmoothStreamingTimer() {
|
|
2718
2745
|
if (this.smoothStreamingTimer) {
|
|
2719
2746
|
clearInterval(this.smoothStreamingTimer);
|
|
@@ -2754,12 +2781,9 @@ export class InteractiveMode {
|
|
|
2754
2781
|
if (content.type !== "toolCall" || !revealedIds.has(content.id))
|
|
2755
2782
|
continue;
|
|
2756
2783
|
if (!this.pendingTools.has(content.id)) {
|
|
2757
|
-
const component =
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
}, this.getRegisteredToolDefinition(content.name), this.ui, this.sessionManager.getCwd());
|
|
2761
|
-
component.setExpanded(this.toolOutputExpanded);
|
|
2762
|
-
this.addToolComponentToChat(component);
|
|
2784
|
+
const component = content.name === "browser" && this.browserActivityComponent
|
|
2785
|
+
? this.browserActivityComponent
|
|
2786
|
+
: this.createToolExecutionComponent(content.name, content.id, content.arguments);
|
|
2763
2787
|
this.pendingTools.set(content.id, component);
|
|
2764
2788
|
}
|
|
2765
2789
|
else {
|
|
@@ -2794,6 +2818,7 @@ export class InteractiveMode {
|
|
|
2794
2818
|
}
|
|
2795
2819
|
}
|
|
2796
2820
|
stopSmoothStreaming() {
|
|
2821
|
+
this.setThinkingAnimation(false);
|
|
2797
2822
|
this.clearSmoothStreamingTimer();
|
|
2798
2823
|
this.streamingTargetMessage = undefined;
|
|
2799
2824
|
this.streamingDisplayedLength = 0;
|
|
@@ -2833,6 +2858,7 @@ export class InteractiveMode {
|
|
|
2833
2858
|
switch (event.type) {
|
|
2834
2859
|
case "agent_start":
|
|
2835
2860
|
this.pendingTools.clear();
|
|
2861
|
+
this.browserActivityComponent = undefined;
|
|
2836
2862
|
if (this.settingsManager.getShowTerminalProgress()) {
|
|
2837
2863
|
this.ui.terminal.setProgress(true);
|
|
2838
2864
|
}
|
|
@@ -2885,7 +2911,11 @@ export class InteractiveMode {
|
|
|
2885
2911
|
this.ui.requestRender();
|
|
2886
2912
|
}
|
|
2887
2913
|
else if (event.message.role === "assistant") {
|
|
2888
|
-
this.streamingComponent = new AssistantMessageComponent(undefined, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.thinkingCollapse, {
|
|
2914
|
+
this.streamingComponent = new AssistantMessageComponent(undefined, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.thinkingCollapse, {
|
|
2915
|
+
requestRender: () => this.ui.requestRender(),
|
|
2916
|
+
reasoningDisplay: this.settingsManager.getReasoningDisplay(),
|
|
2917
|
+
onThinkingAnimationChange: (active) => this.setThinkingAnimation(active),
|
|
2918
|
+
});
|
|
2889
2919
|
// lunr: collapsible reasoning — fresh timing array for this message.
|
|
2890
2920
|
this.thinkingRunTimings = [];
|
|
2891
2921
|
this.streamingComponent.setThinkingTimings(this.thinkingRunTimings);
|
|
@@ -2992,14 +3022,12 @@ export class InteractiveMode {
|
|
|
2992
3022
|
}
|
|
2993
3023
|
let component = this.pendingTools.get(event.toolCallId);
|
|
2994
3024
|
if (!component) {
|
|
2995
|
-
component =
|
|
2996
|
-
showImages: this.settingsManager.getShowImages(),
|
|
2997
|
-
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
2998
|
-
}, this.getRegisteredToolDefinition(event.toolName), this.ui, this.sessionManager.getCwd());
|
|
2999
|
-
component.setExpanded(this.toolOutputExpanded);
|
|
3000
|
-
this.addToolComponentToChat(component);
|
|
3025
|
+
component = this.createToolExecutionComponent(event.toolName, event.toolCallId, event.args);
|
|
3001
3026
|
this.pendingTools.set(event.toolCallId, component);
|
|
3002
3027
|
}
|
|
3028
|
+
else if (event.toolName === "browser" && !component.matchesToolCall(event.toolCallId)) {
|
|
3029
|
+
component.beginNextExecution(event.toolCallId, event.args);
|
|
3030
|
+
}
|
|
3003
3031
|
component.markExecutionStarted();
|
|
3004
3032
|
this.ui.requestRender();
|
|
3005
3033
|
break;
|
|
@@ -3034,6 +3062,7 @@ export class InteractiveMode {
|
|
|
3034
3062
|
this.streamingMessage = undefined;
|
|
3035
3063
|
}
|
|
3036
3064
|
this.pendingTools.clear();
|
|
3065
|
+
this.browserActivityComponent = undefined;
|
|
3037
3066
|
this.maybeAutoNameSession();
|
|
3038
3067
|
// lunr: capture tree-scope changes at turn boundary (bash side-effects).
|
|
3039
3068
|
captureTreeChanges(this.sessionManager.getCwd(), this.sessionManager.getSessionId());
|
|
@@ -3252,7 +3281,10 @@ export class InteractiveMode {
|
|
|
3252
3281
|
break;
|
|
3253
3282
|
}
|
|
3254
3283
|
case "assistant": {
|
|
3255
|
-
const assistantComponent = new AssistantMessageComponent(message, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.thinkingCollapse, {
|
|
3284
|
+
const assistantComponent = new AssistantMessageComponent(message, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.thinkingCollapse, {
|
|
3285
|
+
requestRender: () => this.ui.requestRender(),
|
|
3286
|
+
reasoningDisplay: this.settingsManager.getReasoningDisplay(),
|
|
3287
|
+
});
|
|
3256
3288
|
// lunr: collapsible reasoning — re-attach live timings when this
|
|
3257
3289
|
// message was streamed in this session (undefined = history).
|
|
3258
3290
|
assistantComponent.setThinkingTimings(this.thinkingTimingsByMessage.get(message));
|
|
@@ -3272,6 +3304,7 @@ export class InteractiveMode {
|
|
|
3272
3304
|
}
|
|
3273
3305
|
renderSessionItems(items, options = {}) {
|
|
3274
3306
|
this.pendingTools.clear();
|
|
3307
|
+
let browserActivityComponent;
|
|
3275
3308
|
const renderedPendingTools = new Map();
|
|
3276
3309
|
// Cache-miss notices are not persisted; re-derive them from the full entry
|
|
3277
3310
|
// list and re-inject them after the assistant messages that paid for them.
|
|
@@ -3294,12 +3327,20 @@ export class InteractiveMode {
|
|
|
3294
3327
|
// Render tool call components
|
|
3295
3328
|
for (const content of message.content) {
|
|
3296
3329
|
if (content.type === "toolCall") {
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
}
|
|
3301
|
-
|
|
3302
|
-
|
|
3330
|
+
let component = content.name === "browser" ? browserActivityComponent : undefined;
|
|
3331
|
+
if (component) {
|
|
3332
|
+
component.beginNextExecution(content.id, content.arguments);
|
|
3333
|
+
}
|
|
3334
|
+
else {
|
|
3335
|
+
component = new ToolExecutionComponent(content.name, content.id, content.arguments, {
|
|
3336
|
+
showImages: this.settingsManager.getShowImages(),
|
|
3337
|
+
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
3338
|
+
}, this.getRegisteredToolDefinition(content.name), this.ui, this.sessionManager.getCwd());
|
|
3339
|
+
component.setExpanded(this.toolOutputExpanded);
|
|
3340
|
+
this.addToolComponentToChat(component);
|
|
3341
|
+
if (content.name === "browser")
|
|
3342
|
+
browserActivityComponent = component;
|
|
3343
|
+
}
|
|
3303
3344
|
if (message.stopReason === "aborted" || message.stopReason === "error") {
|
|
3304
3345
|
let errorMessage;
|
|
3305
3346
|
if (message.stopReason === "aborted") {
|
|
@@ -3334,6 +3375,8 @@ export class InteractiveMode {
|
|
|
3334
3375
|
}
|
|
3335
3376
|
}
|
|
3336
3377
|
else {
|
|
3378
|
+
if (message.role === "user")
|
|
3379
|
+
browserActivityComponent = undefined;
|
|
3337
3380
|
// All other messages use standard rendering
|
|
3338
3381
|
this.addMessageToChat(message, options);
|
|
3339
3382
|
}
|
|
@@ -3424,7 +3467,7 @@ export class InteractiveMode {
|
|
|
3424
3467
|
});
|
|
3425
3468
|
}
|
|
3426
3469
|
rebuildChatFromMessages() {
|
|
3427
|
-
this.
|
|
3470
|
+
this.clearChatContainer();
|
|
3428
3471
|
this.renderSessionEntries(this.sessionManager.buildContextEntries());
|
|
3429
3472
|
}
|
|
3430
3473
|
// =========================================================================
|
|
@@ -3755,6 +3798,32 @@ export class InteractiveMode {
|
|
|
3755
3798
|
globalThis[Symbol.for("@lunr/tools-expanded-changed")]?.(expanded);
|
|
3756
3799
|
this.ui.requestRender();
|
|
3757
3800
|
}
|
|
3801
|
+
createToolExecutionComponent(toolName, toolCallId, args) {
|
|
3802
|
+
if (toolName === "browser" && this.browserActivityComponent) {
|
|
3803
|
+
this.browserActivityComponent.beginNextExecution(toolCallId, args);
|
|
3804
|
+
return this.browserActivityComponent;
|
|
3805
|
+
}
|
|
3806
|
+
const component = new ToolExecutionComponent(toolName, toolCallId, args, {
|
|
3807
|
+
showImages: this.settingsManager.getShowImages(),
|
|
3808
|
+
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
3809
|
+
}, this.getRegisteredToolDefinition(toolName), this.ui, this.sessionManager.getCwd());
|
|
3810
|
+
component.setExpanded(this.toolOutputExpanded);
|
|
3811
|
+
this.addToolComponentToChat(component);
|
|
3812
|
+
if (toolName === "browser")
|
|
3813
|
+
this.browserActivityComponent = component;
|
|
3814
|
+
return component;
|
|
3815
|
+
}
|
|
3816
|
+
disposeChatToolComponents() {
|
|
3817
|
+
for (const child of this.chatContainer.children) {
|
|
3818
|
+
if (child instanceof ToolExecutionComponent)
|
|
3819
|
+
child.dispose();
|
|
3820
|
+
}
|
|
3821
|
+
this.browserActivityComponent = undefined;
|
|
3822
|
+
}
|
|
3823
|
+
clearChatContainer() {
|
|
3824
|
+
this.disposeChatToolComponents();
|
|
3825
|
+
this.chatContainer.clear();
|
|
3826
|
+
}
|
|
3758
3827
|
// lunr: consecutive same-tool grouping — a tool component appended right after
|
|
3759
3828
|
// another component for the SAME tool becomes a group continuation (no top
|
|
3760
3829
|
// spacer / top pad); the previous card drops its bottom pad. Mixed neighbors
|
|
@@ -3768,7 +3837,6 @@ export class InteractiveMode {
|
|
|
3768
3837
|
this.hideThinkingBlock = !this.hideThinkingBlock;
|
|
3769
3838
|
this.settingsManager.setHideThinkingBlock(this.hideThinkingBlock);
|
|
3770
3839
|
// Rebuild chat from session messages
|
|
3771
|
-
this.chatContainer.clear();
|
|
3772
3840
|
this.rebuildChatFromMessages();
|
|
3773
3841
|
// If streaming, re-add the streaming component with updated visibility and re-render.
|
|
3774
3842
|
// Re-slice to the current revealed length so hide-thinking does not dump the tail.
|
|
@@ -3946,7 +4014,6 @@ export class InteractiveMode {
|
|
|
3946
4014
|
return !!extensionRunner.getCommand(commandName);
|
|
3947
4015
|
}
|
|
3948
4016
|
renderCompactionResult(result) {
|
|
3949
|
-
this.chatContainer.clear();
|
|
3950
4017
|
this.rebuildChatFromMessages();
|
|
3951
4018
|
this.addMessageToChat(createCompactionSummaryMessage(result.summary, result.tokensBefore, new Date().toISOString()));
|
|
3952
4019
|
this.footer.invalidate();
|
|
@@ -4072,6 +4139,7 @@ export class InteractiveMode {
|
|
|
4072
4139
|
availableThemes: getAvailableThemes(),
|
|
4073
4140
|
hideThinkingBlock: this.hideThinkingBlock,
|
|
4074
4141
|
thinkingCollapse: this.thinkingCollapse,
|
|
4142
|
+
reasoningDisplay: this.settingsManager.getReasoningDisplay(),
|
|
4075
4143
|
cacheRetention: this.settingsManager.getCacheRetention() ?? "short",
|
|
4076
4144
|
doubleEscapeAction: this.settingsManager.getDoubleEscapeAction(),
|
|
4077
4145
|
treeFilterMode: this.settingsManager.getTreeFilterMode(),
|
|
@@ -4092,6 +4160,8 @@ export class InteractiveMode {
|
|
|
4092
4160
|
globalInstructionsPath: getGlobalInstructionsPath(getAgentDir()),
|
|
4093
4161
|
modelInstructionsPath: getModelInstructionsPath(getAgentDir(), this.session.model?.id ?? "no-model-selected"),
|
|
4094
4162
|
confirmLargeSubagentLaunches: this.settingsManager.getConfirmLargeSubagentLaunches(),
|
|
4163
|
+
subagentCommunicationEnabled: this.settingsManager.getSubagentCommunicationEnabled(),
|
|
4164
|
+
automaticSubagentDelegation: this.settingsManager.getAutomaticSubagentDelegation(),
|
|
4095
4165
|
browserEnabled: this.settingsManager.getBrowserEnabled(),
|
|
4096
4166
|
memoryEnabled: this.settingsManager.getMemoryEnabled(),
|
|
4097
4167
|
memoryCharCap: this.settingsManager.getMemoryCharCap(),
|
|
@@ -4185,7 +4255,6 @@ export class InteractiveMode {
|
|
|
4185
4255
|
child.setHideThinkingBlock(hidden);
|
|
4186
4256
|
}
|
|
4187
4257
|
}
|
|
4188
|
-
this.chatContainer.clear();
|
|
4189
4258
|
this.rebuildChatFromMessages();
|
|
4190
4259
|
},
|
|
4191
4260
|
onThinkingCollapseChange: (collapse) => {
|
|
@@ -4196,9 +4265,17 @@ export class InteractiveMode {
|
|
|
4196
4265
|
child.setThinkingCollapse(collapse);
|
|
4197
4266
|
}
|
|
4198
4267
|
}
|
|
4199
|
-
this.chatContainer.clear();
|
|
4200
4268
|
this.rebuildChatFromMessages();
|
|
4201
4269
|
},
|
|
4270
|
+
onReasoningDisplayChange: (display) => {
|
|
4271
|
+
this.settingsManager.setReasoningDisplay(display);
|
|
4272
|
+
for (const child of this.chatContainer.children) {
|
|
4273
|
+
if (child instanceof AssistantMessageComponent) {
|
|
4274
|
+
child.setReasoningDisplay(this.settingsManager.getReasoningDisplay());
|
|
4275
|
+
}
|
|
4276
|
+
}
|
|
4277
|
+
this.ui.requestRender();
|
|
4278
|
+
},
|
|
4202
4279
|
onShowCacheMissNoticesChange: (shown) => {
|
|
4203
4280
|
this.settingsManager.setShowCacheMissNotices(shown);
|
|
4204
4281
|
this.rebuildChatFromMessages();
|
|
@@ -4294,6 +4371,13 @@ export class InteractiveMode {
|
|
|
4294
4371
|
onConfirmLargeSubagentLaunchesChange: (enabled) => {
|
|
4295
4372
|
this.settingsManager.setConfirmLargeSubagentLaunches(enabled);
|
|
4296
4373
|
},
|
|
4374
|
+
onSubagentCommunicationChange: (enabled) => {
|
|
4375
|
+
this.settingsManager.setSubagentCommunicationEnabled(enabled);
|
|
4376
|
+
},
|
|
4377
|
+
onAutomaticSubagentDelegationChange: (enabled) => {
|
|
4378
|
+
this.settingsManager.setAutomaticSubagentDelegation(enabled);
|
|
4379
|
+
this.session.refreshToolRegistry();
|
|
4380
|
+
},
|
|
4297
4381
|
getTierThinkingLevels: (tier) => {
|
|
4298
4382
|
const model = this.resolveModelReference(this.settingsManager.getTierModel(tier));
|
|
4299
4383
|
if (model)
|
|
@@ -4935,7 +5019,7 @@ export class InteractiveMode {
|
|
|
4935
5019
|
return;
|
|
4936
5020
|
}
|
|
4937
5021
|
// Update UI
|
|
4938
|
-
this.
|
|
5022
|
+
this.clearChatContainer();
|
|
4939
5023
|
this.renderInitialMessages();
|
|
4940
5024
|
if (result.editorText && !this.editor.getText().trim()) {
|
|
4941
5025
|
this.restoreEditorFromTreeResult(result);
|
|
@@ -5079,7 +5163,8 @@ export class InteractiveMode {
|
|
|
5079
5163
|
// lunr: providers with a multi-key pool list one entry per subscription plus an
|
|
5080
5164
|
// "all subscriptions" entry, encoding the target as "<providerId>#<subId|all>".
|
|
5081
5165
|
const options = [];
|
|
5082
|
-
for (const { providerId, type } of await this.session.modelRuntime.listCredentials()) {
|
|
5166
|
+
for (const { providerId, type: credentialType } of await this.session.modelRuntime.listCredentials()) {
|
|
5167
|
+
const type = credentialType === "external_claude_code" ? "oauth" : credentialType;
|
|
5083
5168
|
const name = this.session.modelRuntime.getProvider(providerId)?.name ?? providerId;
|
|
5084
5169
|
const status = { type, source: "stored credential" };
|
|
5085
5170
|
if (type === "api_key") {
|
|
@@ -5693,6 +5778,32 @@ export class InteractiveMode {
|
|
|
5693
5778
|
signal: dialog.signal,
|
|
5694
5779
|
prompt: (prompt) => this.showAuthPrompt(dialog, prompt),
|
|
5695
5780
|
notify: (event) => this.notifyAuthDialog(dialog, event),
|
|
5781
|
+
handoff: async (command, args, env) => {
|
|
5782
|
+
this.ui.stop();
|
|
5783
|
+
try {
|
|
5784
|
+
await new Promise((resolve, reject) => {
|
|
5785
|
+
const child = spawn(command, [...args], { stdio: "inherit", env, windowsHide: false });
|
|
5786
|
+
const abort = () => child.kill();
|
|
5787
|
+
dialog.signal.addEventListener("abort", abort, { once: true });
|
|
5788
|
+
if (dialog.signal.aborted)
|
|
5789
|
+
abort();
|
|
5790
|
+
child.once("error", (error) => {
|
|
5791
|
+
dialog.signal.removeEventListener("abort", abort);
|
|
5792
|
+
reject(error);
|
|
5793
|
+
});
|
|
5794
|
+
child.once("close", (code) => {
|
|
5795
|
+
dialog.signal.removeEventListener("abort", abort);
|
|
5796
|
+
if (code === 0)
|
|
5797
|
+
resolve();
|
|
5798
|
+
else
|
|
5799
|
+
reject(new Error("Claude Code login did not complete"));
|
|
5800
|
+
});
|
|
5801
|
+
});
|
|
5802
|
+
}
|
|
5803
|
+
finally {
|
|
5804
|
+
this.ui.start();
|
|
5805
|
+
}
|
|
5806
|
+
},
|
|
5696
5807
|
});
|
|
5697
5808
|
}
|
|
5698
5809
|
async showLoginDialog(providerId, providerName) {
|
|
@@ -5795,7 +5906,7 @@ export class InteractiveMode {
|
|
|
5795
5906
|
if (leafId) {
|
|
5796
5907
|
this.redoStack.push(leafId);
|
|
5797
5908
|
}
|
|
5798
|
-
this.
|
|
5909
|
+
this.clearChatContainer();
|
|
5799
5910
|
this.renderInitialMessages();
|
|
5800
5911
|
void this.flushCompactionQueue({ willRetry: false });
|
|
5801
5912
|
return { editorText: result.editorText, editorImages: result.editorImages };
|
|
@@ -5838,7 +5949,7 @@ export class InteractiveMode {
|
|
|
5838
5949
|
this.showStatus("Navigation cancelled");
|
|
5839
5950
|
return;
|
|
5840
5951
|
}
|
|
5841
|
-
this.
|
|
5952
|
+
this.clearChatContainer();
|
|
5842
5953
|
this.renderInitialMessages();
|
|
5843
5954
|
if (result.editorText && !this.editor.getText().trim()) {
|
|
5844
5955
|
this.restoreEditorFromTreeResult(result);
|
|
@@ -6358,76 +6469,58 @@ export class InteractiveMode {
|
|
|
6358
6469
|
this.chatContainer.addChild(new Text(lines.join("\n"), 1, 0));
|
|
6359
6470
|
this.ui.requestRender();
|
|
6360
6471
|
}
|
|
6361
|
-
//
|
|
6472
|
+
// /plan is a shortcut into read-only mode for planning.
|
|
6362
6473
|
async handlePlanCommand(args) {
|
|
6363
6474
|
const sub = args.toLowerCase();
|
|
6364
|
-
const
|
|
6475
|
+
const inReadOnly = getPermissionMode() === "read-only";
|
|
6365
6476
|
if (sub === "status") {
|
|
6366
|
-
this.showStatus(
|
|
6367
|
-
? "Plan mode is active — edit/write and mutating bash are blocked. /plan off to implement."
|
|
6368
|
-
: `Permission mode: ${getPermissionMode()}.`);
|
|
6477
|
+
this.showStatus(inReadOnly ? "Read mode is active. /plan off to leave it." : `Permission mode: ${getPermissionMode()}.`);
|
|
6369
6478
|
return;
|
|
6370
6479
|
}
|
|
6371
|
-
// lunr: `/plan <text>` — any arg other than on/off/status is task text.
|
|
6372
|
-
// While not in plan: enter plan and send. While in plan: restore previous
|
|
6373
|
-
// mode and send with full tool access ("looks good, go implement it").
|
|
6374
6480
|
if (sub !== "" && sub !== "on" && sub !== "off") {
|
|
6375
|
-
if (
|
|
6376
|
-
this.applyPermissionMode(
|
|
6377
|
-
}
|
|
6378
|
-
else {
|
|
6379
|
-
this.applyPermissionMode("plan");
|
|
6380
|
-
}
|
|
6381
|
-
await this.sendUserMessageAfterDeferredBuiltins(args);
|
|
6481
|
+
if (!inReadOnly)
|
|
6482
|
+
this.applyPermissionMode("read-only");
|
|
6483
|
+
await this.sendUserMessageAfterDeferredBuiltins(`Create a plan for: ${args}`);
|
|
6382
6484
|
return;
|
|
6383
6485
|
}
|
|
6384
|
-
const next = sub
|
|
6385
|
-
if (next ===
|
|
6386
|
-
this.showStatus(next ? "
|
|
6486
|
+
const next = sub !== "off";
|
|
6487
|
+
if (next === inReadOnly) {
|
|
6488
|
+
this.showStatus(next ? "Read mode is already active." : "Read mode is already off.");
|
|
6387
6489
|
return;
|
|
6388
6490
|
}
|
|
6389
|
-
|
|
6390
|
-
this.applyPermissionMode("plan");
|
|
6391
|
-
}
|
|
6392
|
-
else {
|
|
6393
|
-
this.applyPermissionMode(this.restoreTargetAfterPlan());
|
|
6394
|
-
}
|
|
6491
|
+
this.applyPermissionMode(next ? "read-only" : this.restoreTargetAfterPlan());
|
|
6395
6492
|
}
|
|
6396
|
-
// lunr: /mode — permission mode selector (manual / yolo / plan / auto). Per-session only.
|
|
6397
6493
|
handleModeCommand(args) {
|
|
6398
6494
|
const sub = args.toLowerCase();
|
|
6399
6495
|
if (sub === "status") {
|
|
6400
|
-
this.showStatus(`Permission mode: ${getPermissionMode()}`);
|
|
6496
|
+
this.showStatus(`Permission mode: ${getPermissionMode() === "read-only" ? "read" : getPermissionMode()}`);
|
|
6401
6497
|
return;
|
|
6402
6498
|
}
|
|
6403
|
-
if (sub === "
|
|
6404
|
-
this.applyPermissionMode(sub);
|
|
6499
|
+
if (sub === "yolo" || sub === "auto" || sub === "read-only" || sub === "read") {
|
|
6500
|
+
this.applyPermissionMode(sub === "read" ? "read-only" : sub);
|
|
6405
6501
|
return;
|
|
6406
6502
|
}
|
|
6407
6503
|
if (sub !== "") {
|
|
6408
|
-
this.showStatus("Usage: /mode [
|
|
6504
|
+
this.showStatus("Usage: /mode [yolo|auto|read] — bare /mode opens the selector.");
|
|
6409
6505
|
return;
|
|
6410
6506
|
}
|
|
6411
6507
|
const options = [
|
|
6412
|
-
"Manual — approve every action",
|
|
6413
6508
|
"YOLO — auto-approve tools, agent may still ask",
|
|
6414
|
-
"Plan — read-only; present a plan for approval",
|
|
6415
6509
|
"Auto — fully autonomous, no questions",
|
|
6510
|
+
"Read — inspect without making changes",
|
|
6416
6511
|
];
|
|
6417
6512
|
void this.showExtensionSelector("Permission mode", options).then((choice) => {
|
|
6418
6513
|
if (!choice)
|
|
6419
6514
|
return;
|
|
6420
|
-
if (choice.startsWith("
|
|
6421
|
-
this.applyPermissionMode("manual");
|
|
6422
|
-
else if (choice.startsWith("YOLO"))
|
|
6515
|
+
if (choice.startsWith("YOLO"))
|
|
6423
6516
|
this.applyPermissionMode("yolo");
|
|
6424
|
-
else if (choice.startsWith("Plan"))
|
|
6425
|
-
this.applyPermissionMode("plan");
|
|
6426
6517
|
else if (choice.startsWith("Auto"))
|
|
6427
6518
|
this.applyPermissionMode("auto");
|
|
6519
|
+
else if (choice.startsWith("Read"))
|
|
6520
|
+
this.applyPermissionMode("read-only");
|
|
6428
6521
|
});
|
|
6429
6522
|
}
|
|
6430
|
-
/** Destination
|
|
6523
|
+
/** Destination after plan approval or /plan off. */
|
|
6431
6524
|
restoreTargetAfterPlan() {
|
|
6432
6525
|
return restorePermissionModeAfterPlan(this.previousPermissionMode, this.settingsManager.getDefaultPermissionMode());
|
|
6433
6526
|
}
|
|
@@ -6436,8 +6529,8 @@ export class InteractiveMode {
|
|
|
6436
6529
|
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
6437
6530
|
return;
|
|
6438
6531
|
this.sessionManager.setPermissionMode(mode);
|
|
6439
|
-
if (mode === "
|
|
6440
|
-
this.session.setSystemPromptAppend(
|
|
6532
|
+
if (mode === "read-only") {
|
|
6533
|
+
this.session.setSystemPromptAppend(READ_ONLY_MODE_ADDENDUM);
|
|
6441
6534
|
}
|
|
6442
6535
|
else if (mode === "auto") {
|
|
6443
6536
|
this.session.setSystemPromptAppend(AUTO_MODE_ADDENDUM);
|
|
@@ -6468,13 +6561,13 @@ export class InteractiveMode {
|
|
|
6468
6561
|
this.sessionManager.setPermissionMode(mode);
|
|
6469
6562
|
recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir);
|
|
6470
6563
|
const prev = getPermissionMode();
|
|
6471
|
-
if (mode === "
|
|
6564
|
+
if (mode === "read-only" && prev !== "read-only") {
|
|
6472
6565
|
this.previousPermissionMode = prev;
|
|
6473
6566
|
}
|
|
6474
6567
|
setPermissionMode(mode);
|
|
6475
6568
|
this.ui.requestRender();
|
|
6476
|
-
if (mode === "
|
|
6477
|
-
this.session.setSystemPromptAppend(
|
|
6569
|
+
if (mode === "read-only") {
|
|
6570
|
+
this.session.setSystemPromptAppend(READ_ONLY_MODE_ADDENDUM);
|
|
6478
6571
|
}
|
|
6479
6572
|
else if (mode === "auto") {
|
|
6480
6573
|
this.session.setSystemPromptAppend(AUTO_MODE_ADDENDUM);
|
|
@@ -6493,43 +6586,13 @@ export class InteractiveMode {
|
|
|
6493
6586
|
if (mode === "auto" && prev !== "auto") {
|
|
6494
6587
|
this.showStatus("Auto mode active — fully autonomous. Rollback enabled for this session.");
|
|
6495
6588
|
}
|
|
6496
|
-
else if (mode === "
|
|
6497
|
-
this.showStatus("
|
|
6589
|
+
else if (mode === "read-only") {
|
|
6590
|
+
this.showStatus("Read mode active. Changes are blocked.");
|
|
6498
6591
|
}
|
|
6499
6592
|
else {
|
|
6500
6593
|
this.showStatus(`Permission mode: ${mode}`);
|
|
6501
6594
|
}
|
|
6502
6595
|
}
|
|
6503
|
-
// lunr: approval dialog for manual permission mode.
|
|
6504
|
-
// lunr: adds "Switch to auto" / "Switch to yolo" at the bottom so users can
|
|
6505
|
-
// escape manual approval mid-turn without a separate /mode round-trip.
|
|
6506
|
-
async showApprovalDialog(req) {
|
|
6507
|
-
return new Promise((resolve) => {
|
|
6508
|
-
this.showSelector((done) => {
|
|
6509
|
-
const selector = new ExtensionSelectorComponent(`Approve ${req.action}?`, ["Approve once", "Approve for session", "Reject", "Switch to auto", "Switch to yolo"], (option) => {
|
|
6510
|
-
done();
|
|
6511
|
-
if (option === "Approve once")
|
|
6512
|
-
resolve("once");
|
|
6513
|
-
else if (option === "Approve for session")
|
|
6514
|
-
resolve("session");
|
|
6515
|
-
else if (option === "Switch to auto") {
|
|
6516
|
-
this.applyPermissionMode("auto");
|
|
6517
|
-
resolve("once");
|
|
6518
|
-
}
|
|
6519
|
-
else if (option === "Switch to yolo") {
|
|
6520
|
-
this.applyPermissionMode("yolo");
|
|
6521
|
-
resolve("once");
|
|
6522
|
-
}
|
|
6523
|
-
else
|
|
6524
|
-
resolve("reject");
|
|
6525
|
-
}, () => {
|
|
6526
|
-
done();
|
|
6527
|
-
resolve("reject");
|
|
6528
|
-
}, { message: req.detail.slice(0, 500) });
|
|
6529
|
-
return { component: selector, focus: selector };
|
|
6530
|
-
});
|
|
6531
|
-
});
|
|
6532
|
-
}
|
|
6533
6596
|
// Approval dialog for one subagent call launching more than two children.
|
|
6534
6597
|
// "Reject with feedback" collects a one-line
|
|
6535
6598
|
// reason that becomes the block reason the model sees, so it can adjust the plan.
|
|
@@ -6558,7 +6621,7 @@ export class InteractiveMode {
|
|
|
6558
6621
|
});
|
|
6559
6622
|
});
|
|
6560
6623
|
}
|
|
6561
|
-
//
|
|
6624
|
+
// Approval dialog for present_plan (read-only mode). The "with feedback"
|
|
6562
6625
|
// options collect a one-line note via showExtensionInput that becomes part of
|
|
6563
6626
|
// the result text the model sees. Esc/close counts as Decline.
|
|
6564
6627
|
showPlanInChat(summary) {
|
|
@@ -6949,6 +7012,7 @@ ${toggleThinking ? `| \`${toggleThinking}\` | Toggle thinking block visibility |
|
|
|
6949
7012
|
}
|
|
6950
7013
|
}
|
|
6951
7014
|
stop() {
|
|
7015
|
+
this.setThinkingAnimation(false);
|
|
6952
7016
|
this.stopCatalogRefresh?.();
|
|
6953
7017
|
this.stopCatalogRefresh = undefined;
|
|
6954
7018
|
if (this.settingsManager.getShowTerminalProgress()) {
|
|
@@ -6959,6 +7023,7 @@ ${toggleThinking ? `| \`${toggleThinking}\` | Toggle thinking block visibility |
|
|
|
6959
7023
|
this.clearExtensionTerminalInputListeners();
|
|
6960
7024
|
this.footer.dispose();
|
|
6961
7025
|
this.footerDataProvider.dispose();
|
|
7026
|
+
this.disposeChatToolComponents();
|
|
6962
7027
|
if (this.unsubscribe) {
|
|
6963
7028
|
this.unsubscribe();
|
|
6964
7029
|
}
|