@ashx-j/lunr-dev 0.2.13-dev.8.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.
Files changed (484) hide show
  1. package/CHANGELOG.md +60 -1
  2. package/README.md +7 -1
  3. package/dist/builtin-extensions/ashxj-thinking.d.ts +1 -0
  4. package/dist/builtin-extensions/ashxj-thinking.d.ts.map +1 -1
  5. package/dist/builtin-extensions/ashxj-thinking.js +44 -19
  6. package/dist/builtin-extensions/ashxj-thinking.js.map +1 -1
  7. package/dist/builtin-extensions/ashxj-tui.d.ts +14 -0
  8. package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
  9. package/dist/builtin-extensions/ashxj-tui.js +37 -3
  10. package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
  11. package/dist/builtin-extensions/index.d.ts +1 -15
  12. package/dist/builtin-extensions/index.d.ts.map +1 -1
  13. package/dist/builtin-extensions/index.js +8 -21
  14. package/dist/builtin-extensions/index.js.map +1 -1
  15. package/dist/builtin-extensions/lunr-computer-use.d.ts +3 -0
  16. package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -0
  17. package/dist/builtin-extensions/lunr-computer-use.js +157 -0
  18. package/dist/builtin-extensions/lunr-computer-use.js.map +1 -0
  19. package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.d.ts.map +1 -1
  20. package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js +6 -2
  21. package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js.map +1 -1
  22. package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts +4 -0
  23. package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts.map +1 -1
  24. package/dist/builtin-extensions/pi-lsp-extension/src/index.js +172 -171
  25. package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -1
  26. package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts +50 -0
  27. package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts.map +1 -0
  28. package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js +131 -0
  29. package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js.map +1 -0
  30. package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.d.ts +7 -0
  31. package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.d.ts.map +1 -0
  32. package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.js +211 -0
  33. package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.js.map +1 -0
  34. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts +0 -5
  35. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts.map +1 -1
  36. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js +0 -202
  37. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js.map +1 -1
  38. package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
  39. package/dist/builtin-extensions/pi-mcp-adapter/index.js +276 -109
  40. package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
  41. package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts +4 -1
  42. package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts.map +1 -1
  43. package/dist/builtin-extensions/pi-mcp-adapter/init.js +10 -3
  44. package/dist/builtin-extensions/pi-mcp-adapter/init.js.map +1 -1
  45. package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.d.ts.map +1 -1
  46. package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js +6 -1
  47. package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js.map +1 -1
  48. package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts +6 -1
  49. package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts.map +1 -1
  50. package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js +33 -8
  51. package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js.map +1 -1
  52. package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.d.ts.map +1 -1
  53. package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js +2 -1
  54. package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js.map +1 -1
  55. package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts +1 -1
  56. package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts.map +1 -1
  57. package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js +1 -1
  58. package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js.map +1 -1
  59. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +1 -1
  60. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
  61. package/dist/builtin-extensions/pi-subagents/src/extension/index.js +68 -15
  62. package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
  63. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
  64. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +6 -2
  65. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
  66. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts +1 -1
  67. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
  68. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +5 -2
  69. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
  70. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts +10 -0
  71. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts.map +1 -0
  72. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js +38 -0
  73. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js.map +1 -0
  74. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
  75. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +3 -16
  76. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
  77. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts +1 -1
  78. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts.map +1 -1
  79. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js +2 -0
  80. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js.map +1 -1
  81. package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.d.ts.map +1 -1
  82. package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js +1 -1
  83. package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js.map +1 -1
  84. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +1 -1
  85. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -1
  86. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +1 -1
  87. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js.map +1 -1
  88. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +2 -1
  89. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
  90. package/dist/builtin-extensions/pi-subagents/src/tui/render.js +72 -31
  91. package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
  92. package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts +1 -1
  93. package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts.map +1 -1
  94. package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js +2 -1
  95. package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js.map +1 -1
  96. package/dist/builtin-extensions/pi-web-access/extract.d.ts.map +1 -1
  97. package/dist/builtin-extensions/pi-web-access/extract.js +105 -54
  98. package/dist/builtin-extensions/pi-web-access/extract.js.map +1 -1
  99. package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts +1 -1
  100. package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts.map +1 -1
  101. package/dist/builtin-extensions/pi-web-access/gemini-search.js +82 -65
  102. package/dist/builtin-extensions/pi-web-access/gemini-search.js.map +1 -1
  103. package/dist/builtin-extensions/pi-web-access/github-extract.d.ts.map +1 -1
  104. package/dist/builtin-extensions/pi-web-access/github-extract.js +2 -0
  105. package/dist/builtin-extensions/pi-web-access/github-extract.js.map +1 -1
  106. package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
  107. package/dist/builtin-extensions/pi-web-access/index.js +259 -168
  108. package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
  109. package/dist/builtin-extensions/pi-web-access/lazy.d.ts +18 -0
  110. package/dist/builtin-extensions/pi-web-access/lazy.d.ts.map +1 -0
  111. package/dist/builtin-extensions/pi-web-access/lazy.js +19 -0
  112. package/dist/builtin-extensions/pi-web-access/lazy.js.map +1 -0
  113. package/dist/builtin-extensions/pi-web-access/session-cleanup.d.ts +6 -0
  114. package/dist/builtin-extensions/pi-web-access/session-cleanup.d.ts.map +1 -0
  115. package/dist/builtin-extensions/pi-web-access/session-cleanup.js +17 -0
  116. package/dist/builtin-extensions/pi-web-access/session-cleanup.js.map +1 -0
  117. package/dist/catalog/publication.json +12 -12
  118. package/dist/cli-runtime.d.ts +3 -0
  119. package/dist/cli-runtime.d.ts.map +1 -0
  120. package/dist/cli-runtime.js +73 -0
  121. package/dist/cli-runtime.js.map +1 -0
  122. package/dist/cli.d.ts.map +1 -1
  123. package/dist/cli.js +14 -53
  124. package/dist/cli.js.map +1 -1
  125. package/dist/config.d.ts +1 -0
  126. package/dist/config.d.ts.map +1 -1
  127. package/dist/config.js +1 -0
  128. package/dist/config.js.map +1 -1
  129. package/dist/core/agent-session-services.d.ts.map +1 -1
  130. package/dist/core/agent-session-services.js +1 -1
  131. package/dist/core/agent-session-services.js.map +1 -1
  132. package/dist/core/agent-session.d.ts +3 -0
  133. package/dist/core/agent-session.d.ts.map +1 -1
  134. package/dist/core/agent-session.js +56 -12
  135. package/dist/core/agent-session.js.map +1 -1
  136. package/dist/core/compaction/compaction.d.ts.map +1 -1
  137. package/dist/core/compaction/compaction.js +10 -5
  138. package/dist/core/compaction/compaction.js.map +1 -1
  139. package/dist/core/computer-use/adapter.d.ts +23 -0
  140. package/dist/core/computer-use/adapter.d.ts.map +1 -0
  141. package/dist/core/computer-use/adapter.js +116 -0
  142. package/dist/core/computer-use/adapter.js.map +1 -0
  143. package/dist/core/computer-use/lease.d.ts +18 -0
  144. package/dist/core/computer-use/lease.d.ts.map +1 -0
  145. package/dist/core/computer-use/lease.js +129 -0
  146. package/dist/core/computer-use/lease.js.map +1 -0
  147. package/dist/core/computer-use/macos-runtime.d.ts +14 -0
  148. package/dist/core/computer-use/macos-runtime.d.ts.map +1 -0
  149. package/dist/core/computer-use/macos-runtime.js +148 -0
  150. package/dist/core/computer-use/macos-runtime.js.map +1 -0
  151. package/dist/core/computer-use/policy.d.ts +19 -0
  152. package/dist/core/computer-use/policy.d.ts.map +1 -0
  153. package/dist/core/computer-use/policy.js +66 -0
  154. package/dist/core/computer-use/policy.js.map +1 -0
  155. package/dist/core/computer-use/release.generated.d.ts +31 -0
  156. package/dist/core/computer-use/release.generated.d.ts.map +1 -0
  157. package/dist/core/computer-use/release.generated.js +36 -0
  158. package/dist/core/computer-use/release.generated.js.map +1 -0
  159. package/dist/core/computer-use/runtime.d.ts +13 -0
  160. package/dist/core/computer-use/runtime.d.ts.map +1 -0
  161. package/dist/core/computer-use/runtime.js +158 -0
  162. package/dist/core/computer-use/runtime.js.map +1 -0
  163. package/dist/core/computer-use/schemas.d.ts +88 -0
  164. package/dist/core/computer-use/schemas.d.ts.map +1 -0
  165. package/dist/core/computer-use/schemas.js +80 -0
  166. package/dist/core/computer-use/schemas.js.map +1 -0
  167. package/dist/core/computer-use/windows-desktop.d.ts +3 -0
  168. package/dist/core/computer-use/windows-desktop.d.ts.map +1 -0
  169. package/dist/core/computer-use/windows-desktop.js +48 -0
  170. package/dist/core/computer-use/windows-desktop.js.map +1 -0
  171. package/dist/core/computer-use/workflow.d.ts +24 -0
  172. package/dist/core/computer-use/workflow.d.ts.map +1 -0
  173. package/dist/core/computer-use/workflow.js +330 -0
  174. package/dist/core/computer-use/workflow.js.map +1 -0
  175. package/dist/core/extensions/host-static.d.ts.map +1 -1
  176. package/dist/core/extensions/host-static.js +34 -12
  177. package/dist/core/extensions/host-static.js.map +1 -1
  178. package/dist/core/extensions/loader.d.ts +1 -2
  179. package/dist/core/extensions/loader.d.ts.map +1 -1
  180. package/dist/core/extensions/loader.js +10 -64
  181. package/dist/core/extensions/loader.js.map +1 -1
  182. package/dist/core/extensions/types.d.ts +2 -2
  183. package/dist/core/extensions/types.d.ts.map +1 -1
  184. package/dist/core/extensions/types.js.map +1 -1
  185. package/dist/core/footer-data-provider.d.ts.map +1 -1
  186. package/dist/core/footer-data-provider.js +2 -0
  187. package/dist/core/footer-data-provider.js.map +1 -1
  188. package/dist/core/keybindings.d.ts +2 -2
  189. package/dist/core/keybindings.d.ts.map +1 -1
  190. package/dist/core/keybindings.js +2 -2
  191. package/dist/core/keybindings.js.map +1 -1
  192. package/dist/core/model-runtime.d.ts +0 -3
  193. package/dist/core/model-runtime.d.ts.map +1 -1
  194. package/dist/core/model-runtime.js +1 -10
  195. package/dist/core/model-runtime.js.map +1 -1
  196. package/dist/core/package-manager.d.ts.map +1 -1
  197. package/dist/core/package-manager.js +1 -1
  198. package/dist/core/package-manager.js.map +1 -1
  199. package/dist/core/permissions.d.ts +1 -3
  200. package/dist/core/permissions.d.ts.map +1 -1
  201. package/dist/core/permissions.js +33 -25
  202. package/dist/core/permissions.js.map +1 -1
  203. package/dist/core/plan-mode.d.ts.map +1 -1
  204. package/dist/core/plan-mode.js +9 -0
  205. package/dist/core/plan-mode.js.map +1 -1
  206. package/dist/core/rollback.d.ts.map +1 -1
  207. package/dist/core/rollback.js +13 -90
  208. package/dist/core/rollback.js.map +1 -1
  209. package/dist/core/sdk.d.ts +1 -1
  210. package/dist/core/sdk.d.ts.map +1 -1
  211. package/dist/core/sdk.js +1 -1
  212. package/dist/core/sdk.js.map +1 -1
  213. package/dist/core/session-manager.d.ts +0 -1
  214. package/dist/core/session-manager.d.ts.map +1 -1
  215. package/dist/core/session-manager.js +21 -79
  216. package/dist/core/session-manager.js.map +1 -1
  217. package/dist/core/settings-manager.d.ts +6 -0
  218. package/dist/core/settings-manager.d.ts.map +1 -1
  219. package/dist/core/settings-manager.js +19 -0
  220. package/dist/core/settings-manager.js.map +1 -1
  221. package/dist/core/slash-commands.d.ts.map +1 -1
  222. package/dist/core/slash-commands.js +0 -1
  223. package/dist/core/slash-commands.js.map +1 -1
  224. package/dist/core/timings.d.ts +2 -1
  225. package/dist/core/timings.d.ts.map +1 -1
  226. package/dist/core/timings.js +17 -2
  227. package/dist/core/timings.js.map +1 -1
  228. package/dist/dev-cli.js +0 -0
  229. package/dist/gateway/agent-bridge.d.ts +6 -1
  230. package/dist/gateway/agent-bridge.d.ts.map +1 -1
  231. package/dist/gateway/agent-bridge.js +23 -6
  232. package/dist/gateway/agent-bridge.js.map +1 -1
  233. package/dist/gateway/commands.d.ts +1 -1
  234. package/dist/gateway/commands.d.ts.map +1 -1
  235. package/dist/gateway/commands.js +1 -18
  236. package/dist/gateway/commands.js.map +1 -1
  237. package/dist/gateway/cron.d.ts +1 -1
  238. package/dist/gateway/cron.d.ts.map +1 -1
  239. package/dist/gateway/cron.js +23 -7
  240. package/dist/gateway/cron.js.map +1 -1
  241. package/dist/main.d.ts +2 -2
  242. package/dist/main.d.ts.map +1 -1
  243. package/dist/main.js +57 -48
  244. package/dist/main.js.map +1 -1
  245. package/dist/modes/interactive/components/footer.d.ts +4 -2
  246. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  247. package/dist/modes/interactive/components/footer.js +23 -32
  248. package/dist/modes/interactive/components/footer.js.map +1 -1
  249. package/dist/modes/interactive/components/processes-selector.d.ts +2 -3
  250. package/dist/modes/interactive/components/processes-selector.d.ts.map +1 -1
  251. package/dist/modes/interactive/components/processes-selector.js +5 -10
  252. package/dist/modes/interactive/components/processes-selector.js.map +1 -1
  253. package/dist/modes/interactive/components/settings-selector.d.ts +4 -0
  254. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  255. package/dist/modes/interactive/components/settings-selector.js +20 -0
  256. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  257. package/dist/modes/interactive/interactive-mode.d.ts +12 -21
  258. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  259. package/dist/modes/interactive/interactive-mode.js +138 -152
  260. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  261. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  262. package/dist/modes/interactive/theme/theme.js +95 -84
  263. package/dist/modes/interactive/theme/theme.js.map +1 -1
  264. package/dist/modes/interactive/thinking-level-slash.d.ts +4 -0
  265. package/dist/modes/interactive/thinking-level-slash.d.ts.map +1 -0
  266. package/dist/modes/interactive/thinking-level-slash.js +23 -0
  267. package/dist/modes/interactive/thinking-level-slash.js.map +1 -0
  268. package/dist/node-runtime/adapter-AZMY335J.js +279 -0
  269. package/dist/node-runtime/agent-session-services-RSGP5GDN.js +39 -0
  270. package/dist/node-runtime/benchmark-request-UC7PD3V3.js +57 -0
  271. package/dist/node-runtime/brave-UWDA3I22.js +143 -0
  272. package/dist/node-runtime/builtin-extensions-7STLFW3A.js +29 -0
  273. package/dist/node-runtime/chunk-2IDTZAG5.js +1415 -0
  274. package/dist/node-runtime/chunk-3GHXVUAK.js +21 -0
  275. package/dist/node-runtime/chunk-3RCWXWAY.js +466 -0
  276. package/dist/node-runtime/chunk-3WFAEVKS.js +115 -0
  277. package/dist/node-runtime/chunk-3X3KZKMI.js +49 -0
  278. package/dist/node-runtime/chunk-4HXHDDCF.js +16 -0
  279. package/dist/node-runtime/chunk-4SJWFTUP.js +24 -0
  280. package/dist/node-runtime/chunk-4ZWGEEAS.js +69 -0
  281. package/dist/node-runtime/chunk-53YJI7JU.js +137 -0
  282. package/dist/node-runtime/chunk-5NWQCSKR.js +19218 -0
  283. package/dist/node-runtime/chunk-5OLJGVCB.js +68 -0
  284. package/dist/node-runtime/chunk-5Q45AVQG.js +108 -0
  285. package/dist/node-runtime/chunk-5SQDLSZJ.js +949 -0
  286. package/dist/node-runtime/chunk-6SPPH4FY.js +1269 -0
  287. package/dist/node-runtime/chunk-6UB6NKA3.js +860 -0
  288. package/dist/node-runtime/chunk-7AFOFSDY.js +105 -0
  289. package/dist/node-runtime/chunk-7N3YHTYF.js +26 -0
  290. package/dist/node-runtime/chunk-ARC4KOTI.js +11178 -0
  291. package/dist/node-runtime/chunk-AUXVGBO4.js +19 -0
  292. package/dist/node-runtime/chunk-AY6CAJSL.js +30 -0
  293. package/dist/node-runtime/chunk-BHO7O6E5.js +296 -0
  294. package/dist/node-runtime/chunk-BI3DHYCN.js +8845 -0
  295. package/dist/node-runtime/chunk-BKAZ6BKX.js +2185 -0
  296. package/dist/node-runtime/chunk-BR7YDUKA.js +109 -0
  297. package/dist/node-runtime/chunk-BRJX2PRC.js +53 -0
  298. package/dist/node-runtime/chunk-C4O2RSQQ.js +37 -0
  299. package/dist/node-runtime/chunk-CCZJ3PYY.js +17 -0
  300. package/dist/node-runtime/chunk-CGBXPL3E.js +1171 -0
  301. package/dist/node-runtime/chunk-CH6OL6P2.js +295 -0
  302. package/dist/node-runtime/chunk-CJECDQKP.js +19 -0
  303. package/dist/node-runtime/chunk-DAPBPCBP.js +53 -0
  304. package/dist/node-runtime/chunk-DDGMHUOW.js +305 -0
  305. package/dist/node-runtime/chunk-DMMTJQMQ.js +43 -0
  306. package/dist/node-runtime/chunk-DVGWF6A2.js +1180 -0
  307. package/dist/node-runtime/chunk-EH2LJQPM.js +64 -0
  308. package/dist/node-runtime/chunk-EHMBW7FA.js +772 -0
  309. package/dist/node-runtime/chunk-FLYMHKCS.js +966 -0
  310. package/dist/node-runtime/chunk-FVDOXRUD.js +96 -0
  311. package/dist/node-runtime/chunk-GZQHMEWL.js +126 -0
  312. package/dist/node-runtime/chunk-H2EOZYMP.js +57 -0
  313. package/dist/node-runtime/chunk-HQCKFM2O.js +56 -0
  314. package/dist/node-runtime/chunk-HRS4HMDX.js +610 -0
  315. package/dist/node-runtime/chunk-HYHJIRDW.js +19 -0
  316. package/dist/node-runtime/chunk-I6R76AG7.js +22 -0
  317. package/dist/node-runtime/chunk-ISQDQIZN.js +296 -0
  318. package/dist/node-runtime/chunk-J7QGQD45.js +24921 -0
  319. package/dist/node-runtime/chunk-JHYKXIMM.js +378 -0
  320. package/dist/node-runtime/chunk-JT6YCS5B.js +5648 -0
  321. package/dist/node-runtime/chunk-JZHEUQRL.js +180 -0
  322. package/dist/node-runtime/chunk-K72NVGUB.js +2834 -0
  323. package/dist/node-runtime/chunk-KKSIVROT.js +88 -0
  324. package/dist/node-runtime/chunk-LCACDWHJ.js +1743 -0
  325. package/dist/node-runtime/chunk-LTXUQJI4.js +173 -0
  326. package/dist/node-runtime/chunk-LWJXTA6Z.js +6814 -0
  327. package/dist/node-runtime/chunk-M3LZLQW2.js +98 -0
  328. package/dist/node-runtime/chunk-MGSB2C3M.js +46 -0
  329. package/dist/node-runtime/chunk-MGWCVY6Y.js +47 -0
  330. package/dist/node-runtime/chunk-MJQDX3BA.js +72 -0
  331. package/dist/node-runtime/chunk-MUMMMTW4.js +8392 -0
  332. package/dist/node-runtime/chunk-MX3GJNXJ.js +986 -0
  333. package/dist/node-runtime/chunk-NUIFPZWX.js +209 -0
  334. package/dist/node-runtime/chunk-OBMWP3I5.js +68 -0
  335. package/dist/node-runtime/chunk-OR4L3IB2.js +42 -0
  336. package/dist/node-runtime/chunk-OTT6JMPU.js +807 -0
  337. package/dist/node-runtime/chunk-PCIGF2XK.js +250 -0
  338. package/dist/node-runtime/chunk-PL6JKXWI.js +3622 -0
  339. package/dist/node-runtime/chunk-PVCDKGR6.js +55 -0
  340. package/dist/node-runtime/chunk-Q4Q6D4IY.js +364 -0
  341. package/dist/node-runtime/chunk-Q5ZU2VRT.js +83 -0
  342. package/dist/node-runtime/chunk-QFWG2RVL.js +5477 -0
  343. package/dist/node-runtime/chunk-RQ2Q5IYR.js +72 -0
  344. package/dist/node-runtime/chunk-RQ5DNUNG.js +429 -0
  345. package/dist/node-runtime/chunk-RRIZE6QQ.js +17 -0
  346. package/dist/node-runtime/chunk-SN6G4OU6.js +4753 -0
  347. package/dist/node-runtime/chunk-SWSN6HAB.js +53 -0
  348. package/dist/node-runtime/chunk-T5GM5BFH.js +7558 -0
  349. package/dist/node-runtime/chunk-TAP7QTUT.js +1346 -0
  350. package/dist/node-runtime/chunk-U6C7VTR5.js +2033 -0
  351. package/dist/node-runtime/chunk-URD2SLIT.js +1019 -0
  352. package/dist/node-runtime/chunk-VRB2IYGG.js +53 -0
  353. package/dist/node-runtime/chunk-W3CVH5RX.js +62 -0
  354. package/dist/node-runtime/chunk-W7S2REEG.js +9478 -0
  355. package/dist/node-runtime/chunk-XBWPBZBN.js +125 -0
  356. package/dist/node-runtime/chunk-XTHQ7XR7.js +509 -0
  357. package/dist/node-runtime/chunk-ZCHMJ34K.js +130 -0
  358. package/dist/node-runtime/chunk-ZRDIMBEQ.js +651 -0
  359. package/dist/node-runtime/chunk-ZSEZY3II.js +247 -0
  360. package/dist/node-runtime/cli-runtime.js +81 -0
  361. package/dist/node-runtime/clipboard-OZ63BBC6.js +12 -0
  362. package/dist/node-runtime/clipboard-image-7QR6GXVA.js +13 -0
  363. package/dist/node-runtime/command-6UXQ6XZN.js +13 -0
  364. package/dist/node-runtime/commands-LGR5VT5X.js +293 -0
  365. package/dist/node-runtime/config-FMEOZSWE.js +77 -0
  366. package/dist/node-runtime/curator-server-XCM43VEF.js +3816 -0
  367. package/dist/node-runtime/customize-XEXL2DGQ.js +12 -0
  368. package/dist/node-runtime/direct-tool-executor-TDJS7TBD.js +191 -0
  369. package/dist/node-runtime/exa-LL64QZR2.js +329 -0
  370. package/dist/node-runtime/export-html-E4DT6ZJQ.js +150 -0
  371. package/dist/node-runtime/extension-input-RV5N6APL.js +14 -0
  372. package/dist/node-runtime/extension-selector-CPD5LWDD.js +14 -0
  373. package/dist/node-runtime/extract-IUCVZCWC.js +17 -0
  374. package/dist/node-runtime/file-sync-HCOP2QVF.js +117 -0
  375. package/dist/node-runtime/gateway-3OLC4GQN.js +2139 -0
  376. package/dist/node-runtime/gemini-api-QE7ANVDZ.js +29 -0
  377. package/dist/node-runtime/gemini-search-NCIDF7NE.js +330 -0
  378. package/dist/node-runtime/gemini-url-context-OKIN7AIP.js +103 -0
  379. package/dist/node-runtime/gemini-web-MM446SEH.js +14 -0
  380. package/dist/node-runtime/github-extract-F64RZOEA.js +619 -0
  381. package/dist/node-runtime/goal-CZQ7FFQJ.js +1831 -0
  382. package/dist/node-runtime/image-resize-6ZPBFMWW.js +11 -0
  383. package/dist/node-runtime/index.js +863 -0
  384. package/dist/node-runtime/init-EKE277AG.js +30 -0
  385. package/dist/node-runtime/install-cli-TH7IJJQQ.js +308 -0
  386. package/dist/node-runtime/interactive-mode-S5M26CQ7.js +59 -0
  387. package/dist/node-runtime/interactive-view-N6F4KUIT.js +247 -0
  388. package/dist/node-runtime/lsp-manager-3ASUSO4T.js +1104 -0
  389. package/dist/node-runtime/lunr-computer-use-4X3KUNF4.js +206 -0
  390. package/dist/node-runtime/lunr-cron-KKBOGAEF.js +274 -0
  391. package/dist/node-runtime/main.js +57 -0
  392. package/dist/node-runtime/mcp-auth-flow-YL6RWPYG.js +33 -0
  393. package/dist/node-runtime/mcp-panel-IIGMXQGP.js +501 -0
  394. package/dist/node-runtime/mcp-setup-panel-FEK7663I.js +355 -0
  395. package/dist/node-runtime/memory-cap-3S4XRLNP.js +20 -0
  396. package/dist/node-runtime/model-tiers-NJLHUEGK.js +20 -0
  397. package/dist/node-runtime/openai-search-B3MSNCQA.js +288 -0
  398. package/dist/node-runtime/package-manager-cli-C4EJOO5Q.js +751 -0
  399. package/dist/node-runtime/parallel-AI2MNSCU.js +265 -0
  400. package/dist/node-runtime/parser-manager-TQHWYDH7.js +152 -0
  401. package/dist/node-runtime/pdf-extract-IPE6H4HP.js +57 -0
  402. package/dist/node-runtime/perplexity-QVJW3I35.js +12 -0
  403. package/dist/node-runtime/pi-intercom-EEMBGQID.js +2215 -0
  404. package/dist/node-runtime/pi-mcp-adapter-DPTJGAAL.js +428 -0
  405. package/dist/node-runtime/pi-ollama-cloud-4VZRMULP.js +1440 -0
  406. package/dist/node-runtime/pi-prompt-template-model-4QT4LLXF.js +3946 -0
  407. package/dist/node-runtime/pi-subagents-VKCLYIBY.js +6050 -0
  408. package/dist/node-runtime/pi-web-access-BV6DSZOP.js +1867 -0
  409. package/dist/node-runtime/print-mode-VWIRFDAC.js +12 -0
  410. package/dist/node-runtime/proxy-modes-R64LU6WZ.js +688 -0
  411. package/dist/node-runtime/rpc-entry.js +65 -0
  412. package/dist/node-runtime/rpc-mode-SJNSOA4G.js +13 -0
  413. package/dist/node-runtime/runtime-3SB5ATHQ.js +21 -0
  414. package/dist/node-runtime/runtime-bridges-UJ5WJJLN.js +14 -0
  415. package/dist/node-runtime/session-manager-QEMZBMTM.js +33 -0
  416. package/dist/node-runtime/session-selector-URVJLOTK.js +14 -0
  417. package/dist/node-runtime/settings-manager-K6IPIQTI.js +23 -0
  418. package/dist/node-runtime/src-GPFAU3N6.js +2427 -0
  419. package/dist/node-runtime/subagent-executor-EFLTO32A.js +8501 -0
  420. package/dist/node-runtime/summary-review-YSMXKITO.js +228 -0
  421. package/dist/node-runtime/tavily-WEZFVFP7.js +154 -0
  422. package/dist/node-runtime/timings-UAD5BEAS.js +16 -0
  423. package/dist/node-runtime/tool-renderer-MV5O452K.js +204 -0
  424. package/dist/node-runtime/update-cli-I6OVDRPL.js +75 -0
  425. package/dist/node-runtime/v4-5MNC3H7G.js +424 -0
  426. package/dist/node-runtime/video-extract-ETA5RA7U.js +304 -0
  427. package/dist/node-runtime/workflow-SA34S4VX.js +325 -0
  428. package/dist/node-runtime/workspace-index-6DBXSTJ6.js +163 -0
  429. package/dist/node-runtime/youtube-extract-SRVGNN26.js +264 -0
  430. package/dist/rpc.d.ts +3 -0
  431. package/dist/rpc.d.ts.map +1 -0
  432. package/dist/rpc.js +18 -0
  433. package/dist/rpc.js.map +1 -0
  434. package/dist/startup/benchmark-request.d.ts +3 -0
  435. package/dist/startup/benchmark-request.d.ts.map +1 -0
  436. package/dist/startup/benchmark-request.js +65 -0
  437. package/dist/startup/benchmark-request.js.map +1 -0
  438. package/dist/startup/{interactive-shell.d.ts → interactive-view.d.ts} +18 -18
  439. package/dist/startup/interactive-view.d.ts.map +1 -0
  440. package/dist/startup/{interactive-shell.js → interactive-view.js} +119 -52
  441. package/dist/startup/interactive-view.js.map +1 -0
  442. package/dist/startup/launch-routing.d.ts.map +1 -1
  443. package/dist/startup/launch-routing.js +9 -10
  444. package/dist/startup/launch-routing.js.map +1 -1
  445. package/dist/startup/startup-milestones.d.ts +1 -1
  446. package/dist/startup/startup-milestones.d.ts.map +1 -1
  447. package/dist/startup/startup-milestones.js +3 -2
  448. package/dist/startup/startup-milestones.js.map +1 -1
  449. package/dist/utils/await-with-abort.d.ts +2 -0
  450. package/dist/utils/await-with-abort.d.ts.map +1 -0
  451. package/dist/utils/await-with-abort.js +19 -0
  452. package/dist/utils/await-with-abort.js.map +1 -0
  453. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  454. package/dist/utils/syntax-highlight.js +10 -4
  455. package/dist/utils/syntax-highlight.js.map +1 -1
  456. package/docs/compaction.md +5 -3
  457. package/docs/computer-use.md +277 -0
  458. package/docs/development.md +5 -33
  459. package/docs/features.md +2 -3
  460. package/docs/interactive-startup.md +105 -0
  461. package/docs/keybindings.md +2 -2
  462. package/docs/terminal-setup.md +1 -1
  463. package/docs/usage.md +1 -2
  464. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  465. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  466. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  467. package/examples/extensions/gondolin/package-lock.json +2 -2
  468. package/examples/extensions/gondolin/package.json +1 -1
  469. package/examples/extensions/hidden-thinking-label.ts +1 -1
  470. package/examples/extensions/sandbox/package-lock.json +2 -2
  471. package/examples/extensions/sandbox/package.json +1 -1
  472. package/examples/extensions/with-deps/package-lock.json +2 -2
  473. package/examples/extensions/with-deps/package.json +1 -1
  474. package/install-lock/package-lock.json +3827 -0
  475. package/install-lock/package.json +18 -0
  476. package/native/computer-use/LICENSE.md +21 -0
  477. package/npm-shrinkwrap.json +3808 -0
  478. package/package.json +30 -24
  479. package/dist/core/swarm.d.ts +0 -23
  480. package/dist/core/swarm.d.ts.map +0 -1
  481. package/dist/core/swarm.js +0 -45
  482. package/dist/core/swarm.js.map +0 -1
  483. package/dist/startup/interactive-shell.d.ts.map +0 -1
  484. package/dist/startup/interactive-shell.js.map +0 -1
