@ashx-j/lunr 0.2.24 → 0.2.26

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.
Files changed (254) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/dist/builtin-extensions/index.d.ts.map +1 -1
  3. package/dist/builtin-extensions/index.js +1 -0
  4. package/dist/builtin-extensions/index.js.map +1 -1
  5. package/dist/builtin-extensions/lunr-computer-use.d.ts +3 -0
  6. package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -0
  7. package/dist/builtin-extensions/lunr-computer-use.js +179 -0
  8. package/dist/builtin-extensions/lunr-computer-use.js.map +1 -0
  9. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
  10. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +1 -1
  11. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
  12. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +4 -4
  13. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
  14. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +8 -5
  15. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
  16. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts +1 -0
  17. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -1
  18. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +11 -2
  19. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
  20. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -1
  21. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +3 -3
  22. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -1
  23. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
  24. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +15 -1
  25. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
  26. package/dist/builtin-extensions/pi-subagents/src/runs/shared/chain-outputs.d.ts +1 -0
  27. package/dist/builtin-extensions/pi-subagents/src/runs/shared/chain-outputs.d.ts.map +1 -1
  28. package/dist/builtin-extensions/pi-subagents/src/runs/shared/chain-outputs.js +5 -0
  29. package/dist/builtin-extensions/pi-subagents/src/runs/shared/chain-outputs.js.map +1 -1
  30. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts +1 -1
  31. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts.map +1 -1
  32. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js +2 -0
  33. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js.map +1 -1
  34. package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts.map +1 -1
  35. package/dist/builtin-extensions/pi-subagents/src/tui/communication.js +1 -1
  36. package/dist/builtin-extensions/pi-subagents/src/tui/communication.js.map +1 -1
  37. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +1 -0
  38. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
  39. package/dist/builtin-extensions/pi-subagents/src/tui/render.js +5 -3
  40. package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
  41. package/dist/core/computer-use/adapter.d.ts +28 -0
  42. package/dist/core/computer-use/adapter.d.ts.map +1 -0
  43. package/dist/core/computer-use/adapter.js +133 -0
  44. package/dist/core/computer-use/adapter.js.map +1 -0
  45. package/dist/core/computer-use/image.d.ts +27 -0
  46. package/dist/core/computer-use/image.d.ts.map +1 -0
  47. package/dist/core/computer-use/image.js +72 -0
  48. package/dist/core/computer-use/image.js.map +1 -0
  49. package/dist/core/computer-use/lease.d.ts +18 -0
  50. package/dist/core/computer-use/lease.d.ts.map +1 -0
  51. package/dist/core/computer-use/lease.js +129 -0
  52. package/dist/core/computer-use/lease.js.map +1 -0
  53. package/dist/core/computer-use/macos-runtime.d.ts +14 -0
  54. package/dist/core/computer-use/macos-runtime.d.ts.map +1 -0
  55. package/dist/core/computer-use/macos-runtime.js +148 -0
  56. package/dist/core/computer-use/macos-runtime.js.map +1 -0
  57. package/dist/core/computer-use/policy.d.ts +19 -0
  58. package/dist/core/computer-use/policy.d.ts.map +1 -0
  59. package/dist/core/computer-use/policy.js +67 -0
  60. package/dist/core/computer-use/policy.js.map +1 -0
  61. package/dist/core/computer-use/release.generated.d.ts +31 -0
  62. package/dist/core/computer-use/release.generated.d.ts.map +1 -0
  63. package/dist/core/computer-use/release.generated.js +36 -0
  64. package/dist/core/computer-use/release.generated.js.map +1 -0
  65. package/dist/core/computer-use/runtime.d.ts +13 -0
  66. package/dist/core/computer-use/runtime.d.ts.map +1 -0
  67. package/dist/core/computer-use/runtime.js +158 -0
  68. package/dist/core/computer-use/runtime.js.map +1 -0
  69. package/dist/core/computer-use/schemas.d.ts +100 -0
  70. package/dist/core/computer-use/schemas.d.ts.map +1 -0
  71. package/dist/core/computer-use/schemas.js +79 -0
  72. package/dist/core/computer-use/schemas.js.map +1 -0
  73. package/dist/core/computer-use/windows-desktop.d.ts +3 -0
  74. package/dist/core/computer-use/windows-desktop.d.ts.map +1 -0
  75. package/dist/core/computer-use/windows-desktop.js +48 -0
  76. package/dist/core/computer-use/windows-desktop.js.map +1 -0
  77. package/dist/core/computer-use/workflow.d.ts +38 -0
  78. package/dist/core/computer-use/workflow.d.ts.map +1 -0
  79. package/dist/core/computer-use/workflow.js +560 -0
  80. package/dist/core/computer-use/workflow.js.map +1 -0
  81. package/dist/core/extensions/loader.d.ts.map +1 -1
  82. package/dist/core/extensions/loader.js +4 -0
  83. package/dist/core/extensions/loader.js.map +1 -1
  84. package/dist/core/permissions.d.ts +1 -1
  85. package/dist/core/permissions.d.ts.map +1 -1
  86. package/dist/core/permissions.js +14 -3
  87. package/dist/core/permissions.js.map +1 -1
  88. package/dist/core/plan-mode.d.ts.map +1 -1
  89. package/dist/core/plan-mode.js +9 -0
  90. package/dist/core/plan-mode.js.map +1 -1
  91. package/dist/core/settings-manager.d.ts +6 -0
  92. package/dist/core/settings-manager.d.ts.map +1 -1
  93. package/dist/core/settings-manager.js +19 -0
  94. package/dist/core/settings-manager.js.map +1 -1
  95. package/dist/core/subagent-event-transport.d.ts +3 -0
  96. package/dist/core/subagent-event-transport.d.ts.map +1 -0
  97. package/dist/core/subagent-event-transport.js +61 -0
  98. package/dist/core/subagent-event-transport.js.map +1 -0
  99. package/dist/gateway/adapters/discord.d.ts.map +1 -1
  100. package/dist/gateway/adapters/discord.js +4 -9
  101. package/dist/gateway/adapters/discord.js.map +1 -1
  102. package/dist/gateway/adapters/telegram.d.ts.map +1 -1
  103. package/dist/gateway/adapters/telegram.js +7 -0
  104. package/dist/gateway/adapters/telegram.js.map +1 -1
  105. package/dist/gateway/agent-bridge.d.ts +4 -1
  106. package/dist/gateway/agent-bridge.d.ts.map +1 -1
  107. package/dist/gateway/agent-bridge.js +57 -17
  108. package/dist/gateway/agent-bridge.js.map +1 -1
  109. package/dist/gateway/approval.d.ts.map +1 -1
  110. package/dist/gateway/approval.js +3 -3
  111. package/dist/gateway/approval.js.map +1 -1
  112. package/dist/gateway/authz.d.ts +4 -4
  113. package/dist/gateway/authz.d.ts.map +1 -1
  114. package/dist/gateway/authz.js +8 -12
  115. package/dist/gateway/authz.js.map +1 -1
  116. package/dist/gateway/buttons.d.ts.map +1 -1
  117. package/dist/gateway/buttons.js +29 -19
  118. package/dist/gateway/buttons.js.map +1 -1
  119. package/dist/gateway/commands.d.ts +2 -0
  120. package/dist/gateway/commands.d.ts.map +1 -1
  121. package/dist/gateway/commands.js +35 -18
  122. package/dist/gateway/commands.js.map +1 -1
  123. package/dist/gateway/config.d.ts +1 -0
  124. package/dist/gateway/config.d.ts.map +1 -1
  125. package/dist/gateway/config.js +2 -0
  126. package/dist/gateway/config.js.map +1 -1
  127. package/dist/gateway/cron.d.ts +1 -1
  128. package/dist/gateway/cron.d.ts.map +1 -1
  129. package/dist/gateway/cron.js +22 -8
  130. package/dist/gateway/cron.js.map +1 -1
  131. package/dist/gateway/index.d.ts.map +1 -1
  132. package/dist/gateway/index.js +26 -26
  133. package/dist/gateway/index.js.map +1 -1
  134. package/dist/gateway/mobile-commands.d.ts.map +1 -1
  135. package/dist/gateway/mobile-commands.js +11 -11
  136. package/dist/gateway/mobile-commands.js.map +1 -1
  137. package/dist/gateway/presenter.d.ts +12 -1
  138. package/dist/gateway/presenter.d.ts.map +1 -1
  139. package/dist/gateway/presenter.js +148 -50
  140. package/dist/gateway/presenter.js.map +1 -1
  141. package/dist/gateway/router.d.ts +5 -5
  142. package/dist/gateway/router.d.ts.map +1 -1
  143. package/dist/gateway/router.js +95 -43
  144. package/dist/gateway/router.js.map +1 -1
  145. package/dist/gateway/service.d.ts.map +1 -1
  146. package/dist/gateway/service.js +13 -4
  147. package/dist/gateway/service.js.map +1 -1
  148. package/dist/gateway/setup.d.ts +5 -0
  149. package/dist/gateway/setup.d.ts.map +1 -1
  150. package/dist/gateway/setup.js +101 -43
  151. package/dist/gateway/setup.js.map +1 -1
  152. package/dist/gateway/stream.d.ts +6 -5
  153. package/dist/gateway/stream.d.ts.map +1 -1
  154. package/dist/gateway/stream.js +24 -11
  155. package/dist/gateway/stream.js.map +1 -1
  156. package/dist/modes/interactive/components/settings-selector.d.ts +4 -0
  157. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  158. package/dist/modes/interactive/components/settings-selector.js +20 -0
  159. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  160. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  161. package/dist/modes/interactive/interactive-mode.js +8 -0
  162. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  163. package/dist/modes/print-mode.d.ts.map +1 -1
  164. package/dist/modes/print-mode.js +9 -1
  165. package/dist/modes/print-mode.js.map +1 -1
  166. package/dist/node-runtime/adapter-VFG7WNPX.js +17 -0
  167. package/dist/node-runtime/{agent-session-services-IEF7LQWD.js → agent-session-services-5YXS2PLF.js} +13 -10
  168. package/dist/node-runtime/{builtin-extensions-EBAWTH4M.js → builtin-extensions-I2HIFEMY.js} +3 -2
  169. package/dist/node-runtime/{chunk-K5AGHH57.js → chunk-2CFDTH5B.js} +7 -3
  170. package/dist/node-runtime/{chunk-VWCE2HSZ.js → chunk-2HMIRK7W.js} +4 -4
  171. package/dist/node-runtime/chunk-2IDTZAG5.js +1415 -0
  172. package/dist/node-runtime/{chunk-IGV54Q5V.js → chunk-3MISGG4S.js} +137 -76
  173. package/dist/node-runtime/chunk-4SBQAI4T.js +2185 -0
  174. package/dist/node-runtime/{chunk-WHLRAGUQ.js → chunk-5B5QN3ZQ.js} +16 -16
  175. package/dist/node-runtime/chunk-5B6VKFEV.js +180 -0
  176. package/dist/node-runtime/{chunk-AD6VXAO7.js → chunk-5Q4A37RB.js} +15 -104
  177. package/dist/node-runtime/{chunk-4TLO4PO2.js → chunk-7IQGBKBJ.js} +7 -1401
  178. package/dist/node-runtime/{chunk-R3K2F5GI.js → chunk-B4HP6ZWM.js} +2 -0
  179. package/dist/node-runtime/{chunk-OCVIXVTZ.js → chunk-D5UCKPBQ.js} +12 -1
  180. package/dist/node-runtime/chunk-DVQSHCVP.js +97 -0
  181. package/dist/node-runtime/{chunk-HFVZUPFJ.js → chunk-E75WFZ33.js} +2 -2
  182. package/dist/node-runtime/chunk-FY4A63RK.js +73 -0
  183. package/dist/node-runtime/{chunk-RORY2HMJ.js → chunk-I74LN5JG.js} +16 -1
  184. package/dist/node-runtime/chunk-IKU6Y7DL.js +287 -0
  185. package/dist/node-runtime/{chunk-QM43FEAE.js → chunk-L24TPBS4.js} +6 -5
  186. package/dist/node-runtime/{chunk-DE2JB6J5.js → chunk-LJTIVM7I.js} +7 -7
  187. package/dist/node-runtime/{chunk-DSIKTUPW.js → chunk-LWJXTA6Z.js} +274 -2433
  188. package/dist/node-runtime/{chunk-YVI6L6LU.js → chunk-P7XBVXGT.js} +36 -21
  189. package/dist/node-runtime/{chunk-OVX6X377.js → chunk-PTFBPO3C.js} +1 -1
  190. package/dist/node-runtime/{chunk-F4FLTQKV.js → chunk-RAK2QA2B.js} +186 -1529
  191. package/dist/node-runtime/{chunk-L3LX4SNR.js → chunk-RCR3XAQY.js} +36 -8
  192. package/dist/node-runtime/chunk-RGQAEOM5.js +81 -0
  193. package/dist/node-runtime/{chunk-UWPJL22I.js → chunk-SLVOAQOY.js} +15 -4
  194. package/dist/node-runtime/chunk-SN2KSMPQ.js +1364 -0
  195. package/dist/node-runtime/{chunk-FU6OODRZ.js → chunk-SPVDBUOS.js} +1 -1
  196. package/dist/node-runtime/{chunk-5Q3EHOHI.js → chunk-T4DA4XE7.js} +19 -17
  197. package/dist/node-runtime/chunk-U5F4IC7R.js +53 -0
  198. package/dist/node-runtime/{chunk-UP2XBVH5.js → chunk-UOEDI7RP.js} +1 -1
  199. package/dist/node-runtime/{chunk-Y73WPE6S.js → chunk-UVWCDQYF.js} +79 -44
  200. package/dist/node-runtime/{chunk-ZXSGTGJ6.js → chunk-WIF24I7G.js} +21 -5
  201. package/dist/node-runtime/{chunk-OF7PWMG4.js → chunk-X3PGBLQ7.js} +3 -87
  202. package/dist/node-runtime/chunk-XHIRAZ26.js +108 -0
  203. package/dist/node-runtime/{chunk-YDO2F2IA.js → chunk-YWOJIGFY.js} +1 -1
  204. package/dist/node-runtime/{command-7BG7VVTS.js → command-FSBU2EVZ.js} +5 -5
  205. package/dist/node-runtime/{commands-NZLSOHPE.js → commands-EMBQQVVT.js} +4 -2
  206. package/dist/node-runtime/{commands-QFDKNQTL.js → commands-NAAL7KNT.js} +7 -6
  207. package/dist/node-runtime/{config-RORQUQFG.js → config-D4QUPAHX.js} +1 -1
  208. package/dist/node-runtime/{direct-tool-executor-77GW4F5P.js → direct-tool-executor-4D7UXYU4.js} +7 -4
  209. package/dist/node-runtime/{gateway-TWR3N65G.js → gateway-DQM333YV.js} +140 -85
  210. package/dist/node-runtime/index.js +28 -21
  211. package/dist/node-runtime/{init-HS6NQXSK.js → init-P5AUV77I.js} +4 -2
  212. package/dist/node-runtime/{install-cli-VAP6KBFN.js → install-cli-NN4YAU44.js} +3 -3
  213. package/dist/node-runtime/{interactive-mode-6J5VZ2TT.js → interactive-mode-YOHZVMKX.js} +14 -11
  214. package/dist/node-runtime/{lunr-browser-J5ZZYVGM.js → lunr-browser-IR7TL3J7.js} +3 -3
  215. package/dist/node-runtime/lunr-computer-use-Y23CCDIJ.js +158 -0
  216. package/dist/node-runtime/{lunr-cron-CXOL37AL.js → lunr-cron-USHC4LXH.js} +9 -7
  217. package/dist/node-runtime/main.js +19 -15
  218. package/dist/node-runtime/{mcp-auth-flow-QIXHW6QN.js → mcp-auth-flow-QVLFVLEO.js} +2 -1
  219. package/dist/node-runtime/{mobile-commands-VTBM5DSZ.js → mobile-commands-O5LCHL32.js} +6 -5
  220. package/dist/node-runtime/{package-manager-cli-ZLW5DZXF.js → package-manager-cli-Q7BL6KZO.js} +12 -8
  221. package/dist/node-runtime/{pi-mcp-adapter-5UKBZP44.js → pi-mcp-adapter-3PHF4KZ4.js} +5 -5
  222. package/dist/node-runtime/{pi-subagents-XPCLLKIM.js → pi-subagents-7IBSSGEW.js} +27 -21
  223. package/dist/node-runtime/{print-mode-XSFM26EL.js → print-mode-XQ76CYMT.js} +2 -1
  224. package/dist/node-runtime/{proxy-modes-LGEUYD7R.js → proxy-modes-5FAPSZEZ.js} +7 -4
  225. package/dist/node-runtime/rpc-entry.js +19 -15
  226. package/dist/node-runtime/runtime-EFPPD2UW.js +21 -0
  227. package/dist/node-runtime/{runtime-bridges-QYXUX2TG.js → runtime-bridges-7WVCLI76.js} +6 -5
  228. package/dist/node-runtime/{service-ISSP6VHE.js → service-MDQIPQ26.js} +1 -1
  229. package/dist/node-runtime/{settings-manager-WCQDUVQB.js → settings-manager-DJDM5AHM.js} +5 -4
  230. package/dist/node-runtime/setup-PFBWRNUI.js +215 -0
  231. package/dist/node-runtime/{subagent-executor-OTNISDQU.js → subagent-executor-LPZ4BHWE.js} +32 -14
  232. package/dist/node-runtime/{update-cli-VBR2777K.js → update-cli-HNMOTNGX.js} +5 -4
  233. package/dist/node-runtime/workflow-OHPBEFO4.js +637 -0
  234. package/dist/utils/image-resize-core.d.ts +2 -0
  235. package/dist/utils/image-resize-core.d.ts.map +1 -1
  236. package/dist/utils/image-resize-core.js +10 -0
  237. package/dist/utils/image-resize-core.js.map +1 -1
  238. package/docs/computer-use.md +362 -0
  239. package/docs/features.md +9 -7
  240. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  241. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  242. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  243. package/examples/extensions/gondolin/package-lock.json +2 -2
  244. package/examples/extensions/gondolin/package.json +1 -1
  245. package/examples/extensions/sandbox/package-lock.json +2 -2
  246. package/examples/extensions/sandbox/package.json +1 -1
  247. package/examples/extensions/with-deps/package-lock.json +2 -2
  248. package/examples/extensions/with-deps/package.json +1 -1
  249. package/install-lock/package-lock.json +3841 -0
  250. package/install-lock/package.json +18 -0
  251. package/native/computer-use/LICENSE.md +21 -0
  252. package/npm-shrinkwrap.json +3822 -0
  253. package/package.json +15 -9
  254. package/dist/node-runtime/setup-YRBKH2LD.js +0 -155
