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
@@ -1,74 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{c as V}from"./chunk-FGGESBWD.js";import{P as j,R as M,g as F,j as I,s as U,t as D,u as O}from"./chunk-FBMNYSSW.js";import{a as H}from"./chunk-TAC4CEIX.js";import{a as k}from"./chunk-MXWME7ET.js";import{execFileSync as J,spawnSync as c}from"child_process";import{existsSync as s,mkdirSync as P,readFileSync as ae,realpathSync as le,rmSync as h,writeFileSync as X}from"fs";import{homedir as v}from"os";import{basename as ue,dirname as C,resolve as u,sep as Q}from"path";import{execFileSync as te}from"child_process";import{chmodSync as re,mkdirSync as A,rmSync as oe,writeFileSync as T}from"fs";import{dirname as _}from"path";var ne="dev.sootsim.daemon",Y="SootSim Daemon",G="0.1.36";function q(e,t,r){let n=D(),o=O(),a=_(_(o)),l=_(o),d=`${a}/Resources`;oe(n,{recursive:!0,force:!0}),A(U(),{recursive:!0}),A(l,{recursive:!0}),A(d,{recursive:!0}),T(`${a}/Info.plist`,se()),T(`${a}/PkgInfo`,"APPL????"),T(o,ie(e,t,r)),re(o,493);try{te("codesign",["--force","--sign","-","--deep",n],{stdio:"pipe"})}catch(i){let f=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${n} failed: ${f}
5
- the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:n,launcherPath:o}}function se(){return`<?xml version="1.0" encoding="UTF-8"?>
6
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
7
- <plist version="1.0">
8
- <dict>
9
- <key>CFBundleDevelopmentRegion</key><string>en</string>
10
- <key>CFBundleDisplayName</key><string>${Y}</string>
11
- <key>CFBundleExecutable</key><string>sootsim-daemon</string>
12
- <key>CFBundleIdentifier</key><string>${ne}</string>
13
- <key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
14
- <key>CFBundleName</key><string>${Y}</string>
15
- <key>CFBundlePackageType</key><string>APPL</string>
16
- <key>CFBundleShortVersionString</key><string>${G}</string>
17
- <key>CFBundleSignature</key><string>????</string>
18
- <key>CFBundleVersion</key><string>${G}</string>
19
- <key>LSBackgroundOnly</key><true/>
20
- <key>LSUIElement</key><true/>
21
- <key>LSMinimumSystemVersion</key><string>13.0</string>
22
- <key>NSHumanReadableCopyright</key><string>Tamagui LLC</string>
23
- </dict>
24
- </plist>
25
- `}function ie(e,t,r){let o=[e.executable,...e.prefixArgs,"serve","--quiet","--port",String(t)].map(N).join(" "),a=N(r.stdout),l=N(r.stderr);return`#!/bin/sh
26
- # sootsim daemon launcher generated by 'rnx daemon install'.
27
- # launchd spawns this; we exec the real rnx invocation in place so
28
- # launchd tracks the daemon process, not the shell wrapper.
29
- #
30
- # stdout: ${r.stdout}
31
- # stderr: ${r.stderr}
32
- # a missing or broken executable can make launchd retry forever. truncate a
33
- # retry log before it passes 10 MiB so that failure stays bounded on disk.
34
- for log_path in ${a} ${l}; do
35
- if [ -f "$log_path" ]; then
36
- log_bytes=$(wc -c < "$log_path" 2>/dev/null || echo 0)
37
- if [ "$log_bytes" -gt 10485760 ]; then
38
- : > "$log_path"
39
- fi
40
- fi
41
- done
42
- exec ${o}
43
- `}function N(e){return`'${e.replace(/'/g,"'\\''")}'`}var Z=60,y="dev.sootsim.daemon",B="dev.sootsim.server",g="sootsim-daemon",m=u(v(),"Library/Logs/sootsim"),L=u(v(),".local/state/sootsim");async function qe(e,t={}){let[r,...n]=e,o=t.port??7668;if(!r||r==="--help"||r==="-h"){W();return}switch(r){case"install":return ke({port:o,force:n.includes("--force")});case"uninstall":return we();case"status":return De();case"restart":return Le();case"start":return Pe();case"stop":return Ee();case"logs":return Ie(n);default:console.error(` unknown daemon subcommand: ${r}`),W(),process.exit(1)}}function W(){V("daemon")}function de(){let e=pe();if(e)return e;let t=fe();return{executable:process.execPath,prefixArgs:[t]}}function pe(){if(!ge())return null;let e=me();if(!e)return null;let t=H(),r=t==="0.0.0"?k.packageName:`${k.packageName}@${t}`;return{executable:process.execPath,prefixArgs:[e,"exec","--yes","--package",r,"--",k.commandName]}}function ge(){let e=process.argv[1];return process.env.npm_command==="exec"?!0:e?E(e).includes(`${Q}_npx${Q}`):!1}function me(){try{let t=J("which",["npm"],{encoding:"utf8"}).trim();if(t&&s(t))return K(t)}catch{}let e=process.env.npm_execpath;return e&&s(e)?K(e):null}function K(e){let t=E(e);if(ue(t)==="npx-cli.js"){let r=u(C(t),"npm-cli.js");if(s(r))return r}return t}function fe(){try{let t=J("which",[k.commandName],{encoding:"utf8"}).trim();if(t&&s(t))return E(t)}catch{}let e=process.argv[1];if(e&&s(e))return E(e);throw new Error(`could not locate the ${k.commandName} binary`)}function E(e){try{return le(e)}catch{return e}}function he(e,t){P(m,{recursive:!0});let r=u(m,"bridge.out.log"),n=u(m,"bridge.err.log"),{launcherPath:o}=q(e,t,{stdout:r,stderr:n}),a=` <string>${$e(o)}</string>`;return`<?xml version="1.0" encoding="UTF-8"?>
44
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
45
- <plist version="1.0">
46
- <dict>
47
- <key>Label</key><string>${y}</string>
48
- <key>ProgramArguments</key>
49
- <array>
50
- ${a}
51
- </array>
52
- <key>RunAtLoad</key><true/>
53
- <key>KeepAlive</key><true/>
54
- <key>ThrottleInterval</key><integer>${Z}</integer>
55
- <key>ProcessType</key><string>Background</string>
56
- <key>StandardOutPath</key><string>${r}</string>
57
- <key>StandardErrorPath</key><string>${n}</string>
58
- </dict>
59
- </plist>
60
- `}function ye(e,t){return P(L,{recursive:!0}),`[Unit]
61
- Description=rnx bridge daemon
62
- After=default.target
63
-
64
- [Service]
65
- Type=simple
66
- ExecStart=${[e.executable,...e.prefixArgs].map(xe).join(" ")} serve --quiet --port ${t}
67
- Restart=always
68
- RestartSec=${Z}
69
-
70
- [Install]
71
- WantedBy=default.target
72
- `}function $e(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function xe(e){return/[^\w@%+=:,./-]/.test(e)?`'${e.replace(/'/g,"'\\''")}'`:e}function $(){return u(v(),"Library/LaunchAgents",`${y}.plist`)}function be(e=v()){return u(e,"Library/LaunchAgents",`${B}.plist`)}function x(){return u(v(),".config/systemd/user",`${g}.service`)}function Xe(){if(I())return{supported:!1,installed:!1};if(process.platform==="darwin"){let e=$();return{supported:!0,installed:s(e),path:e}}if(process.platform==="linux"){let e=x();return{supported:!0,installed:s(e),path:e}}return{supported:!1,installed:!1}}async function ke({port:e,force:t}){if(I())throw new Error("background daemon setup is unavailable in this environment");let r=de();if(console.log(` binary: ${[r.executable,...r.prefixArgs].join(" ")}`),console.log(` port: ${e}`),process.platform==="darwin"){ee().missing||console.log(` removed legacy ${B} service`);let o=$();if(s(o)&&!t){console.log(` already installed at ${o}`),console.log(" pass --force to overwrite, or use 'rnx daemon restart' to reload");return}P(C(o),{recursive:!0}),X(o,he(r,e)),console.log(` wrote ${o}`);let a=`gui/${process.getuid()}`,l=`${a}/${y}`,d=()=>{let p=c("launchctl",["bootstrap",a,o],{stdio:"pipe",encoding:"utf8"}),w=(p.stderr||p.stdout||"").trim();if(p.status!==0)return{ok:!1,reason:`bootstrap exit ${p.status}${w?`: ${w}`:""}`};let R=c("launchctl",["print",l],{encoding:"utf8"});return R.status!==0?{ok:!1,reason:`bootstrap returned 0 but service not registered (print exit ${R.status})`}:{ok:!0}},i=d();if(!i.ok){let p=i.reason;if(c("launchctl",["bootout",l],{stdio:"ignore"}),i=d(),!i.ok)throw new Error(`launchctl bootstrap failed: ${i.reason}`+(p!==i.reason?` (initial: ${p})`:"")+" \u2014 try `rnx daemon uninstall` then retry, or reboot if launchd state is stuck.")}let f=Date.now()+4e3,b,S;for(;Date.now()<f;){let p=c("launchctl",["print",l],{encoding:"utf8"});if(p.status===0&&(b=p.stdout?.match(/state\s*=\s*(\w+)/)?.[1],S=p.stdout?.match(/pid\s*=\s*(\d+)/)?.[1],b==="running"||S))break;await new Promise(w=>setTimeout(w,150))}if(b!=="running"&&!S)throw new Error(`daemon registered but did not reach running state within 4s (last state: ${b||"unknown"}). check ${u(m,"bridge.err.log")} \u2014 typically a stale runtime or a port already bound by another process.`);console.log(` registered (state: ${b||"unknown"}${S?`, pid ${S}`:""}, log: ${u(m,"bridge.err.log")})`);return}if(process.platform==="linux"){let n=x();if(s(n)&&!t){console.log(` already installed at ${n}`),console.log(" pass --force to overwrite, or use 'rnx daemon restart' to reload");return}P(C(n),{recursive:!0}),X(n,ye(r,e)),console.log(` wrote ${n}`);let o=c("systemctl",["--user","daemon-reload"],{stdio:"pipe",encoding:"utf8"});if(o.status!==0){let i=(o.stderr||o.stdout||"").trim();throw new Error(`systemctl daemon-reload failed${i?`: ${i}`:""}`)}let a=c("systemctl",["--user","enable","--now",g],{stdio:"pipe",encoding:"utf8"});if(a.status!==0){let i=(a.stderr||a.stdout||"").trim();throw new Error(`systemctl enable --now failed${i?`: ${i}`:""} \u2014 try \`rnx daemon uninstall\` then retry.`)}let d=(c("systemctl",["--user","is-active",g],{encoding:"utf8"}).stdout||"").trim()||"unknown";console.log(` registered (state: ${d}, journalctl --user -u ${g} to tail logs)`);try{let i=process.env.USER||process.env.LOGNAME||"";if(i){let f=c("loginctl",["show-user",i,"--property=Linger","--value"],{encoding:"utf8"});!((f.stdout||"").trim().toLowerCase()==="yes")&&f.status===0&&console.log(` note: linger is not enabled for "${i}". the daemon will exit at logout.
73
- enable persistence with: sudo loginctl enable-linger ${i}`)}}catch{}return}console.error(` background daemon is not supported on ${process.platform}`),console.error(" run 'rnx serve' in a persistent shell instead"),process.exit(1)}function ee(e={}){let t=e.userHome??v(),r=be(t),n=u(t,"Library/Logs/sootsim"),o=[];if(s(r)){let a=`${e.launchTarget??`gui/${process.getuid?.()??0}`}/${B}`;(e.bootout??(d=>{c("launchctl",["bootout",d],{stdio:"ignore"})}))(a),h(r,{force:!0}),o.push(r)}for(let a of["server.err.log","server.out.log"]){let l=u(n,a);s(l)&&(h(l,{force:!0}),o.push(l))}return{removed:o,missing:o.length===0}}function ve(){let e=[];if(process.platform==="darwin"){let t=ee();e.push(...t.removed);let r=$();s(r)&&(c("launchctl",["bootout",`gui/${process.getuid()}/${y}`],{stdio:"ignore"}),h(r,{force:!0}),e.push(r));let n=D();return s(n)&&(h(n,{recursive:!0,force:!0}),e.push(n)),s(m)&&(h(m,{recursive:!0,force:!0}),e.push(m)),{removed:e,missing:e.length===0}}if(process.platform==="linux"){let t=x();return s(t)&&(c("systemctl",["--user","disable","--now",g],{stdio:"ignore"}),h(t,{force:!0}),c("systemctl",["--user","daemon-reload"],{stdio:"ignore"}),c("systemctl",["--user","reset-failed",g],{stdio:"ignore"}),e.push(t)),s(L)&&(h(L,{recursive:!0,force:!0}),e.push(L)),{removed:e,missing:e.length===0}}return{removed:e,missing:!0}}function Se(){let e=[],t=F();return s(t)&&(h(t,{recursive:!0,force:!0}),e.push(t)),{removed:e,missing:e.length===0}}async function we(){let e=ve();for(let r of e.removed)console.log(` removed ${r}`);let t=Se();for(let r of t.removed)console.log(` removed ${r}`);e.missing&&t.missing&&console.log(" not installed")}function z(){let e=j();if(M(e)){console.log(` bridge: responding on port ${e.bridgePort} (pid ${e.pid})`);return}console.log(e?" bridge: NOT responding \u2014 stale lockfile; check `rnx daemon logs`":" bridge: NOT responding \u2014 no lockfile; check `rnx daemon logs`")}async function De(){if(process.platform==="darwin"){let e=$();if(!s(e)){console.log(" installed: no");return}console.log(` installed: yes (${e})`);let t=Ae(e);t&&console.log(` binary: ${t}`);let r=c("launchctl",["print",`gui/${process.getuid()}/${y}`],{encoding:"utf8"});if(r.status===0){let n=r.stdout.match(/state\s*=\s*(\w+)/)?.[1],o=r.stdout.match(/pid\s*=\s*(\d+)/)?.[1];console.log(` state: ${n||"unknown"}${o?` (pid ${o})`:""}`)}else console.log(" state: not running");z();return}if(process.platform==="linux"){let e=x();if(!s(e)){console.log(" installed: no");return}console.log(` installed: yes (${e})`);let t=c("systemctl",["--user","is-active",g],{encoding:"utf8"});console.log(` state: ${t.stdout.trim()||"unknown"}`),z();return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Le(){if(process.platform==="darwin"){let e=$();s(e)||(console.error(" daemon not registered. run `rnx daemon install`"),process.exit(1));let t=c("launchctl",["kickstart","-k",`gui/${process.getuid()}/${y}`],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` kickstart failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}if(process.platform==="linux"){let e=x();s(e)||(console.error(" daemon not registered. run `rnx daemon install`"),process.exit(1));let t=c("systemctl",["--user","restart",g],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` restart failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Pe(){if(process.platform==="darwin"){let e=$();s(e)||(console.error(" daemon not registered. run `rnx daemon install`"),process.exit(1));let t=c("launchctl",["kickstart",`gui/${process.getuid()}/${y}`],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` start failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" started");return}if(process.platform==="linux"){let e=x();s(e)||(console.error(" daemon not registered. run `rnx daemon install`"),process.exit(1));let t=c("systemctl",["--user","start",g],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` start failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" started");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Ee(){if(process.platform==="darwin"){let e=$();s(e)||(console.error(" daemon not registered \u2014 nothing to stop"),process.exit(1));let t=c("launchctl",["bootout",`gui/${process.getuid()}/${y}`],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` stop failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" stopped");return}if(process.platform==="linux"){let e=x();s(e)||(console.error(" daemon not registered \u2014 nothing to stop"),process.exit(1));let t=c("systemctl",["--user","stop",g],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` stop failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" stopped");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Ie(e){let t=e.find(o=>/^-n\d+$|^--lines=\d+$|^\d+$/.test(o)),r=t?Number(t.replace(/\D/g,"")):200,n=e.includes("-f")||e.includes("--follow");if(process.platform==="darwin"){let o=u(m,"bridge.out.log"),a=u(m,"bridge.err.log"),l=[o,a].filter(i=>s(i));l.length===0&&(console.error(` no daemon logs yet at ${m}. run \`rnx daemon install\``),process.exit(1));let d=n?["-n",String(r),"-F",...l]:["-n",String(r),...l];c("tail",d,{stdio:"inherit"});return}if(process.platform==="linux"){let o=`${g}.service`,a=["--user","-u",o,"-n",String(r),"--no-pager"],l=c("journalctl",n?[...a,"-f"]:a,{encoding:"utf8",stdio:n?"inherit":"pipe"});if(n)return;let d=`${l.stdout||""}${l.stderr||""}`,i=/insufficient permissions|No journal files were opened/i.test(d);if(l.status===0&&!i){process.stdout.write(l.stdout||"");return}let f=c("journalctl",[`_SYSTEMD_USER_UNIT=${o}`,"-n",String(r),"--no-pager"],{encoding:"utf8"});if(f.status===0&&(f.stdout||"").trim()){process.stdout.write(f.stdout);return}console.error(` could not read --user journal for ${o} (this user isn't in the systemd-journal group yet).
74
- run: sudo journalctl _SYSTEMD_USER_UNIT=${o} -n ${r} --no-pager`),process.exit(1)}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}function Ae(e){try{return ae(e,"utf8").match(/<array>\s*<string>([^<]+)<\/string>/)?.[1]||null}catch{return null}}export{qe as a,Xe as b,ke as c,ee as d,ve as e,Se as f};
@@ -1,4 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{a}from"./chunk-TAC4CEIX.js";import"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";export{a as getCliVersion};
@@ -1,13 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{F as t,G as r,z as s}from"./chunk-FBMNYSSW.js";import"./chunk-DKSZZABN.js";function l(){let e=t(),n=e.configured&&e.productAnalytics;console.log(` bounded diagnostics are ${n?"ON":"OFF"}`),console.log(" permitted fields: package name/version/unsupported API or error class"),console.log(` config: ${s()}`);let o=process.env.DO_NOT_TRACK;(o==="1"||o==="true")&&console.log(` note: DO_NOT_TRACK=${o} is set \u2014 telemetry is off for this run`)}async function i(e){let n=e.find(o=>!o.startsWith("-"))?.toLowerCase();switch(n){case void 0:case"status":l();return;case"on":r({productAnalytics:!0,crashReports:!1}),console.log(" bounded diagnostics ON"),console.log(` config: ${s()}`);return;case"off":r({productAnalytics:!1,crashReports:!1}),console.log(" bounded diagnostics OFF"),console.log(` config: ${s()}`);return;default:console.error(` unknown telemetry action: ${n}`),console.error(" usage: rnx config telemetry [on|off|status]"),process.exit(1)}}function c(){console.log(`
5
- rnx config \u2014 manage local CLI preferences
6
-
7
- usage:
8
- rnx config telemetry [on|off|status]
9
-
10
- environment:
11
- SOOTSIM_HINTS=off suppress CLI hints
12
- SOOTSIM_HINTS=always show every CLI hint every time
13
- `)}async function d(e){if(e.includes("--help")||e.includes("-h")){c();return}let n=e.find(o=>!o.startsWith("-"));if(n==="telemetry"){let o=e.indexOf(n);await i([...e.slice(0,o),...e.slice(o+1)]);return}console.error(` unknown config command: ${n??"(missing)"}`),c(),process.exit(1)}export{d as runConfig};
@@ -1,4 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w}from"./chunk-COXCR6UU.js";import"./chunk-OROUEG22.js";import"./chunk-QE5MC4V3.js";import"./chunk-X3PEDNLV.js";import"./chunk-RYGQ6LZN.js";import"./chunk-AKJYEX54.js";import"./chunk-UDXQCEJU.js";import"./chunk-EKAEEWC2.js";import"./chunk-2APXX4RN.js";import"./chunk-A56GQVNF.js";import"./chunk-D6MGELKZ.js";import"./chunk-3454VMHD.js";import"./chunk-JLOOLA47.js";import"./chunk-USHV3QFZ.js";import"./chunk-UQJY6O72.js";import"./chunk-6F3WOWFC.js";import"./chunk-F4OTMARL.js";import"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-FHRG772G.js";import"./chunk-IYPMULI7.js";import"./chunk-A72MIIJI.js";import"./chunk-FBMNYSSW.js";import"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";export{d as applyRuntimeGenerationOrigin,h as buildOpenUrl,g as buildShellUrl,u as closeSimsBulk,b as ensureBridgeForOpen,v as planBulkCloseTargets,m as playwrightHostPidForSim,j as printConnectedSims,c as resolveBundleTarget,e as resolveDefaultShellBaseUrl,a as resolveDriverConnectWaitOptions,f as resolveShellBaseUrlForBridgePort,t as runClaimCommand,w as runCloseCommand,s as runFocusCommand,p as runLinkCommand,q as runOpenCommand,r as runUseCommand,n as signalDriverLaunchConnected,i as summarizeSimUrl,o as terminatePlaywrightHostsForSims,k as waitForSimMatch,l as waitForSimMatchOrHostExit};
@@ -1,4 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{a,b,c,d,e,f}from"./chunk-YFZLDFZK.js";import"./chunk-FGGESBWD.js";import"./chunk-CCI3DZKE.js";import"./chunk-N5KDDGV6.js";import"./chunk-45X3D6CI.js";import"./chunk-6F3WOWFC.js";import"./chunk-F4OTMARL.js";import"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-5QFJFASW.js";import"./chunk-FBMNYSSW.js";import"./chunk-TAC4CEIX.js";import"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";export{c as daemonInstall,b as getDaemonServiceStatus,a as runDaemon,e as teardownDaemonService,d as teardownLegacyMacDaemonArtifacts,f as teardownSootsimHome};
@@ -1,31 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import"./chunk-CZ2HCNRK.js";import{a as f}from"./chunk-2PVVIPQS.js";import{a as d}from"./chunk-5RWUFIZW.js";import{g as u}from"./chunk-COXCR6UU.js";import"./chunk-OROUEG22.js";import"./chunk-QE5MC4V3.js";import{a}from"./chunk-X3PEDNLV.js";import{c}from"./chunk-RYGQ6LZN.js";import"./chunk-AKJYEX54.js";import"./chunk-UDXQCEJU.js";import{a as p}from"./chunk-EKAEEWC2.js";import"./chunk-2APXX4RN.js";import"./chunk-A56GQVNF.js";import"./chunk-D6MGELKZ.js";import"./chunk-3454VMHD.js";import"./chunk-JLOOLA47.js";import"./chunk-USHV3QFZ.js";import"./chunk-UQJY6O72.js";import"./chunk-6F3WOWFC.js";import"./chunk-F4OTMARL.js";import"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-FHRG772G.js";import"./chunk-IYPMULI7.js";import{i as l}from"./chunk-WGE2P25F.js";import"./chunk-A72MIIJI.js";import"./chunk-FBMNYSSW.js";import"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";function k(e){let t=e.indexOf("--port");if(t<0)return;let o=e[t+1],n=o?Number(o):Number.NaN;return(!Number.isInteger(n)||n<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),n}async function v(e,t){let o=k(e)??t.port;return o?u(String(o)):void 0}async function m(e,t){(e.includes("--help")||e.includes("-h"))&&(console.log(`
5
- rnx desktop \u2014 launch the desktop companion
6
-
7
- usage:
8
- rnx desktop [options]
9
-
10
- options:
11
- --port <number> connect to running dev server on this port
12
- --profile <id> launch with an isolated persistent storage profile
13
- --ephemeral launch with a temporary isolated storage profile
14
-
15
- examples:
16
- rnx desktop
17
- rnx desktop --port 5173
18
- rnx desktop --profile qa
19
- `),process.exit(0));let o=e.find((g,s)=>e[s-1]==="--profile"),n=e.includes("--ephemeral");o&&n&&(console.error(" rnx desktop: --profile cannot be combined with --ephemeral"),process.exit(1));let h=o?c(o).id:void 0,r=p();if(!r){if(f(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await l("run rnx desktop install now?",!0)){console.log();let{runInstallDesktop:s}=await import("./install-desktop-BYOJVTLS.js");await s(["--yes"]),r=p()}r||process.exit(1)}console.log(` launching ${r.path}`);let x=await v(e,t),i=await a.launch({url:x,device:t.device,profileId:h,ephemeralProfile:n});i.launched||(console.error(` ${i.message}`),process.exit(1)),console.log(` ${i.message}`)}function w(){console.log(`
20
- rnx desktop \u2014 launch or install the desktop companion
21
-
22
- usage:
23
- rnx desktop [options]
24
- rnx desktop install [options]
25
-
26
- options:
27
- --port <number> connect to a running dev server on this port
28
- --profile <id> launch with an isolated persistent storage profile
29
- --ephemeral launch with a temporary isolated storage profile
30
- -y, --yes install without prompting
31
- `)}async function T(e,t){if(e.includes("--help")||e.includes("-h")){w();return}let o=e.find(n=>!n.startsWith("-"));if(o==="install"){let n=e.indexOf(o);await d([...e.slice(0,n),...e.slice(n+1)]);return}await m(e,t)}export{T as runDesktop};
@@ -1,52 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{f as J}from"./chunk-WUR4FXWT.js";import"./chunk-SSBZA5VZ.js";import"./chunk-3NLB5LCN.js";import"./chunk-TIB3CTRX.js";import"./chunk-2PVVIPQS.js";import"./chunk-ZNNE5MAV.js";import"./chunk-YLNSLMQM.js";import{c as N,d as $,e as k}from"./chunk-ROISJKH3.js";import{a as E}from"./chunk-JH5KE2OI.js";import"./chunk-ZW6JXEVX.js";import"./chunk-TTUZ5MCK.js";import"./chunk-YPBDPVLR.js";import"./chunk-COXCR6UU.js";import"./chunk-OROUEG22.js";import"./chunk-QE5MC4V3.js";import"./chunk-X3PEDNLV.js";import"./chunk-RYGQ6LZN.js";import"./chunk-AKJYEX54.js";import"./chunk-UDXQCEJU.js";import"./chunk-EKAEEWC2.js";import"./chunk-2APXX4RN.js";import"./chunk-A56GQVNF.js";import"./chunk-D6MGELKZ.js";import"./chunk-3454VMHD.js";import"./chunk-JLOOLA47.js";import"./chunk-USHV3QFZ.js";import"./chunk-UQJY6O72.js";import"./chunk-N5KDDGV6.js";import"./chunk-6F3WOWFC.js";import"./chunk-F4OTMARL.js";import"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-VGJLCFSC.js";import"./chunk-B5NW4TT3.js";import"./chunk-5QFJFASW.js";import"./chunk-FHRG772G.js";import"./chunk-IYPMULI7.js";import"./chunk-A72MIIJI.js";import"./chunk-FBMNYSSW.js";import{a as M}from"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";import{spawn as q}from"child_process";import{existsSync as g,mkdirSync as H,readFileSync as V,writeFileSync as y,unlinkSync as A}from"fs";import{createRequire as z}from"module";import{tmpdir as U}from"os";import{dirname as K,resolve as c,join as w,relative as Q}from"path";function X(){try{let t=import.meta.resolve(`${M.packageName}/detox`);return K(t.startsWith("file://")?t.slice(7):t)}catch{return c(import.meta.dirname,"..","..","detox")}}var Y=`
5
- rnx detox \u2014 run detox-style tests against an rnx shell
6
-
7
- usage:
8
- rnx detox [testFiles...] run all tests under e2e/, test/e2e/, or detox/
9
- rnx detox --config <path> use a specific jest config
10
- rnx detox init scaffold sootsim-detox.config.cjs + sample test
11
- rnx detox --watch jest watch mode
12
- rnx detox --headed keep the rnx shell window visible
13
- rnx detox -t <pattern> pass a jest --testNamePattern
14
- rnx detox --no-launch skip auto-launching an rnx shell
15
-
16
- rnx detox auto-launches an rnx shell if none is running on the
17
- expected port. disable with --no-launch if you're managing the shell yourself.
18
- `;async function fe(t,o={}){if((t.includes("--help")||t.includes("-h"))&&(console.log(Y),process.exit(0)),t[0]==="init")return se();let l=e=>{let s=t.indexOf(e);return s>=0?t[s+1]:void 0},n=e=>t.includes(e),u=n("--watch"),f=n("--headed"),d=n("--no-launch"),T=l("--config"),m=o.port||Number(process.env.SOOTSIM_PORT)||5173,C=t.filter((e,s)=>{if(e.startsWith("--")||e==="-t"||e==="-h")return!1;let i=t[s-1];return!(i==="--config"||i==="-t"||i==="--testNamePattern"||i==="--grep"||i==="--maxWorkers"||i==="--shard")}),L=t.flatMap((e,s)=>e==="--runInBand"||e.startsWith("--maxWorkers=")||e.startsWith("--shard=")?[e]:(e==="--maxWorkers"||e==="--shard")&&t[s+1]?[e,t[s+1]]:[]),I=["e2e","test/e2e","detox"],a=process.env.SOOTSIM_TEST_DIR?c(process.cwd(),process.env.SOOTSIM_TEST_DIR):null;if(!a)for(let e of I){let s=c(process.cwd(),e);if(g(s)){a=s;break}}a||(console.error(` error: no detox tests found. expected one of: ${I.join(", ")}
19
- run 'rnx detox init' to scaffold a starter suite.`),process.exit(1)),d||await te(m);let r=["jest"],x=T||ee(["sootsim-detox.config.cjs","jest.config.cjs","jest.config.js"]),p=null;if(x)r.push("--config",c(process.cwd(),x));else{let e=c(X(),"jest-preset.cjs");p=w(U(),`sootsim-detox-${process.pid}.config.cjs`);let s={rootDir:a,roots:["<rootDir>"],testMatch:["<rootDir>/**/*.test.ts","<rootDir>/**/*.test.js"]};y(p,`module.exports = { ...require(${JSON.stringify(e)}), ...${JSON.stringify(s)} }
20
- `),r.push("--config",p)}u&&r.push("--watch");let j=l("-t")||l("--testNamePattern")||l("--grep");j&&r.push("-t",j);let v=E(),b=!u&&N({uploadedShare:!1,auth:v}),h=process.env.SOOTSIM_JEST_OUTPUT_FILE||null;process.env.SOOTSIM_JEST_JSON==="1"&&r.push("--json"),process.env.SOOTSIM_JEST_OUTPUT_FILE?r.push("--outputFile",process.env.SOOTSIM_JEST_OUTPUT_FILE):b&&(h=w(U(),`sootsim-detox-results-${process.pid}.json`),r.push("--json","--outputFile",h)),r.push(...L),r.push(...C),console.log(" rnx detox"),console.log(` test dir: ${a}`),console.log(` port: ${m}${f?" (headed)":""}`),x&&console.log(` config: ${x}`);let R=process.env.CONFORMANCE_PROOF==="1"||!!process.env.CONFORMANCE_PROOF_DIR,W=R?"node":"npx",G=R?["--no-maglev",z(w(process.cwd(),"package.json")).resolve("jest/bin/jest"),...r.slice(1)]:r,S=q(W,G,{cwd:process.cwd(),stdio:"inherit",env:{...process.env,SOOTSIM_TEST_DIR:a,SOOTSIM_PORT:String(m),SOOTSIM_HEADED:f?"1":"",SOOTSIM_URL:process.env.SOOTSIM_URL||`http://localhost:${m}`}}),_=e=>()=>{S.kill(e)},F=_("SIGTERM"),P=_("SIGINT");process.on("SIGTERM",F),process.on("SIGINT",P);let B=Date.now(),O=await new Promise((e,s)=>{S.once("error",s),S.once("exit",(i,D)=>{if(D){console.error(` error: jest terminated by ${D}`),e(1);return}e(i??1)})});if(process.off("SIGTERM",F),process.off("SIGINT",P),p)try{A(p)}catch{}if(b){let e=h?Z(h):null,s=await k(),i=await $({origin:s,kind:"detox",name:Q(process.cwd(),a)||"e2e",status:O===0?"passed":"failed",summary:e?`${e.numPassedTests}/${e.numTotalTests} tests passed`:null,failureMessage:O===0?null:e?.firstFailure??null,stepCount:e?.numTotalTests??null,failedStepIndex:e?.firstFailedIndex??null,durationMs:Date.now()-B,auth:v});i&&console.log(` run: ${i.id}`)}process.exit(O)}function Z(t){try{let o=JSON.parse(V(t,"utf8")),l=null,n=null,u=0;for(let f of o.testResults??[])for(let d of f.testResults??[]){if(n==null&&d.status==="failed"){n=u;let T=d.failureMessages?.[0]?.split(`
21
- `)[0];l=[d.fullName,T].filter(Boolean).join(": ")||null}u+=1}return typeof o.numTotalTests!="number"?null:{numTotalTests:o.numTotalTests,numPassedTests:o.numPassedTests??0,firstFailure:l,firstFailedIndex:n}}catch{return null}finally{if(!process.env.SOOTSIM_JEST_OUTPUT_FILE)try{A(t)}catch{}}}function ee(t){for(let o of t)if(g(c(process.cwd(),o)))return o;return null}async function te(t){await J()||console.warn(` warn: no rnx shell reachable on :${t}. start your app, then run \`rnx open <app-port>\`
22
- or pass --no-launch if you're managing the shell yourself.`)}function se(){let t=process.cwd(),o=c(t,"sootsim-detox.config.cjs");g(o)?console.log(` skip: ${o} already exists`):(y(o,`// rnx detox jest config.
23
- // extends the sootsim preset, which rewrites \`import ... from 'detox'\`
24
- // to the sootsim driver and keeps your jest transforms intact.
25
-
26
- /** @type {import('@jest/types').Config.InitialOptions} */
27
- module.exports = {
28
- preset: 'rnxsim/detox/jest-preset',
29
- rootDir: __dirname,
30
- testMatch: ['<rootDir>/e2e/**/*.test.ts', '<rootDir>/e2e/**/*.test.js'],
31
- }
32
- `),console.log(` created ${o}`));let l=c(t,"e2e"),n=c(l,"example.test.ts");g(n)?console.log(` skip: ${n} already exists`):(H(l,{recursive:!0}),y(n,`// sample rnx detox test. resolve \`detox\` via the jest preset in
33
- // sootsim-detox.config.cjs \u2014 no extra imports required.
34
-
35
- import { by, device, element, expect, waitFor } from 'detox'
36
-
37
- describe('example', () => {
38
- beforeAll(async () => {
39
- await device.launchApp()
40
- })
41
-
42
- it('shows the welcome text', async () => {
43
- await waitFor(element(by.text('Welcome'))).toBeVisible().withTimeout(5000)
44
- })
45
-
46
- it('taps a button by id', async () => {
47
- await element(by.id('start-button')).tap()
48
- await expect(element(by.id('home-screen'))).toBeVisible()
49
- })
50
- })
51
- `),console.log(` created ${n}`)),console.log(`
52
- next:`),console.log(" rnx detox # run the sample"),console.log(" rnx detox --watch"),process.exit(0)}export{fe as runDetox};
@@ -1,18 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import"./chunk-QE5MC4V3.js";import"./chunk-3454VMHD.js";import"./chunk-6F3WOWFC.js";import{b as c,d as s,e as m}from"./chunk-F4OTMARL.js";import{t as d,v as l,y as a}from"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-FBMNYSSW.js";import"./chunk-DKSZZABN.js";function h(){console.log(`
5
- rnx device \u2014 inspect or change the live device preset for a sim
6
-
7
- usage:
8
- rnx device
9
- rnx device get
10
- rnx device set <model> [--sim <id>]
11
- rnx device list
12
-
13
- examples:
14
- rnx device
15
- rnx device set iphone-14
16
- rnx device set iphone-16-pro-max --sim a7
17
- `)}function v(n){let t=s(n);console.log(` ${n.padEnd(14)} ${String(t.width).padStart(4)}x${String(t.height).padEnd(4)} pt ${String(t.width*t.scale).padStart(4)}x${String(t.height*t.scale).padEnd(4)} px ${t.name}`)}async function u(n){let t=l(n);try{let o=await a(t,"SootSim.bridges.settings.get")??{deviceModel:null},i=typeof o.deviceModel=="string"?o.deviceModel:null;if(!i||!(i in c))return null;let e=s(i);return{model:i,width:e.width,height:e.height,scale:e.scale,name:e.name}}finally{t.close()}}async function $(n,t){(n.includes("--help")||n.includes("-h"))&&(h(),process.exit(0));let o=n[0];if(!o||o==="get"){let i=d(n,{port:t.port}),e=await u(i);e||(console.error(" error: could not read current device from the target sim"),process.exit(1)),console.log(` ${e.model} ${e.width}x${e.height} pt ${e.width*e.scale}x${e.height*e.scale} px ${e.name}`);return}if(o==="list"){console.log(` available devices:
18
- `);for(let i of m())v(i);return}if(o==="set"){let i=n[1];i||(console.error(" error: device set expects a model"),process.exit(1)),i in c||(console.error(` error: unknown device "${i}"`),console.error(" run `rnx device list` to see valid models"),process.exit(1));let e=d(n,{port:t.port}),p=l(e);try{let g=await a(p,"SootSim.bridges.settings.set","deviceModel",i),r=s(i);console.log(` ${g?"set":"kept"} device: ${i} (${r.width}x${r.height} pt, ${r.width*r.scale}x${r.height*r.scale} px)${g?" \u2014 reloading sim":""}`)}finally{p.close()}return}h(),console.error(` unknown subcommand: ${o}`),process.exit(1)}export{$ as runDeviceCommand};
@@ -1,4 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import"./chunk-CZ2HCNRK.js";import{a,b,c,d,e,f,g}from"./chunk-X3PEDNLV.js";import"./chunk-RYGQ6LZN.js";import"./chunk-EKAEEWC2.js";import"./chunk-ZEF57HQO.js";import"./chunk-FHRG772G.js";import"./chunk-FBMNYSSW.js";import"./chunk-DKSZZABN.js";export{c as ALL_DRIVERS,g as buildDriverListRows,a as electronDriver,d as getAllDrivers,e as getDriver,b as playwrightDriver,f as resolveDriver};
@@ -1,4 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{c,d,e,f,g,h,i}from"./chunk-WUR4FXWT.js";import"./chunk-SSBZA5VZ.js";import"./chunk-3NLB5LCN.js";import{a,b}from"./chunk-TIB3CTRX.js";import"./chunk-2PVVIPQS.js";import"./chunk-ZNNE5MAV.js";import"./chunk-YLNSLMQM.js";import"./chunk-ROISJKH3.js";import"./chunk-JH5KE2OI.js";import"./chunk-ZW6JXEVX.js";import"./chunk-TTUZ5MCK.js";import"./chunk-YPBDPVLR.js";import"./chunk-COXCR6UU.js";import"./chunk-OROUEG22.js";import"./chunk-QE5MC4V3.js";import"./chunk-X3PEDNLV.js";import"./chunk-RYGQ6LZN.js";import"./chunk-AKJYEX54.js";import"./chunk-UDXQCEJU.js";import"./chunk-EKAEEWC2.js";import"./chunk-2APXX4RN.js";import"./chunk-A56GQVNF.js";import"./chunk-D6MGELKZ.js";import"./chunk-3454VMHD.js";import"./chunk-JLOOLA47.js";import"./chunk-USHV3QFZ.js";import"./chunk-UQJY6O72.js";import"./chunk-N5KDDGV6.js";import"./chunk-6F3WOWFC.js";import"./chunk-F4OTMARL.js";import"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-VGJLCFSC.js";import"./chunk-B5NW4TT3.js";import"./chunk-5QFJFASW.js";import"./chunk-FHRG772G.js";import"./chunk-IYPMULI7.js";import"./chunk-A72MIIJI.js";import"./chunk-FBMNYSSW.js";import"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";export{f as discoverSootsimUrl,c as getLastFlowPreviewUploadResult,d as getLastFlowTraceSteps,h as hoistLeadingSimFlag,a as parseFlowFile,e as resolveAppFrontmatterTarget,g as runFlowPlayback,i as runMaestroAuthoring,b as validateFlowFile};
@@ -1,4 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{a,b,c}from"./chunk-FGGESBWD.js";import"./chunk-CCI3DZKE.js";import"./chunk-N5KDDGV6.js";import"./chunk-45X3D6CI.js";import"./chunk-6F3WOWFC.js";import"./chunk-F4OTMARL.js";import"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-5QFJFASW.js";import"./chunk-FBMNYSSW.js";import"./chunk-TAC4CEIX.js";import"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
@@ -1,4 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{g as a,h as b}from"./chunk-TIB3CTRX.js";import"./chunk-2PVVIPQS.js";import"./chunk-ZNNE5MAV.js";import"./chunk-YLNSLMQM.js";import"./chunk-TTUZ5MCK.js";import"./chunk-YPBDPVLR.js";import"./chunk-COXCR6UU.js";import"./chunk-OROUEG22.js";import"./chunk-QE5MC4V3.js";import"./chunk-X3PEDNLV.js";import"./chunk-RYGQ6LZN.js";import"./chunk-AKJYEX54.js";import"./chunk-UDXQCEJU.js";import"./chunk-EKAEEWC2.js";import"./chunk-2APXX4RN.js";import"./chunk-A56GQVNF.js";import"./chunk-D6MGELKZ.js";import"./chunk-3454VMHD.js";import"./chunk-JLOOLA47.js";import"./chunk-USHV3QFZ.js";import"./chunk-UQJY6O72.js";import"./chunk-N5KDDGV6.js";import"./chunk-6F3WOWFC.js";import"./chunk-F4OTMARL.js";import"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-VGJLCFSC.js";import"./chunk-B5NW4TT3.js";import"./chunk-5QFJFASW.js";import"./chunk-FHRG772G.js";import"./chunk-IYPMULI7.js";import"./chunk-A72MIIJI.js";import"./chunk-FBMNYSSW.js";import"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";export{a as printShellPerfReport,b as runInspect};
@@ -1,4 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{a}from"./chunk-5RWUFIZW.js";import"./chunk-EKAEEWC2.js";import"./chunk-WGE2P25F.js";import"./chunk-DKSZZABN.js";export{a as runInstallDesktop};
@@ -1,26 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{b as p,d as k}from"./chunk-ZW6JXEVX.js";import"./chunk-FBMNYSSW.js";import{a as b}from"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";import{exec as x}from"node:child_process";import{randomBytes as T}from"node:crypto";import R from"node:http";var w=process.env.SOOTSIM_AUTH_ORIGIN||"https://contrast.dev";function L(t){return t||(process.env.SOOTSIM_AUTH_ORIGIN?process.env.SOOTSIM_AUTH_ORIGIN:process.env.SOOTSIM_UPLOAD_ORIGIN?process.env.SOOTSIM_UPLOAD_ORIGIN:w)}function _(){console.log(`
5
- rnx login \u2014 sign in so uploads can attach to your account
6
-
7
- usage:
8
- rnx login [--origin <url>]
9
-
10
- options:
11
- --origin <url> auth host (default: ${w})
12
- override with SOOTSIM_AUTH_ORIGIN env var
13
- -h, --help
14
- `)}function P(t,e){let r=t.findIndex(g=>g===e);if(r<0)return;let l=t[r+1];return t.splice(r,2),l}function U(t){let e=process.platform==="darwin"?`open "${t}"`:process.platform==="win32"?`start "" "${t}"`:`xdg-open "${t}"`;x(e,r=>{r&&(console.log(" could not open browser automatically."),console.log(` open this URL manually:
15
- ${t}
16
- `))})}function d(t){return`<!doctype html>
17
- <html>
18
- <body style="font-family:system-ui;background:#000;color:#fff;display:flex;align-items:center;justify-content:center;height:100vh;margin:0">
19
- <div style="max-width:480px;text-align:center">
20
- <h1 style="font-size:28px;margin:0 0 12px">${b.name}</h1>
21
- <p style="color:#ccc">${t}</p>
22
- </div>
23
- </body>
24
- </html>`}async function A(t){try{let e=await fetch(`${t.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"local dev-login unavailable"};if(!e.ok){let l=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${l}`}}let r=await e.json();return r.token?{ok:!0,token:r.token,userId:r.user?.id,email:r.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function M(t){try{let e=new URL(t).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function C(t){(t.includes("--help")||t.includes("-h"))&&(_(),process.exit(0));let e=[...t],r=L(P(e,"--origin"));if(M(r)){console.log(` detected local origin (${r}) \u2014 signing in as dev user`);let o=await A(r);if(o.ok){p({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:r,source:"cli"});let u=await k(r),f=u?.user?.email||o.email||u?.user?.id||o.userId;console.log(` signed in${f?` as ${f}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let l=T(16).toString("hex"),g=300*1e3,s=await new Promise(o=>{let u,f=!1,c=a=>{f||(f=!0,clearTimeout(u),o(a),m.close())},m=R.createServer((a,n)=>{try{let i=new URL(a.url||"/","http://127.0.0.1"),O=i.searchParams.get("state"),y=i.searchParams.get("token"),S=i.searchParams.get("email")||void 0,$=i.searchParams.get("userId")||void 0,h=i.searchParams.get("error");if(O!==l){n.statusCode=404,n.end("not found");return}if(n.setHeader("content-type","text/html; charset=utf-8"),h){n.end(d(`sign-in failed: ${h}`)),c({ok:!1,error:h});return}if(!y){n.end(d("missing token. close this tab and retry `rnx login`.")),c({ok:!1,error:"missing token"});return}n.end(d("sign-in complete. you can return to the terminal.")),c({ok:!0,token:y,email:S,userId:$})}catch(i){n.statusCode=500,n.end(d("sign-in callback failed. retry `rnx login`.")),c({ok:!1,error:i instanceof Error?i.message:"callback failed"})}});u=setTimeout(()=>{c({ok:!1,error:"timed out waiting for the browser sign-in (5 minutes). rerun `rnx login` and complete the github authorize screen if it appears."})},g),m.listen(0,"127.0.0.1",()=>{let a=m.address();if(!a||typeof a=="string"){c({ok:!1,error:"failed to bind callback server"});return}let n=new URL(`${r.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",l),n.searchParams.set("port",String(a.port)),n.searchParams.set("contrast",r),console.log(" opening browser for rnx login..."),console.log(" first time here? github will show an authorize screen. approve it to continue."),console.log(" waiting up to 5 minutes for the browser (ctrl+c to cancel)"),console.log(` if nothing opens, visit:
25
- ${n.toString()}
26
- `),U(n.toString())})});s.ok||(console.error(` login failed: ${s.error}`),process.exit(1)),p({token:s.token,user:s.userId?{id:s.userId,email:s.email}:null,origin:r,source:"cli"});let I=await k(r),v=I?.user?.email||s.email||I?.user?.id||s.userId;console.log(` signed in${v?` as ${v}`:""}`)}export{C as runLogin};
@@ -1,26 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as r,b as s}from"./chunk-RV76U3EI.js";import"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-FBMNYSSW.js";import"./chunk-DKSZZABN.js";async function i(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
5
- rnx mode screenshot \u2014 toggle the screenshot-mode chrome overlay
6
-
7
- usage:
8
- rnx mode screenshot [on|off|toggle]
9
-
10
- arguments:
11
- on enable screenshot mode (enables showFrame if needed)
12
- off disable screenshot mode
13
- toggle flip the current state (default)
14
-
15
- examples:
16
- rnx mode screenshot
17
- rnx mode screenshot on
18
- rnx mode screenshot off
19
- `),process.exit(0)),await r(e,o,{modeKey:"screenshotMode",displayName:"screenshot-mode",actionId:"toggle-screenshot-mode"})}var c=new Set(["--sim","--port","-p"]),d=new Set(["screenshot","three"]);function m(e){for(let o=0;o<e.length;o++){let n=e[o];if(n.startsWith("-")){c.has(n)&&o++;continue}return d.has(n)?{name:n,index:o}:null}return null}function h(e,o){return[...e.slice(0,o),...e.slice(o+1)]}function l(){console.log(`
20
- rnx mode \u2014 toggle live display modes
21
-
22
- usage:
23
- rnx mode screenshot [on|off|toggle]
24
- rnx mode three [on|off|toggle]
25
- rnx mode three configure [options]
26
- `)}async function g(e,o){if(e.includes("--help")||e.includes("-h")){l();return}let n=m(e);n||(l(),process.exit(1));let t=h(e,n.index);if(n.name==="screenshot"){await i(t,o);return}await s(t,o)}export{g as runMode};
@@ -1,4 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{a,b,c}from"./chunk-V7I4CTAX.js";import"./chunk-WGE2P25F.js";import"./chunk-A72MIIJI.js";import"./chunk-FBMNYSSW.js";import"./chunk-DKSZZABN.js";export{a as canPromptForPrivacyChoice,b as diagnosticsAllowedForCurrentProcess,c as ensurePrivacyChoice};
@@ -1,72 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as W}from"./chunk-3NLB5LCN.js";import{a as oe}from"./chunk-ROISJKH3.js";import{a as Z,c as ee}from"./chunk-JH5KE2OI.js";import"./chunk-ZW6JXEVX.js";import{d as Y}from"./chunk-AKJYEX54.js";import"./chunk-UDXQCEJU.js";import"./chunk-JLOOLA47.js";import"./chunk-UQJY6O72.js";import{e as X,t as v,v as y,w as Q}from"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-FBMNYSSW.js";import"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";import{existsSync as he,mkdirSync as E,readdirSync as be,readFileSync as ve,rmSync as q,writeFileSync as I}from"fs";import{homedir as ye,tmpdir as Se}from"os";import{dirname as z,extname as re,join as F,resolve as $e}from"path";var J=24e4,Re=9e4,xe=3e4;async function D(e,r,o,i){let t=Math.max(2e4,i+xe);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
5
- the capture lock auto-releases, so simply retry the recording.
6
- if it persists, recover the sim with \`rnx close --sim <id>\`.`),process.exit(1)),/render host not available|already streaming|already recording|lock already held/i.test(s)&&(console.error(` ${o} failed: ${s}
7
- a prior recording was abandoned and its capture is still
8
- releasing. the lock self-heals in ~${Math.round((i+2e4)/1e3)}s \u2014 retry then, or recover now with
9
- \`rnx close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var _e=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),ke=new Set(["start","stop","cancel","status","prelude-start","upload"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){_e.has(o)&&r++;continue}return ke.has(o)?{name:o,index:r}:null}return null}function te(e){let r=u(e,"--owner")?.trim(),o=u(e,"--repo")?.trim();return(r&&!o||!r&&o)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),r&&o?{owner:r,repo:o}:null}async function He(e,r){let o=Oe(e);if(o){let d=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Te(d,r);return}if(o.name==="prelude-start"){await Ie(d,r);return}if(o.name==="upload"){let{runUpload:S}=await import("./upload-DFQK2Q7X.js");await S(d,r);return}if(o.name==="stop"){await Pe(d,r);return}if(o.name==="cancel"){await Ne(d,r);return}await Ae(d,r);return}let i=v(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open","--lockstep"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=se(u(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=u(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let c=u(e,"--output"),a=Number(u(e,"--duration")??"10");(!Number.isFinite(a)||a<=0)&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let l=600;a>l&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 exceeds the ${l}s (10m) maximum`),process.exit(1));let m=Number(u(e,"--fps")??"30"),p=u(e,"--frames");if(p!==void 0){let d=Number(p);(!Number.isInteger(d)||d<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let _=e.includes("--open"),k=u(e,"--max-width")?Number(u(e,"--max-width")):void 0;e.includes("--lockstep")&&(console.error(" --lockstep works with `record start` / `record stop` (stateful mode) \u2014 atomic --duration is wall-clock and cannot bound a virtual-time capture"),process.exit(1));let w=Math.max(100,Math.round(a*1e3)),K=u(e,"--origin"),fe=te(e);if(t==="live"||t==="combined"){c&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await W("record",{originOverride:K,allowGitHubAuth:!0});let d=y({...i,commandTimeoutMs:6e4});try{await H(d),await de(d,t),t==="combined"&&await B(d),await ce(d,K,fe);let S=await le(d,t,t==="combined"?n:void 0);S.ok||(console.error(` start failed: recording store refused to start (${t})`+(S.error?`: ${S.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(f=>setTimeout(f,w)),await ue(d);let O=await me(d);pe(O,_,t)}finally{d.close()}return}let A=p?Number(p):null,R=Be(s,c,A);_&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let b=y({...i,commandTimeoutMs:6e4});try{if(await ne(b),await B(b),R==="png"){let x=A??10,h=T(c,`sootsim-frames-${C()}`);c&&re(c)&&console.log(` note: --frames writes multiple pngs, so --output "${c}" is a directory \u2014 frame-NNN.png files land inside it`),E(h,{recursive:!0});for(let g of be(h))/^frame-\d+\.png$/.test(g)&&q(F(h,g),{force:!0});console.log(` sampling ${x} frames over ${a}s \u2192 ${h}`);let $=await b.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${x}, durationMs: ${w}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!$.ok||!$.requestId)&&(console.error(` frame capture start failed: ${$.error??"unknown error"}`),process.exit(1)),await new Promise(g=>setTimeout(g,w));let ge=Date.now()+Math.max(5e3,w),N=null;for(;;){let g=await b.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${$.requestId})`});if(g||(console.error(" frame capture result missing"),process.exit(1)),g.done){g.ok||(console.error(` frame capture failed: ${g.error??"unknown error"}`),process.exit(1)),N=g.frames??[];break}Date.now()>=ge&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(P=>setTimeout(P,100))}N.forEach((g,P)=>{let we=`${h}/frame-${String(P+1).padStart(3,"0")}.png`;I(we,Buffer.from(g.data,"base64"))}),console.log(` saved ${N.length} frames`);return}if(R==="gif"){let x=A??Math.max(10,Math.round(a*m/3)),h=T(c,`sootsim-${C()}.gif`);E(z(h),{recursive:!0}),console.log(` encoding gif: ${x} frames over ${a}s \u2192 ${h}`);let $=await D(b,`window.__sootsimRecorder.captureGif({ frames: ${x}, durationMs: ${w}${k?`, maxWidth: ${k}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",w);$||(console.error(" gif capture returned no frames"),process.exit(1)),I(h,Buffer.from($.data,"base64")),console.log(` saved: ${h} (${L($.size)})`);return}let d=T(c,`sootsim-${C()}.${R}`);E(z(d),{recursive:!0});let S={format:R,fps:m,durationMs:w};n&&(S.layers=n);let O=await D(b,`window.__sootsimRecorder.start(${JSON.stringify(S)})`,`${R} start`,w);O.ok||(console.error(` start failed: ${O.error??"unknown error"}`),/render host not available|already streaming|already recording|lock already held/i.test(O.error??"")&&console.error(" a prior recording was abandoned and its capture is still\n releasing. retry in ~20s, or recover now with\n `rnx close --sim <id>` then reopen the sim."),process.exit(1)),console.log(` recording ${R} for ${a}s \u2192 ${d}`),await new Promise(x=>setTimeout(x,w));let f=await D(b,"window.__sootsimRecorder.stop()",`${R} encode/flush`,w);f.ok||(console.error(` stop failed: ${f.error??"unknown error"}`),process.exit(1)),f.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await ie(b,d),console.log(` saved: ${d} (${L(f.size)})`),f.durationMs&&f.frameCount!==void 0&&console.log(` source frames: ${f.frameCount} over ${(f.durationMs/1e3).toFixed(2)}s (${(f.frameCount/(f.durationMs/1e3)).toFixed(1)}fps)`)}finally{b.close()}}var Me=6e3;async function V(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:Me})}catch(o){let i=o instanceof Error?o.message:String(o);throw/^command timed out after \d+s$/.test(i)&&(console.error(" sim did not respond \u2014 it is connected to the bridge but has not\n loaded an app (or its page is unresponsive). run `rnx list`\n and target a sim with a loaded app via --sim <id>."),process.exit(1)),o}}async function ne(e){await V(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is rnx engine running in this sim?"),process.exit(1))}async function B(e){let{hidden:r}=await Q(e);r&&(console.error(` refusing to record: the rnx tab is hidden, so frame capture
10
- would be throttled to ~1fps and produce a frozen-looking file.
11
- bring the chrome window to the foreground (un-minimize / switch to
12
- its tab) or run the recording in headless playwright, then retry.`),process.exit(1))}async function ie(e,r){let o=[],i=0;for(;;){let t=await e.send({type:"evaluate",code:`window.__sootsimRecorder.getBlobBase64({ offset: ${i}, chunk: 2097152 })`});if(!t)throw new Error("no blob available on recorder");if(o.push(Buffer.from(t.data,"base64")),i=t.offset,t.done)break}I(r,Buffer.concat(o))}function u(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function Ee(e){if(!e)return;let r=re(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function Be(e,r,o){return e||(o!=null?"png":Ee(r)??"webm")}function C(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function Ue(){let e=F(ye(),".sootsim","recordings");return E(e,{recursive:!0}),e}function T(e,r){return e?$e(process.cwd(),e):F(Ue(),r)}function L(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function se(e){if(!e)return"video";if(e==="video"||e==="live"||e==="combined")return e;console.error(` invalid --mode "${e}" \u2014 expected video | live | combined`),process.exit(1)}function G(){return F(Se(),`sootsim-recording-${X()}.json`)}function U(){let e=G();if(!he(e))return null;try{return{mode:"video",...JSON.parse(ve(e,"utf8"))}}catch{return q(e,{force:!0}),null}}function Ce(e){I(G(),JSON.stringify(e,null,2))}function M(){q(G(),{force:!0})}function j(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
13
- requested sim ${e}. record state is global (not per-sim);
14
- this command acts on that session regardless of --sim.`)}async function Te(e,r){let o=U();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`rnx record stop\` first, or \`rnx record cancel\` to discard.`),process.exit(1));let i=v(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--lockstep"],stripValueFlags:["--mode","--fps","--format","--max-width","--origin","--owner","--repo"]}),t=se(u(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=u(e,"--format"),c=s==="mp4"?"mp4":"webm";s&&c!==s&&(console.error(` record start only supports webm or mp4 (got: ${s}). for gif/png use atomic mode: rnx record --format ${s} --duration <s>`),process.exit(1));let a=Number(u(e,"--fps")??"30"),l=te(e),m=y({...i,commandTimeoutMs:t==="live"||t==="combined"?Re:15e3});try{if(t==="live"||t==="combined"){n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await W("record",{originOverride:u(e,"--origin"),allowGitHubAuth:!0}),await H(m),await de(m,t),t==="combined"&&await B(m),await ce(m,u(e,"--origin"),l);let p=await le(m,t,t==="combined"?n:void 0);p.ok||(console.error(` start failed: recording store refused to start (${t})`+(p.error?`: ${p.error}`:"")),process.exit(1))}else{await ne(m),await B(m);let p=e.includes("--lockstep");p&&c!=="mp4"&&(console.error(" --lockstep requires --format mp4 (webm is realtime-clocked)"),process.exit(1));let _={format:c,fps:a};n&&(_.layers=n),p&&(_.lockstep=!0);let k=await m.send({type:"evaluate",code:`window.__sootsimRecorder.start(${JSON.stringify(_)})`});k.ok||(console.error(` start failed: ${k.error??"unknown error"}`),process.exit(1))}Ce({simId:i.simId??null,mode:t,format:c,fps:a,layers:n,startedAt:new Date().toISOString()}),console.log(t==="video"?` recording ${c} @ ${a}fps${n?` (${n})`:""} \u2014 run \`rnx record stop --output <path>\` when done`:` recording ${t} \u2014 run \`rnx record stop\` when done (add --open to launch the preview URL)`)}finally{m.close()}}async function Ie(e,r){let o=U();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`rnx record stop\` first, or \`rnx record cancel\` to discard.`),process.exit(1));let i=v(e,{port:r.port,stripBooleanFlags:[],stripValueFlags:["--origin"]}),t=y({...i,commandTimeoutMs:15e3});try{if(await H(t),await B(t),!await t.send({type:"evaluate",code:`(() => {
15
- const start = window.SootSim?.bridges?.startRecordingPrelude
16
- if (typeof start !== 'function') return false
17
- return Promise.resolve(start()).then((value) => value === true)
18
- })()`})){let s=await t.send({type:"evaluate",code:`(() => {
19
- const getError = window.SootSim?.bridges?.getRecordingStartError
20
- return typeof getError === 'function' ? getError() : null
21
- })()`}).catch(()=>null);console.error(` prelude start failed: recording store refused to start${typeof s=="string"&&s?` (${s})`:""}`),process.exit(1)}console.log(" recording preview prelude \u2014 run `rnx record start --mode combined` when the visible proof segment is ready")}finally{t.close()}}async function ae(e){try{let r=await e.send({type:"evaluate",code:`(() => {
22
- const store = window.SootSim?.bridges?.getRecordingState?.();
23
- const headless = window.__sootsimRecorder?.state?.();
24
- const eventRecorder = window.SootSim?.bridges?.eventRecorder ?? window.__sootsimEventRecorder;
25
- const eventRecording =
26
- typeof eventRecorder?.isRecording === 'function'
27
- ? eventRecorder.isRecording() === true
28
- : false;
29
- return { store: store ? store.state : undefined, headless, eventRecording };
30
- })()`});return r?r.store==="recording"||r.headless==="recording"?"recording":r.store==="processing"?"processing":r.eventRecording?"prelude":r.store==="idle"||r.headless==="idle"?"idle":null:null}catch{return null}}async function Fe(e){let r=await e.send({type:"evaluate",code:`(() => {
31
- const store = window.SootSim?.bridges?.getRecordingState?.();
32
- const eventRecorder = window.SootSim?.bridges?.eventRecorder ?? window.__sootsimEventRecorder;
33
- const hadStoreRecording = store && store.state !== 'idle';
34
- const hadEventRecording =
35
- typeof eventRecorder?.isRecording === 'function'
36
- ? eventRecorder.isRecording() === true
37
- : false;
38
- const cancel = window.SootSim?.bridges?.cancelRecording;
39
- if (typeof cancel === 'function') cancel();
40
- return Boolean(hadStoreRecording || hadEventRecording);
41
- })()`}).catch(()=>!1),o=await e.send({type:"evaluate",code:`(async () => {
42
- const r = window.__sootsimRecorder;
43
- if (r && typeof r.forceRelease === 'function') return await r.forceRelease();
44
- return false;
45
- })()`}).catch(()=>!1);return{store:r,headless:o}}async function Ae(e,r){let o=U();if(o){j(v(e,{port:r.port}).simId,o),o.mode==="video"?console.log(` recording ${o.mode} (${o.format} @ ${o.fps}fps) on sim ${o.simId??"?"} since ${o.startedAt}`):console.log(` recording ${o.mode} on sim ${o.simId??"?"} since ${o.startedAt}`);return}let i=v(e,{port:r.port}),t=y({...i,commandTimeoutMs:8e3});try{let n=await ae(t);if(n==="recording"||n==="processing"||n==="prelude"){if(n==="prelude"){console.log(" a recording preview prelude is active. hidden setup is being\n captured for the next live/combined preview recording. finish\n it with `rnx record start --mode combined`, or discard it\n with `rnx record cancel`.");return}console.log(` a recording is in progress (engine state: ${n}), but not via
46
- \`record start\` \u2014 it was started by an atomic \`record --duration\`
47
- run or the in-browser record button, which own their own lifecycle.
48
- if that controlling run is still alive it will finish on its own
49
- (atomic \`--mode video/gif/png\` writes a local file from that
50
- process; live/combined upload to /preview/<id>). if the run was
51
- killed, the recording is abandoned and will NOT finish \u2014 reclaim
52
- it now with \`rnx record cancel\`, or it auto-reclaims when the
53
- abandoned capture's deadline lapses.`)}else console.log(" no recording in progress")}finally{t.close()}}async function Ne(e,r){let o=U();if(!o){let s=v(e,{port:r.port}),c=y({...s,commandTimeoutMs:8e3});try{let a=await ae(c);if(a==="recording"||a==="processing"||a==="prelude"){let l=await Fe(c);l.store&&a==="prelude"?console.log(" recording preview prelude cancelled"):l.store||l.headless?console.log(" reclaimed an abandoned recording (started by an atomic\n `record --duration` run or the record button whose owner is\n gone). the recorder is idle again \u2014 live/combined can start."):console.log(" a recording is in progress and still owned by a live atomic\n `record --duration` run or the in-browser record button \u2014 it\n will finish on its own and nothing was reclaimed.")}else console.log(" no recording in progress")}finally{c.close()}return}let i=v(e,{port:r.port});j(i.simId,o);let t=o.simId??i.simId??void 0,n=y({...i,simId:t,commandTimeoutMs:15e3});try{o.mode==="live"||o.mode==="combined"?await n.send({type:"evaluate",code:"void window.SootSim?.bridges?.cancelRecording?.()"}):await n.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"})}catch{}finally{M(),n.close()}console.log(" recording cancelled")}async function Pe(e,r){let o=U();o||(console.error(" no recording in progress. start one with `rnx record start`."),process.exit(1));let i=v(e,{port:r.port,stripBooleanFlags:["--open"],stripValueFlags:["--output"]});j(i.simId,o);let t=o.simId??i.simId??void 0,n=e.includes("--open"),s=y({...i,simId:t,commandTimeoutMs:o.mode==="live"||o.mode==="combined"?J:6e4});try{if(o.mode==="live"||o.mode==="combined"){await ue(s);let m=await me(s);M(),pe(m,n,o.mode);return}let c=u(e,"--output"),a=T(c,`sootsim-${C()}.${o.format}`);E(z(a),{recursive:!0});let l=await s.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"});l.ok||(console.error(` stop failed: ${l.error??"unknown error"}`),M(),process.exit(1)),l.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),M(),process.exit(1)),await ie(s,a),M(),console.log(` saved: ${a} (${L(l.size)})`),l.durationMs&&l.frameCount!==void 0&&console.log(` source frames: ${l.frameCount} over ${(l.durationMs/1e3).toFixed(2)}s (${(l.frameCount/(l.durationMs/1e3)).toFixed(1)}fps)`)}finally{s.close()}}async function H(e){await V(e,'typeof window.SootSim?.bridges?.startRecording === "function" && typeof window.SootSim?.bridges?.stopRecording === "function"')||(console.error(" SootSim.bridges.startRecording missing \u2014 is rnx engine running in this sim?"),process.exit(1))}async function de(e,r){await V(e,`(() => {
54
- const fn = window.__sootsimCaptureBundle
55
- if (typeof fn !== 'function') return false
56
- const snap = fn()
57
- return !!(snap && snap.bundleUrl)
58
- })()`)||(console.error(` --mode ${r} needs a guest app bundle to upload to /preview/<id>,
59
- but this sim has no bundle loaded (a built-in shell screen like
60
- photos/settings/home has none). open a metro/guest app first, or
61
- use \`--mode video\` for a local screen recording with no upload.`),process.exit(1))}async function ce(e,r,o){let i=Z();if(!i)return;let t=i.kind==="api-key"?i.secret:i.token,n=oe(),s={branch:n.branch??void 0,commitSha:n.commitSha??void 0,githubUsername:n.githubUsername??void 0,pullRequestNumber:n.pullRequestNumber??void 0,pullRequestTitle:n.pullRequestTitle??void 0},c=i.kind==="github"?{...ee(i),owner:o?.owner,repo:o?.repo,...s}:o?{owner:o.owner,repo:o.repo,...s}:null,a=r?r.replace(/\/$/,""):null;await e.send({type:"evaluate",code:`(() => {
62
- const set = window.SootSim && window.SootSim.bridges && window.SootSim.bridges.setSession
63
- if (typeof set !== 'function') return false
64
- set({ token: ${JSON.stringify(t)}, user: null })
65
- window.__sootsimPreviewUploadIdentity = ${JSON.stringify(c)}
66
- window.__sootsimPreviewUseInjectedBearer = true
67
- ${a?`window.__sootsimUploadOrigin = ${JSON.stringify(a)}`:"delete window.__sootsimUploadOrigin"}
68
- return true
69
- })()`})||(console.error(" SootSim.bridges.setSession missing \u2014 this sim is running an engine\n build without CLI-injected preview auth. reload the sim or open a\n fresh one (`rnx open --new`); if it persists, update rnx."),process.exit(1))}async function le(e,r,o){let i=o?JSON.stringify(o):"undefined";return await e.send({type:"evaluate",code:`window.SootSim.bridges.startRecording(${JSON.stringify(r)}, ${i}, { skipEntitlement: true })`})===!0?{ok:!0,error:null}:{ok:!1,error:await e.send({type:"evaluate",code:"(window.SootSim?.bridges?.getRecordingStartError?.() ?? null)"}).catch(()=>null)??null}}async function ue(e){await e.send({type:"evaluate",code:"void window.SootSim.bridges.stopRecording()"})}async function me(e){let r=Date.now()+J;for(;Date.now()<r;){let o=await e.send({type:"evaluate",code:"(() => { const s = window.SootSim?.bridges?.getRecordingState?.(); return s ? { state: s.state, lastUpload: s.lastUpload, uploadError: s.uploadError } : null })()"});if(o&&o.state==="idle"){if(o.uploadError)return{uploadError:o.uploadError};if(o.lastUpload?.previewUrl)return{previewUrl:o.lastUpload.previewUrl,eventCount:o.lastUpload.eventCount}}await new Promise(i=>setTimeout(i,300))}return{uploadError:`upload did not settle within ${J/1e3}s`}}function pe(e,r,o){e.uploadError&&(console.error(` upload failed: ${e.uploadError}`),process.exit(1)),e.previewUrl||(console.error(" upload returned no preview URL"),process.exit(1)),console.log(` preview: ${e.previewUrl}`),console.log(` note: this URL is content-addressed \u2014 re-recording the same bundle
70
- replaces this capture at the same /preview/<id>.`),(o==="live"||o==="combined")&&typeof e.eventCount=="number"&&console.log(` captured ${e.eventCount} event${e.eventCount===1?"":"s"}`),(o==="live"||o==="combined")&&e.eventCount===0&&console.log(o==="combined"?` note: this combined recording captured no events \u2014 the Live tab has
71
- nothing to replay. Video will play the captured screen recording.`:` note: this live recording captured no events \u2014 the preview has nothing
72
- to replay and will boot a fresh interactive session instead.`),r&&Y(e.previewUrl)}export{Ee as extToFormat,Be as resolveFormat,He as runRecord,u as valueOf};
@@ -1,29 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as m,b as f}from"./chunk-JH5KE2OI.js";import"./chunk-ZW6JXEVX.js";import{i as l}from"./chunk-WGE2P25F.js";import{M as p}from"./chunk-FBMNYSSW.js";import{a as d}from"./chunk-TAC4CEIX.js";import"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";import{existsSync as h,readFileSync as w}from"node:fs";import{resolve as b}from"node:path";var R="https://contrast.dev",g=8e3;function v(){return{request:(t,e)=>fetch(t,e),confirmSubmission:l,isInteractive:process.stdin.isTTY===!0,now:()=>new Date,stdout:t=>process.stdout.write(t),stderr:t=>process.stderr.write(t)}}function I(t,e){let n=t.indexOf(e);if(n===-1)return null;let r=t[n+1];if(!r||r.startsWith("-"))throw new Error(`${e} requires a value`);return r}function D(t,e=process.cwd()){let n=I(t,"--app"),r=new Set,s=t.indexOf("--app");s!==-1&&(r.add(s),r.add(s+1));let a=[];for(let c=0;c<t.length;c+=1){if(r.has(c))continue;let u=t[c];if(!(u==="--yes"||u==="-y"||u==="--dry-run")){if(u.startsWith("-"))throw new Error(`unknown flag: ${u}`);a.push(u)}}let i=a.join(" ").trim();if(!i)throw new Error("describe the missing or broken compatibility behavior");if(i.length>g)throw new Error(`description is too long (maximum ${g} characters)`);return{appDir:b(e,n??"."),description:i,dryRun:t.includes("--dry-run"),yes:t.includes("--yes")||t.includes("-y")}}function y(t){if(!t||typeof t!="object")return;let e={};for(let n of Object.keys(t)){let r=Object.getOwnPropertyDescriptor(t,n)?.value;typeof r=="string"&&(e[n]=r)}return e}function O(t){let e=b(t,"package.json");if(!h(e))return null;let n;try{n=JSON.parse(w(e,"utf8"))}catch{throw new Error(`could not parse ${e}`)}if(!n||typeof n!="object")throw new Error(`${e} must contain a JSON object`);let r=Object.getOwnPropertyDescriptor(n,"name")?.value,s=Object.getOwnPropertyDescriptor(n,"dependencies")?.value,a=Object.getOwnPropertyDescriptor(n,"devDependencies")?.value,i=y(s),c=y(a);return{...typeof r=="string"?{name:r}:{},...i?{dependencies:i}:{},...c?{devDependencies:c}:{}}}async function S(t,e=new Date){let n=O(t.appDir),r=n?(await import("./web-XPHFZATA.js")).scanDeps(n):null,s=d(),a=p();return{note:t.description,timestamp:e.toISOString(),sootsim_version:a,cli_version:s,bundle:{activeApp:r&&r.projectName!=="unknown"?{appName:r.projectName}:null,reportSource:"cli",runtimeVersion:a,cliVersion:s,platform:process.platform,arch:process.arch,compatibility:r}}}function $(){let t=m(),e=t?.kind==="session"?t.origin.replace(/\/+$/,""):R,n=t&&t.kind!=="github"?f(t):null;return{url:`${e}/api/sootsim/report-issue`,authorization:n}}function k(t){if(!t)return"no package.json found; no compatibility scan attached";let e=t.packages.filter(n=>n.status!=="full"&&n.status!=="not-relevant").length;return`${t.packages.length} React Native ecosystem packages, ${e} needing attention`}function P(t){if(!t||typeof t!="object")return null;let e=Object.getOwnPropertyDescriptor(t,"id")?.value;return typeof e=="string"&&e?e:null}async function V(t,e=v()){let n;try{n=D(t)}catch(o){return e.stderr(` ${o instanceof Error?o.message:String(o)}
5
- usage: rnx report-issue [--app <dir>] [--dry-run] [--yes] "<description>"
6
- `),1}if(!h(n.appDir))return e.stderr(` directory not found: ${n.appDir}
7
- `),1;let r;try{r=await S(n,e.now())}catch(o){return e.stderr(` could not prepare the issue report: ${o instanceof Error?o.message:String(o)}
8
- `),1}if(e.stdout(`
9
- rnx issue report preview
10
-
11
- description: ${r.note}
12
- compatibility: ${k(r.bundle.compatibility)}
13
- environment: CLI ${r.bundle.cliVersion}, runtime ${r.bundle.runtimeVersion??"not installed"}, ${r.bundle.platform}/${r.bundle.arch}
14
-
15
- Includes only the description, compatibility scan, and the version/platform details above.
16
- It does not include source files, environment variables, terminal output, logs, screenshots, or app data.
17
- `),n.dryRun)return e.stdout(`
18
- dry run: nothing was sent.
19
- `),0;if(!n.yes){if(!e.isInteractive)return e.stderr(`
20
- not sent: ask the user for explicit approval, then rerun with --yes.
21
- `),2;if(!await e.confirmSubmission("send this compatibility report to the rnx team?",!1))return e.stdout(`
22
- not sent.
23
- `),2}let s=$(),a={"content-type":"application/json"};s.authorization&&(a.authorization=s.authorization);let i;try{i=await e.request(s.url,{method:"POST",headers:a,body:JSON.stringify(r),signal:AbortSignal.timeout(15e3)})}catch(o){return e.stderr(` report failed: ${o instanceof Error?o.message:String(o)}
24
- `),1}if(!i.ok){let o=(await i.text().catch(()=>"")).slice(0,240);return e.stderr(` report failed: ${i.status} ${i.statusText}${o?` \u2014 ${o}`:""}
25
- `),1}let c=await i.json().catch(()=>null),u=P(c);return e.stdout(u?`
26
- sent. Report id: ${u}
27
- `:`
28
- sent. Thank you.
29
- `),0}export{S as createReportIssuePayload,D as parseReportIssueOptions,V as runReportIssue};
@@ -1,4 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{a}from"./chunk-DCPDMF27.js";import"./chunk-2APXX4RN.js";import"./chunk-D6MGELKZ.js";import"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-FBMNYSSW.js";import"./chunk-DKSZZABN.js";export{a as runReset};
@@ -1,4 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{a,b}from"./chunk-YPBDPVLR.js";import"./chunk-D6MGELKZ.js";import"./chunk-DKSZZABN.js";export{a as readTargetFlag,b as resolveTargetCoords};
@@ -1,4 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{c as a}from"./chunk-SUHAD6N2.js";import"./chunk-USHV3QFZ.js";import"./chunk-UQJY6O72.js";import"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-IYPMULI7.js";import"./chunk-FBMNYSSW.js";import"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";export{a as runRuntime};
@@ -1,20 +0,0 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import { createRequire as __sootsimCreateRequire } from 'node:module'
3
- var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as S}from"./chunk-ZNNE5MAV.js";import"./chunk-QE5MC4V3.js";import{o as b,p as I}from"./chunk-D6MGELKZ.js";import"./chunk-3454VMHD.js";import"./chunk-6F3WOWFC.js";import{b as m}from"./chunk-F4OTMARL.js";import{t as y,v,y as w}from"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-FBMNYSSW.js";import"./chunk-DKSZZABN.js";import{mkdirSync as B,writeFileSync as R}from"fs";import{resolve as f}from"path";async function L(s,$){(s.includes("--help")||s.includes("-h"))&&(console.log(`
5
- sootsim screenshot layers \u2014 export a screen as engine-isolated layers
6
-
7
- usage:
8
- sootsim screenshot layers --ids <testID,testID,...> [--out-dir <dir>]
9
-
10
- options:
11
- --ids <list> comma-separated testIDs of the subtrees to isolate
12
- --out-dir <dir> output directory (default: /tmp/sootsim-layers)
13
-
14
- output:
15
- full.png the normal frame
16
- base.png the frame re-rendered with every listed subtree hidden
17
- layer-<id>.png each subtree rendered alone on a transparent frame
18
- manifest.json device metrics + logical rect per layer
19
- `),process.exit(0));let u=s.find((r,n)=>s[n-1]==="--ids");u||(console.error(" --ids is required (comma-separated testIDs)"),process.exit(1));let i=u.split(",").map(r=>r.trim()).filter(Boolean);i.length===0&&(console.error(" --ids resolved to an empty list"),process.exit(1));let D=s.find((r,n)=>s[n-1]==="--out-dir"),c=f(process.cwd(),D??"/tmp/sootsim-layers"),M=y(s,{port:$.port,stripValueFlags:["--ids","--out-dir"]}),o=v({...M,commandTimeoutMs:45e3});try{let r=await I(o,9e4);if(!r.ready)throw new Error(`app not ready to capture after ${Math.round(r.elapsedMs/1e3)}s (${b(r)})`);let n={};for(let e of i){let t=await o.send({type:"evaluate",code:S({id:e})});if(!t)throw new Error(`no node with testID "${e}"`);n[e]=t}B(c,{recursive:!0});let l=(e,t)=>{if(typeof t!="string"||!t.startsWith("data:image/png;base64,"))throw new Error(`capture for ${e} returned no image data`);let h=f(c,e);R(h,Buffer.from(t.slice(22),"base64")),console.log(` saved: ${h}`)};l("full.png",await o.send({type:"screenshot"})),l("base.png",await o.send({type:"screenshot",captureFilter:{hideTestIds:i}}));for(let e of i)l(`layer-${e}.png`,await o.send({type:"screenshot",captureFilter:{soloTestId:e,hideTestIds:i.filter(t=>t!==e)}}));let p=await w(o,"SootSim.bridges.settings.get")??{deviceModel:null},a=typeof p.deviceModel=="string"&&p.deviceModel in m?p.deviceModel:null,d=a?m[a]:null,x={device:d?{model:a,width:d.width,height:d.height,scale:d.scale}:{model:a},layers:i.map(e=>({testId:e,rect:n[e]}))},g=f(c,"manifest.json");R(g,`${JSON.stringify(x,null,2)}
20
- `),console.log(` saved: ${g}`)}finally{o.close()}}export{L as runScreenshotLayers};