rnxsim 0.1.369 → 0.1.371

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 (265) hide show
  1. package/cli/auth.ts +2 -1
  2. package/cli/bin.ts +283 -273
  3. package/cli/commands/app-fonts.ts +3 -2
  4. package/cli/commands/assert.ts +8 -7
  5. package/cli/commands/auth.ts +2 -1
  6. package/cli/commands/box/checkout-plane.ts +109 -29
  7. package/cli/commands/box/cloud-box.ts +294 -0
  8. package/cli/commands/box/plane-share.ts +208 -0
  9. package/cli/commands/box/rnx-command.ts +2 -2
  10. package/cli/commands/box/search-command.ts +157 -0
  11. package/cli/commands/box.ts +269 -13
  12. package/cli/commands/config.ts +2 -1
  13. package/cli/commands/control.ts +43 -34
  14. package/cli/commands/daemon.ts +22 -21
  15. package/cli/commands/debug.ts +17 -15
  16. package/cli/commands/detox.ts +5 -4
  17. package/cli/commands/device.ts +6 -5
  18. package/cli/commands/electron.ts +6 -5
  19. package/cli/commands/flow.ts +12 -11
  20. package/cli/commands/inspect/find.ts +2 -1
  21. package/cli/commands/inspect/keyboard.ts +2 -1
  22. package/cli/commands/inspect/sleep.ts +2 -1
  23. package/cli/commands/inspect/wait-event.ts +4 -3
  24. package/cli/commands/inspect/wait-idle.ts +2 -1
  25. package/cli/commands/inspect/wait-ready.ts +3 -2
  26. package/cli/commands/inspect/wait-selector.ts +4 -3
  27. package/cli/commands/inspect/wait.ts +2 -1
  28. package/cli/commands/inspect.ts +82 -80
  29. package/cli/commands/install-desktop.ts +5 -4
  30. package/cli/commands/login.ts +3 -2
  31. package/cli/commands/mode.ts +2 -1
  32. package/cli/commands/record.ts +38 -37
  33. package/cli/commands/runtime.ts +9 -8
  34. package/cli/commands/screenshot-layers.ts +4 -3
  35. package/cli/commands/screenshot-mode.ts +2 -1
  36. package/cli/commands/screenshot.ts +8 -7
  37. package/cli/commands/screenshots-capture.ts +2 -1
  38. package/cli/commands/serve.ts +5 -4
  39. package/cli/commands/shell-boolean-mode.ts +2 -1
  40. package/cli/commands/skills.ts +11 -10
  41. package/cli/commands/telemetry.ts +2 -1
  42. package/cli/commands/three-mode.ts +2 -1
  43. package/cli/commands/timeline.ts +4 -3
  44. package/cli/commands/upload.ts +14 -13
  45. package/cli/commands/what-happened.ts +2 -1
  46. package/cli/outbound-endpoints.ts +37 -1
  47. package/cli/recording-access.ts +6 -5
  48. package/cli/run-rnx.ts +140 -0
  49. package/dist-cli/bin.js +6 -6
  50. package/dist-cli/chunks/{agent-OUUFWDLF.js → agent-W2D2V7WF.js} +2 -2
  51. package/dist-cli/chunks/{agent-wrapper-7BE7DR4R.js → agent-wrapper-GVNM2Z4S.js} +2 -2
  52. package/dist-cli/chunks/app-fonts-J6R4TTXD.js +4 -0
  53. package/dist-cli/chunks/{assert-I3CMRNS7.js → assert-YN6U4ZTB.js} +11 -11
  54. package/dist-cli/chunks/auth-XGYZAK2P.js +12 -0
  55. package/dist-cli/chunks/{beta-BHSKY4K4.js → beta-WRDMHHWJ.js} +2 -2
  56. package/dist-cli/chunks/{box-3CVWXVTT.js → box-ML5TFUQW.js} +617 -596
  57. package/dist-cli/chunks/{camera-MNK73TYV.js → camera-OBEI4FZA.js} +2 -2
  58. package/dist-cli/chunks/{chunk-JXARZBWS.js → chunk-2FIT64GR.js} +1 -1
  59. package/dist-cli/chunks/{chunk-RYGQ6LZN.js → chunk-2LH4DYPM.js} +2 -2
  60. package/dist-cli/chunks/chunk-2QW3JH6T.js +99 -0
  61. package/dist-cli/chunks/{chunk-2APXX4RN.js → chunk-2W4YBCPX.js} +2 -2
  62. package/dist-cli/chunks/{chunk-X3PEDNLV.js → chunk-42YOIDLR.js} +2 -2
  63. package/dist-cli/chunks/{chunk-6BMM6OCW.js → chunk-47MSXLWK.js} +2 -2
  64. package/dist-cli/chunks/chunk-4OLUFHEZ.js +74 -0
  65. package/dist-cli/chunks/{chunk-WUR4FXWT.js → chunk-5PPVVGLH.js} +25 -25
  66. package/dist-cli/chunks/{chunk-AKJYEX54.js → chunk-6AZKZ5AJ.js} +2 -2
  67. package/dist-cli/chunks/{chunk-2PVVIPQS.js → chunk-6FPXLSBJ.js} +1 -1
  68. package/dist-cli/chunks/{chunk-CCI3DZKE.js → chunk-763GBI7G.js} +2 -2
  69. package/dist-cli/chunks/{chunk-CZ2HCNRK.js → chunk-7ASCDKA3.js} +1 -1
  70. package/dist-cli/chunks/{chunk-ZNNE5MAV.js → chunk-7Q4WHJDH.js} +1 -1
  71. package/dist-cli/chunks/{chunk-IYPMULI7.js → chunk-7TWD4P6J.js} +2 -2
  72. package/dist-cli/chunks/{chunk-45X3D6CI.js → chunk-7YB46LGI.js} +1 -1
  73. package/dist-cli/chunks/{chunk-3454VMHD.js → chunk-ADJSGO55.js} +2 -2
  74. package/dist-cli/chunks/{chunk-F4OTMARL.js → chunk-AGZZWLEL.js} +2 -2
  75. package/dist-cli/chunks/{chunk-UDXQCEJU.js → chunk-AVIH3TAZ.js} +11 -11
  76. package/dist-cli/chunks/{chunk-DCPDMF27.js → chunk-B26ZJUQA.js} +2 -2
  77. package/dist-cli/chunks/{chunk-D6MGELKZ.js → chunk-BNS5LNEU.js} +1 -1
  78. package/dist-cli/chunks/{chunk-FHRG772G.js → chunk-CJQXP4XM.js} +1 -1
  79. package/dist-cli/chunks/{chunk-OROUEG22.js → chunk-DP6RGTNN.js} +2 -2
  80. package/dist-cli/chunks/{chunk-V7I4CTAX.js → chunk-DYFOLOYL.js} +2 -2
  81. package/dist-cli/chunks/chunk-ERBGQEJ5.js +4 -0
  82. package/dist-cli/chunks/{chunk-H2GB2PLY.js → chunk-ESWSXF55.js} +2 -2
  83. package/dist-cli/chunks/{chunk-FGGESBWD.js → chunk-FLNGSIBL.js} +2 -2
  84. package/dist-cli/chunks/{chunk-4SCVGBOX.js → chunk-GQGS7TRK.js} +1 -1
  85. package/dist-cli/chunks/{chunk-WGE2P25F.js → chunk-H4DU457S.js} +1 -1
  86. package/dist-cli/chunks/{chunk-TBK5UXW2.js → chunk-HFY35VAG.js} +2 -2
  87. package/dist-cli/chunks/{chunk-JLOOLA47.js → chunk-HV3WOWQM.js} +1 -1
  88. package/dist-cli/chunks/{chunk-RV76U3EI.js → chunk-HZ365EMS.js} +10 -10
  89. package/dist-cli/chunks/chunk-IPNDXGVA.js +11 -0
  90. package/dist-cli/chunks/{chunk-TAC4CEIX.js → chunk-IX7Z6ZVJ.js} +2 -2
  91. package/dist-cli/chunks/{chunk-UQJY6O72.js → chunk-IYU2EOIU.js} +1 -1
  92. package/dist-cli/chunks/chunk-J6A5W2DI.js +30 -0
  93. package/dist-cli/chunks/chunk-JKRMBNPO.js +28 -0
  94. package/dist-cli/chunks/{chunk-VGJLCFSC.js → chunk-JUTLQ3GX.js} +1 -1
  95. package/dist-cli/chunks/{chunk-5QFJFASW.js → chunk-KHGXEU4L.js} +1 -1
  96. package/dist-cli/chunks/{chunk-A56GQVNF.js → chunk-KL34TRNW.js} +1 -1
  97. package/dist-cli/chunks/chunk-LFANRLWK.js +7 -0
  98. package/dist-cli/chunks/{chunk-NPVEBXU3.js → chunk-MOIQZVRU.js} +2 -2
  99. package/dist-cli/chunks/chunk-MW4E5EED.js +497 -0
  100. package/dist-cli/chunks/{chunk-AJJCYLBC.js → chunk-N3LAMTGS.js} +2 -2
  101. package/dist-cli/chunks/{chunk-QE5MC4V3.js → chunk-NQ4CI2VI.js} +1 -1
  102. package/dist-cli/chunks/{chunk-6F3WOWFC.js → chunk-OF3U4SZO.js} +2 -2
  103. package/dist-cli/chunks/{chunk-DKSZZABN.js → chunk-OF5OBB67.js} +1 -1
  104. package/dist-cli/chunks/{chunk-MXWME7ET.js → chunk-OQPZOEEP.js} +1 -1
  105. package/dist-cli/chunks/{chunk-SSBZA5VZ.js → chunk-OWDJQWJ7.js} +1 -1
  106. package/dist-cli/chunks/{chunk-YLNSLMQM.js → chunk-PTWMX4AA.js} +2 -2
  107. package/dist-cli/chunks/{chunk-TTUZ5MCK.js → chunk-RYJTPZCX.js} +1 -1
  108. package/dist-cli/chunks/{chunk-A72MIIJI.js → chunk-S3AH2O67.js} +1 -1
  109. package/dist-cli/chunks/{chunk-ZW6JXEVX.js → chunk-SH2HXHR2.js} +2 -2
  110. package/dist-cli/chunks/{chunk-EKAEEWC2.js → chunk-SHLJYXIN.js} +1 -1
  111. package/dist-cli/chunks/{chunk-4G4VCT2M.js → chunk-TL22EBF5.js} +2 -2
  112. package/dist-cli/chunks/{chunk-LU3AHE6T.js → chunk-TWNLRDIH.js} +2 -2
  113. package/dist-cli/chunks/{chunk-B5NW4TT3.js → chunk-UHYAY3RU.js} +2 -2
  114. package/dist-cli/chunks/{chunk-N5KDDGV6.js → chunk-UPMR6Y5P.js} +2 -2
  115. package/dist-cli/chunks/chunk-VEFSHPSU.js +24 -0
  116. package/dist-cli/chunks/{chunk-YPBDPVLR.js → chunk-WCB5XPCH.js} +2 -2
  117. package/dist-cli/chunks/{chunk-USHV3QFZ.js → chunk-WHZE63R2.js} +2 -2
  118. package/dist-cli/chunks/{chunk-ZEF57HQO.js → chunk-WLRIPAGJ.js} +1 -1
  119. package/dist-cli/chunks/{chunk-FBMNYSSW.js → chunk-Y7SKGRAV.js} +1 -1
  120. package/dist-cli/chunks/chunk-Z6CQDU74.js +4 -0
  121. package/dist-cli/chunks/{cleanup-H4XFRMZV.js → cleanup-PTJBMC34.js} +2 -2
  122. package/dist-cli/chunks/cli-version-6ZBD6GKP.js +4 -0
  123. package/dist-cli/chunks/{compat-NKGYERLN.js → compat-FJ2HWRAG.js} +2 -2
  124. package/dist-cli/chunks/config-PYGH7JPN.js +13 -0
  125. package/dist-cli/chunks/{connect-WWWAVVCF.js → connect-AJV4PZA4.js} +2 -2
  126. package/dist-cli/chunks/control-667PAYX4.js +4 -0
  127. package/dist-cli/chunks/daemon-EIBOHZYQ.js +4 -0
  128. package/dist-cli/chunks/{debug-RO6GLDIM.js → debug-XF2XUDHN.js} +20 -20
  129. package/dist-cli/chunks/desktop-HEZYNFYW.js +31 -0
  130. package/dist-cli/chunks/detox-JCFZJRNE.js +52 -0
  131. package/dist-cli/chunks/device-KGUVZHFW.js +18 -0
  132. package/dist-cli/chunks/{diagnose-HDRTUPDO.js → diagnose-KVJQ3TOI.js} +2 -2
  133. package/dist-cli/chunks/{disk-cleanup-QP2NYN43.js → disk-cleanup-7HQXJFUX.js} +2 -2
  134. package/dist-cli/chunks/{do-chain-6LP6SV5J.js → do-chain-3FYJNA2N.js} +2 -2
  135. package/dist-cli/chunks/drivers-5S6M5TJB.js +4 -0
  136. package/dist-cli/chunks/{env-4XD5D2G6.js → env-BX6S2SOM.js} +2 -2
  137. package/dist-cli/chunks/{film-I5SIXLS5.js → film-2WZUVYFA.js} +3 -3
  138. package/dist-cli/chunks/flow-6BZSWNHG.js +4 -0
  139. package/dist-cli/chunks/help-OGJBD4NP.js +4 -0
  140. package/dist-cli/chunks/{hidden-runtime-alias-LJV2S4M2.js → hidden-runtime-alias-PGF55OFH.js} +2 -2
  141. package/dist-cli/chunks/{home-paths-RFI2QRC3.js → home-paths-EGRMTSGE.js} +2 -2
  142. package/dist-cli/chunks/inspect-MZVDGAN4.js +4 -0
  143. package/dist-cli/chunks/install-desktop-QB76DNZF.js +4 -0
  144. package/dist-cli/chunks/login-HRFPYPZ3.js +26 -0
  145. package/dist-cli/chunks/{logout-DKXZZ6HU.js → logout-LRH5HZGP.js} +2 -2
  146. package/dist-cli/chunks/{maestro-WKGVVWRA.js → maestro-S53T4PPE.js} +3 -3
  147. package/dist-cli/chunks/{maestro-generate-KCK6RK2C.js → maestro-generate-YKIVKOB3.js} +3 -3
  148. package/dist-cli/chunks/mode-47JKNUNS.js +26 -0
  149. package/dist-cli/chunks/{optional-demo-registry-EUSKBIPP.js → optional-demo-registry-ARZSPS5Y.js} +2 -2
  150. package/dist-cli/chunks/{perf-IMZMA5MT.js → perf-J73OKB4T.js} +2 -2
  151. package/dist-cli/chunks/{permissions-SLWXTLH6.js → permissions-L3FPI56H.js} +2 -2
  152. package/dist-cli/chunks/{platform-HQ735LAE.js → platform-YAROAHRM.js} +3 -3
  153. package/dist-cli/chunks/privacy-JZQCXHKN.js +4 -0
  154. package/dist-cli/chunks/record-QAQMGYOO.js +72 -0
  155. package/dist-cli/chunks/report-issue-4FVZCAFQ.js +29 -0
  156. package/dist-cli/chunks/reset-NYFUFZCG.js +4 -0
  157. package/dist-cli/chunks/resolve-target-SP22ZGFZ.js +4 -0
  158. package/dist-cli/chunks/runtime-WTS2QMXZ.js +4 -0
  159. package/dist-cli/chunks/{screenshot-command-HAJB5FHK.js → screenshot-command-Q5MGGEWY.js} +11 -11
  160. package/dist-cli/chunks/screenshot-layers-4JW7DRL7.js +20 -0
  161. package/dist-cli/chunks/screenshots-capture-X5PMO44E.js +42 -0
  162. package/dist-cli/chunks/{serve-TM46TKFW.js → serve-3JWJ45J3.js} +20 -20
  163. package/dist-cli/chunks/setup-USPDJESI.js +4 -0
  164. package/dist-cli/chunks/{sim-client-LQUZSO45.js → sim-client-RL6DGOJE.js} +2 -2
  165. package/dist-cli/chunks/skills-QNO6GDJB.js +50 -0
  166. package/dist-cli/chunks/{state-RUVM4Z4S.js → state-OGUCSUC3.js} +2 -2
  167. package/dist-cli/chunks/{storage-GQ33UTYN.js → storage-TG7KFQZ3.js} +2 -2
  168. package/dist-cli/chunks/store-ZYMQW2LN.js +4 -0
  169. package/dist-cli/chunks/telemetry-7CSLUUIW.js +4 -0
  170. package/dist-cli/chunks/timeline-R4G5P335.js +24 -0
  171. package/dist-cli/chunks/{upgrade-AZDZLUIT.js → upgrade-RDTXJ6O3.js} +2 -2
  172. package/dist-cli/chunks/upload-PLF2DPMS.js +4 -0
  173. package/dist-cli/chunks/{version-N3ALB75G.js → version-GU2NUZDS.js} +2 -2
  174. package/dist-cli/chunks/{web-XPHFZATA.js → web-7PUVG3GE.js} +2 -2
  175. package/dist-cli/chunks/welcome-4GGUV7FY.js +5 -0
  176. package/dist-cli/chunks/what-happened-OHAAX6F6.js +25 -0
  177. package/dist-cli/chunks/{ws-bridge-RUXOYOU6.js → ws-bridge-Z3O35MNF.js} +2 -2
  178. package/dist-lib/agent-daemon-client.cjs +1 -1
  179. package/dist-lib/agent-events.cjs +1 -1
  180. package/dist-lib/agent-identity.cjs +1 -1
  181. package/dist-lib/agent-sessions.cjs +1 -1
  182. package/dist-lib/attached-projects.cjs +1 -1
  183. package/dist-lib/auth/shared-session.cjs +1 -1
  184. package/dist-lib/backend-origin.cjs +1 -1
  185. package/dist-lib/beta.cjs +1 -1
  186. package/dist-lib/beta.mjs +1 -1
  187. package/dist-lib/bridge-constants.cjs +1 -1
  188. package/dist-lib/bridge-contract-input.cjs +1 -1
  189. package/dist-lib/bridge-contract-input.mjs +1 -1
  190. package/dist-lib/bridge-contract.cjs +1 -1
  191. package/dist-lib/bridge-contract.mjs +1 -1
  192. package/dist-lib/cli-constants.cjs +1 -1
  193. package/dist-lib/config.cjs +1 -1
  194. package/dist-lib/detox/index.cjs +1 -1
  195. package/dist-lib/dev-bundle-resolution.cjs +69 -34
  196. package/dist-lib/home-paths.cjs +1 -1
  197. package/dist-lib/host/bridge-host.cjs +430 -106
  198. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  199. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  200. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  201. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  202. package/dist-lib/host/websocket-proxy.cjs +1 -1
  203. package/dist-lib/index.cjs +1 -1
  204. package/dist-lib/jump-to-source-babel.cjs +1 -1
  205. package/dist-lib/menu.cjs +1 -1
  206. package/dist-lib/menu.mjs +1 -1
  207. package/dist-lib/metro-production-bundle.cjs +1 -1
  208. package/dist-lib/metro-production-bundle.mjs +1 -1
  209. package/dist-lib/metro.cjs +1 -1
  210. package/dist-lib/profiles.cjs +1 -1
  211. package/dist-lib/public-brand.cjs +1 -1
  212. package/dist-lib/react-native-host-modules.cjs +2 -1
  213. package/dist-lib/react-native-host-modules.mjs +2 -1
  214. package/dist-lib/render-mode.cjs +1 -1
  215. package/dist-lib/scripts/dev-server-scanner.cjs +149 -93
  216. package/dist-lib/sdk.cjs +1 -1
  217. package/dist-lib/sdk.mjs +1 -1
  218. package/dist-lib/skills.cjs +757 -353
  219. package/dist-lib/vite.cjs +1 -1
  220. package/package.json +1 -1
  221. package/scripts/dev-server-scanner.ts +275 -92
  222. package/src/dev-bundle-resolution.ts +123 -40
  223. package/src/host/bridge-host.ts +11 -0
  224. package/src/host/plane-host.ts +203 -0
  225. package/src/react-native-host-modules.ts +1 -0
  226. package/dist-cli/chunks/app-fonts-66V7TL26.js +0 -4
  227. package/dist-cli/chunks/auth-3FMWUVJH.js +0 -12
  228. package/dist-cli/chunks/chunk-3NLB5LCN.js +0 -28
  229. package/dist-cli/chunks/chunk-5RWUFIZW.js +0 -24
  230. package/dist-cli/chunks/chunk-COXCR6UU.js +0 -7
  231. package/dist-cli/chunks/chunk-JH5KE2OI.js +0 -4
  232. package/dist-cli/chunks/chunk-ROISJKH3.js +0 -99
  233. package/dist-cli/chunks/chunk-SUHAD6N2.js +0 -30
  234. package/dist-cli/chunks/chunk-TIB3CTRX.js +0 -497
  235. package/dist-cli/chunks/chunk-YFZLDFZK.js +0 -74
  236. package/dist-cli/chunks/cli-version-MJWLDXBW.js +0 -4
  237. package/dist-cli/chunks/config-WK7467KI.js +0 -13
  238. package/dist-cli/chunks/control-ESI7IZNN.js +0 -4
  239. package/dist-cli/chunks/daemon-UCLO27YP.js +0 -4
  240. package/dist-cli/chunks/desktop-FF34Z5X4.js +0 -31
  241. package/dist-cli/chunks/detox-Q3CWY5UX.js +0 -52
  242. package/dist-cli/chunks/device-WN4ZWLES.js +0 -18
  243. package/dist-cli/chunks/drivers-OR2JPAXD.js +0 -4
  244. package/dist-cli/chunks/flow-4GWW5DYT.js +0 -4
  245. package/dist-cli/chunks/help-MIIWOT3C.js +0 -4
  246. package/dist-cli/chunks/inspect-3ZGNJENJ.js +0 -4
  247. package/dist-cli/chunks/install-desktop-BYOJVTLS.js +0 -4
  248. package/dist-cli/chunks/login-GNIFSAFE.js +0 -26
  249. package/dist-cli/chunks/mode-YVMX7OJY.js +0 -26
  250. package/dist-cli/chunks/privacy-EDC7PF7G.js +0 -4
  251. package/dist-cli/chunks/record-N4KTTVDI.js +0 -72
  252. package/dist-cli/chunks/report-issue-PP752HAD.js +0 -29
  253. package/dist-cli/chunks/reset-DRMKGVP4.js +0 -4
  254. package/dist-cli/chunks/resolve-target-7WWI32R3.js +0 -4
  255. package/dist-cli/chunks/runtime-EKJV2ZVI.js +0 -4
  256. package/dist-cli/chunks/screenshot-layers-GOCJVM2G.js +0 -20
  257. package/dist-cli/chunks/screenshots-capture-YYJLYA3V.js +0 -42
  258. package/dist-cli/chunks/setup-FVPVIYE4.js +0 -4
  259. package/dist-cli/chunks/skills-V5TE57FN.js +0 -50
  260. package/dist-cli/chunks/store-IKNBDDKM.js +0 -4
  261. package/dist-cli/chunks/telemetry-2ZVU6WLK.js +0 -4
  262. package/dist-cli/chunks/timeline-LP7DMJYT.js +0 -24
  263. package/dist-cli/chunks/upload-DFQK2Q7X.js +0 -4
  264. package/dist-cli/chunks/welcome-2NFYLWLJ.js +0 -5
  265. package/dist-cli/chunks/what-happened-EJ5PHKT7.js +0 -25
