@ashx-j/lunr-dev 0.2.21-dev.12.1 → 0.2.25-dev.13.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 (570) hide show
  1. package/CHANGELOG.md +25 -2
  2. package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
  3. package/dist/builtin-extensions/ashxj-tui.js +2 -2
  4. package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
  5. package/dist/builtin-extensions/index.d.ts.map +1 -1
  6. package/dist/builtin-extensions/index.js +1 -0
  7. package/dist/builtin-extensions/index.js.map +1 -1
  8. package/dist/builtin-extensions/lunr-browser.d.ts +9 -0
  9. package/dist/builtin-extensions/lunr-browser.d.ts.map +1 -0
  10. package/dist/builtin-extensions/lunr-browser.js +169 -0
  11. package/dist/builtin-extensions/lunr-browser.js.map +1 -0
  12. package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -1
  13. package/dist/builtin-extensions/lunr-computer-use.js +3 -3
  14. package/dist/builtin-extensions/lunr-computer-use.js.map +1 -1
  15. package/dist/builtin-extensions/lunr-plan-tools.d.ts +7 -7
  16. package/dist/builtin-extensions/lunr-plan-tools.d.ts.map +1 -1
  17. package/dist/builtin-extensions/lunr-plan-tools.js +12 -12
  18. package/dist/builtin-extensions/lunr-plan-tools.js.map +1 -1
  19. package/dist/builtin-extensions/lunr-todos.d.ts.map +1 -1
  20. package/dist/builtin-extensions/lunr-todos.js +15 -0
  21. package/dist/builtin-extensions/lunr-todos.js.map +1 -1
  22. package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -1
  23. package/dist/builtin-extensions/pi-intercom/index.js +5 -0
  24. package/dist/builtin-extensions/pi-intercom/index.js.map +1 -1
  25. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts.map +1 -1
  26. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js +1 -0
  27. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js.map +1 -1
  28. package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
  29. package/dist/builtin-extensions/pi-mcp-adapter/index.js +1 -1
  30. package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
  31. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts +1 -1
  32. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts.map +1 -1
  33. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js +5 -1
  34. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js.map +1 -1
  35. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +2 -2
  36. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
  37. package/dist/builtin-extensions/pi-subagents/src/extension/index.js +18 -5
  38. package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
  39. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
  40. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +1 -1
  41. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
  42. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +4 -3
  43. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
  44. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +8 -3
  45. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
  46. package/dist/builtin-extensions/pi-subagents/src/intercom/communication.d.ts +17 -0
  47. package/dist/builtin-extensions/pi-subagents/src/intercom/communication.d.ts.map +1 -0
  48. package/dist/builtin-extensions/pi-subagents/src/intercom/communication.js +45 -0
  49. package/dist/builtin-extensions/pi-subagents/src/intercom/communication.js.map +1 -0
  50. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts +2 -0
  51. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts.map +1 -1
  52. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js +10 -14
  53. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js.map +1 -1
  54. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts +4 -1
  55. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -1
  56. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js +167 -53
  57. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -1
  58. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts.map +1 -1
  59. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js +5 -0
  60. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js.map +1 -1
  61. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts +2 -0
  62. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts.map +1 -1
  63. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js +3 -2
  64. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js.map +1 -1
  65. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +2 -0
  66. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -1
  67. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +4 -0
  68. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -1
  69. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts +1 -0
  70. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts.map +1 -1
  71. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js +2 -1
  72. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js.map +1 -1
  73. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -1
  74. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +1 -1
  75. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
  76. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts +3 -0
  77. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts.map +1 -1
  78. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js +11 -0
  79. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js.map +1 -1
  80. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
  81. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +41 -3
  82. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
  83. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts +1 -0
  84. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -1
  85. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +5 -1
  86. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -1
  87. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
  88. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +3 -2
  89. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
  90. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
  91. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +23 -0
  92. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
  93. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts +1 -1
  94. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts.map +1 -1
  95. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js +1 -1
  96. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js.map +1 -1
  97. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts +2 -0
  98. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts.map +1 -1
  99. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js +20 -15
  100. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js.map +1 -1
  101. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts +1 -0
  102. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts.map +1 -1
  103. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js +3 -0
  104. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js.map +1 -1
  105. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
  106. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +4 -2
  107. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
  108. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts.map +1 -1
  109. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js +2 -2
  110. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -1
  111. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +2 -0
  112. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
  113. package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
  114. package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts +18 -0
  115. package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts.map +1 -0
  116. package/dist/builtin-extensions/pi-subagents/src/tui/communication.js +48 -0
  117. package/dist/builtin-extensions/pi-subagents/src/tui/communication.js.map +1 -0
  118. package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
  119. package/dist/builtin-extensions/pi-web-access/index.js +11 -7
  120. package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
  121. package/dist/cli/args.d.ts.map +1 -1
  122. package/dist/cli/args.js +2 -1
  123. package/dist/cli/args.js.map +1 -1
  124. package/dist/cli/install-cli.d.ts.map +1 -1
  125. package/dist/cli/install-cli.js +15 -45
  126. package/dist/cli/install-cli.js.map +1 -1
  127. package/dist/core/agent-session-runtime.d.ts +9 -0
  128. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  129. package/dist/core/agent-session-runtime.js +126 -29
  130. package/dist/core/agent-session-runtime.js.map +1 -1
  131. package/dist/core/agent-session.d.ts +23 -1
  132. package/dist/core/agent-session.d.ts.map +1 -1
  133. package/dist/core/agent-session.js +255 -109
  134. package/dist/core/agent-session.js.map +1 -1
  135. package/dist/core/browser/network.d.ts +9 -0
  136. package/dist/core/browser/network.d.ts.map +1 -0
  137. package/dist/core/browser/network.js +146 -0
  138. package/dist/core/browser/network.js.map +1 -0
  139. package/dist/core/browser/runtime.d.ts +24 -0
  140. package/dist/core/browser/runtime.d.ts.map +1 -0
  141. package/dist/core/browser/runtime.js +289 -0
  142. package/dist/core/browser/runtime.js.map +1 -0
  143. package/dist/core/browser/schema.d.ts +16 -0
  144. package/dist/core/browser/schema.d.ts.map +1 -0
  145. package/dist/core/browser/schema.js +36 -0
  146. package/dist/core/browser/schema.js.map +1 -0
  147. package/dist/core/browser/settings.d.ts +8 -0
  148. package/dist/core/browser/settings.d.ts.map +1 -0
  149. package/dist/core/browser/settings.js +30 -0
  150. package/dist/core/browser/settings.js.map +1 -0
  151. package/dist/core/browser/setup.d.ts +2 -0
  152. package/dist/core/browser/setup.d.ts.map +1 -0
  153. package/dist/core/browser/setup.js +16 -0
  154. package/dist/core/browser/setup.js.map +1 -0
  155. package/dist/core/catalog-cache-scope.d.ts.map +1 -1
  156. package/dist/core/catalog-cache-scope.js +3 -1
  157. package/dist/core/catalog-cache-scope.js.map +1 -1
  158. package/dist/core/computer-use/image.d.ts +1 -0
  159. package/dist/core/computer-use/image.d.ts.map +1 -1
  160. package/dist/core/computer-use/image.js +8 -0
  161. package/dist/core/computer-use/image.js.map +1 -1
  162. package/dist/core/computer-use/schemas.d.ts +1 -0
  163. package/dist/core/computer-use/schemas.d.ts.map +1 -1
  164. package/dist/core/computer-use/schemas.js +2 -1
  165. package/dist/core/computer-use/schemas.js.map +1 -1
  166. package/dist/core/computer-use/workflow.d.ts.map +1 -1
  167. package/dist/core/computer-use/workflow.js +89 -23
  168. package/dist/core/computer-use/workflow.js.map +1 -1
  169. package/dist/core/customize.d.ts.map +1 -1
  170. package/dist/core/customize.js +15 -14
  171. package/dist/core/customize.js.map +1 -1
  172. package/dist/core/export-html/index.d.ts.map +1 -1
  173. package/dist/core/export-html/index.js +1 -1
  174. package/dist/core/export-html/index.js.map +1 -1
  175. package/dist/core/extensions/loader.d.ts.map +1 -1
  176. package/dist/core/extensions/loader.js +4 -0
  177. package/dist/core/extensions/loader.js.map +1 -1
  178. package/dist/core/extensions/runner.d.ts +1 -0
  179. package/dist/core/extensions/runner.d.ts.map +1 -1
  180. package/dist/core/extensions/runner.js +1 -1
  181. package/dist/core/extensions/runner.js.map +1 -1
  182. package/dist/core/extensions/types.d.ts +1 -1
  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/install-features.d.ts.map +1 -1
  186. package/dist/core/install-features.js +10 -8
  187. package/dist/core/install-features.js.map +1 -1
  188. package/dist/core/memory-cap.d.ts.map +1 -1
  189. package/dist/core/memory-cap.js +5 -3
  190. package/dist/core/memory-cap.js.map +1 -1
  191. package/dist/core/model-runtime.d.ts.map +1 -1
  192. package/dist/core/model-runtime.js +3 -2
  193. package/dist/core/model-runtime.js.map +1 -1
  194. package/dist/core/model-tiers.d.ts.map +1 -1
  195. package/dist/core/model-tiers.js +9 -6
  196. package/dist/core/model-tiers.js.map +1 -1
  197. package/dist/core/permissions.d.ts +16 -23
  198. package/dist/core/permissions.d.ts.map +1 -1
  199. package/dist/core/permissions.js +71 -142
  200. package/dist/core/permissions.js.map +1 -1
  201. package/dist/core/plan-mode.d.ts +10 -12
  202. package/dist/core/plan-mode.d.ts.map +1 -1
  203. package/dist/core/plan-mode.js +20 -19
  204. package/dist/core/plan-mode.js.map +1 -1
  205. package/dist/core/process-registry.d.ts.map +1 -1
  206. package/dist/core/process-registry.js +6 -4
  207. package/dist/core/process-registry.js.map +1 -1
  208. package/dist/core/runtime-bridges.d.ts.map +1 -1
  209. package/dist/core/runtime-bridges.js +2 -0
  210. package/dist/core/runtime-bridges.js.map +1 -1
  211. package/dist/core/runtime-scope.d.ts +11 -0
  212. package/dist/core/runtime-scope.d.ts.map +1 -0
  213. package/dist/core/runtime-scope.js +3 -0
  214. package/dist/core/runtime-scope.js.map +1 -0
  215. package/dist/core/sdk.d.ts.map +1 -1
  216. package/dist/core/sdk.js +26 -6
  217. package/dist/core/sdk.js.map +1 -1
  218. package/dist/core/session-handoff.d.ts +35 -0
  219. package/dist/core/session-handoff.d.ts.map +1 -0
  220. package/dist/core/session-handoff.js +214 -0
  221. package/dist/core/session-handoff.js.map +1 -0
  222. package/dist/core/session-manager.d.ts +20 -0
  223. package/dist/core/session-manager.d.ts.map +1 -1
  224. package/dist/core/session-manager.js +191 -22
  225. package/dist/core/session-manager.js.map +1 -1
  226. package/dist/core/session-ownership.d.ts +28 -0
  227. package/dist/core/session-ownership.d.ts.map +1 -0
  228. package/dist/core/session-ownership.js +138 -0
  229. package/dist/core/session-ownership.js.map +1 -0
  230. package/dist/core/session-retention.d.ts.map +1 -1
  231. package/dist/core/session-retention.js +11 -2
  232. package/dist/core/session-retention.js.map +1 -1
  233. package/dist/core/settings-manager.d.ts +20 -1
  234. package/dist/core/settings-manager.d.ts.map +1 -1
  235. package/dist/core/settings-manager.js +67 -1
  236. package/dist/core/settings-manager.js.map +1 -1
  237. package/dist/core/slash-commands.d.ts.map +1 -1
  238. package/dist/core/slash-commands.js +6 -4
  239. package/dist/core/slash-commands.js.map +1 -1
  240. package/dist/core/subagent-permission-inherit.d.ts +6 -10
  241. package/dist/core/subagent-permission-inherit.d.ts.map +1 -1
  242. package/dist/core/subagent-permission-inherit.js +14 -14
  243. package/dist/core/subagent-permission-inherit.js.map +1 -1
  244. package/dist/core/subagent-wait-interruption.d.ts +11 -0
  245. package/dist/core/subagent-wait-interruption.d.ts.map +1 -0
  246. package/dist/core/subagent-wait-interruption.js +19 -0
  247. package/dist/core/subagent-wait-interruption.js.map +1 -0
  248. package/dist/core/system-prompt.d.ts +2 -0
  249. package/dist/core/system-prompt.d.ts.map +1 -1
  250. package/dist/core/system-prompt.js +14 -4
  251. package/dist/core/system-prompt.js.map +1 -1
  252. package/dist/core/todo-settings.d.ts +5 -0
  253. package/dist/core/todo-settings.d.ts.map +1 -0
  254. package/dist/core/todo-settings.js +7 -0
  255. package/dist/core/todo-settings.js.map +1 -0
  256. package/dist/core/tools/bash.d.ts.map +1 -1
  257. package/dist/core/tools/bash.js +4 -4
  258. package/dist/core/tools/bash.js.map +1 -1
  259. package/dist/core/tools/edit.d.ts.map +1 -1
  260. package/dist/core/tools/edit.js +5 -3
  261. package/dist/core/tools/edit.js.map +1 -1
  262. package/dist/core/tools/find.d.ts.map +1 -1
  263. package/dist/core/tools/find.js +4 -4
  264. package/dist/core/tools/find.js.map +1 -1
  265. package/dist/core/tools/grep.d.ts.map +1 -1
  266. package/dist/core/tools/grep.js +4 -4
  267. package/dist/core/tools/grep.js.map +1 -1
  268. package/dist/core/tools/ls.d.ts.map +1 -1
  269. package/dist/core/tools/ls.js +4 -4
  270. package/dist/core/tools/ls.js.map +1 -1
  271. package/dist/core/tools/read.d.ts.map +1 -1
  272. package/dist/core/tools/read.js +4 -4
  273. package/dist/core/tools/read.js.map +1 -1
  274. package/dist/core/tools/render-utils.d.ts +14 -5
  275. package/dist/core/tools/render-utils.d.ts.map +1 -1
  276. package/dist/core/tools/render-utils.js +34 -7
  277. package/dist/core/tools/render-utils.js.map +1 -1
  278. package/dist/core/tools/write.d.ts.map +1 -1
  279. package/dist/core/tools/write.js +4 -4
  280. package/dist/core/tools/write.js.map +1 -1
  281. package/dist/core/usage-service.d.ts.map +1 -1
  282. package/dist/core/usage-service.js +5 -3
  283. package/dist/core/usage-service.js.map +1 -1
  284. package/dist/gateway/adapters/discord.d.ts +12 -1
  285. package/dist/gateway/adapters/discord.d.ts.map +1 -1
  286. package/dist/gateway/adapters/discord.js +114 -24
  287. package/dist/gateway/adapters/discord.js.map +1 -1
  288. package/dist/gateway/adapters/telegram.d.ts +4 -2
  289. package/dist/gateway/adapters/telegram.d.ts.map +1 -1
  290. package/dist/gateway/adapters/telegram.js +41 -11
  291. package/dist/gateway/adapters/telegram.js.map +1 -1
  292. package/dist/gateway/agent-bridge.d.ts +18 -4
  293. package/dist/gateway/agent-bridge.d.ts.map +1 -1
  294. package/dist/gateway/agent-bridge.js +305 -73
  295. package/dist/gateway/agent-bridge.js.map +1 -1
  296. package/dist/gateway/approval.d.ts +3 -6
  297. package/dist/gateway/approval.d.ts.map +1 -1
  298. package/dist/gateway/approval.js +62 -24
  299. package/dist/gateway/approval.js.map +1 -1
  300. package/dist/gateway/authz.d.ts +2 -0
  301. package/dist/gateway/authz.d.ts.map +1 -1
  302. package/dist/gateway/authz.js +13 -0
  303. package/dist/gateway/authz.js.map +1 -1
  304. package/dist/gateway/buttons.d.ts +3 -1
  305. package/dist/gateway/buttons.d.ts.map +1 -1
  306. package/dist/gateway/buttons.js +45 -20
  307. package/dist/gateway/buttons.js.map +1 -1
  308. package/dist/gateway/command.d.ts.map +1 -1
  309. package/dist/gateway/command.js +49 -4
  310. package/dist/gateway/command.js.map +1 -1
  311. package/dist/gateway/commands.d.ts +2 -0
  312. package/dist/gateway/commands.d.ts.map +1 -1
  313. package/dist/gateway/commands.js +52 -16
  314. package/dist/gateway/commands.js.map +1 -1
  315. package/dist/gateway/config.d.ts +6 -0
  316. package/dist/gateway/config.d.ts.map +1 -1
  317. package/dist/gateway/config.js +7 -0
  318. package/dist/gateway/config.js.map +1 -1
  319. package/dist/gateway/conversations.d.ts +14 -0
  320. package/dist/gateway/conversations.d.ts.map +1 -0
  321. package/dist/gateway/conversations.js +30 -0
  322. package/dist/gateway/conversations.js.map +1 -0
  323. package/dist/gateway/cron.d.ts +1 -1
  324. package/dist/gateway/cron.d.ts.map +1 -1
  325. package/dist/gateway/cron.js +2 -2
  326. package/dist/gateway/cron.js.map +1 -1
  327. package/dist/gateway/download.d.ts +2 -0
  328. package/dist/gateway/download.d.ts.map +1 -0
  329. package/dist/gateway/download.js +36 -0
  330. package/dist/gateway/download.js.map +1 -0
  331. package/dist/gateway/index.d.ts.map +1 -1
  332. package/dist/gateway/index.js +106 -47
  333. package/dist/gateway/index.js.map +1 -1
  334. package/dist/gateway/mobile-commands.d.ts +24 -0
  335. package/dist/gateway/mobile-commands.d.ts.map +1 -0
  336. package/dist/gateway/mobile-commands.js +423 -0
  337. package/dist/gateway/mobile-commands.js.map +1 -0
  338. package/dist/gateway/presenter.d.ts +27 -0
  339. package/dist/gateway/presenter.d.ts.map +1 -0
  340. package/dist/gateway/presenter.js +308 -0
  341. package/dist/gateway/presenter.js.map +1 -0
  342. package/dist/gateway/router.d.ts +6 -5
  343. package/dist/gateway/router.d.ts.map +1 -1
  344. package/dist/gateway/router.js +126 -43
  345. package/dist/gateway/router.js.map +1 -1
  346. package/dist/gateway/service.d.ts +46 -0
  347. package/dist/gateway/service.d.ts.map +1 -0
  348. package/dist/gateway/service.js +404 -0
  349. package/dist/gateway/service.js.map +1 -0
  350. package/dist/gateway/setup.d.ts +9 -0
  351. package/dist/gateway/setup.d.ts.map +1 -0
  352. package/dist/gateway/setup.js +202 -0
  353. package/dist/gateway/setup.js.map +1 -0
  354. package/dist/gateway/stream.d.ts +6 -5
  355. package/dist/gateway/stream.d.ts.map +1 -1
  356. package/dist/gateway/stream.js +24 -11
  357. package/dist/gateway/stream.js.map +1 -1
  358. package/dist/gateway/types.d.ts +4 -2
  359. package/dist/gateway/types.d.ts.map +1 -1
  360. package/dist/gateway/types.js.map +1 -1
  361. package/dist/index.d.ts +2 -0
  362. package/dist/index.d.ts.map +1 -1
  363. package/dist/index.js +2 -0
  364. package/dist/index.js.map +1 -1
  365. package/dist/main.d.ts.map +1 -1
  366. package/dist/main.js +3 -3
  367. package/dist/main.js.map +1 -1
  368. package/dist/modes/interactive/components/assistant-message.d.ts +19 -2
  369. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  370. package/dist/modes/interactive/components/assistant-message.js +78 -17
  371. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  372. package/dist/modes/interactive/components/copyable-text.d.ts +27 -0
  373. package/dist/modes/interactive/components/copyable-text.d.ts.map +1 -0
  374. package/dist/modes/interactive/components/copyable-text.js +156 -0
  375. package/dist/modes/interactive/components/copyable-text.js.map +1 -0
  376. package/dist/modes/interactive/components/custom-entry.d.ts +1 -0
  377. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  378. package/dist/modes/interactive/components/custom-entry.js +8 -0
  379. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  380. package/dist/modes/interactive/components/custom-message.d.ts +1 -0
  381. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  382. package/dist/modes/interactive/components/custom-message.js +8 -0
  383. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  384. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  385. package/dist/modes/interactive/components/session-selector.js +16 -0
  386. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  387. package/dist/modes/interactive/components/settings-selector.d.ts +12 -1
  388. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  389. package/dist/modes/interactive/components/settings-selector.js +74 -3
  390. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  391. package/dist/modes/interactive/components/thinking-tail.d.ts +9 -2
  392. package/dist/modes/interactive/components/thinking-tail.d.ts.map +1 -1
  393. package/dist/modes/interactive/components/thinking-tail.js +43 -1
  394. package/dist/modes/interactive/components/thinking-tail.js.map +1 -1
  395. package/dist/modes/interactive/components/tool-execution.d.ts +5 -3
  396. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  397. package/dist/modes/interactive/components/tool-execution.js +44 -45
  398. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  399. package/dist/modes/interactive/interactive-mode.d.ts +10 -2
  400. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  401. package/dist/modes/interactive/interactive-mode.js +342 -133
  402. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  403. package/dist/modes/interactive/theme/theme.d.ts +1 -0
  404. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  405. package/dist/modes/interactive/theme/theme.js +23 -0
  406. package/dist/modes/interactive/theme/theme.js.map +1 -1
  407. package/dist/node-runtime/agent-session-services-MQUPZSIN.js +51 -0
  408. package/dist/node-runtime/{builtin-extensions-SRCYQPZ6.js → builtin-extensions-4GNDR6U3.js} +7 -6
  409. package/dist/node-runtime/{chunk-LTXUQJI4.js → chunk-24C5IAJ4.js} +1 -6
  410. package/dist/node-runtime/chunk-2BLXLDJR.js +144 -0
  411. package/dist/node-runtime/{chunk-RQ5DNUNG.js → chunk-2CMV4L24.js} +21 -124
  412. package/dist/node-runtime/{chunk-LTYWTR3V.js → chunk-2MI5OPMN.js} +17 -2
  413. package/dist/node-runtime/{chunk-W3CVH5RX.js → chunk-2TKODGBZ.js} +11 -6
  414. package/dist/node-runtime/{chunk-GT5F3OKM.js → chunk-33SIKK3Y.js} +38 -164
  415. package/dist/node-runtime/{chunk-GZQHMEWL.js → chunk-3DKIWPKN.js} +19 -4
  416. package/dist/node-runtime/{chunk-3GHXVUAK.js → chunk-3VEY2IYY.js} +1 -1
  417. package/dist/node-runtime/chunk-4ER2ZV4Z.js +537 -0
  418. package/dist/node-runtime/chunk-4EULYYR4.js +62 -0
  419. package/dist/node-runtime/{chunk-LOYUC2ID.js → chunk-4SBQAI4T.js} +27 -27
  420. package/dist/node-runtime/{chunk-CZUBYPFP.js → chunk-53ARRUHA.js} +674 -257
  421. package/dist/node-runtime/{chunk-VTPM5V35.js → chunk-5Q4A37RB.js} +10 -4
  422. package/dist/node-runtime/{chunk-SWSN6HAB.js → chunk-5UZOPGE3.js} +1 -1
  423. package/dist/node-runtime/{chunk-XSRCAQK2.js → chunk-5Z5PCXGY.js} +263 -222
  424. package/dist/node-runtime/chunk-7JIYPIQU.js +356 -0
  425. package/dist/node-runtime/{chunk-D466UAID.js → chunk-AJ6R5VTV.js} +60 -88
  426. package/dist/node-runtime/chunk-ATIF3RX5.js +352 -0
  427. package/dist/node-runtime/{chunk-A3KMVBZV.js → chunk-BBUVIEZB.js} +1 -10
  428. package/dist/node-runtime/chunk-CCCN2UCX.js +14 -0
  429. package/dist/node-runtime/chunk-CJS4KQFI.js +3412 -0
  430. package/dist/node-runtime/chunk-DO6PALE2.js +205 -0
  431. package/dist/node-runtime/{chunk-N3PNL74S.js → chunk-DRJI7ZSC.js} +63 -163
  432. package/dist/node-runtime/{chunk-VTGEKB7R.js → chunk-E75WFZ33.js} +1 -1
  433. package/dist/node-runtime/{chunk-MJQDX3BA.js → chunk-EBB4BJW4.js} +3 -3
  434. package/dist/node-runtime/{chunk-VQ4UBWSA.js → chunk-EOEAQIJV.js} +63 -6
  435. package/dist/node-runtime/chunk-EOPL2HMM.js +117 -0
  436. package/dist/node-runtime/chunk-H4K3JDRB.js +47 -0
  437. package/dist/node-runtime/{chunk-HRS4HMDX.js → chunk-HT2XEJNP.js} +19 -3
  438. package/dist/node-runtime/chunk-IMLCWLPI.js +9 -0
  439. package/dist/node-runtime/{chunk-BJ6H7DPI.js → chunk-JJWZB7S3.js} +62 -50
  440. package/dist/node-runtime/chunk-KFFOQR4G.js +672 -0
  441. package/dist/node-runtime/chunk-L5LZUGT7.js +40 -0
  442. package/dist/node-runtime/chunk-LV6CEFW2.js +97 -0
  443. package/dist/node-runtime/{chunk-VSELYKWU.js → chunk-LWYIVUGV.js} +2 -1
  444. package/dist/node-runtime/{chunk-BYQ2MOFI.js → chunk-MFV2LOOX.js} +184 -2192
  445. package/dist/node-runtime/{chunk-5SQDLSZJ.js → chunk-MNRO3UCV.js} +2 -2
  446. package/dist/node-runtime/{chunk-JHYKXIMM.js → chunk-MPKSOJBT.js} +1 -1
  447. package/dist/node-runtime/{chunk-C4O2RSQQ.js → chunk-N4TUWAGA.js} +1 -1
  448. package/dist/node-runtime/{chunk-7NBZ5P7I.js → chunk-NAY6UUQZ.js} +1 -1
  449. package/dist/node-runtime/chunk-NKH2QBKF.js +773 -0
  450. package/dist/node-runtime/chunk-O2AT4MEU.js +124 -0
  451. package/dist/node-runtime/chunk-OAR4TYZE.js +146 -0
  452. package/dist/node-runtime/{chunk-DDGMHUOW.js → chunk-OGJN3OZV.js} +2 -1
  453. package/dist/node-runtime/{chunk-MX3GJNXJ.js → chunk-PLGA743X.js} +23 -0
  454. package/dist/node-runtime/chunk-Q3FEOEDA.js +1364 -0
  455. package/dist/node-runtime/{chunk-H2BI7G7T.js → chunk-QFADHUQV.js} +2 -1
  456. package/dist/node-runtime/{chunk-W3SILANP.js → chunk-RBZQU6TJ.js} +12 -9
  457. package/dist/node-runtime/{chunk-ZVSORYRM.js → chunk-RVOQBXTA.js} +10 -6
  458. package/dist/node-runtime/{chunk-HXJS2PJM.js → chunk-RW4PYFNE.js} +14 -94
  459. package/dist/node-runtime/chunk-TP7K7YWS.js +2830 -0
  460. package/dist/node-runtime/{chunk-ZOIIMEN6.js → chunk-TVLBDVTR.js} +32 -21
  461. package/dist/node-runtime/chunk-UAEOTO52.js +119 -0
  462. package/dist/node-runtime/{chunk-MGWCVY6Y.js → chunk-UDKX3PFN.js} +3 -3
  463. package/dist/node-runtime/{chunk-AY6CAJSL.js → chunk-UJOCPOMX.js} +6 -3
  464. package/dist/node-runtime/{chunk-WJVFOIB5.js → chunk-UQUCFAJ3.js} +1 -1
  465. package/dist/node-runtime/chunk-US544NN6.js +13 -0
  466. package/dist/node-runtime/{chunk-7AFOFSDY.js → chunk-V3HK3FE7.js} +1 -1
  467. package/dist/node-runtime/{chunk-6UB6NKA3.js → chunk-VIVYOI7C.js} +130 -27
  468. package/dist/node-runtime/{chunk-MW2XJZIK.js → chunk-XHIRAZ26.js} +1 -1
  469. package/dist/node-runtime/chunk-YPHAIRZT.js +10 -0
  470. package/dist/node-runtime/{chunk-3RCWXWAY.js → chunk-YRUY57IN.js} +1 -1
  471. package/dist/node-runtime/cli-runtime.js +2 -2
  472. package/dist/node-runtime/command-PYBNGLPP.js +45 -0
  473. package/dist/node-runtime/{commands-BZGSLIP7.js → commands-EMBQQVVT.js} +13 -13
  474. package/dist/node-runtime/commands-Y2OUC2T7.js +37 -0
  475. package/dist/node-runtime/config-7DYMNJUO.js +20 -0
  476. package/dist/node-runtime/{customize-LF5VST47.js → customize-VFJV3U6A.js} +2 -1
  477. package/dist/node-runtime/{direct-tool-executor-BSZDHIYR.js → direct-tool-executor-4D7UXYU4.js} +10 -10
  478. package/dist/node-runtime/{export-html-E4DT6ZJQ.js → export-html-ETFOKW3M.js} +4 -3
  479. package/dist/node-runtime/{extension-input-RV5N6APL.js → extension-input-7QODTFAS.js} +4 -4
  480. package/dist/node-runtime/{extension-selector-CPD5LWDD.js → extension-selector-T65JEDJ5.js} +4 -4
  481. package/dist/node-runtime/{extract-XLQSJN4V.js → extract-EQJE7FZZ.js} +2 -2
  482. package/dist/node-runtime/gateway-QENRQA5X.js +1476 -0
  483. package/dist/node-runtime/{gemini-search-U7SUMPQA.js → gemini-search-35OCRFLN.js} +1 -1
  484. package/dist/node-runtime/{gemini-url-context-PXWCBQHK.js → gemini-url-context-UQY3PHHW.js} +2 -2
  485. package/dist/node-runtime/index.js +113 -73
  486. package/dist/node-runtime/{init-DVJUAOUO.js → init-P5AUV77I.js} +5 -5
  487. package/dist/node-runtime/{install-cli-TH7IJJQQ.js → install-cli-KHAXYBOO.js} +21 -82
  488. package/dist/node-runtime/interactive-mode-IN77GQGX.js +74 -0
  489. package/dist/node-runtime/{interactive-view-N6F4KUIT.js → interactive-view-OMWDFGUQ.js} +10 -10
  490. package/dist/node-runtime/lunr-browser-VVPRWC3F.js +174 -0
  491. package/dist/node-runtime/{lunr-computer-use-TJNDAMWM.js → lunr-computer-use-IAUNXSXH.js} +11 -8
  492. package/dist/node-runtime/{lunr-cron-J64I72C6.js → lunr-cron-P6ZJGVEF.js} +21 -7
  493. package/dist/node-runtime/main.js +47 -34
  494. package/dist/node-runtime/{mcp-auth-flow-YL6RWPYG.js → mcp-auth-flow-QVLFVLEO.js} +2 -2
  495. package/dist/node-runtime/{memory-cap-3S4XRLNP.js → memory-cap-EL3KL4JJ.js} +2 -1
  496. package/dist/node-runtime/mobile-commands-WKFSFACZ.js +33 -0
  497. package/dist/node-runtime/model-runtime-YXGJS5OJ.js +16 -0
  498. package/dist/node-runtime/{model-tiers-NJLHUEGK.js → model-tiers-OU3U5CZG.js} +2 -1
  499. package/dist/node-runtime/{package-manager-cli-VMYX4Y2S.js → package-manager-cli-J337RKTI.js} +25 -17
  500. package/dist/node-runtime/{pi-intercom-NV2LW6X7.js → pi-intercom-QM53RLTS.js} +6 -1
  501. package/dist/node-runtime/{pi-mcp-adapter-JLB5YL2F.js → pi-mcp-adapter-3PHF4KZ4.js} +8 -7
  502. package/dist/node-runtime/{pi-subagents-WEHV3W7H.js → pi-subagents-RCHPB6UK.js} +255 -88
  503. package/dist/node-runtime/{pi-web-access-FN5YC5T6.js → pi-web-access-PNG35XW7.js} +15 -15
  504. package/dist/node-runtime/process-registry-PVJ44F7H.js +31 -0
  505. package/dist/node-runtime/{proxy-modes-OR7ISBXK.js → proxy-modes-5FAPSZEZ.js} +11 -11
  506. package/dist/node-runtime/rpc-entry.js +47 -34
  507. package/dist/node-runtime/{rpc-mode-SJNSOA4G.js → rpc-mode-SH7VB4RH.js} +2 -2
  508. package/dist/node-runtime/runtime-4VA6JKNF.js +373 -0
  509. package/dist/node-runtime/runtime-bridges-3CQHWVVY.js +21 -0
  510. package/dist/node-runtime/service-HGGU3STY.js +36 -0
  511. package/dist/node-runtime/session-handoff-IAFIK7QP.js +33 -0
  512. package/dist/node-runtime/{session-manager-QEMZBMTM.js → session-manager-TCEFDKBL.js} +2 -1
  513. package/dist/node-runtime/{session-selector-URVJLOTK.js → session-selector-HG5J4BDZ.js} +5 -4
  514. package/dist/node-runtime/{settings-manager-3CCU326G.js → settings-manager-HIBIUNBK.js} +12 -5
  515. package/dist/node-runtime/setup-JBKOLJ6F.js +18 -0
  516. package/dist/node-runtime/setup-YU5LKRL3.js +215 -0
  517. package/dist/node-runtime/{subagent-executor-CXKXQDHH.js → subagent-executor-2BH76MMS.js} +64 -23
  518. package/dist/node-runtime/theme-WTJWZSGD.js +68 -0
  519. package/dist/node-runtime/trust-manager-6ZQANSBX.js +17 -0
  520. package/dist/node-runtime/{update-cli-NM7B4CKL.js → update-cli-TVTPVUNM.js} +6 -3
  521. package/dist/node-runtime/usage-service-LFB2SWYV.js +37 -0
  522. package/dist/node-runtime/{video-extract-OYT5WKS5.js → video-extract-OOZHR7SU.js} +2 -2
  523. package/dist/node-runtime/{workflow-C26QCUTW.js → workflow-TVJNKKQP.js} +80 -39
  524. package/dist/node-runtime/{youtube-extract-TQYKGFGS.js → youtube-extract-FNPAUNHU.js} +6 -6
  525. package/dist/startup/interactive-view.d.ts.map +1 -1
  526. package/dist/startup/interactive-view.js +5 -1
  527. package/dist/startup/interactive-view.js.map +1 -1
  528. package/dist/utils/image-resize-core.d.ts +2 -0
  529. package/dist/utils/image-resize-core.d.ts.map +1 -1
  530. package/dist/utils/image-resize-core.js +10 -0
  531. package/dist/utils/image-resize-core.js.map +1 -1
  532. package/docs/browser.md +86 -0
  533. package/docs/computer-use.md +134 -48
  534. package/docs/extensions.md +2 -0
  535. package/docs/features.md +108 -27
  536. package/docs/index.md +1 -1
  537. package/docs/interactive-startup.md +2 -1
  538. package/docs/keybindings.md +1 -1
  539. package/docs/providers.md +6 -2
  540. package/docs/quickstart.md +2 -2
  541. package/docs/sessions.md +10 -0
  542. package/docs/settings.md +3 -1
  543. package/docs/tui.md +2 -0
  544. package/docs/usage.md +20 -4
  545. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  546. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  547. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  548. package/examples/extensions/gondolin/package-lock.json +2 -2
  549. package/examples/extensions/gondolin/package.json +1 -1
  550. package/examples/extensions/plan-mode/README.md +1 -1
  551. package/examples/extensions/sandbox/package-lock.json +2 -2
  552. package/examples/extensions/sandbox/package.json +1 -1
  553. package/examples/extensions/with-deps/package-lock.json +2 -2
  554. package/examples/extensions/with-deps/package.json +1 -1
  555. package/install-lock/package-lock.json +39 -25
  556. package/install-lock/package.json +2 -2
  557. package/npm-shrinkwrap.json +36 -22
  558. package/package.json +10 -7
  559. package/scripts/install-browser.mjs +20 -0
  560. package/dist/node-runtime/agent-session-services-QANFGM2V.js +0 -40
  561. package/dist/node-runtime/chunk-LISUTZS3.js +0 -19
  562. package/dist/node-runtime/chunk-VGYZ3APQ.js +0 -59
  563. package/dist/node-runtime/chunk-XAUQOKYK.js +0 -6011
  564. package/dist/node-runtime/command-ZURZJDXF.js +0 -13
  565. package/dist/node-runtime/gateway-FWHRIBK5.js +0 -2139
  566. package/dist/node-runtime/interactive-mode-BBASNWHN.js +0 -62
  567. package/dist/node-runtime/runtime-bridges-2VQTLPOZ.js +0 -12
  568. package/dist/node-runtime/{chunk-U6C7VTR5.js → chunk-7IQGBKBJ.js} +3 -3
  569. package/dist/node-runtime/{mcp-panel-IIGMXQGP.js → mcp-panel-KTTFXJZ4.js} +3 -3
  570. package/dist/node-runtime/{src-BPQFJR76.js → src-IVPNZ2BX.js} +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"image-resize-core.js","sourceRoot":"","sources":["../../src/utils/image-resize-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAA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AAC;YAED,MAAM,SAAS,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC;YACxF,MAAM,UAAU,GAAG,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC;YAC3F,IAAI,SAAS,KAAK,YAAY,IAAI,UAAU,KAAK,aAAa,EAAE,CAAC;gBAChE,MAAM;YACP,CAAC;YAED,YAAY,GAAG,SAAS,CAAC;YACzB,aAAa,GAAG,UAAU,CAAC;QAC5B,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,IAAI,CAAC;IACb,CAAC;YAAS,CAAC;QACV,IAAI,KAAK,EAAE,CAAC;YACX,KAAK,CAAC,IAAI,EAAE,CAAC;QACd,CAAC;IACF,CAAC;AAAA,CACD","sourcesContent":["import { applyExifOrientation } from \"./exif-orientation.ts\";\nimport { loadPhoton } from \"./photon.ts\";\n\nexport interface ImageResizeOptions {\n\tmaxWidth?: number; // Default: 2000\n\tmaxHeight?: number; // Default: 2000\n\tmaxBytes?: number; // Default: 4.5MB of base64 payload (below Anthropic's 5MB limit)\n\tjpegQuality?: number; // Default: 80\n}\n\nexport interface ResizedImage {\n\tdata: string; // base64\n\tmimeType: string;\n\toriginalWidth: number;\n\toriginalHeight: number;\n\twidth: number;\n\theight: number;\n\twasResized: boolean;\n}\n\n// 4.5MB of base64 payload. Provides headroom below Anthropic's 5MB limit.\nconst DEFAULT_MAX_BYTES = 4.5 * 1024 * 1024;\n\nconst DEFAULT_OPTIONS: Required<ImageResizeOptions> = {\n\tmaxWidth: 2000,\n\tmaxHeight: 2000,\n\tmaxBytes: DEFAULT_MAX_BYTES,\n\tjpegQuality: 80,\n};\n\ninterface EncodedCandidate {\n\tdata: string;\n\tencodedSize: number;\n\tmimeType: string;\n}\n\nfunction encodeCandidate(buffer: Uint8Array, mimeType: string): EncodedCandidate {\n\tconst data = Buffer.from(buffer).toString(\"base64\");\n\treturn {\n\t\tdata,\n\t\tencodedSize: Buffer.byteLength(data, \"utf-8\"),\n\t\tmimeType,\n\t};\n}\n\n/**\n * Resize an image to fit within the specified max dimensions and encoded file size.\n * Returns null if the image cannot be resized below maxBytes.\n *\n * Uses Photon (Rust/WASM) for image processing. If Photon is not available,\n * returns null.\n *\n * Strategy for staying under maxBytes:\n * 1. First resize to maxWidth/maxHeight\n * 2. Try both PNG and JPEG formats, pick the smaller one\n * 3. If still too large, try JPEG with decreasing quality\n * 4. If still too large, progressively reduce dimensions until 1x1\n */\nexport async function resizeImageInProcess(\n\tinputBytes: Uint8Array,\n\tmimeType: string,\n\toptions?: ImageResizeOptions,\n): Promise<ResizedImage | null> {\n\tconst opts = { ...DEFAULT_OPTIONS, ...options };\n\tconst inputBase64Size = Math.ceil(inputBytes.byteLength / 3) * 4;\n\n\tconst photon = await loadPhoton();\n\tif (!photon) {\n\t\treturn null;\n\t}\n\n\tlet image: ReturnType<typeof photon.PhotonImage.new_from_byteslice> | undefined;\n\ttry {\n\t\tconst rawImage = photon.PhotonImage.new_from_byteslice(inputBytes);\n\t\timage = applyExifOrientation(photon, rawImage, inputBytes);\n\t\tif (image !== rawImage) rawImage.free();\n\n\t\tconst originalWidth = image.get_width();\n\t\tconst originalHeight = image.get_height();\n\t\tconst format = mimeType.split(\"/\")[1] ?? \"png\";\n\n\t\t// Check if already within all limits (dimensions AND encoded size)\n\t\tif (originalWidth <= opts.maxWidth && originalHeight <= opts.maxHeight && inputBase64Size < opts.maxBytes) {\n\t\t\treturn {\n\t\t\t\tdata: Buffer.from(inputBytes).toString(\"base64\"),\n\t\t\t\tmimeType: mimeType || `image/${format}`,\n\t\t\t\toriginalWidth,\n\t\t\t\toriginalHeight,\n\t\t\t\twidth: originalWidth,\n\t\t\t\theight: originalHeight,\n\t\t\t\twasResized: false,\n\t\t\t};\n\t\t}\n\n\t\t// Calculate initial dimensions respecting max limits\n\t\tlet targetWidth = originalWidth;\n\t\tlet targetHeight = originalHeight;\n\n\t\tif (targetWidth > opts.maxWidth) {\n\t\t\ttargetHeight = Math.round((targetHeight * opts.maxWidth) / targetWidth);\n\t\t\ttargetWidth = opts.maxWidth;\n\t\t}\n\t\tif (targetHeight > opts.maxHeight) {\n\t\t\ttargetWidth = Math.round((targetWidth * opts.maxHeight) / targetHeight);\n\t\t\ttargetHeight = opts.maxHeight;\n\t\t}\n\n\t\tfunction tryEncodings(width: number, height: number, jpegQualities: number[]): EncodedCandidate[] {\n\t\t\tconst resized = photon!.resize(image!, width, height, photon!.SamplingFilter.Lanczos3);\n\n\t\t\ttry {\n\t\t\t\tconst candidates: EncodedCandidate[] = [encodeCandidate(resized.get_bytes(), \"image/png\")];\n\t\t\t\tfor (const quality of jpegQualities) {\n\t\t\t\t\tcandidates.push(encodeCandidate(resized.get_bytes_jpeg(quality), \"image/jpeg\"));\n\t\t\t\t}\n\t\t\t\treturn candidates;\n\t\t\t} finally {\n\t\t\t\tresized.free();\n\t\t\t}\n\t\t}\n\n\t\tconst qualitySteps = Array.from(new Set([opts.jpegQuality, 85, 70, 55, 40]));\n\t\tlet currentWidth = targetWidth;\n\t\tlet currentHeight = targetHeight;\n\n\t\twhile (true) {\n\t\t\tconst candidates = tryEncodings(currentWidth, currentHeight, qualitySteps);\n\t\t\tfor (const candidate of candidates) {\n\t\t\t\tif (candidate.encodedSize < opts.maxBytes) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: candidate.data,\n\t\t\t\t\t\tmimeType: candidate.mimeType,\n\t\t\t\t\t\toriginalWidth,\n\t\t\t\t\t\toriginalHeight,\n\t\t\t\t\t\twidth: currentWidth,\n\t\t\t\t\t\theight: currentHeight,\n\t\t\t\t\t\twasResized: true,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (currentWidth === 1 && currentHeight === 1) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst nextWidth = currentWidth === 1 ? 1 : Math.max(1, Math.floor(currentWidth * 0.75));\n\t\t\tconst nextHeight = currentHeight === 1 ? 1 : Math.max(1, Math.floor(currentHeight * 0.75));\n\t\t\tif (nextWidth === currentWidth && nextHeight === currentHeight) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcurrentWidth = nextWidth;\n\t\t\tcurrentHeight = nextHeight;\n\t\t}\n\n\t\treturn null;\n\t} catch {\n\t\treturn null;\n\t} finally {\n\t\tif (image) {\n\t\t\timage.free();\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"image-resize-core.js","sourceRoot":"","sources":["../../src/utils/image-resize-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAqBzC,0EAA0E;AAC1E,MAAM,iBAAiB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,MAAM,eAAe,GAAiC;IACrD,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,iBAAiB;IAC3B,WAAW,EAAE,EAAE;IACf,uBAAuB,EAAE,KAAK;CAC9B,CAAC;AAQF,SAAS,eAAe,CAAC,MAAkB,EAAE,QAAgB,EAAoB;IAChF,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACpD,OAAO;QACN,IAAI;QACJ,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC;QAC7C,QAAQ;KACR,CAAC;AAAA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C,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC;YACxF,MAAM,UAAU,GAAG,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC;YAC3F,IAAI,SAAS,KAAK,YAAY,IAAI,UAAU,KAAK,aAAa,EAAE,CAAC;gBAChE,MAAM;YACP,CAAC;YAED,YAAY,GAAG,SAAS,CAAC;YACzB,aAAa,GAAG,UAAU,CAAC;QAC5B,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,IAAI,CAAC;IACb,CAAC;YAAS,CAAC;QACV,IAAI,KAAK,EAAE,CAAC;YACX,KAAK,CAAC,IAAI,EAAE,CAAC;QACd,CAAC;IACF,CAAC;AAAA,CACD","sourcesContent":["import { createHash } from \"node:crypto\";\nimport { applyExifOrientation } from \"./exif-orientation.ts\";\nimport { loadPhoton } from \"./photon.ts\";\n\nexport interface ImageResizeOptions {\n\tmaxWidth?: number; // Default: 2000\n\tmaxHeight?: number; // Default: 2000\n\tmaxBytes?: number; // Default: 4.5MB of base64 payload (below Anthropic's 5MB limit)\n\tjpegQuality?: number; // Default: 80\n\tincludePixelFingerprint?: boolean;\n}\n\nexport interface ResizedImage {\n\tdata: string; // base64\n\tmimeType: string;\n\toriginalWidth: number;\n\toriginalHeight: number;\n\twidth: number;\n\theight: number;\n\twasResized: boolean;\n\tfingerprint?: string;\n}\n\n// 4.5MB of base64 payload. Provides headroom below Anthropic's 5MB limit.\nconst DEFAULT_MAX_BYTES = 4.5 * 1024 * 1024;\n\nconst DEFAULT_OPTIONS: Required<ImageResizeOptions> = {\n\tmaxWidth: 2000,\n\tmaxHeight: 2000,\n\tmaxBytes: DEFAULT_MAX_BYTES,\n\tjpegQuality: 80,\n\tincludePixelFingerprint: false,\n};\n\ninterface EncodedCandidate {\n\tdata: string;\n\tencodedSize: number;\n\tmimeType: string;\n}\n\nfunction encodeCandidate(buffer: Uint8Array, mimeType: string): EncodedCandidate {\n\tconst data = Buffer.from(buffer).toString(\"base64\");\n\treturn {\n\t\tdata,\n\t\tencodedSize: Buffer.byteLength(data, \"utf-8\"),\n\t\tmimeType,\n\t};\n}\n\n/**\n * Resize an image to fit within the specified max dimensions and encoded file size.\n * Returns null if the image cannot be resized below maxBytes.\n *\n * Uses Photon (Rust/WASM) for image processing. If Photon is not available,\n * returns null.\n *\n * Strategy for staying under maxBytes:\n * 1. First resize to maxWidth/maxHeight\n * 2. Try both PNG and JPEG formats, pick the smaller one\n * 3. If still too large, try JPEG with decreasing quality\n * 4. If still too large, progressively reduce dimensions until 1x1\n */\nexport async function resizeImageInProcess(\n\tinputBytes: Uint8Array,\n\tmimeType: string,\n\toptions?: ImageResizeOptions,\n): Promise<ResizedImage | null> {\n\tconst opts = { ...DEFAULT_OPTIONS, ...options };\n\tconst inputBase64Size = Math.ceil(inputBytes.byteLength / 3) * 4;\n\n\tconst photon = await loadPhoton();\n\tif (!photon) {\n\t\treturn null;\n\t}\n\n\tlet image: ReturnType<typeof photon.PhotonImage.new_from_byteslice> | undefined;\n\ttry {\n\t\tconst rawImage = photon.PhotonImage.new_from_byteslice(inputBytes);\n\t\timage = applyExifOrientation(photon, rawImage, inputBytes);\n\t\tif (image !== rawImage) rawImage.free();\n\n\t\tconst originalWidth = image.get_width();\n\t\tconst originalHeight = image.get_height();\n\t\tconst format = mimeType.split(\"/\")[1] ?? \"png\";\n\t\tconst fingerprint = opts.includePixelFingerprint\n\t\t\t? createHash(\"sha256\")\n\t\t\t\t\t.update(`${originalWidth}x${originalHeight}:`)\n\t\t\t\t\t.update(image.get_raw_pixels())\n\t\t\t\t\t.digest(\"hex\")\n\t\t\t: undefined;\n\n\t\t// Check if already within all limits (dimensions AND encoded size)\n\t\tif (originalWidth <= opts.maxWidth && originalHeight <= opts.maxHeight && inputBase64Size < opts.maxBytes) {\n\t\t\treturn {\n\t\t\t\tdata: Buffer.from(inputBytes).toString(\"base64\"),\n\t\t\t\tmimeType: mimeType || `image/${format}`,\n\t\t\t\toriginalWidth,\n\t\t\t\toriginalHeight,\n\t\t\t\twidth: originalWidth,\n\t\t\t\theight: originalHeight,\n\t\t\t\twasResized: false,\n\t\t\t\t...(fingerprint ? { fingerprint } : {}),\n\t\t\t};\n\t\t}\n\n\t\t// Calculate initial dimensions respecting max limits\n\t\tlet targetWidth = originalWidth;\n\t\tlet targetHeight = originalHeight;\n\n\t\tif (targetWidth > opts.maxWidth) {\n\t\t\ttargetHeight = Math.round((targetHeight * opts.maxWidth) / targetWidth);\n\t\t\ttargetWidth = opts.maxWidth;\n\t\t}\n\t\tif (targetHeight > opts.maxHeight) {\n\t\t\ttargetWidth = Math.round((targetWidth * opts.maxHeight) / targetHeight);\n\t\t\ttargetHeight = opts.maxHeight;\n\t\t}\n\n\t\tfunction tryEncodings(width: number, height: number, jpegQualities: number[]): EncodedCandidate[] {\n\t\t\tconst resized = photon!.resize(image!, width, height, photon!.SamplingFilter.Lanczos3);\n\n\t\t\ttry {\n\t\t\t\tconst candidates: EncodedCandidate[] = [encodeCandidate(resized.get_bytes(), \"image/png\")];\n\t\t\t\tfor (const quality of jpegQualities) {\n\t\t\t\t\tcandidates.push(encodeCandidate(resized.get_bytes_jpeg(quality), \"image/jpeg\"));\n\t\t\t\t}\n\t\t\t\treturn candidates;\n\t\t\t} finally {\n\t\t\t\tresized.free();\n\t\t\t}\n\t\t}\n\n\t\tconst qualitySteps = Array.from(new Set([opts.jpegQuality, 85, 70, 55, 40]));\n\t\tlet currentWidth = targetWidth;\n\t\tlet currentHeight = targetHeight;\n\n\t\twhile (true) {\n\t\t\tconst candidates = tryEncodings(currentWidth, currentHeight, qualitySteps);\n\t\t\tfor (const candidate of candidates) {\n\t\t\t\tif (candidate.encodedSize < opts.maxBytes) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: candidate.data,\n\t\t\t\t\t\tmimeType: candidate.mimeType,\n\t\t\t\t\t\toriginalWidth,\n\t\t\t\t\t\toriginalHeight,\n\t\t\t\t\t\twidth: currentWidth,\n\t\t\t\t\t\theight: currentHeight,\n\t\t\t\t\t\twasResized: true,\n\t\t\t\t\t\t...(fingerprint ? { fingerprint } : {}),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (currentWidth === 1 && currentHeight === 1) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst nextWidth = currentWidth === 1 ? 1 : Math.max(1, Math.floor(currentWidth * 0.75));\n\t\t\tconst nextHeight = currentHeight === 1 ? 1 : Math.max(1, Math.floor(currentHeight * 0.75));\n\t\t\tif (nextWidth === currentWidth && nextHeight === currentHeight) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcurrentWidth = nextWidth;\n\t\t\tcurrentHeight = nextHeight;\n\t\t}\n\n\t\treturn null;\n\t} catch {\n\t\treturn null;\n\t} finally {\n\t\tif (image) {\n\t\t\timage.free();\n\t\t}\n\t}\n}\n"]}
