rnxsim 0.1.335 → 0.1.337

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 (272) hide show
  1. package/README.md +104 -76
  2. package/cli/auth.ts +2 -2
  3. package/cli/bin.ts +7 -3
  4. package/cli/bridge-flow-runner.ts +2 -2
  5. package/cli/commands/agent-wrapper.ts +1 -1
  6. package/cli/commands/agent.ts +12 -12
  7. package/cli/commands/app-fonts.ts +1 -1
  8. package/cli/commands/assert.ts +7 -7
  9. package/cli/commands/auth.ts +4 -4
  10. package/cli/commands/camera.ts +13 -13
  11. package/cli/commands/cleanup.ts +6 -6
  12. package/cli/commands/compat.ts +4 -4
  13. package/cli/commands/config.ts +2 -2
  14. package/cli/commands/control.ts +37 -43
  15. package/cli/commands/cpu-profile.ts +2 -2
  16. package/cli/commands/daemon-mac-app.ts +2 -2
  17. package/cli/commands/daemon.ts +12 -12
  18. package/cli/commands/debug.ts +22 -22
  19. package/cli/commands/desktop.ts +3 -3
  20. package/cli/commands/detox.ts +17 -17
  21. package/cli/commands/device.ts +9 -9
  22. package/cli/commands/diagnose.ts +11 -11
  23. package/cli/commands/electron.ts +7 -7
  24. package/cli/commands/film.ts +6 -6
  25. package/cli/commands/inspect/core.ts +6 -7
  26. package/cli/commands/inspect/find.ts +2 -2
  27. package/cli/commands/inspect.ts +36 -36
  28. package/cli/commands/install-desktop.ts +8 -8
  29. package/cli/commands/login.ts +6 -6
  30. package/cli/commands/maestro-generate.ts +2 -2
  31. package/cli/commands/maestro.ts +23 -23
  32. package/cli/commands/mode.ts +4 -4
  33. package/cli/commands/no-bridge-hint.ts +9 -9
  34. package/cli/commands/perf.ts +11 -11
  35. package/cli/commands/permissions.ts +5 -5
  36. package/cli/commands/profile.ts +11 -11
  37. package/cli/commands/react.ts +15 -15
  38. package/cli/commands/record.ts +15 -15
  39. package/cli/commands/report-issue.ts +2 -2
  40. package/cli/commands/reset.ts +2 -2
  41. package/cli/commands/runtime.ts +18 -18
  42. package/cli/commands/screenshot-mode.ts +5 -5
  43. package/cli/commands/screenshot.ts +12 -12
  44. package/cli/commands/screenshots-capture.ts +7 -7
  45. package/cli/commands/screenshots.ts +6 -6
  46. package/cli/commands/serve.ts +6 -6
  47. package/cli/commands/setup.ts +13 -15
  48. package/cli/commands/skills.ts +14 -14
  49. package/cli/commands/slides.ts +19 -23
  50. package/cli/commands/state.ts +2 -2
  51. package/cli/commands/storage.ts +3 -3
  52. package/cli/commands/telemetry.ts +1 -1
  53. package/cli/commands/three-mode.ts +16 -16
  54. package/cli/commands/timeline.ts +4 -4
  55. package/cli/commands/upgrade.ts +1 -1
  56. package/cli/commands/upload.ts +11 -11
  57. package/cli/commands/version.ts +3 -5
  58. package/cli/commands/what-happened.ts +11 -11
  59. package/cli/drivers/electron.ts +3 -3
  60. package/cli/hints.ts +8 -8
  61. package/cli/recording-access.ts +1 -1
  62. package/cli/ws-bridge.ts +5 -5
  63. package/dist-cli/bin.js +5 -5
  64. package/dist-cli/chunks/{agent-XSJMAFVA.js → agent-QQ3RJNRY.js} +14 -14
  65. package/dist-cli/chunks/{agent-wrapper-NFLJ5K64.js → agent-wrapper-M6SQSMRY.js} +3 -3
  66. package/dist-cli/chunks/app-fonts-F6NDV3XC.js +4 -0
  67. package/dist-cli/chunks/{assert-ILAXIYB5.js → assert-5VB3KQNK.js} +12 -12
  68. package/dist-cli/chunks/auth-PFXODKFN.js +12 -0
  69. package/dist-cli/chunks/{beta-TDR6UKJU.js → beta-WUWYHT4F.js} +2 -2
  70. package/dist-cli/chunks/camera-V3MMTKP7.js +33 -0
  71. package/dist-cli/chunks/{chunk-INBPUR4T.js → chunk-2ANFH72P.js} +11 -11
  72. package/dist-cli/chunks/chunk-2GIA5T6B.js +74 -0
  73. package/dist-cli/chunks/{chunk-GP6QEBZA.js → chunk-4FRSEZ7Z.js} +1 -1
  74. package/dist-cli/chunks/{chunk-USGOQ3YJ.js → chunk-4GXBZHNA.js} +2 -2
  75. package/dist-cli/chunks/{chunk-R3CMECGC.js → chunk-4HESY5E7.js} +4 -4
  76. package/dist-cli/chunks/{chunk-WKT7YM5Q.js → chunk-4VJEXQGD.js} +1 -1
  77. package/dist-cli/chunks/{chunk-FE6ZHPKD.js → chunk-5LJNNHZH.js} +1 -1
  78. package/dist-cli/chunks/{chunk-I2HQB5NN.js → chunk-5QXGSTYI.js} +2 -2
  79. package/dist-cli/chunks/{chunk-FJSHIWAM.js → chunk-5SHAOQHJ.js} +2 -2
  80. package/dist-cli/chunks/{chunk-CGZWLSYD.js → chunk-5UPRBMIG.js} +1 -1
  81. package/dist-cli/chunks/{chunk-ZTM2MKNI.js → chunk-5ZEFRPCC.js} +1 -1
  82. package/dist-cli/chunks/{chunk-RTD3CPDQ.js → chunk-6ART4XVJ.js} +23 -23
  83. package/dist-cli/chunks/{chunk-MTD6IAEA.js → chunk-6CAUT2LH.js} +1 -1
  84. package/dist-cli/chunks/{chunk-ZYHCWCMM.js → chunk-7ATIH7OU.js} +1 -1
  85. package/dist-cli/chunks/{chunk-RVUGKXJD.js → chunk-7Q4QKHMA.js} +1 -1
  86. package/dist-cli/chunks/{chunk-MTNIDSOA.js → chunk-ABK2V2PR.js} +1 -1
  87. package/dist-cli/chunks/{chunk-TL4DNDDY.js → chunk-B53ILAHI.js} +2 -2
  88. package/dist-cli/chunks/{chunk-POC3QTA6.js → chunk-BSSVLFZR.js} +2 -2
  89. package/dist-cli/chunks/chunk-BVOBXTPN.js +30 -0
  90. package/dist-cli/chunks/{chunk-4KC35DMK.js → chunk-CPDEUWL5.js} +2 -2
  91. package/dist-cli/chunks/{chunk-HNQLZZJA.js → chunk-DINU267S.js} +2 -2
  92. package/dist-cli/chunks/{chunk-DCDKJ4NC.js → chunk-DQQ4CZVC.js} +2 -2
  93. package/dist-cli/chunks/{chunk-JWAY6DIH.js → chunk-EDWN2HOO.js} +18 -18
  94. package/dist-cli/chunks/{chunk-3CS4EUMG.js → chunk-EWVG4A3B.js} +2 -2
  95. package/dist-cli/chunks/{chunk-RTEJXUXN.js → chunk-F3NKCQHM.js} +6 -6
  96. package/dist-cli/chunks/{chunk-M7CBQ5I4.js → chunk-GEAGFYKP.js} +1 -1
  97. package/dist-cli/chunks/chunk-GGNH44PZ.js +5 -0
  98. package/dist-cli/chunks/{chunk-YSUIYK6B.js → chunk-HAHJJJUC.js} +2 -2
  99. package/dist-cli/chunks/chunk-HPJ5EKIZ.js +4 -0
  100. package/dist-cli/chunks/{chunk-IN2PZBQD.js → chunk-IBTHGFKE.js} +2 -2
  101. package/dist-cli/chunks/{chunk-ZZWO6Y7X.js → chunk-J6BYRRZQ.js} +2 -2
  102. package/dist-cli/chunks/{chunk-6Y3PVPTF.js → chunk-JK4OZ2TQ.js} +5 -5
  103. package/dist-cli/chunks/{chunk-PO3TOAED.js → chunk-KGQAO25M.js} +2 -2
  104. package/dist-cli/chunks/{chunk-J7XFINJG.js → chunk-L6UUIQE7.js} +2 -2
  105. package/dist-cli/chunks/{chunk-35XNGT5C.js → chunk-LXYLCETR.js} +1 -1
  106. package/dist-cli/chunks/{chunk-JWK5WD44.js → chunk-LZAL3DMP.js} +2 -2
  107. package/dist-cli/chunks/{chunk-3ZDOPKHE.js → chunk-M43UU7UG.js} +4 -4
  108. package/dist-cli/chunks/{chunk-ROPHZJ6P.js → chunk-M4LGUVBM.js} +2 -2
  109. package/dist-cli/chunks/{chunk-RELRA5VW.js → chunk-NCG6C5AH.js} +2 -2
  110. package/dist-cli/chunks/{chunk-42KDXJUD.js → chunk-NR5TSR2Y.js} +2 -2
  111. package/dist-cli/chunks/{chunk-R2UL5VFY.js → chunk-OCPWXT73.js} +3 -3
  112. package/dist-cli/chunks/{chunk-VV4MXLFR.js → chunk-ODKS6JUJ.js} +1 -1
  113. package/dist-cli/chunks/{chunk-F33DUJGG.js → chunk-R2WBREGQ.js} +1 -1
  114. package/dist-cli/chunks/chunk-RKY3ZNTA.js +5 -0
  115. package/dist-cli/chunks/{chunk-MGGRL2Z2.js → chunk-SW7BHOMO.js} +9 -9
  116. package/dist-cli/chunks/{chunk-GVKISFQ3.js → chunk-TJTLXG3R.js} +1 -1
  117. package/dist-cli/chunks/chunk-TNI4PW75.js +124 -0
  118. package/dist-cli/chunks/{chunk-CL3PREIE.js → chunk-UWEDNDND.js} +2 -2
  119. package/dist-cli/chunks/{chunk-IV36DY6M.js → chunk-WRID5SBV.js} +1 -1
  120. package/dist-cli/chunks/{chunk-42ALI64M.js → chunk-WUYI3XJ5.js} +2 -2
  121. package/dist-cli/chunks/{chunk-6VN5ULGQ.js → chunk-X7MHCEGG.js} +2 -2
  122. package/dist-cli/chunks/chunk-XIQFYLWD.js +15 -0
  123. package/dist-cli/chunks/{chunk-LCVUJCRJ.js → chunk-ZUK5ZQU7.js} +1 -1
  124. package/dist-cli/chunks/{cleanup-X6ZRPFDV.js → cleanup-6WBS3MUO.js} +10 -10
  125. package/dist-cli/chunks/cli-version-HUQCDGMA.js +4 -0
  126. package/dist-cli/chunks/{compat-VRXJ5J56.js → compat-2WOPKJYK.js} +9 -9
  127. package/dist-cli/chunks/{config-LHPPE4EP.js → config-FPD7WUYB.js} +5 -5
  128. package/dist-cli/chunks/{control-TVTNGSSF.js → control-B3XNER7I.js} +2 -2
  129. package/dist-cli/chunks/daemon-T4D4X2P5.js +4 -0
  130. package/dist-cli/chunks/{debug-EUHBBPGM.js → debug-LKV5CEAV.js} +17 -17
  131. package/dist-cli/chunks/desktop-EMDPOYQT.js +31 -0
  132. package/dist-cli/chunks/detox-4J4UTZE7.js +52 -0
  133. package/dist-cli/chunks/{device-PONITUZJ.js → device-PMZ7RPXQ.js} +11 -11
  134. package/dist-cli/chunks/{diagnose-2PN4K4L2.js → diagnose-MLEP727D.js} +12 -12
  135. package/dist-cli/chunks/{disk-cleanup-U2PQLOEW.js → disk-cleanup-CVEDIPEE.js} +2 -2
  136. package/dist-cli/chunks/drivers-NTUKJEL6.js +4 -0
  137. package/dist-cli/chunks/{film-XGZCFTQL.js → film-4RNECABF.js} +9 -9
  138. package/dist-cli/chunks/flow-5IOCAHVO.js +4 -0
  139. package/dist-cli/chunks/help-NUJUYEWP.js +4 -0
  140. package/dist-cli/chunks/{hidden-runtime-alias-I4MYF5CO.js → hidden-runtime-alias-YIF25W4F.js} +2 -2
  141. package/dist-cli/chunks/{home-paths-YRAPZ5LE.js → home-paths-WNJCCCCZ.js} +2 -2
  142. package/dist-cli/chunks/inspect-MFEIYUCN.js +4 -0
  143. package/dist-cli/chunks/install-desktop-NB65KI4D.js +4 -0
  144. package/dist-cli/chunks/{login-ZMAIAQ6F.js → login-VEHHGN42.js} +6 -6
  145. package/dist-cli/chunks/{logout-UQZ5JBJU.js → logout-VE7PNXL2.js} +2 -2
  146. package/dist-cli/chunks/{maestro-BQYKDUC4.js → maestro-ZXHTDEOI.js} +25 -25
  147. package/dist-cli/chunks/{maestro-generate-VQYMMQJ5.js → maestro-generate-TK33E2Z6.js} +3 -3
  148. package/dist-cli/chunks/mode-ZDKJ56NT.js +26 -0
  149. package/dist-cli/chunks/{optional-demo-registry-DUWHCLGD.js → optional-demo-registry-GBZ3WVDW.js} +2 -2
  150. package/dist-cli/chunks/{perf-7RAU7WRZ.js → perf-JXNZOUKW.js} +28 -28
  151. package/dist-cli/chunks/permissions-WQ62PW7Y.js +13 -0
  152. package/dist-cli/chunks/record-4S3ZMDIO.js +72 -0
  153. package/dist-cli/chunks/{report-issue-P376KFFU.js → report-issue-KKBADTWO.js} +4 -4
  154. package/dist-cli/chunks/reset-H5XIISJE.js +4 -0
  155. package/dist-cli/chunks/runtime-FK7EEMWA.js +4 -0
  156. package/dist-cli/chunks/{screenshot-command-NE7BKTQ2.js → screenshot-command-42U5MVQL.js} +34 -34
  157. package/dist-cli/chunks/{screenshot-layers-UE4R64PZ.js → screenshot-layers-4G42AHOX.js} +2 -2
  158. package/dist-cli/chunks/{screenshots-capture-ULXPLXMC.js → screenshots-capture-HMQ2OO3I.js} +11 -11
  159. package/dist-cli/chunks/{serve-P7BT4XHR.js → serve-S4V5EDW2.js} +16 -16
  160. package/dist-cli/chunks/setup-T43V7GA6.js +32 -0
  161. package/dist-cli/chunks/{skills-NTRYKJSF.js → skills-O426K26J.js} +16 -16
  162. package/dist-cli/chunks/{state-4D5YAM47.js → state-ZEEPDKJG.js} +5 -5
  163. package/dist-cli/chunks/storage-4GQLOFGG.js +37 -0
  164. package/dist-cli/chunks/store-RFMSNWLJ.js +4 -0
  165. package/dist-cli/chunks/telemetry-NFAAPSMN.js +4 -0
  166. package/dist-cli/chunks/{timeline-GZNFGD3Q.js → timeline-ONCYX7KW.js} +6 -6
  167. package/dist-cli/chunks/{upgrade-A46D6PEY.js → upgrade-A36T52AM.js} +2 -2
  168. package/dist-cli/chunks/upload-36O32DII.js +4 -0
  169. package/dist-cli/chunks/version-67HA253N.js +6 -0
  170. package/dist-cli/chunks/{web-H2IXO5SC.js → web-PWXQHQIE.js} +2 -2
  171. package/dist-cli/chunks/{what-happened-Z7UII5GH.js → what-happened-WNXE622R.js} +16 -16
  172. package/dist-lib/agent-daemon-client.cjs +5 -5
  173. package/dist-lib/agent-events.cjs +1 -1
  174. package/dist-lib/agent-identity.cjs +1 -1
  175. package/dist-lib/agent-sessions.cjs +4 -4
  176. package/dist-lib/attached-projects.cjs +1 -1
  177. package/dist-lib/auth/shared-session.cjs +1 -1
  178. package/dist-lib/backend-origin.cjs +1 -1
  179. package/dist-lib/beta.cjs +1 -1
  180. package/dist-lib/beta.mjs +1 -1
  181. package/dist-lib/bridge-constants.cjs +1 -1
  182. package/dist-lib/bridge-contract.cjs +1 -1
  183. package/dist-lib/cli-constants.cjs +1 -1
  184. package/dist-lib/config.cjs +1 -1
  185. package/dist-lib/detox/index.cjs +1 -1
  186. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  187. package/dist-lib/home-paths.cjs +1 -1
  188. package/dist-lib/host/bridge-host.cjs +7 -7
  189. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  190. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  191. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  192. package/dist-lib/host/websocket-proxy.cjs +1 -1
  193. package/dist-lib/index.cjs +248 -98
  194. package/dist-lib/jump-to-source-babel.cjs +1 -1
  195. package/dist-lib/menu.cjs +2 -2
  196. package/dist-lib/menu.mjs +2 -2
  197. package/dist-lib/metro-host-modules/react-dom.js +6 -0
  198. package/dist-lib/metro-host-modules/react-native-web.js +6 -0
  199. package/dist-lib/metro-host-modules/react-native.js +6 -0
  200. package/dist-lib/metro-host-modules/react.js +6 -0
  201. package/dist-lib/metro-host-modules/react__jsx-dev-runtime.js +6 -0
  202. package/dist-lib/metro-host-modules/react__jsx-runtime.js +6 -0
  203. package/dist-lib/metro-production-bundle.cjs +72 -0
  204. package/dist-lib/metro-production-bundle.mjs +44 -0
  205. package/dist-lib/metro.cjs +152 -8
  206. package/dist-lib/profiles.cjs +1 -1
  207. package/dist-lib/public-brand.cjs +2 -2
  208. package/dist-lib/react-native-host-modules.cjs +50 -0
  209. package/dist-lib/render-mode.cjs +1 -1
  210. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  211. package/dist-lib/sdk.cjs +6 -7
  212. package/dist-lib/sdk.mjs +6 -7
  213. package/dist-lib/skills.cjs +71 -77
  214. package/dist-lib/vite.cjs +104 -85
  215. package/package.json +15 -2
  216. package/scripts/preuninstall.cjs +1 -1
  217. package/skills/contrast/SKILL.md +67 -75
  218. package/skills/rnx-debug/SKILL.md +84 -84
  219. package/skills/rnx-perf/SKILL.md +8 -8
  220. package/skills/rnx-setup/SKILL.md +54 -54
  221. package/skills/rnx-test/SKILL.md +35 -35
  222. package/skills/rnx-visual/SKILL.md +18 -18
  223. package/src/agent-daemon-client.ts +2 -2
  224. package/src/agent-sessions.ts +2 -2
  225. package/src/connect.ts +6 -6
  226. package/src/disk-cleanup.ts +1 -1
  227. package/src/home-paths.ts +1 -1
  228. package/src/host/bridge-host.ts +6 -6
  229. package/src/index.ts +1 -1
  230. package/src/metro-host-modules/react-dom.js +6 -0
  231. package/src/metro-host-modules/react-native-web.js +6 -0
  232. package/src/metro-host-modules/react-native.js +6 -0
  233. package/src/metro-host-modules/react.js +6 -0
  234. package/src/metro-host-modules/react__jsx-dev-runtime.js +6 -0
  235. package/src/metro-host-modules/react__jsx-runtime.js +6 -0
  236. package/src/metro-plugin.ts +249 -10
  237. package/src/metro-production-bundle.ts +51 -0
  238. package/src/public-brand.ts +1 -1
  239. package/src/react-native-host-modules.ts +25 -0
  240. package/src/runtime-assets.ts +1 -1
  241. package/src/sim-client.ts +1 -1
  242. package/src/vite-plugin-one.ts +171 -145
  243. package/dist-cli/chunks/app-fonts-L3UXFYVE.js +0 -4
  244. package/dist-cli/chunks/auth-ISX2EUQL.js +0 -12
  245. package/dist-cli/chunks/camera-4SWTNJUA.js +0 -33
  246. package/dist-cli/chunks/chunk-BRHZEZKN.js +0 -124
  247. package/dist-cli/chunks/chunk-EJPYPJWP.js +0 -5
  248. package/dist-cli/chunks/chunk-KWCD5MOK.js +0 -15
  249. package/dist-cli/chunks/chunk-MJ7QGY7Z.js +0 -4
  250. package/dist-cli/chunks/chunk-RSA4XWHN.js +0 -5
  251. package/dist-cli/chunks/chunk-S3EIOAWZ.js +0 -74
  252. package/dist-cli/chunks/chunk-TYANJQLO.js +0 -30
  253. package/dist-cli/chunks/cli-version-NZUSWKZR.js +0 -4
  254. package/dist-cli/chunks/daemon-XUEC47EC.js +0 -4
  255. package/dist-cli/chunks/desktop-LLHMP4A3.js +0 -31
  256. package/dist-cli/chunks/detox-QLNWLXA4.js +0 -52
  257. package/dist-cli/chunks/drivers-7IU37M2E.js +0 -4
  258. package/dist-cli/chunks/flow-NZZLR4BN.js +0 -4
  259. package/dist-cli/chunks/help-D7URIJRD.js +0 -4
  260. package/dist-cli/chunks/inspect-TJYWKY56.js +0 -4
  261. package/dist-cli/chunks/install-desktop-LD3W5RS7.js +0 -4
  262. package/dist-cli/chunks/mode-ZQ6H7KWM.js +0 -26
  263. package/dist-cli/chunks/permissions-DRZ3HCFL.js +0 -13
  264. package/dist-cli/chunks/record-J5JAYW4Y.js +0 -72
  265. package/dist-cli/chunks/reset-KXYRDEFU.js +0 -4
  266. package/dist-cli/chunks/runtime-66CEPOG6.js +0 -4
  267. package/dist-cli/chunks/setup-QO5KZAX3.js +0 -32
  268. package/dist-cli/chunks/storage-X2K2MDPX.js +0 -37
  269. package/dist-cli/chunks/store-TUJPIRTT.js +0 -4
  270. package/dist-cli/chunks/telemetry-CF5DVEKI.js +0 -4
  271. package/dist-cli/chunks/upload-UIQJIBEZ.js +0 -4
  272. package/dist-cli/chunks/version-CMBB3FXL.js +0 -6
