@ashx-j/lunr-dev 0.2.16-dev.9.1 → 0.2.19-dev.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -1
- package/README.md +7 -1
- package/dist/builtin-extensions/ashxj-thinking.d.ts +1 -0
- package/dist/builtin-extensions/ashxj-thinking.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-thinking.js +44 -19
- package/dist/builtin-extensions/ashxj-thinking.js.map +1 -1
- package/dist/builtin-extensions/index.d.ts.map +1 -1
- package/dist/builtin-extensions/index.js +1 -0
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/lunr-computer-use.d.ts +3 -0
- package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-computer-use.js +157 -0
- package/dist/builtin-extensions/lunr-computer-use.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js +10 -3
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts +5 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js +26 -4
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.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 +37 -27
- package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts +6 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js +33 -8
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.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 +52 -23
- 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 +6 -2
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts +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 +5 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts +10 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js +38 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js.map +1 -0
- 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 +3 -16
- 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 +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +70 -30
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.js +103 -102
- package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +1 -1
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/computer-use/adapter.d.ts +23 -0
- package/dist/core/computer-use/adapter.d.ts.map +1 -0
- package/dist/core/computer-use/adapter.js +116 -0
- package/dist/core/computer-use/adapter.js.map +1 -0
- package/dist/core/computer-use/lease.d.ts +18 -0
- package/dist/core/computer-use/lease.d.ts.map +1 -0
- package/dist/core/computer-use/lease.js +129 -0
- package/dist/core/computer-use/lease.js.map +1 -0
- package/dist/core/computer-use/macos-runtime.d.ts +14 -0
- package/dist/core/computer-use/macos-runtime.d.ts.map +1 -0
- package/dist/core/computer-use/macos-runtime.js +148 -0
- package/dist/core/computer-use/macos-runtime.js.map +1 -0
- package/dist/core/computer-use/policy.d.ts +19 -0
- package/dist/core/computer-use/policy.d.ts.map +1 -0
- package/dist/core/computer-use/policy.js +66 -0
- package/dist/core/computer-use/policy.js.map +1 -0
- package/dist/core/computer-use/release.generated.d.ts +31 -0
- package/dist/core/computer-use/release.generated.d.ts.map +1 -0
- package/dist/core/computer-use/release.generated.js +36 -0
- package/dist/core/computer-use/release.generated.js.map +1 -0
- package/dist/core/computer-use/runtime.d.ts +13 -0
- package/dist/core/computer-use/runtime.d.ts.map +1 -0
- package/dist/core/computer-use/runtime.js +158 -0
- package/dist/core/computer-use/runtime.js.map +1 -0
- package/dist/core/computer-use/schemas.d.ts +88 -0
- package/dist/core/computer-use/schemas.d.ts.map +1 -0
- package/dist/core/computer-use/schemas.js +80 -0
- package/dist/core/computer-use/schemas.js.map +1 -0
- package/dist/core/computer-use/windows-desktop.d.ts +3 -0
- package/dist/core/computer-use/windows-desktop.d.ts.map +1 -0
- package/dist/core/computer-use/windows-desktop.js +48 -0
- package/dist/core/computer-use/windows-desktop.js.map +1 -0
- package/dist/core/computer-use/workflow.d.ts +24 -0
- package/dist/core/computer-use/workflow.d.ts.map +1 -0
- package/dist/core/computer-use/workflow.js +330 -0
- package/dist/core/computer-use/workflow.js.map +1 -0
- package/dist/core/keybindings.d.ts +2 -2
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +2 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-runtime.d.ts +0 -3
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +1 -10
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +1 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/permissions.d.ts +1 -1
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +23 -7
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +9 -0
- package/dist/core/plan-mode.js.map +1 -1
- package/dist/core/rollback.d.ts.map +1 -1
- package/dist/core/rollback.js +13 -90
- package/dist/core/rollback.js.map +1 -1
- package/dist/core/session-manager.d.ts +0 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +21 -79
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +6 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +19 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/dev-cli.js +0 -0
- package/dist/gateway/agent-bridge.d.ts +6 -1
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +23 -6
- package/dist/gateway/agent-bridge.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 +23 -7
- package/dist/gateway/cron.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +4 -2
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +23 -32
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/processes-selector.d.ts +2 -3
- package/dist/modes/interactive/components/processes-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/processes-selector.js +5 -10
- package/dist/modes/interactive/components/processes-selector.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 +20 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +18 -8
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/thinking-level-slash.d.ts +4 -0
- package/dist/modes/interactive/thinking-level-slash.d.ts.map +1 -0
- package/dist/modes/interactive/thinking-level-slash.js +23 -0
- package/dist/modes/interactive/thinking-level-slash.js.map +1 -0
- package/dist/node-runtime/adapter-AZMY335J.js +279 -0
- package/dist/node-runtime/{agent-session-services-IFJMSX7Z.js → agent-session-services-RSGP5GDN.js} +15 -12
- package/dist/node-runtime/{builtin-extensions-LYZ3BFWQ.js → builtin-extensions-7STLFW3A.js} +4 -3
- package/dist/node-runtime/chunk-2IDTZAG5.js +1415 -0
- package/dist/node-runtime/{chunk-7NBZ5P7I.js → chunk-4SJWFTUP.js} +1 -1
- package/dist/node-runtime/{chunk-AJX357CL.js → chunk-5NWQCSKR.js} +20 -1013
- package/dist/node-runtime/chunk-5OLJGVCB.js +68 -0
- package/dist/node-runtime/chunk-5Q45AVQG.js +108 -0
- package/dist/node-runtime/{chunk-TQNSPERU.js → chunk-5SQDLSZJ.js} +1 -1
- package/dist/node-runtime/{chunk-F4VQFJI2.js → chunk-6SPPH4FY.js} +4 -4
- package/dist/node-runtime/{chunk-PBC2Y6GS.js → chunk-6UB6NKA3.js} +29 -72
- package/dist/node-runtime/{chunk-A2KQXUJD.js → chunk-7AFOFSDY.js} +1 -1
- package/dist/node-runtime/chunk-BKAZ6BKX.js +2185 -0
- package/dist/node-runtime/{chunk-AHSTJBIB.js → chunk-EH2LJQPM.js} +4 -4
- package/dist/node-runtime/{chunk-N77MY65L.js → chunk-FLYMHKCS.js} +25 -25
- package/dist/node-runtime/{chunk-5P7PZMRU.js → chunk-HRS4HMDX.js} +1 -1
- package/dist/node-runtime/{chunk-IPA627GP.js → chunk-ISQDQIZN.js} +4 -4
- package/dist/node-runtime/{chunk-WJVFOIB5.js → chunk-J7QGQD45.js} +1 -1
- package/dist/node-runtime/{chunk-WOVTOV5P.js → chunk-JT6YCS5B.js} +29 -34
- package/dist/node-runtime/chunk-JZHEUQRL.js +180 -0
- package/dist/node-runtime/{chunk-ZKMFUD3Q.js → chunk-K72NVGUB.js} +3 -3
- package/dist/node-runtime/{chunk-ECD5L7YI.js → chunk-LCACDWHJ.js} +389 -15
- package/dist/node-runtime/{chunk-2QKLKMKC.js → chunk-LTXUQJI4.js} +1 -1
- package/dist/node-runtime/{chunk-MKKH27PH.js → chunk-LWJXTA6Z.js} +274 -2416
- package/dist/node-runtime/{chunk-EDBJNRSM.js → chunk-MGSB2C3M.js} +1 -1
- package/dist/node-runtime/{chunk-CDFZEWPU.js → chunk-MUMMMTW4.js} +6 -2
- package/dist/node-runtime/{chunk-YF63P5ZT.js → chunk-OTT6JMPU.js} +10 -67
- package/dist/node-runtime/{chunk-PGAJ5MO5.js → chunk-T5GM5BFH.js} +1 -1
- package/dist/node-runtime/{chunk-PCGNAY2O.js → chunk-TAP7QTUT.js} +38 -16
- package/dist/node-runtime/{chunk-4TLO4PO2.js → chunk-U6C7VTR5.js} +7 -1401
- package/dist/node-runtime/chunk-URD2SLIT.js +1019 -0
- package/dist/node-runtime/{chunk-QH42CDX3.js → chunk-W7S2REEG.js} +111 -84
- package/dist/node-runtime/{chunk-LZAW4ZX3.js → chunk-ZRDIMBEQ.js} +27 -9
- package/dist/node-runtime/{chunk-AD6VXAO7.js → chunk-ZSEZY3II.js} +5 -100
- package/dist/node-runtime/cli-runtime.js +1 -1
- package/dist/node-runtime/{command-L3LAHDIH.js → command-6UXQ6XZN.js} +1 -1
- package/dist/node-runtime/{commands-RL5YBW5I.js → commands-LGR5VT5X.js} +6 -4
- package/dist/node-runtime/{direct-tool-executor-JVDXTO7A.js → direct-tool-executor-TDJS7TBD.js} +9 -6
- package/dist/node-runtime/{export-html-KR26FOUZ.js → export-html-E4DT6ZJQ.js} +1 -1
- package/dist/node-runtime/{extract-XLQSJN4V.js → extract-IUCVZCWC.js} +2 -2
- package/dist/node-runtime/{gateway-X2TI5X7F.js → gateway-3OLC4GQN.js} +22 -367
- package/dist/node-runtime/{gemini-search-U7SUMPQA.js → gemini-search-NCIDF7NE.js} +1 -1
- package/dist/node-runtime/{gemini-url-context-PXWCBQHK.js → gemini-url-context-OKIN7AIP.js} +2 -2
- package/dist/node-runtime/image-resize-6ZPBFMWW.js +11 -0
- package/dist/node-runtime/index.js +53 -49
- package/dist/node-runtime/{init-NJV2T55N.js → init-EKE277AG.js} +6 -4
- package/dist/node-runtime/{interactive-mode-KOM35YF2.js → interactive-mode-S5M26CQ7.js} +20 -17
- package/dist/node-runtime/{interactive-view-U6OILKF3.js → interactive-view-N6F4KUIT.js} +3 -5
- package/dist/node-runtime/lunr-computer-use-4X3KUNF4.js +206 -0
- package/dist/node-runtime/{lunr-cron-YJ5UHYRD.js → lunr-cron-KKBOGAEF.js} +7 -1
- package/dist/node-runtime/main.js +24 -21
- package/dist/node-runtime/{mcp-auth-flow-QIXHW6QN.js → mcp-auth-flow-YL6RWPYG.js} +2 -1
- package/dist/node-runtime/{package-manager-cli-TZZHJCVI.js → package-manager-cli-C4EJOO5Q.js} +8 -6
- package/dist/node-runtime/{pi-mcp-adapter-QFB37AVN.js → pi-mcp-adapter-DPTJGAAL.js} +33 -27
- package/dist/node-runtime/{pi-subagents-7XJ4H53P.js → pi-subagents-VKCLYIBY.js} +103 -76
- package/dist/node-runtime/{pi-web-access-DPGAVKOA.js → pi-web-access-BV6DSZOP.js} +72 -69
- package/dist/node-runtime/{proxy-modes-HEEFK4KC.js → proxy-modes-R64LU6WZ.js} +12 -9
- package/dist/node-runtime/rpc-entry.js +24 -21
- package/dist/node-runtime/runtime-3SB5ATHQ.js +21 -0
- package/dist/node-runtime/{runtime-bridges-PPHNBFWL.js → runtime-bridges-UJ5WJJLN.js} +3 -3
- package/dist/node-runtime/{session-manager-MQNBYACL.js → session-manager-QEMZBMTM.js} +3 -5
- package/dist/node-runtime/{session-selector-5AZLJS6U.js → session-selector-URVJLOTK.js} +2 -2
- package/dist/node-runtime/{settings-manager-5LF2VQWC.js → settings-manager-K6IPIQTI.js} +3 -1
- package/dist/node-runtime/{src-Y7JSCK64.js → src-GPFAU3N6.js} +30 -10
- package/dist/node-runtime/{subagent-executor-5RNDEPIJ.js → subagent-executor-EFLTO32A.js} +39 -21
- package/dist/node-runtime/{update-cli-A253SZ7P.js → update-cli-I6OVDRPL.js} +3 -1
- package/dist/node-runtime/{video-extract-OYT5WKS5.js → video-extract-ETA5RA7U.js} +2 -2
- package/dist/node-runtime/workflow-SA34S4VX.js +325 -0
- package/dist/node-runtime/{youtube-extract-TQYKGFGS.js → youtube-extract-SRVGNN26.js} +2 -2
- package/dist/rpc.d.ts +3 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +18 -0
- package/dist/rpc.js.map +1 -0
- package/dist/startup/interactive-view.d.ts.map +1 -1
- package/dist/startup/interactive-view.js +1 -2
- package/dist/startup/interactive-view.js.map +1 -1
- package/docs/computer-use.md +277 -0
- package/docs/development.md +0 -32
- package/docs/features.md +2 -2
- package/docs/interactive-startup.md +10 -3
- package/docs/keybindings.md +2 -2
- package/docs/terminal-setup.md +1 -1
- package/docs/usage.md +1 -1
- 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/hidden-thinking-label.ts +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/install-lock/package-lock.json +3827 -0
- package/install-lock/package.json +18 -0
- package/native/computer-use/LICENSE.md +21 -0
- package/npm-shrinkwrap.json +3808 -0
- package/package.json +16 -10
- package/dist/startup/interactive-shell.d.ts +0 -55
- package/dist/startup/interactive-shell.d.ts.map +0 -1
- package/dist/startup/interactive-shell.js +0 -264
- package/dist/startup/interactive-shell.js.map +0 -1
- package/dist/node-runtime/{chunk-YSKSB3BJ.js → chunk-CH6OL6P2.js} +2 -2
- package/dist/node-runtime/{chunk-VSELYKWU.js → chunk-EHMBW7FA.js} +3 -3
|
@@ -2,7 +2,7 @@ import { createRequire as __lunrRequire } from "node:module"; const require = __
|
|
|
2
2
|
import {
|
|
3
3
|
getPermissionMode,
|
|
4
4
|
resetPermissions
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZRDIMBEQ.js";
|
|
6
6
|
|
|
7
7
|
// packages/coding-agent/dist/core/subagent-permission-inherit.js
|
|
8
8
|
var SUBAGENT_CHILD_ENV = "PI_SUBAGENT_CHILD", SUBAGENT_CHILD_PERMISSION_ENV = "PI_SUBAGENT_CHILD_PERMISSION";
|
|
@@ -2,10 +2,13 @@ import { createRequire as __lunrRequire } from "node:module"; const require = __
|
|
|
2
2
|
import {
|
|
3
3
|
PLAN_MODE_WRITE_SPAWN_ERROR,
|
|
4
4
|
resolveChildPermissions
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MGSB2C3M.js";
|
|
6
6
|
import {
|
|
7
7
|
createReadOnlyTools
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-K72NVGUB.js";
|
|
9
|
+
import {
|
|
10
|
+
COMPUTER_TOOLS
|
|
11
|
+
} from "./chunk-5OLJGVCB.js";
|
|
9
12
|
import {
|
|
10
13
|
convertToLlm
|
|
11
14
|
} from "./chunk-FVDOXRUD.js";
|
|
@@ -2193,6 +2196,7 @@ function formatModelAttemptNote(attempt, nextModel) {
|
|
|
2193
2196
|
|
|
2194
2197
|
// packages/coding-agent/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js
|
|
2195
2198
|
var PARENT_OWNED_CHILD_TOOLS = [
|
|
2199
|
+
...COMPUTER_TOOLS,
|
|
2196
2200
|
"cron",
|
|
2197
2201
|
"memory_add",
|
|
2198
2202
|
"memory_remove",
|
|
@@ -437,10 +437,10 @@ function getUsageServiceBridge() {
|
|
|
437
437
|
|
|
438
438
|
// packages/coding-agent/dist/core/rollback.js
|
|
439
439
|
import { spawnSync } from "node:child_process";
|
|
440
|
-
import { createHash
|
|
441
|
-
import {
|
|
440
|
+
import { createHash } from "node:crypto";
|
|
441
|
+
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
442
442
|
import { homedir } from "node:os";
|
|
443
|
-
import { dirname, join, normalize,
|
|
443
|
+
import { dirname, join, normalize, resolve } from "node:path";
|
|
444
444
|
var ROLLBACK_BASE = join(homedir(), ".lunr", "rollback"), contexts = /* @__PURE__ */ new Map(), lastSessionId, globalSettingsManager, warningHandler;
|
|
445
445
|
function setRollbackWarningHandler(handler) {
|
|
446
446
|
warningHandler = handler;
|
|
@@ -682,62 +682,15 @@ function isPathUnderRoot(absPath, root) {
|
|
|
682
682
|
let normRoot = normalize(root).replace(/\\$/g, ""), normPath = normalize(absPath).replace(/\\$/g, "");
|
|
683
683
|
return process.platform === "win32" && (normRoot = normRoot.toLowerCase(), normPath = normPath.toLowerCase()), normPath === normRoot || normPath.startsWith(`${normRoot}/`) || normPath.startsWith(`${normRoot}\\`);
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function isWithinAllowedRoots(absPath, turn) {
|
|
686
686
|
return turn.cwd ? [
|
|
687
687
|
ROLLBACK_BASE,
|
|
688
688
|
join(homedir(), CONFIG_DIR_NAME),
|
|
689
|
+
// lunr: agent settings / cron jobs.json live under the config dir
|
|
690
|
+
// lunr: simple-memory lives next to the lunr agent dir (~/.lunr/simple-memory)
|
|
689
691
|
join(dirname(getAgentDir()), "simple-memory"),
|
|
690
692
|
resolve(turn.cwd)
|
|
691
|
-
] :
|
|
692
|
-
}
|
|
693
|
-
function findAllowedRoot(absPath, turn) {
|
|
694
|
-
return getAllowedRoots(turn).filter((root) => isPathUnderRoot(absPath, root)).sort((a, b) => b.length - a.length)[0];
|
|
695
|
-
}
|
|
696
|
-
function lstatIfPresent(path) {
|
|
697
|
-
try {
|
|
698
|
-
return lstatSync(path);
|
|
699
|
-
} catch (error) {
|
|
700
|
-
if (error.code === "ENOENT")
|
|
701
|
-
return;
|
|
702
|
-
throw error;
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
function safeRestoreParent(absPath, turn) {
|
|
706
|
-
let allowedRoot = findAllowedRoot(absPath, turn);
|
|
707
|
-
if (turn.cwd && !allowedRoot || lstatIfPresent(absPath)?.isSymbolicLink())
|
|
708
|
-
return;
|
|
709
|
-
if (!allowedRoot)
|
|
710
|
-
return dirname(absPath);
|
|
711
|
-
let rootEntry = lstatIfPresent(allowedRoot);
|
|
712
|
-
if (!rootEntry || !rootEntry.isDirectory() || rootEntry.isSymbolicLink())
|
|
713
|
-
return;
|
|
714
|
-
let parent = dirname(absPath), relativeParent = relative(allowedRoot, parent);
|
|
715
|
-
if (relativeParent.startsWith("..") || !isPathUnderRoot(parent, allowedRoot))
|
|
716
|
-
return;
|
|
717
|
-
let current = allowedRoot;
|
|
718
|
-
for (let segment of relativeParent.split(/[\\/]/).filter(Boolean)) {
|
|
719
|
-
current = join(current, segment);
|
|
720
|
-
let entry = lstatIfPresent(current);
|
|
721
|
-
if (entry) {
|
|
722
|
-
if (entry.isSymbolicLink() || !entry.isDirectory())
|
|
723
|
-
return;
|
|
724
|
-
} else
|
|
725
|
-
mkdirSync(current);
|
|
726
|
-
}
|
|
727
|
-
let realRoot = realpathSync.native(allowedRoot), realParent = realpathSync.native(parent);
|
|
728
|
-
if (isPathUnderRoot(realParent, realRoot) && !lstatIfPresent(absPath)?.isSymbolicLink())
|
|
729
|
-
return parent;
|
|
730
|
-
}
|
|
731
|
-
function restoreFileAtomically(absPath, content, turn) {
|
|
732
|
-
let parent = safeRestoreParent(absPath, turn);
|
|
733
|
-
if (!parent)
|
|
734
|
-
return !1;
|
|
735
|
-
let tempPath = join(parent, `.lunr-rollback-${randomUUID()}.tmp`), fd;
|
|
736
|
-
try {
|
|
737
|
-
return fd = openSync(tempPath, "wx", 384), writeFileSync(fd, content), fsyncSync(fd), closeSync(fd), fd = void 0, safeRestoreParent(absPath, turn) ? (renameSync(tempPath, absPath), !0) : !1;
|
|
738
|
-
} finally {
|
|
739
|
-
fd !== void 0 && closeSync(fd), rmSync(tempPath, { force: !0 });
|
|
740
|
-
}
|
|
693
|
+
].some((root) => isPathUnderRoot(absPath, root)) : !0;
|
|
741
694
|
}
|
|
742
695
|
function warnExternalModification(ctx, message) {
|
|
743
696
|
if (!(ctx.externalModWarningShown || !warningHandler)) {
|
|
@@ -772,25 +725,15 @@ function rollbackLastTurn(sessionId) {
|
|
|
772
725
|
let turn = ctx.turns[ctx.turns.length - 1], capture = ctx.settingsManager?.getRollbackCapture() ?? "copies", restored = [], deleted = [];
|
|
773
726
|
for (let [absPath, snap] of turn.files)
|
|
774
727
|
try {
|
|
775
|
-
if (
|
|
728
|
+
if (!isWithinAllowedRoots(absPath, turn)) {
|
|
776
729
|
warnExternalModification(ctx, `Rollback skipped ${absPath}: outside the session working directory or lunR config dir.`);
|
|
777
730
|
continue;
|
|
778
731
|
}
|
|
779
732
|
if (snap.existed && snap.content) {
|
|
780
733
|
if (!snap.createdByTool && existsSync(absPath) && readFileSync(absPath).equals(snap.content))
|
|
781
734
|
continue;
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
continue;
|
|
785
|
-
}
|
|
786
|
-
restored.push(absPath);
|
|
787
|
-
} else if (!snap.existed && (snap.createdByTool || capture === "hybrid" || capture === "shadow-git") && lstatIfPresent(absPath)) {
|
|
788
|
-
if (!safeRestoreParent(absPath, turn)) {
|
|
789
|
-
warnExternalModification(ctx, `Rollback skipped ${absPath}: a symlink or junction made the path unsafe.`);
|
|
790
|
-
continue;
|
|
791
|
-
}
|
|
792
|
-
unlinkSync(absPath), deleted.push(absPath);
|
|
793
|
-
}
|
|
735
|
+
mkdirSync(dirname(absPath), { recursive: !0 }), writeFileSync(absPath, snap.content), restored.push(absPath);
|
|
736
|
+
} else snap.existed || (snap.createdByTool || capture === "hybrid" || capture === "shadow-git") && existsSync(absPath) && (unlinkSync(absPath), deleted.push(absPath));
|
|
794
737
|
} catch {
|
|
795
738
|
}
|
|
796
739
|
return cleanupTurnFiles(ctx, turn), ctx.turns.pop(), { restored, deleted, turnsConsumed };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
isPlanModeActive,
|
|
4
|
-
requestPlanApproval
|
|
5
|
-
} from "./chunk-LZAW4ZX3.js";
|
|
6
2
|
import {
|
|
7
3
|
typebox_exports
|
|
8
4
|
} from "./chunk-PL6JKXWI.js";
|
|
5
|
+
import {
|
|
6
|
+
isPlanModeActive,
|
|
7
|
+
requestPlanApproval
|
|
8
|
+
} from "./chunk-ZRDIMBEQ.js";
|
|
9
9
|
import {
|
|
10
10
|
ashxj_tui_default
|
|
11
11
|
} from "./chunk-JHYKXIMM.js";
|
|
@@ -783,6 +783,12 @@ function writeHideThinkingBlock(hide) {
|
|
|
783
783
|
}
|
|
784
784
|
var THINKING_COMMAND_DESCRIPTION = "View or set the reasoning level for the current model, or toggle thinking-block visibility with show/hide/toggle";
|
|
785
785
|
function ashxj_thinking_default(pi) {
|
|
786
|
+
sessionModel = void 0, typeof pi.on == "function" && (pi.on("session_start", (_event, ctx) => {
|
|
787
|
+
sessionModel = ctx.model;
|
|
788
|
+
}), pi.on("model_select", (event, ctx) => {
|
|
789
|
+
let selected = event?.model;
|
|
790
|
+
sessionModel = ctx.model ?? selected;
|
|
791
|
+
}));
|
|
786
792
|
let thinkingSpec = {
|
|
787
793
|
description: THINKING_COMMAND_DESCRIPTION,
|
|
788
794
|
getArgumentCompletions(prefix) {
|
|
@@ -833,7 +839,7 @@ function ashxj_thinking_default(pi) {
|
|
|
833
839
|
}
|
|
834
840
|
if (level === currentLevel)
|
|
835
841
|
return;
|
|
836
|
-
pi.setThinkingLevel(level)
|
|
842
|
+
pi.setThinkingLevel(level);
|
|
837
843
|
return;
|
|
838
844
|
}
|
|
839
845
|
let requested = trimmed.toLowerCase();
|
|
@@ -841,11 +847,7 @@ function ashxj_thinking_default(pi) {
|
|
|
841
847
|
ctx.ui.notify(`Invalid thinking level: "${trimmed}". Valid: ${levels.join(", ")}`, "error");
|
|
842
848
|
return;
|
|
843
849
|
}
|
|
844
|
-
|
|
845
|
-
ctx.ui.notify(`Thinking level: ${requested} (unchanged)`, "info");
|
|
846
|
-
return;
|
|
847
|
-
}
|
|
848
|
-
pi.setThinkingLevel(requested), ctx.ui.notify(`Thinking level: ${pi.getThinkingLevel()}`, "info");
|
|
850
|
+
requested !== currentLevel && pi.setThinkingLevel(requested);
|
|
849
851
|
}
|
|
850
852
|
};
|
|
851
853
|
pi.registerCommand("thinking", thinkingSpec), pi.registerCommand("effort", {
|
|
@@ -855,11 +857,30 @@ function ashxj_thinking_default(pi) {
|
|
|
855
857
|
...thinkingSpec,
|
|
856
858
|
description: `${THINKING_COMMAND_DESCRIPTION} (alias of /thinking)`
|
|
857
859
|
});
|
|
860
|
+
for (let level of ALL_LEVELS)
|
|
861
|
+
pi.registerCommand(level, {
|
|
862
|
+
description: `Set thinking level to ${level}`,
|
|
863
|
+
handler: async (_args, ctx) => {
|
|
864
|
+
let levels = availableLevelsFor(ctx.model);
|
|
865
|
+
if (!levels.includes(level)) {
|
|
866
|
+
ctx.ui.notify(`Invalid thinking level: "${level}". Valid: ${levels.join(", ")}`, "error");
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
pi.getThinkingLevel() !== level && pi.setThinkingLevel(level);
|
|
870
|
+
}
|
|
871
|
+
});
|
|
858
872
|
}
|
|
873
|
+
var sessionModel;
|
|
859
874
|
function currentModel(pi) {
|
|
860
875
|
let fn = pi.getModel;
|
|
861
876
|
if (typeof fn == "function")
|
|
862
|
-
|
|
877
|
+
try {
|
|
878
|
+
let model = fn.call(pi);
|
|
879
|
+
if (model)
|
|
880
|
+
return model;
|
|
881
|
+
} catch {
|
|
882
|
+
}
|
|
883
|
+
return sessionModel;
|
|
863
884
|
}
|
|
864
885
|
|
|
865
886
|
// packages/coding-agent/dist/builtin-extensions/lunr-local-providers/local-servers.js
|
|
@@ -1295,13 +1316,14 @@ var lightBuiltinExtensions = [
|
|
|
1295
1316
|
], DEFERRED_BUILTIN_LOADERS = [
|
|
1296
1317
|
{ name: "pi-ollama-cloud", load: () => import("./pi-ollama-cloud-4VZRMULP.js") },
|
|
1297
1318
|
{ name: "narumiruna-pi-goal", load: () => import("./goal-CZQ7FFQJ.js") },
|
|
1298
|
-
{ name: "lunr-cron", load: () => import("./lunr-cron-
|
|
1319
|
+
{ name: "lunr-cron", load: () => import("./lunr-cron-KKBOGAEF.js") },
|
|
1299
1320
|
{ name: "pi-intercom", load: () => import("./pi-intercom-EEMBGQID.js") },
|
|
1300
1321
|
{ name: "pi-prompt-template-model", load: () => import("./pi-prompt-template-model-4QT4LLXF.js") },
|
|
1301
|
-
{ name: "pi-subagents", load: () => import("./pi-subagents-
|
|
1302
|
-
{ name: "pi-web-access", load: () => import("./pi-web-access-
|
|
1303
|
-
{ name: "pi-lsp-extension", load: () => import("./src-
|
|
1304
|
-
{ name: "pi-mcp-adapter", load: () => import("./pi-mcp-adapter-
|
|
1322
|
+
{ name: "pi-subagents", load: () => import("./pi-subagents-VKCLYIBY.js") },
|
|
1323
|
+
{ name: "pi-web-access", load: () => import("./pi-web-access-BV6DSZOP.js") },
|
|
1324
|
+
{ name: "pi-lsp-extension", load: () => import("./src-GPFAU3N6.js") },
|
|
1325
|
+
{ name: "pi-mcp-adapter", load: () => import("./pi-mcp-adapter-DPTJGAAL.js") },
|
|
1326
|
+
{ name: "lunr-computer-use", load: () => import("./lunr-computer-use-4X3KUNF4.js") }
|
|
1305
1327
|
], DEFERRED_BUILTIN_EXTENSION_NAMES = DEFERRED_BUILTIN_LOADERS.map((entry) => entry.name), DEFERRED_BUILTIN_FLAGS = ["mcp-config"];
|
|
1306
1328
|
async function loadDeferredBuiltinExtensions() {
|
|
1307
1329
|
return await Promise.all(DEFERRED_BUILTIN_LOADERS.map(async ({ name, load }) => {
|