@ashx-j/lunr 0.2.21 → 0.2.22

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 (438) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +20 -4
  3. package/dist/builtin-extensions/index.d.ts.map +1 -1
  4. package/dist/builtin-extensions/index.js +1 -0
  5. package/dist/builtin-extensions/index.js.map +1 -1
  6. package/dist/builtin-extensions/lunr-browser.d.ts +3 -0
  7. package/dist/builtin-extensions/lunr-browser.d.ts.map +1 -0
  8. package/dist/builtin-extensions/lunr-browser.js +56 -0
  9. package/dist/builtin-extensions/lunr-browser.js.map +1 -0
  10. package/dist/builtin-extensions/lunr-todos.d.ts.map +1 -1
  11. package/dist/builtin-extensions/lunr-todos.js +15 -0
  12. package/dist/builtin-extensions/lunr-todos.js.map +1 -1
  13. package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -1
  14. package/dist/builtin-extensions/pi-intercom/index.js +3 -0
  15. package/dist/builtin-extensions/pi-intercom/index.js.map +1 -1
  16. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts +1 -1
  17. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts.map +1 -1
  18. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js +5 -1
  19. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js.map +1 -1
  20. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +2 -2
  21. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
  22. package/dist/builtin-extensions/pi-subagents/src/extension/index.js +18 -5
  23. package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
  24. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +4 -3
  25. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
  26. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +3 -0
  27. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
  28. package/dist/builtin-extensions/pi-subagents/src/intercom/communication.d.ts +17 -0
  29. package/dist/builtin-extensions/pi-subagents/src/intercom/communication.d.ts.map +1 -0
  30. package/dist/builtin-extensions/pi-subagents/src/intercom/communication.js +45 -0
  31. package/dist/builtin-extensions/pi-subagents/src/intercom/communication.js.map +1 -0
  32. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts.map +1 -1
  33. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js +4 -11
  34. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js.map +1 -1
  35. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts +4 -1
  36. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -1
  37. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js +160 -51
  38. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -1
  39. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts.map +1 -1
  40. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js +5 -0
  41. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js.map +1 -1
  42. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts +2 -0
  43. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts.map +1 -1
  44. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js +3 -2
  45. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js.map +1 -1
  46. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts +1 -0
  47. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts.map +1 -1
  48. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js +2 -1
  49. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js.map +1 -1
  50. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts +1 -0
  51. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts.map +1 -1
  52. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js +2 -0
  53. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js.map +1 -1
  54. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts.map +1 -1
  55. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js +3 -0
  56. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js.map +1 -1
  57. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts +1 -0
  58. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts.map +1 -1
  59. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js +3 -0
  60. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js.map +1 -1
  61. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
  62. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +1 -1
  63. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
  64. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +1 -0
  65. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
  66. package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
  67. package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts +18 -0
  68. package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts.map +1 -0
  69. package/dist/builtin-extensions/pi-subagents/src/tui/communication.js +47 -0
  70. package/dist/builtin-extensions/pi-subagents/src/tui/communication.js.map +1 -0
  71. package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
  72. package/dist/builtin-extensions/pi-web-access/index.js +11 -7
  73. package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
  74. package/dist/cli/args.d.ts.map +1 -1
  75. package/dist/cli/args.js +2 -1
  76. package/dist/cli/args.js.map +1 -1
  77. package/dist/cli/install-cli.d.ts.map +1 -1
  78. package/dist/cli/install-cli.js +15 -45
  79. package/dist/cli/install-cli.js.map +1 -1
  80. package/dist/core/agent-session-runtime.d.ts +9 -0
  81. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  82. package/dist/core/agent-session-runtime.js +126 -29
  83. package/dist/core/agent-session-runtime.js.map +1 -1
  84. package/dist/core/agent-session.d.ts +3 -0
  85. package/dist/core/agent-session.d.ts.map +1 -1
  86. package/dist/core/agent-session.js +20 -2
  87. package/dist/core/agent-session.js.map +1 -1
  88. package/dist/core/browser/network.d.ts +9 -0
  89. package/dist/core/browser/network.d.ts.map +1 -0
  90. package/dist/core/browser/network.js +146 -0
  91. package/dist/core/browser/network.js.map +1 -0
  92. package/dist/core/browser/runtime.d.ts +24 -0
  93. package/dist/core/browser/runtime.d.ts.map +1 -0
  94. package/dist/core/browser/runtime.js +289 -0
  95. package/dist/core/browser/runtime.js.map +1 -0
  96. package/dist/core/browser/schema.d.ts +16 -0
  97. package/dist/core/browser/schema.d.ts.map +1 -0
  98. package/dist/core/browser/schema.js +36 -0
  99. package/dist/core/browser/schema.js.map +1 -0
  100. package/dist/core/browser/settings.d.ts +8 -0
  101. package/dist/core/browser/settings.d.ts.map +1 -0
  102. package/dist/core/browser/settings.js +30 -0
  103. package/dist/core/browser/settings.js.map +1 -0
  104. package/dist/core/browser/setup.d.ts +2 -0
  105. package/dist/core/browser/setup.d.ts.map +1 -0
  106. package/dist/core/browser/setup.js +16 -0
  107. package/dist/core/browser/setup.js.map +1 -0
  108. package/dist/core/customize.d.ts.map +1 -1
  109. package/dist/core/customize.js +15 -14
  110. package/dist/core/customize.js.map +1 -1
  111. package/dist/core/export-html/index.d.ts.map +1 -1
  112. package/dist/core/export-html/index.js +1 -1
  113. package/dist/core/export-html/index.js.map +1 -1
  114. package/dist/core/extensions/runner.d.ts +1 -0
  115. package/dist/core/extensions/runner.d.ts.map +1 -1
  116. package/dist/core/extensions/runner.js +1 -1
  117. package/dist/core/extensions/runner.js.map +1 -1
  118. package/dist/core/extensions/types.d.ts +1 -1
  119. package/dist/core/extensions/types.d.ts.map +1 -1
  120. package/dist/core/extensions/types.js.map +1 -1
  121. package/dist/core/install-features.d.ts.map +1 -1
  122. package/dist/core/install-features.js +10 -8
  123. package/dist/core/install-features.js.map +1 -1
  124. package/dist/core/memory-cap.d.ts.map +1 -1
  125. package/dist/core/memory-cap.js +5 -3
  126. package/dist/core/memory-cap.js.map +1 -1
  127. package/dist/core/model-tiers.d.ts.map +1 -1
  128. package/dist/core/model-tiers.js +9 -6
  129. package/dist/core/model-tiers.js.map +1 -1
  130. package/dist/core/permissions.d.ts.map +1 -1
  131. package/dist/core/permissions.js +9 -0
  132. package/dist/core/permissions.js.map +1 -1
  133. package/dist/core/plan-mode.d.ts.map +1 -1
  134. package/dist/core/plan-mode.js +3 -0
  135. package/dist/core/plan-mode.js.map +1 -1
  136. package/dist/core/process-registry.d.ts.map +1 -1
  137. package/dist/core/process-registry.js +6 -4
  138. package/dist/core/process-registry.js.map +1 -1
  139. package/dist/core/runtime-scope.d.ts +11 -0
  140. package/dist/core/runtime-scope.d.ts.map +1 -0
  141. package/dist/core/runtime-scope.js +3 -0
  142. package/dist/core/runtime-scope.js.map +1 -0
  143. package/dist/core/sdk.d.ts.map +1 -1
  144. package/dist/core/sdk.js +13 -0
  145. package/dist/core/sdk.js.map +1 -1
  146. package/dist/core/session-handoff.d.ts +35 -0
  147. package/dist/core/session-handoff.d.ts.map +1 -0
  148. package/dist/core/session-handoff.js +214 -0
  149. package/dist/core/session-handoff.js.map +1 -0
  150. package/dist/core/session-manager.d.ts +20 -0
  151. package/dist/core/session-manager.d.ts.map +1 -1
  152. package/dist/core/session-manager.js +184 -22
  153. package/dist/core/session-manager.js.map +1 -1
  154. package/dist/core/session-ownership.d.ts +28 -0
  155. package/dist/core/session-ownership.d.ts.map +1 -0
  156. package/dist/core/session-ownership.js +138 -0
  157. package/dist/core/session-ownership.js.map +1 -0
  158. package/dist/core/session-retention.d.ts.map +1 -1
  159. package/dist/core/session-retention.js +11 -2
  160. package/dist/core/session-retention.js.map +1 -1
  161. package/dist/core/settings-manager.d.ts +7 -0
  162. package/dist/core/settings-manager.d.ts.map +1 -1
  163. package/dist/core/settings-manager.js +18 -0
  164. package/dist/core/settings-manager.js.map +1 -1
  165. package/dist/core/slash-commands.d.ts.map +1 -1
  166. package/dist/core/slash-commands.js +2 -0
  167. package/dist/core/slash-commands.js.map +1 -1
  168. package/dist/core/system-prompt.d.ts.map +1 -1
  169. package/dist/core/system-prompt.js +5 -2
  170. package/dist/core/system-prompt.js.map +1 -1
  171. package/dist/core/todo-settings.d.ts +5 -0
  172. package/dist/core/todo-settings.d.ts.map +1 -0
  173. package/dist/core/todo-settings.js +7 -0
  174. package/dist/core/todo-settings.js.map +1 -0
  175. package/dist/core/tools/bash.d.ts.map +1 -1
  176. package/dist/core/tools/bash.js +4 -4
  177. package/dist/core/tools/bash.js.map +1 -1
  178. package/dist/core/tools/edit.d.ts.map +1 -1
  179. package/dist/core/tools/edit.js +5 -3
  180. package/dist/core/tools/edit.js.map +1 -1
  181. package/dist/core/tools/find.d.ts.map +1 -1
  182. package/dist/core/tools/find.js +4 -4
  183. package/dist/core/tools/find.js.map +1 -1
  184. package/dist/core/tools/grep.d.ts.map +1 -1
  185. package/dist/core/tools/grep.js +4 -4
  186. package/dist/core/tools/grep.js.map +1 -1
  187. package/dist/core/tools/ls.d.ts.map +1 -1
  188. package/dist/core/tools/ls.js +4 -4
  189. package/dist/core/tools/ls.js.map +1 -1
  190. package/dist/core/tools/read.d.ts.map +1 -1
  191. package/dist/core/tools/read.js +4 -4
  192. package/dist/core/tools/read.js.map +1 -1
  193. package/dist/core/tools/render-utils.d.ts +11 -2
  194. package/dist/core/tools/render-utils.d.ts.map +1 -1
  195. package/dist/core/tools/render-utils.js +31 -4
  196. package/dist/core/tools/render-utils.js.map +1 -1
  197. package/dist/core/tools/write.d.ts.map +1 -1
  198. package/dist/core/tools/write.js +4 -4
  199. package/dist/core/tools/write.js.map +1 -1
  200. package/dist/core/usage-service.d.ts.map +1 -1
  201. package/dist/core/usage-service.js +5 -3
  202. package/dist/core/usage-service.js.map +1 -1
  203. package/dist/gateway/adapters/discord.d.ts +12 -1
  204. package/dist/gateway/adapters/discord.d.ts.map +1 -1
  205. package/dist/gateway/adapters/discord.js +112 -17
  206. package/dist/gateway/adapters/discord.js.map +1 -1
  207. package/dist/gateway/adapters/telegram.d.ts +4 -2
  208. package/dist/gateway/adapters/telegram.d.ts.map +1 -1
  209. package/dist/gateway/adapters/telegram.js +34 -11
  210. package/dist/gateway/adapters/telegram.js.map +1 -1
  211. package/dist/gateway/agent-bridge.d.ts +14 -3
  212. package/dist/gateway/agent-bridge.d.ts.map +1 -1
  213. package/dist/gateway/agent-bridge.js +252 -60
  214. package/dist/gateway/agent-bridge.js.map +1 -1
  215. package/dist/gateway/approval.d.ts +1 -0
  216. package/dist/gateway/approval.d.ts.map +1 -1
  217. package/dist/gateway/approval.js +60 -18
  218. package/dist/gateway/approval.js.map +1 -1
  219. package/dist/gateway/authz.d.ts +2 -0
  220. package/dist/gateway/authz.d.ts.map +1 -1
  221. package/dist/gateway/authz.js +13 -0
  222. package/dist/gateway/authz.js.map +1 -1
  223. package/dist/gateway/buttons.d.ts +3 -1
  224. package/dist/gateway/buttons.d.ts.map +1 -1
  225. package/dist/gateway/buttons.js +18 -3
  226. package/dist/gateway/buttons.js.map +1 -1
  227. package/dist/gateway/command.d.ts.map +1 -1
  228. package/dist/gateway/command.js +49 -4
  229. package/dist/gateway/command.js.map +1 -1
  230. package/dist/gateway/commands.d.ts.map +1 -1
  231. package/dist/gateway/commands.js +18 -3
  232. package/dist/gateway/commands.js.map +1 -1
  233. package/dist/gateway/config.d.ts +5 -0
  234. package/dist/gateway/config.d.ts.map +1 -1
  235. package/dist/gateway/config.js +5 -0
  236. package/dist/gateway/config.js.map +1 -1
  237. package/dist/gateway/conversations.d.ts +14 -0
  238. package/dist/gateway/conversations.d.ts.map +1 -0
  239. package/dist/gateway/conversations.js +30 -0
  240. package/dist/gateway/conversations.js.map +1 -0
  241. package/dist/gateway/download.d.ts +2 -0
  242. package/dist/gateway/download.d.ts.map +1 -0
  243. package/dist/gateway/download.js +36 -0
  244. package/dist/gateway/download.js.map +1 -0
  245. package/dist/gateway/index.d.ts.map +1 -1
  246. package/dist/gateway/index.js +85 -26
  247. package/dist/gateway/index.js.map +1 -1
  248. package/dist/gateway/mobile-commands.d.ts +24 -0
  249. package/dist/gateway/mobile-commands.d.ts.map +1 -0
  250. package/dist/gateway/mobile-commands.js +422 -0
  251. package/dist/gateway/mobile-commands.js.map +1 -0
  252. package/dist/gateway/presenter.d.ts +16 -0
  253. package/dist/gateway/presenter.d.ts.map +1 -0
  254. package/dist/gateway/presenter.js +210 -0
  255. package/dist/gateway/presenter.js.map +1 -0
  256. package/dist/gateway/router.d.ts +1 -0
  257. package/dist/gateway/router.d.ts.map +1 -1
  258. package/dist/gateway/router.js +32 -3
  259. package/dist/gateway/router.js.map +1 -1
  260. package/dist/gateway/service.d.ts +46 -0
  261. package/dist/gateway/service.d.ts.map +1 -0
  262. package/dist/gateway/service.js +395 -0
  263. package/dist/gateway/service.js.map +1 -0
  264. package/dist/gateway/setup.d.ts +4 -0
  265. package/dist/gateway/setup.d.ts.map +1 -0
  266. package/dist/gateway/setup.js +146 -0
  267. package/dist/gateway/setup.js.map +1 -0
  268. package/dist/gateway/types.d.ts +4 -2
  269. package/dist/gateway/types.d.ts.map +1 -1
  270. package/dist/gateway/types.js.map +1 -1
  271. package/dist/index.d.ts +2 -0
  272. package/dist/index.d.ts.map +1 -1
  273. package/dist/index.js +2 -0
  274. package/dist/index.js.map +1 -1
  275. package/dist/main.d.ts.map +1 -1
  276. package/dist/main.js +2 -1
  277. package/dist/main.js.map +1 -1
  278. package/dist/modes/interactive/components/assistant-message.d.ts +11 -2
  279. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  280. package/dist/modes/interactive/components/assistant-message.js +53 -16
  281. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  282. package/dist/modes/interactive/components/copyable-text.d.ts +31 -0
  283. package/dist/modes/interactive/components/copyable-text.d.ts.map +1 -0
  284. package/dist/modes/interactive/components/copyable-text.js +165 -0
  285. package/dist/modes/interactive/components/copyable-text.js.map +1 -0
  286. package/dist/modes/interactive/components/custom-entry.d.ts +1 -0
  287. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  288. package/dist/modes/interactive/components/custom-entry.js +8 -0
  289. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  290. package/dist/modes/interactive/components/custom-message.d.ts +1 -0
  291. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  292. package/dist/modes/interactive/components/custom-message.js +8 -0
  293. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  294. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  295. package/dist/modes/interactive/components/session-selector.js +16 -0
  296. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  297. package/dist/modes/interactive/components/settings-selector.d.ts +5 -0
  298. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  299. package/dist/modes/interactive/components/settings-selector.js +38 -0
  300. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  301. package/dist/modes/interactive/interactive-mode.d.ts +3 -0
  302. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  303. package/dist/modes/interactive/interactive-mode.js +151 -7
  304. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  305. package/dist/node-runtime/agent-session-services-NQ6GKOIK.js +49 -0
  306. package/dist/node-runtime/{builtin-extensions-JCOPAAB5.js → builtin-extensions-GVC6IFDU.js} +6 -5
  307. package/dist/node-runtime/{chunk-LTYWTR3V.js → chunk-2MI5OPMN.js} +17 -2
  308. package/dist/node-runtime/{chunk-W3CVH5RX.js → chunk-2TKODGBZ.js} +11 -6
  309. package/dist/node-runtime/chunk-4EULYYR4.js +62 -0
  310. package/dist/node-runtime/chunk-5BNJ4JUH.js +672 -0
  311. package/dist/node-runtime/{chunk-6N22HULO.js → chunk-5D7LC2ZQ.js} +7 -2
  312. package/dist/node-runtime/{chunk-KBKMCJDU.js → chunk-5ZQXRPMC.js} +19 -4
  313. package/dist/node-runtime/{chunk-6KDIOJL3.js → chunk-6427XAWG.js} +3 -3
  314. package/dist/node-runtime/{chunk-BOHIDQT4.js → chunk-6B2POMK7.js} +1 -1
  315. package/dist/node-runtime/{chunk-RNBHABBA.js → chunk-7QWNYZDI.js} +7 -0
  316. package/dist/node-runtime/chunk-AZJHNQKQ.js +205 -0
  317. package/dist/node-runtime/{chunk-A3KMVBZV.js → chunk-BBUVIEZB.js} +1 -10
  318. package/dist/node-runtime/chunk-BFNXONG3.js +521 -0
  319. package/dist/node-runtime/{chunk-IRPJXI6U.js → chunk-BX2RB477.js} +1 -1
  320. package/dist/node-runtime/chunk-CCCN2UCX.js +14 -0
  321. package/dist/node-runtime/{chunk-25I2BHAA.js → chunk-CSUZVNYE.js} +1 -1
  322. package/dist/node-runtime/{chunk-QZMODZQ2.js → chunk-E24EO34J.js} +2 -1
  323. package/dist/node-runtime/{chunk-2BUAYZ7K.js → chunk-EQ63ANHL.js} +422 -123
  324. package/dist/node-runtime/{chunk-GB2MGFLI.js → chunk-GJSAD4AB.js} +216 -201
  325. package/dist/node-runtime/{chunk-W3SILANP.js → chunk-GMHJCCEN.js} +8 -8
  326. package/dist/node-runtime/{chunk-DDWHZ633.js → chunk-GNN7H3B7.js} +1 -1
  327. package/dist/node-runtime/chunk-GS66LV4M.js +2830 -0
  328. package/dist/node-runtime/{chunk-6BEIBLQ3.js → chunk-H3XF4UVQ.js} +1 -1
  329. package/dist/node-runtime/chunk-H4K3JDRB.js +47 -0
  330. package/dist/node-runtime/{chunk-YMEAYRBE.js → chunk-HTFRRDSF.js} +2 -7
  331. package/dist/node-runtime/chunk-IMLCWLPI.js +9 -0
  332. package/dist/node-runtime/{chunk-Y5KOEMBH.js → chunk-IQIEU7SB.js} +9 -674
  333. package/dist/node-runtime/{chunk-OPEK5RRY.js → chunk-IVXYUAJE.js} +1 -1
  334. package/dist/node-runtime/{chunk-PDNXVXMD.js → chunk-IWOWXRWU.js} +58 -48
  335. package/dist/node-runtime/chunk-KKUTQQV7.js +144 -0
  336. package/dist/node-runtime/{chunk-AWVD5IEY.js → chunk-LMBNLFXQ.js} +23 -12
  337. package/dist/node-runtime/{chunk-7NBZ5P7I.js → chunk-NAY6UUQZ.js} +1 -1
  338. package/dist/node-runtime/chunk-OAR4TYZE.js +146 -0
  339. package/dist/node-runtime/{chunk-STERBGUB.js → chunk-OFKSVRV7.js} +2 -2
  340. package/dist/node-runtime/{chunk-JZQ7F36T.js → chunk-ORH324EP.js} +19 -3
  341. package/dist/node-runtime/{chunk-2SJB2AWP.js → chunk-PC2Z5TKZ.js} +3 -3
  342. package/dist/node-runtime/{chunk-SY2TFMLO.js → chunk-QDGKKKUM.js} +46 -151
  343. package/dist/node-runtime/chunk-R3K2F5GI.js +122 -0
  344. package/dist/node-runtime/chunk-RMQZU2YU.js +117 -0
  345. package/dist/node-runtime/{chunk-XI77KVKA.js → chunk-TDL7UWJ7.js} +283 -2999
  346. package/dist/node-runtime/{chunk-G6LRAP36.js → chunk-TQGPP4SC.js} +1 -1
  347. package/dist/node-runtime/chunk-UAEOTO52.js +119 -0
  348. package/dist/node-runtime/{chunk-VZR3NCM7.js → chunk-UAFLNHSH.js} +18 -14
  349. package/dist/node-runtime/{chunk-AY6CAJSL.js → chunk-UJOCPOMX.js} +6 -3
  350. package/dist/node-runtime/chunk-UP2XBVH5.js +40 -0
  351. package/dist/node-runtime/{chunk-WJVFOIB5.js → chunk-UQUCFAJ3.js} +1 -1
  352. package/dist/node-runtime/chunk-URD2SLIT.js +1019 -0
  353. package/dist/node-runtime/chunk-US544NN6.js +13 -0
  354. package/dist/node-runtime/chunk-UWPJL22I.js +341 -0
  355. package/dist/node-runtime/chunk-V2A7CEXK.js +355 -0
  356. package/dist/node-runtime/chunk-VJPTNWAP.js +708 -0
  357. package/dist/node-runtime/{chunk-WKDK4C5P.js → chunk-VSSXXL36.js} +38 -164
  358. package/dist/node-runtime/{chunk-4I23VTC4.js → chunk-VWCE2HSZ.js} +21 -124
  359. package/dist/node-runtime/{chunk-WLLDXJRT.js → chunk-WADV2VDS.js} +22 -1014
  360. package/dist/node-runtime/{chunk-GKLEQ3I4.js → chunk-XLTL257W.js} +126 -27
  361. package/dist/node-runtime/chunk-YPHAIRZT.js +10 -0
  362. package/dist/node-runtime/cli-runtime.js +2 -2
  363. package/dist/node-runtime/command-3JHHXOPX.js +45 -0
  364. package/dist/node-runtime/commands-2JVNFGMQ.js +36 -0
  365. package/dist/node-runtime/{commands-MV5KOZ64.js → commands-KAMO2T6P.js} +10 -10
  366. package/dist/node-runtime/config-RORQUQFG.js +20 -0
  367. package/dist/node-runtime/{customize-LF5VST47.js → customize-VFJV3U6A.js} +2 -1
  368. package/dist/node-runtime/{direct-tool-executor-BK7CLEBX.js → direct-tool-executor-YAVOLDFY.js} +8 -8
  369. package/dist/node-runtime/{export-html-TEXVV5RP.js → export-html-KBFVV63J.js} +4 -3
  370. package/dist/node-runtime/{extension-input-O4HSAEM4.js → extension-input-K24TVKVW.js} +4 -4
  371. package/dist/node-runtime/{extension-selector-X5FCX43D.js → extension-selector-SPNF7EDR.js} +4 -4
  372. package/dist/node-runtime/{extract-XLQSJN4V.js → extract-EQJE7FZZ.js} +2 -2
  373. package/dist/node-runtime/{gateway-BM6NLOH4.js → gateway-VFO6SFKK.js} +275 -994
  374. package/dist/node-runtime/{gemini-search-U7SUMPQA.js → gemini-search-35OCRFLN.js} +1 -1
  375. package/dist/node-runtime/{gemini-url-context-PXWCBQHK.js → gemini-url-context-UQY3PHHW.js} +2 -2
  376. package/dist/node-runtime/index.js +104 -65
  377. package/dist/node-runtime/{init-3C7Z24OI.js → init-X2LIUB2H.js} +3 -3
  378. package/dist/node-runtime/{install-cli-EXMJQESX.js → install-cli-C3CF7O7N.js} +21 -82
  379. package/dist/node-runtime/interactive-mode-LOM6AIF6.js +72 -0
  380. package/dist/node-runtime/{interactive-view-ILS6TAN5.js → interactive-view-IDSCPPK7.js} +8 -8
  381. package/dist/node-runtime/lunr-browser-YNW7FTYX.js +87 -0
  382. package/dist/node-runtime/{lunr-cron-4VHP4E4B.js → lunr-cron-BKHGNBKT.js} +19 -5
  383. package/dist/node-runtime/main.js +44 -31
  384. package/dist/node-runtime/{memory-cap-3S4XRLNP.js → memory-cap-EL3KL4JJ.js} +2 -1
  385. package/dist/node-runtime/mobile-commands-HMP25WBC.js +32 -0
  386. package/dist/node-runtime/model-runtime-PLQKAG4B.js +16 -0
  387. package/dist/node-runtime/{model-tiers-NJLHUEGK.js → model-tiers-OU3U5CZG.js} +2 -1
  388. package/dist/node-runtime/{package-manager-cli-N37546V5.js → package-manager-cli-VCK4E2RC.js} +22 -15
  389. package/dist/node-runtime/{pi-intercom-NV2LW6X7.js → pi-intercom-HBPK5HSJ.js} +4 -1
  390. package/dist/node-runtime/{pi-mcp-adapter-GUFZWW54.js → pi-mcp-adapter-E6WULBKF.js} +4 -4
  391. package/dist/node-runtime/{pi-subagents-6MUIFNDM.js → pi-subagents-FEUDLJOE.js} +201 -78
  392. package/dist/node-runtime/{pi-web-access-2CQGFLT2.js → pi-web-access-WTGMNZ32.js} +15 -15
  393. package/dist/node-runtime/process-registry-4FAKZQOL.js +31 -0
  394. package/dist/node-runtime/{proxy-modes-V6YVFH3C.js → proxy-modes-OSQCWRBI.js} +9 -9
  395. package/dist/node-runtime/rpc-entry.js +44 -31
  396. package/dist/node-runtime/{rpc-mode-W5ZTLTMZ.js → rpc-mode-P5ODXPEG.js} +2 -2
  397. package/dist/node-runtime/runtime-4VA6JKNF.js +373 -0
  398. package/dist/node-runtime/{runtime-bridges-2VQTLPOZ.js → runtime-bridges-3XUQ46XW.js} +6 -5
  399. package/dist/node-runtime/service-ISSP6VHE.js +36 -0
  400. package/dist/node-runtime/session-handoff-HC7R5E24.js +33 -0
  401. package/dist/node-runtime/{session-manager-E7AREDTV.js → session-manager-CFN4UFM2.js} +2 -1
  402. package/dist/node-runtime/{session-selector-FJ7M2AIX.js → session-selector-LHRMJOKT.js} +5 -4
  403. package/dist/node-runtime/{settings-manager-CUGAZWAB.js → settings-manager-UUZ6NUXI.js} +7 -2
  404. package/dist/node-runtime/setup-JBKOLJ6F.js +18 -0
  405. package/dist/node-runtime/setup-NRXVZBLJ.js +155 -0
  406. package/dist/node-runtime/{subagent-executor-MH4A7CCF.js → subagent-executor-MLUMBWCP.js} +22 -18
  407. package/dist/node-runtime/theme-U7IGOA7O.js +68 -0
  408. package/dist/node-runtime/trust-manager-MMISNCYO.js +17 -0
  409. package/dist/node-runtime/{update-cli-XTZMZGOL.js → update-cli-4TP25CNW.js} +7 -2
  410. package/dist/node-runtime/usage-service-LFB2SWYV.js +37 -0
  411. package/dist/node-runtime/{video-extract-OYT5WKS5.js → video-extract-OOZHR7SU.js} +2 -2
  412. package/dist/node-runtime/{youtube-extract-TQYKGFGS.js → youtube-extract-FNPAUNHU.js} +6 -6
  413. package/docs/browser.md +86 -0
  414. package/docs/extensions.md +2 -0
  415. package/docs/features.md +94 -16
  416. package/docs/interactive-startup.md +2 -1
  417. package/docs/sessions.md +10 -0
  418. package/docs/settings.md +1 -0
  419. package/docs/tui.md +2 -0
  420. package/docs/usage.md +16 -0
  421. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  422. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  423. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  424. package/examples/extensions/gondolin/package-lock.json +2 -2
  425. package/examples/extensions/gondolin/package.json +1 -1
  426. package/examples/extensions/sandbox/package-lock.json +2 -2
  427. package/examples/extensions/sandbox/package.json +1 -1
  428. package/examples/extensions/with-deps/package-lock.json +2 -2
  429. package/examples/extensions/with-deps/package.json +1 -1
  430. package/package.json +7 -4
  431. package/scripts/install-browser.mjs +20 -0
  432. package/dist/node-runtime/agent-session-services-C743TYQE.js +0 -37
  433. package/dist/node-runtime/chunk-VGYZ3APQ.js +0 -59
  434. package/dist/node-runtime/command-P4NYCJ2M.js +0 -13
  435. package/dist/node-runtime/interactive-mode-EVVBA64D.js +0 -59
  436. package/dist/node-runtime/{chunk-UWQYRSYQ.js → chunk-YJMMG7C6.js} +25 -25
  437. package/dist/node-runtime/{mcp-panel-IIGMXQGP.js → mcp-panel-KTTFXJZ4.js} +3 -3
  438. package/dist/node-runtime/{src-BPQFJR76.js → src-IVPNZ2BX.js} +9 -9
