@ashx-j/lunr-dev 0.2.16-dev.9.1 → 0.2.19-dev.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/README.md +7 -1
  3. package/dist/builtin-extensions/ashxj-thinking.d.ts +1 -0
  4. package/dist/builtin-extensions/ashxj-thinking.d.ts.map +1 -1
  5. package/dist/builtin-extensions/ashxj-thinking.js +44 -19
  6. package/dist/builtin-extensions/ashxj-thinking.js.map +1 -1
  7. package/dist/builtin-extensions/index.d.ts.map +1 -1
  8. package/dist/builtin-extensions/index.js +1 -0
  9. package/dist/builtin-extensions/index.js.map +1 -1
  10. package/dist/builtin-extensions/lunr-computer-use.d.ts +3 -0
  11. package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -0
  12. package/dist/builtin-extensions/lunr-computer-use.js +157 -0
  13. package/dist/builtin-extensions/lunr-computer-use.js.map +1 -0
  14. package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts.map +1 -1
  15. package/dist/builtin-extensions/pi-lsp-extension/src/index.js +10 -3
  16. package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -1
  17. package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts +5 -1
  18. package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts.map +1 -1
  19. package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js +26 -4
  20. package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js.map +1 -1
  21. package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
  22. package/dist/builtin-extensions/pi-mcp-adapter/index.js +37 -27
  23. package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
  24. package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts +6 -1
  25. package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts.map +1 -1
  26. package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js +33 -8
  27. package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js.map +1 -1
  28. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
  29. package/dist/builtin-extensions/pi-subagents/src/extension/index.js +52 -23
  30. package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
  31. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
  32. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +6 -2
  33. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
  34. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts +1 -1
  35. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
  36. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +5 -2
  37. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
  38. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts +10 -0
  39. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts.map +1 -0
  40. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js +38 -0
  41. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js.map +1 -0
  42. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
  43. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +3 -16
  44. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
  45. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts +1 -1
  46. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts.map +1 -1
  47. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js +2 -0
  48. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js.map +1 -1
  49. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +1 -0
  50. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
  51. package/dist/builtin-extensions/pi-subagents/src/tui/render.js +70 -30
  52. package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
  53. package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
  54. package/dist/builtin-extensions/pi-web-access/index.js +103 -102
  55. package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
  56. package/dist/core/agent-session-services.d.ts.map +1 -1
  57. package/dist/core/agent-session-services.js +1 -1
  58. package/dist/core/agent-session-services.js.map +1 -1
  59. package/dist/core/computer-use/adapter.d.ts +23 -0
  60. package/dist/core/computer-use/adapter.d.ts.map +1 -0
  61. package/dist/core/computer-use/adapter.js +116 -0
  62. package/dist/core/computer-use/adapter.js.map +1 -0
  63. package/dist/core/computer-use/lease.d.ts +18 -0
  64. package/dist/core/computer-use/lease.d.ts.map +1 -0
  65. package/dist/core/computer-use/lease.js +129 -0
  66. package/dist/core/computer-use/lease.js.map +1 -0
  67. package/dist/core/computer-use/macos-runtime.d.ts +14 -0
  68. package/dist/core/computer-use/macos-runtime.d.ts.map +1 -0
  69. package/dist/core/computer-use/macos-runtime.js +148 -0
  70. package/dist/core/computer-use/macos-runtime.js.map +1 -0
  71. package/dist/core/computer-use/policy.d.ts +19 -0
  72. package/dist/core/computer-use/policy.d.ts.map +1 -0
  73. package/dist/core/computer-use/policy.js +66 -0
  74. package/dist/core/computer-use/policy.js.map +1 -0
  75. package/dist/core/computer-use/release.generated.d.ts +31 -0
  76. package/dist/core/computer-use/release.generated.d.ts.map +1 -0
  77. package/dist/core/computer-use/release.generated.js +36 -0
  78. package/dist/core/computer-use/release.generated.js.map +1 -0
  79. package/dist/core/computer-use/runtime.d.ts +13 -0
  80. package/dist/core/computer-use/runtime.d.ts.map +1 -0
  81. package/dist/core/computer-use/runtime.js +158 -0
  82. package/dist/core/computer-use/runtime.js.map +1 -0
  83. package/dist/core/computer-use/schemas.d.ts +88 -0
  84. package/dist/core/computer-use/schemas.d.ts.map +1 -0
  85. package/dist/core/computer-use/schemas.js +80 -0
  86. package/dist/core/computer-use/schemas.js.map +1 -0
  87. package/dist/core/computer-use/windows-desktop.d.ts +3 -0
  88. package/dist/core/computer-use/windows-desktop.d.ts.map +1 -0
  89. package/dist/core/computer-use/windows-desktop.js +48 -0
  90. package/dist/core/computer-use/windows-desktop.js.map +1 -0
  91. package/dist/core/computer-use/workflow.d.ts +24 -0
  92. package/dist/core/computer-use/workflow.d.ts.map +1 -0
  93. package/dist/core/computer-use/workflow.js +330 -0
  94. package/dist/core/computer-use/workflow.js.map +1 -0
  95. package/dist/core/keybindings.d.ts +2 -2
  96. package/dist/core/keybindings.d.ts.map +1 -1
  97. package/dist/core/keybindings.js +2 -2
  98. package/dist/core/keybindings.js.map +1 -1
  99. package/dist/core/model-runtime.d.ts +0 -3
  100. package/dist/core/model-runtime.d.ts.map +1 -1
  101. package/dist/core/model-runtime.js +1 -10
  102. package/dist/core/model-runtime.js.map +1 -1
  103. package/dist/core/package-manager.d.ts.map +1 -1
  104. package/dist/core/package-manager.js +1 -1
  105. package/dist/core/package-manager.js.map +1 -1
  106. package/dist/core/permissions.d.ts +1 -1
  107. package/dist/core/permissions.d.ts.map +1 -1
  108. package/dist/core/permissions.js +23 -7
  109. package/dist/core/permissions.js.map +1 -1
  110. package/dist/core/plan-mode.d.ts.map +1 -1
  111. package/dist/core/plan-mode.js +9 -0
  112. package/dist/core/plan-mode.js.map +1 -1
  113. package/dist/core/rollback.d.ts.map +1 -1
  114. package/dist/core/rollback.js +13 -90
  115. package/dist/core/rollback.js.map +1 -1
  116. package/dist/core/session-manager.d.ts +0 -1
  117. package/dist/core/session-manager.d.ts.map +1 -1
  118. package/dist/core/session-manager.js +21 -79
  119. package/dist/core/session-manager.js.map +1 -1
  120. package/dist/core/settings-manager.d.ts +6 -0
  121. package/dist/core/settings-manager.d.ts.map +1 -1
  122. package/dist/core/settings-manager.js +19 -0
  123. package/dist/core/settings-manager.js.map +1 -1
  124. package/dist/dev-cli.js +0 -0
  125. package/dist/gateway/agent-bridge.d.ts +6 -1
  126. package/dist/gateway/agent-bridge.d.ts.map +1 -1
  127. package/dist/gateway/agent-bridge.js +23 -6
  128. package/dist/gateway/agent-bridge.js.map +1 -1
  129. package/dist/gateway/cron.d.ts +1 -1
  130. package/dist/gateway/cron.d.ts.map +1 -1
  131. package/dist/gateway/cron.js +23 -7
  132. package/dist/gateway/cron.js.map +1 -1
  133. package/dist/modes/interactive/components/footer.d.ts +4 -2
  134. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  135. package/dist/modes/interactive/components/footer.js +23 -32
  136. package/dist/modes/interactive/components/footer.js.map +1 -1
  137. package/dist/modes/interactive/components/processes-selector.d.ts +2 -3
  138. package/dist/modes/interactive/components/processes-selector.d.ts.map +1 -1
  139. package/dist/modes/interactive/components/processes-selector.js +5 -10
  140. package/dist/modes/interactive/components/processes-selector.js.map +1 -1
  141. package/dist/modes/interactive/components/settings-selector.d.ts +4 -0
  142. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  143. package/dist/modes/interactive/components/settings-selector.js +20 -0
  144. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  145. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  146. package/dist/modes/interactive/interactive-mode.js +18 -8
  147. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  148. package/dist/modes/interactive/thinking-level-slash.d.ts +4 -0
  149. package/dist/modes/interactive/thinking-level-slash.d.ts.map +1 -0
  150. package/dist/modes/interactive/thinking-level-slash.js +23 -0
  151. package/dist/modes/interactive/thinking-level-slash.js.map +1 -0
  152. package/dist/node-runtime/adapter-AZMY335J.js +279 -0
  153. package/dist/node-runtime/{agent-session-services-IFJMSX7Z.js → agent-session-services-RSGP5GDN.js} +15 -12
  154. package/dist/node-runtime/{builtin-extensions-LYZ3BFWQ.js → builtin-extensions-7STLFW3A.js} +4 -3
  155. package/dist/node-runtime/chunk-2IDTZAG5.js +1415 -0
  156. package/dist/node-runtime/{chunk-7NBZ5P7I.js → chunk-4SJWFTUP.js} +1 -1
  157. package/dist/node-runtime/{chunk-AJX357CL.js → chunk-5NWQCSKR.js} +20 -1013
  158. package/dist/node-runtime/chunk-5OLJGVCB.js +68 -0
  159. package/dist/node-runtime/chunk-5Q45AVQG.js +108 -0
  160. package/dist/node-runtime/{chunk-TQNSPERU.js → chunk-5SQDLSZJ.js} +1 -1
  161. package/dist/node-runtime/{chunk-F4VQFJI2.js → chunk-6SPPH4FY.js} +4 -4
  162. package/dist/node-runtime/{chunk-PBC2Y6GS.js → chunk-6UB6NKA3.js} +29 -72
  163. package/dist/node-runtime/{chunk-A2KQXUJD.js → chunk-7AFOFSDY.js} +1 -1
  164. package/dist/node-runtime/chunk-BKAZ6BKX.js +2185 -0
  165. package/dist/node-runtime/{chunk-AHSTJBIB.js → chunk-EH2LJQPM.js} +4 -4
  166. package/dist/node-runtime/{chunk-N77MY65L.js → chunk-FLYMHKCS.js} +25 -25
  167. package/dist/node-runtime/{chunk-5P7PZMRU.js → chunk-HRS4HMDX.js} +1 -1
  168. package/dist/node-runtime/{chunk-IPA627GP.js → chunk-ISQDQIZN.js} +4 -4
  169. package/dist/node-runtime/{chunk-WJVFOIB5.js → chunk-J7QGQD45.js} +1 -1
  170. package/dist/node-runtime/{chunk-WOVTOV5P.js → chunk-JT6YCS5B.js} +29 -34
  171. package/dist/node-runtime/chunk-JZHEUQRL.js +180 -0
  172. package/dist/node-runtime/{chunk-ZKMFUD3Q.js → chunk-K72NVGUB.js} +3 -3
  173. package/dist/node-runtime/{chunk-ECD5L7YI.js → chunk-LCACDWHJ.js} +389 -15
  174. package/dist/node-runtime/{chunk-2QKLKMKC.js → chunk-LTXUQJI4.js} +1 -1
  175. package/dist/node-runtime/{chunk-MKKH27PH.js → chunk-LWJXTA6Z.js} +274 -2416
  176. package/dist/node-runtime/{chunk-EDBJNRSM.js → chunk-MGSB2C3M.js} +1 -1
  177. package/dist/node-runtime/{chunk-CDFZEWPU.js → chunk-MUMMMTW4.js} +6 -2
  178. package/dist/node-runtime/{chunk-YF63P5ZT.js → chunk-OTT6JMPU.js} +10 -67
  179. package/dist/node-runtime/{chunk-PGAJ5MO5.js → chunk-T5GM5BFH.js} +1 -1
  180. package/dist/node-runtime/{chunk-PCGNAY2O.js → chunk-TAP7QTUT.js} +38 -16
  181. package/dist/node-runtime/{chunk-4TLO4PO2.js → chunk-U6C7VTR5.js} +7 -1401
  182. package/dist/node-runtime/chunk-URD2SLIT.js +1019 -0
  183. package/dist/node-runtime/{chunk-QH42CDX3.js → chunk-W7S2REEG.js} +111 -84
  184. package/dist/node-runtime/{chunk-LZAW4ZX3.js → chunk-ZRDIMBEQ.js} +27 -9
  185. package/dist/node-runtime/{chunk-AD6VXAO7.js → chunk-ZSEZY3II.js} +5 -100
  186. package/dist/node-runtime/cli-runtime.js +1 -1
  187. package/dist/node-runtime/{command-L3LAHDIH.js → command-6UXQ6XZN.js} +1 -1
  188. package/dist/node-runtime/{commands-RL5YBW5I.js → commands-LGR5VT5X.js} +6 -4
  189. package/dist/node-runtime/{direct-tool-executor-JVDXTO7A.js → direct-tool-executor-TDJS7TBD.js} +9 -6
  190. package/dist/node-runtime/{export-html-KR26FOUZ.js → export-html-E4DT6ZJQ.js} +1 -1
  191. package/dist/node-runtime/{extract-XLQSJN4V.js → extract-IUCVZCWC.js} +2 -2
  192. package/dist/node-runtime/{gateway-X2TI5X7F.js → gateway-3OLC4GQN.js} +22 -367
  193. package/dist/node-runtime/{gemini-search-U7SUMPQA.js → gemini-search-NCIDF7NE.js} +1 -1
  194. package/dist/node-runtime/{gemini-url-context-PXWCBQHK.js → gemini-url-context-OKIN7AIP.js} +2 -2
  195. package/dist/node-runtime/image-resize-6ZPBFMWW.js +11 -0
  196. package/dist/node-runtime/index.js +53 -49
  197. package/dist/node-runtime/{init-NJV2T55N.js → init-EKE277AG.js} +6 -4
  198. package/dist/node-runtime/{interactive-mode-KOM35YF2.js → interactive-mode-S5M26CQ7.js} +20 -17
  199. package/dist/node-runtime/{interactive-view-U6OILKF3.js → interactive-view-N6F4KUIT.js} +3 -5
  200. package/dist/node-runtime/lunr-computer-use-4X3KUNF4.js +206 -0
  201. package/dist/node-runtime/{lunr-cron-YJ5UHYRD.js → lunr-cron-KKBOGAEF.js} +7 -1
  202. package/dist/node-runtime/main.js +24 -21
  203. package/dist/node-runtime/{mcp-auth-flow-QIXHW6QN.js → mcp-auth-flow-YL6RWPYG.js} +2 -1
  204. package/dist/node-runtime/{package-manager-cli-TZZHJCVI.js → package-manager-cli-C4EJOO5Q.js} +8 -6
  205. package/dist/node-runtime/{pi-mcp-adapter-QFB37AVN.js → pi-mcp-adapter-DPTJGAAL.js} +33 -27
  206. package/dist/node-runtime/{pi-subagents-7XJ4H53P.js → pi-subagents-VKCLYIBY.js} +103 -76
  207. package/dist/node-runtime/{pi-web-access-DPGAVKOA.js → pi-web-access-BV6DSZOP.js} +72 -69
  208. package/dist/node-runtime/{proxy-modes-HEEFK4KC.js → proxy-modes-R64LU6WZ.js} +12 -9
  209. package/dist/node-runtime/rpc-entry.js +24 -21
  210. package/dist/node-runtime/runtime-3SB5ATHQ.js +21 -0
  211. package/dist/node-runtime/{runtime-bridges-PPHNBFWL.js → runtime-bridges-UJ5WJJLN.js} +3 -3
  212. package/dist/node-runtime/{session-manager-MQNBYACL.js → session-manager-QEMZBMTM.js} +3 -5
  213. package/dist/node-runtime/{session-selector-5AZLJS6U.js → session-selector-URVJLOTK.js} +2 -2
  214. package/dist/node-runtime/{settings-manager-5LF2VQWC.js → settings-manager-K6IPIQTI.js} +3 -1
  215. package/dist/node-runtime/{src-Y7JSCK64.js → src-GPFAU3N6.js} +30 -10
  216. package/dist/node-runtime/{subagent-executor-5RNDEPIJ.js → subagent-executor-EFLTO32A.js} +39 -21
  217. package/dist/node-runtime/{update-cli-A253SZ7P.js → update-cli-I6OVDRPL.js} +3 -1
  218. package/dist/node-runtime/{video-extract-OYT5WKS5.js → video-extract-ETA5RA7U.js} +2 -2
  219. package/dist/node-runtime/workflow-SA34S4VX.js +325 -0
  220. package/dist/node-runtime/{youtube-extract-TQYKGFGS.js → youtube-extract-SRVGNN26.js} +2 -2
  221. package/dist/rpc.d.ts +3 -0
  222. package/dist/rpc.d.ts.map +1 -0
  223. package/dist/rpc.js +18 -0
  224. package/dist/rpc.js.map +1 -0
  225. package/dist/startup/interactive-view.d.ts.map +1 -1
  226. package/dist/startup/interactive-view.js +1 -2
  227. package/dist/startup/interactive-view.js.map +1 -1
  228. package/docs/computer-use.md +277 -0
  229. package/docs/development.md +0 -32
  230. package/docs/features.md +2 -2
  231. package/docs/interactive-startup.md +10 -3
  232. package/docs/keybindings.md +2 -2
  233. package/docs/terminal-setup.md +1 -1
  234. package/docs/usage.md +1 -1
  235. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  236. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  237. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  238. package/examples/extensions/gondolin/package-lock.json +2 -2
  239. package/examples/extensions/gondolin/package.json +1 -1
  240. package/examples/extensions/hidden-thinking-label.ts +1 -1
  241. package/examples/extensions/sandbox/package-lock.json +2 -2
  242. package/examples/extensions/sandbox/package.json +1 -1
  243. package/examples/extensions/with-deps/package-lock.json +2 -2
  244. package/examples/extensions/with-deps/package.json +1 -1
  245. package/install-lock/package-lock.json +3827 -0
  246. package/install-lock/package.json +18 -0
  247. package/native/computer-use/LICENSE.md +21 -0
  248. package/npm-shrinkwrap.json +3808 -0
  249. package/package.json +16 -10
  250. package/dist/startup/interactive-shell.d.ts +0 -55
  251. package/dist/startup/interactive-shell.d.ts.map +0 -1
  252. package/dist/startup/interactive-shell.js +0 -264
  253. package/dist/startup/interactive-shell.js.map +0 -1
  254. package/dist/node-runtime/{chunk-YSKSB3BJ.js → chunk-CH6OL6P2.js} +2 -2
  255. package/dist/node-runtime/{chunk-VSELYKWU.js → chunk-EHMBW7FA.js} +3 -3
