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,7 +1,7 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.371 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{f as b,m as C}from"./chunk-2APXX4RN.js";import{I as N,J as D,K as O,L as T,M as k}from"./chunk-D6MGELKZ.js";import{t as A,v as _,x as S}from"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-FBMNYSSW.js";import"./chunk-DKSZZABN.js";var B=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],F="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function R(){console.log(`
4
+ import{f as b,m as I}from"./chunk-2W4YBCPX.js";import{I as O,J as T,K as C,L as R,M as A}from"./chunk-BNS5LNEU.js";import{t as S,v as N,x as D}from"./chunk-ESWSXF55.js";import"./chunk-WLRIPAGJ.js";import{b as _,c as u}from"./chunk-ERBGQEJ5.js";import"./chunk-Y7SKGRAV.js";import"./chunk-OF5OBB67.js";var L=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],H="__sootsimShellAnimationTrace",z="__sootsimDebugAnimation";function E(){console.log(`
5
5
  rnx debug \u2014 drive __sootsimDebug from the terminal
6
6
 
7
7
  usage:
@@ -9,7 +9,7 @@ usage:
9
9
 
10
10
  subcommands:
11
11
  enable <channels> turn on one or more debug channels
12
- channels: ${B.slice(0,-1).join(", ")}
12
+ channels: ${L.slice(0,-1).join(", ")}
13
13
  or 'all' for every channel
14
14
  disable <channels> turn off one or more debug channels (or 'all')
15
15
  toggle <channel> flip a single channel
@@ -77,9 +77,9 @@ examples:
77
77
  rnx debug trace shell 120
78
78
  rnx debug trace anim on 3 240
79
79
  rnx debug trace anim 3 60
80
- `)}function I(t){return t?t.split(",").map(a=>a.trim()).filter(Boolean):[]}function i(t,a){return t===void 0?"":JSON.stringify(t,null,a?2:0)}function $(t,a=240){let d=Number.isFinite(a)&&a>0?Math.max(1,Math.round(a)):240,m=JSON.stringify(F),f=JSON.stringify(q);return t==="on"?`(() => {
80
+ `)}function B(t){return t?t.split(",").map(a=>a.trim()).filter(Boolean):[]}function i(t,a){return t===void 0?"":JSON.stringify(t,null,a?2:0)}function x(t,a=240){let d=Number.isFinite(a)&&a>0?Math.max(1,Math.round(a)):240,g=JSON.stringify(H),p=JSON.stringify(z);return t==="on"?`(() => {
81
81
  const root = window
82
- const store = root[${m}] || (root[${m}] = {
82
+ const store = root[${g}] || (root[${g}] = {
83
83
  enabled: false,
84
84
  limit: ${d},
85
85
  seq: 0,
@@ -89,13 +89,13 @@ examples:
89
89
  })
90
90
  store.limit = ${d}
91
91
  store.enabled = true
92
- const currentHook = root[${f}]
92
+ const currentHook = root[${p}]
93
93
  if (store.hook !== currentHook) {
94
94
  store.prevHook = typeof currentHook === 'function' ? currentHook : undefined
95
95
  }
96
96
  if (typeof store.hook !== 'function') {
97
97
  store.hook = (sample) => {
98
- const target = root[${m}]
98
+ const target = root[${g}]
99
99
  if (!target || target.enabled !== true) return
100
100
  const samples = Array.isArray(target.samples) ? target.samples : (target.samples = [])
101
101
  target.seq = typeof target.seq === 'number' ? target.seq + 1 : 1
@@ -110,7 +110,7 @@ examples:
110
110
  }
111
111
  }
112
112
  }
113
- root[${f}] = store.hook
113
+ root[${p}] = store.hook
114
114
  return {
115
115
  enabled: true,
116
116
  limit: store.limit,
@@ -118,11 +118,11 @@ examples:
118
118
  }
119
119
  })()`:t==="off"?`(() => {
120
120
  const root = window
121
- const store = root[${m}]
121
+ const store = root[${g}]
122
122
  if (!store) return { enabled: false, limit: 0, count: 0 }
123
123
  store.enabled = false
124
- if (root[${f}] === store.hook) {
125
- root[${f}] = typeof store.prevHook === 'function' ? store.prevHook : undefined
124
+ if (root[${p}] === store.hook) {
125
+ root[${p}] = typeof store.prevHook === 'function' ? store.prevHook : undefined
126
126
  }
127
127
  return {
128
128
  enabled: false,
@@ -130,7 +130,7 @@ examples:
130
130
  count: Array.isArray(store.samples) ? store.samples.length : 0,
131
131
  }
132
132
  })()`:t==="clear"?`(() => {
133
- const store = window[${m}]
133
+ const store = window[${g}]
134
134
  if (!store) return { cleared: true, count: 0 }
135
135
  store.samples = []
136
136
  store.seq = 0
@@ -141,14 +141,14 @@ examples:
141
141
  count: 0,
142
142
  }
143
143
  })()`:`(() => {
144
- const store = window[${m}]
144
+ const store = window[${g}]
145
145
  return {
146
146
  enabled: !!store?.enabled,
147
147
  limit: typeof store?.limit === 'number' ? store.limit : 0,
148
148
  count: Array.isArray(store?.samples) ? store.samples.length : 0,
149
149
  }
150
- })()`}function P(t=50){let a=Number.isFinite(t)&&t>0?Math.max(1,Math.round(t)):50;return`(() => {
151
- const store = window[${JSON.stringify(F)}]
150
+ })()`}function J(t=50){let a=Number.isFinite(t)&&t>0?Math.max(1,Math.round(t)):50;return`(() => {
151
+ const store = window[${JSON.stringify(H)}]
152
152
  const all = Array.isArray(store?.samples) ? store.samples : []
153
153
  const samples = all.slice(-${a})
154
154
  const first = samples[0] ?? null
@@ -181,9 +181,9 @@ examples:
181
181
  } : null,
182
182
  samples,
183
183
  }
184
- })()`}async function u(t,a){return S(t,a)}function z(t,a){let d=t.indexOf(a);if(d<0)return null;let m=Number(t[d+1]);return Number.isFinite(m)?m:null}async function J(t){await u(t,"window.__sootsimCompositor.getStats(false, false, undefined, 'enable').then(() => 'enabled')"),await t.send({type:"screenshot"});let d=(await u(t,"window.__sootsimCompositor.getStats(false, false, undefined, 'disable').then((s) => ({ imageAudit: s.imageAudit }))"))?.imageAudit;if(!d)throw new Error("compositor returned no image audit");return d}function E(t){return t===null?" - ":t.toFixed(3).padStart(6)}function V(t){let a=t.sourceUri??t.testID??`node ${t.nodeId}`;return a.length<=58?a:`...${a.slice(-55)}`}function W(t,a,d){let f=t.rows.filter(c=>c.shortfall!==null).filter(c=>c.shortfall<d);if(console.log(` ${t.rows.length} images drawn (${t.draws} draws), ${f.length} below ${d} of what their source could deliver`),console.log(` sampling: mipmapped ${t.samplingCounts.mipmapped} \xB7 cubic ${t.samplingCounts.cubic} \xB7 repeat ${t.samplingCounts.repeat} \xB7 none ${t.samplingCounts.none}`),a.length===0){console.log(" every image delivered its source resolution");return}console.log(""),console.log(" short eff decoded source needed(dev) dest(pt) dpr image");for(let c of a){let x=`${c.decoded.width}x${c.decoded.height}`.padEnd(11),r=(c.vector?"vector":c.intrinsic?`${c.intrinsic.width}x${c.intrinsic.height}`:"?").padEnd(11),w=`${Math.round(c.needed.width)}x${Math.round(c.needed.height)}`.padEnd(12),y=`${Math.round(c.destination.width)}x${Math.round(c.destination.height)}`.padEnd(9);console.log(` ${E(c.shortfall)} ${E(c.effective.width)} ${x} ${r} ${w} ${y} ${c.dpr.toFixed(1)} ${V(c)}`)}}async function X(t,a){let d=A(t,{port:a.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),m=d.positional;(!m[0]||t.includes("--help")||t.includes("-h"))&&(R(),process.exit(0));let c=d.wsPort,x=d.simId,r=!t.includes("--json"),w=x?` --sim ${x}`:"",y=m[0],l=m.slice(1);if(new Set(["state","js","perf","memory","sample-color"]).has(y)){let{runInspect:e}=await import("./inspect-3ZGNJENJ.js");await e(["debug",...t],{port:a.port,verbose:a.verbose});return}let o=_(d);try{switch(y){case"enable":{let e=I(l[0]);e.length===0&&(console.error(` usage: rnx debug enable <channel[,channel,...]>
185
- known: ${B.join(", ")}`),process.exit(1));let s=await k(o,"enable",e);console.log(i({active:s},r));break}case"disable":{let e=I(l[0]),s=await k(o,"disable",e);console.log(i({active:s},r));break}case"toggle":{let e=l[0];e||(console.error(" usage: rnx debug toggle <channel>"),process.exit(1));let s=await u(o,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(i({[e]:s},r));break}case"status":{let e=await N(o);console.log(i(e,r));break}case"channels":{let e=await u(o,"window.__sootsimDebug.channels()");console.log(i(e,r));break}case"flags":{let e=await D(o);console.log(i(e,r));break}case"snapshot":{let e=l[0],s=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",n=await u(o,`(() => { const s = ${s}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(i(n,r));break}case"snapshots":{let e=await u(o,"window.__sootsimDebug.snapshots()");console.log(i(e,r));break}case"diff":{let e=l[0],s=l[1];(!e||!s)&&(console.error(" usage: rnx debug diff <labelA> <labelB>"),process.exit(1));let n=`(() => {
186
- const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(s)});
184
+ })()`}async function m(t,a){return D(t,a)}function V(t,a){let d=t.indexOf(a);if(d<0)return null;let g=Number(t[d+1]);return Number.isFinite(g)?g:null}async function W(t){await m(t,"window.__sootsimCompositor.getStats(false, false, undefined, 'enable').then(() => 'enabled')"),await t.send({type:"screenshot"});let d=(await m(t,"window.__sootsimCompositor.getStats(false, false, undefined, 'disable').then((s) => ({ imageAudit: s.imageAudit }))"))?.imageAudit;if(!d)throw new Error("compositor returned no image audit");return d}function F(t){return t===null?" - ":t.toFixed(3).padStart(6)}function K(t){let a=t.sourceUri??t.testID??`node ${t.nodeId}`;return a.length<=58?a:`...${a.slice(-55)}`}function G(t,a,d){let p=t.rows.filter(c=>c.shortfall!==null).filter(c=>c.shortfall<d);if(console.log(` ${t.rows.length} images drawn (${t.draws} draws), ${p.length} below ${d} of what their source could deliver`),console.log(` sampling: mipmapped ${t.samplingCounts.mipmapped} \xB7 cubic ${t.samplingCounts.cubic} \xB7 repeat ${t.samplingCounts.repeat} \xB7 none ${t.samplingCounts.none}`),a.length===0){console.log(" every image delivered its source resolution");return}console.log(""),console.log(" short eff decoded source needed(dev) dest(pt) dpr image");for(let c of a){let $=`${c.decoded.width}x${c.decoded.height}`.padEnd(11),r=(c.vector?"vector":c.intrinsic?`${c.intrinsic.width}x${c.intrinsic.height}`:"?").padEnd(11),y=`${Math.round(c.needed.width)}x${Math.round(c.needed.height)}`.padEnd(12),v=`${Math.round(c.destination.width)}x${Math.round(c.destination.height)}`.padEnd(9);console.log(` ${F(c.shortfall)} ${F(c.effective.width)} ${$} ${r} ${y} ${v} ${c.dpr.toFixed(1)} ${K(c)}`)}}async function ne(t,a){let d=S(t,{port:a.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),g=d.positional;(!g[0]||t.includes("--help")||t.includes("-h"))&&(E(),u(0));let c=d.wsPort,$=d.simId,r=!t.includes("--json"),y=$?` --sim ${$}`:"",v=g[0],l=g.slice(1);if(new Set(["state","js","perf","memory","sample-color"]).has(v)){let{runInspect:e}=await import("./inspect-MZVDGAN4.js");await e(["debug",...t],{port:a.port,verbose:a.verbose});return}let o=N(d);try{switch(v){case"enable":{let e=B(l[0]);e.length===0&&(console.error(` usage: rnx debug enable <channel[,channel,...]>
185
+ known: ${L.join(", ")}`),u(1));let n=await A(o,"enable",e);console.log(i({active:n},r));break}case"disable":{let e=B(l[0]),n=await A(o,"disable",e);console.log(i({active:n},r));break}case"toggle":{let e=l[0];e||(console.error(" usage: rnx debug toggle <channel>"),u(1));let n=await m(o,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(i({[e]:n},r));break}case"status":{let e=await O(o);console.log(i(e,r));break}case"channels":{let e=await m(o,"window.__sootsimDebug.channels()");console.log(i(e,r));break}case"flags":{let e=await T(o);console.log(i(e,r));break}case"snapshot":{let e=l[0],n=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",s=await m(o,`(() => { const s = ${n}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(i(s,r));break}case"snapshots":{let e=await m(o,"window.__sootsimDebug.snapshots()");console.log(i(e,r));break}case"diff":{let e=l[0],n=l[1];(!e||!n)&&(console.error(" usage: rnx debug diff <labelA> <labelB>"),u(1));let s=`(() => {
186
+ const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(n)});
187
187
  if (!d) return null;
188
188
  return {
189
189
  a: d.a,
@@ -193,8 +193,8 @@ examples:
193
193
  removed: d.removed,
194
194
  changed: d.changed,
195
195
  };
196
- })()`,g=await u(o,n);console.log(i(g,r));break}case"clear-snapshots":{let e=l[0],s=e?`window.__sootsimDebug.clearSnapshots(${JSON.stringify(e)})`:"window.__sootsimDebug.clearSnapshots()";await u(o,s),console.log(i({cleared:e||"all"},r));break}case"image-audit":{let e=z(t,"--min")??.98,s=await J(o);s.draws===0&&(console.error(` the audit recorded zero image draws, so an empty result proves nothing.
196
+ })()`,f=await m(o,s);console.log(i(f,r));break}case"clear-snapshots":{let e=l[0],n=e?`window.__sootsimDebug.clearSnapshots(${JSON.stringify(e)})`:"window.__sootsimDebug.clearSnapshots()";await m(o,n),console.log(i({cleared:e||"all"},r));break}case"image-audit":{let e=V(t,"--min")??.98,n=await W(o);n.draws===0&&(console.error(` the audit recorded zero image draws, so an empty result proves nothing.
197
197
  while it records, paint boundaries rebuild and raster blits are
198
198
  bypassed, so every image on screen should reach the draw path.
199
199
  zero draws means either nothing on screen is an image, or the audit
200
- is not attached to the surface that paints.`),process.exit(2));let n=s.rows.filter(g=>g.shortfall!==null&&g.shortfall<e);r?W(s,t.includes("--all")?s.rows:n,e):console.log(i({...s,minimum:e,under:n.length},!1)),n.length>0&&process.exit(1);break}case"find":{let e=l[0];if(e==="sheets"||e==="portals"||e==="boundaries"){let s=await O(o,e);console.log(i(s,r))}else console.error(" usage: rnx debug find <sheets|portals|boundaries>"),process.exit(1);break}case"trace":{let e=l[0],s=l[1];if(e==="anim"){let n=l[1];if((!n||n==="--help"||n==="-h")&&(console.error(" usage: rnx debug trace anim <on|off|status|clear|<id>> [id|limit]"),process.exit(1)),n==="on"){let p=l[2]??"all",h=l[3]?Number(l[3]):void 0,v=p==="all"?"all":Number(p);v!=="all"&&!Number.isFinite(v)&&(console.error(` invalid target: ${p}`),process.exit(1)),await b(o,"enableAnimationTrace",v,h);let j=await b(o,"listAnimationTraces");console.log(i({enabled:v,traces:j},r));break}if(n==="off"){let p=l[2]??"all",h=p==="all"?"all":Number(p);h!=="all"&&!Number.isFinite(h)&&(console.error(` invalid target: ${p}`),process.exit(1)),await b(o,"disableAnimationTrace",h),console.log(i({disabled:h},r));break}if(n==="status"||n==="clear"){n==="clear"&&await b(o,"disableAnimationTrace","all");let p=await b(o,"listAnimationTraces");console.log(i({traces:p},r));break}let g=Number(n);Number.isFinite(g)||(console.error(` invalid id: ${n}`),process.exit(1));let L=l[2]?Number(l[2]):void 0,H=await b(o,"getAnimationTrace",g,L);console.log(i({id:g,samples:H},r));break}if(e!=="shell"&&(console.error(" usage: rnx debug trace <shell|anim> [args]"),process.exit(1)),!s||/^[0-9]+$/.test(s)){let n=s?Number(s):50,g=await u(o,P(n));console.log(i(g,r));break}if(s==="on"){let n=l[2]?Number(l[2]):240,g=await u(o,$("on",n));console.log(i(g,r));break}if(s==="off"){let n=await u(o,$("off"));console.log(i(n,r));break}if(s==="clear"){let n=await u(o,$("clear"));console.log(i(n,r));break}if(s==="status"){let n=await u(o,$("status"));console.log(i(n,r));break}console.error(" usage: rnx debug trace shell [on [limit]|off|status|clear|recentLimit]"),process.exit(1)}case"record":{let e=l[0],n=await u(o,`window.__sootsimDebug.record(${e==="on"?"true":e==="off"?"false":"undefined"})`);console.log(i({recording:n},r));break}case"recent":{let e=l[0],s=l[1]?Number(l[1]):50,n=await T(o,e,s);console.log(i(n,r));break}case"clear-events":{await u(o,"window.__sootsimDebug.clearEvents()"),console.log(i({cleared:!0},r));break}default:console.error(` unknown subcommand: ${y}`),R(),process.exit(1)}}catch(e){console.error(` debug failed: ${e.message}`),await C(o,{errorsCommand:`rnx get errors 5${w}`,warningsCommand:`rnx get warnings 5${w}`,requestsCommand:`rnx get requests 5${w}`}),process.exit(1)}finally{o.close()}}export{X as runDebug};
200
+ is not attached to the surface that paints.`),u(2));let s=n.rows.filter(f=>f.shortfall!==null&&f.shortfall<e);r?G(n,t.includes("--all")?n.rows:s,e):console.log(i({...n,minimum:e,under:s.length},!1)),s.length>0&&u(1);break}case"find":{let e=l[0];if(e==="sheets"||e==="portals"||e==="boundaries"){let n=await C(o,e);console.log(i(n,r))}else console.error(" usage: rnx debug find <sheets|portals|boundaries>"),u(1);break}case"trace":{let e=l[0],n=l[1];if(e==="anim"){let s=l[1];if((!s||s==="--help"||s==="-h")&&(console.error(" usage: rnx debug trace anim <on|off|status|clear|<id>> [id|limit]"),u(1)),s==="on"){let h=l[2]??"all",w=l[3]?Number(l[3]):void 0,k=h==="all"?"all":Number(h);k!=="all"&&!Number.isFinite(k)&&(console.error(` invalid target: ${h}`),u(1)),await b(o,"enableAnimationTrace",k,w);let q=await b(o,"listAnimationTraces");console.log(i({enabled:k,traces:q},r));break}if(s==="off"){let h=l[2]??"all",w=h==="all"?"all":Number(h);w!=="all"&&!Number.isFinite(w)&&(console.error(` invalid target: ${h}`),u(1)),await b(o,"disableAnimationTrace",w),console.log(i({disabled:w},r));break}if(s==="status"||s==="clear"){s==="clear"&&await b(o,"disableAnimationTrace","all");let h=await b(o,"listAnimationTraces");console.log(i({traces:h},r));break}let f=Number(s);Number.isFinite(f)||(console.error(` invalid id: ${s}`),u(1));let j=l[2]?Number(l[2]):void 0,M=await b(o,"getAnimationTrace",f,j);console.log(i({id:f,samples:M},r));break}if(e!=="shell"&&(console.error(" usage: rnx debug trace <shell|anim> [args]"),u(1)),!n||/^[0-9]+$/.test(n)){let s=n?Number(n):50,f=await m(o,J(s));console.log(i(f,r));break}if(n==="on"){let s=l[2]?Number(l[2]):240,f=await m(o,x("on",s));console.log(i(f,r));break}if(n==="off"){let s=await m(o,x("off"));console.log(i(s,r));break}if(n==="clear"){let s=await m(o,x("clear"));console.log(i(s,r));break}if(n==="status"){let s=await m(o,x("status"));console.log(i(s,r));break}console.error(" usage: rnx debug trace shell [on [limit]|off|status|clear|recentLimit]"),u(1)}case"record":{let e=l[0],s=await m(o,`window.__sootsimDebug.record(${e==="on"?"true":e==="off"?"false":"undefined"})`);console.log(i({recording:s},r));break}case"recent":{let e=l[0],n=l[1]?Number(l[1]):50,s=await R(o,e,n);console.log(i(s,r));break}case"clear-events":{await m(o,"window.__sootsimDebug.clearEvents()"),console.log(i({cleared:!0},r));break}default:console.error(` unknown subcommand: ${v}`),E(),u(1)}}catch(e){_(e),console.error(` debug failed: ${e.message}`),await I(o,{errorsCommand:`rnx get errors 5${y}`,warningsCommand:`rnx get warnings 5${y}`,requestsCommand:`rnx get requests 5${y}`}),u(1)}finally{o.close()}}export{ne as runDebug};
@@ -0,0 +1,31 @@
1
+ /*! rnx v0.1.371 | (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-7ASCDKA3.js";import{a as m}from"./chunk-6FPXLSBJ.js";import{a as f}from"./chunk-VEFSHPSU.js";import{g as d}from"./chunk-LFANRLWK.js";import"./chunk-DP6RGTNN.js";import"./chunk-NQ4CI2VI.js";import{a as u}from"./chunk-42YOIDLR.js";import{c as a}from"./chunk-2LH4DYPM.js";import"./chunk-6AZKZ5AJ.js";import"./chunk-AVIH3TAZ.js";import{a as l}from"./chunk-SHLJYXIN.js";import"./chunk-2W4YBCPX.js";import"./chunk-KL34TRNW.js";import"./chunk-BNS5LNEU.js";import"./chunk-ADJSGO55.js";import"./chunk-HV3WOWQM.js";import"./chunk-WHZE63R2.js";import"./chunk-IYU2EOIU.js";import"./chunk-OF3U4SZO.js";import"./chunk-AGZZWLEL.js";import"./chunk-ESWSXF55.js";import"./chunk-WLRIPAGJ.js";import{c as r}from"./chunk-ERBGQEJ5.js";import"./chunk-CJQXP4XM.js";import"./chunk-7TWD4P6J.js";import{i as c}from"./chunk-H4DU457S.js";import"./chunk-S3AH2O67.js";import"./chunk-Y7SKGRAV.js";import"./chunk-OQPZOEEP.js";import"./chunk-OF5OBB67.js";function v(e){let t=e.indexOf("--port");if(t<0)return;let n=e[t+1],o=n?Number(n):Number.NaN;return(!Number.isInteger(o)||o<=0)&&(console.error(` invalid --port value: ${n||"(missing)"}`),r(1)),o}async function w(e,t){let n=v(e)??t.port;return n?d(String(n)):void 0}async function h(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
+ `),r(0));let n=e.find((k,p)=>e[p-1]==="--profile"),o=e.includes("--ephemeral");n&&o&&(console.error(" rnx desktop: --profile cannot be combined with --ephemeral"),r(1));let x=n?a(n).id:void 0,i=l();if(!i){if(m(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await c("run rnx desktop install now?",!0)){console.log();let{runInstallDesktop:p}=await import("./install-desktop-QB76DNZF.js");await p(["--yes"]),i=l()}i||r(1)}console.log(` launching ${i.path}`);let g=await w(e,t),s=await u.launch({url:g,device:t.device,profileId:x,ephemeralProfile:o});s.launched||(console.error(` ${s.message}`),r(1)),console.log(` ${s.message}`)}function b(){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 C(e,t){if(e.includes("--help")||e.includes("-h")){b();return}let n=e.find(o=>!o.startsWith("-"));if(n==="install"){let o=e.indexOf(n);await f([...e.slice(0,o),...e.slice(o+1)]);return}await h(e,t)}export{C as runDesktop};
@@ -0,0 +1,52 @@
1
+ /*! rnx v0.1.371 | (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 U}from"./chunk-5PPVVGLH.js";import"./chunk-OWDJQWJ7.js";import"./chunk-JKRMBNPO.js";import"./chunk-MW4E5EED.js";import"./chunk-6FPXLSBJ.js";import"./chunk-7Q4WHJDH.js";import"./chunk-PTWMX4AA.js";import{c as $,d as k,e as J}from"./chunk-2QW3JH6T.js";import{a as N}from"./chunk-IPNDXGVA.js";import"./chunk-SH2HXHR2.js";import"./chunk-RYJTPZCX.js";import"./chunk-WCB5XPCH.js";import"./chunk-LFANRLWK.js";import"./chunk-DP6RGTNN.js";import"./chunk-NQ4CI2VI.js";import"./chunk-42YOIDLR.js";import"./chunk-2LH4DYPM.js";import"./chunk-6AZKZ5AJ.js";import"./chunk-AVIH3TAZ.js";import"./chunk-SHLJYXIN.js";import"./chunk-2W4YBCPX.js";import"./chunk-KL34TRNW.js";import"./chunk-BNS5LNEU.js";import"./chunk-ADJSGO55.js";import"./chunk-HV3WOWQM.js";import"./chunk-WHZE63R2.js";import"./chunk-IYU2EOIU.js";import"./chunk-UPMR6Y5P.js";import"./chunk-OF3U4SZO.js";import"./chunk-AGZZWLEL.js";import"./chunk-ESWSXF55.js";import"./chunk-WLRIPAGJ.js";import"./chunk-JUTLQ3GX.js";import{c as f}from"./chunk-ERBGQEJ5.js";import"./chunk-UHYAY3RU.js";import"./chunk-KHGXEU4L.js";import"./chunk-CJQXP4XM.js";import"./chunk-7TWD4P6J.js";import"./chunk-S3AH2O67.js";import"./chunk-Y7SKGRAV.js";import{a as E}from"./chunk-OQPZOEEP.js";import"./chunk-OF5OBB67.js";import{spawn as H}from"child_process";import{existsSync as T,mkdirSync as V,readFileSync as z,writeFileSync as I,unlinkSync as C}from"fs";import{createRequire as K}from"module";import{tmpdir as A}from"os";import{dirname as Q,resolve as a,join as y,relative as X}from"path";function Y(){try{let t=import.meta.resolve(`${E.packageName}/detox`);return Q(t.startsWith("file://")?t.slice(7):t)}catch{return a(import.meta.dirname,"..","..","detox")}}var Z=`
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 xe(t,o={}){if((t.includes("--help")||t.includes("-h"))&&(console.log(Z),f(0)),t[0]==="init")return oe();let l=e=>{let s=t.indexOf(e);return s>=0?t[s+1]:void 0},n=e=>t.includes(e),u=n("--watch"),m=n("--headed"),d=n("--no-launch"),S=l("--config"),x=o.port||Number(process.env.SOOTSIM_PORT)||5173,L=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")}),W=t.flatMap((e,s)=>e==="--runInBand"||e.startsWith("--maxWorkers=")||e.startsWith("--shard=")?[e]:(e==="--maxWorkers"||e==="--shard")&&t[s+1]?[e,t[s+1]]:[]),j=["e2e","test/e2e","detox"],c=process.env.SOOTSIM_TEST_DIR?a(process.cwd(),process.env.SOOTSIM_TEST_DIR):null;if(!c)for(let e of j){let s=a(process.cwd(),e);if(T(s)){c=s;break}}c||(console.error(` error: no detox tests found. expected one of: ${j.join(", ")}
19
+ run 'rnx detox init' to scaffold a starter suite.`),f(1)),d||await se(x);let r=["jest"],h=S||te(["sootsim-detox.config.cjs","jest.config.cjs","jest.config.js"]),p=null;if(h)r.push("--config",a(process.cwd(),h));else{let e=a(Y(),"jest-preset.cjs");p=y(A(),`sootsim-detox-${process.pid}.config.cjs`);let s={rootDir:c,roots:["<rootDir>"],testMatch:["<rootDir>/**/*.test.ts","<rootDir>/**/*.test.js"]};I(p,`module.exports = { ...require(${JSON.stringify(e)}), ...${JSON.stringify(s)} }
20
+ `),r.push("--config",p)}u&&r.push("--watch");let v=l("-t")||l("--testNamePattern")||l("--grep");v&&r.push("-t",v);let b=N(),R=!u&&$({uploadedShare:!1,auth:b}),g=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):R&&(g=y(A(),`sootsim-detox-results-${process.pid}.json`),r.push("--json","--outputFile",g)),r.push(...W),r.push(...L),console.log(" rnx detox"),console.log(` test dir: ${c}`),console.log(` port: ${x}${m?" (headed)":""}`),h&&console.log(` config: ${h}`);let _=process.env.CONFORMANCE_PROOF==="1"||!!process.env.CONFORMANCE_PROOF_DIR,G=_?"node":"npx",B=_?["--no-maglev",K(y(process.cwd(),"package.json")).resolve("jest/bin/jest"),...r.slice(1)]:r,O=H(G,B,{cwd:process.cwd(),stdio:"inherit",env:{...process.env,SOOTSIM_TEST_DIR:c,SOOTSIM_PORT:String(x),SOOTSIM_HEADED:m?"1":"",SOOTSIM_URL:process.env.SOOTSIM_URL||`http://localhost:${x}`}}),F=e=>()=>{O.kill(e)},P=F("SIGTERM"),D=F("SIGINT");process.on("SIGTERM",P),process.on("SIGINT",D);let q=Date.now(),w=await new Promise((e,s)=>{O.once("error",s),O.once("exit",(i,M)=>{if(M){console.error(` error: jest terminated by ${M}`),e(1);return}e(i??1)})});if(process.off("SIGTERM",P),process.off("SIGINT",D),p)try{C(p)}catch{}if(R){let e=g?ee(g):null,s=await J(),i=await k({origin:s,kind:"detox",name:X(process.cwd(),c)||"e2e",status:w===0?"passed":"failed",summary:e?`${e.numPassedTests}/${e.numTotalTests} tests passed`:null,failureMessage:w===0?null:e?.firstFailure??null,stepCount:e?.numTotalTests??null,failedStepIndex:e?.firstFailedIndex??null,durationMs:Date.now()-q,auth:b});i&&console.log(` run: ${i.id}`)}f(w)}function ee(t){try{let o=JSON.parse(z(t,"utf8")),l=null,n=null,u=0;for(let m of o.testResults??[])for(let d of m.testResults??[]){if(n==null&&d.status==="failed"){n=u;let S=d.failureMessages?.[0]?.split(`
21
+ `)[0];l=[d.fullName,S].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{C(t)}catch{}}}function te(t){for(let o of t)if(T(a(process.cwd(),o)))return o;return null}async function se(t){await U()||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 oe(){let t=process.cwd(),o=a(t,"sootsim-detox.config.cjs");T(o)?console.log(` skip: ${o} already exists`):(I(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=a(t,"e2e"),n=a(l,"example.test.ts");T(n)?console.log(` skip: ${n} already exists`):(V(l,{recursive:!0}),I(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"),f(0)}export{xe as runDetox};
@@ -0,0 +1,18 @@
1
+ /*! rnx v0.1.371 | (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-NQ4CI2VI.js";import"./chunk-ADJSGO55.js";import"./chunk-OF3U4SZO.js";import{b as d,d as c,e as h}from"./chunk-AGZZWLEL.js";import{t as l,v as a,y as m}from"./chunk-ESWSXF55.js";import"./chunk-WLRIPAGJ.js";import{c as s}from"./chunk-ERBGQEJ5.js";import"./chunk-Y7SKGRAV.js";import"./chunk-OF5OBB67.js";function v(){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 u(t){let n=c(t);console.log(` ${t.padEnd(14)} ${String(n.width).padStart(4)}x${String(n.height).padEnd(4)} pt ${String(n.width*n.scale).padStart(4)}x${String(n.height*n.scale).padEnd(4)} px ${n.name}`)}async function x(t){let n=a(t);try{let o=await m(n,"SootSim.bridges.settings.get")??{deviceModel:null},i=typeof o.deviceModel=="string"?o.deviceModel:null;if(!i||!(i in d))return null;let e=c(i);return{model:i,width:e.width,height:e.height,scale:e.scale,name:e.name}}finally{n.close()}}async function b(t,n){(t.includes("--help")||t.includes("-h"))&&(v(),s(0));let o=t[0];if(!o||o==="get"){let i=l(t,{port:n.port}),e=await x(i);e||(console.error(" error: could not read current device from the target sim"),s(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 h())u(i);return}if(o==="set"){let i=t[1];i||(console.error(" error: device set expects a model"),s(1)),i in d||(console.error(` error: unknown device "${i}"`),console.error(" run `rnx device list` to see valid models"),s(1));let e=l(t,{port:n.port}),g=a(e);try{let p=await m(g,"SootSim.bridges.settings.set","deviceModel",i),r=c(i);console.log(` ${p?"set":"kept"} device: ${i} (${r.width}x${r.height} pt, ${r.width*r.scale}x${r.height*r.scale} px)${p?" \u2014 reloading sim":""}`)}finally{g.close()}return}v(),console.error(` unknown subcommand: ${o}`),s(1)}export{b as runDeviceCommand};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.371 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{e as v,t as E,v as x,y as b}from"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-FBMNYSSW.js";import"./chunk-DKSZZABN.js";function j(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(r=>typeof r=="string"?r:JSON.stringify(r)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
4
+ import{e as v,t as E,v as x,y as b}from"./chunk-ESWSXF55.js";import"./chunk-WLRIPAGJ.js";import"./chunk-Y7SKGRAV.js";import"./chunk-OF5OBB67.js";function j(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(r=>typeof r=="string"?r:JSON.stringify(r)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
5
5
  rnx get diagnosis \u2014 compact "what just went wrong?" report
6
6
 
7
7
  usage:
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.371 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a,b,c,d,e}from"./chunk-AJJCYLBC.js";import"./chunk-FHRG772G.js";import"./chunk-IYPMULI7.js";import"./chunk-FBMNYSSW.js";import"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";export{e as applyAutomaticSootsimCleanup,d as applySootsimCleanup,b as formatSootsimBytes,a as isAutomaticSootsimCleanupComplete,c as planSootsimCleanup};
4
+ import{a,b,c,d,e}from"./chunk-N3LAMTGS.js";import"./chunk-CJQXP4XM.js";import"./chunk-7TWD4P6J.js";import"./chunk-Y7SKGRAV.js";import"./chunk-OQPZOEEP.js";import"./chunk-OF5OBB67.js";export{e as applyAutomaticSootsimCleanup,d as applySootsimCleanup,b as formatSootsimBytes,a as isAutomaticSootsimCleanupComplete,c as planSootsimCleanup};
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.371 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import"./chunk-DKSZZABN.js";var p=class extends Error{constructor(s){super(s),this.name="BridgeInputError"}};var k=new Set(["tap","tap-id","tap-text","double-tap","long-press","type","type-into","key","key-sequence","dismiss","scroll","drag","swipe","pinch","touch","sleep"]);function O(a){return a.includes("--then")}function o(a,s){throw new p(`do chain action ${a+1} has invalid arguments; usage: rnx do ${s}`)}function r(a,s,l){let n=Number(a);return(a===void 0||!Number.isFinite(n))&&o(s,l),n}function D(a){let s=[[]];for(let l of a){if(l!=="--then"){s[s.length-1].push(l);continue}if(s[s.length-1].length===0)throw new p("do chain contains an empty action");s.push([])}if(s.length<2)throw new p("do chain needs at least two actions separated by --then");if(s[s.length-1].length===0)throw new p("do chain cannot end with --then");return s.flatMap((l,n)=>{let[d,...t]=l;if(!d)throw new p("do chain contains an empty action");if(!k.has(d))throw new p(`do chain action ${n+1} cannot batch ${JSON.stringify(d)}; run it as a separate rnx do command`);switch(d){case"tap":return t.length===1&&!Number.isFinite(Number(t[0]))?[{type:"tapId",id:t[0]}]:(t.length!==2&&o(n,"tap <testid> | <x> <y>"),[{type:"tap",x:r(t[0],n,"tap <testid> | <x> <y>"),y:r(t[1],n,"tap <testid> | <x> <y>")}]);case"tap-id":return t.length!==1&&o(n,"tap-id <id>"),[{type:"tapId",id:t[0]}];case"tap-text":{let e=t.join(" ");return e||o(n,"tap-text <text>"),[{type:"tapText",text:e}]}case"double-tap":{let e="double-tap <testid> [gapMs] | <x> <y> [gapMs]";return t.length>0&&!Number.isFinite(Number(t[0]))?(t.length>2&&o(n,e),[{type:"targetedDoubleTap",id:t[0],gapMs:t.length===2?Math.max(0,Math.round(r(t[1],n,e))):80}]):((t.length<2||t.length>3)&&o(n,e),[{type:"doubleTap",x:r(t[0],n,e),y:r(t[1],n,e),gapMs:t.length===3?Math.max(0,Math.round(r(t[2],n,e))):80}])}case"long-press":{let e="long-press <testid> [durationMs] | <x> <y> [durationMs]";return t.length>0&&!Number.isFinite(Number(t[0]))?(t.length>2&&o(n,e),[{type:"targetedLongPress",id:t[0],durationMs:t.length===2?Math.max(0,Math.round(r(t[1],n,e))):600}]):((t.length<2||t.length>3)&&o(n,e),[{type:"longPress",x:r(t[0],n,e),y:r(t[1],n,e),durationMs:t.length===3?Math.max(0,Math.round(r(t[2],n,e))):600}])}case"type":{let e=t.join(" ");return e||o(n,"type <text>"),[{type:"type",text:e}]}case"type-into":{let e=t.slice(1).join(" ");return(!t[0]||!e)&&o(n,"type-into <id> <text>"),[{type:"tapId",id:t[0]},{type:"type",text:e}]}case"key":return t.length!==1&&o(n,"key <name>"),[{type:"key",key:t[0]}];case"key-sequence":return t.length===0&&o(n,"key-sequence <key> [<key> ...]"),t.map(e=>({type:"key",key:e}));case"dismiss":return t.length!==0&&o(n,"dismiss"),[{type:"dismissKeyboard"}];case"scroll":{let e="scroll <id> <x> <y>";return t.length!==3&&o(n,e),[{type:"scroll",id:t[0],x:r(t[1],n,e),y:r(t[2],n,e),animated:!1}]}case"drag":case"swipe":{let e=`${d} <x1> <y1> <x2> <y2> [steps] [stepMs]`;(t.length<4||t.length>6)&&o(n,e);let i=d==="swipe"?10:12,y=d==="swipe"?8:16;return[{type:"drag",fromX:r(t[0],n,e),fromY:r(t[1],n,e),toX:r(t[2],n,e),toY:r(t[3],n,e),steps:t.length>=5?Math.max(1,Math.round(r(t[4],n,e))):i,stepMs:t.length===6?Math.max(0,Math.round(r(t[5],n,e))):y}]}case"pinch":{let e="pinch <x1> <y1> <x2> <y2> <x1'> <y1'> <x2'> <y2'> [steps] [stepMs]";return(t.length<8||t.length>10)&&o(n,e),[{type:"pinch",fromX1:r(t[0],n,e),fromY1:r(t[1],n,e),fromX2:r(t[2],n,e),fromY2:r(t[3],n,e),toX1:r(t[4],n,e),toY1:r(t[5],n,e),toX2:r(t[6],n,e),toY2:r(t[7],n,e),steps:t.length>=9?Math.max(1,Math.round(r(t[8],n,e))):12,stepMs:t.length===10?Math.max(0,Math.round(r(t[9],n,e))):16}]}case"touch":{let e="touch <down|move|up|cancel> <x> <y> [pointerId]";(t.length<3||t.length>4)&&o(n,e);let i=t[0];i!=="down"&&i!=="move"&&i!=="up"&&i!=="cancel"&&o(n,e);let y=t.length===4?Math.max(1,Math.round(r(t[3],n,e))):999;return i==="cancel"?[{type:"touchCancel",pointerId:y}]:[{type:i==="down"?"touchDown":i==="move"?"touchMove":"touchUp",x:r(t[1],n,e),y:r(t[2],n,e),pointerId:y}]}case"sleep":{let e="sleep [seconds]";t.length>1&&o(n,e);let i=t.length===1?r(t[0],n,e):.5;return i<0&&o(n,e),[{type:"wait",ms:Math.round(i*1e3)}]}default:throw new p(`do chain action ${n+1} cannot batch ${JSON.stringify(d)}`)}})}async function Y(a,s={}){let[l,n,d,t,e]=await Promise.all([import("./connect-WWWAVVCF.js"),import("./sim-client-LQUZSO45.js"),import("./ws-bridge-RUXOYOU6.js"),import("./env-4XD5D2G6.js"),import("./resolve-target-7WWI32R3.js")]),{connect:i}=l,{SimPerformError:y}=n,{checkSimHealth:M,parseBridgeCliArgs:S}=d,{isAgentEnv:$}=t,{resolveTargetCoords:x}=e,b=a.includes("--json"),I=a.includes("--no-wait")||process.env.SOOTSIM_NO_AUTO_WAIT==="1",m=S(a,{port:s.port,commandTimeoutMs:3e4,stripBooleanFlags:["--json","--no-wait"]});if(!Number.isFinite(m.commandTimeoutMs)||m.commandTimeoutMs<=0)return console.error(" do chain: --timeout must be a positive number"),1;let w;try{w=D(m.positional)}catch(u){return console.error(` do chain: ${u instanceof Error?u.message:u}`),1}let h=null;try{h=await i({port:m.wsPort,sim:m.simId,timeoutMs:m.commandTimeoutMs}),await M(h);let u=[];for(let c of w){if(c.type!=="targetedDoubleTap"&&c.type!=="targetedLongPress"){u.push(c);continue}let f=await x(h,{mode:"testid",value:c.id});if(!f)throw new p(`do chain could not find testID ${JSON.stringify(c.id)}`);u.push(c.type==="targetedDoubleTap"?{type:"doubleTap",x:f.x,y:f.y,gapMs:c.gapMs}:{type:"longPress",x:f.x,y:f.y,durationMs:c.durationMs})}let g=await h.perform(u,{timeoutMs:m.commandTimeoutMs});if(!I)try{let c=$()?400:200,f=await h.settle({maxMs:c});f.settled||process.stderr.write(` \u26A0 auto-wait timed out after ${f.elapsed??c}ms. next command may see mid-animation state. use \`rnx do settle\` for a longer wait.
4
+ import"./chunk-OF5OBB67.js";var p=class extends Error{constructor(s){super(s),this.name="BridgeInputError"}};var k=new Set(["tap","tap-id","tap-text","double-tap","long-press","type","type-into","key","key-sequence","dismiss","scroll","drag","swipe","pinch","touch","sleep"]);function O(a){return a.includes("--then")}function o(a,s){throw new p(`do chain action ${a+1} has invalid arguments; usage: rnx do ${s}`)}function r(a,s,l){let n=Number(a);return(a===void 0||!Number.isFinite(n))&&o(s,l),n}function D(a){let s=[[]];for(let l of a){if(l!=="--then"){s[s.length-1].push(l);continue}if(s[s.length-1].length===0)throw new p("do chain contains an empty action");s.push([])}if(s.length<2)throw new p("do chain needs at least two actions separated by --then");if(s[s.length-1].length===0)throw new p("do chain cannot end with --then");return s.flatMap((l,n)=>{let[d,...t]=l;if(!d)throw new p("do chain contains an empty action");if(!k.has(d))throw new p(`do chain action ${n+1} cannot batch ${JSON.stringify(d)}; run it as a separate rnx do command`);switch(d){case"tap":return t.length===1&&!Number.isFinite(Number(t[0]))?[{type:"tapId",id:t[0]}]:(t.length!==2&&o(n,"tap <testid> | <x> <y>"),[{type:"tap",x:r(t[0],n,"tap <testid> | <x> <y>"),y:r(t[1],n,"tap <testid> | <x> <y>")}]);case"tap-id":return t.length!==1&&o(n,"tap-id <id>"),[{type:"tapId",id:t[0]}];case"tap-text":{let e=t.join(" ");return e||o(n,"tap-text <text>"),[{type:"tapText",text:e}]}case"double-tap":{let e="double-tap <testid> [gapMs] | <x> <y> [gapMs]";return t.length>0&&!Number.isFinite(Number(t[0]))?(t.length>2&&o(n,e),[{type:"targetedDoubleTap",id:t[0],gapMs:t.length===2?Math.max(0,Math.round(r(t[1],n,e))):80}]):((t.length<2||t.length>3)&&o(n,e),[{type:"doubleTap",x:r(t[0],n,e),y:r(t[1],n,e),gapMs:t.length===3?Math.max(0,Math.round(r(t[2],n,e))):80}])}case"long-press":{let e="long-press <testid> [durationMs] | <x> <y> [durationMs]";return t.length>0&&!Number.isFinite(Number(t[0]))?(t.length>2&&o(n,e),[{type:"targetedLongPress",id:t[0],durationMs:t.length===2?Math.max(0,Math.round(r(t[1],n,e))):600}]):((t.length<2||t.length>3)&&o(n,e),[{type:"longPress",x:r(t[0],n,e),y:r(t[1],n,e),durationMs:t.length===3?Math.max(0,Math.round(r(t[2],n,e))):600}])}case"type":{let e=t.join(" ");return e||o(n,"type <text>"),[{type:"type",text:e}]}case"type-into":{let e=t.slice(1).join(" ");return(!t[0]||!e)&&o(n,"type-into <id> <text>"),[{type:"tapId",id:t[0]},{type:"type",text:e}]}case"key":return t.length!==1&&o(n,"key <name>"),[{type:"key",key:t[0]}];case"key-sequence":return t.length===0&&o(n,"key-sequence <key> [<key> ...]"),t.map(e=>({type:"key",key:e}));case"dismiss":return t.length!==0&&o(n,"dismiss"),[{type:"dismissKeyboard"}];case"scroll":{let e="scroll <id> <x> <y>";return t.length!==3&&o(n,e),[{type:"scroll",id:t[0],x:r(t[1],n,e),y:r(t[2],n,e),animated:!1}]}case"drag":case"swipe":{let e=`${d} <x1> <y1> <x2> <y2> [steps] [stepMs]`;(t.length<4||t.length>6)&&o(n,e);let i=d==="swipe"?10:12,y=d==="swipe"?8:16;return[{type:"drag",fromX:r(t[0],n,e),fromY:r(t[1],n,e),toX:r(t[2],n,e),toY:r(t[3],n,e),steps:t.length>=5?Math.max(1,Math.round(r(t[4],n,e))):i,stepMs:t.length===6?Math.max(0,Math.round(r(t[5],n,e))):y}]}case"pinch":{let e="pinch <x1> <y1> <x2> <y2> <x1'> <y1'> <x2'> <y2'> [steps] [stepMs]";return(t.length<8||t.length>10)&&o(n,e),[{type:"pinch",fromX1:r(t[0],n,e),fromY1:r(t[1],n,e),fromX2:r(t[2],n,e),fromY2:r(t[3],n,e),toX1:r(t[4],n,e),toY1:r(t[5],n,e),toX2:r(t[6],n,e),toY2:r(t[7],n,e),steps:t.length>=9?Math.max(1,Math.round(r(t[8],n,e))):12,stepMs:t.length===10?Math.max(0,Math.round(r(t[9],n,e))):16}]}case"touch":{let e="touch <down|move|up|cancel> <x> <y> [pointerId]";(t.length<3||t.length>4)&&o(n,e);let i=t[0];i!=="down"&&i!=="move"&&i!=="up"&&i!=="cancel"&&o(n,e);let y=t.length===4?Math.max(1,Math.round(r(t[3],n,e))):999;return i==="cancel"?[{type:"touchCancel",pointerId:y}]:[{type:i==="down"?"touchDown":i==="move"?"touchMove":"touchUp",x:r(t[1],n,e),y:r(t[2],n,e),pointerId:y}]}case"sleep":{let e="sleep [seconds]";t.length>1&&o(n,e);let i=t.length===1?r(t[0],n,e):.5;return i<0&&o(n,e),[{type:"wait",ms:Math.round(i*1e3)}]}default:throw new p(`do chain action ${n+1} cannot batch ${JSON.stringify(d)}`)}})}async function Y(a,s={}){let[l,n,d,t,e]=await Promise.all([import("./connect-AJV4PZA4.js"),import("./sim-client-RL6DGOJE.js"),import("./ws-bridge-Z3O35MNF.js"),import("./env-BX6S2SOM.js"),import("./resolve-target-SP22ZGFZ.js")]),{connect:i}=l,{SimPerformError:y}=n,{checkSimHealth:M,parseBridgeCliArgs:S}=d,{isAgentEnv:$}=t,{resolveTargetCoords:x}=e,b=a.includes("--json"),I=a.includes("--no-wait")||process.env.SOOTSIM_NO_AUTO_WAIT==="1",m=S(a,{port:s.port,commandTimeoutMs:3e4,stripBooleanFlags:["--json","--no-wait"]});if(!Number.isFinite(m.commandTimeoutMs)||m.commandTimeoutMs<=0)return console.error(" do chain: --timeout must be a positive number"),1;let w;try{w=D(m.positional)}catch(u){return console.error(` do chain: ${u instanceof Error?u.message:u}`),1}let h=null;try{h=await i({port:m.wsPort,sim:m.simId,timeoutMs:m.commandTimeoutMs}),await M(h);let u=[];for(let c of w){if(c.type!=="targetedDoubleTap"&&c.type!=="targetedLongPress"){u.push(c);continue}let f=await x(h,{mode:"testid",value:c.id});if(!f)throw new p(`do chain could not find testID ${JSON.stringify(c.id)}`);u.push(c.type==="targetedDoubleTap"?{type:"doubleTap",x:f.x,y:f.y,gapMs:c.gapMs}:{type:"longPress",x:f.x,y:f.y,durationMs:c.durationMs})}let g=await h.perform(u,{timeoutMs:m.commandTimeoutMs});if(!I)try{let c=$()?400:200,f=await h.settle({maxMs:c});f.settled||process.stderr.write(` \u26A0 auto-wait timed out after ${f.elapsed??c}ms. next command may see mid-animation state. use \`rnx do settle\` for a longer wait.
5
5
  `)}catch{}return console.log(b?JSON.stringify(g):` completed ${g.completed} batched ${g.completed===1?"step":"steps"} in ${g.durationMs}ms`),0}catch(u){return u instanceof y&&b?console.log(JSON.stringify(u.result)):console.error(` do chain failed: ${u instanceof Error?u.message:u}`),1}finally{h?.close()}}export{O as hasDoChain,D as parseDoChainActions,Y as runDoChain};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.371 | (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-7ASCDKA3.js";import{a,b,c,d,e,f,g}from"./chunk-42YOIDLR.js";import"./chunk-2LH4DYPM.js";import"./chunk-SHLJYXIN.js";import"./chunk-WLRIPAGJ.js";import"./chunk-CJQXP4XM.js";import"./chunk-Y7SKGRAV.js";import"./chunk-OF5OBB67.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 +1,4 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.371 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a}from"./chunk-A72MIIJI.js";import"./chunk-DKSZZABN.js";export{a as isAgentEnv};