@@ -0,0 +1,86 @@
1
+ # Headless browser
2
+
3
+ The built-in `browser` tool runs Chromium through Playwright. Use it for pages that need JavaScript and for explicit website interactions. `web_search` still handles discovery; `fetch_content` still reads URLs. Neither tool automatically opens this browser. An interaction task can start with `browser` without fetching the page first.
4
+
5
+ ## Installation and settings
6
+
7
+ Browser is on by default. Normal npm installation and updates automatically install the Chromium revision required by the pinned `playwright-core` dependency, including Playwright's supporting binaries. The same lifecycle works in source workspaces and published packages. Existing matching binaries are reused from Playwright's OS cache. Ordinary builds and CLI startup never download or launch a browser; Playwright loads on first browser use.
8
+
9
+ Use **Browser** in `/settings` to turn it off or on. Turning it off immediately hides the tool and closes the session's browser, including pending initialization. It does not delete cached binaries. Turning it on makes the tool available without launching Chromium. The global `browserEnabled` setting defaults to true for new and existing users. A legacy explicit `features.browser.enabled: false` in `install-features.json` remains off until the user changes the new setting. An explicit `browserEnabled` value takes precedence; no legacy file is rewritten.
10
+
11
+ `npm install --ignore-scripts`, `npm --offline`, `PI_OFFLINE=1`, and `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1` skip automatic Chromium installation. A failed download warns without making the rest of lunR unusable. Browser calls diagnose missing binaries and never install them silently. When online, run:
12
+
13
+ ```sh
14
+ lunr browser install
15
+ ```
16
+
17
+ `lunr setup` also installs matching Chromium automatically, including for Node-based standalone layouts. `PLAYWRIGHT_BROWSERS_PATH` selects an alternate cache and must be consistent between installation and execution. Linux may require Chromium system libraries; install those through your OS administrator. lunR does not install OS packages or disable Chromium's sandbox. Standalone compiled Bun browser installation has not been validated.
18
+
19
+ ## Actions
20
+
21
+ There is one tool, `browser`, with these actions:
22
+
23
+ | Action | Parameters and result |
24
+ | --- | --- |
25
+ | `navigate` | Required `url`, optional `tab`. Opens a browser if needed and navigates the selected tab. Returns its id and URL. |
26
+ | `inspect` | Returns an accessible snapshot. Optional `role` with exact `name`, or exact `label`, scopes the snapshot to one element. |
27
+ | `act` | Required `interaction` and target. Supports `click`, `fill`, `select`, `check`, `press`. |
28
+ | `tabs` | Required `operation`: `list`, `create`, `select`, `close`. `create` optionally takes a URL; `select` requires `tab`. |
29
+ | `screenshot` | Returns an explicit JPEG of the current viewport. It is never taken automatically. |
30
+ | `close` | Closes Chromium, the proxy, and every tab. Discards cookies and in-memory storage. |
31
+
32
+ Targets use an accessible `role` and optional exact `name`, or an exact field `label`. Inspect first to find the target. Zero or multiple matches produce an error; lunR does not choose the first match. There is no CSS selector, coordinate-click, or arbitrary JavaScript evaluation parameter.
33
+
34
+ ```json
35
+ {"action":"navigate","url":"https://example.com"}
36
+ {"action":"inspect"}
37
+ {"action":"act","interaction":"fill","label":"Search","value":"release notes"}
38
+ {"action":"act","interaction":"click","role":"button","name":"Search"}
39
+ {"action":"inspect","role":"main"}
40
+ ```
41
+
42
+ `fill` takes text in `value`. `select` takes the option's value. `check` requires `checked: true` or `false`. `press` accepts Enter, Tab, Escape, Space, Backspace, Delete, arrow keys, Home, End, PageUp, and PageDown. Clipboard shortcuts are excluded.
43
+
44
+ ## Permissions and external effects
45
+
46
+ Read-only sessions and children can navigate, inspect, capture screenshots, and manage tabs. They cannot call `act`. Yolo and auto permit interactions without per-action approval.
47
+
48
+ Observation is not a guarantee of zero external effects. Loading a page executes its JavaScript and can send requests. Clicking, filling, checking, selecting, or pressing a key may submit forms or change remote data. `/undo`, `/edit`, and `/rollback` cannot reverse website effects. After a timeout or cancellation, inspect the site before retrying an action that might already have succeeded.
49
+
50
+ Page text and screenshots are untrusted content, not instructions for the agent. A page can contain misleading labels or prompt injection. Granting access to a site does not authorize unrelated actions found in its content.
51
+
52
+ ## Network policy
53
+
54
+ The default policy permits public HTTP and HTTPS destinations only. It rejects embedded URL credentials, private/reserved IPv4 ranges, and IPv6 addresses outside the permitted global range, including mapped IPv4 and transition ranges.
55
+
56
+ Browser HTTP requests and HTTPS tunnels pass through a session-owned loopback proxy. The proxy checks all resolved addresses and connects to a checked IP rather than resolving the hostname again. Redirect destinations and subrequests must pass the same checks. Chromium's loopback proxy bypass is disabled. Service workers and WebSockets are blocked; QUIC and non-proxied WebRTC UDP are disabled. Some sites will not work with those restrictions.
57
+
58
+ For a local development server, explicitly opt in yourself:
59
+
60
+ ```json
61
+ {"browserAllowPrivateNetwork": true}
62
+ ```
63
+
64
+ Set `browserAllowPrivateNetwork` in global `settings.json` yourself and restart after changing it. This grants access to **all local and private destinations**, including requests initiated by public pages. It is not a per-site allowlist. To return to the public-only policy:
65
+
66
+ ```json
67
+ {"browserAllowPrivateNetwork": false}
68
+ ```
69
+
70
+ These checks are defense in depth, not an OS network sandbox. The proxy classifies destination IPs, not ownership of globally routed addresses. It cannot identify a public address routed internally by a VPN, or stop a public server from relaying requests elsewhere. Chromium vulnerabilities and other local processes are outside this policy. The loopback proxy is temporary and is not an authenticated multi-user service. Use an OS/container network boundary when hostile sites require stronger isolation.
71
+
72
+ ## Lifetime and limits
73
+
74
+ Each session owns a new ephemeral browser context. Children get separate contexts and processes, not their parent's cookies. Sessions never attach to an existing browser or import cookies, profiles, passwords, or history. There are no uploads, accepted downloads, clipboard access, or camera/microphone/device grants. File choosers have no tool action; downloads are refused and cancelled.
75
+
76
+ Operations are serialized, with at most 16 queued calls and four tabs including popups. Snapshots return at most 16KB or 300 lines, plus a truncation notice. Scope `inspect` with a unique role/name or label when it truncates. Chromium still constructs the accessible snapshot before truncation; this is an output limit, not a page-memory limit. The viewport is 1280 by 800; screenshots are capped at 2MB.
77
+
78
+ Operations have a 30-second deadline, with shorter launch, navigation, and interaction timeouts. Cancellation closes the browser rather than keeping partially completed state. Session replacement, reload, shutdown, and aborted turns also close it. Five minutes without a browser operation discards the context. Resuming a conversation does not restore its browser state. Forced process termination cannot promise the same cleanup as a normal shutdown.
79
+
80
+ ## Development validation
81
+
82
+ Install Chromium into an isolated cache explicitly, then use that same `PLAYWRIGHT_BROWSERS_PATH` for tests. `test/browser.test.ts` runs policy tests without Chromium and enables its actual-browser cases only when this variable is set. `test/browser-lifecycle.test.ts` covers missing binaries, deferred loading, settings-driven cleanup, and cancellation during launch. Browser settings and install tests cover default-on behavior, legacy explicit disable, npm lifecycle execution, offline installs, and ignored scripts.
83
+
84
+ After the offline package builds and coding-agent Node bundle, run `node scripts/check-browser.mjs`. It uses a local scripted provider and fixture website, with the normal child permission environment for auto and read-only CLI sessions. A third session verifies missing-Chromium recovery. The checker terminates completed print processes after the final answer because of the existing headless exit behavior. It saves sanitized fixture results, tool inventories, and isolated prompts under `.artifacts/browser-smoke/`; nothing is sent to an external model.
85
+
86
+ `node scripts/check-interactive-first-paint.mjs` verifies both disabled and enabled browser tool inventories while the implementation imports are stalled. No Chromium launch is needed for that check.
@@ -1,14 +1,12 @@
1
1
  # Image-only computer use