@@ -1,11 +1,11 @@
1
1
  import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
2
- import {
3
- computeContextBreakdown
4
- } from "./chunk-A2KQXUJD.js";
5
2
  import {
6
3
  checkForUpdate,
7
4
  markUpdateNotified
8
5
  } from "./chunk-BR7YDUKA.js";
6
+ import {
7
+ computeContextBreakdown
8
+ } from "./chunk-7AFOFSDY.js";
9
9
  import {
10
10
  copyToClipboard,
11
11
  readClipboardText
@@ -27,7 +27,7 @@ import {
27
27
  areExperimentalFeaturesEnabled,
28
28
  getProjectTrustOptions,
29
29
  hasTrustRequiringProjectResources
30
- } from "./chunk-2QKLKMKC.js";
30
+ } from "./chunk-LTXUQJI4.js";
31
31
  import {
32
32
  MissingSessionCwdError,
33
33
  SessionImportFileNotFoundError,
@@ -37,7 +37,10 @@ import {
37
37
  parseSkillBlock,
38
38
  refreshModelCandidatesForInit,
39
39
  stripJsonComments
40
- } from "./chunk-WOVTOV5P.js";
40
+ } from "./chunk-JT6YCS5B.js";
41
+ import {
42
+ parseGitUrl
43
+ } from "./chunk-T5GM5BFH.js";
41
44
  import {
42
45
  computeFileLists,
43
46
  createFileOps,
@@ -45,10 +48,7 @@ import {
45
48
  extractFileOpsFromMessage,
46
49
  findExactModelReferenceMatch,
47
50
  resolveModelScope
48
- } from "./chunk-TQNSPERU.js";
49
- import {
50
- parseGitUrl
51
- } from "./chunk-PGAJ5MO5.js";
51
+ } from "./chunk-5SQDLSZJ.js";
52
52
  import {
53
53
  clearRegistry,
54
54
  createAllToolDefinitions,
@@ -62,25 +62,7 @@ import {
62
62
  restart,
63
63
  resume,
64
64
  truncateToVisualLines
65
- } from "./chunk-ZKMFUD3Q.js";
66
- import {
67
- convertToPng,
68
- processImage
69
- } from "./chunk-AD6VXAO7.js";
70
- import {
71
- AUTO_MODE_ADDENDUM,
72
- PLAN_MODE_ADDENDUM,
73
- getPermissionMode,
74
- nextPermissionMode,
75
- registerApprovalHandler,
76
- resetPermissions,
77
- restorePermissionModeAfterPlan,
78
- setPermissionMode
79
- } from "./chunk-LZAW4ZX3.js";
80
- import {
81
- getGlobalInstructionsPath,
82
- getModelInstructionsPath
83
- } from "./chunk-M3LZLQW2.js";
65
+ } from "./chunk-K72NVGUB.js";
84
66
  import {
85
67
  DEFAULT_MAX_BYTES,
86
68
  DEFAULT_MAX_LINES,
@@ -97,16 +79,34 @@ import {
97
79
  import {
98
80
  killTrackedDetachedChildren
99
81
  } from "./chunk-ZCHMJ34K.js";
82
+ import {
83
+ convertToPng,
84
+ processImage
85
+ } from "./chunk-5Q45AVQG.js";
86
+ import {
87
+ AUTO_MODE_ADDENDUM,
88
+ PLAN_MODE_ADDENDUM,
89
+ getPermissionMode,
90
+ nextPermissionMode,
91
+ registerApprovalHandler,
92
+ resetPermissions,
93
+ restorePermissionModeAfterPlan,
94
+ setPermissionMode
95
+ } from "./chunk-ZRDIMBEQ.js";
96
+ import {
97
+ getGlobalInstructionsPath,
98
+ getModelInstructionsPath
99
+ } from "./chunk-M3LZLQW2.js";
100
100
  import {
101
101
  HTTP_IDLE_TIMEOUT_CHOICES,
102
102
  SKILL_TAG_CHARACTERS,
103
103
  configureHttpDispatcher,
104
104
  formatHttpIdleTimeoutMs
105
- } from "./chunk-AJX357CL.js";
105
+ } from "./chunk-5NWQCSKR.js";
106
106
  import {
107
107
  SessionManager,
108
108
  sessionEntryToContextMessages
109
- } from "./chunk-PBC2Y6GS.js";
109
+ } from "./chunk-6UB6NKA3.js";
110
110
  import {
111
111
  createCompactionSummaryMessage
112
112
  } from "./chunk-FVDOXRUD.js";
