agentbox-app 0.1.12 → 0.1.16

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 (370) hide show
  1. package/README.md +24 -9
  2. package/bin/agentbox.mjs +23 -1
  3. package/briefs/message-rules.md +36 -8
  4. package/briefs/worker.md +46 -23
  5. package/main/account-discovery.mjs +122 -30
  6. package/main/account-tooling.mjs +29 -1
  7. package/main/account-usage.mjs +46 -0
  8. package/main/acp.mjs +296 -0
  9. package/main/agent-homes.mjs +158 -0
  10. package/main/agent-sessions.mjs +311 -260
  11. package/main/agent-updates.mjs +9 -22
  12. package/main/agents.mjs +179 -466
  13. package/main/analytics.mjs +42 -2
  14. package/main/answer-modes.mjs +103 -37
  15. package/main/approval-prompt-core.mjs +197 -0
  16. package/main/approval-prompt-server.mjs +4 -138
  17. package/main/approvals.mjs +101 -297
  18. package/main/artifact-path.mjs +47 -18
  19. package/main/claude-bin.mjs +45 -311
  20. package/main/claude-input.mjs +57 -7
  21. package/main/claude-launch-env.mjs +54 -0
  22. package/main/claude-models.mjs +39 -7
  23. package/main/claude-plan.mjs +64 -16
  24. package/main/claude-session-open.mjs +28 -0
  25. package/main/claude-usage-process.mjs +40 -0
  26. package/main/claude-usage.mjs +94 -59
  27. package/main/cloud/account.mjs +179 -0
  28. package/main/cloud/aws.mjs +127 -0
  29. package/main/cloud/browser-return.mjs +58 -0
  30. package/main/cloud/clients.mjs +15 -0
  31. package/main/cloud/codex-cloud.mjs +53 -0
  32. package/main/cloud/config.mjs +107 -0
  33. package/main/cloud/docs.mjs +219 -0
  34. package/main/cloud/exec.mjs +27 -0
  35. package/main/cloud/host.mjs +165 -0
  36. package/main/cloud/kit.mjs +80 -0
  37. package/main/cloud/logins.mjs +543 -0
  38. package/main/cloud/managed.mjs +115 -0
  39. package/main/cloud/marker.mjs +104 -0
  40. package/main/cloud/org.mjs +53 -0
  41. package/main/cloud/reuse.mjs +208 -0
  42. package/main/cloud/run-cli.mjs +177 -0
  43. package/main/cloud/run.mjs +1934 -0
  44. package/main/cloud/usage.mjs +76 -0
  45. package/main/cloud-permission.mjs +51 -0
  46. package/main/codex-account.mjs +78 -0
  47. package/main/codex-app-server.mjs +276 -409
  48. package/main/codex-approvals.mjs +148 -433
  49. package/main/codex-bin.mjs +51 -249
  50. package/main/codex-models.mjs +20 -2
  51. package/main/codex-session.mjs +246 -506
  52. package/main/codex-threads-worker.mjs +12 -0
  53. package/main/codex-threads.mjs +112 -11
  54. package/main/codex-usage-file.mjs +5 -3
  55. package/main/codex-usage.mjs +56 -7
  56. package/main/codex-watch.mjs +83 -5
  57. package/main/codex.mjs +95 -363
  58. package/main/config.mjs +37 -5
  59. package/main/corner-tag.mjs +810 -0
  60. package/main/crash-report.mjs +26 -3
  61. package/main/dev-window.mjs +1 -1
  62. package/main/engine-bin.mjs +545 -0
  63. package/main/engine-setup.mjs +25 -24
  64. package/main/feedback.mjs +14 -31
  65. package/main/folder-pictures.mjs +2 -2
  66. package/main/freeze-recorder-thread.mjs +86 -0
  67. package/main/freeze-recorder.mjs +146 -0
  68. package/main/fresh-user.mjs +20 -9
  69. package/main/git-change-offthread.mjs +17 -3
  70. package/main/git-change-thread.mjs +5 -2
  71. package/main/harnesses/claude-stream.mjs +208 -0
  72. package/main/harnesses/claude.mjs +105 -0
  73. package/main/harnesses/codex.mjs +72 -0
  74. package/main/harnesses/common.mjs +78 -0
  75. package/main/harnesses/instructions-file.mjs +116 -0
  76. package/main/harnesses/opencode.mjs +234 -0
  77. package/main/harnesses.mjs +65 -0
  78. package/main/importable-threads.mjs +96 -0
  79. package/main/ipc.mjs +520 -135
  80. package/main/leftovers.mjs +117 -25
  81. package/main/liquid-glass.mjs +26 -0
  82. package/main/live-replies.mjs +10 -4
  83. package/main/local-app-frames.mjs +82 -0
  84. package/main/main-went-red.mjs +330 -0
  85. package/main/main.mjs +248 -37
  86. package/main/memory-gate-history.mjs +85 -20
  87. package/main/memory-gate-server.mjs +129 -11
  88. package/main/memory-gate.mjs +62 -8
  89. package/main/memory-log.mjs +124 -0
  90. package/main/menu.mjs +4 -2
  91. package/main/message-priority.mjs +2 -2
  92. package/main/mic.mjs +38 -0
  93. package/main/native/liquid-glass/build/liquid-glass.node +0 -0
  94. package/main/new-chats-watch.mjs +110 -0
  95. package/main/new-user-window.mjs +25 -0
  96. package/main/notify.mjs +64 -5
  97. package/main/opencode-server.mjs +271 -0
  98. package/main/opencode.mjs +287 -0
  99. package/main/phone-alerts.mjs +117 -0
  100. package/main/phone-inbox.mjs +625 -0
  101. package/main/phone-link.mjs +571 -0
  102. package/main/phone-uploads.mjs +476 -0
  103. package/main/picture-shape.mjs +114 -0
  104. package/main/quit-sequence.mjs +143 -0
  105. package/main/refresh-agent-models.mjs +15 -2
  106. package/main/relay-address.mjs +28 -0
  107. package/main/relay-client.mjs +314 -0
  108. package/main/repeats.mjs +10 -4
  109. package/main/row-label.mjs +18 -47
  110. package/main/run-change.mjs +13 -0
  111. package/main/run-ledger.mjs +135 -0
  112. package/main/runs-on.mjs +32 -35
  113. package/main/save-attachments.mjs +41 -0
  114. package/main/serve.mjs +155 -9
  115. package/main/settings.mjs +364 -50
  116. package/main/shell-path.mjs +234 -0
  117. package/main/ship-conflict-brief.mjs +119 -0
  118. package/main/ship-queue.mjs +134 -20
  119. package/main/sign-in-files.mjs +3 -7
  120. package/main/source-updater.mjs +45 -11
  121. package/main/stage-attachment.mjs +68 -0
  122. package/main/stall-watch.mjs +50 -0
  123. package/main/start-hold.mjs +73 -0
  124. package/main/store/home.mjs +87 -232
  125. package/main/store/paths.mjs +11 -0
  126. package/main/store/teammates-files.mjs +99 -0
  127. package/main/store/work-items.mjs +231 -13
  128. package/main/store.mjs +227 -53
  129. package/main/supervisor.mjs +3865 -699
  130. package/main/task-commands.mjs +13 -17
  131. package/main/task-folders-offthread.mjs +6 -1
  132. package/main/task-folders.mjs +897 -105
  133. package/main/task-terminals.mjs +147 -41
  134. package/main/team/index.mjs +114 -10
  135. package/main/team/memory-cloud.mjs +183 -1
  136. package/main/team/room-hours.mjs +48 -0
  137. package/main/team/room-setup.mjs +31 -0
  138. package/main/team/rooms-memory.mjs +454 -0
  139. package/main/team/rooms-shape.mjs +42 -0
  140. package/main/team/rooms-supabase.mjs +324 -0
  141. package/main/team/rooms.mjs +575 -0
  142. package/main/team/session.mjs +96 -26
  143. package/main/team/supabase-backend.mjs +180 -0
  144. package/main/team/sync.mjs +109 -1
  145. package/main/teammates.mjs +580 -0
  146. package/main/terminal-host.mjs +143 -0
  147. package/main/terminal-hosts.mjs +261 -0
  148. package/main/transcript-search.mjs +80 -0
  149. package/main/updater.mjs +71 -9
  150. package/main/webview-guard.mjs +45 -0
  151. package/main/worktree-include.mjs +365 -0
  152. package/mcp/core/documents.mjs +3 -1
  153. package/mcp/core/repeats.mjs +88 -0
  154. package/mcp/core/teammates.mjs +222 -0
  155. package/mcp/core/work.mjs +76 -4
  156. package/mcp/stdio.mjs +24 -11
  157. package/mcp/tools.mjs +116 -8
  158. package/package.json +30 -5
  159. package/renderer/dist/assets/abnfDiagram-YUKMZFIV-CoWB6YUK.js +1 -0
  160. package/renderer/dist/assets/arc-Ch0NrCul.js +1 -0
  161. package/renderer/dist/assets/architectureDiagram-47P4ROYG-CXz9M5tQ.js +36 -0
  162. package/renderer/dist/assets/blockDiagram-E7TT5TSB-DchGUuHH.js +140 -0
  163. package/renderer/dist/assets/c4Diagram-CRA5TL53-Cip-zNyr.js +38 -0
  164. package/renderer/dist/assets/channel-BQuQSL--.js +1 -0
  165. package/renderer/dist/assets/chunk-2Q5K7J3B-BoXid_2r.js +1 -0
  166. package/renderer/dist/assets/chunk-5VM5RSS4-Cpez1rRz.js +15 -0
  167. package/renderer/dist/assets/chunk-7TKQ45FW-DKA84YkE.js +1 -0
  168. package/renderer/dist/assets/chunk-AW2ZBBNX-Dg-SumPG.js +88 -0
  169. package/renderer/dist/assets/chunk-FVRAUYC3-06TCvPm1.js +2 -0
  170. package/renderer/dist/assets/chunk-HTAEGDNF-CMEBy1Td.js +1 -0
  171. package/renderer/dist/assets/chunk-JWPE2WC7-BJ2ObmV-.js +1 -0
  172. package/renderer/dist/assets/chunk-KQW6MTUR-CGWOYXUE.js +1 -0
  173. package/renderer/dist/assets/chunk-XXDRQBXY-CiZp07XC.js +1 -0
  174. package/renderer/dist/assets/classDiagram-v2-K4WV4PDN-DJNIX719.js +217 -0
  175. package/renderer/dist/assets/cornerTag-CPgvu-q3.js +1 -0
  176. package/renderer/dist/assets/cornerTag-oMfEjzCO.css +1 -0
  177. package/renderer/dist/assets/cose-bilkent-JH36ORCC-CbkyZOUH.js +1 -0
  178. package/renderer/dist/assets/cynefin-EF2NZ3EQ-78iOroZO.js +141 -0
  179. package/renderer/dist/assets/cynefinDiagram-3GCD6N5R-GcCopMs7.js +62 -0
  180. package/renderer/dist/assets/cytoscape.esm-C5JX3QLV.js +331 -0
  181. package/renderer/dist/assets/dagre-W4DXFKR2-DHLlXLkz.js +4 -0
  182. package/renderer/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
  183. package/renderer/dist/assets/diagram-2UJZ2QOL-DuZSUHcH.js +200 -0
  184. package/renderer/dist/assets/diagram-OVF4WLC6-Ckxu3cqH.js +24 -0
  185. package/renderer/dist/assets/diagram-PFPMY2P6-CsTw9Ycn.js +30 -0
  186. package/renderer/dist/assets/diagram-UMYRVEAY-CTXd8qVg.js +24 -0
  187. package/renderer/dist/assets/diagram-YEKJPTXX-CJs1T_9m.js +41 -0
  188. package/renderer/dist/assets/diagram-ZIFT7M5P-CvjI23mf.js +3 -0
  189. package/renderer/dist/assets/ebnfDiagram-VR2GEFS7-d_IeAzOJ.js +1 -0
  190. package/renderer/dist/assets/elk-IJKZMXRS-zo9KFP3N.js +27 -0
  191. package/renderer/dist/assets/erDiagram-O2IAPWRE-DqfYf5Dt.js +99 -0
  192. package/renderer/dist/assets/flowDiagram-OXPTDLAJ-DAWsMLmo.js +213 -0
  193. package/renderer/dist/assets/ganttDiagram-R7TSEDQI-4ml_bhwR.js +292 -0
  194. package/renderer/dist/assets/gitGraphDiagram-XJZIOB7I-B_WcqSId.js +106 -0
  195. package/renderer/dist/assets/graph-DGbsTEsI.js +1 -0
  196. package/renderer/dist/assets/infoDiagram-5W2HQ5XZ-CI-jYqzc.js +2 -0
  197. package/renderer/dist/assets/init-Gi6I4Gst.js +1 -0
  198. package/renderer/dist/assets/ishikawaDiagram-K3B6WC7H-B56VWRlV.js +70 -0
  199. package/renderer/dist/assets/journeyDiagram-COXZFDF6-D1-p09Lr.js +139 -0
  200. package/renderer/dist/assets/kanban-definition-P3RFRI5V-Cv3w7JoN.js +89 -0
  201. package/renderer/dist/assets/katex-C5jXJg4s.js +257 -0
  202. package/renderer/dist/assets/linear-C35V2Spi.js +1 -0
  203. package/renderer/dist/assets/main-BcoBiGwv.css +32 -0
  204. package/renderer/dist/assets/main-CLnIOulD.js +1191 -0
  205. package/renderer/dist/assets/mermaid.core-BzGT5Vo9.js +314 -0
  206. package/renderer/dist/assets/mindmap-definition-LZFPQGKD-BZUfuymC.js +96 -0
  207. package/renderer/dist/assets/ordinal-Cboi1Yqb.js +1 -0
  208. package/renderer/dist/assets/pegDiagram-BGZESJAR-DFh9XNGe.js +1 -0
  209. package/renderer/dist/assets/pieDiagram-CAPJLFHJ-C65tPVsy.js +39 -0
  210. package/renderer/dist/assets/product-name-CSNW6d7s.js +40 -0
  211. package/renderer/dist/assets/quadrantDiagram-GDMTTRAM-Cushj_nk.js +7 -0
  212. package/renderer/dist/assets/railroadDiagram-SM67HX2B-DZGebGx5.js +1 -0
  213. package/renderer/dist/assets/requirementDiagram-X7JNWC4A-DpAB0MNo.js +84 -0
  214. package/renderer/dist/assets/sankeyDiagram-UM26HJRW-D-29rHra.js +40 -0
  215. package/renderer/dist/assets/sequenceDiagram-ZO4K6R2Y-FfOQAZol.js +169 -0
  216. package/renderer/dist/assets/sizeCapture-INFHLROL-C_n6fDBY.js +1 -0
  217. package/renderer/dist/assets/stateDiagram-v2-TBUQTH76-BZjenzJG.js +291 -0
  218. package/renderer/dist/assets/swimlanes-N4OXWK64-DxaMU9vX.js +1 -0
  219. package/renderer/dist/assets/swimlanesDiagram-K3J5GTZL-Cb2kM6rr.js +8 -0
  220. package/renderer/dist/assets/timeline-definition-YOQAKGHF-DTg5HJKz.js +120 -0
  221. package/renderer/dist/assets/usecaseDiagram-VIAY4XPW-Bc3MZDsl.js +370 -0
  222. package/renderer/dist/assets/vennDiagram-BLWOH2XV-GIVGk9Id.js +34 -0
  223. package/renderer/dist/assets/wardleyDiagram-YMQ3BMBF-NmJnbQOg.js +78 -0
  224. package/renderer/dist/assets/xychartDiagram-TAQBALBS-p-kfGfnW.js +7 -0
  225. package/renderer/dist/corner-tag.html +13 -0
  226. package/renderer/dist/emulator/audio-rules.mjs +74 -0
  227. package/renderer/dist/emulator/data/compression/README.md +11 -0
  228. package/renderer/dist/emulator/data/compression/extract7z.js +1 -0
  229. package/renderer/dist/emulator/data/compression/extractzip.js +1 -0
  230. package/renderer/dist/emulator/data/compression/libunrar.js +519 -0
  231. package/renderer/dist/emulator/data/compression/libunrar.wasm +0 -0
  232. package/renderer/dist/emulator/data/cores/README.md +22 -0
  233. package/renderer/dist/emulator/data/cores/mgba-legacy-wasm.data +0 -0
  234. package/renderer/dist/emulator/data/cores/mgba-thread-legacy-wasm.data +0 -0
  235. package/renderer/dist/emulator/data/cores/mgba-thread-wasm.data +0 -0
  236. package/renderer/dist/emulator/data/cores/mgba-wasm.data +0 -0
  237. package/renderer/dist/emulator/data/cores/package.json +65 -0
  238. package/renderer/dist/emulator/data/cores/reports/mgba.json +1 -0
  239. package/renderer/dist/emulator/data/emulator.css +1614 -0
  240. package/renderer/dist/emulator/data/loader.js +170 -0
  241. package/renderer/dist/emulator/data/localization/README.md +63 -0
  242. package/renderer/dist/emulator/data/localization/af-FR.json +339 -0
  243. package/renderer/dist/emulator/data/localization/ar-AR.json +301 -0
  244. package/renderer/dist/emulator/data/localization/ben-BEN.json +301 -0
  245. package/renderer/dist/emulator/data/localization/de-GER.json +301 -0
  246. package/renderer/dist/emulator/data/localization/el-GR.json +301 -0
  247. package/renderer/dist/emulator/data/localization/en-US.json +339 -0
  248. package/renderer/dist/emulator/data/localization/es-ES.json +310 -0
  249. package/renderer/dist/emulator/data/localization/fa-AF.json +310 -0
  250. package/renderer/dist/emulator/data/localization/hi-HI.json +301 -0
  251. package/renderer/dist/emulator/data/localization/it-IT.json +302 -0
  252. package/renderer/dist/emulator/data/localization/ja-JA.json +301 -0
  253. package/renderer/dist/emulator/data/localization/jv-JV.json +301 -0
  254. package/renderer/dist/emulator/data/localization/ko-KO.json +336 -0
  255. package/renderer/dist/emulator/data/localization/pt-BR.json +361 -0
  256. package/renderer/dist/emulator/data/localization/retroarch.json +617 -0
  257. package/renderer/dist/emulator/data/localization/ro-RO.json +310 -0
  258. package/renderer/dist/emulator/data/localization/ru-RU.json +301 -0
  259. package/renderer/dist/emulator/data/localization/tr-TR.json +310 -0
  260. package/renderer/dist/emulator/data/localization/vi-VN.json +302 -0
  261. package/renderer/dist/emulator/data/localization/zh-CN.json +351 -0
  262. package/renderer/dist/emulator/data/src/GameManager.js +464 -0
  263. package/renderer/dist/emulator/data/src/compression.js +142 -0
  264. package/renderer/dist/emulator/data/src/emulator.js +6158 -0
  265. package/renderer/dist/emulator/data/src/gamepad.js +167 -0
  266. package/renderer/dist/emulator/data/src/nipplejs.js +1 -0
  267. package/renderer/dist/emulator/data/src/shaders.js +236 -0
  268. package/renderer/dist/emulator/data/src/socket.io.min.js +7 -0
  269. package/renderer/dist/emulator/data/src/storage.js +125 -0
  270. package/renderer/dist/emulator/data/version.json +5 -0
  271. package/renderer/dist/emulator/host.js +297 -0
  272. package/renderer/dist/emulator/index.html +28 -0
  273. package/renderer/dist/emulator/provenance.json +6 -0
  274. package/renderer/dist/index.html +16 -3
  275. package/scripts/after-install.mjs +30 -8
  276. package/scripts/approval-server.sh +24 -5
  277. package/scripts/before-publish.mjs +12 -10
  278. package/scripts/cloud-shim.pl +57 -0
  279. package/shared/account-names.d.mts +6 -0
  280. package/shared/account-names.mjs +15 -0
  281. package/shared/agent-hours.mjs +136 -0
  282. package/shared/agent-import.mjs +62 -34
  283. package/shared/agents.d.mts +1 -0
  284. package/shared/agents.mjs +126 -522
  285. package/shared/analytics-events.mjs +12 -0
  286. package/shared/approval-card.mjs +36 -0
  287. package/shared/bridge-map.mjs +45 -1
  288. package/shared/claude-code-shape.mjs +6 -0
  289. package/shared/claude-commands.generated.mjs +6 -4
  290. package/shared/claude-models.generated.mjs +6 -4
  291. package/shared/claude-usage.d.mts +1 -0
  292. package/shared/claude-usage.mjs +42 -1
  293. package/shared/cloud-hand-back.d.mts +7 -0
  294. package/shared/cloud-hand-back.mjs +20 -0
  295. package/shared/cloud-kit.d.mts +219 -0
  296. package/shared/cloud-kit.mjs +341 -0
  297. package/shared/cloud-login-name.mjs +4 -0
  298. package/shared/cloud-start.mjs +17 -0
  299. package/shared/cloud-versions.mjs +23 -0
  300. package/shared/codex-import.mjs +2 -2
  301. package/shared/codex-modes.d.mts +22 -9
  302. package/shared/codex-modes.mjs +67 -11
  303. package/shared/codex-usage.mjs +108 -2
  304. package/shared/corner-tag.d.mts +36 -0
  305. package/shared/corner-tag.mjs +396 -0
  306. package/shared/dead-run-trace.mjs +19 -2
  307. package/shared/engines.mjs +76 -300
  308. package/shared/feedback.d.mts +7 -0
  309. package/shared/feedback.mjs +25 -0
  310. package/shared/first-run-practice.mjs +17 -24
  311. package/shared/harness-definitions.mjs +111 -0
  312. package/shared/instruction-defaults.json +2 -2
  313. package/shared/key-caps.d.mts +14 -0
  314. package/shared/key-caps.mjs +68 -0
  315. package/shared/message-edits.d.mts +7 -0
  316. package/shared/message-edits.mjs +35 -0
  317. package/shared/move-thread.d.mts +24 -0
  318. package/shared/move-thread.mjs +112 -0
  319. package/shared/named-threads.mjs +72 -0
  320. package/shared/not-shipped.d.mts +22 -0
  321. package/shared/not-shipped.mjs +89 -0
  322. package/shared/notify-rules.d.mts +31 -0
  323. package/shared/notify-rules.mjs +55 -8
  324. package/shared/phone-files.mjs +28 -0
  325. package/shared/phone-settings.mjs +118 -0
  326. package/shared/phone-snapshot.d.mts +16 -0
  327. package/shared/phone-snapshot.mjs +348 -0
  328. package/shared/picture-formats.d.mts +1 -0
  329. package/shared/picture-formats.mjs +13 -0
  330. package/shared/provider-commands.mjs +10 -2
  331. package/shared/rank.d.mts +4 -1
  332. package/shared/rank.mjs +82 -19
  333. package/shared/relay-address.mjs +6 -0
  334. package/shared/relay-crypto.mjs +165 -0
  335. package/shared/repeats.d.mts +8 -0
  336. package/shared/repeats.mjs +33 -2
  337. package/shared/room-cards.mjs +167 -0
  338. package/shared/room-links.d.mts +4 -0
  339. package/shared/room-links.mjs +21 -0
  340. package/shared/runs-on.d.mts +3 -13
  341. package/shared/runs-on.mjs +31 -52
  342. package/shared/shipped-note.d.mts +4 -0
  343. package/shared/shipped-note.mjs +6 -0
  344. package/shared/shortcuts.mjs +24 -10
  345. package/shared/spawn-trouble.d.mts +4 -0
  346. package/shared/spawn-trouble.mjs +484 -30
  347. package/shared/team-rules.mjs +9 -2
  348. package/shared/teammates.d.mts +19 -0
  349. package/shared/teammates.mjs +756 -0
  350. package/shared/terminal-focus.d.mts +1 -0
  351. package/shared/terminal-focus.mjs +13 -0
  352. package/shared/terminal-input.d.mts +1 -0
  353. package/shared/terminal-input.mjs +30 -0
  354. package/shared/terminal-keys.d.mts +1 -0
  355. package/shared/terminal-keys.mjs +16 -0
  356. package/shared/terminal-size.d.mts +4 -0
  357. package/shared/terminal-size.mjs +29 -0
  358. package/shared/thread-cards.mjs +4 -1
  359. package/shared/usage.d.mts +12 -0
  360. package/shared/usage.mjs +56 -3
  361. package/shared/websites.d.mts +15 -0
  362. package/shared/websites.mjs +61 -0
  363. package/shared/where-it-runs-from.d.mts +43 -0
  364. package/shared/where-it-runs-from.mjs +155 -0
  365. package/shared/work-items.mjs +150 -29
  366. package/shared/work-lines.mjs +93 -245
  367. package/shared/xterm-invalid-range.d.mts +2 -0
  368. package/shared/xterm-invalid-range.mjs +58 -0
  369. package/renderer/dist/assets/index-ChKsQkRw.js +0 -1169
  370. package/renderer/dist/assets/index-ClBXnq3B.css +0 -32