package/cli/auth.ts CHANGED
@@ -9,6 +9,7 @@
9
9
  // callers wanting an auth header: `authHeaderOrExit('upload')`.
10
10
 
11
11
  import { readSharedDesktopAuthSession } from '../src/auth/shared-session'
12
+ import { rnxExit } from './run-rnx'
12
13
 
13
14
  export type CliApiKeyEnvName = 'RNX_API_KEY' | 'SOOTSIM_API_KEY'
14
15
 
@@ -151,5 +152,5 @@ export function authHeaderOrExit(commandLabel: string): {
151
152
  ` • run \`rnx login\` to sign in with your GH account\n` +
152
153
  ` • set RNX_API_KEY=sk_rnx_... (recommended for CI)\n\n`,
153
154
  )
154
- process.exit(1)
155
+ rnxExit(1)
155
156
  }
package/cli/bin.ts CHANGED
@@ -8,6 +8,7 @@
8
8
 
9
9
  import { rnxPublicBrand } from '../src/public-brand'
10
10
  import { parseArgs, TOP_LEVEL_RUNTIME_COMMANDS } from './parse-args'
11
+ import { RnxExit } from './run-rnx'
11
12
 
12
13
  // `./help` is loaded lazily (only on help paths) — it statically pulls the full
13
14
  // CLI registry renderers and engine settings, which would otherwise add ~400ms