@@ -128,7 +128,12 @@ import {
128
128
  peekRollbackTurnsConsumed,
129
129
  rollbackLastTurn,
130
130
  setRollbackWarningHandler
131
- } from "./chunk-YF63P5ZT.js";
131
+ } from "./chunk-OTT6JMPU.js";
132
+ import {
133
+ MEMORY_CHAR_CAP_DEFAULT,
134
+ MEMORY_CHAR_CAP_MAX,
135
+ MEMORY_CHAR_CAP_MIN
136
+ } from "./chunk-AY6CAJSL.js";
132
137
  import {
133
138
  CustomEditor
134
139
  } from "./chunk-H2EOZYMP.js";
@@ -138,11 +143,6 @@ import {
138
143
  import {
139
144
  getCustomizeBridge
140
145
  } from "./chunk-HQCKFM2O.js";
141
- import {
142
- MEMORY_CHAR_CAP_DEFAULT,
143
- MEMORY_CHAR_CAP_MAX,
144
- MEMORY_CHAR_CAP_MIN
145
- } from "./chunk-AY6CAJSL.js";
146
146
  import {
147
147
  markStartupMilestone
148
148
  } from "./chunk-CCZJ3PYY.js";
@@ -157,10 +157,10 @@ import {
157
157
  } from "./chunk-I6R76AG7.js";
158
158
  import {
159
159
  SessionSelectorComponent
160
- } from "./chunk-5P7PZMRU.js";
160
+ } from "./chunk-HRS4HMDX.js";
161
161
  import {
162
162
  KeybindingsManager
163
- } from "./chunk-YSKSB3BJ.js";
163
+ } from "./chunk-CH6OL6P2.js";
164
164
  import {
165
165
  DynamicBorder
166
166
  } from "./chunk-3GHXVUAK.js";