@@ -1,279 +1,81 @@
1
1
  // Where Codex actually is, and whether we are entitled to say it is not here.
2
2
  //
3
- // The sibling of main/claude-bin.mjs, and it keeps that file's rule rather than
4
- // re-arguing it.
3
+ // THIS FILE IS NOW THE NAMES AND NOTHING ELSE. The search, the registry entry
4
+ // that declares Codex, and every measurement behind its paths live in
5
+ // main/engine-bin.mjs, which does the same job for every coding agent the app
6
+ // can run. Until 2026-10-08 this was 279 lines beside main/claude-bin.mjs's 338,
7
+ // and the two were copies of one idea: three of the seven commits they ever had
8
+ // are literally "one more install location".
5
9
  //
6
- // So `found` decides which binary would be spawned and `certain` decides
7
- // whether a screen may SAY there is nothing here, and they are never the same
8
- // value.
10
+ // WHAT IS KEPT HERE is the vocabulary the rest of the app already imports --
11
+ // main/config.mjs, main/settings.mjs and main/codex-launch-env.mjs, which builds
12
+ // the PATH a Codex opened from the desktop needs out of `candidatePaths` and
13
+ // `versionedPaths`.
14
+ //
15
+ // `found` decides which binary would be spawned and `certain` decides whether a
16
+ // screen may SAY there is nothing here, and they are never the same value.
9
17
  //