@@ -0,0 +1,521 @@
1
+ import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
2
+ import {
3
+ FORWARDED_COMMANDS,
4
+ MOBILE_COMMANDS
5
+ } from "./chunk-V2A7CEXK.js";
6
+ import {
7
+ conversationBinding,
8
+ createPicker
9
+ } from "./chunk-VJPTNWAP.js";
10
+ import {
11
+ computeContextBreakdown
12
+ } from "./chunk-TQGPP4SC.js";
13
+ import {
14
+ findExactModelReferenceMatch
15
+ } from "./chunk-OFKSVRV7.js";
16
+ import {
17
+ SessionManager
18
+ } from "./chunk-XLTL257W.js";
19
+ import {
20
+ runtimeScope
21
+ } from "./chunk-IMLCWLPI.js";
22
+
23
+ // packages/coding-agent/dist/gateway/commands.js
24
+ var MODEL_CACHE_TTL_MS = 300 * 1e3, SESSIONS_CACHE_TTL_MS = 300 * 1e3, MAX_MODEL_LIST_LINES = 15, PROVIDER_PER_PAGE = 10;
25
+ var MAX_MODELS_PER_PROVIDER = 50, MODEL_ID_MAX = 38, MODEL_CACHE_CAP = 100, SESSIONS_CACHE_CAP = 100, modelCache = /* @__PURE__ */ new Map(), sessionsCache = /* @__PURE__ */ new Map();
26
+ function evictLRU(map, cap) {
27
+ for (; map.size > cap; ) {
28
+ let first = map.keys().next().value;
29
+ first !== void 0 && map.delete(first);
30
+ }
31
+ }
32
+ function getCachedModels(key) {
33
+ let cached = modelCache.get(key);
34
+ if (cached) {
35
+ if (Date.now() > cached.expires) {
36
+ modelCache.delete(key);
37
+ return;
38
+ }
39
+ return modelCache.delete(key), modelCache.set(key, cached), cached.models;
40
+ }
41
+ }
42
+ function setCachedModels(key, models) {
43
+ modelCache.set(key, { models, expires: Date.now() + MODEL_CACHE_TTL_MS }), evictLRU(modelCache, MODEL_CACHE_CAP);
44
+ }
45
+ function getCachedSessions(key) {
46
+ let cached = sessionsCache.get(key);
47
+ if (cached) {
48
+ if (Date.now() > cached.expires) {
49
+ sessionsCache.delete(key);
50
+ return;
51
+ }
52
+ return sessionsCache.delete(key), sessionsCache.set(key, cached), cached.sessions;
53
+ }
54
+ }
55
+ function setCachedSessions(key, sessions) {
56
+ sessionsCache.set(key, { sessions, expires: Date.now() + SESSIONS_CACHE_TTL_MS }), evictLRU(sessionsCache, SESSIONS_CACHE_CAP);
57
+ }
58
+ function oneLine(text) {
59
+ return text.replace(/\s+/g, " ").trim().slice(0, 200);
60
+ }
61
+ function prefixLines(text, prefix) {
62
+ return text.split(`
63
+ `).map((line, index) => (index === 0 ? prefix : " ") + line).join(`
64
+ `);
65
+ }
66
+ function truncate(text, max) {
67
+ return text.length <= max ? text : `${text.slice(0, max - 1)}\u2026`;
68
+ }
69
+ function formatRelativeTime(date) {
70
+ let seconds = Math.max(0, Math.floor((Date.now() - date.getTime()) / 1e3));
71
+ if (seconds < 60)
72
+ return `${seconds}s ago`;
73
+ let minutes = Math.floor(seconds / 60);
74
+ if (minutes < 60)
75
+ return `${minutes}m ago`;
76
+ let hours = Math.floor(minutes / 60);
77
+ return hours < 24 ? `${hours}h ago` : `${Math.floor(hours / 24)}d ago`;
78
+ }
79
+ function formatModelList(models, maxLines = MAX_MODEL_LIST_LINES) {
80
+ if (models.length === 0)
81
+ return ["No models available."];
82
+ let byProvider = /* @__PURE__ */ new Map();
83
+ for (let model of models) {
84
+ let list = byProvider.get(model.provider) ?? [];
85
+ list.push(model), byProvider.set(model.provider, list);
86
+ }
87
+ let providers = [...byProvider.keys()].sort(), lines = [], index = 1;
88
+ for (let provider of providers) {
89
+ let list = (byProvider.get(provider) ?? []).sort((a, b) => a.id.localeCompare(b.id));
90
+ for (let model of list)
91
+ lines.push(`${index}) ${provider}/${model.id}`), index++;
92
+ }
93
+ return lines.length <= maxLines ? lines : [
94
+ `${models.length} models across ${providers.length} providers.`,
95
+ "Use /model <provider/id> or /model <query>.",
96
+ ...providers.map((p) => `- ${p}`)
97
+ ];
98
+ }
99
+ function groupModelsByProvider(models) {
100
+ let byProvider = /* @__PURE__ */ new Map();
101
+ for (let model of models) {
102
+ let list = byProvider.get(model.provider) ?? [];
103
+ list.push(model), byProvider.set(model.provider, list);
104
+ }
105
+ for (let list of byProvider.values())
106
+ list.sort((a, b) => a.id.localeCompare(b.id));
107
+ return byProvider;
108
+ }
109
+ function truncateModelId(id) {
110
+ let lastSlash = id.lastIndexOf("/"), name = lastSlash >= 0 ? id.slice(lastSlash + 1) : id;
111
+ return truncate(name, MODEL_ID_MAX);
112
+ }
113
+ async function refreshAndCacheModels(session, key) {
114
+ let runtime = session.modelRuntime;
115
+ await runtime.refresh();
116
+ let models = [...await runtime.getAvailable()].sort((a, b) => a.provider.localeCompare(b.provider) || a.id.localeCompare(b.id));
117
+ return setCachedModels(key, models), models;
118
+ }
119
+ async function setModelAndReply(ctx, model) {
120
+ let session = ctx.session;
121
+ try {
122
+ await session.setModel(model);
123
+ } catch (error) {
124
+ if ((error instanceof Error ? error.message : String(error)).includes("No API key")) {
125
+ await ctx.reply(`No API key for ${model.provider}.`);
126
+ return;
127
+ }
128
+ throw error;
129
+ }
130
+ await ctx.reply(`Model \u2192 ${model.provider}/${model.id} (thinking level re-clamped to ${session.thinkingLevel})`);
131
+ }
132
+ var newCommand = {
133
+ name: "new",
134
+ aliases: ["reset"],
135
+ description: "start a fresh session for this chat",
136
+ // lunr: busy-session /new must bypass the guard (same as /stop).
137
+ bypassBusy: !0,
138
+ needsSession: !1,
139
+ async handler(ctx) {
140
+ await ctx.bridge.reset(ctx.key), await ctx.reply("Session reset \u2014 next message starts a fresh session.");
141
+ }
142
+ }, undoCommand = {
143
+ name: "undo",
144
+ description: "rewind the session tree before the last user turn",
145
+ bypassBusy: !1,
146
+ needsSession: !0,
147
+ async handler(ctx) {
148
+ let { userText } = await ctx.bridge.undo(ctx.key), text = userText ? ` "${truncate(userText, 60)}"` : "";
149
+ await ctx.reply(`Undone \u2014 rewound before${text}. /redo to restore.`);
150
+ }
151
+ }, redoCommand = {
152
+ name: "redo",
153
+ description: "restore the last undone turn",
154
+ bypassBusy: !1,
155
+ needsSession: !0,
156
+ async handler(ctx) {
157
+ await ctx.bridge.redo(ctx.key), await ctx.reply("Redone.");
158
+ }
159
+ }, stopCommand = {
160
+ name: "stop",
161
+ description: "abort the running turn",
162
+ bypassBusy: !0,
163
+ needsSession: !1,
164
+ async handler(ctx) {
165
+ await ctx.bridge.abort(ctx.key), await ctx.reply("Stopped.");
166
+ }
167
+ }, statusCommand = {
168
+ name: "status",
169
+ description: "session status",
170
+ bypassBusy: !0,
171
+ needsSession: !1,
172
+ async handler(ctx) {
173
+ let status = ctx.bridge.getStatus(ctx.key), age = status.createdAt ? `${Math.max(0, Math.round((Date.now() - Date.parse(status.createdAt)) / 1e3))}s` : "no session yet";
174
+ await ctx.reply(`${ctx.event.source.platform} \xB7 session age ${age} \xB7 ${status.busy ? "busy" : "idle"} \xB7 queue ${status.queueDepth}
175
+ Project: ${conversationBinding(ctx.key)?.cwd ?? "not selected"}`);
176
+ }
177
+ }, whoamiCommand = {
178
+ name: "whoami",
179
+ description: "your ids and session key",
180
+ bypassBusy: !0,
181
+ needsSession: !1,
182
+ async handler(ctx) {
183
+ let { userId, chatId } = ctx.event.source;
184
+ await ctx.reply(`userId: ${userId}
185
+ chatId: ${chatId}
186
+ key: ${ctx.key}`);
187
+ }
188
+ }, helpCommand = {
189
+ name: "help",
190
+ description: "this message",
191
+ bypassBusy: !0,
192
+ needsSession: !1,
193
+ async handler(ctx) {
194
+ await ctx.reply(formatHelpText());
195
+ }
196
+ }, modelCommand = {
197
+ name: "model",
198
+ description: "list or switch models",
199
+ bypassBusy: !1,
200
+ needsSession: !0,
201
+ async handler(ctx) {
202
+ let session = ctx.session, arg = ctx.args.trim();
203
+ if (!arg) {
204
+ let models2 = getCachedModels(ctx.key) ?? await refreshAndCacheModels(session, ctx.key), byProvider = groupModelsByProvider(models2), current = session.model, currentRef = current ? `${current.provider}/${current.id}` : "", providerItems = [...byProvider.keys()].sort().map((provider) => ({
205
+ label: `${current?.provider === provider ? "\u2713 " : ""}${provider} (${byProvider.get(provider)?.length ?? 0})`,
206
+ value: provider
207
+ })), pickerOpts = {
208
+ replyTo: ctx.event.messageId,
209
+ threadId: ctx.event.source.threadId
210
+ };
211
+ if (!(await createPicker(ctx.adapter, ctx.event.source, {
212
+ kind: "model",
213
+ sessionKey: ctx.key,
214
+ invokerId: ctx.event.source.userId,
215
+ items: providerItems,
216
+ perPage: PROVIDER_PER_PAGE,
217
+ title: "Pick a model provider",
218
+ async resolve(item) {
219
+ if (item.value === "__back__")
220
+ return { done: !1, items: providerItems, title: "Pick a model provider" };
221
+ if (!item.value.includes("/")) {
222
+ let provider = item.value, list = byProvider.get(provider) ?? [], capped = list.slice(0, MAX_MODELS_PER_PROVIDER), note = list.length > MAX_MODELS_PER_PROVIDER ? ` \u2014 ${list.length - MAX_MODELS_PER_PROVIDER} more available` : "", modelItems = [];
223
+ for (let m of capped) {
224
+ let ref = `${provider}/${m.id}`;
225
+ modelItems.push({
226
+ label: `${currentRef === ref ? "\u2713 " : ""}${truncateModelId(m.id)}`,
227
+ value: ref
228
+ });
229
+ }
230
+ return modelItems.unshift({ label: "\u25C0 Back", value: "__back__" }), {
231
+ done: !1,
232
+ items: modelItems,
233
+ title: `${provider} (${list.length})${note}`,
234
+ breadcrumbs: provider
235
+ };
236
+ }
237
+ let exact2 = findExactModelReferenceMatch(item.value, models2);
238
+ if (!exact2)
239
+ return { done: !0, text: "That model is no longer available." };
240
+ try {
241
+ await session.setModel(exact2);
242
+ } catch (error) {
243
+ if ((error instanceof Error ? error.message : String(error)).includes("No API key"))
244
+ return { done: !0, text: `No API key for ${exact2.provider}.` };
245
+ throw error;
246
+ }
247
+ return {
248
+ done: !0,
249
+ text: `\u263E Model \u2192 ${exact2.provider}/${exact2.id} (thinking level re-clamped to ${session.thinkingLevel})`
250
+ };
251
+ }
252
+ }, pickerOpts)).success) {
253
+ let currentText = `${current?.provider ?? "none"}/${current?.id ?? "none"}`, lines = formatModelList(models2);
254
+ await ctx.reply([`Current: ${currentText}`, ...lines, "Use /model <n> or /model <provider/id>"].join(`
255
+ `));
256
+ }
257
+ return;
258
+ }
259
+ let numeric = Number.parseInt(arg, 10);
260
+ if (!Number.isNaN(numeric) && /^\d+$/.test(arg)) {
261
+ let cached = getCachedModels(ctx.key);
262
+ if (!cached || numeric < 1 || numeric > cached.length) {
263
+ await ctx.reply("Invalid selection \u2014 run /model to see the current list.");
264
+ return;
265
+ }
266
+ await setModelAndReply(ctx, cached[numeric - 1]);
267
+ return;
268
+ }
269
+ let models = getCachedModels(ctx.key) ?? await refreshAndCacheModels(session, ctx.key), exact = findExactModelReferenceMatch(arg, models);
270
+ if (exact) {
271
+ await setModelAndReply(ctx, exact);
272
+ return;
273
+ }
274
+ let query = arg.toLowerCase(), matches = models.filter((m) => m.id.toLowerCase().includes(query) || `${m.provider}/${m.id}`.toLowerCase().includes(query) || (m.name?.toLowerCase().includes(query) ?? !1));
275
+ if (matches.length === 0) {
276
+ await ctx.reply(`No model matches "${arg}".`);
277
+ return;
278
+ }
279
+ if (matches.length > 1) {
280
+ await ctx.reply(formatModelList(matches).join(`
281
+ `));
282
+ return;
283
+ }
284
+ await setModelAndReply(ctx, matches[0]);
285
+ }
286
+ }, sessionsCommand = {
287
+ name: "sessions",
288
+ description: "list or switch sessions",
289
+ bypassBusy: !1,
290
+ needsSession: !0,
291
+ async handler(ctx) {
292
+ let session = ctx.session, arg = ctx.args.trim(), currentFile = session.sessionManager?.getSessionFile();
293
+ if (!arg) {
294
+ let all = await SessionManager.list(process.cwd());
295
+ all.sort((a, b) => b.modified.getTime() - a.modified.getTime());
296
+ let sessions = all.slice(0, 10);
297
+ setCachedSessions(ctx.key, sessions);
298
+ let items = sessions.map((s) => ({
299
+ label: `${s.path === currentFile ? "\u263E " : ""}${s.name ? truncate(s.name, 30) : truncate(s.firstMessage, 30) || "(empty)"}`,
300
+ value: s.path
301
+ }));
302
+ if (!(await createPicker(ctx.adapter, ctx.event.source, {
303
+ kind: "sessions",
304
+ sessionKey: ctx.key,
305
+ invokerId: ctx.event.source.userId,
306
+ items,
307
+ perPage: 8,
308
+ title: "Pick a session",
309
+ async resolve(item) {
310
+ await ctx.bridge.switchSession(ctx.key, item.value);
311
+ let switched2 = await ctx.bridge.getSession(ctx.key), name2 = switched2?.sessionManager?.getSessionName() ?? "unnamed", count2 = switched2?.sessionManager?.getEntries().length ?? 0;
312
+ return { done: !0, text: `\u263E Switched to "${name2}" (${count2} msgs). History continues here.` };
313
+ }
314
+ }, { replyTo: ctx.event.messageId, threadId: ctx.event.source.threadId })).success) {
315
+ let lines = sessions.map((s, i) => {
316
+ let marker = s.path === currentFile ? " \u263E" : "", label = s.name ? truncate(s.name, 40) : truncate(s.firstMessage, 40) || "(empty)";
317
+ return `${i + 1}) ${label}${marker} \xB7 ${formatRelativeTime(s.modified)} \xB7 ${s.messageCount} msgs`;
318
+ });
319
+ await ctx.reply([`Sessions for ${process.cwd()}`, ...lines, "Use /sessions <n> or /sessions <id-prefix>"].join(`
320
+ `));
321
+ }
322
+ return;
323
+ }
324
+ let path, numeric = Number.parseInt(arg, 10), cached = getCachedSessions(ctx.key);
325
+ if (!Number.isNaN(numeric) && /^\d+$/.test(arg)) {
326
+ if (!cached || numeric < 1 || numeric > cached.length) {
327
+ await ctx.reply("Invalid selection \u2014 run /sessions to see the current list.");
328
+ return;
329
+ }
330
+ path = cached[numeric - 1].path;
331
+ } else {
332
+ let matches = (cached ?? await SessionManager.list(process.cwd())).filter((s) => s.id.startsWith(arg) || s.path.startsWith(arg));
333
+ if (matches.length === 0) {
334
+ await ctx.reply(`No session matches "${arg}".`);
335
+ return;
336
+ }
337
+ if (matches.length > 1) {
338
+ await ctx.reply(`Multiple sessions match "${arg}" \u2014 use a longer prefix.`);
339
+ return;
340
+ }
341
+ path = matches[0].path;
342
+ }
343
+ if (!path) {
344
+ await ctx.reply("No session selected.");
345
+ return;
346
+ }
347
+ await ctx.bridge.switchSession(ctx.key, path);
348
+ let switched = await ctx.bridge.getSession(ctx.key), name = switched?.sessionManager?.getSessionName() ?? "unnamed", count = switched?.sessionManager?.getEntries().length ?? 0;
349
+ await ctx.reply(`Switched to "${name}" (${count} msgs). History continues here.`);
350
+ }
351
+ }, titleCommand = {
352
+ name: "title",
353
+ aliases: ["name"],
354
+ description: "name the current session",
355
+ bypassBusy: !0,
356
+ needsSession: !0,
357
+ async handler(ctx) {
358
+ let session = ctx.session, name = ctx.args.trim();
359
+ if (!name) {
360
+ let current = session.sessionManager?.getSessionName();
361
+ await ctx.reply(current ? `Session title: ${current}` : "(unnamed)");
362
+ return;
363
+ }
364
+ session.setSessionName(name);
365
+ let readBack = session.sessionManager?.getSessionName() ?? name;
366
+ await ctx.reply(`Session titled "${readBack}".`);
367
+ }
368
+ }, contextCommand = {
369
+ name: "context",
370
+ description: "estimated context window breakdown",
371
+ bypassBusy: !0,
372
+ needsSession: !0,
373
+ async handler(ctx) {
374
+ let session = ctx.session, model = session.model;
375
+ if (!model) {
376
+ await ctx.reply("No model selected.");
377
+ return;
378
+ }
379
+ let contextWindow = model.contextWindow ?? 0;
380
+ if (contextWindow <= 0) {
381
+ await ctx.reply("Context window unknown for this model.");
382
+ return;
383
+ }
384
+ let tools = session.getActiveToolNames().map((name) => session.getToolDefinition(name)).filter((d) => d !== void 0), breakdown = computeContextBreakdown({
385
+ systemPrompt: session.systemPrompt,
386
+ tools,
387
+ messages: session.messages,
388
+ contextWindow
389
+ }), usage = session.getContextUsage(), tokens = usage?.tokens ?? breakdown.total, percent = usage?.percent ?? (contextWindow > 0 ? tokens / contextWindow * 100 : 0), messageTokens = breakdown.user + breakdown.assistantText + breakdown.thinking + breakdown.toolCalls + breakdown.toolResults + breakdown.summaries, stats = session.getSessionStats();
390
+ await ctx.reply([
391
+ `Context: ${tokens.toLocaleString("en-US")} / ${contextWindow.toLocaleString("en-US")} tokens (${Math.round(percent)}%)`,
392
+ ` system ${breakdown.systemPrompt.toLocaleString("en-US")} \xB7 tools ${breakdown.toolDefinitions.toLocaleString("en-US")} \xB7 messages ${messageTokens.toLocaleString("en-US")}`,
393
+ `Session: ${stats.totalMessages} messages \xB7 ${stats.userMessages} turns \xB7 model ${model.provider}/${model.id}`
394
+ ].join(`
395
+ `));
396
+ }
397
+ }, compactCommand = {
398
+ name: "compact",
399
+ description: "summarize and compress session context",
400
+ bypassBusy: !0,
401
+ needsSession: !0,
402
+ async handler(ctx) {
403
+ let session = ctx.session, instructions = ctx.args.trim() || void 0;
404
+ try {
405
+ let result = await session.compact(instructions), before = result.tokensBefore.toLocaleString("en-US"), after = result.estimatedTokensAfter !== void 0 ? `~${result.estimatedTokensAfter.toLocaleString("en-US")}` : "~?";
406
+ await ctx.reply(`Compacted: ${before} \u2192 ${after} tokens.`);
407
+ } catch (error) {
408
+ let message = error instanceof Error ? error.message : String(error);
409
+ if (message.includes("Nothing to compact") || message.includes("Already compacted") || message.includes("No model selected")) {
410
+ await ctx.reply(message);
411
+ return;
412
+ }
413
+ throw error;
414
+ }
415
+ }
416
+ }, thinkingCommand = {
417
+ name: "thinking",
418
+ aliases: ["effort", "reasoning"],
419
+ description: "get or set the thinking level",
420
+ bypassBusy: !1,
421
+ needsSession: !0,
422
+ async handler(ctx) {
423
+ let session = ctx.session, levels = session.getAvailableThinkingLevels();
424
+ if (!session.supportsThinking()) {
425
+ await ctx.reply(`Model ${session.model?.provider ?? "none"}/${session.model?.id ?? "none"} doesn't support thinking.`);
426
+ return;
427
+ }
428
+ let arg = ctx.args.trim().toLowerCase();
429
+ if (!arg) {
430
+ let current = session.thinkingLevel, items = levels.map((level) => ({
431
+ label: `${level === current ? "\u2713 " : ""}${level}`,
432
+ value: level
433
+ }));
434
+ (await createPicker(ctx.adapter, ctx.event.source, {
435
+ kind: "thinking",
436
+ sessionKey: ctx.key,
437
+ invokerId: ctx.event.source.userId,
438
+ items,
439
+ perPage: levels.length,
440
+ title: "Pick a thinking level",
441
+ async resolve(item) {
442
+ let level = item.value;
443
+ return session.setThinkingLevel(level), { done: !0, text: `\u263E Thinking \u2192 ${level}` };
444
+ }
445
+ }, { replyTo: ctx.event.messageId, threadId: ctx.event.source.threadId })).success || await ctx.reply(`Level: ${current} \u2014 available: ${levels.join(", ")}`);
446
+ return;
447
+ }
448
+ if (!levels.includes(arg)) {
449
+ await ctx.reply(`Invalid level. Available: ${levels.join(", ")}`);
450
+ return;
451
+ }
452
+ session.setThinkingLevel(arg), await ctx.reply(`Thinking \u2192 ${arg}`);
453
+ }
454
+ }, CHAT_COMMANDS = [
455
+ newCommand,
456
+ undoCommand,
457
+ redoCommand,
458
+ stopCommand,
459
+ statusCommand,
460
+ whoamiCommand,
461
+ helpCommand,
462
+ modelCommand,
463
+ sessionsCommand,
464
+ titleCommand,
465
+ contextCommand,
466
+ compactCommand,
467
+ thinkingCommand
468
+ ];
469
+ function botCommandSpecs() {
470
+ return [
471
+ ...new Map([...CHAT_COMMANDS, ...MOBILE_COMMANDS, ...FORWARDED_COMMANDS].map((c) => [
472
+ c.name,
473
+ { name: c.name, description: c.description }
474
+ ])).values()
475
+ ];
476
+ }
477
+ function formatHelpText() {
478
+ let lines = ["lunR gateway commands:"];
479
+ for (let cmd of CHAT_COMMANDS) {
480
+ let names = [cmd.name, ...cmd.aliases ?? []].map((a) => `/${a}`).join(" | ");
481
+ lines.push(`${names} \u2014 ${cmd.description}`);
482
+ }
483
+ for (let cmd of botCommandSpecs())
484
+ CHAT_COMMANDS.some((c) => c.name === cmd.name) || lines.push(`/${cmd.name} \xB7 ${cmd.description}`);
485
+ return lines.push(""), lines.push("Tap to pick: /model, /thinking, /sessions (run without args to see buttons)."), lines.join(`
486
+ `);
487
+ }
488
+ async function runChatCommand(cmd, ctx) {
489
+ if (!cmd.bypassBusy && ctx.bridge.getStatus(ctx.key).busy)
490
+ return await ctx.reply("\u23F3 busy \u2014 /stop first or wait"), !0;
491
+ if (cmd.needsSession) {
492
+ let session = await ctx.bridge.getSession(ctx.key);
493
+ if (!session)
494
+ return await ctx.reply("No session yet \u2014 send a message first."), !0;
495
+ ctx.session = session;
496
+ }
497
+ try {
498
+ let settingsManager = ctx.session?.settingsManager;
499
+ return (settingsManager ? await runtimeScope.run({ settingsManager, modelRuntime: ctx.session?.modelRuntime, thinking: () => ctx.session.thinkingLevel }, () => cmd.handler(ctx)) : await cmd.handler(ctx)) ?? !0;
500
+ } catch (err) {
501
+ let message = err instanceof Error ? err.message : String(err);
502
+ return await ctx.adapter.send(ctx.event.source.chatId, `\u26A0 ${oneLine(message)}`, {
503
+ replyTo: ctx.event.messageId,
504
+ threadId: ctx.event.source.threadId
505
+ }), !0;
506
+ }
507
+ }
508
+ async function sendCommandReply(adapter, event, text) {
509
+ await adapter.send(event.source.chatId, prefixLines(text, "\u263E "), {
510
+ replyTo: event.messageId,
511
+ threadId: event.source.threadId
512
+ });
513
+ }
514
+
515
+ export {
516
+ CHAT_COMMANDS,
517
+ botCommandSpecs,
518
+ formatHelpText,
519
+ runChatCommand,
520
+ sendCommandReply
521
+ };
@@ -4,7 +4,7 @@ import {
4
4
  ServerError,
5
5
  logger,
6
6
  wrapError
7
- } from "./chunk-UWQYRSYQ.js";
7
+ } from "./chunk-YJMMG7C6.js";
8
8
  import {
9
9
  UrlElicitationRequiredError
10
10
  } from "./chunk-4TLO4PO2.js";