4
+ import{a}from"./chunk-S3AH2O67.js";import"./chunk-OF5OBB67.js";export{a as isAgentEnv};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.371 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{c as R,d as L}from"./chunk-RV76U3EI.js";import{t as x,v as A,z as b}from"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-FBMNYSSW.js";import"./chunk-DKSZZABN.js";import{spawnSync as T}from"node:child_process";import{existsSync as V,mkdirSync as W,unlinkSync as N,writeFileSync as E}from"node:fs";import{homedir as j}from"node:os";import{dirname as q,extname as H,join as K,resolve as I}from"node:path";var n=e=>new Promise(a=>setTimeout(a,e)),X=["--out","--fps","--script","--slow"],J=["--keep-three"],Q=["--background","--gradient","--gradient-angle","--colorway","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--room","--focus","--focus-amount","--focus-range"],Y=12e4,Z=16e6;function c(e,a){let s=e.indexOf(a);return s>=0?e[s+1]:void 0}async function r(e,a,s=3e4){return await e.send({type:"evaluate",code:a},{timeoutMs:s})}async function ae(e,a){if(e.length===0||e.includes("--help")||e.includes("-h"))return console.log(`
4
+ import{c as R,d as L}from"./chunk-HZ365EMS.js";import{t as x,v as A,z as b}from"./chunk-ESWSXF55.js";import"./chunk-WLRIPAGJ.js";import"./chunk-ERBGQEJ5.js";import"./chunk-Y7SKGRAV.js";import"./chunk-OF5OBB67.js";import{spawnSync as T}from"node:child_process";import{existsSync as V,mkdirSync as W,unlinkSync as N,writeFileSync as E}from"node:fs";import{homedir as j}from"node:os";import{dirname as q,extname as H,join as K,resolve as I}from"node:path";var n=e=>new Promise(a=>setTimeout(a,e)),X=["--out","--fps","--script","--slow"],J=["--keep-three"],Q=["--background","--gradient","--gradient-angle","--colorway","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--room","--focus","--focus-amount","--focus-range"],Y=12e4,Z=16e6;function c(e,a){let s=e.indexOf(a);return s>=0?e[s+1]:void 0}async function r(e,a,s=3e4){return await e.send({type:"evaluate",code:a},{timeoutMs:s})}async function ae(e,a){if(e.length===0||e.includes("--help")||e.includes("-h"))return console.log(`
5
5
  rnx film \u2014 record a flow flat, replay it on the 3d stage, save a clip
6
6
 
7
7
  usage:
@@ -35,7 +35,7 @@ examples:
35
35
  rnx film flows/swap.yaml --script hero-arc --background gradient-tide --out ~/Desktop/swap-3d.mp4
36
36
  rnx film flows/login.yaml --colorway deep-blue --environment on --env-shape pane --room on
37
37
  `),0;let s=e.find(d=>!d.startsWith("--")&&/\.ya?ml$/.test(d));if(!s||!V(I(s)))return console.error(` film: flow file not found: ${s??"(none given)"}`),1;let P=Number.parseInt(c(e,"--fps")??"30",10),h=c(e,"--script")??"hero-arc",z=e.includes("--keep-three"),v=s.replace(/^.*\//,"").replace(/\.ya?ml$/,""),O=c(e,"--out"),l=I(O??K(j(),"Desktop","sootsim-films",`${v}.webm`)),S=H(l).toLowerCase()===".mp4";if(S&&T("ffmpeg",["-version"]).status!==0)return console.error(" film: --out ends in .mp4 but ffmpeg is not installed"),console.error(" install ffmpeg or use a .webm output path"),1;let C=x(e,{port:a.port,stripValueFlags:[...X,...Q],stripBooleanFlags:J}),t=A({...C,commandTimeoutMs:6e4});try{let d=await r(t,`(() => { const s = window.SootSim?.bridges?.settings?.get?.() || {}
38
- return { threeMode: s.threeMode === true, editor: s.threeRecordingEditor === true } })()`);if(console.log(` film: recording flow ${v} on the flat canvas`),!await r(t,"(async () => !!(await window.SootSim?.bridges?.startRecording?.('video', undefined, { skipEntitlement: true })))()"))return console.error(" film: engine recording store did not start (is @sootsim/plugin-recording installed?)"),1;let D=Date.now();await n(500);let{runFlowPlayback:G}=await import("./flow-4GWW5DYT.js"),m=[s],y=c(e,"--sim");y&&m.push("--sim",y);let k=c(e,"--slow");k&&m.push("--slow",k);let f=await G(m);await n(400);let u=Math.min(Date.now()-D,Y);if(await r(t,"window.SootSim?.bridges?.stopRecording?.()"),f!==0)return console.error(` film: flow failed (exit ${f}) \u2014 not filming a broken take`),f;let F=!1;for(let o=0;o<50;o++){await n(400);let i=await r(t,`(() => { const s = window.SootSim?.bridges?.getRecordingState?.()
38
+ return { threeMode: s.threeMode === true, editor: s.threeRecordingEditor === true } })()`);if(console.log(` film: recording flow ${v} on the flat canvas`),!await r(t,"(async () => !!(await window.SootSim?.bridges?.startRecording?.('video', undefined, { skipEntitlement: true })))()"))return console.error(" film: engine recording store did not start (is @sootsim/plugin-recording installed?)"),1;let D=Date.now();await n(500);let{runFlowPlayback:G}=await import("./flow-6BZSWNHG.js"),m=[s],y=c(e,"--sim");y&&m.push("--sim",y);let k=c(e,"--slow");k&&m.push("--slow",k);let f=await G(m);await n(400);let u=Math.min(Date.now()-D,Y);if(await r(t,"window.SootSim?.bridges?.stopRecording?.()"),f!==0)return console.error(` film: flow failed (exit ${f}) \u2014 not filming a broken take`),f;let F=!1;for(let o=0;o<50;o++){await n(400);let i=await r(t,`(() => { const s = window.SootSim?.bridges?.getRecordingState?.()
39
39
  return { state: s?.state, hasBlob: !!s?.lastVideoBlob } })()`);if(i?.state==="idle"&&i.hasBlob){F=!0;break}}if(!F)return console.error(" film: flow recording never produced a video blob"),1;console.log(` film: flow captured (${(u/1e3).toFixed(1)}s)`),await r(t,"window.SootSim?.bridges?.settings?.set?.('threeMode', true)"),await R(t),await n(1400),await r(t,"window.SootSim?.bridges?.settings?.set?.('threeRecordingEditor', true)");let _=!1;for(let o=0;o<60;o++)if(await n(250),await r(t,`(() => { const rs = window.SootSim?.replayStore
40
40
  return rs?.value?.preview?.surface === 'video' && !!rs?.value?.preview?.flowVideoUrl })()`)){_=!0;break}if(!_)return console.error(" film: recording editor did not seed the replay store"),1;let p=L(e);delete p.script,p.resetPose=!0,await b(t,"SootSim.bridges.threeMode.configure",p),await n(2400),console.log(` film: filming the 3d stage (script: ${h})`);let M=await r(t,`(() => {
41
41
  const c = window.SootSim?.bridges?.threeMode?.getCanvas?.()
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.371 | (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-5PPVVGLH.js";import"./chunk-OWDJQWJ7.js";import"./chunk-JKRMBNPO.js";import{a,b}from"./chunk-MW4E5EED.js";import"./chunk-6FPXLSBJ.js";import"./chunk-7Q4WHJDH.js";import"./chunk-PTWMX4AA.js";import"./chunk-2QW3JH6T.js";import"./chunk-IPNDXGVA.js";import"./chunk-SH2HXHR2.js";import"./chunk-RYJTPZCX.js";import"./chunk-WCB5XPCH.js";import"./chunk-LFANRLWK.js";import"./chunk-DP6RGTNN.js";import"./chunk-NQ4CI2VI.js";import"./chunk-42YOIDLR.js";import"./chunk-2LH4DYPM.js";import"./chunk-6AZKZ5AJ.js";import"./chunk-AVIH3TAZ.js";import"./chunk-SHLJYXIN.js";import"./chunk-2W4YBCPX.js";import"./chunk-KL34TRNW.js";import"./chunk-BNS5LNEU.js";import"./chunk-ADJSGO55.js";import"./chunk-HV3WOWQM.js";import"./chunk-WHZE63R2.js";import"./chunk-IYU2EOIU.js";import"./chunk-UPMR6Y5P.js";import"./chunk-OF3U4SZO.js";import"./chunk-AGZZWLEL.js";import"./chunk-ESWSXF55.js";import"./chunk-WLRIPAGJ.js";import"./chunk-JUTLQ3GX.js";import"./chunk-ERBGQEJ5.js";import"./chunk-UHYAY3RU.js";import"./chunk-KHGXEU4L.js";import"./chunk-CJQXP4XM.js";import"./chunk-7TWD4P6J.js";import"./chunk-S3AH2O67.js";import"./chunk-Y7SKGRAV.js";import"./chunk-OQPZOEEP.js";import"./chunk-OF5OBB67.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};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.371 | (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-FLNGSIBL.js";import"./chunk-763GBI7G.js";import"./chunk-UPMR6Y5P.js";import"./chunk-7YB46LGI.js";import"./chunk-OF3U4SZO.js";import"./chunk-AGZZWLEL.js";import"./chunk-ESWSXF55.js";import"./chunk-WLRIPAGJ.js";import"./chunk-KHGXEU4L.js";import"./chunk-Y7SKGRAV.js";import"./chunk-IX7Z6ZVJ.js";import"./chunk-OQPZOEEP.js";import"./chunk-OF5OBB67.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.371 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import"./chunk-B5NW4TT3.js";import{b as n}from"./chunk-5QFJFASW.js";import"./chunk-DKSZZABN.js";var e=["do","get"];function i(t){if(t.command)return t;let o=t.commandArgs.find(r=>!r.startsWith("-"));if(!o)return t;for(let r of e)if(n(r,o))return{...t,command:r};return t}export{i as resolveHiddenRuntimeAlias};
4
+ import"./chunk-UHYAY3RU.js";import{b as n}from"./chunk-KHGXEU4L.js";import"./chunk-OF5OBB67.js";var e=["do","get"];function i(t){if(t.command)return t;let o=t.commandArgs.find(r=>!r.startsWith("-"));if(!o)return t;for(let r of e)if(n(r,o))return{...t,command:r};return t}export{i as resolveHiddenRuntimeAlias};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.371 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
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,X,Y,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-FBMNYSSW.js";import"./chunk-DKSZZABN.js";export{b as ACTIVE_RUNTIME_FILE,e as CONFIG_FILE,f as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,d as DEV_BRIDGES_DIR,a as SOOTSIM_HOME_ENV,O as activeRuntimeDir,m as activeRuntimeFile,v as cacheDir,r as cameraFixturesDir,W as claimDaemonLockfile,z as configFilePath,K as consumeRuntimeUpgradeNotice,t as daemonAppBundlePath,s as daemonAppDir,u as daemonAppLauncherPath,w as daemonLockfilePath,y as devBridgeLockfilePath,x as devBridgesDir,n as electronDir,o as electronUserDataDir,p as electronVersionDir,L as ensureSootsimHome,R as isDaemonLockfileFresh,S as isDevBridgeLockfileFresh,i as isDevWorkstation,C as isOnboardingComplete,h as isSootsimDevCheckout,q as profilesDir,M as readActiveRuntime,P as readDaemonLockfile,Q as readDevBridgeLockfiles,T as readLiveRuntimeVersions,H as readOrCreateAnonymousId,F as readPrivacyPreferences,A as readSharedConfig,D as readSimulatorDriverPreference,X as removeDaemonLockfile,Y as removeDevBridgeLockfile,l as runtimeDir,I as runtimeUpgradeNoticePath,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,N as writeActiveRuntime,U as writeDaemonLockfile,V as writeDevBridgeLockfile,E as writeOnboardingPreferences,G as writePrivacyPreferences,J as writeRuntimeUpgradeNotice,B as writeSharedConfig};
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,X,Y,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-Y7SKGRAV.js";import"./chunk-OF5OBB67.js";export{b as ACTIVE_RUNTIME_FILE,e as CONFIG_FILE,f as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,d as DEV_BRIDGES_DIR,a as SOOTSIM_HOME_ENV,O as activeRuntimeDir,m as activeRuntimeFile,v as cacheDir,r as cameraFixturesDir,W as claimDaemonLockfile,z as configFilePath,K as consumeRuntimeUpgradeNotice,t as daemonAppBundlePath,s as daemonAppDir,u as daemonAppLauncherPath,w as daemonLockfilePath,y as devBridgeLockfilePath,x as devBridgesDir,n as electronDir,o as electronUserDataDir,p as electronVersionDir,L as ensureSootsimHome,R as isDaemonLockfileFresh,S as isDevBridgeLockfileFresh,i as isDevWorkstation,C as isOnboardingComplete,h as isSootsimDevCheckout,q as profilesDir,M as readActiveRuntime,P as readDaemonLockfile,Q as readDevBridgeLockfiles,T as readLiveRuntimeVersions,H as readOrCreateAnonymousId,F as readPrivacyPreferences,A as readSharedConfig,D as readSimulatorDriverPreference,X as removeDaemonLockfile,Y as removeDevBridgeLockfile,l as runtimeDir,I as runtimeUpgradeNoticePath,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,N as writeActiveRuntime,U as writeDaemonLockfile,V as writeDevBridgeLockfile,E as writeOnboardingPreferences,G as writePrivacyPreferences,J as writeRuntimeUpgradeNotice,B as writeSharedConfig};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.371 | (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-MW4E5EED.js";import"./chunk-6FPXLSBJ.js";import"./chunk-7Q4WHJDH.js";import"./chunk-PTWMX4AA.js";import"./chunk-RYJTPZCX.js";import"./chunk-WCB5XPCH.js";import"./chunk-LFANRLWK.js";import"./chunk-DP6RGTNN.js";import"./chunk-NQ4CI2VI.js";import"./chunk-42YOIDLR.js";import"./chunk-2LH4DYPM.js";import"./chunk-6AZKZ5AJ.js";import"./chunk-AVIH3TAZ.js";import"./chunk-SHLJYXIN.js";import"./chunk-2W4YBCPX.js";import"./chunk-KL34TRNW.js";import"./chunk-BNS5LNEU.js";import"./chunk-ADJSGO55.js";import"./chunk-HV3WOWQM.js";import"./chunk-WHZE63R2.js";import"./chunk-IYU2EOIU.js";import"./chunk-UPMR6Y5P.js";import"./chunk-OF3U4SZO.js";import"./chunk-AGZZWLEL.js";import"./chunk-ESWSXF55.js";import"./chunk-WLRIPAGJ.js";import"./chunk-JUTLQ3GX.js";import"./chunk-ERBGQEJ5.js";import"./chunk-UHYAY3RU.js";import"./chunk-KHGXEU4L.js";import"./chunk-CJQXP4XM.js";import"./chunk-7TWD4P6J.js";import"./chunk-S3AH2O67.js";import"./chunk-Y7SKGRAV.js";import"./chunk-OQPZOEEP.js";import"./chunk-OF5OBB67.js";export{a as printShellPerfReport,b as runInspect};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.371 | (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-VEFSHPSU.js";import"./chunk-SHLJYXIN.js";import"./chunk-ERBGQEJ5.js";import"./chunk-H4DU457S.js";import"./chunk-OF5OBB67.js";export{a as runInstallDesktop};
@@ -0,0 +1,26 @@
1
+ /*! rnx v0.1.371 | (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 k,d as I}from"./chunk-SH2HXHR2.js";import{c as p}from"./chunk-ERBGQEJ5.js";import"./chunk-Y7SKGRAV.js";import{a as w}from"./chunk-OQPZOEEP.js";import"./chunk-OF5OBB67.js";import{exec as T}from"node:child_process";import{randomBytes as R}from"node:crypto";import L from"node:http";var O=process.env.SOOTSIM_AUTH_ORIGIN||"https://contrast.dev";function _(t){return t||(process.env.SOOTSIM_AUTH_ORIGIN?process.env.SOOTSIM_AUTH_ORIGIN:process.env.SOOTSIM_UPLOAD_ORIGIN?process.env.SOOTSIM_UPLOAD_ORIGIN:O)}function P(){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: ${O})
12
+ override with SOOTSIM_AUTH_ORIGIN env var
13
+ -h, --help
14
+ `)}function U(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 A(t){let e=process.platform==="darwin"?`open "${t}"`:process.platform==="win32"?`start "" "${t}"`:`xdg-open "${t}"`;T(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">${w.name}</h1>
21
+ <p style="color:#ccc">${t}</p>
22
+ </div>
23
+ </body>
24
+ </html>`}async function M(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 G(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 B(t){(t.includes("--help")||t.includes("-h"))&&(P(),p(0));let e=[...t],r=_(U(e,"--origin"));if(G(r)){console.log(` detected local origin (${r}) \u2014 signing in as dev user`);let o=await M(r);if(o.ok){k({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:r,source:"cli"});let u=await I(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=R(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=L.createServer((a,n)=>{try{let i=new URL(a.url||"/","http://127.0.0.1"),S=i.searchParams.get("state"),b=i.searchParams.get("token"),$=i.searchParams.get("email")||void 0,x=i.searchParams.get("userId")||void 0,h=i.searchParams.get("error");if(S!==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(!b){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:b,email:$,userId:x})}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
+ `),A(n.toString())})});s.ok||(console.error(` login failed: ${s.error}`),p(1)),k({token:s.token,user:s.userId?{id:s.userId,email:s.email}:null,origin:r,source:"cli"});let v=await I(r),y=v?.user?.email||s.email||v?.user?.id||s.userId;console.log(` signed in${y?` as ${y}`:""}`)}export{B as runLogin};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.371 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as e,c as t}from"./chunk-ZW6JXEVX.js";import"./chunk-FBMNYSSW.js";import"./chunk-DKSZZABN.js";async function r(){let o=e();if(!o?.token){console.log(" not signed in");return}try{await fetch(`${o.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${o.token}`}})}catch{}t(),console.log(" signed out")}export{r as runLogout};
4
+ import{a as e,c as t}from"./chunk-SH2HXHR2.js";import"./chunk-Y7SKGRAV.js";import"./chunk-OF5OBB67.js";async function r(){let o=e();if(!o?.token){console.log(" not signed in");return}try{await fetch(`${o.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${o.token}`}})}catch{}t(),console.log(" signed out")}export{r as runLogout};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.371 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{c as E,d as O,g as L,h as R,i as U}from"./chunk-WUR4FXWT.js";import"./chunk-SSBZA5VZ.js";import"./chunk-3NLB5LCN.js";import{a as A}from"./chunk-TIB3CTRX.js";import"./chunk-2PVVIPQS.js";import"./chunk-ZNNE5MAV.js";import{a as S}from"./chunk-YLNSLMQM.js";import{b as $,c as F,d as M,e as T}from"./chunk-ROISJKH3.js";import{a as k}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"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";import*as n from"fs";import*as a from"path";var I=[".maestro","maestro"];function W(){console.log(`
4
+ import{c as E,d as O,g as L,h as R,i as U}from"./chunk-5PPVVGLH.js";import"./chunk-OWDJQWJ7.js";import"./chunk-JKRMBNPO.js";import{a as A}from"./chunk-MW4E5EED.js";import"./chunk-6FPXLSBJ.js";import"./chunk-7Q4WHJDH.js";import{a as S}from"./chunk-PTWMX4AA.js";import{b as $,c as F,d as M,e as T}from"./chunk-2QW3JH6T.js";import{a as k}from"./chunk-IPNDXGVA.js";import"./chunk-SH2HXHR2.js";import"./chunk-RYJTPZCX.js";import"./chunk-WCB5XPCH.js";import"./chunk-LFANRLWK.js";import"./chunk-DP6RGTNN.js";import"./chunk-NQ4CI2VI.js";import"./chunk-42YOIDLR.js";import"./chunk-2LH4DYPM.js";import"./chunk-6AZKZ5AJ.js";import"./chunk-AVIH3TAZ.js";import"./chunk-SHLJYXIN.js";import"./chunk-2W4YBCPX.js";import"./chunk-KL34TRNW.js";import"./chunk-BNS5LNEU.js";import"./chunk-ADJSGO55.js";import"./chunk-HV3WOWQM.js";import"./chunk-WHZE63R2.js";import"./chunk-IYU2EOIU.js";import"./chunk-UPMR6Y5P.js";import"./chunk-OF3U4SZO.js";import"./chunk-AGZZWLEL.js";import"./chunk-ESWSXF55.js";import"./chunk-WLRIPAGJ.js";import"./chunk-JUTLQ3GX.js";import"./chunk-ERBGQEJ5.js";import"./chunk-UHYAY3RU.js";import"./chunk-KHGXEU4L.js";import"./chunk-CJQXP4XM.js";import"./chunk-7TWD4P6J.js";import"./chunk-S3AH2O67.js";import"./chunk-Y7SKGRAV.js";import"./chunk-OQPZOEEP.js";import"./chunk-OF5OBB67.js";import*as n from"fs";import*as a from"path";var I=[".maestro","maestro"];function W(){console.log(`
5
5
  rnx maestro \u2014 author and run Maestro YAML flows against rnx
6
6
 
7
7
  usage:
@@ -95,7 +95,7 @@ appId: com.example.app
95
95
  - inputText: "secret123"
96
96
  - tapOn: "Sign in"
97
97
  - assertVisible: "Welcome"
98
- `,"utf8"),console.log(` + wrote ${e}`),console.log(" next: rnx maestro test .maestro/login.yaml"),0)}async function Q(r,s={}){if(r.includes("--help")||r.includes("-h"))return W(),0;if(r.includes("--list-compat"))return D(),0;let e;try{e=N(r)}catch(o){return console.error(` error: ${o.message}`),1}e=R(e);let t=process.cwd(),i=e[0];if(i==="init")return _(t);if(i==="generate"){let{runMaestroGenerate:o}=await import("./maestro-generate-KCK6RK2C.js");return o(e.slice(1))}if(i==="start"||i==="keep"||i==="good"||i==="end"||i==="validate")return U(e);e=J(e);let c=null,f;if(i==="test"){let o=e.slice(1).find(u=>!j(u));o?(c=a.resolve(t,o),f=e.slice(1).filter(u=>u!==o)):(c=P(t),f=e.slice(1))}else i&&!j(i)?(c=a.resolve(t,i),f=e.slice(1)):(c=P(t),f=e);if(!c)return console.error(`
98
+ `,"utf8"),console.log(` + wrote ${e}`),console.log(" next: rnx maestro test .maestro/login.yaml"),0)}async function Q(r,s={}){if(r.includes("--help")||r.includes("-h"))return W(),0;if(r.includes("--list-compat"))return D(),0;let e;try{e=N(r)}catch(o){return console.error(` error: ${o.message}`),1}e=R(e);let t=process.cwd(),i=e[0];if(i==="init")return _(t);if(i==="generate"){let{runMaestroGenerate:o}=await import("./maestro-generate-YKIVKOB3.js");return o(e.slice(1))}if(i==="start"||i==="keep"||i==="good"||i==="end"||i==="validate")return U(e);e=J(e);let c=null,f;if(i==="test"){let o=e.slice(1).find(u=>!j(u));o?(c=a.resolve(t,o),f=e.slice(1).filter(u=>u!==o)):(c=P(t),f=e.slice(1))}else i&&!j(i)?(c=a.resolve(t,i),f=e.slice(1)):(c=P(t),f=e);if(!c)return console.error(`
99
99
  error: no maestro flows found.
100
100
  expected one of: ${I.map(o=>`./${o}/`).join(", ")}
101
101
  or pass a flow explicitly: rnx maestro test path/to/flow.yaml
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.369 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.371 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as x}from"./chunk-YLNSLMQM.js";import{b as A,d as E,e as O}from"./chunk-ROISJKH3.js";import{a as S,b as T}from"./chunk-JH5KE2OI.js";import"./chunk-ZW6JXEVX.js";import"./chunk-AKJYEX54.js";import"./chunk-UDXQCEJU.js";import{h as v}from"./chunk-D6MGELKZ.js";import"./chunk-JLOOLA47.js";import"./chunk-UQJY6O72.js";import{t as y,v as b}from"./chunk-H2GB2PLY.js";import"./chunk-ZEF57HQO.js";import"./chunk-FBMNYSSW.js";import"./chunk-MXWME7ET.js";import"./chunk-DKSZZABN.js";import{mkdtempSync as B,writeFileSync as C}from"fs";import{tmpdir as N}from"os";import{join as _}from"path";var j=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",P=18e3,V=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function J(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var M=new Set(["--origin","--preview-origin","--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]);function G(e){for(let t=0;t<e.length;t++){let r=e[t];if(r){if(M.has(r)){t+=1;continue}if(!r.startsWith("-"))return{prompt:r,index:t}}}return null}function H(e,t){return e.filter((r,o)=>o!==t)}async function Y(e,t){let r=H(e,t),o=y(r,{stripBooleanFlags:["--new","--headless","--headed","--electron","--preview-open"],stripValueFlags:[...M]}),i=b(o);try{let n=await v(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),s=[typeof n.nodeCount=="number"?`nodes: ${n.nodeCount}`:"",n.tree||""].filter(Boolean).join(`
4
+ import{a as x}from"./chunk-PTWMX4AA.js";import{b as A,d as E,e as O}from"./chunk-2QW3JH6T.js";import{a as S,b as T}from"./chunk-IPNDXGVA.js";import"./chunk-SH2HXHR2.js";import"./chunk-6AZKZ5AJ.js";import"./chunk-AVIH3TAZ.js";import{h as v}from"./chunk-BNS5LNEU.js";import"./chunk-HV3WOWQM.js";import"./chunk-IYU2EOIU.js";import{t as y,v as b}from"./chunk-ESWSXF55.js";import"./chunk-WLRIPAGJ.js";import"./chunk-ERBGQEJ5.js";import"./chunk-Y7SKGRAV.js";import"./chunk-OQPZOEEP.js";import"./chunk-OF5OBB67.js";import{mkdtempSync as B,writeFileSync as C}from"fs";import{tmpdir as N}from"os";import{join as _}from"path";var j=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",P=18e3,V=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function J(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var M=new Set(["--origin","--preview-origin","--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]);function G(e){for(let t=0;t<e.length;t++){let r=e[t];if(r){if(M.has(r)){t+=1;continue}if(!r.startsWith("-"))return{prompt:r,index:t}}}return null}function H(e,t){return e.filter((r,o)=>o!==t)}async function Y(e,t){let r=H(e,t),o=y(r,{stripBooleanFlags:["--new","--headless","--headed","--electron","--preview-open"],stripValueFlags:[...M]}),i=b(o);try{let n=await v(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),s=[typeof n.nodeCount=="number"?`nodes: ${n.nodeCount}`:"",n.tree||""].filter(Boolean).join(`
5
5
  `);return s.length>P?s.slice(0,P)+`
6
6
  [tree truncated]`:s}finally{i.close()}}var K=`
7
7
  You write Maestro-compatible rnx YAML flows from a user's plain-language test goal.
@@ -32,5 +32,5 @@ ${t||"[no tree available]"}
32
32
 
33
33
  Generate the shortest replayable flow that verifies the goal from this current state.
34
34
  `.trim()}async function z(e){let t=await fetch(`${e.origin.replace(/\/$/,"")}/api/llm`,{method:"POST",headers:{"content-type":"application/json",authorization:e.authHeader},body:JSON.stringify({modelId:j,context:{systemPrompt:K,messages:[{role:"user",content:X(e.prompt,e.describe),timestamp:Date.now()}]},options:{maxTokens:1800,temperature:.2},threadId:null}),signal:AbortSignal.timeout(V)});if(!t.ok||!t.body){let a=await t.text().catch(()=>"");throw new Error(`/api/llm ${t.status}${a?`: ${a}`:""}`)}let r=t.body.getReader(),o=new TextDecoder,i=[],n="",c=a=>{let l=a.trim();if(!l)return;let u=JSON.parse(l);if(u.type==="text_delta"&&u.delta)i.push(u.delta);else if(u.type==="error")throw new Error(u.errorMessage||"llm error")};for(;;){let{value:a,done:l}=await r.read();if(l)break;n+=o.decode(a,{stream:!0});let u;for(;(u=n.indexOf(`
35
- `))>=0;)c(n.slice(0,u)),n=n.slice(u+1)}n+=o.decode(),n.trim()&&c(n);let s=i.join("").trim();if(!s)throw new Error("llm returned an empty test flow");return s}function W(e){let t=e.match(/```(?:json)?\s*([\s\S]*?)```/i),r=t?t[1]:e.slice(e.indexOf("{"),e.lastIndexOf("}")+1);return JSON.parse(r)}function F(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function q(e){let t=W(e);if(!F(t))throw new Error("llm did not return a JSON object");let r=typeof t.summary=="string"&&t.summary.trim()?t.summary.trim().slice(0,500):"rnx generated test",o=t.steps;if(!Array.isArray(o)||o.length===0)throw new Error("llm returned no flow steps");let i=o.map((n,c)=>{if(!F(n))throw new Error(`flow step ${c+1} is not an object`);return n});return{summary:r,steps:i,yamlText:x.stringify(i)}}function Q(e,t,r,o){let i=[r,"--preview","--preview-origin",o,"--billing-kind","test_run"],n=new Set(["--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]),c=new Set(["--new","--headless","--headed","--electron","--preview-open","--no-shell","--shell-only"]);for(let s=0;s<e.length;s++){if(s===t)continue;let a=e[s];if(a==="--origin"||a==="--preview-origin"){s+=1;continue}if(a==="--public-origin"){let l=e[s+1];l&&i.push("--preview-public-origin",l),s+=1;continue}if(n.has(a)){let l=e[s+1];l&&i.push(a,l),s+=1;continue}c.has(a)&&i.push(a)}return i}async function le(e){let t=G(e);if(!t)return console.error(' usage: rnx maestro generate "test goal"'),1;let{prompt:r,index:o}=t,i=S();if(!i||i.kind==="github")return console.error(' rnx maestro generate "<goal>" needs a login or RNX_API_KEY.'),console.error(" API keys must include preview_upload and llm scopes."),1;let n=T(i),c=await O(J(e,["--origin","--preview-origin"]));console.log(" inspecting current sim\u2026");let s=await Y(e,o);console.log(" generating Maestro flow\u2026");let a=await z({prompt:r,describe:s,origin:c,authHeader:n}),l=q(a),u=B(_(N(),"sootsim-maestro-generate-")),p=_(u,"flow.yaml");C(p,l.yamlText),console.log(` flow: ${p}`);let k=Date.now(),{runFlowPlayback:I,getLastFlowPreviewUploadResult:D,getLastFlowTraceSteps:L}=await import("./flow-4GWW5DYT.js"),$=Q(e,o,p,c),w=await I($),m=D(),h=L(),R=h.find(U=>U.status==="failure"),g=w===0?"passed":"failed",d=await E({origin:c,kind:"maestro",prompt:r,summary:l.summary,status:g,failureMessage:g==="failed"?R?.error??"flow playback failed":null,previewShareId:m?.shareId??null,owner:f(e,"--owner")??null,repo:f(e,"--repo")??null,durationMs:Date.now()-k,flowYamlSizeBytes:Buffer.byteLength(l.yamlText,"utf8"),...A(h),auth:i});return console.log(`
35
+ `))>=0;)c(n.slice(0,u)),n=n.slice(u+1)}n+=o.decode(),n.trim()&&c(n);let s=i.join("").trim();if(!s)throw new Error("llm returned an empty test flow");return s}function W(e){let t=e.match(/```(?:json)?\s*([\s\S]*?)```/i),r=t?t[1]:e.slice(e.indexOf("{"),e.lastIndexOf("}")+1);return JSON.parse(r)}function F(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function q(e){let t=W(e);if(!F(t))throw new Error("llm did not return a JSON object");let r=typeof t.summary=="string"&&t.summary.trim()?t.summary.trim().slice(0,500):"rnx generated test",o=t.steps;if(!Array.isArray(o)||o.length===0)throw new Error("llm returned no flow steps");let i=o.map((n,c)=>{if(!F(n))throw new Error(`flow step ${c+1} is not an object`);return n});return{summary:r,steps:i,yamlText:x.stringify(i)}}function Q(e,t,r,o){let i=[r,"--preview","--preview-origin",o,"--billing-kind","test_run"],n=new Set(["--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]),c=new Set(["--new","--headless","--headed","--electron","--preview-open","--no-shell","--shell-only"]);for(let s=0;s<e.length;s++){if(s===t)continue;let a=e[s];if(a==="--origin"||a==="--preview-origin"){s+=1;continue}if(a==="--public-origin"){let l=e[s+1];l&&i.push("--preview-public-origin",l),s+=1;continue}if(n.has(a)){let l=e[s+1];l&&i.push(a,l),s+=1;continue}c.has(a)&&i.push(a)}return i}async function le(e){let t=G(e);if(!t)return console.error(' usage: rnx maestro generate "test goal"'),1;let{prompt:r,index:o}=t,i=S();if(!i||i.kind==="github")return console.error(' rnx maestro generate "<goal>" needs a login or RNX_API_KEY.'),console.error(" API keys must include preview_upload and llm scopes."),1;let n=T(i),c=await O(J(e,["--origin","--preview-origin"]));console.log(" inspecting current sim\u2026");let s=await Y(e,o);console.log(" generating Maestro flow\u2026");let a=await z({prompt:r,describe:s,origin:c,authHeader:n}),l=q(a),u=B(_(N(),"sootsim-maestro-generate-")),p=_(u,"flow.yaml");C(p,l.yamlText),console.log(` flow: ${p}`);let k=Date.now(),{runFlowPlayback:I,getLastFlowPreviewUploadResult:D,getLastFlowTraceSteps:L}=await import("./flow-6BZSWNHG.js"),$=Q(e,o,p,c),w=await I($),m=D(),h=L(),R=h.find(U=>U.status==="failure"),g=w===0?"passed":"failed",d=await E({origin:c,kind:"maestro",prompt:r,summary:l.summary,status:g,failureMessage:g==="failed"?R?.error??"flow playback failed":null,previewShareId:m?.shareId??null,owner:f(e,"--owner")??null,repo:f(e,"--repo")??null,durationMs:Date.now()-k,flowYamlSizeBytes:Buffer.byteLength(l.yamlText,"utf8"),...A(h),auth:i});return console.log(`
36
36
  result: ${g}`),d&&console.log(` run: ${d.id}`),m?.previewUrl&&console.log(` preview: ${m.previewUrl}`),d?.traceUrl&&console.log(` replay: ${d.traceUrl}`),w}export{le as runMaestroGenerate};