@@ -317,281 +318,290 @@ if (
317
318
  // is much harder to act on than this targeted message.
318
319
  exitIfStandaloneBlocked(command)
319
320
 
320
- if (TOP_LEVEL_RUNTIME_COMMANDS.has(command)) {
321
- if (command === 'do') {
322
- const { hasDoChain, runDoChain } = await import('./commands/do-chain')
323
- if (hasDoChain(commandArgsWithSim)) {
324
- await exitWithFlush(await runDoChain(commandArgsWithSim, { port }))
325
- }
326
- }
327
- const { runInspect } = await import('./commands/inspect')
328
- await runInspect([command, ...commandArgsWithSim], { port, verbose })
329
- } else {
330
- switch (command) {
331
- case 'assert': {
332
- // stays outside the usual dispatcher — it spawns self to get the
333
- // inner verb's --json payload, so it never needs the shared bridge
334
- // machinery that lives inside runInspect.
335
- const { runAssert } = await import('./commands/assert')
336
- await runAssert(parsed.commandArgs)
337
- break
338
- }
339
-
340
- case 'detox': {
341
- const { runDetox } = await import('./commands/detox')
342
- await runDetox(parsed.commandArgs, { port, verbose })
343
- break
344
- }
345
-
346
- case 'maestro': {
347
- const { runMaestro } = await import('./commands/maestro')
348
- // Maestro forwards playback argv to the shared runner, so it must
349
- // receive the global `--sim`. passing the bare
350
- // parsed.commandArgs dropped an explicit `sootsim --sim <id> maestro
351
- // …`, silently falling back to the current/saved sim (QA F21-4).
352
- const code = await runMaestro(commandArgsWithSim, { port, verbose })
353
- // bridge + dynamic imports leave handles open that keep node alive.
354
- await exitWithFlush(typeof code === 'number' ? code : 0)
355
- }
356
-
357
- case 'record': {
358
- const { runRecord } = await import('./commands/record')
359
- await runRecord(commandArgsWithSim, { port, verbose })
360
- break
361
- }
362
-
363
- case 'film': {
364
- const { runFilm } = await import('./commands/film')
365
- // film chains the flow runner, which opens ws bridges + dynamic
366
- // imports that keep node alive — exit explicitly like `flow` does.
367
- const code = await runFilm(commandArgsWithSim, { port, verbose })
368
- await exitWithFlush(typeof code === 'number' ? code : 0)
369
- }
370
-
371
- case 'storage': {
372
- const { runStorage } = await import('./commands/storage')
373
- const code = await runStorage(commandArgsWithSim, { port, verbose })
374
- await exitWithFlush(typeof code === 'number' ? code : 0)
375
- }
376
-
377
- case 'state': {
378
- const { runState } = await import('./commands/state')
379
- const code = await runState(commandArgsWithSim, { port })
380
- await exitWithFlush(code)
381
- }
382
-
383
- case 'reset': {
384
- const { runReset } = await import('./commands/reset')
385
- const code = await runReset(commandArgsWithSim, { port })
386
- await exitWithFlush(code)
387
- }
388
-
389
- case 'perf': {
390
- const { runPerf } = await import('./commands/perf')
391
- const code = await runPerf(commandArgsWithSim, { port, verbose })
392
- await exitWithFlush(typeof code === 'number' ? code : 0)
393
- }
394
-
395
- case 'screenshot': {
396
- const { runScreenshotCommand } = await import('./commands/screenshot-command')
397
- const code = await runScreenshotCommand(commandArgsWithSim, { port, verbose })
398
- await exitWithFlush(typeof code === 'number' ? code : 0)
399
- }
400
-
401
- case 'camera': {
402
- const { runCamera } = await import('./commands/camera')
403
- const code = await runCamera(commandArgsWithSim, { port })
404
- await exitWithFlush(typeof code === 'number' ? code : 0)
405
- }
406
-
407
- case 'mode': {
408
- const { runMode } = await import('./commands/mode')
409
- await runMode(commandArgsWithSim, { port, verbose })
410
- break
411
- }
412
-
413
- case 'permissions': {
414
- const { runPermissions } = await import('./commands/permissions')
415
- const code = await runPermissions(commandArgsWithSim, { port, verbose })
416
- await exitWithFlush(code)
417
- }
418
-
419
- case 'debug': {
420
- const { runDebug } = await import('./commands/debug')
421
- await runDebug(commandArgsWithSim, { port, verbose })
422
- break
423
- }
424
-
425
- case 'timeline': {
426
- const { runTimeline } = await import('./commands/timeline')
427
- await runTimeline(commandArgsWithSim, { port, verbose })
428
- break
429
- }
430
-
431
- case 'what-happened': {
432
- const { runWhatHappened } = await import('./commands/what-happened')
433
- await runWhatHappened(commandArgsWithSim, { port, verbose })
434
- break
435
- }
436
-
437
- case 'open': {
438
- const { runOpenCommand } = await import('./commands/control')
439
- await runOpenCommand(commandArgsWithSim, { port })
440
- break
441
- }
442
-
443
- case 'ios':
444
- case 'android': {
445
- const { runPlatformCommand } = await import('./commands/platform')
446
- const code = await runPlatformCommand(command, commandArgsWithSim, { port })
447
- await exitWithFlush(typeof code === 'number' ? code : 0)
448
- }
449
-
450
- case 'box': {
451
- const { runBox } = await import('./commands/box')
452
- await exitWithFlush(await runBox(commandArgsWithSim, { port, verbose }))
453
- }
454
-
455
- case 'use': {
456
- const { runUseCommand } = await import('./commands/control')
457
- await runUseCommand(commandArgsWithSim, { port })
458
- break
459
- }
460
-
461
- case 'claim': {
462
- const { runClaimCommand } = await import('./commands/control')
463
- await runClaimCommand(commandArgsWithSim, { port })
464
- break
465
- }
466
-
467
- case 'close': {
468
- const { runCloseCommand } = await import('./commands/control')
469
- await runCloseCommand(commandArgsWithSim, { port })
470
- break
471
- }
472
-
473
- case 'device': {
474
- const { runDeviceCommand } = await import('./commands/device')
475
- await runDeviceCommand(commandArgsWithSim, { port })
476
- break
477
- }
478
-
479
- case 'compat': {
480
- const { runCompat } = await import('./commands/compat')
481
- await runCompat(parsed.commandArgs)
482
- break
483
- }
484
-
485
- case 'report-issue': {
486
- const { runReportIssue } = await import('./commands/report-issue')
487
- const code = await runReportIssue(parsed.commandArgs)
488
- await exitWithFlush(code)
489
- }
490
-
491
- case 'desktop': {
492
- const { runDesktop } = await import('./commands/desktop')
493
- await runDesktop(parsed.commandArgs, { port, device })
494
- break
495
- }
496
-
497
- case 'login': {
498
- const { runLogin } = await import('./commands/login')
499
- await runLogin(parsed.commandArgs)
500
- break
501
- }
502
-
503
- case 'logout': {
504
- const { runLogout } = await import('./commands/logout')
505
- await runLogout()
506
- break
507
- }
508
-
509
- case 'auth': {
510
- const { runAuth } = await import('./commands/auth')
511
- await runAuth(parsed.commandArgs)
512
- break
513
- }
514
-
515
- case 'setup': {
516
- const { runSetup } = await import('./commands/setup')
517
- await runSetup(parsed.commandArgs)
518
- break
519
- }
520
-
521
- case 'serve': {
522
- const { runServe } = await import('./commands/serve')
523
- await runServe(parsed.commandArgs, { port })
524
- break
525
- }
526
-
527
- case 'daemon': {
528
- const { runDaemon } = await import('./commands/daemon')
529
- await runDaemon(parsed.commandArgs, { port })
530
- break
531
- }
532
-
533
- case 'runtime': {
534
- const { runRuntime } = await import('./commands/runtime')
535
- await runRuntime(parsed.commandArgs)
536
- break
537
- }
538
-
539
- case 'upgrade': {
540
- const { runUpgrade } = await import('./commands/upgrade')
541
- await runUpgrade(parsed.commandArgs)
542
- break
543
- }
544
-
545
- case 'version': {
546
- const { runVersion } = await import('./commands/version')
547
- await runVersion(parsed.commandArgs)
548
- break
549
- }
550
-
551
- case 'agent': {
552
- const { runAgentCommand } = await import('./commands/agent')
553
- const code = await runAgentCommand(parsed.commandArgs)
554
- await exitWithFlush(code)
555
- }
556
-
557
- case 'agent-wrapper': {
558
- const { runAgentWrapper } = await import('./commands/agent-wrapper')
559
- const code = await runAgentWrapper(parsed.commandArgs)
560
- await exitWithFlush(code)
561
- }
562
-
563
- case 'skill': {
564
- const { runSkill } = await import('./commands/skills')
565
- await runSkill(parsed.commandArgs)
566
- break
567
- }
568
-
569
- case 'app-fonts': {
570
- const { runAppFonts } = await import('./commands/app-fonts')
571
- await runAppFonts(parsed.commandArgs)
572
- break
573
- }
574
-
575
- case 'config': {
576
- const { runConfig } = await import('./commands/config')
577
- await runConfig(parsed.commandArgs)
578
- break
579
- }
580
-
581
- case 'cleanup': {
582
- const { runCleanup } = await import('./commands/cleanup')
583
- const code = await runCleanup(parsed.commandArgs)
584
- await exitWithFlush(code)
585
- }
586
-
587
- default: {
588
- console.error(` unknown command: ${command}`)
589
- console.error(
590
- ` run \`${rnxPublicBrand.commandName} --help\` to see the full surface.`,
591
- )
592
- await exitWithFlush(1)
321
+ // the command modules stop by throwing RnxExit rather than ending the
322
+ // process, because the same command has to run in a box shell and in
323
+ // workerd, where process.exit() cancels the whole request. this is the
324
+ // host boundary that turns it back into a real exit code.
325
+ try {
326
+ if (TOP_LEVEL_RUNTIME_COMMANDS.has(command)) {
327
+ if (command === 'do') {
328
+ const { hasDoChain, runDoChain } = await import('./commands/do-chain')
329
+ if (hasDoChain(commandArgsWithSim)) {
330
+ await exitWithFlush(await runDoChain(commandArgsWithSim, { port }))
331
+ }
332
+ }
333
+ const { runInspect } = await import('./commands/inspect')
334
+ await runInspect([command, ...commandArgsWithSim], { port, verbose })
335
+ } else {
336
+ switch (command) {
337
+ case 'assert': {
338
+ // stays outside the usual dispatcher — it spawns self to get the
339
+ // inner verb's --json payload, so it never needs the shared bridge
340
+ // machinery that lives inside runInspect.
341
+ const { runAssert } = await import('./commands/assert')
342
+ await runAssert(parsed.commandArgs)
343
+ break
344
+ }
345
+
346
+ case 'detox': {
347
+ const { runDetox } = await import('./commands/detox')
348
+ await runDetox(parsed.commandArgs, { port, verbose })
349
+ break
350
+ }
351
+
352
+ case 'maestro': {
353
+ const { runMaestro } = await import('./commands/maestro')
354
+ // Maestro forwards playback argv to the shared runner, so it must
355
+ // receive the global `--sim`. passing the bare
356
+ // parsed.commandArgs dropped an explicit `sootsim --sim <id> maestro
357
+ // …`, silently falling back to the current/saved sim (QA F21-4).
358
+ const code = await runMaestro(commandArgsWithSim, { port, verbose })
359
+ // bridge + dynamic imports leave handles open that keep node alive.
360
+ await exitWithFlush(typeof code === 'number' ? code : 0)
361
+ }
362
+
363
+ case 'record': {
364
+ const { runRecord } = await import('./commands/record')
365
+ await runRecord(commandArgsWithSim, { port, verbose })
366
+ break
367
+ }
368
+
369
+ case 'film': {
370
+ const { runFilm } = await import('./commands/film')
371
+ // film chains the flow runner, which opens ws bridges + dynamic
372
+ // imports that keep node alive — exit explicitly like `flow` does.
373
+ const code = await runFilm(commandArgsWithSim, { port, verbose })
374
+ await exitWithFlush(typeof code === 'number' ? code : 0)
375
+ }
376
+
377
+ case 'storage': {
378
+ const { runStorage } = await import('./commands/storage')
379
+ const code = await runStorage(commandArgsWithSim, { port, verbose })
380
+ await exitWithFlush(typeof code === 'number' ? code : 0)
381
+ }
382
+
383
+ case 'state': {
384
+ const { runState } = await import('./commands/state')
385
+ const code = await runState(commandArgsWithSim, { port })
386
+ await exitWithFlush(code)
387
+ }
388
+
389
+ case 'reset': {
390
+ const { runReset } = await import('./commands/reset')
391
+ const code = await runReset(commandArgsWithSim, { port })
392
+ await exitWithFlush(code)
393
+ }
394
+
395
+ case 'perf': {
396
+ const { runPerf } = await import('./commands/perf')
397
+ const code = await runPerf(commandArgsWithSim, { port, verbose })
398
+ await exitWithFlush(typeof code === 'number' ? code : 0)
399
+ }
400
+
401
+ case 'screenshot': {
402
+ const { runScreenshotCommand } = await import('./commands/screenshot-command')
403
+ const code = await runScreenshotCommand(commandArgsWithSim, { port, verbose })
404
+ await exitWithFlush(typeof code === 'number' ? code : 0)
405
+ }
406
+
407
+ case 'camera': {
408
+ const { runCamera } = await import('./commands/camera')
409
+ const code = await runCamera(commandArgsWithSim, { port })
410
+ await exitWithFlush(typeof code === 'number' ? code : 0)
411
+ }
412
+
413
+ case 'mode': {
414
+ const { runMode } = await import('./commands/mode')
415
+ await runMode(commandArgsWithSim, { port, verbose })
416
+ break
417
+ }
418
+
419
+ case 'permissions': {
420
+ const { runPermissions } = await import('./commands/permissions')
421
+ const code = await runPermissions(commandArgsWithSim, { port, verbose })
422
+ await exitWithFlush(code)
423
+ }
424
+
425
+ case 'debug': {
426
+ const { runDebug } = await import('./commands/debug')
427
+ await runDebug(commandArgsWithSim, { port, verbose })
428
+ break
429
+ }
430
+
431
+ case 'timeline': {
432
+ const { runTimeline } = await import('./commands/timeline')
433
+ await runTimeline(commandArgsWithSim, { port, verbose })
434
+ break
435
+ }
436
+
437
+ case 'what-happened': {
438
+ const { runWhatHappened } = await import('./commands/what-happened')
439
+ await runWhatHappened(commandArgsWithSim, { port, verbose })
440
+ break
441
+ }
442
+
443
+ case 'open': {
444
+ const { runOpenCommand } = await import('./commands/control')
445
+ await runOpenCommand(commandArgsWithSim, { port })
446
+ break
447
+ }
448
+
449
+ case 'ios':
450
+ case 'android': {
451
+ const { runPlatformCommand } = await import('./commands/platform')
452
+ const code = await runPlatformCommand(command, commandArgsWithSim, { port })
453
+ await exitWithFlush(typeof code === 'number' ? code : 0)
454
+ }
455
+
456
+ case 'box': {
457
+ const { runBox } = await import('./commands/box')
458
+ await exitWithFlush(await runBox(commandArgsWithSim, { port, verbose }))
459
+ }
460
+
461
+ case 'use': {
462
+ const { runUseCommand } = await import('./commands/control')
463
+ await runUseCommand(commandArgsWithSim, { port })
464
+ break
465
+ }
466
+
467
+ case 'claim': {
468
+ const { runClaimCommand } = await import('./commands/control')
469
+ await runClaimCommand(commandArgsWithSim, { port })
470
+ break
471
+ }
472
+
473
+ case 'close': {
474
+ const { runCloseCommand } = await import('./commands/control')
475
+ await runCloseCommand(commandArgsWithSim, { port })
476
+ break
477
+ }
478
+
479
+ case 'device': {
480
+ const { runDeviceCommand } = await import('./commands/device')
481
+ await runDeviceCommand(commandArgsWithSim, { port })
482
+ break
483
+ }
484
+
485
+ case 'compat': {
486
+ const { runCompat } = await import('./commands/compat')
487
+ await runCompat(parsed.commandArgs)
488
+ break
489
+ }
490
+
491
+ case 'report-issue': {
492
+ const { runReportIssue } = await import('./commands/report-issue')
493
+ const code = await runReportIssue(parsed.commandArgs)
494
+ await exitWithFlush(code)
495
+ }
496
+
497
+ case 'desktop': {
498
+ const { runDesktop } = await import('./commands/desktop')
499
+ await runDesktop(parsed.commandArgs, { port, device })
500
+ break
501
+ }
502
+
503
+ case 'login': {
504
+ const { runLogin } = await import('./commands/login')
505
+ await runLogin(parsed.commandArgs)
506
+ break
507
+ }
508
+
509
+ case 'logout': {
510
+ const { runLogout } = await import('./commands/logout')
511
+ await runLogout()
512
+ break
513
+ }
514
+
515
+ case 'auth': {
516
+ const { runAuth } = await import('./commands/auth')
517
+ await runAuth(parsed.commandArgs)
518
+ break
519
+ }
520
+
521
+ case 'setup': {
522
+ const { runSetup } = await import('./commands/setup')
523
+ await runSetup(parsed.commandArgs)
524
+ break
525
+ }
526
+
527
+ case 'serve': {
528
+ const { runServe } = await import('./commands/serve')
529
+ await runServe(parsed.commandArgs, { port })
530
+ break
531
+ }
532
+
533
+ case 'daemon': {
534
+ const { runDaemon } = await import('./commands/daemon')
535
+ await runDaemon(parsed.commandArgs, { port })
536
+ break
537
+ }
538
+
539
+ case 'runtime': {
540
+ const { runRuntime } = await import('./commands/runtime')
541
+ await runRuntime(parsed.commandArgs)
542
+ break
543
+ }
544
+
545
+ case 'upgrade': {
546
+ const { runUpgrade } = await import('./commands/upgrade')
547
+ await runUpgrade(parsed.commandArgs)
548
+ break
549
+ }
550
+
551
+ case 'version': {
552
+ const { runVersion } = await import('./commands/version')
553
+ await runVersion(parsed.commandArgs)
554
+ break
555
+ }
556
+
557
+ case 'agent': {
558
+ const { runAgentCommand } = await import('./commands/agent')
559
+ const code = await runAgentCommand(parsed.commandArgs)
560
+ await exitWithFlush(code)
561
+ }
562
+
563
+ case 'agent-wrapper': {
564
+ const { runAgentWrapper } = await import('./commands/agent-wrapper')
565
+ const code = await runAgentWrapper(parsed.commandArgs)
566
+ await exitWithFlush(code)
567
+ }
568
+
569
+ case 'skill': {
570
+ const { runSkill } = await import('./commands/skills')
571
+ await runSkill(parsed.commandArgs)
572
+ break
573
+ }
574
+
575
+ case 'app-fonts': {
576
+ const { runAppFonts } = await import('./commands/app-fonts')
577
+ await runAppFonts(parsed.commandArgs)
578
+ break
579
+ }
580
+
581
+ case 'config': {
582
+ const { runConfig } = await import('./commands/config')
583
+ await runConfig(parsed.commandArgs)
584
+ break
585
+ }
586
+
587
+ case 'cleanup': {
588
+ const { runCleanup } = await import('./commands/cleanup')
589
+ const code = await runCleanup(parsed.commandArgs)
590
+ await exitWithFlush(code)
591
+ }
592
+
593
+ default: {
594
+ console.error(` unknown command: ${command}`)
595
+ console.error(
596
+ ` run \`${rnxPublicBrand.commandName} --help\` to see the full surface.`,
597
+ )
598
+ await exitWithFlush(1)
599
+ }
593
600
  }
594
601
  }
602
+ } catch (error) {
603
+ if (error instanceof RnxExit) await exitWithFlush(error.code)
604
+ throw error
595
605
  }
596
606
 
597
607
  await scheduleAutomaticCleanup()
@@ -15,6 +15,7 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
15
15
  import { join } from 'node:path'
16
16
  import { gzipSync } from 'node:zlib'
17
17
  import { fetchAppFontFiles } from '../app-fonts'
18
+ import { rnxExit } from '../run-rnx'
18
19
 
19
20
  type ManifestEntry = {
20
21
  url: string
@@ -40,7 +41,7 @@ async function stage(args: string[]): Promise<void> {
40
41
  console.error(
41
42
  ' usage: rnx app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>',
42
43
  )
43
- process.exit(1)
44
+ rnxExit(1)
44
45
  }
45
46
  if (!wire.trim()) {
46
47
  console.log('no app fonts declared — nothing to stage')
@@ -94,5 +95,5 @@ export async function runAppFonts(args: string[]): Promise<void> {
94
95
  }
95
96
  console.error(` unknown app-fonts subcommand: ${sub ?? '(none)'}`)
96
97
  console.error(' available: stage')
97
- process.exit(1)
98
+ rnxExit(1)
98
99
  }