10
18
  // ONE DIFFERENCE FROM CLAUDE CODE, AND IT CHANGES THE SCREEN. Claude Code is
11
- // required: the app will not open an inbox without it. Codex is optional, and
12
- // an absence is the ordinary case rather than a fault. So nothing here ever
13
- // produces a warning. All a missing Codex does is leave the second engine out
14
- // of the map that shared/engines.mjs reads, which is silence rather than a
15
- // sentence about software she never asked for.
19
+ // required: the app will not open an inbox without it. Codex is optional, and an
20
+ // absence is the ordinary case rather than a fault. So nothing here ever produces
21
+ // a warning. All a missing Codex does is leave the second engine out of the map
22
+ // that shared/engines.mjs reads, which is silence rather than a sentence about
23
+ // software nobody asked for.
16
24
  //
17
25
  // NOTHING HERE SPAWNS ANYTHING, AND main/config.mjs IS WHAT CALLS IT.
26
+ // `resolveCodexBin` is what answers "is there a Codex on this machine", and its
27
+ // answer is the fact `engineFor` refuses on. Before it was wired in, a `codexBin`
28
+ // in zero.config.json arrived on `config` through the unknown-key spread and went
29
+ // to `spawn` with no finder and no existence check behind it.
18
30
  //
19
- // It was inert when it was written -- "no config key, no snapshot field, no
20
- // Settings row" -- and that stopped being true the moment the supervisor
21
- // started spawning `config.codexBin`. Until this was wired in, that path
22
- // arrived on `config` through the unknown-key spread in main/config.mjs and
23
- // went to `spawn` with no finder and no existence check behind it, which is the
24
- // one path in the second engine that becomes a process and was the only one
25
- // with no guard on it. `resolveCodexBin` is now what answers "is there a Codex
26
- // on this Mac", and its answer is the fact `engineFor` refuses on.
27
- //
28
- // There is still no Settings row, which is a real gap and not a claim of one:
29
- // she can set `codexBin` in zero.config.json and nothing on screen says whether
30
- // it was found.
31
- //
32
- // ------------------------------------------------------------------------
33
- // MEASURED ON THIS MAC 2026-09-04, BECAUSE THE 2026-08-25 ORIGINAL WAS WRITTEN
34
- // AGAINST codex-cli 0.144.0 AND SIX OF ITS ASSUMPTIONS HAVE MOVED SINCE.
35
- //
36
- // Installed here: codex-cli 0.148.0 at /opt/homebrew/bin/codex. That is a
37
- // Homebrew CASK, not a formula as the original said, and the bin entry is a
38
- // SYMLINK into /opt/homebrew/Caskroom/codex/0.148.0/bin/codex. `brew info
39
- // --cask codex` the same minute reports 0.148.0 installed against 0.152.1
40
- // available, so the moment mid-upgrade where that link points at nothing is a
41
- // live state on this machine and not a hypothetical. It is the same shape the
42
- // dangling-symlink rule was written for in the sibling file.
43
- //
44
- // THE INSTALL METHOD THE DOCS NOW LEAD WITH DID NOT EXIST IN THE ORIGINAL.
45
- // `https://chatgpt.com/codex/install.sh`, read 2026-09-04:
46
- //
47
- // BIN_DIR="${CODEX_INSTALL_DIR:-$HOME/.local/bin}"
48
- // CODEX_HOME_DIR="${CODEX_HOME:-$HOME/.codex}"
49
- // STANDALONE_ROOT="$CODEX_HOME_DIR/packages/standalone"
50
- //
51
- // It links ~/.local/bin/codex at a versioned file under that root and swaps the
52
- // file on every update. Three things follow, and all three are changes from the
53
- // original: that path goes FIRST (the tool's own answer settles a machine set
54
- // up the documented way in one stat call, exactly as ~/.local/bin/claude does
55
- // next door), the standalone store's own bin is worth listing for the case
56
- // where CODEX_INSTALL_DIR put the link somewhere no list covers, and CODEX_HOME
57
- // can move every trace below out from under us.
58
- //
59
- // AND THE STORE KEEPS THE BINARY IN TWO PLACES, WHICH THE FIRST VERSION OF THIS
60
- // FILE MISSED. Same script, read the same day:
61
- //
62
- // line 951: ln -sf "bin/codex" "$stage_release/codex"
63
- // line 1021: version_from_binary "$release_dir/bin/codex" \
64
- // || version_from_binary "$release_dir/codex"
65
- //
66
- // Every staged release carries the binary at `<release>/bin/codex` AND at
67
- // `<release>/codex`, and the installer accepts either when it goes looking for
68
- // a version. `current` is a symlink at the live release, so BOTH
69
- // `current/bin/codex` and `current/codex` resolve on a machine set up the
70
- // documented way. Each is one stat call, so listing both costs nothing, and
71
- // listing only one is how the app tells somebody their Codex is missing while
72
- // they are looking at it.
73
- //
74
- // WHAT ~/.codex REALLY HOLDS NOW: 38 entries. auth.json, config.toml, sessions/
75
- // and history.jsonl are all still there, so the original's evidence list is not
76
- // wrong. It is INCOMPLETE, and it is aging in a specific way. The directory
77
- // also holds state_5.sqlite, thread_history_1.sqlite, logs_2.sqlite,
78
- // memories_1.sqlite, queue_1.sqlite, goals_1.sqlite, models_cache.json,
79
- // installation_id and shell_snapshots/, and the split matters: sessions/ holds
80
- // 1691 rollout files with the newest written 2026-09-03, while history.jsonl
81
- // has not been touched since 2026-06-03. The live record moved into sqlite
82
- // files whose names carry a schema number that increments, which is a name no
83
- // list can hold. That is why the directory itself stays on the list, last and
84
- // broad, and why nothing below tries to enumerate what is inside it.
85
- //
86
- // AND THE LINK MOVED. The original's install URL, developers.openai.com/codex/
87
- // cli, answers 308 to learn.chatgpt.com/docs/codex/cli.
88
- //
89
- // The npm package is unchanged and still real (@openai/codex, 0.153.0 on
90
- // 2026-09-04), so the package-manager paths and the per-Node directories below
91
- // are carried over exactly as they were.
31
+ // AND THERE IS A SETTINGS ROW NOW (w-ce8c1a9275): somebody whose Codex the
32
+ // search misses can point the app at the binary themselves, which is written
33
+ // back as `codexBin` and wins over everything below.
92
34
 