2
2
 
3
- This dev-channel integration combines stable lunR 0.2.21 with image-only computer
4
- use. Offline builds, focused automated tests, local scripted-provider startup
5
- checks, and isolated package installation pass. No live desktop capture or input,
6
- native runtime launch, or remote inference ran. Stable production publication
7
- remains blocked. Smooth cursor animation is not included.
8
-
9
- The dev package is `@ashx-j/lunr-dev`, with command `lunr-dev` and update command
10
- `lunr-dev update`. Stable `@ashx-j/lunr` and `lunr` remain separate. Both commands
11
- share `~/.lunr/agent` credentials, settings, and sessions.
3
+ This dev-channel build combines stable lunR 0.2.25 and PR #77's current
4
+ image-only computer use. The earlier image-only build shipped as
5
+ `@ashx-j/lunr-dev@0.2.21-dev.12.1` and received user testing. The dev command
6
+ is `lunr-dev`, including `lunr-dev update`; stable `lunr` stays separate. Both
7
+ commands share `~/.lunr/agent` settings, credentials, and sessions. Smooth cursor
8
+ animation is not implemented. Stable production publication remains blocked
9
+ pending the native runtime's separate approval.
12
10
 
13
11
  ## Setup and permissions
14
12
 
@@ -29,8 +27,8 @@ Intel macOS have no native discovery tool. All computer tools except release
29
27
  require an image-capable model. There is no text-only accessibility fallback.