@@ -1523,12 +1523,11 @@ var FooterComponent = class {
1523
1523
  autoCompactEnabled = !0;
1524
1524
  session;
1525
1525
  footerData;
1526
- usageCache;
1527
1526
  constructor(session, footerData) {
1528
1527
  this.session = session, this.footerData = footerData;
1529
1528
  }
1530
1529
  setSession(session) {
1531
- this.session = session, this.usageCache = void 0;
1530
+ this.session = session;
1532
1531
  }
1533
1532
  setAutoCompactEnabled(enabled) {
1534
1533
  this.autoCompactEnabled = enabled;
@@ -1545,29 +1544,15 @@ var FooterComponent = class {
1545
1544
  */
1546
1545
  dispose() {
1547
1546
  }
1548
- getUsageTotals() {
1549
- let manager = this.session.sessionManager, leafId = manager.getLeafId();
1550
- if (this.usageCache?.manager === manager && this.usageCache.leafId === leafId)
1551
- return this.usageCache.totals;
1552
- let totals = {
1553
- totalInput: 0,
1554
- totalOutput: 0,
1555
- totalCacheRead: 0,
1556
- totalCacheWrite: 0,
1557
- totalCost: 0,
1558
- latestCacheHitRate: void 0
1559
- };
1560
- for (let entry of manager.getEntries()) {
1561
- if (entry.type !== "message" || entry.message.role !== "assistant")
1562
- continue;
1563
- totals.totalInput += entry.message.usage.input, totals.totalOutput += entry.message.usage.output, totals.totalCacheRead += entry.message.usage.cacheRead, totals.totalCacheWrite += entry.message.usage.cacheWrite, totals.totalCost += entry.message.usage.cost.total;
1564
- let latestPromptTokens = entry.message.usage.input + entry.message.usage.cacheRead + entry.message.usage.cacheWrite;
1565
- totals.latestCacheHitRate = latestPromptTokens > 0 ? entry.message.usage.cacheRead / latestPromptTokens * 100 : void 0;
1566
- }
1567
- return this.usageCache = { manager, leafId, totals }, totals;
1568
- }
1569
1547
  render(width) {
1570
- let state = this.session.state, { totalInput, totalOutput, totalCacheRead, totalCacheWrite, totalCost, latestCacheHitRate } = this.getUsageTotals(), contextUsage = this.session.getContextUsage(), contextWindow = contextUsage?.contextWindow ?? state.model?.contextWindow ?? 0, contextPercentValue = contextUsage?.percent ?? 0, contextPercent = contextUsage?.percent !== null ? contextPercentValue.toFixed(1) : "?", pwd = formatCwdForFooter(this.session.sessionManager.getCwd(), process.env.HOME || process.env.USERPROFILE), branch = this.footerData.getGitBranch();
1548
+ let state = this.session.state, totalInput = 0, totalOutput = 0, totalCacheRead = 0, totalCacheWrite = 0, totalCost = 0, latestCacheHitRate;
1549
+ for (let entry of this.session.sessionManager.getEntries())
1550
+ if (entry.type === "message" && entry.message.role === "assistant") {
1551
+ totalInput += entry.message.usage.input, totalOutput += entry.message.usage.output, totalCacheRead += entry.message.usage.cacheRead, totalCacheWrite += entry.message.usage.cacheWrite, totalCost += entry.message.usage.cost.total;
1552
+ let latestPromptTokens = entry.message.usage.input + entry.message.usage.cacheRead + entry.message.usage.cacheWrite;
1553
+ latestCacheHitRate = latestPromptTokens > 0 ? entry.message.usage.cacheRead / latestPromptTokens * 100 : void 0;
1554
+ }
1555
+ let contextUsage = this.session.getContextUsage(), contextWindow = contextUsage?.contextWindow ?? state.model?.contextWindow ?? 0, contextPercentValue = contextUsage?.percent ?? 0, contextPercent = contextUsage?.percent !== null ? contextPercentValue.toFixed(1) : "?", pwd = formatCwdForFooter(this.session.sessionManager.getCwd(), process.env.HOME || process.env.USERPROFILE), branch = this.footerData.getGitBranch();
1571
1556
  branch && (pwd = `${pwd} (${branch})`);
1572
1557
  let sessionName = this.session.sessionManager.getSessionName();
1573
1558
  sessionName && (pwd = `${pwd} \u2022 ${sessionName}`);
@@ -2436,7 +2421,6 @@ var ProcessesSelectorComponent = class extends Container11 {
2436
2421
  confirmKill = null;
2437
2422
  done;
2438
2423
  refreshTimer;
2439
- requestRender;
2440
2424
  _focused = !1;
2441
2425
  get focused() {
2442
2426
  return this._focused;
@@ -2444,11 +2428,8 @@ var ProcessesSelectorComponent = class extends Container11 {
2444
2428
  set focused(value) {
2445
2429
  this._focused = value;
2446
2430
  }
2447
- constructor(done, requestRender = () => {
2448
- }) {
2449
- super(), this.done = done, this.requestRender = requestRender, this.refresh(), this.refreshTimer = setInterval(() => {
2450
- this.refresh(), this.requestRender();
2451
- }, 2e3);
2431
+ constructor(done) {
2432
+ super(), this.done = done, this.refresh(), this.refreshTimer = setInterval(() => this.refresh(), 2e3);
2452
2433
  }
2453
2434
  refresh() {
2454
2435
  this.processes = list(), this.selected >= this.processes.length && (this.selected = Math.max(0, this.processes.length - 1)), this.rebuild();
@@ -2484,11 +2465,11 @@ var ProcessesSelectorComponent = class extends Container11 {
2484
2465
  return;
2485
2466
  }
2486
2467
  if (data === "q") {
2487
- this.dispose(), this.done();
2468
+ this.cleanup(), this.done();
2488
2469
  return;
2489
2470
  }
2490
2471
  if (getKeybindings5().matches(data, "tui.select.cancel")) {
2491
- this.dispose(), this.done();
2472
+ this.cleanup(), this.done();
2492
2473
  return;
2493
2474
  }
2494
2475
  if (this.processes.length === 0)
@@ -2521,7 +2502,7 @@ var ProcessesSelectorComponent = class extends Container11 {
2521
2502
  }
2522
2503
  }
2523
2504
  }
2524
- dispose() {
2505
+ cleanup() {
2525
2506
  this.refreshTimer && (clearInterval(this.refreshTimer), this.refreshTimer = void 0);
2526
2507
  }
2527
2508
  };
@@ -3423,6 +3404,20 @@ var ThemeSubmenu = class extends Container13 {
3423
3404
  currentValue: config.smoothStreaming ? "true" : "false",
3424
3405
  values: ["true", "false"]
3425
3406
  },
3407
+ {
3408
+ id: "computer-use",
3409
+ label: "Computer use",
3410
+ description: "Control this computer with native desktop tools",
3411
+ currentValue: config.computerUse !== !1 ? "on" : "off",
3412
+ values: ["on", "off"]
3413
+ },
3414
+ {
3415
+ id: "computer-foreground",
3416
+ label: "Allow foreground control",
3417
+ description: "Allow desktop tools to change focus when background control fails",
3418
+ currentValue: config.computerForeground !== !1 ? "on" : "off",
3419
+ values: ["on", "off"]
3420
+ },
3426
3421
  {
3427
3422
  id: "agent-memory",
3428
3423
  label: "Agent memory",
@@ -3709,6 +3704,12 @@ var ThemeSubmenu = class extends Container13 {
3709
3704
  case "memory-char-cap":
3710
3705
  callbacks.onMemoryCharCapChange(parseInt(newValue, 10));
3711
3706
  break;
3707
+ case "computer-use":
3708
+ callbacks.onComputerUseChange?.(newValue === "on");
3709
+ break;
3710
+ case "computer-foreground":
3711
+ callbacks.onComputerForegroundChange?.(newValue === "on");
3712
+ break;
3712
3713
  case "agent-memory":
3713
3714
  callbacks.onMemoryEnabledChange(newValue === "on");
3714
3715
  break;
@@ -5204,6 +5205,27 @@ Fell back to moon theme.`), result;
5204
5205
  }
5205
5206
  };
5206
5207
 
5208
+ // packages/coding-agent/dist/modes/interactive/thinking-level-slash.js
5209
+ var THINKING_LEVEL_SLASH_NAMES = /* @__PURE__ */ new Set(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
5210
+ function wrapThinkingLevelSlashCommands(inner, getLevels) {
5211
+ return {
5212
+ triggerCharacters: inner.triggerCharacters,
5213
+ async getSuggestions(lines, cursorLine, cursorCol, options) {
5214
+ let result = await inner.getSuggestions(lines, cursorLine, cursorCol, options);
5215
+ if (!result)
5216
+ return result;
5217
+ let textBefore = (lines[cursorLine] || "").slice(0, cursorCol);
5218
+ if (!textBefore.startsWith("/") || textBefore.includes(" "))
5219
+ return result;
5220
+ let allowed = new Set(getLevels()), items = result.items.filter((item) => !THINKING_LEVEL_SLASH_NAMES.has(item.value) || allowed.has(item.value));
5221
+ return items.length === 0 ? null : { ...result, items };
5222
+ },
5223
+ applyCompletion(lines, cursorLine, cursorCol, item, prefix) {
5224
+ return inner.applyCompletion(lines, cursorLine, cursorCol, item, prefix);
5225
+ }
5226
+ };
5227
+ }
5228
+
5207
5229
  // packages/coding-agent/dist/modes/interactive/interactive-mode.js
5208
5230
  function isExpandable(obj) {
5209
5231
  return typeof obj == "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded == "function";
@@ -5525,7 +5547,7 @@ var InteractiveMode = class _InteractiveMode {
5525
5547
  });
5526
5548
  }
5527
5549
  setupAutocompleteProvider() {
5528
- let provider = this.createBaseAutocompleteProvider(), triggerCharacters = [...provider.triggerCharacters ?? []];
5550
+ let provider = wrapThinkingLevelSlashCommands(this.createBaseAutocompleteProvider(), () => this.session.getAvailableThinkingLevels()), triggerCharacters = [...provider.triggerCharacters ?? []];
5529
5551
  for (let wrapProvider of this.autocompleteProviderWrappers)
5530
5552
  provider = wrapProvider(provider), triggerCharacters.push(...provider.triggerCharacters ?? []);
5531
5553
  triggerCharacters.length > 0 && (provider.triggerCharacters = [...new Set(triggerCharacters)]), this.autocompleteProvider = provider, this.defaultEditor.setAutocompleteProvider(provider), this.editor !== this.defaultEditor && this.editor.setAutocompleteProvider?.(provider);
@@ -6210,8 +6232,9 @@ ${warningLines}`, 0, 0)), this.loadedResourcesContainer.addChild(new Spacer19(1)
6210
6232
  return;
6211
6233
  }
6212
6234
  leadingSpacer && container.addChild(new Spacer19(1));
6235
+ let first = !0;
6213
6236
  for (let component of widgets.values())
6214
- container.addChild(component);
6237
+ first || (container.addChild(new Spacer19(1)), container.addChild(new DynamicBorder((s) => theme.fg("dim", s)))), first = !1, container.addChild(component);
6215
6238
  }
6216
6239
  /**
6217
6240
  * Set a custom footer component, or restore the built-in footer.
@@ -6573,8 +6596,8 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
6573
6596
  try {
6574
6597
  let image = await readClipboardImage();
6575
6598
  if (image) {
6576
- let saved = this.writeClipboardImageFile(image), id = this.insertImageChip(saved);
6577
- this.ui.requestRender(), this.showStatus(`Pasted ${formatImageMarker(id)}`);
6599
+ let saved = this.writeClipboardImageFile(image);
6600
+ this.insertImageChip(saved), this.ui.requestRender();
6578
6601
  return;
6579
6602
  }
6580
6603
  if (options.textFallback !== !1) {
@@ -7307,8 +7330,7 @@ Kill them before exit?`) && killAll(), this.stop(), await this.runtimeHost.dispo
7307
7330
  this.ui.requestRender();
7308
7331
  }
7309
7332
  cycleThinkingLevel() {
7310
- let newLevel = this.session.cycleThinkingLevel();
7311
- newLevel === void 0 ? this.showStatus("Current model does not support thinking") : (this.footer.invalidate(), this.updateEditorBorderColor(), this.showStatus(`Thinking level: ${newLevel}`));
7333
+ this.session.cycleThinkingLevel() === void 0 ? this.showStatus("Current model does not support thinking") : (this.footer.invalidate(), this.updateEditorBorderColor());
7312
7334
  }
7313
7335
  cyclePermissionMode() {
7314
7336
  this.applyPermissionMode(nextPermissionMode(getPermissionMode()), { silent: !0 });
@@ -7319,11 +7341,8 @@ Kill them before exit?`) && killAll(), this.stop(), await this.runtimeHost.dispo
7319
7341
  if (result === void 0) {
7320
7342
  let msg = this.session.scopedModels.length > 0 ? "Only one model in scope" : "Only one model available";
7321
7343
  this.showStatus(msg);
7322
- } else {
7323
- this.footer.invalidate(), this.updateEditorBorderColor();
7324
- let thinkingStr = result.model.reasoning && result.thinkingLevel !== "off" ? ` (thinking: ${result.thinkingLevel})` : "";
7325
- this.showStatus(`Switched to ${result.model.name || result.model.id}${thinkingStr}`), this.maybeWarnAboutAnthropicSubscriptionAuth(result.model);
7326
- }
7344
+ } else
7345
+ this.footer.invalidate(), this.updateEditorBorderColor(), this.maybeWarnAboutAnthropicSubscriptionAuth(result.model);
7327
7346
  } catch (error) {
7328
7347
  this.showError(error instanceof Error ? error.message : String(error));
7329
7348
  }
@@ -7564,6 +7583,8 @@ Pi will resume when the editor exits.
7564
7583
  globalInstructionsPath: getGlobalInstructionsPath(getAgentDir()),
7565
7584
  modelInstructionsPath: getModelInstructionsPath(getAgentDir(), this.session.model?.id ?? "no-model-selected"),
7566
7585
  confirmLargeSubagentLaunches: this.settingsManager.getConfirmLargeSubagentLaunches(),
7586
+ computerUse: this.settingsManager.getComputerUse(),
7587
+ computerForeground: this.settingsManager.getComputerForeground(),
7567
7588
  memoryEnabled: this.settingsManager.getMemoryEnabled(),
7568
7589
  memoryCharCap: this.settingsManager.getMemoryCharCap(),
7569
7590
  searchCurator: getSearchCuratorSetting(),
@@ -7717,6 +7738,12 @@ Pi will resume when the editor exits.
7717
7738
  onMemoryCharCapChange: (cap) => {
7718
7739
  this.settingsManager.setMemoryCharCap(cap);
7719
7740
  },
7741
+ onComputerUseChange: (enabled) => {
7742
+ this.settingsManager.setComputerUse(enabled);
7743
+ },
7744
+ onComputerForegroundChange: (enabled) => {
7745
+ this.settingsManager.setComputerForeground(enabled);
7746
+ },
7720
7747
  onMemoryEnabledChange: (enabled) => {
7721
7748
  this.settingsManager.setMemoryEnabled(enabled), this.session.refreshToolRegistry(), this.showStatus(`Agent memory: ${enabled ? "on" : "off"}`);
7722
7749
  },
@@ -9325,8 +9352,8 @@ ${cycleThinkingLevel ? `| \`${cycleThinkingLevel}\` | Cycle thinking level |
9325
9352
  ` : ""}| \`${cycleModelForward}\` / \`${cycleModelBackward}\` | Cycle models |
9326
9353
  | \`${selectModel}\` | Open model selector |
9327
9354
  | \`${expandTools}\` | Expand or collapse a thinking/tool card |
9328
- | \`${toggleThinking}\` | Toggle thinking block visibility |
9329
- | \`${externalEditor}\` | Edit message in external editor |
9355
+ ${toggleThinking ? `| \`${toggleThinking}\` | Toggle thinking block visibility |
9356
+ ` : ""}| \`${externalEditor}\` | Edit message in external editor |
9330
9357
  | \`${copyMessage}\` | Copy last assistant message |
9331
9358
  | \`${followUp}\` | Queue follow-up message |
9332
9359
  | \`${dequeue}\` | Restore queued messages |
@@ -2,6 +2,9 @@ import { createRequire as __lunrRequire } from "node:module"; const require = __
2
2
  import {
3
3
  isUserInstructionsPath
4
4
  } from "./chunk-M3LZLQW2.js";
5
+ import {
6
+ computerPolicy
7
+ } from "./chunk-5OLJGVCB.js";
5
8
  import {
6
9
  getAgentDir
7
10
  } from "./chunk-PCIGF2XK.js";
@@ -125,6 +128,12 @@ function isCodeRewriteMutating(input) {
125
128
  return input?.dry_run === !1;
126
129
  }
127
130
  function planModeBlockReason(toolName, input) {
131
+ if (toolName.startsWith("computer_"))
132
+ try {
133
+ return computerPolicy(toolName, {})?.observation ? void 0 : PLAN_MODE_BLOCK_MESSAGE;
134
+ } catch {
135
+ return PLAN_MODE_BLOCK_MESSAGE;
136
+ }
128
137
  if (BLOCKED_TOOLS.has(toolName) || toolName === "code_rewrite" && isCodeRewriteMutating(input) || toolName.startsWith("settings_") && toolName !== "settings_load" && Object.keys(input ?? {}).length > 0)
129
138
  return PLAN_MODE_BLOCK_MESSAGE;
130
139
  if (toolName === "bash") {
@@ -401,8 +410,8 @@ var READ_ONLY_TOOLS = /* @__PURE__ */ new Set([
401
410
  function getContext(sessionId) {
402
411
  return sessionId ? contexts.get(sessionId) ?? defaultContext : defaultContext;
403
412
  }
404
- function createPermissionContext(sessionId, mode = defaultContext.mode) {
405
- contexts.set(sessionId, { mode, approvals: /* @__PURE__ */ new Set() });
413
+ function createPermissionContext(sessionId, mode = defaultContext.mode, allowApprovals = !0) {
414
+ contexts.set(sessionId, { mode, allowApprovals, approvals: /* @__PURE__ */ new Set() });
406
415
  }
407
416
  function deletePermissionContext(sessionId) {
408
417
  contexts.delete(sessionId);
@@ -487,7 +496,7 @@ function getRequestedChildLaunches(input) {
487
496
  return collectRequestedChildLaunches(input, launches), launches;
488
497
  }
489
498
  function requiresManualApproval(toolName, input) {
490
- return isMutatingTool(toolName) ? !0 : toolName.startsWith("settings_") && toolName !== "settings_load" ? Object.keys(input).length > 0 : toolName === "subagent" ? getRequestedChildLaunches(input).some((launch) => launch.permissions === "full") : toolName === "code_rewrite" && isCodeRewriteMutating(input);
499
+ return toolName.startsWith("computer_") ? toolName !== "computer_end" : isMutatingTool(toolName) ? !0 : toolName.startsWith("settings_") && toolName !== "settings_load" ? Object.keys(input).length > 0 : toolName === "subagent" ? getRequestedChildLaunches(input).some((launch) => launch.permissions === "full") : toolName === "code_rewrite" && isCodeRewriteMutating(input);
491
500
  }
492
501
  function firstTaskText(value) {
493
502
  return typeof value == "string" && value.trim() ? sanitizeDetail(value) : "";
@@ -525,7 +534,7 @@ async function gateLargeSubagentLaunch(input, ctx, options) {
525
534
  block: !0,
526
535
  reason: cached.feedback ? `${LARGE_SUBAGENT_LAUNCH_REJECT_REASON} ${cached.feedback}` : LARGE_SUBAGENT_LAUNCH_REJECT_REASON
527
536
  } : { fullChildrenApproved: cached.fullChildrenApproved };
528
- if (!approvalHandler)
537
+ if (!approvalHandler || ctx.allowApprovals === !1)
529
538
  return { block: !0, reason: NO_LARGE_SUBAGENT_LAUNCH_HANDLER_REASON };
530
539
  let summary = largeLaunchTaskSummary(input, options?.assistantMessage), siblingLaunches = (options?.assistantMessage?.content ?? []).flatMap((block) => {
531
540
  if (block.type !== "toolCall" || block.name !== "subagent")
@@ -557,7 +566,14 @@ function sanitizeDetail(value) {
557
566
  return text.length > 200 ? `${text.slice(0, 200)}\u2026` : text;
558
567
  }
559
568
  async function gateToolCall(toolName, input, cwd, sessionId, options) {
560
- let ctx = getContext(sessionId), protectedWriteReason = protectedFileWriteReason(toolName, input, cwd);
569
+ let ctx = getContext(sessionId);
570
+ if (toolName.startsWith("computer_"))
571
+ try {
572
+ computerPolicy(toolName, input);
573
+ } catch (error) {
574
+ return { block: !0, reason: String(error) };
575
+ }
576
+ let protectedWriteReason = protectedFileWriteReason(toolName, input, cwd);
561
577
  if (protectedWriteReason)
562
578
  return { block: !0, reason: protectedWriteReason };
563
579
  if (READ_ONLY_TOOLS.has(toolName))
@@ -576,7 +592,9 @@ async function gateToolCall(toolName, input, cwd, sessionId, options) {
576
592
  if (ctx.mode !== "manual" || !requiresManualApproval(toolName, input) || largeLaunchCoveredManualApproval)
577
593
  return;
578
594
  let action, detail;
579
- if (toolName === "bash")
595
+ if (toolName.startsWith("computer_"))
596
+ action = toolName, detail = sanitizeDetail(JSON.stringify(input));
597
+ else if (toolName === "bash")
580
598
  action = "bash", detail = sanitizeDetail(input.command);
581
599
  else if (toolName === "edit" || toolName === "write") {
582
600
  let path = resolvePath(cwd, input.path);
@@ -594,9 +612,9 @@ async function gateToolCall(toolName, input, cwd, sessionId, options) {
594
612
  permissions: ${launch.permissions}`).join(`
595
613
  `));
596
614
  } else toolName === "code_rewrite" ? (action = "code_rewrite", detail = sanitizeDetail(input.path ?? input.pattern)) : (action = toolName, detail = "");
597
- if (ctx.approvals.has(action))
615
+ if (!toolName.startsWith("computer_") && ctx.approvals.has(action))
598
616
  return;
599
- if (!approvalHandler)
617
+ if (!approvalHandler || ctx.allowApprovals === !1)
600
618
  return { block: !0, reason: NO_HANDLER_REASON };
601
619
  let resp;
602
620
  try {
@@ -606,7 +624,7 @@ permissions: ${launch.permissions}`).join(`
606
624
  }
607
625
  let decision = typeof resp == "string" ? resp : resp.decision;
608
626
  if (decision === "session") {
609
- ctx.approvals.add(action);
627
+ toolName.startsWith("computer_") || ctx.approvals.add(action);
610
628
  return;
611
629
  }
612
630
  if (decision === "reject") {
@@ -3,6 +3,9 @@ import {
3
3
  loadPhoton
4
4
  } from "./chunk-RQ2Q5IYR.js";
5
5
 
6
+ // packages/coding-agent/dist/utils/image-resize.js
7
+ import { Worker } from "node:worker_threads";
8
+
6
9
  // packages/coding-agent/dist/utils/exif-orientation.js
7
10
  function readOrientationFromTiff(bytes, tiffStart) {
8
11
  if (tiffStart + 8 > bytes.length)
@@ -99,36 +102,6 @@ function applyExifOrientation(photon, image, originalBytes) {
99
102
  }
100
103
  }
101
104
 
102
- // packages/coding-agent/dist/utils/image-convert.js
103
- async function convertImageBytesToPng(bytes) {
104
- let photon = await loadPhoton();
105
- if (!photon)
106
- return null;
107
- try {
108
- let rawImage = photon.PhotonImage.new_from_byteslice(bytes), image = applyExifOrientation(photon, rawImage, bytes);
109
- image !== rawImage && rawImage.free();
110
- try {
111
- return new Uint8Array(image.get_bytes());
112
- } finally {
113
- image.free();
114
- }
115
- } catch {
116
- return null;
117
- }
118
- }
119
- async function convertToPng(base64Data, mimeType) {
120
- if (mimeType === "image/png")
121
- return { data: base64Data, mimeType };
122
- let bytes = new Uint8Array(Buffer.from(base64Data, "base64")), pngBytes = await convertImageBytesToPng(bytes);
123
- return pngBytes ? {
124
- data: Buffer.from(pngBytes).toString("base64"),
125
- mimeType: "image/png"
126
- } : null;
127
- }
128
-
129
- // packages/coding-agent/dist/utils/image-resize.js
130
- import { Worker } from "node:worker_threads";
131
-
132
105
  // packages/coding-agent/dist/utils/image-resize-core.js
133
106
  var DEFAULT_MAX_BYTES = 4.5 * 1024 * 1024, DEFAULT_OPTIONS = {
134
107
  maxWidth: 2e3,
@@ -267,76 +240,8 @@ function formatDimensionNote(result) {
267
240
  return `[Image: original ${result.originalWidth}x${result.originalHeight}, displayed at ${result.width}x${result.height}. Multiply coordinates by ${scale.toFixed(2)} to map to original image.]`;
268
241
  }
269
242
 
270
- // packages/coding-agent/dist/utils/image-process.js
271
- function baseMimeType(mimeType) {
272
- return mimeType.split(";")[0]?.trim().toLowerCase() ?? mimeType.toLowerCase();
273
- }
274
- function normalizeSupportedImageMimeType(mimeType) {
275
- switch (baseMimeType(mimeType)) {
276
- case "image/png":
277
- return "image/png";
278
- case "image/jpeg":
279
- case "image/jpg":
280
- return "image/jpeg";
281
- case "image/gif":
282
- return "image/gif";
283
- case "image/webp":
284
- return "image/webp";
285
- default:
286
- return null;
287
- }
288
- }
289
- async function normalizeImage(bytes, mimeType) {
290
- let normalizedMimeType = normalizeSupportedImageMimeType(mimeType);
291
- if (normalizedMimeType)
292
- return { bytes, mimeType: normalizedMimeType };
293
- let pngBytes = await convertImageBytesToPng(bytes);
294
- return pngBytes ? {
295
- bytes: pngBytes,
296
- mimeType: "image/png",
297
- convertedFrom: baseMimeType(mimeType)
298
- } : null;
299
- }
300
- function conversionHint(from, to) {
301
- if (!(!from || from === to))
302
- return `[Image converted from ${from} to ${to}.]`;
303
- }
304
- async function processImage(bytes, mimeType, options) {
305
- let autoResizeImages = options?.autoResizeImages ?? !0, normalized = await normalizeImage(bytes, mimeType);
306
- if (!normalized)
307
- return {
308
- ok: !1,
309
- message: "[Image omitted: could not be converted to a supported inline image format.]"
310
- };
311
- if (autoResizeImages) {
312
- let resized = await resizeImage(normalized.bytes, normalized.mimeType, options?.resizeOptions);
313
- if (!resized)
314
- return {
315
- ok: !1,
316
- message: "[Image omitted: could not be resized below the inline image size limit.]"
317
- };
318
- let hints2 = [], convertedHint2 = conversionHint(normalized.convertedFrom, resized.mimeType);
319
- convertedHint2 && hints2.push(convertedHint2);
320
- let dimensionNote = formatDimensionNote(resized);
321
- return dimensionNote && hints2.push(dimensionNote), {
322
- ok: !0,
323
- data: resized.data,
324
- mimeType: resized.mimeType,
325
- hints: hints2
326
- };
327
- }
328
- let hints = [], convertedHint = conversionHint(normalized.convertedFrom, normalized.mimeType);
329
- return convertedHint && hints.push(convertedHint), {
330
- ok: !0,
331
- data: Buffer.from(normalized.bytes).toString("base64"),
332
- mimeType: normalized.mimeType,
333
- hints
334
- };
335
- }
336
-
337
243
  export {
338
- convertToPng,
244
+ applyExifOrientation,
339
245
  resizeImage,
340
- formatDimensionNote,
341
- processImage
246
+ formatDimensionNote
342
247
  };
@@ -58,7 +58,7 @@ var args = process.argv.slice(2), startupBenchmark = process.env.PI_STARTUP_BENC
58
58
  markStartupMilestone("mode_routed");
59
59
  var startupView;
60
60
  if (preloadMode === "interactive") {
61
- let { InteractiveView } = await import("./interactive-view-U6OILKF3.js");
61
+ let { InteractiveView } = await import("./interactive-view-N6F4KUIT.js");
62
62
  startupView = new InteractiveView(), startupView.start(), await startupView.waitForFirstFrame(), startupView.isExitRequested && process.exit(0);
63
63
  }
64
64
  var startRuntime = async () => {
@@ -5,7 +5,7 @@ import "./chunk-BRJX2PRC.js";
5
5
  async function handleGatewayCommand(args) {
6
6
  if (args[0] !== "gateway")
7
7
  return !1;
8
- let { runGateway } = await import("./gateway-X2TI5X7F.js"), code = await runGateway(args.slice(1));
8
+ let { runGateway } = await import("./gateway-3OLC4GQN.js"), code = await runGateway(args.slice(1));
9
9
  return process.exitCode = code, !0;
10
10
  }
11
11
  export {
@@ -5,7 +5,7 @@ import {
5
5
  lazyConnect,
6
6
  updateMetadataCache,
7
7
  updateStatusBar
8
- } from "./chunk-MKKH27PH.js";
8
+ } from "./chunk-BKAZ6BKX.js";
9
9
  import {
10
10
  ensureCompatibilityImports,
11
11
  getMcpDiscoverySummary,
@@ -18,18 +18,20 @@ import {
18
18
  writeDirectToolsConfig,
19
19
  writeSharedServerEntry,
20
20
  writeStarterProjectConfig
21
- } from "./chunk-VSELYKWU.js";
21
+ } from "./chunk-EHMBW7FA.js";
22
+ import "./chunk-ARC4KOTI.js";
23
+ import "./chunk-LWJXTA6Z.js";
22
24
  import {
23
25
  authenticate,
24
26
  getAuthForUrl,
25
27
  removeAuth,
26
28
  supportsOAuth
27
- } from "./chunk-4TLO4PO2.js";
29
+ } from "./chunk-U6C7VTR5.js";
28
30
  import {
29
31
  getAgentPath
30
32
  } from "./chunk-4HXHDDCF.js";
33
+ import "./chunk-2IDTZAG5.js";
31
34
  import "./chunk-BI3DHYCN.js";
32
- import "./chunk-ARC4KOTI.js";
33
35
  import "./chunk-Q4Q6D4IY.js";
34
36
  import "./chunk-BRJX2PRC.js";
35
37