93
- import fs from 'node:fs';
94
35
  import os from 'node:os';
95
- import path from 'node:path';
96
- import { askShell } from './claude-bin.mjs';
36
+ import {
37
+ ENGINES, findEngine, resolveEngine, forgetEngine, installEvidence as evidenceFor,
38
+ versionedBinPaths,
39
+ } from './engine-bin.mjs';
97
40
 
98
- // In order, and the first that exists wins. The shell installer's own path is
99
- // first for the same reason its sibling's is: it is the answer the tool itself
100
- // produces. Everything after it is a package manager's default bin directory,
101
- // because Codex ships as a Homebrew cask and as an npm package rather than with
102
- // an installer that owns a folder.
103
- export function candidatePaths(home = os.homedir()) {
104
- return [
105
- path.join(home, '.local/bin/codex'), // the shell installer's link
106
- path.join(home, '.codex/packages/standalone/current/bin/codex'),
107
- path.join(home, '.codex/packages/standalone/current/codex'),
108
- '/opt/homebrew/bin/codex', // the Homebrew cask, Apple Silicon
109
- '/usr/local/bin/codex', // Homebrew on Intel, and npm -g
110
- path.join(home, '.bun/bin/codex'),
111
- path.join(home, '.volta/bin/codex'),
112
- path.join(home, '.asdf/shims/codex'),
113
- path.join(home, '.npm-global/bin/codex'), // the two npm prefixes people
114
- path.join(home, '.npm-packages/bin/codex'), // actually write in a guide
115
- path.join(home, '.yarn/bin/codex'),
116
- path.join(home, 'Library/pnpm/codex'), // pnpm's own bin on macOS
117
- path.join(home, '.local/share/pnpm/codex'), // pnpm's own bin on Linux
118
- path.join(home, '.deno/bin/codex'),
119
- path.join(home, 'bin/codex'), // a hand-rolled ~/bin on PATH
120
- '/opt/local/bin/codex', // MacPorts
121
- '/usr/bin/codex',
122
- ];
123
- }
41
+ const CODEX = ENGINES.codex;
124
42
 