30
28
  Gateway sessions operate the gateway host, not the chat client's device.
31
29
 
32
- Manual approves observation and input. `computer_end` releases without approval.
33
- Plan allows relevant observation and release, but blocks mutation. Auto allows
30
+ `computer_end` releases without approval. Read-only allows relevant observation
31
+ and release, but blocks mutation. Yolo and Auto permit input. Auto allows
34
32
  requested, implied, or necessary GUI work without lunR per-call prompts. In
35
33
  Yolo, ask before introducing GUI work into an otherwise non-GUI task. These
36
34
  intent rules are agent guidance, not a natural-language authorization classifier.
@@ -47,10 +45,14 @@ recording, or permission tool is exposed.
47
45
 
48
46
  ## Observe, act, inspect
49
47
 
50
- 1. Use `computer_apps` for app identities or windows for a PID. Results allowlist
51
- at most 50 rows and truncate titles to 240 characters. Pass `next_offset` as
52
- `offset` with the same PID selection to retrieve more apps or windows. Lists
53
- refresh per call, so changing native order can shift page boundaries. PID zero
48
+ 1. Use `computer_apps` for app identities or windows for a PID. For a known app
49
+ or title, pass `query` to avoid paging through unrelated identities. It matches
50
+ a case-insensitive literal substring in `name`, `app_name`, or `title` before
51
+ pagination and display truncation. `total` counts matching rows. Omit `query`
52
+ to browse all rows. Results allowlist at most 50 rows and truncate titles to
53
+ 240 characters. Pass `next_offset` as `offset` with the same PID and query to
54
+ retrieve more matches. Lists refresh per call, so changing native order can
55
+ shift page boundaries. PID zero
54
56
  identifies an installed app that is not running. Window `bounds` are native