@@ -0,0 +1,72 @@
1
+ import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
2
+
3
+ // packages/coding-agent/dist/utils/photon.js
4
+ import { createRequire } from "module";
5
+ import * as path from "path";
6
+ import { fileURLToPath } from "url";
7
+ var require2 = createRequire(new URL("../utils/photon.js", import.meta.url).href), fs = require2("fs"), WASM_FILENAME = "photon_rs_bg.wasm", photonModule = null, loadPromise = null;
8
+ function pathOrNull(file) {
9
+ return typeof file == "string" ? file : file instanceof URL ? fileURLToPath(file) : null;
10
+ }
11
+ function getFallbackWasmPaths() {
12
+ let execDir = path.dirname(process.execPath);
13
+ return [
14
+ path.join(execDir, WASM_FILENAME),
15
+ path.join(execDir, "photon", WASM_FILENAME),
16
+ path.join(process.cwd(), WASM_FILENAME)
17
+ ];
18
+ }
19
+ function patchPhotonWasmRead() {
20
+ let originalReadFileSync = fs.readFileSync.bind(fs), fallbackPaths = getFallbackWasmPaths(), mutableFs = fs, patchedReadFileSync = ((...args) => {
21
+ let [file, options] = args;
22
+ if (pathOrNull(file)?.endsWith(WASM_FILENAME))
23
+ try {
24
+ return originalReadFileSync(...args);
25
+ } catch (error) {
26
+ let err = error;
27
+ if (err?.code && err.code !== "ENOENT")
28
+ throw error;
29
+ for (let fallbackPath of fallbackPaths)
30
+ if (fs.existsSync(fallbackPath))
31
+ return options === void 0 ? originalReadFileSync(fallbackPath) : originalReadFileSync(fallbackPath, options);
32
+ throw error;
33
+ }
34
+ return originalReadFileSync(...args);
35
+ });
36
+ try {
37
+ mutableFs.readFileSync = patchedReadFileSync;
38
+ } catch {
39
+ Object.defineProperty(fs, "readFileSync", {
40
+ value: patchedReadFileSync,
41
+ writable: !0,
42
+ configurable: !0
43
+ });
44
+ }
45
+ return () => {
46
+ try {
47
+ mutableFs.readFileSync = originalReadFileSync;
48
+ } catch {
49
+ Object.defineProperty(fs, "readFileSync", {
50
+ value: originalReadFileSync,
51
+ writable: !0,
52
+ configurable: !0
53
+ });
54
+ }
55
+ };
56
+ }
57
+ async function loadPhoton() {
58
+ return photonModule || loadPromise || (loadPromise = (async () => {
59
+ let restoreReadFileSync = patchPhotonWasmRead();
60
+ try {
61
+ return photonModule = await import("@silvia-odwyer/photon-node"), photonModule;
62
+ } catch {
63
+ return photonModule = null, photonModule;
64
+ } finally {
65
+ restoreReadFileSync();
66
+ }
67
+ })(), loadPromise);
68
+ }
69
+
70
+ export {
71
+ loadPhoton
72
+ };
@@ -0,0 +1,429 @@
1
+ import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
2
+ import {
3
+ VERSION,
4
+ appendDebugLog,
5
+ getAgentDir
6
+ } from "./chunk-PCIGF2XK.js";
7
+
8
+ // packages/coding-agent/dist/gateway/config.js
9
+ import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
10
+ import { join } from "node:path";
11
+ function gatewayConfigPath() {
12
+ return join(getAgentDir(), "gateway.json");
13
+ }
14
+ function defaultPlatformConfig(requireMention) {
15
+ return {
16
+ enabled: !1,
17
+ allowedUsers: [],
18
+ allowedChats: [],
19
+ requireMention,
20
+ freeResponseChats: []
21
+ };
22
+ }
23
+ function defaultGatewayConfig() {
24
+ return {
25
+ telegram: defaultPlatformConfig(!1),
26
+ discord: { ...defaultPlatformConfig(!0), ignoredChannels: [], autoThread: !0 },
27
+ groupSessionsPerUser: !0,
28
+ unauthorizedDmBehavior: "pair",
29
+ streaming: { enabled: !0, editIntervalMs: 800, bufferThreshold: 24 }
30
+ };
31
+ }
32
+ function asStringArray(value) {
33
+ if (Array.isArray(value))
34
+ return value.every((v) => typeof v == "string") ? value : void 0;
35
+ }
36
+ function asBoolean(value) {
37
+ return typeof value == "boolean" ? value : void 0;
38
+ }
39
+ function asNumber(value) {
40
+ return typeof value == "number" && Number.isFinite(value) ? value : void 0;
41
+ }
42
+ function sanitizePlatform(raw, base) {
43
+ if (raw == null || typeof raw != "object" || Array.isArray(raw))
44
+ return base;
45
+ let r = raw;
46
+ return {
47
+ enabled: asBoolean(r.enabled) ?? base.enabled,
48
+ token: typeof r.token == "string" ? r.token : base.token,
49
+ allowedUsers: asStringArray(r.allowedUsers) ?? base.allowedUsers,
50
+ allowedChats: asStringArray(r.allowedChats) ?? base.allowedChats,
51
+ requireMention: asBoolean(r.requireMention) ?? base.requireMention,
52
+ freeResponseChats: asStringArray(r.freeResponseChats) ?? base.freeResponseChats,
53
+ homeChannel: typeof r.homeChannel == "string" ? r.homeChannel : base.homeChannel
54
+ };
55
+ }
56
+ function sanitizeDiscord(raw, base) {
57
+ let platform = sanitizePlatform(raw, base), r = raw != null && typeof raw == "object" && !Array.isArray(raw) ? raw : {};
58
+ return {
59
+ ...platform,
60
+ ignoredChannels: asStringArray(r.ignoredChannels) ?? base.ignoredChannels,
61
+ autoThread: asBoolean(r.autoThread) ?? base.autoThread
62
+ };
63
+ }
64
+ function sanitizeConfig(raw) {
65
+ let base = defaultGatewayConfig();
66
+ if (raw == null || typeof raw != "object" || Array.isArray(raw))
67
+ return base;
68
+ let r = raw, streamingRaw = r.streaming != null && typeof r.streaming == "object" && !Array.isArray(r.streaming) ? r.streaming : {};
69
+ return {
70
+ telegram: sanitizePlatform(r.telegram, base.telegram),
71
+ discord: sanitizeDiscord(r.discord, base.discord),
72
+ groupSessionsPerUser: asBoolean(r.groupSessionsPerUser) ?? base.groupSessionsPerUser,
73
+ unauthorizedDmBehavior: r.unauthorizedDmBehavior === "ignore" ? "ignore" : "pair",
74
+ streaming: {
75
+ enabled: asBoolean(streamingRaw.enabled) ?? base.streaming.enabled,
76
+ editIntervalMs: asNumber(streamingRaw.editIntervalMs) ?? base.streaming.editIntervalMs,
77
+ bufferThreshold: asNumber(streamingRaw.bufferThreshold) ?? base.streaming.bufferThreshold
78
+ }
79
+ };
80
+ }
81
+ function loadGatewayConfig() {
82
+ let path = gatewayConfigPath();
83
+ if (!existsSync(path))
84
+ return defaultGatewayConfig();
85
+ try {
86
+ return sanitizeConfig(JSON.parse(readFileSync(path, "utf-8")));
87
+ } catch (err) {
88
+ return console.error(`[gateway] Failed to load config from ${path}: ${err}`), defaultGatewayConfig();
89
+ }
90
+ }
91
+ function saveGatewayConfig(config) {
92
+ let path = gatewayConfigPath(), dir = getAgentDir();
93
+ existsSync(dir) || mkdirSync(dir, { recursive: !0 });
94
+ let tmp = `${path}.tmp-${process.pid}`;
95
+ writeFileSync(tmp, `${JSON.stringify(config, null, 2)}
96
+ `, "utf-8"), renameSync(tmp, path);
97
+ try {
98
+ chmodSync(path, 384);
99
+ } catch {
100
+ }
101
+ }
102
+ function resolvePlatformToken(platform, platformCfg) {
103
+ let upper = platform.toUpperCase();
104
+ return process.env[`LUNR_${upper}_BOT_TOKEN`] ?? process.env[`${upper}_BOT_TOKEN`] ?? platformCfg.token;
105
+ }
106
+ function platformConfigFor(cfg, platform) {
107
+ if (platform === "telegram")
108
+ return cfg.telegram;
109
+ if (platform === "discord")
110
+ return cfg.discord;
111
+ }
112
+
113
+ // packages/coding-agent/dist/core/install-features.js
114
+ import { chmodSync as chmodSync2, existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync2, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
115
+ import { join as join2 } from "node:path";
116
+ var FEATURE_CATALOG = [
117
+ {
118
+ id: "chat-platforms",
119
+ title: "Chat platforms",
120
+ summary: "Discord + Telegram gateway so lunR can talk in chat apps.",
121
+ defaultEnabled: !1,
122
+ options: [
123
+ {
124
+ id: "autostart",
125
+ type: "boolean",
126
+ prompt: "Auto-start the lunR gateway daemon when you log in?",
127
+ default: !1,
128
+ askWhen: "chat-platforms"
129
+ },
130
+ {
131
+ id: "telegram-token",
132
+ type: "secret",
133
+ prompt: "Telegram bot token (empty skips; stored in gateway.json)",
134
+ askWhen: "chat-platforms"
135
+ },
136
+ {
137
+ id: "discord-token",
138
+ type: "secret",
139
+ prompt: "Discord bot token (empty skips; stored in gateway.json)",
140
+ askWhen: "chat-platforms"
141
+ }
142
+ ]
143
+ }
144
+ ], CHAT_PLATFORMS_INFER_UNTIL = "0.2.0";
145
+ function installFeaturesPath() {
146
+ return join2(getAgentDir(), "install-features.json");
147
+ }
148
+ function getFeatureSpec(id) {
149
+ return FEATURE_CATALOG.find((f) => f.id === id);
150
+ }
151
+ function getFeatureOptionSpec(id, option) {
152
+ return getFeatureSpec(id)?.options.find((o) => o.id === option);
153
+ }
154
+ function versionGte(a, b) {
155
+ let pa = a.split(".").map((p) => Number.parseInt(p, 10) || 0), pb = b.split(".").map((p) => Number.parseInt(p, 10) || 0);
156
+ for (let i = 0; i < 3; i++) {
157
+ let d = (pa[i] ?? 0) - (pb[i] ?? 0);
158
+ if (d !== 0)
159
+ return d > 0;
160
+ }
161
+ return !0;
162
+ }
163
+ function emptyFile(now = (/* @__PURE__ */ new Date()).toISOString()) {
164
+ return {
165
+ schemaVersion: 1,
166
+ installerVersion: VERSION,
167
+ installMethod: "binary",
168
+ installedAt: now,
169
+ updatedAt: now,
170
+ features: {}
171
+ };
172
+ }
173
+ function sanitizeState(raw) {
174
+ if (raw == null || typeof raw != "object" || Array.isArray(raw))
175
+ return;
176
+ let r = raw;
177
+ if (typeof r.enabled != "boolean")
178
+ return;
179
+ let options = {};
180
+ if (r.options != null && typeof r.options == "object" && !Array.isArray(r.options))
181
+ for (let [k, v] of Object.entries(r.options))
182
+ (typeof v == "boolean" || typeof v == "string" || typeof v == "number") && (options[k] = v);
183
+ return { enabled: r.enabled, options };
184
+ }
185
+ function sanitizeFile(raw) {
186
+ if (raw == null || typeof raw != "object" || Array.isArray(raw))
187
+ return;
188
+ let r = raw;
189
+ if (r.schemaVersion !== 1)
190
+ return;
191
+ let features = {};
192
+ if (r.features != null && typeof r.features == "object" && !Array.isArray(r.features))
193
+ for (let [id, state] of Object.entries(r.features)) {
194
+ let sanitized = sanitizeState(state);
195
+ sanitized && (features[id] = sanitized);
196
+ }
197
+ let now = (/* @__PURE__ */ new Date()).toISOString();
198
+ return {
199
+ schemaVersion: 1,
200
+ installerVersion: typeof r.installerVersion == "string" ? r.installerVersion : VERSION,
201
+ installMethod: "binary",
202
+ installedAt: typeof r.installedAt == "string" ? r.installedAt : now,
203
+ updatedAt: typeof r.updatedAt == "string" ? r.updatedAt : now,
204
+ inferUntil: typeof r.inferUntil == "string" ? r.inferUntil : void 0,
205
+ features
206
+ };
207
+ }
208
+ function gatewayHasEnabledFileToken() {
209
+ let cfg = loadGatewayConfig();
210
+ for (let platform of [cfg.telegram, cfg.discord])
211
+ if (platform.enabled && typeof platform.token == "string" && platform.token.length > 0)
212
+ return !0;
213
+ return !1;
214
+ }
215
+ function inferPathActive() {
216
+ return VERSION.startsWith("0.80.") ? !0 : !versionGte(VERSION, CHAT_PLATFORMS_INFER_UNTIL);
217
+ }
218
+ function inferFromGateway() {
219
+ if (!inferPathActive() || !gatewayHasEnabledFileToken())
220
+ return;
221
+ let now = (/* @__PURE__ */ new Date()).toISOString(), file = {
222
+ ...emptyFile(now),
223
+ inferUntil: CHAT_PLATFORMS_INFER_UNTIL,
224
+ features: {
225
+ "chat-platforms": { enabled: !0, options: { autostart: !1 } }
226
+ }
227
+ };
228
+ return saveInstallFeatures(file), appendDebugLog("install-features: inferred chat-platforms enabled (file token, autostart false)"), file;
229
+ }
230
+ function loadInstallFeatures() {
231
+ let path = installFeaturesPath();
232
+ if (!existsSync2(path))
233
+ return inferFromGateway() ?? emptyFile();
234
+ try {
235
+ return sanitizeFile(JSON.parse(readFileSync2(path, "utf-8"))) ?? inferFromGateway() ?? emptyFile();
236
+ } catch {
237
+ return inferFromGateway() ?? emptyFile();
238
+ }
239
+ }
240
+ function saveInstallFeatures(file) {
241
+ let path = installFeaturesPath(), dir = getAgentDir();
242
+ existsSync2(dir) || mkdirSync2(dir, { recursive: !0 });
243
+ let tmp = `${path}.tmp-${process.pid}`;
244
+ writeFileSync2(tmp, `${JSON.stringify(file, null, 2)}
245
+ `, "utf-8"), renameSync2(tmp, path);
246
+ try {
247
+ chmodSync2(path, 420);
248
+ } catch {
249
+ }
250
+ }
251
+ function isFeatureEnabled(id) {
252
+ let state = loadInstallFeatures().features[id];
253
+ return state ? state.enabled : getFeatureSpec(id)?.defaultEnabled ?? !1;
254
+ }
255
+ function coerceBooleanSetValue(raw) {
256
+ if (raw === "true" || raw === "1")
257
+ return !0;
258
+ if (raw === "false" || raw === "0")
259
+ return !1;
260
+ }
261
+ function parseSetAssignment(raw) {
262
+ let eq = raw.indexOf("=");
263
+ if (eq <= 0)
264
+ return;
265
+ let lhs = raw.slice(0, eq), value = raw.slice(eq + 1), dot = lhs.indexOf(".");
266
+ if (!(dot <= 0 || dot === lhs.length - 1))
267
+ return { id: lhs.slice(0, dot), option: lhs.slice(dot + 1), value };
268
+ }
269
+ function parseFeatureFlags(argv) {
270
+ let yes = !1, reconfigure = !1, features = [], noFeatures = [], sets = [];
271
+ for (let i = 0; i < argv.length; i++) {
272
+ let arg = argv[i];
273
+ if (arg === "--yes" || arg === "-y") {
274
+ yes = !0;
275
+ continue;
276
+ }
277
+ if (arg === "--reconfigure") {
278
+ reconfigure = !0;
279
+ continue;
280
+ }
281
+ if (arg === "--feature") {
282
+ let id = argv[++i];
283
+ if (!id)
284
+ return { ok: !1, error: "--feature requires an id" };
285
+ features.push(id);
286
+ continue;
287
+ }
288
+ if (arg === "--no-feature") {
289
+ let id = argv[++i];
290
+ if (!id)
291
+ return { ok: !1, error: "--no-feature requires an id" };
292
+ noFeatures.push(id);
293
+ continue;
294
+ }
295
+ if (arg === "--set") {
296
+ let raw = argv[++i];
297
+ if (!raw)
298
+ return { ok: !1, error: "--set requires <id.option>=<value>" };
299
+ let parsed = parseSetAssignment(raw);
300
+ if (!parsed)
301
+ return { ok: !1, error: `invalid --set ${raw}` };
302
+ sets.push(parsed);
303
+ continue;
304
+ }
305
+ if (arg.startsWith("--feature=")) {
306
+ features.push(arg.slice(10));
307
+ continue;
308
+ }
309
+ if (arg.startsWith("--no-feature=")) {
310
+ noFeatures.push(arg.slice(13));
311
+ continue;
312
+ }
313
+ if (arg.startsWith("--set=")) {
314
+ let parsed = parseSetAssignment(arg.slice(6));
315
+ if (!parsed)
316
+ return { ok: !1, error: `invalid --set ${arg}` };
317
+ sets.push(parsed);
318
+ continue;
319
+ }
320
+ return { ok: !1, error: `unknown flag ${arg}` };
321
+ }
322
+ return { ok: !0, yes, reconfigure, features, noFeatures, sets };
323
+ }
324
+ function applyFeatureFlags(current, flags) {
325
+ let next = {
326
+ ...current,
327
+ installerVersion: VERSION,
328
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
329
+ features: { ...current.features }
330
+ }, secrets = {}, enabledIds = [], disabledIds = [];
331
+ for (let id of flags.features) {
332
+ if (!getFeatureSpec(id))
333
+ return { ok: !1, error: `unknown feature ${id}`, exitCode: 2 };
334
+ let prev = next.features[id];
335
+ next.features[id] = { enabled: !0, options: { ...prev?.options } }, enabledIds.push(id);
336
+ }
337
+ for (let id of flags.noFeatures) {
338
+ if (!getFeatureSpec(id))
339
+ return { ok: !1, error: `unknown feature ${id}`, exitCode: 2 };
340
+ let prev = next.features[id];
341
+ next.features[id] = { enabled: !1, options: { ...prev?.options } }, disabledIds.push(id);
342
+ }
343
+ for (let set of flags.sets) {
344
+ if (!getFeatureSpec(set.id))
345
+ return { ok: !1, error: `unknown feature ${set.id}`, exitCode: 2 };
346
+ let option = getFeatureOptionSpec(set.id, set.option);
347
+ if (!option)
348
+ return { ok: !1, error: `unknown option ${set.id}.${set.option}`, exitCode: 2 };
349
+ if (option.type === "secret")
350
+ return {
351
+ ok: !1,
352
+ error: `cannot --set a secret option (${set.id}.${set.option}). set LUNR_TELEGRAM_BOT_TOKEN / LUNR_DISCORD_BOT_TOKEN, or run setup in a TTY`,
353
+ exitCode: 2
354
+ };
355
+ if (!(flags.features.includes(set.id) || next.features[set.id]?.enabled === !0))
356
+ return { ok: !1, error: `enable the feature first (${set.id})`, exitCode: 2 };
357
+ if (option.type === "boolean") {
358
+ let coerced = coerceBooleanSetValue(set.value);
359
+ if (coerced === void 0)
360
+ return { ok: !1, error: `${set.id}.${set.option} must be true|false|1|0`, exitCode: 2 };
361
+ let prev = next.features[set.id] ?? { enabled: !0, options: {} };
362
+ next.features[set.id] = { ...prev, enabled: !0, options: { ...prev.options, [set.option]: coerced } };
363
+ }
364
+ }
365
+ return { ok: !0, next, secrets, enabledIds, disabledIds };
366
+ }
367
+ function persistEnvAndSecretTokens(secrets) {
368
+ let cfg = loadGatewayConfig(), telegram = secrets["telegram-token"] || process.env.LUNR_TELEGRAM_BOT_TOKEN || process.env.TELEGRAM_BOT_TOKEN, discord = secrets["discord-token"] || process.env.LUNR_DISCORD_BOT_TOKEN || process.env.DISCORD_BOT_TOKEN;
369
+ telegram && (cfg.telegram.token = telegram, cfg.telegram.enabled = !0), discord && (cfg.discord.token = discord, cfg.discord.enabled = !0), saveGatewayConfig(cfg);
370
+ }
371
+ var chatPlatformsHandler = {
372
+ async apply(ctx) {
373
+ persistEnvAndSecretTokens(ctx.secrets);
374
+ let cfg = loadGatewayConfig();
375
+ if (cfg.telegram.token && (cfg.telegram.enabled = !0), cfg.discord.token && (cfg.discord.enabled = !0), saveGatewayConfig(cfg), ctx.next.options.autostart === !0) {
376
+ let hasFileToken = !!(cfg.telegram.token || cfg.discord.token);
377
+ console.error(hasFileToken ? "chat-platforms: autostart recorded; login item install is not in this build yet." : "chat-platforms: autostart requested but no file token in gateway.json \u2014 unit not enabled.");
378
+ }
379
+ },
380
+ async disable(opts) {
381
+ let cfg = loadGatewayConfig();
382
+ cfg.telegram.enabled = !1, cfg.discord.enabled = !1, opts.purgeSecrets && (delete cfg.telegram.token, delete cfg.discord.token), saveGatewayConfig(cfg);
383
+ }
384
+ }, FEATURE_HANDLERS = {
385
+ "chat-platforms": chatPlatformsHandler
386
+ };
387
+ function appendInstallLog(line) {
388
+ try {
389
+ let dir = getAgentDir();
390
+ existsSync2(dir) || mkdirSync2(dir, { recursive: !0 });
391
+ let path = join2(dir, "install.log");
392
+ writeFileSync2(path, `${(/* @__PURE__ */ new Date()).toISOString()} ${line}
393
+ `, { encoding: "utf-8", flag: "a" });
394
+ } catch {
395
+ }
396
+ }
397
+ var PRODUCT_UNINSTALL_FLAGS = /* @__PURE__ */ new Set(["--purge", "--yes", "-y"]);
398
+ function isProductUninstallArgv(rest) {
399
+ return rest.every((arg) => PRODUCT_UNINSTALL_FLAGS.has(arg));
400
+ }
401
+ function deliverMentionsChatPlatform(deliver) {
402
+ return deliver.split(",").some((part) => {
403
+ let name = part.trim().split(":")[0]?.toLowerCase();
404
+ return name === "telegram" || name === "discord";
405
+ });
406
+ }
407
+ function chatPlatformDeliverBlockedMessage() {
408
+ return "chat platforms are not enabled. Enable with: lunr features enable chat-platforms";
409
+ }
410
+
411
+ export {
412
+ gatewayConfigPath,
413
+ loadGatewayConfig,
414
+ saveGatewayConfig,
415
+ resolvePlatformToken,
416
+ platformConfigFor,
417
+ FEATURE_CATALOG,
418
+ getFeatureSpec,
419
+ loadInstallFeatures,
420
+ saveInstallFeatures,
421
+ isFeatureEnabled,
422
+ parseFeatureFlags,
423
+ applyFeatureFlags,
424
+ FEATURE_HANDLERS,
425
+ appendInstallLog,
426
+ isProductUninstallArgv,
427
+ deliverMentionsChatPlatform,
428
+ chatPlatformDeliverBlockedMessage
429
+ };
@@ -0,0 +1,17 @@
1
+ import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
2
+
3
+ // packages/coding-agent/dist/utils/await-with-abort.js
4
+ function awaitWithAbort(pending, signal) {
5
+ return signal ? new Promise((resolve, reject) => {
6
+ let abort = () => reject(signal.reason);
7
+ signal.aborted ? abort() : signal.addEventListener("abort", abort, { once: !0 }), pending.then((value) => {
8
+ signal.removeEventListener("abort", abort), resolve(value);
9
+ }, (error) => {
10
+ signal.removeEventListener("abort", abort), reject(error);
11
+ });
12
+ }) : pending;
13
+ }
14
+
15
+ export {
16
+ awaitWithAbort
17
+ };