@ashx-j/lunr 0.2.23 → 0.2.25
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 +22 -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 +3 -8
- package/dist/gateway/adapters/discord.js.map +1 -1
- package/dist/gateway/adapters/telegram.d.ts.map +1 -1
- package/dist/gateway/adapters/telegram.js +7 -0
- package/dist/gateway/adapters/telegram.js.map +1 -1
- package/dist/gateway/agent-bridge.d.ts +4 -1
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +57 -17
- package/dist/gateway/agent-bridge.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/buttons.d.ts.map +1 -1
- package/dist/gateway/buttons.js +29 -19
- package/dist/gateway/buttons.js.map +1 -1
- package/dist/gateway/commands.d.ts +2 -0
- package/dist/gateway/commands.d.ts.map +1 -1
- package/dist/gateway/commands.js +39 -18
- package/dist/gateway/commands.js.map +1 -1
- package/dist/gateway/config.d.ts +1 -0
- package/dist/gateway/config.d.ts.map +1 -1
- package/dist/gateway/config.js +2 -0
- package/dist/gateway/config.js.map +1 -1
- package/dist/gateway/cron.d.ts +1 -1
- package/dist/gateway/cron.d.ts.map +1 -1
- package/dist/gateway/cron.js +2 -2
- package/dist/gateway/cron.js.map +1 -1
- package/dist/gateway/index.d.ts.map +1 -1
- package/dist/gateway/index.js +26 -26
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/mobile-commands.d.ts.map +1 -1
- package/dist/gateway/mobile-commands.js +15 -14
- package/dist/gateway/mobile-commands.js.map +1 -1
- package/dist/gateway/presenter.d.ts +12 -1
- package/dist/gateway/presenter.d.ts.map +1 -1
- package/dist/gateway/presenter.js +146 -48
- package/dist/gateway/presenter.js.map +1 -1
- package/dist/gateway/router.d.ts +5 -5
- package/dist/gateway/router.d.ts.map +1 -1
- package/dist/gateway/router.js +96 -42
- package/dist/gateway/router.js.map +1 -1
- package/dist/gateway/service.d.ts.map +1 -1
- package/dist/gateway/service.js +13 -4
- package/dist/gateway/service.js.map +1 -1
- package/dist/gateway/setup.d.ts +5 -0
- package/dist/gateway/setup.d.ts.map +1 -1
- package/dist/gateway/setup.js +98 -42
- package/dist/gateway/setup.js.map +1 -1
- package/dist/gateway/stream.d.ts +6 -5
- package/dist/gateway/stream.d.ts.map +1 -1
- package/dist/gateway/stream.js +24 -11
- package/dist/gateway/stream.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-YXXFCP5J.js} +12 -12
- package/dist/node-runtime/{builtin-extensions-QVCXNQT4.js → builtin-extensions-ZLAX7TUH.js} +3 -3
- package/dist/node-runtime/{chunk-W64JC4E7.js → chunk-2HHLJWGD.js} +3 -87
- package/dist/node-runtime/{chunk-VWCE2HSZ.js → chunk-2HMIRK7W.js} +4 -4
- package/dist/node-runtime/{chunk-XLTL257W.js → chunk-2KIPT4HJ.js} +5 -1
- package/dist/node-runtime/{chunk-RIR5EDDJ.js → chunk-3XPLBUEM.js} +17 -12
- package/dist/node-runtime/{chunk-QAZOULTU.js → chunk-6XL67VVY.js} +40 -6
- package/dist/node-runtime/chunk-7S3T6YEA.js +97 -0
- package/dist/node-runtime/{chunk-R3K2F5GI.js → chunk-B4HP6ZWM.js} +2 -0
- package/dist/node-runtime/{chunk-TQGPP4SC.js → chunk-CDVHZOOK.js} +1 -1
- package/dist/node-runtime/{chunk-YJMMG7C6.js → chunk-DSIKTUPW.js} +1 -1
- package/dist/node-runtime/{chunk-LFZDVKSP.js → chunk-E4D3IGP2.js} +41 -25
- 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-YHQ3NBB3.js → chunk-IJIFHRTB.js} +20 -18
- package/dist/node-runtime/{chunk-GS66LV4M.js → chunk-KJ6DWS3K.js} +4 -4
- package/dist/node-runtime/{chunk-HPUP7E4T.js → chunk-KWIYUUZK.js} +68 -42
- package/dist/node-runtime/{chunk-TVJUOJZJ.js → chunk-LQP3RB67.js} +184 -1527
- 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-GMHJCCEN.js → chunk-NRKGMJYU.js} +4 -1
- package/dist/node-runtime/{chunk-CSUZVNYE.js → chunk-OVX6X377.js} +10 -6
- package/dist/node-runtime/{chunk-DD5YWFSJ.js → chunk-QTU6AKNJ.js} +130 -65
- package/dist/node-runtime/{chunk-LLUIPGDR.js → chunk-RC7DMV45.js} +110 -77
- package/dist/node-runtime/{chunk-UWPJL22I.js → chunk-SLVOAQOY.js} +15 -4
- package/dist/node-runtime/{chunk-EKVFP6YF.js → chunk-TORR5XBV.js} +17 -16
- package/dist/node-runtime/{chunk-UP2XBVH5.js → chunk-UOEDI7RP.js} +1 -1
- package/dist/node-runtime/{chunk-DQMGU675.js → chunk-VQFSUJJG.js} +20 -17
- package/dist/node-runtime/{chunk-X3URCYCU.js → chunk-WF7PGWRZ.js} +14 -14
- package/dist/node-runtime/chunk-YCUZEGJG.js +1361 -0
- 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-6WDOYKS6.js} +5 -5
- package/dist/node-runtime/{commands-KAMO2T6P.js → commands-NZLSOHPE.js} +2 -2
- package/dist/node-runtime/{commands-XDCFGIGW.js → commands-QC6VUZJQ.js} +9 -9
- package/dist/node-runtime/{config-RORQUQFG.js → config-D4QUPAHX.js} +1 -1
- 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-INAYBF4Q.js} +141 -85
- package/dist/node-runtime/index.js +23 -21
- package/dist/node-runtime/{init-X2LIUB2H.js → init-HS6NQXSK.js} +2 -2
- package/dist/node-runtime/{install-cli-3BO4MMQ6.js → install-cli-KL4UDDAD.js} +3 -3
- package/dist/node-runtime/{interactive-mode-4MFRKAHG.js → interactive-mode-Z5M7WYYZ.js} +14 -14
- package/dist/node-runtime/{interactive-view-TUZHCQM3.js → interactive-view-NGFAMHPW.js} +2 -2
- package/dist/node-runtime/{lunr-browser-RYFIIVJN.js → lunr-browser-IR7TL3J7.js} +4 -4
- package/dist/node-runtime/{lunr-cron-YWXEPZMQ.js → lunr-cron-LWIZJM2N.js} +8 -8
- package/dist/node-runtime/main.js +19 -18
- package/dist/node-runtime/{mobile-commands-LVHDAUDP.js → mobile-commands-J7OJEKFO.js} +6 -6
- 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-VYZM5WHN.js} +10 -8
- 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-DNY7EAIG.js} +23 -13
- package/dist/node-runtime/{proxy-modes-OSQCWRBI.js → proxy-modes-LGEUYD7R.js} +3 -3
- package/dist/node-runtime/rpc-entry.js +19 -18
- package/dist/node-runtime/{runtime-bridges-3XUQ46XW.js → runtime-bridges-VRDDR73P.js} +8 -1
- package/dist/node-runtime/{service-ISSP6VHE.js → service-MDQIPQ26.js} +1 -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-J4SPQPDJ.js} +10 -7
- package/dist/node-runtime/setup-CQ2NLVK5.js +214 -0
- package/dist/node-runtime/{subagent-executor-M5VWB3D3.js → subagent-executor-KZZQGAKV.js} +40 -7
- package/dist/node-runtime/{update-cli-UVKJWRRJ.js → update-cli-GTFJC7XK.js} +4 -5
- 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 +19 -18
- 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
- package/dist/node-runtime/setup-5SR2J35A.js +0 -155
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-FQMM2EZ2.js";
|
|
9
9
|
|
|
10
10
|
// packages/coding-agent/dist/core/plan-mode.js
|
|
11
|
-
var
|
|
11
|
+
var READ_ONLY_MODE_ADDENDUM = "You are in read-only mode. Investigate and answer without making changes. If the user asks for a plan, you may call present_plan for approval. Do not implement until the user switches modes or approves that plan.", READ_ONLY_MODE_BLOCK_MESSAGE = "Read-only mode is active; no changes allowed.", BLOCKED_TOOLS = /* @__PURE__ */ new Set(["edit", "write", "memory_add", "memory_remove", "cron"]), ALLOWED_COMMANDS = /* @__PURE__ */ new Set([
|
|
12
12
|
"ls",
|
|
13
13
|
"ll",
|
|
14
14
|
"cat",
|
|
@@ -125,15 +125,15 @@ var PLAN_MODE_ADDENDUM = "You are in plan mode. Investigate read-only, then pres
|
|
|
125
125
|
function isCodeRewriteMutating(input) {
|
|
126
126
|
return input?.dry_run === !1;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function readOnlyModeBlockReason(toolName, input) {
|
|
129
129
|
if (toolName === "browser" && input?.action === "act")
|
|
130
|
-
return `${
|
|
130
|
+
return `${READ_ONLY_MODE_BLOCK_MESSAGE} Browser interactions require a writable mode; observation remains available.`;
|
|
131
131
|
if (BLOCKED_TOOLS.has(toolName) || toolName === "code_rewrite" && isCodeRewriteMutating(input))
|
|
132
|
-
return
|
|
132
|
+
return READ_ONLY_MODE_BLOCK_MESSAGE;
|
|
133
133
|
if (toolName === "bash") {
|
|
134
134
|
let command = readBashCommand(input);
|
|
135
135
|
if (command && isMutatingBashCommand(command))
|
|
136
|
-
return `${
|
|
136
|
+
return `${READ_ONLY_MODE_BLOCK_MESSAGE} Blocked command: ${command}`;
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
function readBashCommand(input) {
|
|
@@ -365,16 +365,16 @@ function effectiveLargeSubagentLaunchCountForTurn(args, assistantMessage) {
|
|
|
365
365
|
}
|
|
366
366
|
|
|
367
367
|
// packages/coding-agent/dist/core/permissions.js
|
|
368
|
-
var PERMISSION_MODES = ["
|
|
368
|
+
var PERMISSION_MODES = ["yolo", "auto", "read-only"];
|
|
369
369
|
function nextPermissionMode(current) {
|
|
370
370
|
let i = PERMISSION_MODES.indexOf(current);
|
|
371
371
|
return PERMISSION_MODES[(i + 1) % PERMISSION_MODES.length];
|
|
372
372
|
}
|
|
373
|
-
function
|
|
374
|
-
return getPermissionMode(sessionId) === "
|
|
373
|
+
function isReadOnlyModeActive(sessionId) {
|
|
374
|
+
return getPermissionMode(sessionId) === "read-only";
|
|
375
375
|
}
|
|
376
376
|
function restorePermissionModeAfterPlan(previous, defaultMode) {
|
|
377
|
-
return previous && previous !== "
|
|
377
|
+
return previous && previous !== "read-only" ? previous : defaultMode;
|
|
378
378
|
}
|
|
379
379
|
var READ_ONLY_TOOLS = /* @__PURE__ */ new Set([
|
|
380
380
|
"read",
|
|
@@ -398,8 +398,15 @@ var READ_ONLY_TOOLS = /* @__PURE__ */ new Set([
|
|
|
398
398
|
"lsp_symbols",
|
|
399
399
|
"lsp_code_actions",
|
|
400
400
|
"lsp_completions",
|
|
401
|
-
"
|
|
402
|
-
|
|
401
|
+
"lsp_rename",
|
|
402
|
+
"memory_load",
|
|
403
|
+
"subagent_wait",
|
|
404
|
+
"subagent_supervisor",
|
|
405
|
+
"intercom",
|
|
406
|
+
"contact_supervisor",
|
|
407
|
+
"present_plan",
|
|
408
|
+
"structured_output"
|
|
409
|
+
]), NO_HANDLER_REASON = "Approval channel unavailable.", LARGE_SUBAGENT_LAUNCH_REJECT_REASON = "Large subagent launch rejected by user.", NO_LARGE_SUBAGENT_LAUNCH_HANDLER_REASON = "Large subagent launch blocked: no approval channel available.", LARGE_SUBAGENT_LAUNCH_ACTION = "large-subagent-launch", contexts = /* @__PURE__ */ new Map(), defaultContext = { mode: "yolo", approvals: /* @__PURE__ */ new Set() }, approvalHandler, turnLargeLaunchDecisions = /* @__PURE__ */ new WeakMap();
|
|
403
410
|
function getContext(sessionId) {
|
|
404
411
|
return sessionId ? contexts.get(sessionId) ?? defaultContext : defaultContext;
|
|
405
412
|
}
|
|
@@ -415,7 +422,7 @@ function getPermissionMode(sessionId) {
|
|
|
415
422
|
function setPermissionMode(mode, sessionId) {
|
|
416
423
|
getContext(sessionId).mode = mode;
|
|
417
424
|
}
|
|
418
|
-
function resetPermissions(defaultMode = "
|
|
425
|
+
function resetPermissions(defaultMode = "yolo", sessionId) {
|
|
419
426
|
sessionId ? contexts.set(sessionId, { mode: defaultMode, approvals: /* @__PURE__ */ new Set() }) : defaultContext = { mode: defaultMode, approvals: /* @__PURE__ */ new Set() };
|
|
420
427
|
}
|
|
421
428
|
function registerApprovalHandler(fn) {
|
|
@@ -439,10 +446,6 @@ async function requestPlanApproval(summary) {
|
|
|
439
446
|
return planApprovalResultText(resp);
|
|
440
447
|
}
|
|
441
448
|
var AUTO_MODE_ADDENDUM = "You are running fully autonomously. Do not ask the user questions or wait for confirmation; make reasonable decisions and complete the task end-to-end.";
|
|
442
|
-
function isPathOutsideCwd(absPath, cwd) {
|
|
443
|
-
let norm = (p) => p.replace(/\\/g, "/").replace(/\/$/, ""), np = norm(absPath), nc = norm(cwd);
|
|
444
|
-
return np === nc ? !1 : !np.startsWith(`${nc}/`);
|
|
445
|
-
}
|
|
446
449
|
function resolvePath(cwd, p) {
|
|
447
450
|
return typeof p != "string" || !p ? "" : resolve(cwd, p);
|
|
448
451
|
}
|
|
@@ -467,9 +470,6 @@ function protectedFileWriteReason(toolName, input, cwd) {
|
|
|
467
470
|
if (normalizedTarget === globalSettings || normalizedTarget === projectSettings)
|
|
468
471
|
return SETTINGS_FILE_DIRECT_WRITE_BLOCK_REASON;
|
|
469
472
|
}
|
|
470
|
-
function isMutatingTool(toolName) {
|
|
471
|
-
return MUTATING_TOOLS.has(toolName);
|
|
472
|
-
}
|
|
473
473
|
function collectRequestedChildLaunches(value, launches) {
|
|
474
474
|
if (!value || typeof value != "object" || Array.isArray(value))
|
|
475
475
|
return;
|
|
@@ -493,9 +493,6 @@ function getRequestedChildLaunches(input) {
|
|
|
493
493
|
let launches = [];
|
|
494
494
|
return collectRequestedChildLaunches(input, launches), launches;
|
|
495
495
|
}
|
|
496
|
-
function requiresManualApproval(toolName, input) {
|
|
497
|
-
return toolName === "browser" ? input.action === "act" : isMutatingTool(toolName) ? !0 : toolName === "subagent" ? getRequestedChildLaunches(input).some((launch) => launch.permissions === "full") : toolName === "code_rewrite" && isCodeRewriteMutating(input);
|
|
498
|
-
}
|
|
499
496
|
function firstTaskText(value) {
|
|
500
497
|
return typeof value == "string" && value.trim() ? sanitizeDetail(value) : "";
|
|
501
498
|
}
|
|
@@ -522,16 +519,14 @@ async function gateLargeSubagentLaunch(input, ctx, options) {
|
|
|
522
519
|
if (ctx.mode === "auto" || options?.confirmLargeSubagentLaunches === !1)
|
|
523
520
|
return;
|
|
524
521
|
let count = effectiveLargeSubagentLaunchCountForTurn(input, options?.assistantMessage);
|
|
525
|
-
if (count <= 2)
|
|
522
|
+
if (count <= 2 || ctx.approvals.has(LARGE_SUBAGENT_LAUNCH_ACTION))
|
|
526
523
|
return;
|
|
527
|
-
if (ctx.approvals.has(LARGE_SUBAGENT_LAUNCH_ACTION))
|
|
528
|
-
return { fullChildrenApproved: !1 };
|
|
529
524
|
let turnKey = options?.assistantMessage, cached = turnKey ? turnLargeLaunchDecisions.get(turnKey) : void 0;
|
|
530
525
|
if (cached)
|
|
531
526
|
return cached.decision === "reject" ? {
|
|
532
527
|
block: !0,
|
|
533
528
|
reason: cached.feedback ? `${LARGE_SUBAGENT_LAUNCH_REJECT_REASON} ${cached.feedback}` : LARGE_SUBAGENT_LAUNCH_REJECT_REASON
|
|
534
|
-
} :
|
|
529
|
+
} : void 0;
|
|
535
530
|
if (!approvalHandler)
|
|
536
531
|
return { block: !0, reason: NO_LARGE_SUBAGENT_LAUNCH_HANDLER_REASON };
|
|
537
532
|
let summary = largeLaunchTaskSummary(input, options?.assistantMessage), siblingLaunches = (options?.assistantMessage?.content ?? []).flatMap((block) => {
|
|
@@ -539,7 +534,7 @@ async function gateLargeSubagentLaunch(input, ctx, options) {
|
|
|
539
534
|
return [];
|
|
540
535
|
let args = block.arguments && typeof block.arguments == "object" && !Array.isArray(block.arguments) ? block.arguments : void 0;
|
|
541
536
|
return args ? getRequestedChildLaunches(args) : [];
|
|
542
|
-
}),
|
|
537
|
+
}), launchSummary = (siblingLaunches.length > 0 ? siblingLaunches : getRequestedChildLaunches(input)).map((launch) => `${launch.description}
|
|
543
538
|
permissions: ${launch.permissions}`).join(`
|
|
544
539
|
`), resp;
|
|
545
540
|
try {
|
|
@@ -554,10 +549,15 @@ ${launchSummary || summary}` : ""}`,
|
|
|
554
549
|
return { block: !0, reason: err instanceof Error ? err.message : NO_LARGE_SUBAGENT_LAUNCH_HANDLER_REASON };
|
|
555
550
|
}
|
|
556
551
|
let rawDecision = typeof resp == "string" ? resp : resp.decision, decision = rawDecision === "approve" ? "once" : rawDecision, feedback = typeof resp == "string" ? void 0 : resp.feedback?.trim();
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
}
|
|
552
|
+
if (turnKey && turnLargeLaunchDecisions.set(turnKey, { decision, ...feedback ? { feedback } : {} }), decision === "session") {
|
|
553
|
+
ctx.approvals.add(LARGE_SUBAGENT_LAUNCH_ACTION);
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
if (decision === "reject")
|
|
557
|
+
return {
|
|
558
|
+
block: !0,
|
|
559
|
+
reason: feedback ? `${LARGE_SUBAGENT_LAUNCH_REJECT_REASON} ${feedback}` : LARGE_SUBAGENT_LAUNCH_REJECT_REASON
|
|
560
|
+
};
|
|
561
561
|
}
|
|
562
562
|
function sanitizeDetail(value) {
|
|
563
563
|
let text = String(value ?? "").trim();
|
|
@@ -567,66 +567,35 @@ async function gateToolCall(toolName, input, cwd, sessionId, options) {
|
|
|
567
567
|
let ctx = getContext(sessionId), protectedWriteReason = protectedFileWriteReason(toolName, input, cwd);
|
|
568
568
|
if (protectedWriteReason)
|
|
569
569
|
return { block: !0, reason: protectedWriteReason };
|
|
570
|
-
if (READ_ONLY_TOOLS.has(toolName))
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
} else if (toolName === "memory_add")
|
|
592
|
-
action = toolName, detail = sanitizeDetail(input.content);
|
|
593
|
-
else if (toolName === "memory_remove")
|
|
594
|
-
action = toolName, detail = sanitizeDetail(input.line);
|
|
595
|
-
else if (toolName === "cron")
|
|
596
|
-
action = "cron", detail = sanitizeDetail(input.action);
|
|
597
|
-
else if (toolName === "subagent") {
|
|
598
|
-
action = FULL_CHILD_ACTION;
|
|
599
|
-
let launches = getRequestedChildLaunches(input).filter((launch) => launch.permissions === "full");
|
|
600
|
-
detail = sanitizeDetail(launches.map((launch) => `${launch.description}
|
|
601
|
-
permissions: ${launch.permissions}`).join(`
|
|
602
|
-
`));
|
|
603
|
-
} else toolName === "browser" ? (action = "browser", detail = sanitizeDetail(`${input.interaction ?? ""} ${input.role ?? ""} ${input.name ?? input.label ?? ""}. Website effects cannot be undone.`)) : toolName === "code_rewrite" ? (action = "code_rewrite", detail = sanitizeDetail(input.path ?? input.pattern)) : (action = toolName, detail = "");
|
|
604
|
-
if (ctx.approvals.has(action))
|
|
605
|
-
return;
|
|
606
|
-
if (!approvalHandler)
|
|
607
|
-
return { block: !0, reason: NO_HANDLER_REASON };
|
|
608
|
-
let resp;
|
|
609
|
-
try {
|
|
610
|
-
resp = await approvalHandler({ toolName, action, detail });
|
|
611
|
-
} catch (err) {
|
|
612
|
-
return { block: !0, reason: err instanceof Error ? err.message : NO_HANDLER_REASON };
|
|
613
|
-
}
|
|
614
|
-
let decision = typeof resp == "string" ? resp : resp.decision;
|
|
615
|
-
if (decision === "session") {
|
|
616
|
-
ctx.approvals.add(action);
|
|
617
|
-
return;
|
|
618
|
-
}
|
|
619
|
-
if (decision === "reject") {
|
|
620
|
-
let feedback = typeof resp == "string" ? void 0 : resp.feedback?.trim();
|
|
621
|
-
return { block: !0, reason: feedback ? `${REJECT_REASON} ${feedback}` : REJECT_REASON };
|
|
570
|
+
if (!READ_ONLY_TOOLS.has(toolName)) {
|
|
571
|
+
if (ctx.mode === "read-only") {
|
|
572
|
+
let reason = readOnlyModeBlockReason(toolName, input);
|
|
573
|
+
if (reason)
|
|
574
|
+
return { block: !0, reason };
|
|
575
|
+
if (toolName === "mcp")
|
|
576
|
+
return input.tool || input.connect || input.action && input.action !== "ui-messages" ? { block: !0, reason: "Read-only mode blocks MCP tool calls, connections, and authentication." } : void 0;
|
|
577
|
+
if (toolName === "subagent") {
|
|
578
|
+
let action = input.action;
|
|
579
|
+
return getRequestedChildLaunches(input).some((child) => child.permissions === "full") || action === "resume" || action === "steer" || action === "append-step" || action === "schedule" || action === "schedule-cancel" ? {
|
|
580
|
+
block: !0,
|
|
581
|
+
reason: "Read-only mode cannot launch full-access children or change running children."
|
|
582
|
+
} : void 0;
|
|
583
|
+
}
|
|
584
|
+
return toolName === "bash" || toolName === "browser" || toolName === "code_rewrite" ? void 0 : { block: !0, reason: `Read-only mode cannot verify that ${toolName} is safe.` };
|
|
585
|
+
}
|
|
586
|
+
if (toolName === "subagent") {
|
|
587
|
+
let launchResult = await gateLargeSubagentLaunch(input, ctx, options);
|
|
588
|
+
if (launchResult)
|
|
589
|
+
return launchResult;
|
|
590
|
+
}
|
|
622
591
|
}
|
|
623
592
|
}
|
|
624
593
|
|
|
625
594
|
export {
|
|
626
|
-
|
|
595
|
+
READ_ONLY_MODE_ADDENDUM,
|
|
627
596
|
PERMISSION_MODES,
|
|
628
597
|
nextPermissionMode,
|
|
629
|
-
|
|
598
|
+
isReadOnlyModeActive,
|
|
630
599
|
restorePermissionModeAfterPlan,
|
|
631
600
|
NO_HANDLER_REASON,
|
|
632
601
|
createPermissionContext,
|
|
@@ -57,7 +57,7 @@ var args = process.argv.slice(2), startupBenchmark = process.env.PI_STARTUP_BENC
|
|
|
57
57
|
markStartupMilestone("mode_routed");
|
|
58
58
|
var startupView;
|
|
59
59
|
if (preloadMode === "interactive") {
|
|
60
|
-
let { InteractiveView } = await import("./interactive-view-
|
|
60
|
+
let { InteractiveView } = await import("./interactive-view-NGFAMHPW.js");
|
|
61
61
|
startupView = new InteractiveView(), startupView.start(), await startupView.waitForFirstFrame(), startupView.isExitRequested && process.exit(0);
|
|
62
62
|
}
|
|
63
63
|
var startRuntime = async () => {
|
|
@@ -8,11 +8,11 @@ async function handleGatewayCommand(args) {
|
|
|
8
8
|
try {
|
|
9
9
|
let sub = args[1];
|
|
10
10
|
if (sub === "setup")
|
|
11
|
-
await (await import("./setup-
|
|
11
|
+
await (await import("./setup-CQ2NLVK5.js")).setupGateway();
|
|
12
12
|
else if (sub === "pair" && args[2] === "approve" && args.includes("--owner"))
|
|
13
|
-
console.log((await import("./setup-
|
|
13
|
+
console.log((await import("./setup-CQ2NLVK5.js")).approveGatewayOwner(args[3], args[4]));
|
|
14
14
|
else if (["start", "stop", "restart", "status", "logs", "doctor", "autostart"].includes(sub)) {
|
|
15
|
-
let service = await import("./service-
|
|
15
|
+
let service = await import("./service-MDQIPQ26.js");
|
|
16
16
|
if (sub === "start" && console.log(await service.startGatewayService()), sub === "stop" && console.log(await service.stopGatewayService()), sub === "restart" && (await service.stopGatewayService(), console.log(await service.startGatewayService())), (sub === "status" || sub === "doctor") && console.log(service.serviceStatusText()), sub === "logs" && console.log(service.readGatewayLog()), sub === "autostart") {
|
|
17
17
|
let mode = args[2];
|
|
18
18
|
if (mode !== "off" && mode !== "login" && mode !== "boot")
|
|
@@ -20,7 +20,7 @@ async function handleGatewayCommand(args) {
|
|
|
20
20
|
await service.configureStartup(mode), console.log(`Automatic startup: ${mode}`);
|
|
21
21
|
}
|
|
22
22
|
if (sub === "doctor") {
|
|
23
|
-
let { loadGatewayConfig, resolvePlatformToken } = await import("./config-
|
|
23
|
+
let { loadGatewayConfig, resolvePlatformToken } = await import("./config-D4QUPAHX.js"), cfg = loadGatewayConfig();
|
|
24
24
|
for (let platform of ["telegram", "discord"])
|
|
25
25
|
console.log(`${platform}: ${cfg[platform].enabled ? "enabled" : "disabled"}, token ${resolvePlatformToken(platform, cfg[platform]) ? "configured" : "missing"}, owners ${cfg.owners?.[platform].length ?? 0}`);
|
|
26
26
|
console.log(`Project roots: ${cfg.projectRoots?.length ?? 0}. Run lunr gateway setup to change these.
|
|
@@ -32,7 +32,7 @@ lunr gateway autostart off|login|boot
|
|
|
32
32
|
lunr gateway pair approve <platform> <code> [--owner]
|
|
33
33
|
lunr gateway pair list`);
|
|
34
34
|
else {
|
|
35
|
-
let { runGateway } = await import("./gateway-
|
|
35
|
+
let { runGateway } = await import("./gateway-INAYBF4Q.js");
|
|
36
36
|
process.exitCode = await runGateway(sub === "run" ? args.slice(2) : args.slice(1));
|
|
37
37
|
}
|
|
38
38
|
} catch (error) {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
lazyConnect,
|
|
6
6
|
updateMetadataCache,
|
|
7
7
|
updateStatusBar
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DSIKTUPW.js";
|
|
9
9
|
import {
|
|
10
10
|
authenticate,
|
|
11
11
|
getAuthForUrl,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
writeDirectToolsConfig,
|
|
25
25
|
writeSharedServerEntry,
|
|
26
26
|
writeStarterProjectConfig
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-LWYIVUGV.js";
|
|
28
28
|
import {
|
|
29
29
|
getAgentPath
|
|
30
30
|
} from "./chunk-4HXHDDCF.js";
|
|
@@ -5,23 +5,23 @@ import {
|
|
|
5
5
|
formatHelpText,
|
|
6
6
|
runChatCommand,
|
|
7
7
|
sendCommandReply
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-E4D3IGP2.js";
|
|
9
|
+
import "./chunk-TORR5XBV.js";
|
|
10
|
+
import "./chunk-QTU6AKNJ.js";
|
|
11
11
|
import "./chunk-RMQZU2YU.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-SLVOAQOY.js";
|
|
13
|
+
import "./chunk-CDVHZOOK.js";
|
|
14
|
+
import "./chunk-GYIXXQAO.js";
|
|
15
15
|
import "./chunk-GJ2RDBRL.js";
|
|
16
16
|
import "./chunk-CGBXPL3E.js";
|
|
17
17
|
import "./chunk-BBUVIEZB.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-ZXSGTGJ6.js";
|
|
19
19
|
import "./chunk-M3LZLQW2.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-2KIPT4HJ.js";
|
|
21
21
|
import "./chunk-FVDOXRUD.js";
|
|
22
22
|
import "./chunk-IMLCWLPI.js";
|
|
23
23
|
import "./chunk-UAEOTO52.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-B4HP6ZWM.js";
|
|
25
25
|
import "./chunk-E24EO34J.js";
|
|
26
26
|
import "./chunk-RDDAZOMU.js";
|
|
27
27
|
import "./chunk-FQMM2EZ2.js";
|
package/dist/node-runtime/{direct-tool-executor-YAVOLDFY.js → direct-tool-executor-77GW4F5P.js}
RENAMED
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
resolveMcpOutputGuardOptions,
|
|
7
7
|
resolveMcpResultContent,
|
|
8
8
|
transformMcpContent
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HFVZUPFJ.js";
|
|
10
10
|
import {
|
|
11
11
|
formatSchema,
|
|
12
12
|
getFailureAgeSeconds,
|
|
13
13
|
lazyConnect
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-DSIKTUPW.js";
|
|
15
15
|
import {
|
|
16
16
|
UrlElicitationRequiredError,
|
|
17
17
|
authenticate,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
abortable,
|
|
22
22
|
formatAuthRequiredMessage,
|
|
23
23
|
throwIfAborted
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-LWYIVUGV.js";
|
|
25
25
|
import "./chunk-4HXHDDCF.js";
|
|
26
26
|
import "./chunk-ARC4KOTI.js";
|
|
27
27
|
import "./chunk-BI3DHYCN.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
SessionManager
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2KIPT4HJ.js";
|
|
5
5
|
import "./chunk-FVDOXRUD.js";
|
|
6
6
|
import "./chunk-UAEOTO52.js";
|
|
7
7
|
import {
|