55
57
  geometry, not screenshot coordinates.
56
58
  2. Use `computer_observe` with an exact `pid` and `window_id`, or `desktop=true`.
@@ -62,6 +64,12 @@ recording, or permission tool is exposed.
62
64
  5. Call `computer_end` when finished.
63
65
 
64
66
  The token lasts 30 seconds, belongs to one exact target, and permits one action.
67
+ Copy it exactly, without abbreviating or reconstructing it. A failed action
68
+ consumes the active token. Capture again before any next action, including window
69
+ focus. `background_unavailable` makes foreground input the next candidate after
70
+ a fresh capture, if permitted. Do not substitute another background shortcut.
71
+ Token rejection does not prove foreground typing failed.
72
+
65
73
  Every new observation invalidates the previous token before capture. Failed,
66
74
  cancelled, or malformed captures issue no token. Old tokens cannot be replayed,
67
75
  including after a successful action returns a new image.
@@ -80,10 +88,20 @@ capture an exact window before acting.
80
88
 
81
89
  A successful transport or a changed image does not prove the intended application
82
90
  effect. Results preserve partial/unverifiable outcomes and bounded refusal codes.
91
+ Pre-dispatch failures report `input:"not_dispatched"` and state that this call
92
+ sent no input. They do not establish whether earlier calls had an effect. Token
93
+ codes distinguish a missing active observation, a mismatched token, a wrong
94
+ target, and expiry only while that state is available. A closed workflow cannot
95
+ identify whether an old token was consumed or unknown. Once dispatch begins,
96
+ transport failure reports `input:"uncertain"` and possible effects. Neither path
97
+ retries input. Unparseable driver text is omitted rather than forwarded as a
98
+ message; structured refusal fields remain bounded and allowlisted.
83
99
  When input returns but its post-image fails, the tool reports possible effects