125
- // One bin directory per installed Node, under a name no list can hold. A global
126
- // npm install under nvm, fnm, n or asdf lands there and nowhere else, and a
127
- // double-clicked Electron app inherits launchd's PATH, which has never heard of
128
- // any of them.
129
- export function versionedPaths(home = os.homedir(), readdir = defaultReaddir) {
130
- const under = (dir, tail) => readdir(path.join(home, dir)).map((v) => path.join(home, dir, v, tail));
131
- return [
132
- ...under('.nvm/versions/node', 'bin/codex'),
133
- ...under('.local/share/fnm/node-versions', 'installation/bin/codex'),
134
- ...under('Library/Application Support/fnm/node-versions', 'installation/bin/codex'),
135
- ...under('n/versions/node', 'bin/codex'),
136
- ...under('.asdf/installs/nodejs', 'bin/codex'),
137
- ];
43
+ export const INSTALL_URL = CODEX.installUrl;
44
+
45
+ /** Every normal home for this binary, in order; the first that exists wins. */
46
+ export function candidatePaths(home = os.homedir()) {
47
+ return CODEX.candidates(home, () => []);
138
48
  }
139
49
 
140
- function defaultReaddir(dir) {
141
- try { return fs.readdirSync(dir); } catch { return []; }
50
+ /** One bin directory per installed Node, read rather than guessed. */
51
+ export function versionedPaths(home = os.homedir(), readdir = undefined) {
52
+ return versionedBinPaths('codex', home, readdir);
142
53
  }
143
54
 
144
- // THE COPY THE CHATGPT APP CARRIES INSIDE ITSELF. Somebody who has only ever
145
- // used Codex in the ChatGPT app has this and nothing else (w-9f6975906c,
146
- // measured 2026-10-05: codex-cli 0.158.0-alpha.2, sharing the CLI's sign-in).
147
- // Searched LAST, after the shell, because it moves with the app's releases.
148
- //
149
- // AND THE ONE THE CODEX DESKTOP APP CARRIES (w-d5d632e503). Its reported place,
150
- // not measured on a Mac here: none of the Macs this was written on had the app.
151
- // A path that is not there costs one missed `exists`.
55
+ /** The copies the ChatGPT and Codex desktop apps carry inside themselves. */
152
56
  export function appCopyPaths(home = os.homedir()) {
153
- const inside = ['ChatGPT.app/Contents/Resources/codex-cli/bin/codex', 'Codex.app/Contents/Resources/codex'];
154
- return inside.flatMap((p) => [path.join('/Applications', p), path.join(home, 'Applications', p)]);
57
+ return CODEX.appCopies(home);
155
58
  }
156
59
 
157
- // WHAT CODEX LEAVES BEHIND. None of these is a binary and none is ever spawned.
158
- // They exist only to stop the app claiming an absence it has not established.
159
- //
160
- // Both homes are looked in when CODEX_HOME is set, and that is on purpose: a
161
- // CODEX_HOME inherited from somewhere else is not proof the ordinary directory
162
- // is gone, and the whole job of this list is to make an absence hard to claim
163
- // rather than easy.
60
+ /** What Codex leaves behind. None of it is ever spawned. */
164
61
  export function evidencePaths(home = os.homedir(), env = process.env) {
165
- const homes = [env?.CODEX_HOME, path.join(home, '.codex')].filter(Boolean);
166
- const out = [];
167
- for (const dir of new Set(homes)) {
168
- out.push(
169
- path.join(dir, 'auth.json'), // it has been logged in
170
- path.join(dir, 'config.toml'),
171
- path.join(dir, 'sessions'), // one folder tree of past runs
172
- path.join(dir, 'history.jsonl'),
173
- path.join(dir, 'packages/standalone/releases'), // the installer's version store
174
- dir, // and the directory itself, last
175
- );
176
- }
177
- return out;
62
+ return CODEX.evidence(home, env);
178
63
  }
179
64
 
180
- // A path that is a symlink to nothing. `existsSync` follows the link and says
181
- // false, which is indistinguishable from nothing being there at all, and the
182
- // two mean opposite things. Both of Codex's normal installs are a symlink into
183
- // a versioned directory that gets swapped on every update, so this is the
184
- // ordinary shape of a Codex that is being upgraded rather than an odd one.
185
- function defaultDangles(p) {
186
- try { return !!fs.lstatSync(p) && !fs.existsSync(p); } catch { return false; }
65
+ export function installEvidence({ home = os.homedir(), env = process.env, exists, dangles } = {}) {
66
+ return evidenceFor('codex', { home, env, exists, dangles });
187
67
  }
188
68
 
189
- export function installEvidence({
190
- home = os.homedir(), env = process.env, exists = fs.existsSync, dangles = defaultDangles,
191
- } = {}) {
192
- for (const p of evidencePaths(home, env)) if (exists(p)) return p;
193
- for (const p of candidatePaths(home)) if (dangles(p)) return p;
194
- return null;
69
+ /** The whole search. See main/engine-bin.mjs for what each answer means. */
70
+ export function findCodexBin(where = {}) {
71
+ return findEngine('codex', where);
195
72
  }
196
73
 
197
- export const INSTALL_URL = 'https://learn.chatgpt.com/docs/codex/cli';
198
-
199
- /**
200
- * The whole search, a pure function of its inputs so a test can put Codex
201
- * anywhere without touching the machine it runs on.
202
- *
203
- * Returns the same shape its sibling does: { path, found, certain, from,
204
- * searched, evidence }, so a caller can hold the two side by side without
205
- * learning two vocabularies.
206
- */
207
- export function findCodexBin({
208
- configured = null,
209
- home = os.homedir(),
210
- env = process.env,
211
- exists = fs.existsSync,
212
- shellLookup = () => askShell({ bin: 'codex' }),
213
- readdir = defaultReaddir,
214
- dangles = defaultDangles,
215
- } = {}) {
216
- if (configured) {
217
- return {
218
- path: configured, found: exists(configured), certain: true, from: 'settings',
219
- searched: [], evidence: null,
220
- };
221
- }
222
-
223
- const searched = [...candidatePaths(home), ...versionedPaths(home, readdir)];
224
- for (const candidate of searched) {
225
- if (exists(candidate)) return { path: candidate, found: true, certain: true, from: 'disk', searched, evidence: null };
226
- }
227
-
228
- const fromShell = shellSaid(shellLookup());
229
- if (fromShell.path) return { path: fromShell.path, found: true, certain: true, from: 'shell', searched, evidence: null };
230
-
231
- for (const candidate of appCopyPaths(home)) {
232
- if (exists(candidate)) return { path: candidate, found: true, certain: true, from: 'app', searched, evidence: null };
233
- }
234
-
235
- // NOT FOUND, AND WHETHER THAT IS KNOWN. Every cheap path missed and every
236
- // shell we could reach missed, so the last question is whether this Mac shows
237
- // any sign of Codex anyway.
238
- const evidence = installEvidence({ home, env, exists, dangles });
239
- return {
240
- path: null,
241
- found: false,
242
- certain: fromShell.answered && !evidence,
243
- from: null,
244
- searched,
245
- evidence,
246
- };
247
- }
248
-
249
- // askShell used to answer with a path or null. Anything handing back the old
250
- // shape is read as an answer, because that is what it always meant.
251
- function shellSaid(result) {
252
- if (typeof result === 'string') return { path: result, answered: true };
253
- if (!result || typeof result !== 'object') return { path: null, answered: true };
254
- return { path: result.path ?? null, answered: result.answered !== false };
255
- }
256
-
257
- /* ------------------------------- the cache -------------------------------- */
258
- // Only the SHELL step is remembered, for the same thirty seconds and the same
259
- // reason: the path checks are stat calls, and caching those is how a settings
260
- // screen ends up still saying "not found" after somebody has installed it.
261
-
262
- const SHELL_TTL = 30_000;
263
- let shellAnswer = null;
264
- let shellAskedAt = 0;
265
-
266
- export function resolveCodexBin(configured = null, { now = Date.now(), shellLookup = () => askShell({ bin: 'codex' }), ...where } = {}) {
267
- const remembered = () => {
268
- if (shellAskedAt && now - shellAskedAt < SHELL_TTL) return shellAnswer;
269
- shellAnswer = shellLookup();
270
- shellAskedAt = now;
271
- return shellAnswer;
272
- };
273
- return findCodexBin({ ...where, configured, shellLookup: remembered });
74
+ /** The same search with the shell step held for thirty seconds. */
75
+ export function resolveCodexBin(configured = null, where = {}) {
76
+ return resolveEngine('codex', configured, where);
274
77
  }
275
78
 
276
79
  export function forgetCodexBin() {
277
- shellAnswer = null;
278
- shellAskedAt = 0;
80
+ forgetEngine('codex');
279
81
  }
@@ -59,6 +59,7 @@
59
59
  import fs from 'node:fs';
60
60
  import os from 'node:os';
61
61
  import path from 'node:path';
62
+ import { shellDataDirsNow } from './shell-path.mjs';
62
63
  const liveCatalogs=new Map();
63
64
  export function rememberCodexModels(home,models){
64
65
  const rows=models.filter(m=>typeof m.model==='string'&&m.model).map((m,i)=>({slug:m.model,display_name:m.displayName,visibility:m.hidden?'hide':'list',priority:i,default_reasoning_level:m.defaultReasoningEffort,supported_reasoning_levels:(m.supportedReasoningEfforts||[]).map(l=>({effort:l.reasoningEffort,description:l.description}))}));
@@ -80,8 +81,13 @@ const catalogRows=(home,read)=>liveCatalogs.get(home)??modelRows(read(path.join(
80
81
  * offering models out of the wrong one would offer models a different login
81
82
  * cannot run.
82
83
  */
83
- export function codexHome({ configured = null, env = process.env, home = os.homedir() } = {}) {
84
- return configured || env?.CODEX_HOME || path.join(home, '.codex');
84
+ export function codexHome({ configured = null, env = process.env, home = os.homedir(), shell = shellDataDirsNow().CODEX_HOME } = {}) {
85
+ // AND THE ONE THE SHELL PROFILE EXPORTS (w-6d8c543a43). The supervisor asks
86
+ // with the worker's scrubbed environment, which never has CODEX_HOME, so a
87
+ // home set in .zshrc, the one their terminal's Codex signs in to, was never
88
+ // reached and every Codex task ran signed out on ~/.codex.
89
+ const fromShell = typeof shell === 'string' && path.isAbsolute(shell) ? shell : null;
90
+ return configured || env?.CODEX_HOME || fromShell || path.join(home, '.codex');
85
91
  }
86
92
 
87
93
  /**
@@ -112,6 +118,18 @@ export function codexModels({ home = codexHome(), read = readJson } = {}) {
112
118
  }));
113
119
  }
114
120
 
121
+ /**
122
+ * The models any of these logins may be offered, once each. A task goes to a
123
+ * login whose plan has its model (`_pickProfile`), so a model one login has is
124
+ * one this Mac can run. The longest list leads because it is Codex's order for
125
+ * the widest plan; a model only a smaller list has follows it.
126
+ */
127
+ export function codexModelsAcross(homes, { read = readJson } = {}) {
128
+ const lists = homes.map((home) => codexModels({ home, read })).sort((a, b) => b.length - a.length);
129
+ const seen = new Set();
130
+ return lists.flat().filter((m) => !seen.has(m.id) && seen.add(m.id));
131
+ }
132
+
115
133
  /**
116
134
  * Every slug in the cache, hidden ones included: what Codex would accept if it
117
135
  * were handed the word, which is a different question from what she may pick.