@@ -5,9 +5,9 @@ import {
5
5
  createPicker,
6
6
  gatewayInput,
7
7
  gatewaySelect,
8
- isGatewayOwner,
9
- requireGatewayOwner
10
- } from "./chunk-IGV54Q5V.js";
8
+ isAuthorized,
9
+ requireAuthorized
10
+ } from "./chunk-3MISGG4S.js";
11
11
  import {
12
12
  getSubagentCancellation
13
13
  } from "./chunk-BBUVIEZB.js";
@@ -15,13 +15,13 @@ import {
15
15
  PERMISSION_MODES,
16
16
  getPermissionMode,
17
17
  setPermissionMode
18
- } from "./chunk-ZXSGTGJ6.js";
18
+ } from "./chunk-WIF24I7G.js";
19
19
  import {
20
20
  SessionManager
21
21
  } from "./chunk-2KIPT4HJ.js";
22
22
  import {
23
23
  loadGatewayConfig
24
- } from "./chunk-R3K2F5GI.js";
24
+ } from "./chunk-B4HP6ZWM.js";
25
25
 
26
26
  // packages/coding-agent/dist/gateway/mobile-commands.js
27
27
  import { mkdirSync, readdirSync, realpathSync, statSync } from "node:fs";
@@ -109,9 +109,9 @@ async function browseProject(ctx, initialPath) {
109
109
  sessionKey: key,
110
110
  invokerId: event.source.userId,
111
111
  ...initial,
112
- validate: () => isGatewayOwner(event.source, loadGatewayConfig()),
112
+ validate: () => isAuthorized(event.source, loadGatewayConfig()),
113
113
  resolve: async (item) => {
114
- if (requireGatewayOwner(event.source), item.value === "use" && current) {
114
+ if (requireAuthorized(event.source), item.value === "use" && current) {
115
115
  let cwd = resolveWithinRoots(current, loadGatewayConfig().projectRoots ?? []);
116
116
  if (bridge.getStatus(key).busy)
117
117
  throw new Error("Stop the current turn or wait before switching projects.");
@@ -146,9 +146,9 @@ async function continueSession(ctx, file) {
146
146
  }
147
147
  }
148
148
  async function performContinue(ctx, file, signal) {
149
- requireGatewayOwner(ctx.event.source);
149
+ requireAuthorized(ctx.event.source);
150
150
  let { requestSessionTransfer, SessionTransferError } = await import("./session-handoff-GWARVEWT.js"), { key, bridge } = ctx;
151
- if ((await bridge.getSession(key))?.sessionManager?.getSessionFile() === file) {
151
+ if (bridge.peekSession?.(key)?.sessionManager?.getSessionFile() === file) {
152
152
  await ctx.adapter.send(ctx.event.source.chatId, "This session is already open here.");
153
153
  return;
154
154
  }
@@ -157,7 +157,7 @@ async function performContinue(ctx, file, signal) {
157
157
  try {
158
158
  await requestSessionTransfer(file, { timeoutMs: 3e3, signal });
159
159
  } catch (error) {
160
- if (!(error instanceof SessionTransferError) || error.code !== "busy")
160
+ if (!(error instanceof SessionTransferError) || !["busy", "timeout"].includes(error.code))
161
161
  throw error;
162
162
  let choice = await gatewaySelect(key, `${error instanceof Error ? error.message : "Session is in use"}
163
163
  How should lunR continue?`, ["Wait until idle", "Stop and continue", "Cancel"], { signal });
@@ -168,19 +168,19 @@ How should lunR continue?`, ["Wait until idle", "Stop and continue", "Cancel"],
168
168
  else {
169
169
  let deadline = Date.now() + 12e4;
170
170
  for (; ; ) {
171
- signal.throwIfAborted(), requireGatewayOwner(ctx.event.source);
171
+ signal.throwIfAborted(), requireAuthorized(ctx.event.source);
172
172
  try {
173
173
  await requestSessionTransfer(file, { timeoutMs: 3e3, signal });
174
174
  break;
175
175
  } catch (retryError) {
176
- if (!(retryError instanceof SessionTransferError) || retryError.code !== "busy" || Date.now() >= deadline)
176
+ if (!(retryError instanceof SessionTransferError) || !["busy", "timeout"].includes(retryError.code) || Date.now() >= deadline)
177
177
  throw retryError;
178
178
  }
179
179
  await new Promise((resolve2) => setTimeout(resolve2, 500));
180
180
  }
181
181
  }
182
182
  }
183
- signal.throwIfAborted(), requireGatewayOwner(ctx.event.source), await bridge.switchSession(key, file);
183
+ signal.throwIfAborted(), requireAuthorized(ctx.event.source), await bridge.switchSession(key, file);
184
184
  let session = await bridge.getSession(key), cwd = session?.sessionManager?.getCwd();
185
185
  bindConversation(key, ctx.event.source, { cwd, owner: ctx.event.source.userId });
186
186
  let id = session?.sessionManager?.getSessionId();
@@ -241,14 +241,14 @@ async function sessionPicker(ctx, items) {
241
241
  invokerId: ctx.event.source.userId,
242
242
  title: "Choose a session. Use /sessions <search> to filter.",
243
243
  items,
244
- validate: () => isGatewayOwner(ctx.event.source, loadGatewayConfig()),
244
+ validate: () => isAuthorized(ctx.event.source, loadGatewayConfig()),
245
245
  resolve: async (item) => (await continueSession(ctx, item.value), { done: !0, text: "Session selection finished." })
246
246
  }, { threadId: ctx.event.source.threadId });
247
247
  }
248
248
  async function handleMobileCommand(ctx, command, args) {
249
249
  if (!MOBILE_COMMANDS.some((c) => c.name === command) && command !== "resume")
250
250
  return !1;
251
- if (requireGatewayOwner(ctx.event.source, ctx.cfg), bindConversation(ctx.key, ctx.event.source, { owner: ctx.event.source.userId }), command === "project")
251
+ if (requireAuthorized(ctx.event.source, ctx.cfg), bindConversation(ctx.key, ctx.event.source, { owner: ctx.event.source.userId }), command === "project")
252
252
  return await browseProject(ctx, args.trim() || void 0), !0;
253
253
  if (command === "sessions" || command === "resume" || command === "continue")
254
254
  return await browseSessions(ctx, args, command === "continue"), !0;
@@ -325,7 +325,7 @@ async function handleMobileCommand(ctx, command, args) {
325
325
  if (command === "settings") {
326
326
  let choice = await gatewaySelect(ctx.key, "Session settings", ["Model", "Thinking", "Permissions"]);
327
327
  if (choice === "Model" || choice === "Thinking") {
328
- let { CHAT_COMMANDS, runChatCommand } = await import("./commands-QFDKNQTL.js"), cmd = CHAT_COMMANDS.find((c) => c.name === choice.toLowerCase());
328
+ let { CHAT_COMMANDS, runChatCommand } = await import("./commands-NAAL7KNT.js"), cmd = CHAT_COMMANDS.find((c) => c.name === choice.toLowerCase());
329
329
  return cmd && await runChatCommand(cmd, {
330
330
  ...ctx,
331
331
  args: "",
@@ -0,0 +1,180 @@
1
+ import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
2
+ import {
3
+ require_proper_lockfile
4
+ } from "./chunk-URD2SLIT.js";
5
+ import {
6
+ getPackageDir
7
+ } from "./chunk-FQMM2EZ2.js";
8
+ import {
9
+ __toESM
10
+ } from "./chunk-BRJX2PRC.js";
11
+
12
+ // packages/coding-agent/dist/core/computer-use/runtime.js
13
+ var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
14
+ import { execFile } from "node:child_process";
15
+ import { createHash, randomUUID } from "node:crypto";
16
+ import { createReadStream } from "node:fs";
17
+ import { lstat, mkdir, readdir, readFile, readlink, realpath, rename, rm } from "node:fs/promises";
18
+ import { createRequire } from "node:module";
19
+ import { userInfo } from "node:os";
20
+ import { dirname, isAbsolute, join, relative, resolve } from "node:path";
21
+ import { promisify } from "node:util";
22
+
23
+ // packages/coding-agent/dist/core/computer-use/release.generated.js
24
+ var computerRelease = {
25
+ version: "0.28.1",
26
+ tag: "cua-driver-rs-v0.28.1",
27
+ sourceCommit: "d8028a7943087ee258dc1b4d19dc12a7cd27669c",
28
+ repository: "https://github.com/trycua/cua",
29
+ prerelease: !0,
30
+ approval: "production-approved",
31
+ artifacts: [
32
+ {
33
+ platform: "win32",
34
+ arch: "x64",
35
+ packageName: "@ashx-j/lunr-computer-win32-x64",
36
+ name: "cua-driver-rs-0.28.1-windows-x86_64-binary.zip",
37
+ bytes: 28930759,
38
+ sha256: "ab90418a54f84102f549cde4537daef3a0e20ba8254b7e24524a50fc5f4174d3"
39
+ },
40
+ {
41
+ platform: "win32",
42
+ arch: "arm64",
43
+ packageName: "@ashx-j/lunr-computer-win32-arm64",
44
+ name: "cua-driver-rs-0.28.1-windows-arm64-binary.zip",
45
+ bytes: 27246194,
46
+ sha256: "d260e6110e029680d543d317f3c3c09569475f8d65855fcedda202e2ee989bf0"
47
+ },
48
+ {
49
+ platform: "darwin",
50
+ arch: "arm64",
51
+ packageName: "@ashx-j/lunr-computer-darwin-arm64",
52
+ name: "cua-driver-rs-0.28.1-darwin-arm64.tar.gz",
53
+ bytes: 70074352,
54
+ sha256: "b3cb3781feb9855dfcdd616bc5c9c8e627453e3e16a073c1446326691a549b24"
55
+ }
56
+ ]
57
+ };
58
+
59
+ // packages/coding-agent/dist/core/computer-use/runtime.js
60
+ var exec = promisify(execFile), CUA_VERSION = computerRelease.version;
61
+ async function resolveRuntimeArchive(packageDirectory = getPackageDir(), platform = process.platform, arch = process.arch) {
62
+ let payload = computerRelease.artifacts.find((item) => item.platform === platform && item.arch === arch);
63
+ if (!payload)
64
+ throw new Error("Computer use is unsupported on this platform or architecture.");
65
+ let archive = join(packageDirectory, "native", "computer-use", payload.name);
66
+ try {
67
+ await lstat(archive);
68
+ } catch (error) {
69
+ if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
70
+ throw error;
71
+ let manifestPath;
72
+ try {
73
+ manifestPath = createRequire(join(packageDirectory, "package.json")).resolve(`${payload.packageName}/package.json`);
74
+ } catch {
75
+ throw new Error("Computer-use payload is missing. Reinstall lunR with optional dependencies enabled. No runtime was downloaded.");
76
+ }
77
+ let manifest = JSON.parse(await readFile(manifestPath, "utf8")), cli = JSON.parse(await readFile(join(packageDirectory, "package.json"), "utf8"));
78
+ if (manifest.name !== payload.packageName || manifest.version !== cli.version)
79
+ throw new Error("Computer-use payload package version does not match lunR. Reinstall lunR with optional dependencies enabled.");
80
+ archive = join(dirname(manifestPath), payload.name);
81
+ }
82
+ let info = await lstat(archive);
83
+ if (!info.isFile() || info.isSymbolicLink() || info.size !== payload.bytes)
84
+ throw new Error("Bundled computer-use archive is not a regular file of the pinned size.");
85
+ return { archive, sha256: payload.sha256 };
86
+ }
87
+ function runtimeEnvironment(inherited = process.env) {
88
+ return {
89
+ ...Object.fromEntries(Object.entries(inherited).filter((entry) => entry[1] !== void 0 && !entry[0].toUpperCase().startsWith("CUA_"))),
90
+ CUA_DRIVER_RS_TELEMETRY_ENABLED: "false",
91
+ CUA_DRIVER_RS_UPDATE_CHECK: "false",
92
+ CUA_DRIVER_PERMISSION_MODE: "standard",
93
+ CUA_DRIVER_DISABLE_UNRESTRICTED: "true"
94
+ };
95
+ }
96
+ async function digest(path, signal) {
97
+ let hash = createHash("sha256");
98
+ for await (let chunk of createReadStream(path, { signal }))
99
+ hash.update(chunk);
100
+ return hash.digest("hex");
101
+ }
102
+ async function assertOwnedPath(path) {
103
+ let current = resolve(path);
104
+ for (; ; ) {
105
+ try {
106
+ if ((await lstat(current)).isSymbolicLink() || resolve(await realpath(current)).toLowerCase() !== current.toLowerCase())
107
+ throw new Error(`Computer runtime path redirects elsewhere: ${current}`);
108
+ } catch (error) {
109
+ if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
110
+ throw error;
111
+ }
112
+ let parent = dirname(current);
113
+ if (parent === current)
114
+ return;
115
+ current = parent;
116
+ }
117
+ }
118
+ async function runtimeInventory(root, signal) {
119
+ let inventory = {};
120
+ async function walk(path) {
121
+ for (let item of await readdir(path, { withFileTypes: !0 })) {
122
+ let entry = join(path, item.name), key = relative(root, entry);
123
+ if (item.isSymbolicLink()) {
124
+ let target = await readlink(entry), resolved = relative(root, resolve(dirname(entry), target));
125
+ if (isAbsolute(target) || resolved === ".." || resolved.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) || isAbsolute(resolved))
126
+ throw new Error("Runtime symlink escapes its bundle.");
127
+ inventory[key] = `link:${target}`;
128
+ } else if (item.isDirectory())
129
+ await assertOwnedPath(entry), inventory[key] = "directory", await walk(entry);
130
+ else if (item.isFile())
131
+ await assertOwnedPath(entry), inventory[key] = await digest(entry, signal);
132
+ else
133
+ throw new Error("Unexpected runtime filesystem entry.");
134
+ }
135
+ }
136
+ return await walk(root), Object.fromEntries(Object.entries(inventory).sort(([a], [b]) => a.localeCompare(b)));
137
+ }
138
+ async function installRuntime(signal) {
139
+ signal?.throwIfAborted();
140
+ let platform = `${process.platform}-${process.arch}`, { archive, sha256 } = await resolveRuntimeArchive();
141
+ if (process.platform === "win32" && process.env.SESSIONNAME === "Services")
142
+ throw new Error("Computer use requires a logged-in interactive desktop.");
143
+ if (await digest(archive, signal) !== sha256)
144
+ throw new Error("Bundled computer-use archive failed SHA-256 verification.");
145
+ let root = join(userInfo().homedir, ".lunr", "desktop");
146
+ await assertOwnedPath(root), await mkdir(root, { recursive: !0, mode: 448 });
147
+ let release = await import_proper_lockfile.default.lock(root, { retries: 0, stale: 12e4 }), temporary = join(root, `extract-${randomUUID()}`), destination = join(root, `runtime-${platform}`);
148
+ try {
149
+ await assertOwnedPath(destination), await mkdir(temporary, { mode: 448 }), await exec(process.platform === "win32" ? join(process.env.SystemRoot ?? "C:\\Windows", "System32", "tar.exe") : "/usr/bin/tar", ["-xf", archive, "-C", temporary], {
150
+ timeout: 3e4,
151
+ windowsHide: !0,
152
+ signal
153
+ });
154
+ let extracted = process.platform === "darwin" ? join(temporary, `cua-driver-rs-${CUA_VERSION}-darwin-arm64`) : temporary, expected = await runtimeInventory(extracted, signal);
155
+ try {
156
+ if (await lstat(destination), JSON.stringify(await runtimeInventory(destination, signal)) !== JSON.stringify(expected))
157
+ throw new Error("Cached computer runtime differs from the verified archive. Remove the inactive lunR runtime directory before reinstalling; it was not executed or overwritten.");
158
+ } catch (error) {
159
+ if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
160
+ throw error;
161
+ await rename(extracted, destination);
162
+ }
163
+ if (signal?.throwIfAborted(), process.platform === "darwin") {
164
+ let app = join(destination, "CuaDriver.app");
165
+ return await exec("/usr/bin/codesign", ["--verify", "--deep", "--strict", app], { timeout: 15e3, signal }), { app, command: join(app, "Contents", "MacOS", "cua-driver") };
166
+ }
167
+ return { command: join(destination, "cua-driver.exe") };
168
+ } finally {
169
+ await rm(temporary, { recursive: !0, force: !0 }), await release();
170
+ }
171
+ }
172
+
173
+ export {
174
+ CUA_VERSION,
175
+ resolveRuntimeArchive,
176
+ runtimeEnvironment,
177
+ assertOwnedPath,
178
+ runtimeInventory,
179
+ installRuntime
180
+ };
@@ -3,6 +3,12 @@ import {
3
3
  loadPhoton
4
4
  } from "./chunk-RQ2Q5IYR.js";
5
5
 
6
+ // packages/coding-agent/dist/utils/image-resize.js
7
+ import { Worker } from "node:worker_threads";
8
+
9
+ // packages/coding-agent/dist/utils/image-resize-core.js
10
+ import { createHash } from "node:crypto";
11
+
6
12
  // packages/coding-agent/dist/utils/exif-orientation.js
7
13
  function readOrientationFromTiff(bytes, tiffStart) {
8
14
  if (tiffStart + 8 > bytes.length)
@@ -99,42 +105,13 @@ function applyExifOrientation(photon, image, originalBytes) {
99
105
  }
100
106
  }
101
107
 
102
- // packages/coding-agent/dist/utils/image-convert.js
103
- async function convertImageBytesToPng(bytes) {
104
- let photon = await loadPhoton();
105
- if (!photon)
106
- return null;
107
- try {
108
- let rawImage = photon.PhotonImage.new_from_byteslice(bytes), image = applyExifOrientation(photon, rawImage, bytes);
109
- image !== rawImage && rawImage.free();
110
- try {
111
- return new Uint8Array(image.get_bytes());
112
- } finally {
113
- image.free();
114
- }
115
- } catch {
116
- return null;
117
- }
118
- }
119
- async function convertToPng(base64Data, mimeType) {
120
- if (mimeType === "image/png")
121
- return { data: base64Data, mimeType };
122
- let bytes = new Uint8Array(Buffer.from(base64Data, "base64")), pngBytes = await convertImageBytesToPng(bytes);
123
- return pngBytes ? {
124
- data: Buffer.from(pngBytes).toString("base64"),
125
- mimeType: "image/png"
126
- } : null;
127
- }
128
-
129
- // packages/coding-agent/dist/utils/image-resize.js
130
- import { Worker } from "node:worker_threads";
131
-
132
108
  // packages/coding-agent/dist/utils/image-resize-core.js
133
109
  var DEFAULT_MAX_BYTES = 4.5 * 1024 * 1024, DEFAULT_OPTIONS = {
134
110
  maxWidth: 2e3,
135
111
  maxHeight: 2e3,
136
112
  maxBytes: DEFAULT_MAX_BYTES,
137
- jpegQuality: 80
113
+ jpegQuality: 80,
114
+ includePixelFingerprint: !1
138
115
  };
139
116
  function encodeCandidate(buffer, mimeType) {
140
117
  let data = Buffer.from(buffer).toString("base64");
@@ -162,7 +139,7 @@ async function resizeImageInProcess(inputBytes, mimeType, options) {
162
139
  }
163
140
  }, rawImage = photon.PhotonImage.new_from_byteslice(inputBytes);
164
141
  image = applyExifOrientation(photon, rawImage, inputBytes), image !== rawImage && rawImage.free();
165
- let originalWidth = image.get_width(), originalHeight = image.get_height(), format = mimeType.split("/")[1] ?? "png";
142
+ let originalWidth = image.get_width(), originalHeight = image.get_height(), format = mimeType.split("/")[1] ?? "png", fingerprint = opts.includePixelFingerprint ? createHash("sha256").update(`${originalWidth}x${originalHeight}:`).update(image.get_raw_pixels()).digest("hex") : void 0;
166
143
  if (originalWidth <= opts.maxWidth && originalHeight <= opts.maxHeight && inputBase64Size < opts.maxBytes)
167
144
  return {
168
145
  data: Buffer.from(inputBytes).toString("base64"),
@@ -171,7 +148,8 @@ async function resizeImageInProcess(inputBytes, mimeType, options) {
171
148
  originalHeight,
172
149
  width: originalWidth,
173
150
  height: originalHeight,
174
- wasResized: !1
151
+ wasResized: !1,
152
+ ...fingerprint ? { fingerprint } : {}
175
153
  };
176
154
  let targetWidth = originalWidth, targetHeight = originalHeight;
177
155
  targetWidth > opts.maxWidth && (targetHeight = Math.round(targetHeight * opts.maxWidth / targetWidth), targetWidth = opts.maxWidth), targetHeight > opts.maxHeight && (targetWidth = Math.round(targetWidth * opts.maxHeight / targetHeight), targetHeight = opts.maxHeight);
@@ -187,7 +165,8 @@ async function resizeImageInProcess(inputBytes, mimeType, options) {
187
165
  originalHeight,
188
166
  width: currentWidth,
189
167
  height: currentHeight,
190
- wasResized: !0
168
+ wasResized: !0,
169
+ ...fingerprint ? { fingerprint } : {}
191
170
  };
192
171
  if (currentWidth === 1 && currentHeight === 1)
193
172
  break;
@@ -267,76 +246,8 @@ function formatDimensionNote(result) {
267
246
  return `[Image: original ${result.originalWidth}x${result.originalHeight}, displayed at ${result.width}x${result.height}. Multiply coordinates by ${scale.toFixed(2)} to map to original image.]`;
268
247
  }
269
248
 
270
- // packages/coding-agent/dist/utils/image-process.js
271
- function baseMimeType(mimeType) {
272
- return mimeType.split(";")[0]?.trim().toLowerCase() ?? mimeType.toLowerCase();
273
- }
274
- function normalizeSupportedImageMimeType(mimeType) {
275
- switch (baseMimeType(mimeType)) {
276
- case "image/png":
277
- return "image/png";
278
- case "image/jpeg":
279
- case "image/jpg":
280
- return "image/jpeg";
281
- case "image/gif":
282
- return "image/gif";
283
- case "image/webp":
284
- return "image/webp";
285
- default:
286
- return null;
287
- }
288
- }
289
- async function normalizeImage(bytes, mimeType) {
290
- let normalizedMimeType = normalizeSupportedImageMimeType(mimeType);
291
- if (normalizedMimeType)
292
- return { bytes, mimeType: normalizedMimeType };
293
- let pngBytes = await convertImageBytesToPng(bytes);
294
- return pngBytes ? {
295
- bytes: pngBytes,
296
- mimeType: "image/png",
297
- convertedFrom: baseMimeType(mimeType)
298
- } : null;
299
- }
300
- function conversionHint(from, to) {
301
- if (!(!from || from === to))
302
- return `[Image converted from ${from} to ${to}.]`;
303
- }
304
- async function processImage(bytes, mimeType, options) {
305
- let autoResizeImages = options?.autoResizeImages ?? !0, normalized = await normalizeImage(bytes, mimeType);
306
- if (!normalized)
307
- return {
308
- ok: !1,
309
- message: "[Image omitted: could not be converted to a supported inline image format.]"
310
- };
311
- if (autoResizeImages) {
312
- let resized = await resizeImage(normalized.bytes, normalized.mimeType, options?.resizeOptions);
313
- if (!resized)
314
- return {
315
- ok: !1,
316
- message: "[Image omitted: could not be resized below the inline image size limit.]"
317
- };
318
- let hints2 = [], convertedHint2 = conversionHint(normalized.convertedFrom, resized.mimeType);
319
- convertedHint2 && hints2.push(convertedHint2);
320
- let dimensionNote = formatDimensionNote(resized);
321
- return dimensionNote && hints2.push(dimensionNote), {
322
- ok: !0,
323
- data: resized.data,
324
- mimeType: resized.mimeType,
325
- hints: hints2
326
- };
327
- }
328
- let hints = [], convertedHint = conversionHint(normalized.convertedFrom, normalized.mimeType);
329
- return convertedHint && hints.push(convertedHint), {
330
- ok: !0,
331
- data: Buffer.from(normalized.bytes).toString("base64"),
332
- mimeType: normalized.mimeType,
333
- hints
334
- };
335
- }
336
-
337
249
  export {
338
- convertToPng,
250
+ applyExifOrientation,
339
251
  resizeImage,
340
- formatDimensionNote,
341
- processImage
252
+ formatDimensionNote
342
253
  };