@@ -1,11 +1,11 @@
1
- /*! rnx v0.1.335 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.337 | (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{b as k,d as v}from"./chunk-ZZWO6Y7X.js";import"./chunk-GP6QEBZA.js";import{a as b}from"./chunk-CL3PREIE.js";import"./chunk-MTNIDSOA.js";import{exec as L}from"node:child_process";import{randomBytes as R}from"node:crypto";import P from"node:http";var O=process.env.SOOTSIM_AUTH_ORIGIN||"https://contrast.dev",w="https://contrast.localhost:3000";async function A(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${w}/api/auth/me`)).ok)return w}catch{}return O}function C(){console.log(`
5
- rnxsim login \u2014 sign in so uploads can attach to your account
4
+ import{b as k,d as v}from"./chunk-J6BYRRZQ.js";import"./chunk-4FRSEZ7Z.js";import{a as b}from"./chunk-UWEDNDND.js";import"./chunk-ABK2V2PR.js";import{exec as L}from"node:child_process";import{randomBytes as R}from"node:crypto";import P from"node:http";var O=process.env.SOOTSIM_AUTH_ORIGIN||"https://contrast.dev",w="https://contrast.localhost:3000";async function A(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${w}/api/auth/me`)).ok)return w}catch{}return O}function C(){console.log(`
5
+ rnx login \u2014 sign in so uploads can attach to your account
6
6
 
7
7
  usage:
8
- rnxsim login [--origin <url>]
8
+ rnx login [--origin <url>]
9
9
 
10
10
  options:
11
11
  --origin <url> auth host (default: auto)
@@ -23,6 +23,6 @@ options:
23
23
  <p style="color:#ccc">${r}</p>
24
24
  </div>
25
25
  </body>
26
- </html>`}async function G(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"local dev-login unavailable"};if(!e.ok){let u=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${u}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function M(r){try{let e=new URL(r).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 F(r){(r.includes("--help")||r.includes("-h"))&&(C(),process.exit(0));let e=[...r],t=await A(U(e,"--origin"));if(M(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let n=await G(t);if(n.ok){k({token:n.token,user:n.userId?{id:n.userId,email:n.email}:null,origin:t,source:"cli"});let s=await v(t),d=s?.user?.email||n.email||s?.user?.id||n.userId,{trackCliEvent:a,flushCliTelemetry:f}=await import("./telemetry-CF5DVEKI.js");a({event:"cli_login_succeeded",identity:{userId:n.userId??s?.user?.id??null},properties:{origin:t,mode:"dev"}}),await f(),console.log(` signed in${d?` as ${d}`:""} (dev)`);return}console.log(` dev-login not available (${n.error}); falling back to browser`)}let u=R(16).toString("hex");{let{trackCliEvent:n,flushCliTelemetry:s}=await import("./telemetry-CF5DVEKI.js");n({event:"cli_login_started",properties:{origin:t}}),await s()}let m=300*1e3,i=await new Promise(n=>{let s,d=!1,a=c=>{d||(d=!0,clearTimeout(s),n(c),f.close())},f=P.createServer((c,o)=>{try{let l=new URL(c.url||"/","http://127.0.0.1"),S=l.searchParams.get("state"),y=l.searchParams.get("token"),x=l.searchParams.get("email")||void 0,T=l.searchParams.get("userId")||void 0,p=l.searchParams.get("error");if(S!==u){o.statusCode=404,o.end("not found");return}if(o.setHeader("content-type","text/html; charset=utf-8"),p){o.end(g(`sign-in failed: ${p}`)),a({ok:!1,error:p});return}if(!y){o.end(g("missing token. close this tab and retry `rnxsim login`.")),a({ok:!1,error:"missing token"});return}o.end(g("sign-in complete. you can return to the terminal.")),a({ok:!0,token:y,email:x,userId:T})}catch(l){o.statusCode=500,o.end(g("sign-in callback failed. retry `rnxsim login`.")),a({ok:!1,error:l instanceof Error?l.message:"callback failed"})}});s=setTimeout(()=>{a({ok:!1,error:"timed out waiting for the browser sign-in (5 minutes). rerun `rnxsim login` and complete the github authorize screen if it appears."})},m),f.listen(0,"127.0.0.1",()=>{let c=f.address();if(!c||typeof c=="string"){a({ok:!1,error:"failed to bind callback server"});return}let o=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);o.searchParams.set("state",u),o.searchParams.set("port",String(c.port)),o.searchParams.set("contrast",t),console.log(" opening browser for rnxsim 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:
26
+ </html>`}async function G(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"local dev-login unavailable"};if(!e.ok){let u=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${u}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function M(r){try{let e=new URL(r).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 F(r){(r.includes("--help")||r.includes("-h"))&&(C(),process.exit(0));let e=[...r],t=await A(U(e,"--origin"));if(M(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let n=await G(t);if(n.ok){k({token:n.token,user:n.userId?{id:n.userId,email:n.email}:null,origin:t,source:"cli"});let s=await v(t),d=s?.user?.email||n.email||s?.user?.id||n.userId,{trackCliEvent:a,flushCliTelemetry:f}=await import("./telemetry-NFAAPSMN.js");a({event:"cli_login_succeeded",identity:{userId:n.userId??s?.user?.id??null},properties:{origin:t,mode:"dev"}}),await f(),console.log(` signed in${d?` as ${d}`:""} (dev)`);return}console.log(` dev-login not available (${n.error}); falling back to browser`)}let u=R(16).toString("hex");{let{trackCliEvent:n,flushCliTelemetry:s}=await import("./telemetry-NFAAPSMN.js");n({event:"cli_login_started",properties:{origin:t}}),await s()}let m=300*1e3,i=await new Promise(n=>{let s,d=!1,a=c=>{d||(d=!0,clearTimeout(s),n(c),f.close())},f=P.createServer((c,o)=>{try{let l=new URL(c.url||"/","http://127.0.0.1"),S=l.searchParams.get("state"),y=l.searchParams.get("token"),x=l.searchParams.get("email")||void 0,T=l.searchParams.get("userId")||void 0,p=l.searchParams.get("error");if(S!==u){o.statusCode=404,o.end("not found");return}if(o.setHeader("content-type","text/html; charset=utf-8"),p){o.end(g(`sign-in failed: ${p}`)),a({ok:!1,error:p});return}if(!y){o.end(g("missing token. close this tab and retry `rnx login`.")),a({ok:!1,error:"missing token"});return}o.end(g("sign-in complete. you can return to the terminal.")),a({ok:!0,token:y,email:x,userId:T})}catch(l){o.statusCode=500,o.end(g("sign-in callback failed. retry `rnx login`.")),a({ok:!1,error:l instanceof Error?l.message:"callback failed"})}});s=setTimeout(()=>{a({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."})},m),f.listen(0,"127.0.0.1",()=>{let c=f.address();if(!c||typeof c=="string"){a({ok:!1,error:"failed to bind callback server"});return}let o=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);o.searchParams.set("state",u),o.searchParams.set("port",String(c.port)),o.searchParams.set("contrast",t),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:
27
27
  ${o.toString()}
28
- `),E(o.toString())})});if(!i.ok){let{trackCliEvent:n,flushCliTelemetry:s}=await import("./telemetry-CF5DVEKI.js");n({event:"cli_login_failed",properties:{origin:t,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}k({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:t,source:"cli"});let h=await v(t),I=h?.user?.email||i.email||h?.user?.id||i.userId,{trackCliEvent:$,flushCliTelemetry:_}=await import("./telemetry-CF5DVEKI.js");$({event:"cli_login_succeeded",identity:{userId:i.userId??h?.user?.id??null},properties:{origin:t}}),await _(),console.log(` signed in${I?` as ${I}`:""}`)}export{F as runLogin};
28
+ `),E(o.toString())})});if(!i.ok){let{trackCliEvent:n,flushCliTelemetry:s}=await import("./telemetry-NFAAPSMN.js");n({event:"cli_login_failed",properties:{origin:t,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}k({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:t,source:"cli"});let h=await v(t),I=h?.user?.email||i.email||h?.user?.id||i.userId,{trackCliEvent:$,flushCliTelemetry:_}=await import("./telemetry-NFAAPSMN.js");$({event:"cli_login_succeeded",identity:{userId:i.userId??h?.user?.id??null},properties:{origin:t}}),await _(),console.log(` signed in${I?` as ${I}`:""}`)}export{F as runLogin};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.335 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.337 | (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 i}from"./chunk-RELRA5VW.js";import{a as t,c as o}from"./chunk-ZZWO6Y7X.js";import"./chunk-GP6QEBZA.js";import"./chunk-MTNIDSOA.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};
4
+ import{c as r,d as i}from"./chunk-NCG6C5AH.js";import{a as t,c as o}from"./chunk-J6BYRRZQ.js";import"./chunk-4FRSEZ7Z.js";import"./chunk-ABK2V2PR.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};
@@ -1,18 +1,18 @@
1
- /*! rnx v0.1.335 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.337 | (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 P}from"./chunk-R3CMECGC.js";import"./chunk-FE6ZHPKD.js";import"./chunk-R2UL5VFY.js";import{b as k}from"./chunk-JWAY6DIH.js";import"./chunk-MJ7QGY7Z.js";import"./chunk-RVUGKXJD.js";import{a as S}from"./chunk-I2HQB5NN.js";import"./chunk-KWCD5MOK.js";import"./chunk-4KC35DMK.js";import"./chunk-ZTM2MKNI.js";import"./chunk-YSUIYK6B.js";import"./chunk-PO3TOAED.js";import"./chunk-IV36DY6M.js";import"./chunk-42ALI64M.js";import{b as $,c as F,d as T,e as M}from"./chunk-INBPUR4T.js";import{a as A}from"./chunk-FJSHIWAM.js";import"./chunk-JWK5WD44.js";import"./chunk-6VN5ULGQ.js";import"./chunk-35XNGT5C.js";import"./chunk-DCDKJ4NC.js";import"./chunk-ROPHZJ6P.js";import"./chunk-3ZDOPKHE.js";import"./chunk-ZYHCWCMM.js";import"./chunk-WKT7YM5Q.js";import"./chunk-J7XFINJG.js";import"./chunk-RELRA5VW.js";import"./chunk-ZZWO6Y7X.js";import"./chunk-M7CBQ5I4.js";import"./chunk-3CS4EUMG.js";import"./chunk-EJPYPJWP.js";import"./chunk-POC3QTA6.js";import"./chunk-RSA4XWHN.js";import"./chunk-RTEJXUXN.js";import"./chunk-GVKISFQ3.js";import"./chunk-BRHZEZKN.js";import"./chunk-GP6QEBZA.js";import"./chunk-CL3PREIE.js";import"./chunk-MTNIDSOA.js";import*as n from"fs";import*as a from"path";var I=[".maestro","maestro"];function W(){console.log(`
5
- rnxsim maestro \u2014 author and run Maestro YAML flows against rnx
4
+ import{c as E,d as O,g as L,h as R,i as P}from"./chunk-4HESY5E7.js";import"./chunk-5LJNNHZH.js";import"./chunk-OCPWXT73.js";import{b as k}from"./chunk-EDWN2HOO.js";import"./chunk-HPJ5EKIZ.js";import"./chunk-7Q4QKHMA.js";import{a as S}from"./chunk-5QXGSTYI.js";import"./chunk-XIQFYLWD.js";import"./chunk-CPDEUWL5.js";import"./chunk-5ZEFRPCC.js";import"./chunk-HAHJJJUC.js";import"./chunk-KGQAO25M.js";import"./chunk-WRID5SBV.js";import"./chunk-WUYI3XJ5.js";import{b as $,c as F,d as T,e as M}from"./chunk-2ANFH72P.js";import{a as A}from"./chunk-5SHAOQHJ.js";import"./chunk-LZAL3DMP.js";import"./chunk-X7MHCEGG.js";import"./chunk-LXYLCETR.js";import"./chunk-DQQ4CZVC.js";import"./chunk-M4LGUVBM.js";import"./chunk-M43UU7UG.js";import"./chunk-7ATIH7OU.js";import"./chunk-4VJEXQGD.js";import"./chunk-L6UUIQE7.js";import"./chunk-NCG6C5AH.js";import"./chunk-J6BYRRZQ.js";import"./chunk-GEAGFYKP.js";import"./chunk-EWVG4A3B.js";import"./chunk-RKY3ZNTA.js";import"./chunk-BSSVLFZR.js";import"./chunk-GGNH44PZ.js";import"./chunk-F3NKCQHM.js";import"./chunk-TJTLXG3R.js";import"./chunk-TNI4PW75.js";import"./chunk-4FRSEZ7Z.js";import"./chunk-UWEDNDND.js";import"./chunk-ABK2V2PR.js";import*as n from"fs";import*as a from"path";var I=[".maestro","maestro"];function W(){console.log(`
5
+ rnx maestro \u2014 author and run Maestro YAML flows against rnx
6
6
 
7
7
  usage:
8
- rnxsim maestro # discover .maestro/ or maestro/ in cwd, run all
9
- rnxsim maestro test <flow-or-dir> # mirrors "maestro test"
10
- rnxsim maestro test .maestro/ # every *.yaml / *.yml in a directory
11
- rnxsim maestro generate "<goal>" # generate, run, and upload a Maestro flow
12
- rnxsim maestro start|keep|end # author a flow from live CLI actions
13
- rnxsim maestro validate <flow> # validate a Maestro YAML file
14
- rnxsim maestro init # scaffold .maestro/login.yaml
15
- rnxsim maestro --list-compat # print supported/unsupported verbs
8
+ rnx maestro # discover .maestro/ or maestro/ in cwd, run all
9
+ rnx maestro test <flow-or-dir> # mirrors "maestro test"
10
+ rnx maestro test .maestro/ # every *.yaml / *.yml in a directory
11
+ rnx maestro generate "<goal>" # generate, run, and upload a Maestro flow
12
+ rnx maestro start|keep|end # author a flow from live CLI actions
13
+ rnx maestro validate <flow> # validate a Maestro YAML file
14
+ rnx maestro init # scaffold .maestro/login.yaml
15
+ rnx maestro --list-compat # print supported/unsupported verbs
16
16
 
17
17
  options:
18
18
  --env KEY=VALUE set env vars for \${KEY} interpolation (repeatable)
@@ -30,15 +30,15 @@ options:
30
30
  --slow <ms> delay between steps for natural pacing
31
31
 
32
32
  examples:
33
- rnxsim maestro test .maestro/login.yaml
34
- rnxsim maestro test .maestro/
35
- rnxsim maestro generate "log in and verify the welcome screen"
36
- rnxsim maestro start
37
- rnxsim maestro end --output .maestro/login.yaml --validate
38
- rnxsim maestro --env USERNAME=alice test .maestro/login.yaml
39
- rnxsim maestro init
33
+ rnx maestro test .maestro/login.yaml
34
+ rnx maestro test .maestro/
35
+ rnx maestro generate "log in and verify the welcome screen"
36
+ rnx maestro start
37
+ rnx maestro end --output .maestro/login.yaml --validate
38
+ rnx maestro --env USERNAME=alice test .maestro/login.yaml
39
+ rnx maestro init
40
40
  `)}function D(){console.log(`
41
- rnxsim maestro \u2014 compatibility matrix
41
+ rnx maestro \u2014 compatibility matrix
42
42
 
43
43
  supported verbs:
44
44
  launchApp, stopApp, clearState, clearKeychain (warn-only),
@@ -78,8 +78,8 @@ not yet implemented (will throw "unsupported maestro verb"):
78
78
  travel, setLocation, setAirplaneMode, killApp, faker,
79
79
  addMedia, startRecording, stopRecording (use --record flag),
80
80
  repeat.while (only repeat.times is supported).
81
- `)}function U(t){return t.startsWith("-")}function Y(t){let s=[];for(let e=0;e<t.length;e++){if(t[e]==="--env"||t[e]==="-e"){let r=t[e+1];if(!r||!r.includes("="))throw new Error(`--env expects KEY=VALUE (got ${JSON.stringify(r??"")})`);let i=r.indexOf("="),c=r.slice(0,i),p=r.slice(i+1);process.env[c]=p,e+=1;continue}s.push(t[e])}return s}function J(t){let s=[];for(let e=0;e<t.length;e++){let r=t[e];if(r==="--format"||r==="--output"||r==="--device"||r==="-d"){e+=1;continue}if(r==="--continuous"){console.warn(" warn: --continuous is not yet implemented in rnx \u2014 running once");continue}s.push(r)}return s}function j(t){for(let s of I){let e=a.join(t,s);if(n.existsSync(e)&&n.statSync(e).isDirectory())return e}return null}function N(t){let s=n.statSync(t);if(s.isFile())return[t];if(!s.isDirectory())throw new Error(`not a file or directory: ${t}`);let e={},r=["config.yaml","config.yml"].map(l=>a.join(t,l)).find(l=>n.existsSync(l));if(r){let l=S.parse(n.readFileSync(r,"utf8"));l&&typeof l=="object"&&(e=l)}let i=Array.isArray(e.flows)&&e.flows.length>0?e.flows:["*"],c=l=>{let u=a.basename(l);return!(u.startsWith(".")||!u.endsWith(".yaml")&&!u.endsWith(".yml")||u==="config.yaml"||u==="config.yml")},p=new Set;for(let l of i)for(let u of n.globSync(l,{cwd:t})){if(!c(u))continue;let d=a.join(t,u);n.existsSync(d)&&n.statSync(d).isFile()&&p.add(d)}let m=[...p].sort(),y=Array.isArray(e.includeTags)?e.includeTags:[],w=Array.isArray(e.excludeTags)?e.excludeTags:[];return(y.length>0||w.length>0)&&(m=m.filter(l=>{let{frontmatter:u}=k(n.readFileSync(l,"utf8")),d=Array.isArray(u.tags)?u.tags:[];return!(y.length>0&&!d.some(h=>y.includes(h))||d.some(h=>w.includes(h)))})),m}async function _(t){let s=a.join(t,".maestro");n.mkdirSync(s,{recursive:!0});let e=a.join(s,"login.yaml");return n.existsSync(e)?(console.error(` error: ${e} already exists`),1):(n.writeFileSync(e,`# rnxsim maestro starter flow \u2014 drop-in compatible with the maestro cli.
82
- # run: rnxsim maestro test .maestro/login.yaml
81
+ `)}function U(t){return t.startsWith("-")}function Y(t){let s=[];for(let e=0;e<t.length;e++){if(t[e]==="--env"||t[e]==="-e"){let r=t[e+1];if(!r||!r.includes("="))throw new Error(`--env expects KEY=VALUE (got ${JSON.stringify(r??"")})`);let i=r.indexOf("="),c=r.slice(0,i),p=r.slice(i+1);process.env[c]=p,e+=1;continue}s.push(t[e])}return s}function J(t){let s=[];for(let e=0;e<t.length;e++){let r=t[e];if(r==="--format"||r==="--output"||r==="--device"||r==="-d"){e+=1;continue}if(r==="--continuous"){console.warn(" warn: --continuous is not yet implemented in rnx \u2014 running once");continue}s.push(r)}return s}function j(t){for(let s of I){let e=a.join(t,s);if(n.existsSync(e)&&n.statSync(e).isDirectory())return e}return null}function N(t){let s=n.statSync(t);if(s.isFile())return[t];if(!s.isDirectory())throw new Error(`not a file or directory: ${t}`);let e={},r=["config.yaml","config.yml"].map(l=>a.join(t,l)).find(l=>n.existsSync(l));if(r){let l=S.parse(n.readFileSync(r,"utf8"));l&&typeof l=="object"&&(e=l)}let i=Array.isArray(e.flows)&&e.flows.length>0?e.flows:["*"],c=l=>{let u=a.basename(l);return!(u.startsWith(".")||!u.endsWith(".yaml")&&!u.endsWith(".yml")||u==="config.yaml"||u==="config.yml")},p=new Set;for(let l of i)for(let u of n.globSync(l,{cwd:t})){if(!c(u))continue;let d=a.join(t,u);n.existsSync(d)&&n.statSync(d).isFile()&&p.add(d)}let m=[...p].sort(),y=Array.isArray(e.includeTags)?e.includeTags:[],w=Array.isArray(e.excludeTags)?e.excludeTags:[];return(y.length>0||w.length>0)&&(m=m.filter(l=>{let{frontmatter:u}=k(n.readFileSync(l,"utf8")),d=Array.isArray(u.tags)?u.tags:[];return!(y.length>0&&!d.some(h=>y.includes(h))||d.some(h=>w.includes(h)))})),m}async function _(t){let s=a.join(t,".maestro");n.mkdirSync(s,{recursive:!0});let e=a.join(s,"login.yaml");return n.existsSync(e)?(console.error(` error: ${e} already exists`),1):(n.writeFileSync(e,`# rnx maestro starter flow \u2014 drop-in compatible with the maestro cli.
82
+ # run: rnx maestro test .maestro/login.yaml
83
83
  appId: com.example.app
84
84
  ---
85
85
  - launchApp
@@ -91,13 +91,13 @@ appId: com.example.app
91
91
  - inputText: "secret123"
92
92
  - tapOn: "Sign in"
93
93
  - assertVisible: "Welcome"
94
- `,"utf8"),console.log(` + wrote ${e}`),console.log(" next: rnxsim maestro test .maestro/login.yaml"),0)}async function Q(t,s={}){if(t.includes("--help")||t.includes("-h"))return W(),0;if(t.includes("--list-compat"))return D(),0;let e;try{e=Y(t)}catch(o){return console.error(` error: ${o.message}`),1}e=R(e);let r=process.cwd(),i=e[0];if(i==="init")return _(r);if(i==="generate"){let{runMaestroGenerate:o}=await import("./maestro-generate-VQYMMQJ5.js");return o(e.slice(1))}if(i==="start"||i==="keep"||i==="good"||i==="end"||i==="validate")return P(e);e=J(e);let c=null,p;if(i==="test"){let o=e.slice(1).find(f=>!U(f));o?(c=a.resolve(r,o),p=e.slice(1).filter(f=>f!==o)):(c=j(r),p=e.slice(1))}else i&&!U(i)?(c=a.resolve(r,i),p=e.slice(1)):(c=j(r),p=e);if(!c)return console.error(`
94
+ `,"utf8"),console.log(` + wrote ${e}`),console.log(" next: rnx maestro test .maestro/login.yaml"),0)}async function Q(t,s={}){if(t.includes("--help")||t.includes("-h"))return W(),0;if(t.includes("--list-compat"))return D(),0;let e;try{e=Y(t)}catch(o){return console.error(` error: ${o.message}`),1}e=R(e);let r=process.cwd(),i=e[0];if(i==="init")return _(r);if(i==="generate"){let{runMaestroGenerate:o}=await import("./maestro-generate-TK33E2Z6.js");return o(e.slice(1))}if(i==="start"||i==="keep"||i==="good"||i==="end"||i==="validate")return P(e);e=J(e);let c=null,p;if(i==="test"){let o=e.slice(1).find(f=>!U(f));o?(c=a.resolve(r,o),p=e.slice(1).filter(f=>f!==o)):(c=j(r),p=e.slice(1))}else i&&!U(i)?(c=a.resolve(r,i),p=e.slice(1)):(c=j(r),p=e);if(!c)return console.error(`
95
95
  error: no maestro flows found.
96
96
  expected one of: ${I.map(o=>`./${o}/`).join(", ")}
97
- or pass a flow explicitly: rnxsim maestro test path/to/flow.yaml
98
- or scaffold a starter flow: rnxsim maestro init
97
+ or pass a flow explicitly: rnx maestro test path/to/flow.yaml
98
+ or scaffold a starter flow: rnx maestro init
99
99
  `),1;if(!n.existsSync(c))return console.error(` error: ${c} not found`),1;let m;try{m=N(c)}catch(o){return console.error(` error: ${o.message}`),1}if(m.length===0)return console.error(` error: no *.yaml or *.yml files found in ${c}`),1;console.log(`
100
- rnxsim maestro \u2014 ${m.length} flow${m.length===1?"":"s"}
100
+ rnx maestro \u2014 ${m.length} flow${m.length===1?"":"s"}
101
101
  root: ${a.relative(r,c)||"."}
102
102
  `);let y=A(),w=o=>{let f=p.indexOf(o);return f>=0?p[f+1]:void 0},l=null,u=()=>l??=M(w("--preview-origin")??w("--origin")),d=0,h=[];for(let o of m){console.log(`
103
103
  \u25B6 ${a.relative(r,o)}`);let f=[o,...p];s.port&&f.push("--port",String(s.port));let g=0,V=Date.now();try{g=await L(f)}catch(x){console.error(` x ${x.message}`),g=1}h.push({file:o,exit:g}),g!==0&&d===0&&(d=g);let b=E();if(F({uploadedShare:!!b,auth:y})){let x=O(),C=x.find(K=>K.status==="failure"),v=await T({origin:await u(),kind:"maestro",name:a.relative(r,o),status:g===0?"passed":"failed",failureMessage:g===0?null:C?.error??"flow playback failed",previewShareId:b?.shareId??null,owner:w("--owner")??null,repo:w("--repo")??null,durationMs:Date.now()-V,...$(x),auth:y});v&&console.log(` run: ${v.id}${v.traceUrl?` \xB7 replay: ${v.traceUrl}`:""}`)}}if(m.length>1){console.log(`
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.335 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.337 | (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-I2HQB5NN.js";import{b as O,d as A,e as E}from"./chunk-INBPUR4T.js";import{a as S,b as T}from"./chunk-FJSHIWAM.js";import"./chunk-JWK5WD44.js";import"./chunk-6VN5ULGQ.js";import"./chunk-35XNGT5C.js";import{f as v}from"./chunk-3ZDOPKHE.js";import"./chunk-ZYHCWCMM.js";import"./chunk-RELRA5VW.js";import"./chunk-ZZWO6Y7X.js";import{q as y,s as b}from"./chunk-RTEJXUXN.js";import"./chunk-GVKISFQ3.js";import"./chunk-GP6QEBZA.js";import"./chunk-CL3PREIE.js";import"./chunk-MTNIDSOA.js";import{mkdtempSync as B,writeFileSync as N}from"fs";import{tmpdir as C}from"os";import{join as k}from"path";var J=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",_=18e3,j=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function V(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var F=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(F.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:[...F]}),i=b(o);try{let n=await v(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),s=[n.shell?`shell: ${JSON.stringify(n.shell)}`:"",n.keyboard?`keyboard: ${JSON.stringify(n.keyboard)}`:"",typeof n.nodeCount=="number"?`nodes: ${n.nodeCount}`:"",n.tree||""].filter(Boolean).join(`
4
+ import{a as x}from"./chunk-5QXGSTYI.js";import{b as O,d as A,e as E}from"./chunk-2ANFH72P.js";import{a as S,b as T}from"./chunk-5SHAOQHJ.js";import"./chunk-LZAL3DMP.js";import"./chunk-X7MHCEGG.js";import"./chunk-LXYLCETR.js";import{f as v}from"./chunk-M43UU7UG.js";import"./chunk-7ATIH7OU.js";import"./chunk-NCG6C5AH.js";import"./chunk-J6BYRRZQ.js";import{q as y,s as b}from"./chunk-F3NKCQHM.js";import"./chunk-TJTLXG3R.js";import"./chunk-4FRSEZ7Z.js";import"./chunk-UWEDNDND.js";import"./chunk-ABK2V2PR.js";import{mkdtempSync as B,writeFileSync as N}from"fs";import{tmpdir as C}from"os";import{join as k}from"path";var J=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",_=18e3,j=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function V(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var F=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(F.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:[...F]}),i=b(o);try{let n=await v(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),s=[n.shell?`shell: ${JSON.stringify(n.shell)}`:"",n.keyboard?`keyboard: ${JSON.stringify(n.keyboard)}`:"",typeof n.nodeCount=="number"?`nodes: ${n.nodeCount}`:"",n.tree||""].filter(Boolean).join(`
5
5
  `);return s.length>_?s.slice(0,_)+`
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(j)});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 P(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function q(e){let t=W(e);if(!P(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(!P(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: rnxsim maestro generate "test goal"'),1;let{prompt:r,index:o}=t,i=S();if(!i||i.kind==="github")return console.error(' rnxsim 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 E(V(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(k(C(),"sootsim-maestro-generate-")),p=k(u,"flow.yaml");N(p,l.yamlText),console.log(` flow: ${p}`);let M=Date.now(),{runFlowPlayback:I,getLastFlowPreviewUploadResult:$,getLastFlowTraceSteps:D}=await import("./flow-NZZLR4BN.js"),L=Q(e,o,p,c),w=await I(L),m=$(),h=D(),R=h.find(U=>U.status==="failure"),g=w===0?"passed":"failed",d=await A({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()-M,flowYamlSizeBytes:Buffer.byteLength(l.yamlText,"utf8"),...O(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 P(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function q(e){let t=W(e);if(!P(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(!P(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 E(V(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(k(C(),"sootsim-maestro-generate-")),p=k(u,"flow.yaml");N(p,l.yamlText),console.log(` flow: ${p}`);let M=Date.now(),{runFlowPlayback:I,getLastFlowPreviewUploadResult:$,getLastFlowTraceSteps:D}=await import("./flow-5IOCAHVO.js"),L=Q(e,o,p,c),w=await I(L),m=$(),h=D(),R=h.find(U=>U.status==="failure"),g=w===0?"passed":"failed",d=await A({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()-M,flowYamlSizeBytes:Buffer.byteLength(l.yamlText,"utf8"),...O(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};
@@ -0,0 +1,26 @@
1
+ /*! rnx v0.1.337 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a as r,b as s}from"./chunk-6ART4XVJ.js";import"./chunk-F3NKCQHM.js";import"./chunk-TJTLXG3R.js";import"./chunk-4FRSEZ7Z.js";import"./chunk-ABK2V2PR.js";async function i(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
5
+ rnx mode screenshot \u2014 toggle the screenshot-mode chrome overlay
6
+
7
+ usage:
8
+ rnx mode screenshot [on|off|toggle]
9
+
10
+ arguments:
11
+ on enable screenshot mode (enables showFrame if needed)
12
+ off disable screenshot mode
13
+ toggle flip the current state (default)
14
+
15
+ examples:
16
+ rnx mode screenshot
17
+ rnx mode screenshot on
18
+ rnx mode screenshot off
19
+ `),process.exit(0)),await r(e,o,{modeKey:"screenshotMode",displayName:"screenshot-mode",actionId:"toggle-screenshot-mode"})}var c=new Set(["--sim","--port","-p"]),d=new Set(["screenshot","three"]);function m(e){for(let o=0;o<e.length;o++){let n=e[o];if(n.startsWith("-")){c.has(n)&&o++;continue}return d.has(n)?{name:n,index:o}:null}return null}function h(e,o){return[...e.slice(0,o),...e.slice(o+1)]}function l(){console.log(`
20
+ rnx mode \u2014 toggle live display modes
21
+
22
+ usage:
23
+ rnx mode screenshot [on|off|toggle]
24
+ rnx mode three [on|off|toggle]
25
+ rnx mode three configure [options]
26
+ `)}async function g(e,o){if(e.includes("--help")||e.includes("-h")){l();return}let n=m(e);n||(l(),process.exit(1));let t=h(e,n.index);if(n.name==="screenshot"){await i(t,o);return}await s(t,o)}export{g as runMode};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.335 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.337 | (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}from"./chunk-ZYHCWCMM.js";import"./chunk-MTNIDSOA.js";export{d as __withOptionalDemoAppsForTests,a as findInternalDemoRegistry,b as loadOptionalDemoApps,c as optionalDemoAppsSync};
4
+ import{a,b,c,d}from"./chunk-7ATIH7OU.js";import"./chunk-ABK2V2PR.js";export{d as __withOptionalDemoAppsForTests,a as findInternalDemoRegistry,b as loadOptionalDemoApps,c as optionalDemoAppsSync};
@@ -1,17 +1,17 @@
1
- /*! rnx v0.1.335 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.337 | (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{j as N}from"./chunk-JWAY6DIH.js";import"./chunk-MJ7QGY7Z.js";import"./chunk-RVUGKXJD.js";import"./chunk-I2HQB5NN.js";import"./chunk-KWCD5MOK.js";import"./chunk-4KC35DMK.js";import"./chunk-ZTM2MKNI.js";import"./chunk-YSUIYK6B.js";import"./chunk-PO3TOAED.js";import"./chunk-IV36DY6M.js";import"./chunk-42ALI64M.js";import"./chunk-JWK5WD44.js";import"./chunk-6VN5ULGQ.js";import"./chunk-35XNGT5C.js";import"./chunk-DCDKJ4NC.js";import"./chunk-ROPHZJ6P.js";import"./chunk-3ZDOPKHE.js";import"./chunk-ZYHCWCMM.js";import"./chunk-WKT7YM5Q.js";import"./chunk-J7XFINJG.js";import"./chunk-M7CBQ5I4.js";import"./chunk-3CS4EUMG.js";import"./chunk-EJPYPJWP.js";import"./chunk-POC3QTA6.js";import"./chunk-RSA4XWHN.js";import{q as P,s as R,v as d,w as x}from"./chunk-RTEJXUXN.js";import"./chunk-GVKISFQ3.js";import"./chunk-BRHZEZKN.js";import"./chunk-GP6QEBZA.js";import"./chunk-CL3PREIE.js";import"./chunk-MTNIDSOA.js";import{mkdirSync as D,writeFileSync as W}from"fs";import{dirname as A,resolve as J}from"path";import{WebSocket as B}from"ws";var C=e=>new Promise(o=>setTimeout(o,e)),S=class{ws;nextId=1;pending=new Map;listeners=new Set;ready;constructor(o){this.ws=new B(o,{maxPayload:1<<28}),this.ready=new Promise((r,n)=>{this.ws.once("open",()=>r()),this.ws.once("error",n)}),this.ws.on("message",r=>{let n=JSON.parse(r.toString());if(n.id&&this.pending.has(n.id)){let{res:t,rej:s}=this.pending.get(n.id);this.pending.delete(n.id),n.error?s(new Error(JSON.stringify(n.error))):t(n.result)}else if(n.method)for(let t of this.listeners)t(n.method,n.params)})}waitOpen(){return this.ready}on(o){this.listeners.add(o)}send(o,r={},n){let t=this.nextId++;return new Promise((s,a)=>{this.pending.set(t,{res:s,rej:a}),this.ws.send(JSON.stringify({id:t,method:o,params:r,...n?{sessionId:n}:{}}))})}close(){try{this.ws.close()}catch{}}};async function O(e,o){let r=Number(h(e,"--duration")??"5");if(!Number.isFinite(r)||r<=0)return console.error(" --duration must be a positive number (seconds)"),1;let n=Number(h(e,"--sample-interval")??"0.1"),t=Number(h(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=h(e,"--match")??"/rn/",a=h(e,"--output")??h(e,"-o"),i=J(process.cwd(),a??"/tmp/sootsim.cpuprofile"),l=[];try{l=await(await fetch(`http://localhost:${t}/json/list`)).json()}catch{return E(t),1}let f=l.find(m=>m.type==="page"&&m.url.includes(s));if(!f)return console.error(` no page target matching "${s}" on CDP :${t}`),console.error(` open targets: ${l.map(m=>m.url).join(", ")||"(none)"}`),1;let u=new S(f.webSocketDebuggerUrl);await u.waitOpen();try{let m=new Map;if(u.on((c,p)=>{c==="Target.attachedToTarget"&&p.targetInfo?.type==="worker"&&m.set(p.sessionId,p.targetInfo.url),c==="Target.detachedFromTarget"&&m.delete(p.sessionId)}),await u.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),await C(500),m.size===0)return console.error(" no worker targets attached \u2014 is the app loaded in this tab?"),1;for(let c of m.keys())await u.send("Profiler.enable",{},c),await u.send("Profiler.setSamplingInterval",{interval:n*1e3},c),await u.send("Profiler.start",{},c);console.log(` recording ${r}s across ${m.size} worker(s) \u2014 interact now\u2026`),await C(r*1e3);let b=[];for(let[c,p]of m){let{profile:y}=await u.send("Profiler.stop",{},c);b.push({url:p,profile:y})}return b.sort((c,p)=>p.profile.samples.length-c.profile.samples.length),D(A(i),{recursive:!0}),b.forEach((c,p)=>{let y=p===0?i:i.replace(/(\.[^.]+)?$/,`.worker${p}$1`);if(W(y,JSON.stringify(c.profile)),console.log(` ${v(c.url)}: ${c.profile.samples.length} samples \u2192 ${y}`),o.verbose&&c.profile.samples.length>0)for(let $ of U(c.profile,12))console.log(` ${$.pct.toFixed(1).padStart(5)}% ${$.name} ${$.url}`)}),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}finally{u.close()}}function E(e){console.error(` perf cpu needs a CDP-enabled browser on :${e}.`),console.error(" the tenant worker can't be profiled via the JS Self-Profiler API (F28),"),console.error(" so the sim must expose Chrome remote debugging. easiest path \u2014"),console.error(" open the sim with a CDP port (it stays driveable over the bridge,"),console.error(" so you can scroll/navigate while profiling):"),console.error(""),console.error(` rnxsim open <metro-port> --new --driver playwright --cdp-port ${e}`),console.error(` rnxsim perf cpu --cdp-port ${e} --match <metro-port>`),console.error(""),console.error(" or launch a standalone CDP Chrome (not bridge-driveable):"),console.error(""),console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\'),console.error(` --remote-debugging-port=${e} --user-data-dir=/tmp/sootsim-cdp \\`),console.error(" --no-sandbox --disable-gpu-sandbox \\"),console.error(" --use-gl=angle --use-angle=metal \\"),console.error(' "http://localhost:5173/rn/<metro-port>" &'),console.error(""),console.error(" override the port with --cdp-port or $SOOTSIM_CDP_PORT.")}function v(e){return e?e.replace(/^https?:\/\/[^/]+/,"").replace(/\?.*$/,"").slice(-50):"(native)"}function U(e,o){let r=e.samples.length||1,n=new Map;for(let t of e.nodes){let s=t.callFrame,a=`${s.functionName||"(anonymous)"}@${v(s.url)}:${s.lineNumber}`,i=n.get(a)??{self:0,name:s.functionName||"(anonymous)",url:`${v(s.url)}:${s.lineNumber}`};i.self+=t.hitCount??0,n.set(a,i)}return[...n.values()].map(t=>({...t,pct:t.self/r*100})).sort((t,s)=>s.self-t.self).slice(0,o)}function h(e,o){let r=e.indexOf(o);if(!(r<0||r===e.length-1))return e[r+1]}function j(){console.log(`
5
- rnxsim perf react \u2014 inspect React component render cost in the tenant worker
4
+ import{j as N}from"./chunk-EDWN2HOO.js";import"./chunk-HPJ5EKIZ.js";import"./chunk-7Q4QKHMA.js";import"./chunk-5QXGSTYI.js";import"./chunk-XIQFYLWD.js";import"./chunk-CPDEUWL5.js";import"./chunk-5ZEFRPCC.js";import"./chunk-HAHJJJUC.js";import"./chunk-KGQAO25M.js";import"./chunk-WRID5SBV.js";import"./chunk-WUYI3XJ5.js";import"./chunk-LZAL3DMP.js";import"./chunk-X7MHCEGG.js";import"./chunk-LXYLCETR.js";import"./chunk-DQQ4CZVC.js";import"./chunk-M4LGUVBM.js";import"./chunk-M43UU7UG.js";import"./chunk-7ATIH7OU.js";import"./chunk-4VJEXQGD.js";import"./chunk-L6UUIQE7.js";import"./chunk-GEAGFYKP.js";import"./chunk-EWVG4A3B.js";import"./chunk-RKY3ZNTA.js";import"./chunk-BSSVLFZR.js";import"./chunk-GGNH44PZ.js";import{q as P,s as R,v as d,w as x}from"./chunk-F3NKCQHM.js";import"./chunk-TJTLXG3R.js";import"./chunk-TNI4PW75.js";import"./chunk-4FRSEZ7Z.js";import"./chunk-UWEDNDND.js";import"./chunk-ABK2V2PR.js";import{mkdirSync as D,writeFileSync as W}from"fs";import{dirname as A,resolve as J}from"path";import{WebSocket as B}from"ws";var C=e=>new Promise(o=>setTimeout(o,e)),S=class{ws;nextId=1;pending=new Map;listeners=new Set;ready;constructor(o){this.ws=new B(o,{maxPayload:1<<28}),this.ready=new Promise((r,n)=>{this.ws.once("open",()=>r()),this.ws.once("error",n)}),this.ws.on("message",r=>{let n=JSON.parse(r.toString());if(n.id&&this.pending.has(n.id)){let{res:t,rej:s}=this.pending.get(n.id);this.pending.delete(n.id),n.error?s(new Error(JSON.stringify(n.error))):t(n.result)}else if(n.method)for(let t of this.listeners)t(n.method,n.params)})}waitOpen(){return this.ready}on(o){this.listeners.add(o)}send(o,r={},n){let t=this.nextId++;return new Promise((s,a)=>{this.pending.set(t,{res:s,rej:a}),this.ws.send(JSON.stringify({id:t,method:o,params:r,...n?{sessionId:n}:{}}))})}close(){try{this.ws.close()}catch{}}};async function O(e,o){let r=Number(h(e,"--duration")??"5");if(!Number.isFinite(r)||r<=0)return console.error(" --duration must be a positive number (seconds)"),1;let n=Number(h(e,"--sample-interval")??"0.1"),t=Number(h(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=h(e,"--match")??"/rn/",a=h(e,"--output")??h(e,"-o"),i=J(process.cwd(),a??"/tmp/sootsim.cpuprofile"),l=[];try{l=await(await fetch(`http://localhost:${t}/json/list`)).json()}catch{return E(t),1}let f=l.find(m=>m.type==="page"&&m.url.includes(s));if(!f)return console.error(` no page target matching "${s}" on CDP :${t}`),console.error(` open targets: ${l.map(m=>m.url).join(", ")||"(none)"}`),1;let u=new S(f.webSocketDebuggerUrl);await u.waitOpen();try{let m=new Map;if(u.on((c,p)=>{c==="Target.attachedToTarget"&&p.targetInfo?.type==="worker"&&m.set(p.sessionId,p.targetInfo.url),c==="Target.detachedFromTarget"&&m.delete(p.sessionId)}),await u.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),await C(500),m.size===0)return console.error(" no worker targets attached \u2014 is the app loaded in this tab?"),1;for(let c of m.keys())await u.send("Profiler.enable",{},c),await u.send("Profiler.setSamplingInterval",{interval:n*1e3},c),await u.send("Profiler.start",{},c);console.log(` recording ${r}s across ${m.size} worker(s) \u2014 interact now\u2026`),await C(r*1e3);let b=[];for(let[c,p]of m){let{profile:y}=await u.send("Profiler.stop",{},c);b.push({url:p,profile:y})}return b.sort((c,p)=>p.profile.samples.length-c.profile.samples.length),D(A(i),{recursive:!0}),b.forEach((c,p)=>{let y=p===0?i:i.replace(/(\.[^.]+)?$/,`.worker${p}$1`);if(W(y,JSON.stringify(c.profile)),console.log(` ${v(c.url)}: ${c.profile.samples.length} samples \u2192 ${y}`),o.verbose&&c.profile.samples.length>0)for(let $ of U(c.profile,12))console.log(` ${$.pct.toFixed(1).padStart(5)}% ${$.name} ${$.url}`)}),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}finally{u.close()}}function E(e){console.error(` perf cpu needs a CDP-enabled browser on :${e}.`),console.error(" the tenant worker can't be profiled via the JS Self-Profiler API (F28),"),console.error(" so the sim must expose Chrome remote debugging. easiest path \u2014"),console.error(" open the sim with a CDP port (it stays driveable over the bridge,"),console.error(" so you can scroll/navigate while profiling):"),console.error(""),console.error(` rnx open <metro-port> --new --driver playwright --cdp-port ${e}`),console.error(` rnx perf cpu --cdp-port ${e} --match <metro-port>`),console.error(""),console.error(" or launch a standalone CDP Chrome (not bridge-driveable):"),console.error(""),console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\'),console.error(` --remote-debugging-port=${e} --user-data-dir=/tmp/sootsim-cdp \\`),console.error(" --no-sandbox --disable-gpu-sandbox \\"),console.error(" --use-gl=angle --use-angle=metal \\"),console.error(' "http://localhost:5173/rn/<metro-port>" &'),console.error(""),console.error(" override the port with --cdp-port or $SOOTSIM_CDP_PORT.")}function v(e){return e?e.replace(/^https?:\/\/[^/]+/,"").replace(/\?.*$/,"").slice(-50):"(native)"}function U(e,o){let r=e.samples.length||1,n=new Map;for(let t of e.nodes){let s=t.callFrame,a=`${s.functionName||"(anonymous)"}@${v(s.url)}:${s.lineNumber}`,i=n.get(a)??{self:0,name:s.functionName||"(anonymous)",url:`${v(s.url)}:${s.lineNumber}`};i.self+=t.hitCount??0,n.set(a,i)}return[...n.values()].map(t=>({...t,pct:t.self/r*100})).sort((t,s)=>s.self-t.self).slice(0,o)}function h(e,o){let r=e.indexOf(o);if(!(r<0||r===e.length-1))return e[r+1]}function j(){console.log(`
5
+ rnx perf react \u2014 inspect React component render cost in the tenant worker
6
6
 
7
7
  usage:
8
- rnxsim perf react profile start [--include-props] [--max-commits N]
9
- rnxsim perf react profile stop
10
- rnxsim perf react summary [--limit 10] [--json]
11
- rnxsim perf react slow [--limit 5] [--json]
12
- rnxsim perf react rerenders [--limit 5] [--json]
13
- rnxsim perf react tree [--depth 3] [--find <name>] [--json]
14
- rnxsim perf react why <fiber-id> [--json]
8
+ rnx perf react profile start [--include-props] [--max-commits N]
9
+ rnx perf react profile stop
10
+ rnx perf react summary [--limit 10] [--json]
11
+ rnx perf react slow [--limit 5] [--json]
12
+ rnx perf react rerenders [--limit 5] [--json]
13
+ rnx perf react tree [--depth 3] [--find <name>] [--json]
14
+ rnx perf react why <fiber-id> [--json]
15
15
 
16
16
  \`react summary\` is the demo-friendly shortcut: it runs both slow and
17
17
  rerenders in one round-trip, prints them as a single table per side,
@@ -19,30 +19,30 @@ and surfaces the duration-zero warning prominently when the bundle is
19
19
  running without React profiler timers.
20
20
 
21
21
  examples:
22
- rnxsim perf react profile start
23
- rnxsim do tap-text Inbox
24
- rnxsim perf react profile stop
25
- rnxsim perf react summary --limit 10
26
- rnxsim perf react slow --limit 10
27
- rnxsim perf react rerenders --json
22
+ rnx perf react profile start
23
+ rnx do tap-text Inbox
24
+ rnx perf react profile stop
25
+ rnx perf react summary --limit 10
26
+ rnx perf react slow --limit 10
27
+ rnx perf react rerenders --json
28
28
  `)}function F(e,o){let r=e.indexOf(o);if(r>=0&&r+1<e.length)return e[r+1];let n=`${o}=`,t=e.find(s=>s.startsWith(n));return t?t.slice(n.length):void 0}function w(e,o,r){let n=F(e,o);if(n===void 0)return r;let t=Number(n);return Number.isFinite(t)&&t>0?Math.round(t):r}function M(e,o){let r=e.map((t,s)=>Math.max(t.length,...o.map(a=>a[s]?.length??0))),n=t=>t.map((s,a)=>s.padEnd(r[a])).join(" ").trimEnd();return[n(e),n(e.map(t=>"-".repeat(t.length))),...o.map(n)].map(t=>` ${t}`).join(`
29
29
  `)}function g(e){console.log(JSON.stringify(e,null,2))}function T(e){e.error&&console.error(` warning: ${e.error}`),e.durationWarning&&console.error(` warning: ${e.durationWarning}`);let o=e.rows??[];if(o.length===0){console.log(` no React render samples yet (${e.commits??0} commit(s))`);return}console.log(M(["component","total","avg","commits","slowest"],o.map(r=>[r.displayName,`${r.totalMs.toFixed(2)}ms`,`${r.avgMs.toFixed(2)}ms`,String(r.commitCount),`#${r.slowestCommit} ${r.slowestMs.toFixed(2)}ms`])))}function k(e){e.error&&console.error(` warning: ${e.error}`);let o=e.rows??[];if(o.length===0){console.log(` no React render samples yet (${e.commits??0} commit(s))`);return}console.log(M(["component","renders","causes"],o.map(r=>{let n=Object.entries(r.causes??{}).filter(([,t])=>t>0).sort((t,s)=>s[1]-t[1]).slice(0,4).map(([t,s])=>`${t}:${s}`).join(", ");return[r.displayName,String(r.renders??r.count),n||"-"]})))}function _(e){e.error&&console.error(` warning: ${e.error}`);let o=e.rows??[];if(o.length===0){console.log(` no React tree data yet (${e.roots??0} root(s))`);return}for(let r of o){let n=" ".repeat(r.depth);console.log(` ${n}@${r.id} ${r.displayName} [${r.kind}] children=${r.childCount}`)}}function z(e){if(e.error){console.error(` ${e.error}`);return}let o=e.sample;if(!o){console.log(" no sample");return}if(console.log(` @${o.fiberId} ${o.displayName}`),console.log(` duration: ${Number(o.actualDuration??0).toFixed(2)}ms`),console.log(` causes: ${(o.causes??[]).join(", ")||"-"}`),o.propDiffs?.length){console.log(" props:");for(let r of o.propDiffs){let n="old"in r||"new"in r?` ${JSON.stringify(r.old)} \u2192 ${JSON.stringify(r.new)}`:"";console.log(` ${r.key}${n}`)}}o.parentChain?.length&&console.log(` parents: ${o.parentChain.join(" \u2190 ")}`)}async function I(e,o){let r=P(e,{port:o.port,stripBooleanFlags:["--json","--include-props","--help","-h"],stripValueFlags:["--limit","--depth","--find","--max-commits"]});if(e.includes("--help")||e.includes("-h"))return j(),0;let[n,t]=r.positional,s=e.includes("--json"),a=R(r);try{if(n==="profile"&&t==="start"){let i=await x(a,"SootSim.bridges.reactProfile.start",{includeProps:e.includes("--include-props"),maxCommits:w(e,"--max-commits",2e3)});return s?g(i):console.log(" React profile started"),0}if(n==="profile"&&t==="stop"){let i=await x(a,"SootSim.bridges.reactProfile.stop");return s?g(i):(console.log(` React profile stopped (${i.commits??0} commit(s))`),i.error&&console.error(` warning: ${i.error}`)),i.error?1:0}if(n==="summary"){let i=w(e,"--limit",10),[l,f]=await Promise.all([d(a,"SootSim.bridges.reactProfile.slow",{limit:i}),d(a,"SootSim.bridges.reactProfile.rerenders",{limit:i})]);if(s)return g({commits:l.commits??f.commits??0,slow:l,rerenders:f}),0;let u=l.commits??f.commits??0;console.log(` React profile summary (${u} commit(s)):`),l.error&&console.error(` warning: ${l.error}`),l.durationWarning&&console.error(` warning: ${l.durationWarning}`),f.error&&console.error(` warning: ${f.error}`),console.log(`
30
30
  slowest renders:`),T(l),console.log(`
31
31
  most rerenders:`),k(f);let m=l.rows?.[0];return(l.rows&&l.rows.length>0?l.rows.every(c=>c.totalMs<=0&&c.slowestMs<=0):!1)&&!l.durationWarning&&console.error(`
32
- warning: every commit reports actualDuration=0ms \u2014 the React profiler timer is disabled in this bundle (rerender counts are still accurate; ${m?.displayName?`top-listed: ${m.displayName}`:"no slow signal"}).`),0}if(n==="slow"){let i=await d(a,"SootSim.bridges.reactProfile.slow",{limit:w(e,"--limit",10)});return s?g(i):T(i),0}if(n==="rerenders"){let i=await d(a,"SootSim.bridges.reactProfile.rerenders",{limit:w(e,"--limit",10)});return s?g(i):k(i),0}if(n==="tree"){let i=await d(a,"SootSim.bridges.reactProfile.tree",{depth:w(e,"--depth",3),find:F(e,"--find")});return s?g(i):_(i),0}if(n==="why"){let i=Number(t);if(!Number.isFinite(i)||i<=0)return console.error(" usage: rnxsim perf react why <fiber-id>"),1;let l=await d(a,"SootSim.bridges.reactProfile.why",Math.round(i));return s?g(l):z(l),l.error?1:0}return j(),n?1:0}finally{a.close()}}var G=new Set(["--sim","--port","-p"]),L=new Set(["cpu","react","shell","scroll"]);function H(e){for(let o=0;o<e.length;o++){let r=e[o];if(r.startsWith("-")){G.has(r)&&o++;continue}return L.has(r)?{name:r,index:o}:null}return null}function V(e,o){return[...e.slice(0,o),...e.slice(o+1)]}function Z(){console.log(`
33
- rnxsim perf \u2014 performance profiling tools
32
+ warning: every commit reports actualDuration=0ms \u2014 the React profiler timer is disabled in this bundle (rerender counts are still accurate; ${m?.displayName?`top-listed: ${m.displayName}`:"no slow signal"}).`),0}if(n==="slow"){let i=await d(a,"SootSim.bridges.reactProfile.slow",{limit:w(e,"--limit",10)});return s?g(i):T(i),0}if(n==="rerenders"){let i=await d(a,"SootSim.bridges.reactProfile.rerenders",{limit:w(e,"--limit",10)});return s?g(i):k(i),0}if(n==="tree"){let i=await d(a,"SootSim.bridges.reactProfile.tree",{depth:w(e,"--depth",3),find:F(e,"--find")});return s?g(i):_(i),0}if(n==="why"){let i=Number(t);if(!Number.isFinite(i)||i<=0)return console.error(" usage: rnx perf react why <fiber-id>"),1;let l=await d(a,"SootSim.bridges.reactProfile.why",Math.round(i));return s?g(l):z(l),l.error?1:0}return j(),n?1:0}finally{a.close()}}var G=new Set(["--sim","--port","-p"]),L=new Set(["cpu","react","shell","scroll"]);function H(e){for(let o=0;o<e.length;o++){let r=e[o];if(r.startsWith("-")){G.has(r)&&o++;continue}return L.has(r)?{name:r,index:o}:null}return null}function V(e,o){return[...e.slice(0,o),...e.slice(o+1)]}function Z(){console.log(`
33
+ rnx perf \u2014 performance profiling tools
34
34
 
35
35
  usage:
36
- rnxsim perf cpu [options]
37
- rnxsim perf react <subcommand> [options]
38
- rnxsim perf shell <start|stop|transition> [options]
39
- rnxsim perf scroll <start|stop> [options]
36
+ rnx perf cpu [options]
37
+ rnx perf react <subcommand> [options]
38
+ rnx perf shell <start|stop|transition> [options]
39
+ rnx perf scroll <start|stop> [options]
40
40
 
41
41
  examples:
42
- rnxsim perf cpu --duration 5 --output /tmp/trace.cpuprofile
43
- rnxsim perf react summary --limit 10
44
- rnxsim perf shell start
45
- rnxsim perf shell stop --json
46
- rnxsim perf scroll start
47
- rnxsim perf scroll stop --json
42
+ rnx perf cpu --duration 5 --output /tmp/trace.cpuprofile
43
+ rnx perf react summary --limit 10
44
+ rnx perf shell start
45
+ rnx perf shell stop --json
46
+ rnx perf scroll start
47
+ rnx perf scroll stop --json
48
48
  `)}async function te(e,o){let r=H(e);if(!r)return Z(),e.includes("--help")||e.includes("-h")?0:1;let n=V(e,r.index);if(r.name==="cpu")return O(n,o);if(r.name==="react")return I(n,o);let t=n.includes("--help")||n.includes("-h")?[]:n;return await N(["debug","perf",...t],{...o,internalPerfCommand:r.name==="scroll"?"scroll":"shell"}),typeof process.exitCode=="number"?process.exitCode:0}export{te as runPerf};
@@ -0,0 +1,13 @@
1
+ /*! rnx v0.1.337 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{q as h,s as w,v as m,w as u}from"./chunk-F3NKCQHM.js";import"./chunk-TJTLXG3R.js";import"./chunk-4FRSEZ7Z.js";import"./chunk-ABK2V2PR.js";var A=["not-determined","restricted","denied","authorized","limited","provisional","ephemeral","unavailable"],E=["app-tracking-transparency","bluetooth","calendars","camera","contacts","face-id","local-network","location-always","location-when-in-use","media-library","microphone","motion","notifications","photo-library","photo-library-add-only","reminders","siri","speech-recognition"];function b(){console.log(`
5
+ rnx permissions \u2014 inspect and change simulated operating-system permissions
6
+
7
+ usage:
8
+ rnx permissions list [--json]
9
+ rnx permissions get <app-id> [--json]
10
+ rnx permissions set <app-id> <kind> <status> [--once] [--accuracy full|reduced] [--json]
11
+ rnx permissions reset <app-id> [kind] [--json]
12
+ `)}function S(n,i){console.log(i?JSON.stringify(n,null,2):n)}function $(n,i){let e=n.indexOf(i);return e>=0?n[e+1]:void 0}function P(n){return E.find(i=>i===n)??null}function j(n){return A.find(i=>i===n)??null}function x(n,i,e){switch(n){case"authorized":return{status:n,...i?{authorizationScope:"once"}:null,...e?{locationAccuracy:e}:null};case"not-determined":case"restricted":case"denied":case"limited":case"provisional":case"ephemeral":case"unavailable":return{status:n}}}async function B(n,i){if(n.includes("--help")||n.includes("-h"))return b(),0;let e=h(n,{port:i.port,stripBooleanFlags:["--json","--once"],stripValueFlags:["--accuracy"]}),[s,o,r,f]=e.positional;if(!s)return b(),1;let c=n.includes("--json"),t=w(e);try{if(s==="list"){let p=await m(t,"SootSim.bridges.test.permissionListApps");return S(c?p:p.map(l=>`${l.appId} ${l.displayName}`).join(`
13
+ `),c),0}if(!o)throw new Error(`${s} requires an app id`);if(s==="get"){let p=await m(t,"SootSim.bridges.test.permissionGetAppSettings",o);return S(p,c),0}if(s==="reset"){if(r){let l=P(r);if(!l)throw new Error(`unknown permission kind: ${r}`);await u(t,"SootSim.bridges.test.permissionSetAppPermission",o,l,{status:"not-determined"})}else await u(t,"SootSim.bridges.test.permissionResetApp",o);let p=await m(t,"SootSim.bridges.test.permissionGetAppSettings",o);return S(p,c),0}if(s!=="set")throw new Error(`unknown permissions command: ${s}`);if(!r||!f)throw new Error("set requires an app id, permission kind, and status");let a=P(r);if(!a)throw new Error(`unknown permission kind: ${r}`);let g=j(f);if(!g)throw new Error(`unknown permission status: ${f}`);let d=$(n,"--accuracy"),y=d==="full"||d==="reduced"?d:void 0;if(d&&!y)throw new Error(`unknown location accuracy: ${d}`);let k=await u(t,"SootSim.bridges.test.permissionSetAppPermission",o,a,x(g,n.includes("--once"),y));return S(k,c),0}catch(a){return console.error(` permissions failed: ${a instanceof Error?a.message:a}`),1}finally{t.close()}}export{B as runPermissions};
@@ -0,0 +1,72 @@
1
+ /*! rnx v0.1.337 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a as W}from"./chunk-OCPWXT73.js";import{a as oe}from"./chunk-2ANFH72P.js";import{a as Z,c as ee}from"./chunk-5SHAOQHJ.js";import{d as Y}from"./chunk-LZAL3DMP.js";import"./chunk-X7MHCEGG.js";import"./chunk-LXYLCETR.js";import"./chunk-7ATIH7OU.js";import"./chunk-NCG6C5AH.js";import"./chunk-J6BYRRZQ.js";import{e as X,q as v,s as y,t as Q}from"./chunk-F3NKCQHM.js";import"./chunk-TJTLXG3R.js";import"./chunk-4FRSEZ7Z.js";import"./chunk-UWEDNDND.js";import"./chunk-ABK2V2PR.js";import{existsSync as he,mkdirSync as E,readdirSync as be,readFileSync as ve,rmSync as q,writeFileSync as I}from"fs";import{homedir as ye,tmpdir as Se}from"os";import{dirname as z,extname as re,join as F,resolve as $e}from"path";var J=24e4,Re=9e4,xe=3e4;async function D(e,r,o,i){let t=Math.max(2e4,i+xe);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
5
+ the capture lock auto-releases, so simply retry the recording.
6
+ if it persists, recover the sim with \`rnx close --sim <id>\`.`),process.exit(1)),/render host not available|already streaming|already recording|lock already held/i.test(s)&&(console.error(` ${o} failed: ${s}
7
+ a prior recording was abandoned and its capture is still
8
+ releasing. the lock self-heals in ~${Math.round((i+2e4)/1e3)}s \u2014 retry then, or recover now with
9
+ \`rnx close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var _e=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),ke=new Set(["start","stop","cancel","status","prelude-start","upload"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){_e.has(o)&&r++;continue}return ke.has(o)?{name:o,index:r}:null}return null}function te(e){let r=u(e,"--owner")?.trim(),o=u(e,"--repo")?.trim();return(r&&!o||!r&&o)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),r&&o?{owner:r,repo:o}:null}async function He(e,r){let o=Oe(e);if(o){let d=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Te(d,r);return}if(o.name==="prelude-start"){await Ie(d,r);return}if(o.name==="upload"){let{runUpload:S}=await import("./upload-36O32DII.js");await S(d,r);return}if(o.name==="stop"){await Pe(d,r);return}if(o.name==="cancel"){await Ne(d,r);return}await Ae(d,r);return}let i=v(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open","--lockstep"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=se(u(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=u(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let c=u(e,"--output"),a=Number(u(e,"--duration")??"10");(!Number.isFinite(a)||a<=0)&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let l=600;a>l&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 exceeds the ${l}s (10m) maximum`),process.exit(1));let m=Number(u(e,"--fps")??"30"),p=u(e,"--frames");if(p!==void 0){let d=Number(p);(!Number.isInteger(d)||d<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let _=e.includes("--open"),k=u(e,"--max-width")?Number(u(e,"--max-width")):void 0;e.includes("--lockstep")&&(console.error(" --lockstep works with `record start` / `record stop` (stateful mode) \u2014 atomic --duration is wall-clock and cannot bound a virtual-time capture"),process.exit(1));let w=Math.max(100,Math.round(a*1e3)),K=u(e,"--origin"),fe=te(e);if(t==="live"||t==="combined"){c&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await W("record",{originOverride:K,allowGitHubAuth:!0});let d=y({...i,commandTimeoutMs:6e4});try{await H(d),await de(d,t),t==="combined"&&await B(d),await ce(d,K,fe);let S=await le(d,t,t==="combined"?n:void 0);S.ok||(console.error(` start failed: recording store refused to start (${t})`+(S.error?`: ${S.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(f=>setTimeout(f,w)),await ue(d);let O=await me(d);pe(O,_,t)}finally{d.close()}return}let A=p?Number(p):null,R=Be(s,c,A);_&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let b=y({...i,commandTimeoutMs:6e4});try{if(await ne(b),await B(b),R==="png"){let x=A??10,h=T(c,`sootsim-frames-${C()}`);c&&re(c)&&console.log(` note: --frames writes multiple pngs, so --output "${c}" is a directory \u2014 frame-NNN.png files land inside it`),E(h,{recursive:!0});for(let g of be(h))/^frame-\d+\.png$/.test(g)&&q(F(h,g),{force:!0});console.log(` sampling ${x} frames over ${a}s \u2192 ${h}`);let $=await b.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${x}, durationMs: ${w}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!$.ok||!$.requestId)&&(console.error(` frame capture start failed: ${$.error??"unknown error"}`),process.exit(1)),await new Promise(g=>setTimeout(g,w));let ge=Date.now()+Math.max(5e3,w),N=null;for(;;){let g=await b.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${$.requestId})`});if(g||(console.error(" frame capture result missing"),process.exit(1)),g.done){g.ok||(console.error(` frame capture failed: ${g.error??"unknown error"}`),process.exit(1)),N=g.frames??[];break}Date.now()>=ge&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(P=>setTimeout(P,100))}N.forEach((g,P)=>{let we=`${h}/frame-${String(P+1).padStart(3,"0")}.png`;I(we,Buffer.from(g.data,"base64"))}),console.log(` saved ${N.length} frames`);return}if(R==="gif"){let x=A??Math.max(10,Math.round(a*m/3)),h=T(c,`sootsim-${C()}.gif`);E(z(h),{recursive:!0}),console.log(` encoding gif: ${x} frames over ${a}s \u2192 ${h}`);let $=await D(b,`window.__sootsimRecorder.captureGif({ frames: ${x}, durationMs: ${w}${k?`, maxWidth: ${k}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",w);$||(console.error(" gif capture returned no frames"),process.exit(1)),I(h,Buffer.from($.data,"base64")),console.log(` saved: ${h} (${L($.size)})`);return}let d=T(c,`sootsim-${C()}.${R}`);E(z(d),{recursive:!0});let S={format:R,fps:m,durationMs:w};n&&(S.layers=n);let O=await D(b,`window.__sootsimRecorder.start(${JSON.stringify(S)})`,`${R} start`,w);O.ok||(console.error(` start failed: ${O.error??"unknown error"}`),/render host not available|already streaming|already recording|lock already held/i.test(O.error??"")&&console.error(" a prior recording was abandoned and its capture is still\n releasing. retry in ~20s, or recover now with\n `rnx close --sim <id>` then reopen the sim."),process.exit(1)),console.log(` recording ${R} for ${a}s \u2192 ${d}`),await new Promise(x=>setTimeout(x,w));let f=await D(b,"window.__sootsimRecorder.stop()",`${R} encode/flush`,w);f.ok||(console.error(` stop failed: ${f.error??"unknown error"}`),process.exit(1)),f.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await ie(b,d),console.log(` saved: ${d} (${L(f.size)})`),f.durationMs&&f.frameCount!==void 0&&console.log(` source frames: ${f.frameCount} over ${(f.durationMs/1e3).toFixed(2)}s (${(f.frameCount/(f.durationMs/1e3)).toFixed(1)}fps)`)}finally{b.close()}}var Me=6e3;async function V(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:Me})}catch(o){let i=o instanceof Error?o.message:String(o);throw/^command timed out after \d+s$/.test(i)&&(console.error(" sim did not respond \u2014 it is connected to the bridge but has not\n loaded an app (or its page is unresponsive). run `rnx list`\n and target a sim with a loaded app via --sim <id>."),process.exit(1)),o}}async function ne(e){await V(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is rnx engine running in this sim?"),process.exit(1))}async function B(e){let{hidden:r}=await Q(e);r&&(console.error(` refusing to record: the rnx tab is hidden, so frame capture
10
+ would be throttled to ~1fps and produce a frozen-looking file.
11
+ bring the chrome window to the foreground (un-minimize / switch to
12
+ its tab) or run the recording in headless playwright, then retry.`),process.exit(1))}async function ie(e,r){let o=[],i=0;for(;;){let t=await e.send({type:"evaluate",code:`window.__sootsimRecorder.getBlobBase64({ offset: ${i}, chunk: 2097152 })`});if(!t)throw new Error("no blob available on recorder");if(o.push(Buffer.from(t.data,"base64")),i=t.offset,t.done)break}I(r,Buffer.concat(o))}function u(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function Ee(e){if(!e)return;let r=re(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function Be(e,r,o){return e||(o!=null?"png":Ee(r)??"webm")}function C(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function Ue(){let e=F(ye(),".sootsim","recordings");return E(e,{recursive:!0}),e}function T(e,r){return e?$e(process.cwd(),e):F(Ue(),r)}function L(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function se(e){if(!e)return"video";if(e==="video"||e==="live"||e==="combined")return e;console.error(` invalid --mode "${e}" \u2014 expected video | live | combined`),process.exit(1)}function G(){return F(Se(),`sootsim-recording-${X()}.json`)}function U(){let e=G();if(!he(e))return null;try{return{mode:"video",...JSON.parse(ve(e,"utf8"))}}catch{return q(e,{force:!0}),null}}function Ce(e){I(G(),JSON.stringify(e,null,2))}function M(){q(G(),{force:!0})}function j(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
13
+ requested sim ${e}. record state is global (not per-sim);
14
+ this command acts on that session regardless of --sim.`)}async function Te(e,r){let o=U();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`rnx record stop\` first, or \`rnx record cancel\` to discard.`),process.exit(1));let i=v(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--lockstep"],stripValueFlags:["--mode","--fps","--format","--max-width","--origin","--owner","--repo"]}),t=se(u(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=u(e,"--format"),c=s==="mp4"?"mp4":"webm";s&&c!==s&&(console.error(` record start only supports webm or mp4 (got: ${s}). for gif/png use atomic mode: rnx record --format ${s} --duration <s>`),process.exit(1));let a=Number(u(e,"--fps")??"30"),l=te(e),m=y({...i,commandTimeoutMs:t==="live"||t==="combined"?Re:15e3});try{if(t==="live"||t==="combined"){n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await W("record",{originOverride:u(e,"--origin"),allowGitHubAuth:!0}),await H(m),await de(m,t),t==="combined"&&await B(m),await ce(m,u(e,"--origin"),l);let p=await le(m,t,t==="combined"?n:void 0);p.ok||(console.error(` start failed: recording store refused to start (${t})`+(p.error?`: ${p.error}`:"")),process.exit(1))}else{await ne(m),await B(m);let p=e.includes("--lockstep");p&&c!=="mp4"&&(console.error(" --lockstep requires --format mp4 (webm is realtime-clocked)"),process.exit(1));let _={format:c,fps:a};n&&(_.layers=n),p&&(_.lockstep=!0);let k=await m.send({type:"evaluate",code:`window.__sootsimRecorder.start(${JSON.stringify(_)})`});k.ok||(console.error(` start failed: ${k.error??"unknown error"}`),process.exit(1))}Ce({simId:i.simId??null,mode:t,format:c,fps:a,layers:n,startedAt:new Date().toISOString()}),console.log(t==="video"?` recording ${c} @ ${a}fps${n?` (${n})`:""} \u2014 run \`rnx record stop --output <path>\` when done`:` recording ${t} \u2014 run \`rnx record stop\` when done (add --open to launch the preview URL)`)}finally{m.close()}}async function Ie(e,r){let o=U();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`rnx record stop\` first, or \`rnx record cancel\` to discard.`),process.exit(1));let i=v(e,{port:r.port,stripBooleanFlags:[],stripValueFlags:["--origin"]}),t=y({...i,commandTimeoutMs:15e3});try{if(await H(t),await B(t),!await t.send({type:"evaluate",code:`(() => {
15
+ const start = window.SootSim?.bridges?.startRecordingPrelude
16
+ if (typeof start !== 'function') return false
17
+ return Promise.resolve(start()).then((value) => value === true)
18
+ })()`})){let s=await t.send({type:"evaluate",code:`(() => {
19
+ const getError = window.SootSim?.bridges?.getRecordingStartError
20
+ return typeof getError === 'function' ? getError() : null
21
+ })()`}).catch(()=>null);console.error(` prelude start failed: recording store refused to start${typeof s=="string"&&s?` (${s})`:""}`),process.exit(1)}console.log(" recording preview prelude \u2014 run `rnx record start --mode combined` when the visible proof segment is ready")}finally{t.close()}}async function ae(e){try{let r=await e.send({type:"evaluate",code:`(() => {
22
+ const store = window.SootSim?.bridges?.getRecordingState?.();
23
+ const headless = window.__sootsimRecorder?.state?.();
24
+ const eventRecorder = window.SootSim?.bridges?.eventRecorder ?? window.__sootsimEventRecorder;
25
+ const eventRecording =
26
+ typeof eventRecorder?.isRecording === 'function'
27
+ ? eventRecorder.isRecording() === true
28
+ : false;
29
+ return { store: store ? store.state : undefined, headless, eventRecording };
30
+ })()`});return r?r.store==="recording"||r.headless==="recording"?"recording":r.store==="processing"?"processing":r.eventRecording?"prelude":r.store==="idle"||r.headless==="idle"?"idle":null:null}catch{return null}}async function Fe(e){let r=await e.send({type:"evaluate",code:`(() => {
31
+ const store = window.SootSim?.bridges?.getRecordingState?.();
32
+ const eventRecorder = window.SootSim?.bridges?.eventRecorder ?? window.__sootsimEventRecorder;
33
+ const hadStoreRecording = store && store.state !== 'idle';
34
+ const hadEventRecording =
35
+ typeof eventRecorder?.isRecording === 'function'
36
+ ? eventRecorder.isRecording() === true
37
+ : false;
38
+ const cancel = window.SootSim?.bridges?.cancelRecording;
39
+ if (typeof cancel === 'function') cancel();
40
+ return Boolean(hadStoreRecording || hadEventRecording);
41
+ })()`}).catch(()=>!1),o=await e.send({type:"evaluate",code:`(async () => {
42
+ const r = window.__sootsimRecorder;
43
+ if (r && typeof r.forceRelease === 'function') return await r.forceRelease();
44
+ return false;
45
+ })()`}).catch(()=>!1);return{store:r,headless:o}}async function Ae(e,r){let o=U();if(o){j(v(e,{port:r.port}).simId,o),o.mode==="video"?console.log(` recording ${o.mode} (${o.format} @ ${o.fps}fps) on sim ${o.simId??"?"} since ${o.startedAt}`):console.log(` recording ${o.mode} on sim ${o.simId??"?"} since ${o.startedAt}`);return}let i=v(e,{port:r.port}),t=y({...i,commandTimeoutMs:8e3});try{let n=await ae(t);if(n==="recording"||n==="processing"||n==="prelude"){if(n==="prelude"){console.log(" a recording preview prelude is active. hidden setup is being\n captured for the next live/combined preview recording. finish\n it with `rnx record start --mode combined`, or discard it\n with `rnx record cancel`.");return}console.log(` a recording is in progress (engine state: ${n}), but not via
46
+ \`record start\` \u2014 it was started by an atomic \`record --duration\`
47
+ run or the in-browser record button, which own their own lifecycle.
48
+ if that controlling run is still alive it will finish on its own
49
+ (atomic \`--mode video/gif/png\` writes a local file from that
50
+ process; live/combined upload to /preview/<id>). if the run was
51
+ killed, the recording is abandoned and will NOT finish \u2014 reclaim
52
+ it now with \`rnx record cancel\`, or it auto-reclaims when the
53
+ abandoned capture's deadline lapses.`)}else console.log(" no recording in progress")}finally{t.close()}}async function Ne(e,r){let o=U();if(!o){let s=v(e,{port:r.port}),c=y({...s,commandTimeoutMs:8e3});try{let a=await ae(c);if(a==="recording"||a==="processing"||a==="prelude"){let l=await Fe(c);l.store&&a==="prelude"?console.log(" recording preview prelude cancelled"):l.store||l.headless?console.log(" reclaimed an abandoned recording (started by an atomic\n `record --duration` run or the record button whose owner is\n gone). the recorder is idle again \u2014 live/combined can start."):console.log(" a recording is in progress and still owned by a live atomic\n `record --duration` run or the in-browser record button \u2014 it\n will finish on its own and nothing was reclaimed.")}else console.log(" no recording in progress")}finally{c.close()}return}let i=v(e,{port:r.port});j(i.simId,o);let t=o.simId??i.simId??void 0,n=y({...i,simId:t,commandTimeoutMs:15e3});try{o.mode==="live"||o.mode==="combined"?await n.send({type:"evaluate",code:"void window.SootSim?.bridges?.cancelRecording?.()"}):await n.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"})}catch{}finally{M(),n.close()}console.log(" recording cancelled")}async function Pe(e,r){let o=U();o||(console.error(" no recording in progress. start one with `rnx record start`."),process.exit(1));let i=v(e,{port:r.port,stripBooleanFlags:["--open"],stripValueFlags:["--output"]});j(i.simId,o);let t=o.simId??i.simId??void 0,n=e.includes("--open"),s=y({...i,simId:t,commandTimeoutMs:o.mode==="live"||o.mode==="combined"?J:6e4});try{if(o.mode==="live"||o.mode==="combined"){await ue(s);let m=await me(s);M(),pe(m,n,o.mode);return}let c=u(e,"--output"),a=T(c,`sootsim-${C()}.${o.format}`);E(z(a),{recursive:!0});let l=await s.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"});l.ok||(console.error(` stop failed: ${l.error??"unknown error"}`),M(),process.exit(1)),l.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),M(),process.exit(1)),await ie(s,a),M(),console.log(` saved: ${a} (${L(l.size)})`),l.durationMs&&l.frameCount!==void 0&&console.log(` source frames: ${l.frameCount} over ${(l.durationMs/1e3).toFixed(2)}s (${(l.frameCount/(l.durationMs/1e3)).toFixed(1)}fps)`)}finally{s.close()}}async function H(e){await V(e,'typeof window.SootSim?.bridges?.startRecording === "function" && typeof window.SootSim?.bridges?.stopRecording === "function"')||(console.error(" SootSim.bridges.startRecording missing \u2014 is rnx engine running in this sim?"),process.exit(1))}async function de(e,r){await V(e,`(() => {
54
+ const fn = window.__sootsimCaptureBundle
55
+ if (typeof fn !== 'function') return false
56
+ const snap = fn()
57
+ return !!(snap && snap.bundleUrl)
58
+ })()`)||(console.error(` --mode ${r} needs a guest app bundle to upload to /preview/<id>,
59
+ but this sim has no bundle loaded (a built-in shell screen like
60
+ photos/settings/home has none). open a metro/guest app first, or
61
+ use \`--mode video\` for a local screen recording with no upload.`),process.exit(1))}async function ce(e,r,o){let i=Z();if(!i)return;let t=i.kind==="api-key"?i.secret:i.token,n=oe(),s={branch:n.branch??void 0,commitSha:n.commitSha??void 0,githubUsername:n.githubUsername??void 0,pullRequestNumber:n.pullRequestNumber??void 0,pullRequestTitle:n.pullRequestTitle??void 0},c=i.kind==="github"?{...ee(i),owner:o?.owner,repo:o?.repo,...s}:o?{owner:o.owner,repo:o.repo,...s}:null,a=r?r.replace(/\/$/,""):null;await e.send({type:"evaluate",code:`(() => {
62
+ const set = window.SootSim && window.SootSim.bridges && window.SootSim.bridges.setSession
63
+ if (typeof set !== 'function') return false
64
+ set({ token: ${JSON.stringify(t)}, user: null })
65
+ window.__sootsimPreviewUploadIdentity = ${JSON.stringify(c)}
66
+ window.__sootsimPreviewUseInjectedBearer = true
67
+ ${a?`window.__sootsimUploadOrigin = ${JSON.stringify(a)}`:"delete window.__sootsimUploadOrigin"}
68
+ return true
69
+ })()`})||(console.error(" SootSim.bridges.setSession missing \u2014 this sim is running an engine\n build without CLI-injected preview auth. reload the sim or open a\n fresh one (`rnx open --new`); if it persists, update rnx."),process.exit(1))}async function le(e,r,o){let i=o?JSON.stringify(o):"undefined";return await e.send({type:"evaluate",code:`window.SootSim.bridges.startRecording(${JSON.stringify(r)}, ${i}, { skipEntitlement: true })`})===!0?{ok:!0,error:null}:{ok:!1,error:await e.send({type:"evaluate",code:"(window.SootSim?.bridges?.getRecordingStartError?.() ?? null)"}).catch(()=>null)??null}}async function ue(e){await e.send({type:"evaluate",code:"void window.SootSim.bridges.stopRecording()"})}async function me(e){let r=Date.now()+J;for(;Date.now()<r;){let o=await e.send({type:"evaluate",code:"(() => { const s = window.SootSim?.bridges?.getRecordingState?.(); return s ? { state: s.state, lastUpload: s.lastUpload, uploadError: s.uploadError } : null })()"});if(o&&o.state==="idle"){if(o.uploadError)return{uploadError:o.uploadError};if(o.lastUpload?.previewUrl)return{previewUrl:o.lastUpload.previewUrl,eventCount:o.lastUpload.eventCount}}await new Promise(i=>setTimeout(i,300))}return{uploadError:`upload did not settle within ${J/1e3}s`}}function pe(e,r,o){e.uploadError&&(console.error(` upload failed: ${e.uploadError}`),process.exit(1)),e.previewUrl||(console.error(" upload returned no preview URL"),process.exit(1)),console.log(` preview: ${e.previewUrl}`),console.log(` note: this URL is content-addressed \u2014 re-recording the same bundle
70
+ replaces this capture at the same /preview/<id>.`),(o==="live"||o==="combined")&&typeof e.eventCount=="number"&&console.log(` captured ${e.eventCount} event${e.eventCount===1?"":"s"}`),(o==="live"||o==="combined")&&e.eventCount===0&&console.log(o==="combined"?` note: this combined recording captured no events \u2014 the Live tab has
71
+ nothing to replay. Video will play the captured screen recording.`:` note: this live recording captured no events \u2014 the preview has nothing
72
+ to replay and will boot a fresh interactive session instead.`),r&&Y(e.previewUrl)}export{Ee as extToFormat,Be as resolveFormat,He as runRecord,u as valueOf};
@@ -1,12 +1,12 @@
1
- /*! rnx v0.1.335 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.337 | (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 m,b as f}from"./chunk-FJSHIWAM.js";import{a as d}from"./chunk-CGZWLSYD.js";import"./chunk-ZZWO6Y7X.js";import{J as p}from"./chunk-GP6QEBZA.js";import{a as l}from"./chunk-IN2PZBQD.js";import"./chunk-CL3PREIE.js";import"./chunk-MTNIDSOA.js";import{existsSync as h,readFileSync as w}from"node:fs";import{resolve as b}from"node:path";var R="https://contrast.dev",g=8e3;function v(){return{request:(t,e)=>fetch(t,e),confirmSubmission:d,isInteractive:process.stdin.isTTY===!0,now:()=>new Date,stdout:t=>process.stdout.write(t),stderr:t=>process.stderr.write(t)}}function I(t,e){let n=t.indexOf(e);if(n===-1)return null;let r=t[n+1];if(!r||r.startsWith("-"))throw new Error(`${e} requires a value`);return r}function D(t,e=process.cwd()){let n=I(t,"--app"),r=new Set,s=t.indexOf("--app");s!==-1&&(r.add(s),r.add(s+1));let a=[];for(let c=0;c<t.length;c+=1){if(r.has(c))continue;let u=t[c];if(!(u==="--yes"||u==="-y"||u==="--dry-run")){if(u.startsWith("-"))throw new Error(`unknown flag: ${u}`);a.push(u)}}let i=a.join(" ").trim();if(!i)throw new Error("describe the missing or broken compatibility behavior");if(i.length>g)throw new Error(`description is too long (maximum ${g} characters)`);return{appDir:b(e,n??"."),description:i,dryRun:t.includes("--dry-run"),yes:t.includes("--yes")||t.includes("-y")}}function y(t){if(!t||typeof t!="object")return;let e={};for(let n of Object.keys(t)){let r=Object.getOwnPropertyDescriptor(t,n)?.value;typeof r=="string"&&(e[n]=r)}return e}function O(t){let e=b(t,"package.json");if(!h(e))return null;let n;try{n=JSON.parse(w(e,"utf8"))}catch{throw new Error(`could not parse ${e}`)}if(!n||typeof n!="object")throw new Error(`${e} must contain a JSON object`);let r=Object.getOwnPropertyDescriptor(n,"name")?.value,s=Object.getOwnPropertyDescriptor(n,"dependencies")?.value,a=Object.getOwnPropertyDescriptor(n,"devDependencies")?.value,i=y(s),c=y(a);return{...typeof r=="string"?{name:r}:{},...i?{dependencies:i}:{},...c?{devDependencies:c}:{}}}async function S(t,e=new Date){let n=O(t.appDir),r=n?(await import("./web-H2IXO5SC.js")).scanDeps(n):null,s=l(),a=p();return{note:t.description,timestamp:e.toISOString(),sootsim_version:a,cli_version:s,bundle:{activeApp:r&&r.projectName!=="unknown"?{appName:r.projectName}:null,reportSource:"cli",runtimeVersion:a,cliVersion:s,platform:process.platform,arch:process.arch,compatibility:r}}}function $(){let t=m(),e=t?.kind==="session"?t.origin.replace(/\/+$/,""):R,n=t&&t.kind!=="github"?f(t):null;return{url:`${e}/api/sootsim/report-issue`,authorization:n}}function k(t){if(!t)return"no package.json found; no compatibility scan attached";let e=t.packages.filter(n=>n.status!=="full"&&n.status!=="not-relevant").length;return`${t.packages.length} React Native ecosystem packages, ${e} needing attention`}function P(t){if(!t||typeof t!="object")return null;let e=Object.getOwnPropertyDescriptor(t,"id")?.value;return typeof e=="string"&&e?e:null}async function V(t,e=v()){let n;try{n=D(t)}catch(o){return e.stderr(` ${o instanceof Error?o.message:String(o)}
5
- usage: rnxsim report-issue [--app <dir>] [--dry-run] [--yes] "<description>"
4
+ import{a as m,b as f}from"./chunk-5SHAOQHJ.js";import{a as d}from"./chunk-5UPRBMIG.js";import"./chunk-J6BYRRZQ.js";import{J as p}from"./chunk-4FRSEZ7Z.js";import{a as l}from"./chunk-IBTHGFKE.js";import"./chunk-UWEDNDND.js";import"./chunk-ABK2V2PR.js";import{existsSync as h,readFileSync as w}from"node:fs";import{resolve as b}from"node:path";var R="https://contrast.dev",g=8e3;function v(){return{request:(t,e)=>fetch(t,e),confirmSubmission:d,isInteractive:process.stdin.isTTY===!0,now:()=>new Date,stdout:t=>process.stdout.write(t),stderr:t=>process.stderr.write(t)}}function I(t,e){let n=t.indexOf(e);if(n===-1)return null;let r=t[n+1];if(!r||r.startsWith("-"))throw new Error(`${e} requires a value`);return r}function D(t,e=process.cwd()){let n=I(t,"--app"),r=new Set,s=t.indexOf("--app");s!==-1&&(r.add(s),r.add(s+1));let a=[];for(let c=0;c<t.length;c+=1){if(r.has(c))continue;let u=t[c];if(!(u==="--yes"||u==="-y"||u==="--dry-run")){if(u.startsWith("-"))throw new Error(`unknown flag: ${u}`);a.push(u)}}let i=a.join(" ").trim();if(!i)throw new Error("describe the missing or broken compatibility behavior");if(i.length>g)throw new Error(`description is too long (maximum ${g} characters)`);return{appDir:b(e,n??"."),description:i,dryRun:t.includes("--dry-run"),yes:t.includes("--yes")||t.includes("-y")}}function y(t){if(!t||typeof t!="object")return;let e={};for(let n of Object.keys(t)){let r=Object.getOwnPropertyDescriptor(t,n)?.value;typeof r=="string"&&(e[n]=r)}return e}function O(t){let e=b(t,"package.json");if(!h(e))return null;let n;try{n=JSON.parse(w(e,"utf8"))}catch{throw new Error(`could not parse ${e}`)}if(!n||typeof n!="object")throw new Error(`${e} must contain a JSON object`);let r=Object.getOwnPropertyDescriptor(n,"name")?.value,s=Object.getOwnPropertyDescriptor(n,"dependencies")?.value,a=Object.getOwnPropertyDescriptor(n,"devDependencies")?.value,i=y(s),c=y(a);return{...typeof r=="string"?{name:r}:{},...i?{dependencies:i}:{},...c?{devDependencies:c}:{}}}async function S(t,e=new Date){let n=O(t.appDir),r=n?(await import("./web-PWXQHQIE.js")).scanDeps(n):null,s=l(),a=p();return{note:t.description,timestamp:e.toISOString(),sootsim_version:a,cli_version:s,bundle:{activeApp:r&&r.projectName!=="unknown"?{appName:r.projectName}:null,reportSource:"cli",runtimeVersion:a,cliVersion:s,platform:process.platform,arch:process.arch,compatibility:r}}}function $(){let t=m(),e=t?.kind==="session"?t.origin.replace(/\/+$/,""):R,n=t&&t.kind!=="github"?f(t):null;return{url:`${e}/api/sootsim/report-issue`,authorization:n}}function k(t){if(!t)return"no package.json found; no compatibility scan attached";let e=t.packages.filter(n=>n.status!=="full"&&n.status!=="not-relevant").length;return`${t.packages.length} React Native ecosystem packages, ${e} needing attention`}function P(t){if(!t||typeof t!="object")return null;let e=Object.getOwnPropertyDescriptor(t,"id")?.value;return typeof e=="string"&&e?e:null}async function V(t,e=v()){let n;try{n=D(t)}catch(o){return e.stderr(` ${o instanceof Error?o.message:String(o)}
5
+ usage: rnx report-issue [--app <dir>] [--dry-run] [--yes] "<description>"
6
6
  `),1}if(!h(n.appDir))return e.stderr(` directory not found: ${n.appDir}
7
7
  `),1;let r;try{r=await S(n,e.now())}catch(o){return e.stderr(` could not prepare the issue report: ${o instanceof Error?o.message:String(o)}
8
8
  `),1}if(e.stdout(`
9
- rnxsim issue report preview
9
+ rnx issue report preview
10
10
 
11
11
  description: ${r.note}
12
12
  compatibility: ${k(r.bundle.compatibility)}
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.337 | (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-JK4OZ2TQ.js";import"./chunk-M4LGUVBM.js";import"./chunk-M43UU7UG.js";import"./chunk-F3NKCQHM.js";import"./chunk-TJTLXG3R.js";import"./chunk-4FRSEZ7Z.js";import"./chunk-ABK2V2PR.js";export{a as runReset};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.337 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c as a}from"./chunk-BVOBXTPN.js";import"./chunk-HAHJJJUC.js";import"./chunk-LXYLCETR.js";import"./chunk-EWVG4A3B.js";import"./chunk-F3NKCQHM.js";import"./chunk-TJTLXG3R.js";import"./chunk-4FRSEZ7Z.js";import"./chunk-UWEDNDND.js";import"./chunk-ABK2V2PR.js";export{a as runRuntime};