84
100
  and stops the workflow. Capture again before deciding; never repeat input blindly.
85
101
  After an unchanged post-image, the same action against identical captured pixels
86
- is refused. Click signatures normalize omitted left-button/single-click/empty
102
+ is refused. Pixel identity hashes decoded full-image RGBA values and dimensions,
103
+ not PNG encoding bytes, before cropping or resizing. Full captures reuse the
104
+ image processor's decode, and crops reuse the existing full-image decode. Click signatures normalize omitted left-button/single-click/empty
87
105
  modifier defaults and modifier order. Three consecutive unchanged full observations
88
106
  stop polling in that workflow. Crops are explicit requests, not an automatic retry loop.
89
107
 
@@ -166,7 +184,8 @@ released. Driver-internal helper lifetime and held-input cancellation still need
166
184
  native acceptance.
167
185
 
168
186
  Gateway cron creates fresh permission contexts with the configured default mode,
169
- without gateway approvals or its approval handler. Missing approval blocks calls.
187
+ without gateway approvals or its approval handler. Read-only blocks input, and
188
+ missing approval blocks operations that still require confirmation.
170
189
  Session shutdown precedes disposal, even after partial extension binding failure.
171
190
  TUI cron continues to use its live permission context.
172
191
 
@@ -201,37 +220,104 @@ Release staging creates exact-version host-specific optional payload packages.
201
220
  They contain unchanged archives and no install scripts. Workspace manifests keep
202
221
  unpublished payload dependencies out. Standalone asset copying selects one
203
222
  opaque archive. Stable publication remains gated on production approval and a
204
- new CLI version. This integration retains dev-channel CLI naming, update routing,
205
- and exact-version package/lock rewriting. Dev publication uses `latest` only for
206
- `@ashx-j/lunr-dev`; shared libraries and payload packages use the `dev` tag. Stable
207
- tags remain unchanged. The user requested a dev-channel update and installation,
208
- with automated release checks complete. Publication and global installation remain
209
- separate distribution steps.
210
-
211
- ## Pending acceptance
212
-
213
- Source tests cover image-only capture flags, metadata allowlists, image/crop
214
- mapping, fresh tokens, single-action post-images, bounded unchanged behavior,
215
- uncertain outcomes, permissions, and ownership. Source-review fixes add equivalent
216
- click defaults, app/window pagination, and Unicode partial-typing recovery coverage.
217
- The focused 23-suite run passes 265 tests, including a real Photon PNG crop
218
- fixture that checks output pixels and coordinate mapping. All five offline package
219
- builds and the Node bundle pass. Clean-parent first-request capture confirms that
220
- `computer_load` is the only addition to the unsupported-host tool inventory; the
221
- supported-host fingerprint is current. Private prompt and tool snapshots remain
222
- local validation artifacts.
223
-
224
- Seven dev package tarballs pass isolated installation and relocation checks,
225
- host-only payload selection, archive verification, omitted-optional handling, and
226
- the standalone installer lock. First-paint and first-turn subagent, MCP, LSP, and
227
- local HTTP fixtures pass without remote inference. These checks do not launch the
228
- native driver or prove application effects.
229
-
230
- Explicitly authorized desktop acceptance remains required. Native gates include
231
- Windows locked/UAC/integrity states,
232
- Electron/native apps, display scaling and moved/resized windows, Unicode,
233
- held-input cancellation, and macOS TCC/LaunchServices/FIFO/shutdown on hardware.
234
- Cursor/runtime changes need a separate scoped decision before implementation.
223
+ new CLI version. Dev-channel update/publication changes were not ported here.
224
+
225
+ ## Verification and remaining acceptance
226
+
227
+ After integrating v0.2.24 master, all five offline package builds and the Node
228
+ bundle pass. With the PR #118 baseline repairs integrated, validation passes
229
+ 391 focused tests across 31 files and eight archive/package tests. Installation and archive staging tests now create inert
230
+ fixtures, so source tests need no native release payload. The Windows installation
231
+ test exercises real extraction, locking, cache reuse, and helper-tamper rejection
232
+ without executing either fixture file. Fake-driver tests cover exact-token
233
+ rejection with zero action dispatch, background refusal followed by fresh-capture
234
+ foreground input, and uncertain or partial post-dispatch outcomes. Real PNG
235
+ fixtures reproduce encoding-independent pixel identity and preserve crop mapping.
236
+ First-paint and first-request checks pass for both browser settings; removing only
237
+ `computer_load` reproduces master's unchanged tool hashes.
238
+
239
+ All three pinned upstream archives match their committed byte counts and SHA-256
240
+ hashes. Seven public-name tarballs staged with those unchanged real payloads pass
241
+ relocated installation, first requests, all supported OS/CPU selections, omitted
242
+ optional-payload recovery, and standalone installer `npm ci --ignore-scripts`.
243
+ Staging validates rewritten JavaScript and declaration imports and exact payload
244
+ versions in both locks. These checks ran on Windows x64 without launching the
245
+ native driver; OS/CPU selection tests do not establish operation on other hardware.
246
+ Archive integrity and packaging are verified, but native signing, permission and
247
+ input acceptance remain separate. Production approval is still development-only;
248
+ publication requires separate approval and a new CLI version.
249
+
250
+ PR #77 also incorporates the separately tracked baseline repairs from PR #118.
251
+ That work fixes AI catalog subpath resolution in extension loading and updates
252
+ fixtures for current gateway, shutdown, provider and subscription contracts.
253
+ Its 152 focused tests across ten files pass. The complete Ubuntu log before
254
+ those repairs records 101 coding-agent failures across 27 suites and 11 AI
255
+ failures, more than the subset exposed by check annotations. Agent passes
256
+ 181/181 in that run. Clean full-suite CI still requires broader baseline work;
257
+ local Windows-only diagnostics are not evidence of Ubuntu failures.
258
+ The automated checks did not operate a desktop or launch CuaDriver.
259
+
260
+ A separately authorized Windows x64 smoke test used this branch's compiled
261
+ computer tools with the real pinned runtime. It launched a new blank Notepad
262
+ window, captured that exact window, and typed a fixed 39-character phrase using
263
+ background delivery. The post-action screenshot showed the complete expected
264
+ text and character count. The driver's outcome remained `unverifiable`; the
265
+ image established the application effect. `computer_end` confirmed shutdown and
266
+ released the desktop lease. No document was saved or installed CLI changed.
267
+ This verifies basic launch, window capture and background text input only.
268
+ A later Windows x64 test on an owned scratch Notepad window found that background
269
+ Ctrl+A failed with `tool_invocation_failed`; a fresh image showed no selection.
270
+ A fresh-token `foreground=true` retry initially returned the same XAML/UIA error.
271
+ Pinned upstream source at `d8028a7943087ee258dc1b4d19dc12a7cd27669c`
272
+ routes `hotkey` for a XAML window through UIA before checking `delivery_mode`.
273
+ This native refusal was not a `background_unavailable` code. The unchanged
274
+ screenshot established that the background shortcut had not selected the text.
275
+
276
+ The Windows workflow now sends foreground modifier shortcuts without x/y through
277
+ that pin's `press_key` with `modifiers`, whose foreground branch uses verified
278
+ window focus and SendInput. Background shortcuts, keys with image coordinates,
279
+ and non-Windows dispatch remain unchanged. On a subsequent parent-run test,
280
+ foreground Ctrl+A selected all 39 characters in the same owned Notepad scratch;
281
+ its post-action image showed the selection. Foreground Ctrl+N then opened a
282
+ blank unsaved tab in that window, leaving the earlier scratch tab intact.
283
+
284
+ The parent next cancelled a 2048-character `computer_text` call 86 ms after the
285
+ real SDK call began, while it was still pending. The result reported
286
+ `input_dispatch_failed`, `input:uncertain` and `cleanup:confirmed`. The native
287
+ runtime exited and its desktop lease was absent before a fresh workflow captured
288
+ the same owned window. That image showed exactly six characters in the new tab.
289
+ This verifies partial text input followed by in-flight cancellation, cleanup and
290
+ reacquisition, not a pre-dispatch cancellation or complete text delivery.
291
+ `computer_end` shut down the new runtime and released its lease. Both tabs
292
+ remained unsaved; other user documents were untouched. No global CLI changed.
293
+ The complete-gesture tool API did not exercise held modifier or mouse-button
294
+ release under abort, which remains unverified.
295
+
296
+ The dev integration passed all five offline package builds, the Node bundle,
297
+ 265 focused tests across 23 suites, and eight archive/package tests. A real
298
+ Photon fixture checks cropped pixels and coordinate mapping. First-paint and
299
+ first-request checks passed with the regenerated supported-host fingerprint;
300
+ removing only `computer_load` reproduced the unchanged unsupported-host baseline.
301
+ Seven local dev tarballs passed relocated installation, OS/CPU payload selection,
302
+ omitted-optional handling, and installer-lock checks. The dev publication workflow
303
+ also passed. These historical results describe the dev integration. The current branch's
304
+ stable packaging checks are recorded above.
305
+
306
+ The user reported testing the published dev build; specific applications and
307
+ scenarios were not supplied. This does not establish full platform acceptance.
308
+ Native gates remain Windows locked/UAC/integrity states, other Electron/native
309
+ apps, display scaling and moved/resized windows, Unicode, held modifier/button
310
+ release under abort, and macOS TCC/LaunchServices/FIFO/shutdown on hardware.
311
+ Provider-driven computer tool choice has not been live-qualified. Cursor/runtime
312
+ changes need a separate scoped decision before implementation. Provider token
313
+ savings remain unmeasured. An offline fake-driver discovery comparison finds a
314
+ named app at row 118 of 139 synthetic apps in one query instead of three
315
+ unfiltered pages. It
316
+ returns one identity instead of 139 and 147 result-text characters instead of
317
+ 8699. The loaded computer-tool definitions grow by 230 serialized characters;
318
+ the first-request definitions are unchanged because detailed tools load on demand.
319
+ These are call and text-payload measurements, not model tokens or billing. The
320
+ comparison uses no desktop, provider, screenshot resizing, or history pruning.
235
321
 