@@ -0,0 +1,14 @@
1
+ import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
2
+
3
+ // packages/coding-agent/dist/core/todo-settings.js
4
+ var TODO_TOOL_NAMES = /* @__PURE__ */ new Set(["todo"]), TODOS_ENABLED_CHANGED_SYMBOL = /* @__PURE__ */ Symbol.for("@lunr/todos-enabled-changed");
5
+ function notifyTodosEnabledChanged(enabled) {
6
+ let handler = globalThis[TODOS_ENABLED_CHANGED_SYMBOL];
7
+ handler?.(enabled);
8
+ }
9
+
10
+ export {
11
+ TODO_TOOL_NAMES,
12
+ TODOS_ENABLED_CHANGED_SYMBOL,
13
+ notifyTodosEnabledChanged
14
+ };
@@ -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-6N22HULO.js";
5
+ } from "./chunk-5D7LC2ZQ.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";
@@ -133,7 +133,8 @@ ${chalk.bold("Usage:")}
133
133
  ${APP_NAME} [options] [@files...] [messages...]
134
134
 
135
135
  ${chalk.bold("Commands:")}
136
- ${APP_NAME} setup First-run / reconfigure optional features
136
+ ${APP_NAME} setup Install Chromium and configure optional features
137
+ ${APP_NAME} browser install Repair Chromium after offline or ignored-script installs
137
138
  ${APP_NAME} features [list|enable|disable]
138
139
  ${APP_NAME} uninstall Remove this ${APP_NAME} install (keeps agent dir unless --purge)
139
140
  ${APP_NAME} uninstall <source> [-l] Remove an extension package (alias for remove)