@ashx-j/lunr 0.2.23 → 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 +14 -1
- package/README.md +10 -10
- 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-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/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/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 +19 -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/core/agent-session.d.ts +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +5 -4
- 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 +9 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +40 -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/system-prompt.d.ts +2 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +9 -4
- package/dist/core/system-prompt.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/settings-selector.d.ts +4 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +23 -3
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-tail.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-tail.js +2 -2
- package/dist/modes/interactive/components/thinking-tail.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +12 -2
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +76 -90
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/node-runtime/{agent-session-services-GZVSOGYR.js → agent-session-services-IEF7LQWD.js} +8 -9
- package/dist/node-runtime/{builtin-extensions-QVCXNQT4.js → builtin-extensions-EBAWTH4M.js} +3 -3
- package/dist/node-runtime/{chunk-XLTL257W.js → chunk-2KIPT4HJ.js} +5 -1
- package/dist/node-runtime/{chunk-YHQ3NBB3.js → chunk-5Q3EHOHI.js} +17 -17
- package/dist/node-runtime/{chunk-TQGPP4SC.js → chunk-CDVHZOOK.js} +1 -1
- package/dist/node-runtime/{chunk-DQMGU675.js → chunk-DE2JB6J5.js} +20 -17
- package/dist/node-runtime/{chunk-YJMMG7C6.js → chunk-DSIKTUPW.js} +1 -1
- package/dist/node-runtime/{chunk-TVJUOJZJ.js → chunk-F4FLTQKV.js} +1 -1
- package/dist/node-runtime/{chunk-GMHJCCEN.js → chunk-FU6OODRZ.js} +4 -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-AZJHNQKQ.js → chunk-I54LGHWM.js} +1 -1
- package/dist/node-runtime/{chunk-DD5YWFSJ.js → chunk-IGV54Q5V.js} +2 -2
- package/dist/node-runtime/{chunk-RIR5EDDJ.js → chunk-K5AGHH57.js} +17 -12
- package/dist/node-runtime/{chunk-GS66LV4M.js → chunk-KJ6DWS3K.js} +4 -4
- package/dist/node-runtime/{chunk-LLUIPGDR.js → chunk-L3LX4SNR.js} +108 -75
- 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-W64JC4E7.js → chunk-OF7PWMG4.js} +2 -2
- package/dist/node-runtime/{chunk-CSUZVNYE.js → chunk-OVX6X377.js} +10 -6
- package/dist/node-runtime/{chunk-X3URCYCU.js → chunk-QM43FEAE.js} +14 -14
- package/dist/node-runtime/{chunk-QAZOULTU.js → chunk-RORY2HMJ.js} +39 -5
- package/dist/node-runtime/{chunk-EKVFP6YF.js → chunk-WHLRAGUQ.js} +13 -12
- package/dist/node-runtime/{chunk-HPUP7E4T.js → chunk-Y73WPE6S.js} +16 -16
- package/dist/node-runtime/{chunk-LFZDVKSP.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-PDVTBRWA.js → command-7BG7VVTS.js} +3 -3
- package/dist/node-runtime/{commands-KAMO2T6P.js → commands-NZLSOHPE.js} +2 -2
- package/dist/node-runtime/{commands-XDCFGIGW.js → commands-QFDKNQTL.js} +7 -7
- package/dist/node-runtime/{direct-tool-executor-YAVOLDFY.js → direct-tool-executor-77GW4F5P.js} +3 -3
- package/dist/node-runtime/{export-html-KSOIMVPI.js → export-html-VM4J2MNR.js} +1 -1
- package/dist/node-runtime/{gateway-AYWM5DIO.js → gateway-TWR3N65G.js} +12 -12
- package/dist/node-runtime/index.js +16 -17
- package/dist/node-runtime/{init-X2LIUB2H.js → init-HS6NQXSK.js} +2 -2
- package/dist/node-runtime/{install-cli-3BO4MMQ6.js → install-cli-VAP6KBFN.js} +1 -1
- package/dist/node-runtime/{interactive-mode-4MFRKAHG.js → interactive-mode-6J5VZ2TT.js} +10 -11
- package/dist/node-runtime/{interactive-view-TUZHCQM3.js → interactive-view-NGFAMHPW.js} +2 -2
- package/dist/node-runtime/{lunr-browser-RYFIIVJN.js → lunr-browser-J5ZZYVGM.js} +1 -1
- package/dist/node-runtime/{lunr-cron-YWXEPZMQ.js → lunr-cron-CXOL37AL.js} +5 -5
- package/dist/node-runtime/main.js +14 -15
- package/dist/node-runtime/{mobile-commands-LVHDAUDP.js → mobile-commands-VTBM5DSZ.js} +4 -4
- package/dist/node-runtime/{model-runtime-PLQKAG4B.js → model-runtime-OO5HFLWE.js} +1 -1
- package/dist/node-runtime/{package-manager-cli-6GT3Z3CK.js → package-manager-cli-ZLW5DZXF.js} +3 -4
- 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-CDWK2AKY.js → pi-subagents-XPCLLKIM.js} +23 -13
- package/dist/node-runtime/{proxy-modes-OSQCWRBI.js → proxy-modes-LGEUYD7R.js} +3 -3
- package/dist/node-runtime/rpc-entry.js +14 -15
- 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/{settings-manager-6VEMXRDL.js → settings-manager-WCQDUVQB.js} +7 -4
- package/dist/node-runtime/{setup-5SR2J35A.js → setup-YRBKH2LD.js} +2 -2
- package/dist/node-runtime/{subagent-executor-M5VWB3D3.js → subagent-executor-OTNISDQU.js} +40 -7
- package/dist/node-runtime/{update-cli-UVKJWRRJ.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 +15 -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 +1 -1
- package/docs/usage.md +4 -4
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/plan-mode/README.md +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
- package/dist/node-runtime/chunk-LISUTZS3.js +0 -19
|
@@ -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 &
|
|
@@ -279,8 +279,7 @@ export class InteractiveMode {
|
|
|
279
279
|
signalCleanupHandlers = [];
|
|
280
280
|
// Track if editor is in bash mode (text starts with !)
|
|
281
281
|
isBashMode = false;
|
|
282
|
-
//
|
|
283
|
-
// / `/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.
|
|
284
283
|
previousPermissionMode;
|
|
285
284
|
// lunr: mode in effect before `/goal` forced session auto. Dedicated so it cannot
|
|
286
285
|
// collide with plan restore.
|
|
@@ -611,23 +610,22 @@ export class InteractiveMode {
|
|
|
611
610
|
time("ui.start");
|
|
612
611
|
void this.maybeNotifyCliUpdate();
|
|
613
612
|
this.startPlanUsagePolling();
|
|
614
|
-
//
|
|
613
|
+
// Plans and large subagent launches use distinct approval dialogs.
|
|
615
614
|
registerApprovalHandler(async (req) => {
|
|
616
615
|
if (req.kind === "large-subagent-launch") {
|
|
617
616
|
return this.showLargeSubagentLaunchApprovalDialog(req);
|
|
618
617
|
}
|
|
619
|
-
//
|
|
620
|
-
// restore runs BEFORE resolving so the model's next tool call already
|
|
621
|
-
// has full access. Decline keeps plan mode active.
|
|
618
|
+
// Approval restores writing access before the model's next tool call.
|
|
622
619
|
if (req.kind === "plan") {
|
|
623
620
|
const resp = await this.showPlanApprovalDialog(req.detail);
|
|
624
621
|
const decision = typeof resp === "string" ? resp : resp.decision;
|
|
625
622
|
if (decision !== "reject") {
|
|
626
|
-
this.
|
|
623
|
+
const target = this.restoreTargetAfterPlan();
|
|
624
|
+
this.applyPermissionMode(target === "read-only" ? "yolo" : target);
|
|
627
625
|
}
|
|
628
626
|
return resp;
|
|
629
627
|
}
|
|
630
|
-
return
|
|
628
|
+
return "reject";
|
|
631
629
|
});
|
|
632
630
|
// lunr: initialize rollback service for this session.
|
|
633
631
|
initRollback(this.settingsManager, this.sessionManager.getSessionId());
|
|
@@ -2459,7 +2457,7 @@ export class InteractiveMode {
|
|
|
2459
2457
|
if (text &&
|
|
2460
2458
|
!this.runtimeHost.isDetached &&
|
|
2461
2459
|
(!text.startsWith("/") ||
|
|
2462
|
-
/^\/(?: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))) {
|
|
2463
2461
|
recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir);
|
|
2464
2462
|
}
|
|
2465
2463
|
if (!text) {
|
|
@@ -2585,9 +2583,9 @@ export class InteractiveMode {
|
|
|
2585
2583
|
this.handleModeCommand(text === "/mode" ? "" : text.slice(6).trim());
|
|
2586
2584
|
return;
|
|
2587
2585
|
}
|
|
2588
|
-
if (text === "/
|
|
2586
|
+
if (text === "/read" || text === "/yolo" || text === "/auto") {
|
|
2589
2587
|
this.editor.setText("");
|
|
2590
|
-
this.applyPermissionMode(text.slice(1));
|
|
2588
|
+
this.applyPermissionMode(text === "/read" ? "read-only" : text.slice(1));
|
|
2591
2589
|
return;
|
|
2592
2590
|
}
|
|
2593
2591
|
if (text === "/processes") {
|
|
@@ -4162,6 +4160,8 @@ export class InteractiveMode {
|
|
|
4162
4160
|
globalInstructionsPath: getGlobalInstructionsPath(getAgentDir()),
|
|
4163
4161
|
modelInstructionsPath: getModelInstructionsPath(getAgentDir(), this.session.model?.id ?? "no-model-selected"),
|
|
4164
4162
|
confirmLargeSubagentLaunches: this.settingsManager.getConfirmLargeSubagentLaunches(),
|
|
4163
|
+
subagentCommunicationEnabled: this.settingsManager.getSubagentCommunicationEnabled(),
|
|
4164
|
+
automaticSubagentDelegation: this.settingsManager.getAutomaticSubagentDelegation(),
|
|
4165
4165
|
browserEnabled: this.settingsManager.getBrowserEnabled(),
|
|
4166
4166
|
memoryEnabled: this.settingsManager.getMemoryEnabled(),
|
|
4167
4167
|
memoryCharCap: this.settingsManager.getMemoryCharCap(),
|
|
@@ -4371,6 +4371,13 @@ export class InteractiveMode {
|
|
|
4371
4371
|
onConfirmLargeSubagentLaunchesChange: (enabled) => {
|
|
4372
4372
|
this.settingsManager.setConfirmLargeSubagentLaunches(enabled);
|
|
4373
4373
|
},
|
|
4374
|
+
onSubagentCommunicationChange: (enabled) => {
|
|
4375
|
+
this.settingsManager.setSubagentCommunicationEnabled(enabled);
|
|
4376
|
+
},
|
|
4377
|
+
onAutomaticSubagentDelegationChange: (enabled) => {
|
|
4378
|
+
this.settingsManager.setAutomaticSubagentDelegation(enabled);
|
|
4379
|
+
this.session.refreshToolRegistry();
|
|
4380
|
+
},
|
|
4374
4381
|
getTierThinkingLevels: (tier) => {
|
|
4375
4382
|
const model = this.resolveModelReference(this.settingsManager.getTierModel(tier));
|
|
4376
4383
|
if (model)
|
|
@@ -5156,7 +5163,8 @@ export class InteractiveMode {
|
|
|
5156
5163
|
// lunr: providers with a multi-key pool list one entry per subscription plus an
|
|
5157
5164
|
// "all subscriptions" entry, encoding the target as "<providerId>#<subId|all>".
|
|
5158
5165
|
const options = [];
|
|
5159
|
-
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;
|
|
5160
5168
|
const name = this.session.modelRuntime.getProvider(providerId)?.name ?? providerId;
|
|
5161
5169
|
const status = { type, source: "stored credential" };
|
|
5162
5170
|
if (type === "api_key") {
|
|
@@ -5770,6 +5778,32 @@ export class InteractiveMode {
|
|
|
5770
5778
|
signal: dialog.signal,
|
|
5771
5779
|
prompt: (prompt) => this.showAuthPrompt(dialog, prompt),
|
|
5772
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
|
+
},
|
|
5773
5807
|
});
|
|
5774
5808
|
}
|
|
5775
5809
|
async showLoginDialog(providerId, providerName) {
|
|
@@ -6435,76 +6469,58 @@ export class InteractiveMode {
|
|
|
6435
6469
|
this.chatContainer.addChild(new Text(lines.join("\n"), 1, 0));
|
|
6436
6470
|
this.ui.requestRender();
|
|
6437
6471
|
}
|
|
6438
|
-
//
|
|
6472
|
+
// /plan is a shortcut into read-only mode for planning.
|
|
6439
6473
|
async handlePlanCommand(args) {
|
|
6440
6474
|
const sub = args.toLowerCase();
|
|
6441
|
-
const
|
|
6475
|
+
const inReadOnly = getPermissionMode() === "read-only";
|
|
6442
6476
|
if (sub === "status") {
|
|
6443
|
-
this.showStatus(
|
|
6444
|
-
? "Plan mode is active — edit/write and mutating bash are blocked. /plan off to implement."
|
|
6445
|
-
: `Permission mode: ${getPermissionMode()}.`);
|
|
6477
|
+
this.showStatus(inReadOnly ? "Read mode is active. /plan off to leave it." : `Permission mode: ${getPermissionMode()}.`);
|
|
6446
6478
|
return;
|
|
6447
6479
|
}
|
|
6448
|
-
// lunr: `/plan <text>` — any arg other than on/off/status is task text.
|
|
6449
|
-
// While not in plan: enter plan and send. While in plan: restore previous
|
|
6450
|
-
// mode and send with full tool access ("looks good, go implement it").
|
|
6451
6480
|
if (sub !== "" && sub !== "on" && sub !== "off") {
|
|
6452
|
-
if (
|
|
6453
|
-
this.applyPermissionMode(
|
|
6454
|
-
}
|
|
6455
|
-
else {
|
|
6456
|
-
this.applyPermissionMode("plan");
|
|
6457
|
-
}
|
|
6458
|
-
await this.sendUserMessageAfterDeferredBuiltins(args);
|
|
6481
|
+
if (!inReadOnly)
|
|
6482
|
+
this.applyPermissionMode("read-only");
|
|
6483
|
+
await this.sendUserMessageAfterDeferredBuiltins(`Create a plan for: ${args}`);
|
|
6459
6484
|
return;
|
|
6460
6485
|
}
|
|
6461
|
-
const next = sub
|
|
6462
|
-
if (next ===
|
|
6463
|
-
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.");
|
|
6464
6489
|
return;
|
|
6465
6490
|
}
|
|
6466
|
-
|
|
6467
|
-
this.applyPermissionMode("plan");
|
|
6468
|
-
}
|
|
6469
|
-
else {
|
|
6470
|
-
this.applyPermissionMode(this.restoreTargetAfterPlan());
|
|
6471
|
-
}
|
|
6491
|
+
this.applyPermissionMode(next ? "read-only" : this.restoreTargetAfterPlan());
|
|
6472
6492
|
}
|
|
6473
|
-
// lunr: /mode — permission mode selector (manual / yolo / plan / auto). Per-session only.
|
|
6474
6493
|
handleModeCommand(args) {
|
|
6475
6494
|
const sub = args.toLowerCase();
|
|
6476
6495
|
if (sub === "status") {
|
|
6477
|
-
this.showStatus(`Permission mode: ${getPermissionMode()}`);
|
|
6496
|
+
this.showStatus(`Permission mode: ${getPermissionMode() === "read-only" ? "read" : getPermissionMode()}`);
|
|
6478
6497
|
return;
|
|
6479
6498
|
}
|
|
6480
|
-
if (sub === "
|
|
6481
|
-
this.applyPermissionMode(sub);
|
|
6499
|
+
if (sub === "yolo" || sub === "auto" || sub === "read-only" || sub === "read") {
|
|
6500
|
+
this.applyPermissionMode(sub === "read" ? "read-only" : sub);
|
|
6482
6501
|
return;
|
|
6483
6502
|
}
|
|
6484
6503
|
if (sub !== "") {
|
|
6485
|
-
this.showStatus("Usage: /mode [
|
|
6504
|
+
this.showStatus("Usage: /mode [yolo|auto|read] — bare /mode opens the selector.");
|
|
6486
6505
|
return;
|
|
6487
6506
|
}
|
|
6488
6507
|
const options = [
|
|
6489
|
-
"Manual — approve every action",
|
|
6490
6508
|
"YOLO — auto-approve tools, agent may still ask",
|
|
6491
|
-
"Plan — read-only; present a plan for approval",
|
|
6492
6509
|
"Auto — fully autonomous, no questions",
|
|
6510
|
+
"Read — inspect without making changes",
|
|
6493
6511
|
];
|
|
6494
6512
|
void this.showExtensionSelector("Permission mode", options).then((choice) => {
|
|
6495
6513
|
if (!choice)
|
|
6496
6514
|
return;
|
|
6497
|
-
if (choice.startsWith("
|
|
6498
|
-
this.applyPermissionMode("manual");
|
|
6499
|
-
else if (choice.startsWith("YOLO"))
|
|
6515
|
+
if (choice.startsWith("YOLO"))
|
|
6500
6516
|
this.applyPermissionMode("yolo");
|
|
6501
|
-
else if (choice.startsWith("Plan"))
|
|
6502
|
-
this.applyPermissionMode("plan");
|
|
6503
6517
|
else if (choice.startsWith("Auto"))
|
|
6504
6518
|
this.applyPermissionMode("auto");
|
|
6519
|
+
else if (choice.startsWith("Read"))
|
|
6520
|
+
this.applyPermissionMode("read-only");
|
|
6505
6521
|
});
|
|
6506
6522
|
}
|
|
6507
|
-
/** Destination
|
|
6523
|
+
/** Destination after plan approval or /plan off. */
|
|
6508
6524
|
restoreTargetAfterPlan() {
|
|
6509
6525
|
return restorePermissionModeAfterPlan(this.previousPermissionMode, this.settingsManager.getDefaultPermissionMode());
|
|
6510
6526
|
}
|
|
@@ -6513,8 +6529,8 @@ export class InteractiveMode {
|
|
|
6513
6529
|
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
6514
6530
|
return;
|
|
6515
6531
|
this.sessionManager.setPermissionMode(mode);
|
|
6516
|
-
if (mode === "
|
|
6517
|
-
this.session.setSystemPromptAppend(
|
|
6532
|
+
if (mode === "read-only") {
|
|
6533
|
+
this.session.setSystemPromptAppend(READ_ONLY_MODE_ADDENDUM);
|
|
6518
6534
|
}
|
|
6519
6535
|
else if (mode === "auto") {
|
|
6520
6536
|
this.session.setSystemPromptAppend(AUTO_MODE_ADDENDUM);
|
|
@@ -6545,13 +6561,13 @@ export class InteractiveMode {
|
|
|
6545
6561
|
this.sessionManager.setPermissionMode(mode);
|
|
6546
6562
|
recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir);
|
|
6547
6563
|
const prev = getPermissionMode();
|
|
6548
|
-
if (mode === "
|
|
6564
|
+
if (mode === "read-only" && prev !== "read-only") {
|
|
6549
6565
|
this.previousPermissionMode = prev;
|
|
6550
6566
|
}
|
|
6551
6567
|
setPermissionMode(mode);
|
|
6552
6568
|
this.ui.requestRender();
|
|
6553
|
-
if (mode === "
|
|
6554
|
-
this.session.setSystemPromptAppend(
|
|
6569
|
+
if (mode === "read-only") {
|
|
6570
|
+
this.session.setSystemPromptAppend(READ_ONLY_MODE_ADDENDUM);
|
|
6555
6571
|
}
|
|
6556
6572
|
else if (mode === "auto") {
|
|
6557
6573
|
this.session.setSystemPromptAppend(AUTO_MODE_ADDENDUM);
|
|
@@ -6570,43 +6586,13 @@ export class InteractiveMode {
|
|
|
6570
6586
|
if (mode === "auto" && prev !== "auto") {
|
|
6571
6587
|
this.showStatus("Auto mode active — fully autonomous. Rollback enabled for this session.");
|
|
6572
6588
|
}
|
|
6573
|
-
else if (mode === "
|
|
6574
|
-
this.showStatus("
|
|
6589
|
+
else if (mode === "read-only") {
|
|
6590
|
+
this.showStatus("Read mode active. Changes are blocked.");
|
|
6575
6591
|
}
|
|
6576
6592
|
else {
|
|
6577
6593
|
this.showStatus(`Permission mode: ${mode}`);
|
|
6578
6594
|
}
|
|
6579
6595
|
}
|
|
6580
|
-
// lunr: approval dialog for manual permission mode.
|
|
6581
|
-
// lunr: adds "Switch to auto" / "Switch to yolo" at the bottom so users can
|
|
6582
|
-
// escape manual approval mid-turn without a separate /mode round-trip.
|
|
6583
|
-
async showApprovalDialog(req) {
|
|
6584
|
-
return new Promise((resolve) => {
|
|
6585
|
-
this.showSelector((done) => {
|
|
6586
|
-
const selector = new ExtensionSelectorComponent(`Approve ${req.action}?`, ["Approve once", "Approve for session", "Reject", "Switch to auto", "Switch to yolo"], (option) => {
|
|
6587
|
-
done();
|
|
6588
|
-
if (option === "Approve once")
|
|
6589
|
-
resolve("once");
|
|
6590
|
-
else if (option === "Approve for session")
|
|
6591
|
-
resolve("session");
|
|
6592
|
-
else if (option === "Switch to auto") {
|
|
6593
|
-
this.applyPermissionMode("auto");
|
|
6594
|
-
resolve("once");
|
|
6595
|
-
}
|
|
6596
|
-
else if (option === "Switch to yolo") {
|
|
6597
|
-
this.applyPermissionMode("yolo");
|
|
6598
|
-
resolve("once");
|
|
6599
|
-
}
|
|
6600
|
-
else
|
|
6601
|
-
resolve("reject");
|
|
6602
|
-
}, () => {
|
|
6603
|
-
done();
|
|
6604
|
-
resolve("reject");
|
|
6605
|
-
}, { message: req.detail.slice(0, 500) });
|
|
6606
|
-
return { component: selector, focus: selector };
|
|
6607
|
-
});
|
|
6608
|
-
});
|
|
6609
|
-
}
|
|
6610
6596
|
// Approval dialog for one subagent call launching more than two children.
|
|
6611
6597
|
// "Reject with feedback" collects a one-line
|
|
6612
6598
|
// reason that becomes the block reason the model sees, so it can adjust the plan.
|
|
@@ -6635,7 +6621,7 @@ export class InteractiveMode {
|
|
|
6635
6621
|
});
|
|
6636
6622
|
});
|
|
6637
6623
|
}
|
|
6638
|
-
//
|
|
6624
|
+
// Approval dialog for present_plan (read-only mode). The "with feedback"
|
|
6639
6625
|
// options collect a one-line note via showExtensionInput that becomes part of
|
|
6640
6626
|
// the result text the model sees. Esc/close counts as Decline.
|
|
6641
6627
|
showPlanInChat(summary) {
|