236
322
  ## Privacy
237
323
 
@@ -2737,6 +2737,8 @@ See [tui.md](tui.md) Pattern 7 for a complete example with mode indicator.
2737
2737
 
2738
2738
  ### Message and Entry Rendering
2739
2739
 
2740
+ Clicking a custom message or entry toggles the renderer's `expanded` option. Child components that handle a click themselves take priority. Expansion survives theme invalidation; new or restored cards use the current tool-expansion setting.
2741
+
2740
2742
  Register a custom renderer for messages with your `customType`. Use message renderers for content that should participate in LLM context:
2741
2743
 
2742
2744
  ```typescript
package/docs/features.md CHANGED
@@ -1,36 +1,57 @@
1
1
  # Built-in features
2
2
 
3
- lunR ships these workflows as baked-in extensions. You do not need a third-party package for MCP, subagents, plan mode, or todos.
3
+ lunR ships these workflows as baked-in extensions. You do not need a third-party package for MCP, subagents, planning, or todos.
4
4
 
5
5
  Sample code under `examples/extensions/plan-mode`, `examples/extensions/todo.ts`, and `examples/extensions/subagent/` is **Extension API sample code**, not the product implementation.
6
6
 
7
- ## Permissions and plan mode
7
+ ## Permissions and planning
8
8
 
9
- Permission modes: `manual | yolo | plan | auto`. Shift+Tab (`app.mode.cycle`) cycles that order. Ctrl+T (`app.thinking.cycle`) cycles thinking levels for the selected model.
9
+ Permission modes: `yolo | auto | read-only`. Shift+Tab cycles in that order. The TUI labels read-only as `read` in its footer and settings. Ctrl+T cycles thinking levels.
10
10
 
11
- - **manual** — approve every tool
12
- - **yolo** — auto-approve ordinary tools; large subagent launches still request confirmation
13
- - **plan** — read-oriented planning; the model calls `present_plan` with a summary; you approve or decline in a dock
14
- - **auto** — fully autonomous
11
+ - **yolo** auto-approves tools but still confirms large subagent launches. This is the default.
12
+ - **auto** runs without questions or large-launch confirmation.
13
+ - **read-only** permits investigation but blocks writes, full-access child launches, MCP tool calls, and unknown extension actions. MCP search and tool descriptions remain available. The shell command check is heuristic, not an OS sandbox.
15
14
 
16
- `/plan` enters plan mode. `/plan <task>` enters plan mode and sends the task. If you are already in plan, `/plan <task>` restores the previous mode and sends. Default startup mode is `defaultPermissionMode` in settings (`manual`).
17
-
18
- `present_plan` is only available in plan mode. After approval, interactive lunR leaves plan mode before the tool result resolves.
15
+ Use `/read` or `/mode read` to inspect without changing files. `/plan` switches to read-only mode, and `/plan <task>` asks for a plan in that mode. If already read-only, `/plan <task>` stays read-only. Use `/plan off` to leave read-only mode. `present_plan` is available in read-only mode when a plan is needed. Approving a plan restores the previous mode before the tool result resolves, or enters yolo if no writable previous mode exists. Existing saved defaults migrate `manual` to `yolo` and `plan` to `read-only`.
19
16
 
20
17
  ## Subagents
21
18
 
19
+ `/settings` has two independent switches, both on by default. Automatic subagent delegation controls the built-in system prompt: off tells the agent to work directly and launch children only when you explicitly ask. Tier selection and other launch instructions remain available when you do ask. Custom system prompts and project instruction files are unchanged.
20
+
21
+ Subagent communication controls messages between a child and its parent while work is in progress. Off removes child `contact_supervisor` and `intercom`, parent questions and live steering for new children. Final results, status, cancellation, and `subagent_wait` still work. New launches and resumed children use the selected mode for their whole run, including queued steps. Turning it off blocks new parent questions and live steering immediately; already-running children retain their tools, and pending requests can still receive replies. The setting does not disable intercom between unrelated lunR sessions.
22
+
22
23
  Advertised subagents always start **fresh** (no forked parent context). Default parallel concurrency / max tasks / global run cap are unlimited; an explicit `concurrency` is still honored.
23
24
 
24
25
  Single, parallel, and chain launches run async when `async` is omitted. Set `async:false` for an immediate foreground result or use `clarify:true` for the interactive preview/editor. Continue independent work after an async launch, then yield for normal interactive completion. Use `subagent_wait` only when the same turn or skill must finish after its children. Headless sessions auto-drain current-session work. Use status for one-time inspection rather than polling or sleeping for completion.
25
26
 
27
+ In the interactive TUI, normal Enter during an executing `subagent_wait` releases only the parent's local wait. It does not stop background children or parallel sibling tools. After the current tool batch fully settles, lunR submits the text as a fresh parent prompt rather than a steering message. Alt+Enter remains a follow-up, and normal Enter outside `subagent_wait` remains steering while the parent works.
28
+
26
29
  The legacy extension config keys `asyncByDefault` and `forceTopLevelAsync` remain accepted but no longer change launch mode. Omitted `async` resolves to async, while explicit `async:false`, `clarify:true`, and internal `foregroundOnly` calls stay foreground. RPC and scheduled launches remain always async.
27
30
 
28
31
  Collapsed subagent rows (foreground and async) are one line: status glyph, description, selected tier or explicit model, tokens, and elapsed time. Mixed async runs use the same flat child rows without an aggregate tree. Running rows keep a live spinner and clock; completed collapsed rows freeze those stats. Choose the running child spinner under `/settings` → Customize. Async launches show `subagent async` in the tool header. Completed notify cards show title and status only; the model still receives the full result text.
29
32
 
30
- A launch of 3+ parallel children in one `tasks`/`chain.parallel` call, or 3+ same-turn SINGLE `subagent` calls, receives one aggregate confirmation in **manual and yolo**. Sequential work stays `chain`. Auto bypasses this confirmation, and it can be disabled independently in `/settings`.
33
+ A launch of 3+ parallel children in one `tasks`/`chain.parallel` call, or 3+ same-turn SINGLE `subagent` calls, receives one aggregate confirmation in **yolo**. Sequential work stays `chain`. Auto bypasses this confirmation, and it can be disabled independently in `/settings`.
31
34
 
32
35
  `/goal` sets a session goal and **forces session auto** permission mode.
33
36
 
37
+ ### Child communication
38
+
39
+ Children own reversible implementation choices within their assigned scope. Define file ownership and required outputs at launch. Establish a shared contract before dependent parallel work, then pass it through chain outputs or an artifact. Native child intercom reaches the supervisor only; it cannot discover or message siblings.
40
+
41
+ `contact_supervisor` separates delivery by purpose:
42
+
43
+ - `progress_update` records a UI-only entry. It never enters parent model context or starts a parent turn. Existing activity indicators usually make an explicit progress call unnecessary.
44
+ - `handoff` delivers actionable dependency findings or corrections without waiting for a reply. State what another task can now do, consolidate related findings, and reference one artifact for supporting detail. Continue independent work.
45
+ - `need_decision` and `interview_request` wait for a supervisor reply. Use them for decisions outside the child's authority, permission or safety concerns, and blockers. Include the blocked decision, evidence, and recommended choice.
46
+
47
+ Blocking requests and handoffs wake an idle parent. Headless waits yield to queued messages so a child can receive a decision before it finishes. Expired requests, stopped runs, and requests owned by another session cannot wake it. Legacy children retain model-facing progress delivery; UI-only progress requires the new protocol advertised by the spawning parent.
48
+
49
+ Inactivity and threshold notices stay in diagnostic entries rather than parent context or intercom relays. Repeated tool failures remain model-facing. Completion-guard diagnostics do not duplicate the normal terminal failure report.
50
+
51
+ Return one self-contained final report with outcomes, verification, blockers, and artifact paths. The runtime delivers it. A final report that only says findings were sent earlier is insufficient.
52
+
53
+ Communication cards are collapsed tool-style rows. Click to show `From` or `To`, the child's description, and the message. Routing IDs stay in structured diagnostics. Outgoing steering also shows its delivery state when expanded; delivery acknowledgement is not a model answer.
54
+
34
55
  ### Questions to async children
35
56
 
36
57
  The parent can use `subagent_supervisor` with `action: "ask"` to ask a running async child for information it needs before the final report. The request names the run, selects one child, and includes a `reason` explaining which decision needs the answer.
@@ -43,9 +64,13 @@ A child must have an active question-capable input channel. Only one question ma
43
64
 
44
65
  The agent must ask only when the child has missing context, the answer changes a concrete next decision, and waiting for completion would block progress or risk rework. It must use available results first and batch related questions. Routine progress checks, duplicate questions, polling, and step-by-step supervision are prohibited. A follow-up is appropriate only when the answer leaves the original decision unresolved.
45
66
 
67
+ ### Measuring communication cost
68
+
69
+ Compare the same task, models, thinking levels, and starting checkout before and after a communication change. Count parent wakeups by their triggering event, provider calls in both parent and child sessions, duplicate deliveries, input/output tokens, cache reads/writes, elapsed time, and blocked time. Check task correctness and delivery of required escalations before comparing cost. Cached input is separate from uncached input; fewer messages or a quieter UI alone do not establish savings. Keep transcript evidence local.
70
+
46
71
  ## Todos, memory, and global instructions
47
72
 
48
- - **Todos** — lunr-todos is a full-replace list. Collapsed lists show all four active items; lists of five or more show three and a `+N more` line. Completed todos prune on the next user turn (no leftover `✓ N done` footer).
73
+ - **Todos** — lunr-todos is a full-replace list. `/settings` → Todos disables its system-prompt guidance, model-facing tool, and editor widget. Collapsed lists show all four active items; lists of five or more show three and a `+N more` line. Completed todos prune on the next user turn, so the footer does not leave a `✓ N done` line.
49
74
  - **Agent memory** — durable established facts and stable preferences in `~/.lunr/simple-memory/memory.md`. `/settings` → Agent memory controls injection and the `memory_add`, `memory_remove`, and `memory_load` tools without deleting stored facts. `memoryCharCap` defaults to 5000. Behavior instructions, transient task state, transcripts, guesses, and secrets do not belong in memory.
50
75
  - **Global instructions** — create `~/.lunr/agent/agents/AGENTS.md` yourself when you want global behavior or instructions. lunR injects it through the normal context loader; `/reload` picks up changes. The model cannot modify this user-managed file. The retired `behavior.md` file and behavior presets are no longer loaded.
51
76
  - **Model instructions** — `/settings` can enable `~/.lunr/agent/agents/<model-name>/AGENTS.md` and choose **Both** (global then model-specific) or **Model only**. The folder name is provider-independent and filesystem-safe. Project `AGENTS.md`/`CLAUDE.md` files are unaffected, and `--no-context-files` disables all instruction files.
@@ -60,33 +85,81 @@ Jobs persist in `~/.lunr/agent/cron/` (`jobs.json`). Interactive TUI cron runs i
60
85
 
61
86
  Schedule examples: `every 30m`, `every 2h`, `every 1d`, a duration one-shot (`30m`), an ISO timestamp, or a 5-field cron expression.
62
87
 
63
- ## Gateway (Telegram / Discord)
88
+ ## Gateway for Telegram and Discord
89
+
90
+ Run `lunr gateway setup` in your terminal. Use Up/Down and Enter to choose the platform, saved token and owner options, default project, startup preference, provider, and model. Long lists scroll; Escape cancels. Only a new bot token, user ID, or custom folder path needs typing. Token entry stays hidden. Setup explains bot creation, validates the bot identity, and asks before saving or starting the gateway. Log in to a model provider locally with `/login` first. Setup does not create model-provider accounts.
64
91
 
65
- Enable the chat-platforms feature, then run the daemon:
92
+ Telegram uses BotFather and long polling. Discord needs the bot and `applications.commands` installation scopes. Enable Message Content Intent for ordinary text messages. GuildMembers intent is not required. Discord registers native slash commands; Telegram registers a command menu. Both platforms use buttons for selections and approvals.
93
+
94
+ Your computer must stay awake and online. Startup cannot make a sleeping or disconnected computer available.
95
+
96
+ ### Service controls
66
97
 
67
98
  ```bash
68
- lunr setup
69
- lunr features enable chat-platforms
70
- lunr gateway
99
+ lunr gateway setup
100
+ lunr gateway start
101
+ lunr gateway stop
102
+ lunr gateway restart
103
+ lunr gateway status
104
+ lunr gateway logs
105
+ lunr gateway doctor
106
+ lunr gateway run
107
+ lunr gateway autostart login
108
+ lunr gateway autostart boot
109
+ lunr gateway autostart off
71
110
  ```
72
111
 
73
- Config: `~/.lunr/agent/gateway.json` (chmod 0600; may hold bot tokens). Secrets do not go in `install-features.json`.
112
+ Bare `lunr gateway` also runs in the foreground. The terminal's `/settings` Gateway menu opens setup, service controls, logs, and diagnostics.
113
+
114
+ Login startup runs after you sign in. Boot startup runs before login and may require administrator approval or OS-managed account credentials. Linux uses a systemd user service, with lingering for boot startup. macOS uses a LaunchAgent for login or a LaunchDaemon running as your user for boot. Windows uses Scheduled Tasks; its boot option asks Windows to obtain the account credentials rather than saving the password in lunR. lunR checks the native installation command before recording a successful startup change. Changing or disabling startup removes the previous lunR service, not other applications' services.
115
+
116
+ Encrypted home directories, missing user-service support, network restrictions, and OS permissions can prevent boot startup. Use `status`, `doctor`, and `logs` to check the installed service and bot connections. Service definitions are separate for each lunR profile. Native startup specifications have automated tests; installing and rebooting services on all three operating systems still requires host verification.
74
117
 
75
- Token resolution: `LUNR_<PLATFORM>_BOT_TOKEN` env → `<PLATFORM>_BOT_TOKEN` env → file token.
118
+ ### Owner access
119
+
120
+ Configuration lives in `~/.lunr/agent/gateway.json` and may contain bot tokens. It is written with mode 0600 where supported; Windows security follows the profile directory's ACL. Tokens are not stored in `install-features.json` or startup command arguments. Environment tokens override file tokens in this order: `LUNR_<PLATFORM>_BOT_TOKEN`, then `<PLATFORM>_BOT_TOKEN`.
121
+
122
+ If you skipped your user ID during setup, message the bot privately and approve its pairing code locally:
76
123
 
77
124
  ```bash
78
- lunr gateway # run the daemon
79
- lunr gateway pair approve <platform> <code>
125
+ lunr gateway pair approve telegram <code> --owner
126
+ lunr gateway pair approve discord <code> --owner
80
127
  lunr gateway pair list
81
- lunr gateway status
82
128
  ```
83
129
 
84
- - Telegram: long-poll bot. Talk to @BotFather, put the token in `gateway.json` or `LUNR_TELEGRAM_BOT_TOKEN`, set `telegram.enabled = true`.
85
- - Discord: mention-gated by default (`requireMention: true`). Enable the Message Content intent. No GuildMembers intent. Put the token in `gateway.json` or `LUNR_DISCORD_BOT_TOKEN`.
86
- - Authz is fail-closed. Unauthorized DMs pair (`unauthorizedDmBehavior: "pair"`) unless you set `ignore`.
87
- - Gateway `/new` while a session is busy aborts the live turn and drops the queue.
130
+ Owner access includes local projects and saved TUI conversation history. Ordinary `lunr gateway pair approve <platform> <code>` grants chat access only; add `--owner` locally to grant owner access. Ordinary pairing, group access, and Discord roles do not grant it. Project browsing, cross-project sessions, permission changes, and file downloads require an explicitly configured owner in a private DM. Removing owner access invalidates later owner actions and approvals.
131
+
132
+ ### Projects and mobile controls
133
+
134
+ The owner can send `/start` to check setup before the first task, `/model` to select an authenticated model before a task, and a normal message immediately when setup's default project remains approved. With multiple approved roots and no explicit default, choose `/project` first. A paired non-owner without a project must ask the local owner to configure access; `/project` and `/continue` are owner-only. Use `/project` to browse approved roots, open child folders, go back, select a folder, or create one. `/project <path>` opens the browser at an approved path. The gateway remembers the selected working directory for that conversation. Project instruction files, skills, tools, and trust checks use that directory rather than the daemon's launch directory.
135
+
136
+ **The selected project is a working directory, not a shell sandbox.** Shell commands and tools can access other locations allowed by your OS account. The folder browser and `/download` check their own path boundaries, including symlinks.
137
+
138
+ - `/model`, `/thinking`, `/settings`, and `/mode` control the active session. `/fast` controls Codex fast mode.
139
+ - `/plan <task>` starts planning. The plan appears in chat with approval buttons. Approval returns the session to yolo mode.
140
+ - `/goal`, `/cron`, `/run`, `/chain`, and `/parallel` use the same built-in extensions as the terminal. Pass arguments when an extension's interactive editor requires the terminal.
141
+ - `/skill` selects a loaded skill and asks for a task. `/mcp` and `/lsp` expose their text status commands; the agent retains the configured coding tools.
142
+ - `/usage` reports session tokens and provider-plan usage. `/status` includes the selected project.
143
+ - `/stop` aborts the current turn and pending transfer. `/stopall` also requests cancellation of background subagents and tracked shell processes. `/processes` lists this session's processes; `/processes stop <pid>` requests a stop.
144
+ - `/cancel` cancels a pending selection or transfer. `/new` aborts the current turn and drops queued input, but refuses to discard a session that still has attached background work.
145
+
146
+ Upload images or documents in chat. Images reach the model as images; documents are saved under the project's `.lunr/uploads/` directory and passed to the model as paths. `/download <project-relative path>` sends a file back. Files are limited to 8 MB; common credential filenames are blocked from download. This filename check is not a content-based secret scanner. Only send files you intend to share with the chat platform.
147
+
148
+ Foreground replies, follow-up answers, errors, and extension notices enter a disk-backed outbox before sending. Successfully sent chunks are acknowledged in order; failed sends retry up to five times per destination without blocking other chats. A failed final preview edit falls back to a full reply. Permanently failed deliveries remain in `gateway-outbox.json` with `failed: true` and an error in gateway logs for diagnosis; they do not retry forever. A send can still reach the platform just before the process exits without recording its acknowledgement, so a restart can repeat that chunk. Existing outbox entries without the newer fields remain eligible for delivery. Session changes cancel stale interactive prompts and notices, but finished assistant results still reach their originating chat when authorized. Revoked access prevents delivery. Discord role-only authorization needs a fresh inbound role check after restart before it can authorize new sends; an old stored role assertion cannot authorize outbox replay. Tool approvals, pickers, and text questions do not become model prompts; they expire when the session changes. Terminal-only custom screens report that limitation rather than pretending they accepted a selection.
149
+
150
+ ### Continue between desktop and phone
88
151
 
89
- Without runnable adapters (enabled platform + resolvable token), `lunr gateway` prints setup instructions and exits 1.
152
+ In the terminal, `/handoff` marks the current saved session for eight hours. Repeat it to refresh the mark; `/handoff cancel` removes it. Unsaved sessions must be persisted first.
153
+
154
+ On your phone, `/continue` opens the only marked session, or offers a picker if several are marked. Without an active mark, it selects the latest TUI activity. TUI activation, user prompts, and state-changing user commands count as activity. Background results and file timestamps do not. Closed TUI sessions remain eligible.
155
+
156
+ `/sessions [filter]` browses saved sessions across projects, including locally registered custom session paths. It works before you have sent the bot its first task. Continuation preserves the session file, selected conversation branch, original project directory, and permission checkpoint. Resuming `auto` or `yolo` asks for confirmation on the phone and defaults to read-only if declined.
157
+
158
+ Only one updated lunR process may write a persistent session at a time. A running owner must release it cooperatively. If it is busy, choose Wait, Stop and continue, or Cancel. Wait retries busy requests for up to two minutes. Stop and continue aborts the foreground turn; it does not migrate children or shell processes. Those must finish or actually stop before transfer. Cancellation stops pending acquisition, but cannot undo extension shutdown once release has begun.
159
+
160
+ A detached terminal keeps its draft and can use `/reclaim` to reopen fresh state after the phone releases ownership. It does not append from its old in-memory conversation. Marks remain until expiry or cancellation, even after a successful continuation. Expiry only removes the preference; it neither deletes the conversation nor disconnects it.
161
+
162
+ All concurrent writers must use a lunR version with session ownership support. Old versions and external file editors cannot honor these locks. Recovery only clears an owner after verified local process death. Uncertain, foreign-host, or incomplete ownership records fail closed; inspect them rather than deleting a live lock.
90
163
 
91
164
  ## MCP, LSP, web search
92
165
 
@@ -94,6 +167,14 @@ Without runnable adapters (enabled platform + resolvable token), `lunr gateway`
94
167
  - **LSP** — `/lsp`, `/lsp-restart`, `/lsp-config`. Footer LSP segment is off by default (`footerLsp`). On Windows, npm `.cmd` shims need a real LSP start (`shell: true`); if the server never starts, tools silently fall back to tree-sitter. Check `/lsp` if language features look missing.
95
168
  - **Web search** — `/websearch` (and related search commands). Interactive TUI attaches web-access after first paint; print/RPC/gateway load it before the first turn.
96
169
 
170
+ ## Headless browser
171
+
172
+ The first-party `browser` tool is on by default. Normal installation and updates install matching Chromium automatically. Browser in `/settings` turns the tool off and closes active contexts immediately; cached binaries remain. Offline or ignored-script installs can recover later with `lunr browser install`. Startup and tool execution never install Chromium. The browser handles JavaScript-rendered pages and accessible website interactions, while `web_search` remains discovery and `fetch_content` remains URL reading. There is no automatic browser fallback.
173
+
174
+ The browser uses ephemeral session-owned contexts. Read-only mode blocks interactions. Yolo and auto allow them without per-action approval. Public HTTP(S) is the default; local/private access requires explicit user configuration. Website effects cannot be reversed by `/undo`.
175
+
176
+ See [Headless browser](browser.md) for action parameters, installation exceptions, legacy setting precedence, private-network risks, lifecycle limits, and validation.
177
+
97
178
  ## Thinking, usage, streaming, UI
98
179
 
99
180
  - `/thinking`, `/effort`, and `/reasoning` are full-parity aliases. `/off`, `/minimal`, `/low`, `/medium`, `/high`, `/xhigh`, and `/max` set a level when the current model supports it. `/thinking` completions follow the session model. `xhigh` and `max` are opt-in. `/thinking hide|show|toggle` still hides thinking blocks.