rnxsim 0.1.368 → 0.1.370

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 (256) hide show
  1. package/cli/auth.ts +2 -1
  2. package/cli/bin.ts +283 -273
  3. package/cli/commands/app-fonts.ts +3 -2
  4. package/cli/commands/assert.ts +8 -7
  5. package/cli/commands/auth.ts +2 -1
  6. package/cli/commands/box/checkout-plane.ts +49 -16
  7. package/cli/commands/compat.ts +93 -4
  8. package/cli/commands/config.ts +2 -1
  9. package/cli/commands/control.ts +37 -33
  10. package/cli/commands/daemon.ts +22 -21
  11. package/cli/commands/debug.ts +17 -15
  12. package/cli/commands/detect.ts +11 -7
  13. package/cli/commands/detox.ts +5 -4
  14. package/cli/commands/device.ts +6 -5
  15. package/cli/commands/electron.ts +6 -5
  16. package/cli/commands/flow.ts +12 -11
  17. package/cli/commands/inspect/find.ts +2 -1
  18. package/cli/commands/inspect/keyboard.ts +2 -1
  19. package/cli/commands/inspect/sleep.ts +2 -1
  20. package/cli/commands/inspect/wait-event.ts +4 -3
  21. package/cli/commands/inspect/wait-idle.ts +2 -1
  22. package/cli/commands/inspect/wait-ready.ts +3 -2
  23. package/cli/commands/inspect/wait-selector.ts +4 -3
  24. package/cli/commands/inspect/wait.ts +2 -1
  25. package/cli/commands/inspect.ts +82 -80
  26. package/cli/commands/install-desktop.ts +5 -4
  27. package/cli/commands/login.ts +3 -2
  28. package/cli/commands/mode.ts +2 -1
  29. package/cli/commands/record.ts +38 -37
  30. package/cli/commands/runtime.ts +9 -8
  31. package/cli/commands/screenshot-layers.ts +4 -3
  32. package/cli/commands/screenshot-mode.ts +2 -1
  33. package/cli/commands/screenshot.ts +8 -7
  34. package/cli/commands/screenshots-capture.ts +2 -1
  35. package/cli/commands/serve.ts +5 -4
  36. package/cli/commands/shell-boolean-mode.ts +2 -1
  37. package/cli/commands/skills.ts +11 -10
  38. package/cli/commands/telemetry.ts +2 -1
  39. package/cli/commands/three-mode.ts +2 -1
  40. package/cli/commands/timeline.ts +4 -3
  41. package/cli/commands/upload.ts +14 -13
  42. package/cli/commands/what-happened.ts +2 -1
  43. package/cli/recording-access.ts +6 -5
  44. package/cli/run-rnx.ts +140 -0
  45. package/dist-cli/bin.js +6 -6
  46. package/dist-cli/chunks/{agent-GXCQMYV4.js → agent-3R4424LW.js} +2 -2
  47. package/dist-cli/chunks/{agent-wrapper-Y3PQAL6I.js → agent-wrapper-4PPWZWSY.js} +2 -2
  48. package/dist-cli/chunks/app-fonts-KYXB6CXQ.js +4 -0
  49. package/dist-cli/chunks/{assert-BSRQBRH7.js → assert-7EZOWGYQ.js} +11 -11
  50. package/dist-cli/chunks/auth-L7M36H6C.js +12 -0
  51. package/dist-cli/chunks/{beta-R4IZ5SWO.js → beta-FKAF6YWJ.js} +2 -2
  52. package/dist-cli/chunks/{box-2NQYYY3B.js → box-5Y5VBMHV.js} +62 -62
  53. package/dist-cli/chunks/{camera-ER66WWAX.js → camera-XHF2RPFG.js} +2 -2
  54. package/dist-cli/chunks/{chunk-UBH2BWCY.js → chunk-2FOGXVOK.js} +2 -2
  55. package/dist-cli/chunks/{chunk-7B22IPSC.js → chunk-3BG6UCQY.js} +2 -2
  56. package/dist-cli/chunks/{chunk-IXRVFQMT.js → chunk-3SOPYG7S.js} +2 -2
  57. package/dist-cli/chunks/{chunk-7V3S2DY2.js → chunk-3UXXYJVD.js} +1 -1
  58. package/dist-cli/chunks/{chunk-3MPFC3DS.js → chunk-5BR33NAZ.js} +1 -1
  59. package/dist-cli/chunks/{chunk-BWJOLJOK.js → chunk-5RKRVS5A.js} +2 -2
  60. package/dist-cli/chunks/{chunk-WVVAYLWZ.js → chunk-64JAEJ6N.js} +1 -1
  61. package/dist-cli/chunks/{chunk-GXHCJRKE.js → chunk-6A6L3VJR.js} +2 -2
  62. package/dist-cli/chunks/chunk-6GPS7U4X.js +74 -0
  63. package/dist-cli/chunks/{chunk-JHYXRORU.js → chunk-6S5LJV2O.js} +2 -2
  64. package/dist-cli/chunks/{chunk-TOE5O6JE.js → chunk-6W4HIWC7.js} +2 -2
  65. package/dist-cli/chunks/{chunk-ESVUVW3R.js → chunk-72S5FCBY.js} +2 -2
  66. package/dist-cli/chunks/{chunk-TC6DNQL6.js → chunk-7C7TJYZ3.js} +2 -2
  67. package/dist-cli/chunks/{chunk-M7COA4BE.js → chunk-AALKIAUZ.js} +1 -1
  68. package/dist-cli/chunks/{chunk-CKNNO6ZG.js → chunk-ARMXC3C3.js} +25 -25
  69. package/dist-cli/chunks/chunk-AVJBT5LF.js +4 -0
  70. package/dist-cli/chunks/chunk-BMIJZNKD.js +28 -0
  71. package/dist-cli/chunks/{chunk-FSPZY4AI.js → chunk-C7BA5CCM.js} +2 -2
  72. package/dist-cli/chunks/{chunk-EHA65UVJ.js → chunk-CMVRTZ5G.js} +2 -2
  73. package/dist-cli/chunks/chunk-D24EOJ4C.js +24 -0
  74. package/dist-cli/chunks/{chunk-3XMEIZEV.js → chunk-D2GZASRV.js} +1 -1
  75. package/dist-cli/chunks/{chunk-3S2J6IVC.js → chunk-DHYTRCIP.js} +2 -2
  76. package/dist-cli/chunks/{chunk-QMVBWZH2.js → chunk-DMHSD6YJ.js} +2 -2
  77. package/dist-cli/chunks/{chunk-NGWUGNPV.js → chunk-DUXHYPBP.js} +2 -2
  78. package/dist-cli/chunks/{chunk-4FLQYRGN.js → chunk-DXV37CJN.js} +1 -1
  79. package/dist-cli/chunks/{chunk-T2MGLXY5.js → chunk-EOIBLKZO.js} +2 -2
  80. package/dist-cli/chunks/{chunk-PNBQBBG5.js → chunk-EQ3OE2AV.js} +1 -1
  81. package/dist-cli/chunks/{chunk-WFAFAGMG.js → chunk-EWSWOWXK.js} +2 -2
  82. package/dist-cli/chunks/{chunk-HKQXGCQT.js → chunk-FA75F34Z.js} +1 -1
  83. package/dist-cli/chunks/{chunk-NERY6HGZ.js → chunk-FK4JSTZ3.js} +2 -2
  84. package/dist-cli/chunks/{chunk-NPSPWMBO.js → chunk-GJRLPJQL.js} +2 -2
  85. package/dist-cli/chunks/{chunk-TPIPKXJL.js → chunk-GRO74J2X.js} +1 -1
  86. package/dist-cli/chunks/chunk-H5X5FJ63.js +99 -0
  87. package/dist-cli/chunks/chunk-HEKHLQ3B.js +497 -0
  88. package/dist-cli/chunks/chunk-HQQTS2CB.js +30 -0
  89. package/dist-cli/chunks/{chunk-Q65KH25G.js → chunk-I52NT6VG.js} +1 -1
  90. package/dist-cli/chunks/{chunk-AUPJX4KI.js → chunk-IDLFVRPN.js} +1 -1
  91. package/dist-cli/chunks/{chunk-LAKWOJ5Y.js → chunk-JZLDHPB7.js} +2 -2
  92. package/dist-cli/chunks/{chunk-WJQB6AXZ.js → chunk-LIMWG54N.js} +1 -1
  93. package/dist-cli/chunks/{chunk-TE645QCO.js → chunk-LUOHRBJG.js} +1 -1
  94. package/dist-cli/chunks/{chunk-DJSPNOF6.js → chunk-LXPHL6FO.js} +2 -2
  95. package/dist-cli/chunks/{chunk-ECXDCED5.js → chunk-MDCY532E.js} +2 -2
  96. package/dist-cli/chunks/{chunk-4VA2ISWX.js → chunk-NJMU5BN6.js} +1 -1
  97. package/dist-cli/chunks/{chunk-RRALQ4WM.js → chunk-NR2V2ONN.js} +2 -2
  98. package/dist-cli/chunks/{chunk-SHMLYTNH.js → chunk-NTC46LSA.js} +2 -2
  99. package/dist-cli/chunks/{chunk-X5MXQB3L.js → chunk-O6QLKSAM.js} +10 -10
  100. package/dist-cli/chunks/{chunk-LPAOOJIW.js → chunk-OJZHECGH.js} +1 -1
  101. package/dist-cli/chunks/chunk-OTFTMGAL.js +7 -0
  102. package/dist-cli/chunks/{chunk-QKOY7UW5.js → chunk-PAUEZO6F.js} +2 -2
  103. package/dist-cli/chunks/{chunk-WXRDFUR7.js → chunk-PIZXOXBL.js} +2 -2
  104. package/dist-cli/chunks/{chunk-WF2CRNYF.js → chunk-PNOENVMJ.js} +1 -1
  105. package/dist-cli/chunks/{chunk-FDAFSRQE.js → chunk-Q4MRJ6PO.js} +2 -2
  106. package/dist-cli/chunks/{chunk-SSUPPM6K.js → chunk-RRX52O37.js} +1 -1
  107. package/dist-cli/chunks/{chunk-E6XYIIJK.js → chunk-U63T6LIQ.js} +1 -1
  108. package/dist-cli/chunks/{chunk-OZJMWTGA.js → chunk-UFVAAWGZ.js} +1 -1
  109. package/dist-cli/chunks/{chunk-GS5VUDCF.js → chunk-VVQCZ42C.js} +1 -1
  110. package/dist-cli/chunks/{chunk-MCO7V4VN.js → chunk-WFQHT4QD.js} +2 -2
  111. package/dist-cli/chunks/{chunk-JFGW75UL.js → chunk-WPV4H5S4.js} +2 -2
  112. package/dist-cli/chunks/{chunk-OXCDE3DD.js → chunk-X6WQ4YWE.js} +1 -1
  113. package/dist-cli/chunks/{chunk-FVODUDPS.js → chunk-YIZGNT7A.js} +1 -1
  114. package/dist-cli/chunks/{chunk-MGOAQHMO.js → chunk-Z2VBSNFI.js} +2 -2
  115. package/dist-cli/chunks/{chunk-GFWUIGGY.js → chunk-Z3DENGXW.js} +2 -2
  116. package/dist-cli/chunks/{cleanup-WHGLBAJ2.js → cleanup-MXMMJ7JW.js} +2 -2
  117. package/dist-cli/chunks/cli-version-MLS55UTY.js +4 -0
  118. package/dist-cli/chunks/compat-E6KE5KDI.js +23 -0
  119. package/dist-cli/chunks/config-QSLLVZDS.js +13 -0
  120. package/dist-cli/chunks/{connect-N4FV3DDV.js → connect-QE4VU6GB.js} +2 -2
  121. package/dist-cli/chunks/control-XD5F6K5T.js +4 -0
  122. package/dist-cli/chunks/daemon-UN5SE2JO.js +4 -0
  123. package/dist-cli/chunks/{debug-AHEK43AJ.js → debug-5FG3MBJS.js} +20 -20
  124. package/dist-cli/chunks/desktop-5EZX7NX5.js +31 -0
  125. package/dist-cli/chunks/detox-WJGQP5TM.js +52 -0
  126. package/dist-cli/chunks/device-D7LKCAMS.js +18 -0
  127. package/dist-cli/chunks/{diagnose-WDP3CVIX.js → diagnose-A3W6ZTGA.js} +2 -2
  128. package/dist-cli/chunks/{disk-cleanup-JRT5MKFW.js → disk-cleanup-BDRHX5ZG.js} +2 -2
  129. package/dist-cli/chunks/{do-chain-7FDMO56C.js → do-chain-RUJNRPPF.js} +2 -2
  130. package/dist-cli/chunks/drivers-3NJ5RL6X.js +4 -0
  131. package/dist-cli/chunks/{env-YIBOMB24.js → env-U67SQVTV.js} +2 -2
  132. package/dist-cli/chunks/{film-R3EQADMG.js → film-XC6UAQ3V.js} +3 -3
  133. package/dist-cli/chunks/flow-FHZZD3P6.js +4 -0
  134. package/dist-cli/chunks/help-BYYDUSXF.js +4 -0
  135. package/dist-cli/chunks/{hidden-runtime-alias-6M4UERRQ.js → hidden-runtime-alias-7S2TNZXG.js} +2 -2
  136. package/dist-cli/chunks/{home-paths-QJNOHZJO.js → home-paths-LMO5LB4F.js} +2 -2
  137. package/dist-cli/chunks/inspect-RQCTWDCC.js +4 -0
  138. package/dist-cli/chunks/install-desktop-GOWXCQUE.js +4 -0
  139. package/dist-cli/chunks/login-JIU42S4C.js +26 -0
  140. package/dist-cli/chunks/{logout-VNJX2IEW.js → logout-JTAWQXZO.js} +2 -2
  141. package/dist-cli/chunks/{maestro-SQS2OS2D.js → maestro-TYBQYOGB.js} +3 -3
  142. package/dist-cli/chunks/{maestro-generate-GWVPISG5.js → maestro-generate-YLAGWVKE.js} +3 -3
  143. package/dist-cli/chunks/mode-DV24ZRZ6.js +26 -0
  144. package/dist-cli/chunks/{optional-demo-registry-L3LRBQHG.js → optional-demo-registry-JZH66VIM.js} +2 -2
  145. package/dist-cli/chunks/{perf-XLPC4UKR.js → perf-LXXJ4EAX.js} +2 -2
  146. package/dist-cli/chunks/{permissions-QRHWVMDP.js → permissions-KAOVZUPW.js} +2 -2
  147. package/dist-cli/chunks/{platform-F47URZNB.js → platform-KW35446W.js} +3 -3
  148. package/dist-cli/chunks/privacy-MIFE72CG.js +4 -0
  149. package/dist-cli/chunks/record-EK3ETFHZ.js +72 -0
  150. package/dist-cli/chunks/report-issue-NW5PCAZF.js +29 -0
  151. package/dist-cli/chunks/reset-RZ4O5AFJ.js +4 -0
  152. package/dist-cli/chunks/resolve-target-7R5BNYMM.js +4 -0
  153. package/dist-cli/chunks/runtime-MZHLSRS6.js +4 -0
  154. package/dist-cli/chunks/{screenshot-command-RK7IJHVK.js → screenshot-command-TQSPTFT2.js} +11 -11
  155. package/dist-cli/chunks/screenshot-layers-IZP3L3AQ.js +20 -0
  156. package/dist-cli/chunks/screenshots-capture-K7LJOVAE.js +42 -0
  157. package/dist-cli/chunks/{serve-UBXNGLNP.js → serve-MMX4WXXG.js} +18 -18
  158. package/dist-cli/chunks/setup-YFP3KEQZ.js +4 -0
  159. package/dist-cli/chunks/{sim-client-VTKFEDJX.js → sim-client-KLAYIFOC.js} +2 -2
  160. package/dist-cli/chunks/skills-N4D3POIS.js +50 -0
  161. package/dist-cli/chunks/{state-273XJPUE.js → state-ES6TFQZF.js} +2 -2
  162. package/dist-cli/chunks/{storage-RTDFWIY7.js → storage-52DR5V2C.js} +2 -2
  163. package/dist-cli/chunks/store-HOL45WCI.js +4 -0
  164. package/dist-cli/chunks/telemetry-BV6OTYPF.js +4 -0
  165. package/dist-cli/chunks/timeline-NRVNB5JR.js +24 -0
  166. package/dist-cli/chunks/{upgrade-R74NVHKG.js → upgrade-LNED5YQ2.js} +2 -2
  167. package/dist-cli/chunks/upload-RXKHFIBU.js +4 -0
  168. package/dist-cli/chunks/{version-RTFCYQZ7.js → version-VEF2DYGG.js} +2 -2
  169. package/dist-cli/chunks/{web-35SSKBRU.js → web-CGDE6S73.js} +2 -2
  170. package/dist-cli/chunks/welcome-FT2AMUWW.js +5 -0
  171. package/dist-cli/chunks/what-happened-FSIDWL32.js +25 -0
  172. package/dist-cli/chunks/{ws-bridge-JXQUAWFA.js → ws-bridge-QXFQLRE7.js} +2 -2
  173. package/dist-lib/agent-daemon-client.cjs +1 -1
  174. package/dist-lib/agent-events.cjs +1 -1
  175. package/dist-lib/agent-identity.cjs +1 -1
  176. package/dist-lib/agent-sessions.cjs +1 -1
  177. package/dist-lib/attached-projects.cjs +1 -1
  178. package/dist-lib/auth/shared-session.cjs +1 -1
  179. package/dist-lib/backend-origin.cjs +1 -1
  180. package/dist-lib/beta.cjs +1 -1
  181. package/dist-lib/beta.mjs +1 -1
  182. package/dist-lib/bridge-constants.cjs +1 -1
  183. package/dist-lib/bridge-contract-input.cjs +1 -1
  184. package/dist-lib/bridge-contract-input.mjs +1 -1
  185. package/dist-lib/bridge-contract.cjs +1 -1
  186. package/dist-lib/bridge-contract.mjs +1 -1
  187. package/dist-lib/cli-constants.cjs +1 -1
  188. package/dist-lib/config.cjs +1 -1
  189. package/dist-lib/detox/index.cjs +1 -1
  190. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  191. package/dist-lib/home-paths.cjs +1 -1
  192. package/dist-lib/host/bridge-host.cjs +1 -1
  193. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  194. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  195. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  196. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  197. package/dist-lib/host/websocket-proxy.cjs +1 -1
  198. package/dist-lib/index.cjs +1 -1
  199. package/dist-lib/jump-to-source-babel.cjs +1 -1
  200. package/dist-lib/menu.cjs +1 -1
  201. package/dist-lib/menu.mjs +1 -1
  202. package/dist-lib/metro-production-bundle.cjs +1 -1
  203. package/dist-lib/metro-production-bundle.mjs +1 -1
  204. package/dist-lib/metro.cjs +1 -1
  205. package/dist-lib/profiles.cjs +1 -1
  206. package/dist-lib/public-brand.cjs +1 -1
  207. package/dist-lib/react-native-host-modules.cjs +2 -1
  208. package/dist-lib/react-native-host-modules.mjs +2 -1
  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 +1 -1
  212. package/dist-lib/sdk.mjs +1 -1
  213. package/dist-lib/skills.cjs +560 -48
  214. package/dist-lib/vite.cjs +1 -1
  215. package/package.json +1 -1
  216. package/src/react-native-host-modules.ts +1 -0
  217. package/dist-cli/chunks/app-fonts-MDD3W4VN.js +0 -4
  218. package/dist-cli/chunks/auth-SLPHDPCF.js +0 -12
  219. package/dist-cli/chunks/chunk-2YK5J2D2.js +0 -24
  220. package/dist-cli/chunks/chunk-42TLK75A.js +0 -497
  221. package/dist-cli/chunks/chunk-57LITN73.js +0 -7
  222. package/dist-cli/chunks/chunk-T4ZZ26A2.js +0 -28
  223. package/dist-cli/chunks/chunk-UXROQPIN.js +0 -30
  224. package/dist-cli/chunks/chunk-YSHJ3LMQ.js +0 -74
  225. package/dist-cli/chunks/chunk-YYPTSF6W.js +0 -99
  226. package/dist-cli/chunks/cli-version-DMXIXBIM.js +0 -4
  227. package/dist-cli/chunks/compat-MGBKGYGQ.js +0 -20
  228. package/dist-cli/chunks/config-TRDOMP4T.js +0 -13
  229. package/dist-cli/chunks/control-5GRBZVYK.js +0 -4
  230. package/dist-cli/chunks/daemon-MBT5E3ZC.js +0 -4
  231. package/dist-cli/chunks/desktop-LDRIXOVV.js +0 -31
  232. package/dist-cli/chunks/detox-6HAKYISO.js +0 -52
  233. package/dist-cli/chunks/device-QM3S7OVU.js +0 -18
  234. package/dist-cli/chunks/drivers-AJL2EVXH.js +0 -4
  235. package/dist-cli/chunks/flow-BDAA6BWL.js +0 -4
  236. package/dist-cli/chunks/help-5EJD6LJF.js +0 -4
  237. package/dist-cli/chunks/inspect-S3LR3R2A.js +0 -4
  238. package/dist-cli/chunks/install-desktop-GXE6K7BJ.js +0 -4
  239. package/dist-cli/chunks/login-ISWDW4WU.js +0 -26
  240. package/dist-cli/chunks/mode-3URDGBZB.js +0 -26
  241. package/dist-cli/chunks/privacy-BF23T67T.js +0 -4
  242. package/dist-cli/chunks/record-2DN3OUE5.js +0 -72
  243. package/dist-cli/chunks/report-issue-D3BQPSLU.js +0 -29
  244. package/dist-cli/chunks/reset-T5CNZ7D3.js +0 -4
  245. package/dist-cli/chunks/resolve-target-KAAS274S.js +0 -4
  246. package/dist-cli/chunks/runtime-AQJDBR3X.js +0 -4
  247. package/dist-cli/chunks/screenshot-layers-DP2QKSMN.js +0 -20
  248. package/dist-cli/chunks/screenshots-capture-MA7P3FUT.js +0 -42
  249. package/dist-cli/chunks/setup-GH7OW4GC.js +0 -4
  250. package/dist-cli/chunks/skills-HPK25R4B.js +0 -50
  251. package/dist-cli/chunks/store-DLKNNM4L.js +0 -4
  252. package/dist-cli/chunks/telemetry-7CWDXEOO.js +0 -4
  253. package/dist-cli/chunks/timeline-IF2PGK7C.js +0 -24
  254. package/dist-cli/chunks/upload-3JFFVCZ4.js +0 -4
  255. package/dist-cli/chunks/welcome-N5V352SE.js +0 -5
  256. package/dist-cli/chunks/what-happened-WXTP6EPR.js +0 -25
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.368 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.370 | (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 N}from"./chunk-4FLQYRGN.js";import{o as R}from"./chunk-E6XYIIJK.js";import{a as I}from"./chunk-WVVAYLWZ.js";import{a as T}from"./chunk-Q65KH25G.js";function G(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function O(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return G(r)?r:null}catch{return null}}import{randomBytes as q,createHash as X}from"node:crypto";import f from"node:fs";import h from"node:path";var $=null;function B(){if($)return $;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||R()}function y(){return B()}function U(){return h.join(B(),"attached-projects.json")}function _(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=f.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return _();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{f.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return _()}}function K(e){let t=U();f.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=f.openSync(r,"w",384);try{f.writeFileSync(n,JSON.stringify(e,null,2)),f.fsyncSync(n)}finally{f.closeSync(n)}f.renameSync(r,t)}function w(e){let t=S();return e(t),K(t),t}function F(e){return X("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function Q(){return`s_${q(10).toString("hex")}`}function Se(e){let t=h.resolve(e.cwd),r=F(t),n;return w(o=>{let s=o.attachedProjects.find(a=>a.id===r);if(s){let a={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=a,n=a;return}let c=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:c,updatedAt:c};o.attachedProjects.push(d),n=d}),n}function M(e){return S().attachedProjects.find(t=>t.id===e)??null}function we(){return S().attachedProjects}var V=336*60*60*1e3;function ve(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],c=o-V,d=s.filter(a=>a.ts>=c);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Ae(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function xe(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function C(e){let t;return w(r=>{if(e.id){let c=r.agentSessions.find(d=>d.id===e.id);if(c){let d={...c,...e,lastSeenAt:Date.now()},a=r.agentSessions.indexOf(c);r.agentSessions[a]=d,t=d;return}}let n=r.attachedProjects.find(c=>c.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??Q(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function L(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function z(e,t,r=Date.now()){return{...e,...t,id:e.id,projectId:e.projectId,createdAt:e.createdAt,lastSeenAt:r}}function Z(e){e.length!==0&&w(t=>{let r=Date.now(),n=new Map(t.agentSessions.map((o,s)=>[o.id,s]));for(let{id:o,patch:s}of e){let c=n.get(o);c!==void 0&&(t.agentSessions[c]=z(t.agentSessions[c],s,r))}})}function v(e,t){Z([{id:e,patch:t}])}async function Pe(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-L3LRBQHG.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!f.existsSync(o.dir))continue;let s=h.resolve(o.dir),c=F(s);if(n.attachedProjects.some(a=>a.id===c))continue;let d=Date.now();n.attachedProjects.push({id:c,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as ee,spawnSync as te}from"node:child_process";import{randomUUID as re}from"node:crypto";import i,{constants as m}from"node:fs";import u from"node:path";import ne from"node:readline";function b(e){return u.join(y(),"sessions",e)}function J(e){return u.join(b(e),"prompt.in")}function H(e){return u.join(b(e),"events.out")}function se(e){return u.join(y(),"transcripts",`${e}.log`)}function E(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(b(t)))}function oe(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ie();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("rnx CLI not found. set SOOTSIM_BIN to the path of the rnx binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ie(){try{let e=ce();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[rnx] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli`.")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function ce(){try{let r=T.resolve(`${I.packageName}/package.json`);return u.dirname(r)}catch{}let e=ae();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name===I.packageName)return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function ae(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function de(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,c=null;for(;c===null;)try{c=i.openSync(o,m.O_WRONLY|m.O_CREAT|m.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let a=Number(i.readFileSync(o,"utf8").trim());if(a&&!ue(a)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(a=>setTimeout(a,50))}try{return i.writeFileSync(c,String(process.pid)),await r()}finally{try{i.closeSync(c)}catch{}try{i.unlinkSync(o)}catch{}}}function ue(e){try{return process.kill(e,0),!0}catch{return!1}}function W(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=te("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function $e(e){let t=M(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return de(t.id,r,async()=>{let n=L(t.id).find(p=>p.provider===r&&p.status!=="ended"&&E(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`rnx agent end <sessionId>\`.`);let o=r==="claude"?re():void 0,s=C({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),c=J(s.id),d=H(s.id),a=se(s.id);W(c),W(d);let g=u.dirname(a);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:Y}=oe(),x=[...Y,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",c,"--events-out",d,"--transcript",a];e.codexBin&&x.push("--codex-bin",e.codexBin),e.claudeBin&&x.push("--claude-bin",e.claudeBin),e.freshThread&&x.push("--fresh-thread"),o&&x.push("--claude-session-uuid",o);let P=ee(A,x,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});P.unref();let D=e.readyTimeoutMs??6e3,j=await le(d,p=>p.type==="ready"||p.type==="error",D);if(!j||j.type==="error"){if(P.pid)try{process.kill(P.pid,"SIGTERM")}catch{}try{i.rmSync(b(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=j&&j.type==="error"?j.message:`no ready event within ${D}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:P.pid,status:"idle"}),{session:k(s.id),wrapperPid:P.pid}})}async function _e(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!E(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=J(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,m.O_WRONLY);try{let s=N(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
4
+ import{a as N}from"./chunk-DXV37CJN.js";import{o as R}from"./chunk-U63T6LIQ.js";import{a as I}from"./chunk-64JAEJ6N.js";import{a as T}from"./chunk-I52NT6VG.js";function G(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function O(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return G(r)?r:null}catch{return null}}import{randomBytes as q,createHash as X}from"node:crypto";import f from"node:fs";import h from"node:path";var $=null;function B(){if($)return $;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||R()}function y(){return B()}function U(){return h.join(B(),"attached-projects.json")}function _(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=f.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return _();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{f.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return _()}}function K(e){let t=U();f.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=f.openSync(r,"w",384);try{f.writeFileSync(n,JSON.stringify(e,null,2)),f.fsyncSync(n)}finally{f.closeSync(n)}f.renameSync(r,t)}function w(e){let t=S();return e(t),K(t),t}function F(e){return X("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function Q(){return`s_${q(10).toString("hex")}`}function Se(e){let t=h.resolve(e.cwd),r=F(t),n;return w(o=>{let s=o.attachedProjects.find(a=>a.id===r);if(s){let a={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=a,n=a;return}let c=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:c,updatedAt:c};o.attachedProjects.push(d),n=d}),n}function M(e){return S().attachedProjects.find(t=>t.id===e)??null}function we(){return S().attachedProjects}var V=336*60*60*1e3;function ve(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],c=o-V,d=s.filter(a=>a.ts>=c);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Ae(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function xe(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function C(e){let t;return w(r=>{if(e.id){let c=r.agentSessions.find(d=>d.id===e.id);if(c){let d={...c,...e,lastSeenAt:Date.now()},a=r.agentSessions.indexOf(c);r.agentSessions[a]=d,t=d;return}}let n=r.attachedProjects.find(c=>c.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??Q(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function L(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function z(e,t,r=Date.now()){return{...e,...t,id:e.id,projectId:e.projectId,createdAt:e.createdAt,lastSeenAt:r}}function Z(e){e.length!==0&&w(t=>{let r=Date.now(),n=new Map(t.agentSessions.map((o,s)=>[o.id,s]));for(let{id:o,patch:s}of e){let c=n.get(o);c!==void 0&&(t.agentSessions[c]=z(t.agentSessions[c],s,r))}})}function v(e,t){Z([{id:e,patch:t}])}async function Pe(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-JZH66VIM.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!f.existsSync(o.dir))continue;let s=h.resolve(o.dir),c=F(s);if(n.attachedProjects.some(a=>a.id===c))continue;let d=Date.now();n.attachedProjects.push({id:c,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as ee,spawnSync as te}from"node:child_process";import{randomUUID as re}from"node:crypto";import i,{constants as m}from"node:fs";import u from"node:path";import ne from"node:readline";function b(e){return u.join(y(),"sessions",e)}function J(e){return u.join(b(e),"prompt.in")}function H(e){return u.join(b(e),"events.out")}function se(e){return u.join(y(),"transcripts",`${e}.log`)}function E(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(b(t)))}function oe(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ie();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("rnx CLI not found. set SOOTSIM_BIN to the path of the rnx binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ie(){try{let e=ce();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[rnx] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli`.")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function ce(){try{let r=T.resolve(`${I.packageName}/package.json`);return u.dirname(r)}catch{}let e=ae();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name===I.packageName)return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function ae(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function de(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,c=null;for(;c===null;)try{c=i.openSync(o,m.O_WRONLY|m.O_CREAT|m.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let a=Number(i.readFileSync(o,"utf8").trim());if(a&&!ue(a)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(a=>setTimeout(a,50))}try{return i.writeFileSync(c,String(process.pid)),await r()}finally{try{i.closeSync(c)}catch{}try{i.unlinkSync(o)}catch{}}}function ue(e){try{return process.kill(e,0),!0}catch{return!1}}function W(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=te("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function $e(e){let t=M(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return de(t.id,r,async()=>{let n=L(t.id).find(p=>p.provider===r&&p.status!=="ended"&&E(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`rnx agent end <sessionId>\`.`);let o=r==="claude"?re():void 0,s=C({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),c=J(s.id),d=H(s.id),a=se(s.id);W(c),W(d);let g=u.dirname(a);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:Y}=oe(),x=[...Y,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",c,"--events-out",d,"--transcript",a];e.codexBin&&x.push("--codex-bin",e.codexBin),e.claudeBin&&x.push("--claude-bin",e.claudeBin),e.freshThread&&x.push("--fresh-thread"),o&&x.push("--claude-session-uuid",o);let P=ee(A,x,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});P.unref();let D=e.readyTimeoutMs??6e3,j=await le(d,p=>p.type==="ready"||p.type==="error",D);if(!j||j.type==="error"){if(P.pid)try{process.kill(P.pid,"SIGTERM")}catch{}try{i.rmSync(b(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=j&&j.type==="error"?j.message:`no ready event within ${D}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:P.pid,status:"idle"}),{session:k(s.id),wrapperPid:P.pid}})}async function _e(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!E(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=J(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,m.O_WRONLY);try{let s=N(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
5
5
  `)}finally{i.closeSync(o)}v(e,{lastPrompt:t.displayText??t.text,status:"working"})}async function Be(e){let t=k(e);if(!t)throw new l("NO_SESSION",`no session with id=${e}`);if(E(t.wrapperPid,e))try{process.kill(t.wrapperPid,"SIGTERM")}catch{}let r=b(e),n=y();if(r.startsWith(n))try{i.rmSync(r,{recursive:!0,force:!0})}catch{}v(e,{status:"ended",wrapperPid:void 0})}function Ue(e,t){let r=H(e);if(!i.existsSync(r))throw new l("NO_FIFO",`events FIFO missing: ${r}`);let n=i.openSync(r,m.O_RDWR),o=i.createReadStream("",{fd:n,autoClose:!0}),s=ne.createInterface({input:o,crlfDelay:1/0});s.on("line",d=>{let a=O(d);a&&t(a)});let c=!1;return()=>{if(!c){c=!0;try{i.writeSync(n,`
6
6
  `)}catch{}try{s.close()}catch{}try{o.destroy()}catch{}}}}async function le(e,t,r){let n=i.openSync(e,m.O_RDWR|m.O_NONBLOCK),o=Buffer.alloc(8192),s="",c=Date.now()+r;try{for(;Date.now()<c;){let d=0;try{d=i.readSync(n,o,0,o.length,null)}catch(a){if(a.code!=="EAGAIN")throw a;d=0}if(d>0){s+=o.subarray(0,d).toString("utf8");let a;for(;(a=s.indexOf(`
7
7
  `))>=0;){let g=s.slice(0,a);s=s.slice(a+1);let A=O(g);if(A&&t(A))return A}}else await new Promise(a=>setTimeout(a,30))}return null}finally{i.closeSync(n)}}export{O as a,y as b,Se as c,M as d,we as e,ve as f,Ae as g,xe as h,k as i,L as j,z as k,Z as l,Pe as m,b as n,J as o,H as p,se as q,E as r,oe as s,l as t,$e as u,_e as v,Be as w,Ue as x};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.368 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.370 | (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 r,c as g,d as f,e as v}from"./chunk-NPSPWMBO.js";import"./chunk-HKQXGCQT.js";import"./chunk-3S2J6IVC.js";import"./chunk-E6XYIIJK.js";import"./chunk-WVVAYLWZ.js";import"./chunk-Q65KH25G.js";var $={"browser-cache":"browser caches","camera-fixture":"staged camera fixture videos",recording:"recordings and captured frames","runtime-archive":"downloaded runtime archives","runtime-version":"inactive runtime versions"};function y(s){let i=new Map;for(let o of s){let n=i.get(o.kind)??{bytes:0,count:0};n.bytes+=o.bytes,n.count++,i.set(o.kind,n)}return[...i].sort((o,n)=>n[1].bytes-o[1].bytes).map(([o,n])=>` ${$[o]}: ${r(n.bytes)} (${n.count} ${n.count===1?"item":"items"})`)}function h(){console.log(`
4
+ import{b as r,c as g,d as f,e as v}from"./chunk-GJRLPJQL.js";import"./chunk-FA75F34Z.js";import"./chunk-DHYTRCIP.js";import"./chunk-U63T6LIQ.js";import"./chunk-64JAEJ6N.js";import"./chunk-I52NT6VG.js";var $={"browser-cache":"browser caches","camera-fixture":"staged camera fixture videos",recording:"recordings and captured frames","runtime-archive":"downloaded runtime archives","runtime-version":"inactive runtime versions"};function y(s){let i=new Map;for(let o of s){let n=i.get(o.kind)??{bytes:0,count:0};n.bytes+=o.bytes,n.count++,i.set(o.kind,n)}return[...i].sort((o,n)=>n[1].bytes-o[1].bytes).map(([o,n])=>` ${$[o]}: ${r(n.bytes)} (${n.count} ${n.count===1?"item":"items"})`)}function h(){console.log(`
5
5
  rnx cleanup \u2014 inspect and reclaim local rnx disk usage
6
6
 
7
7
  usage:
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.370 | (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-MDCY532E.js";import"./chunk-64JAEJ6N.js";import"./chunk-I52NT6VG.js";export{a as getCliVersion};
@@ -0,0 +1,23 @@
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{d,g as m,i as w,j as y}from"./chunk-Z2VBSNFI.js";import"./chunk-I52NT6VG.js";import{existsSync as $,readFileSync as O}from"node:fs";import{dirname as E,join as V,relative as M,resolve as j}from"node:path";import{existsSync as a,readFileSync as g,readdirSync as R,statSync as C}from"fs";import{basename as N,dirname as J,join as c}from"path";var b=["ts","js","cjs","mjs","mts","cts"];function v(e){let n=e;for(;;){if(a(c(n,"turbo.json"))||a(c(n,"nx.json"))||a(c(n,"lerna.json"))||a(c(n,"pnpm-workspace.yaml")))return n;let t=c(n,"package.json");if(a(t))try{if(JSON.parse(g(t,"utf8")).workspaces)return n}catch{}let s=J(n);if(s===n)break;n=s}return e}function T(e){return a(c(e,"bun.lock"))||a(c(e,"bun.lockb"))?"bun":a(c(e,"pnpm-lock.yaml"))?"pnpm":a(c(e,"yarn.lock"))?"yarn":"npm"}function F(e){if(a(c(e,"turbo.json")))return"turbo";if(a(c(e,"nx.json")))return"nx";if(a(c(e,"pnpm-workspace.yaml")))return"pnpm";let n=c(e,"package.json");if(a(n))try{if(JSON.parse(g(n,"utf8")).workspaces)return"npm-workspaces"}catch{}return"single"}function W(e){return e.one?"one":e.expo?"expo":e["react-native"]?"bare":"unknown"}function h(e){let n=c(e,"package.json");if(!a(n))return null;let t;try{t=JSON.parse(g(n,"utf8"))}catch{return null}let s={...t.dependencies,...t.devDependencies},r=W(s);return r==="unknown"?null:{dir:e,name:t.name||N(e),framework:r,hasViteConfig:b.some(o=>a(c(e,`vite.config.${o}`))),hasMetroConfig:b.some(o=>a(c(e,`metro.config.${o}`))),devCommand:t.scripts?.dev||null}}function A(e){let n=[],t=c(e,"pnpm-workspace.yaml");if(a(t)){let o=g(t,"utf8").match(/packages:\s*\n((?:\s+-\s+.+\n?)+)/);if(o){let i=o[1].split(`
5
+ `).filter(Boolean);for(let f of i){let p=f.replace(/^\s*-\s*['"]?/,"").replace(/['"]?\s*$/,"");p&&n.push(...P(e,p))}}return n}let s=c(e,"package.json");if(a(s))try{let r=JSON.parse(g(s,"utf8")),o=Array.isArray(r.workspaces)?r.workspaces:r.workspaces?.packages||[];for(let i of o)n.push(...P(e,i))}catch{}return n}function P(e,n){let t=n.replace(/\/\*\*?$/,"").replace(/\*$/,""),s=c(e,t);if(!a(s))return[];try{return R(s).map(o=>c(s,o)).filter(o=>{try{return C(o).isDirectory()&&a(c(o,"package.json"))}catch{return!1}})}catch{return[]}}function S(e){let n=F(e),t=T(e);if(n==="single"){let i=h(e);return{root:e,type:n,packageManager:t,apps:i?[i]:[]}}let s=A(e),r=[],o=h(e);o&&r.push(o);for(let i of s){if(i===e)continue;let f=h(i);f&&r.push(f)}return{root:e,type:n,packageManager:t,apps:r}}async function z(e){if(e.includes("--help")||e.includes("-h")){console.log(`
6
+ rnx compat \u2014 check package compatibility
7
+
8
+ usage:
9
+ rnx compat [package-name]
10
+ rnx compat --json
11
+ rnx compat --brief
12
+
13
+ flags:
14
+ --json machine-readable output
15
+ --brief one-line summary
16
+ --app <dir> target directory (default: cwd)
17
+ `);return}let n=e.indexOf("--app"),t=n>=0&&e[n+1]?j(e[n+1]):process.cwd(),s=e.find((p,l)=>!p.startsWith("-")&&(n<0||l!==n+1)),r=D(t);if(!r){console.error(` no package.json found in ${t}`),process.exitCode=1;return}if(s){k(e,_(t,r,s));return}let o=d(x(t,r));if(o.packages.length>0||n>=0){k(e,o);return}let i=v(t),f=S(i).apps.flatMap(p=>{if(j(p.dir)===t)return[];let l=D(p.dir);if(!l)return[];let u=d(x(p.dir,l));return u.packages.length>0?[{dir:p.dir,result:u}]:[]});if(f.length===1){let p=f[0];console.log(`
18
+ scanning ${M(t,p.dir)||"."}`),k(e,p.result);return}if(f.length>1){console.log(`
19
+ this workspace has more than one app. scan one with --app:`);for(let p of f)console.log(` rnx compat --app ${M(t,p.dir)}`);console.log();return}k(e,o)}function k(e,n){if(e.includes("--json")){console.log(JSON.stringify(n,null,2));return}if(e.includes("--brief")){console.log(` ${m(n)}`),console.log(` ${y}`);return}console.log(`
20
+ rnx compatibility report`),console.log(` ${m(n)}
21
+ `);for(let r of w(n))console.log(` ${r}`);let t=n.packages.filter(r=>r.status==="full").length;t>0&&console.log(` supported: ${t} packages`);let s=n.packages.filter(r=>r.status==="not-relevant").length;s>0&&console.log(` not relevant at runtime: ${s} packages`),n.packages.length===0&&console.log(" no React Native ecosystem packages detected"),console.log(`
22
+ ${y}
23
+ `)}function x(e,n){let t=(r,o)=>{let i=e;for(;;){let f=V(i,"node_modules",r,"package.json");if($(f)){try{let l=JSON.parse(O(f,"utf8"));if(l&&typeof l=="object"&&"version"in l){let u=l.version;if(typeof u=="string")return u}}catch{}return o}let p=E(i);if(p===i)return o;i=p}},s=r=>r&&Object.fromEntries(Object.entries(r).map(([o,i])=>[o,t(o,i)]));return{name:n.name,dependencies:s(n.dependencies),devDependencies:s(n.devDependencies)}}function D(e){let n=j(e,"package.json");if(!$(n))return null;let t=JSON.parse(O(n,"utf8"));return t&&typeof t=="object"?t:null}function _(e,n,t){let s=x(e,n),r=s.dependencies?.[t]??s.devDependencies?.[t]??"*";return d({dependencies:{[t]:r}})}export{z as runCompat};
@@ -0,0 +1,13 @@
1
+ /*! rnx v0.1.370 | (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 r}from"./chunk-AVJBT5LF.js";import{F as i,G as s,z as t}from"./chunk-U63T6LIQ.js";import"./chunk-I52NT6VG.js";function f(){let e=i(),n=e.configured&&e.productAnalytics;console.log(` bounded diagnostics are ${n?"ON":"OFF"}`),console.log(" permitted fields: package name/version/unsupported API or error class"),console.log(` config: ${t()}`);let o=process.env.DO_NOT_TRACK;(o==="1"||o==="true")&&console.log(` note: DO_NOT_TRACK=${o} is set \u2014 telemetry is off for this run`)}async function c(e){let n=e.find(o=>!o.startsWith("-"))?.toLowerCase();switch(n){case void 0:case"status":f();return;case"on":s({productAnalytics:!0,crashReports:!1}),console.log(" bounded diagnostics ON"),console.log(` config: ${t()}`);return;case"off":s({productAnalytics:!1,crashReports:!1}),console.log(" bounded diagnostics OFF"),console.log(` config: ${t()}`);return;default:console.error(` unknown telemetry action: ${n}`),console.error(" usage: rnx config telemetry [on|off|status]"),r(1)}}function l(){console.log(`
5
+ rnx config \u2014 manage local CLI preferences
6
+
7
+ usage:
8
+ rnx config telemetry [on|off|status]
9
+
10
+ environment:
11
+ SOOTSIM_HINTS=off suppress CLI hints
12
+ SOOTSIM_HINTS=always show every CLI hint every time
13
+ `)}async function p(e){if(e.includes("--help")||e.includes("-h")){l();return}let n=e.find(o=>!o.startsWith("-"));if(n==="telemetry"){let o=e.indexOf(n);await c([...e.slice(0,o),...e.slice(o+1)]);return}console.error(` unknown config command: ${n??"(missing)"}`),l(),r(1)}export{p as runConfig};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.368 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.370 | (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 s,i as p}from"./chunk-UBH2BWCY.js";import"./chunk-TE645QCO.js";import"./chunk-NGWUGNPV.js";import"./chunk-3XMEIZEV.js";import"./chunk-M7COA4BE.js";import{g as f,n as a,u as d}from"./chunk-T2MGLXY5.js";import"./chunk-LPAOOJIW.js";import"./chunk-E6XYIIJK.js";import"./chunk-Q65KH25G.js";function g(c,i,o){let e=c.filter(n=>n.readyState==="open");if(i){let n=e.find(r=>r.id===i);if(!n)throw new s(`no sim connected with id ${i} on bridge :${o}`+(e.length?` \u2014 connected: ${e.map(r=>r.id).join(", ")}`:" \u2014 no sims connected; open one with `rnx open <port>`"));return n}let t=f();if(t){let n=e.find(r=>r.id===t);if(n)return n}let m=e.find(n=>n.isPrimary)??e[0];if(!m)throw new s(`no sims connected on bridge :${o} \u2014 open one with \`rnx open <port>\``);return m}async function S(c={}){let i=c.port??a().bridgePort,o=c.timeoutMs??15e3,e=d(i,{commandTimeoutMs:o,cliLabel:"sdk"}),t;try{t=g(await e.listSims(),c.sim,i)}catch(n){if(e.close(),n instanceof s)throw n;let r=n instanceof Error?n.message:String(n);throw new s(`${r} \u2014 is the rnx daemon or dev shell running?`)}e.close();let m=d(i,{commandTimeoutMs:o,cliLabel:"sdk",simId:t.id,simIdSource:"flag"});return new p(m,t.id,{commandTimeoutMs:o})}export{S as connect};
4
+ import{b as s,i as p}from"./chunk-2FOGXVOK.js";import"./chunk-LUOHRBJG.js";import"./chunk-DUXHYPBP.js";import"./chunk-D2GZASRV.js";import"./chunk-AALKIAUZ.js";import{g as f,n as a,u as d}from"./chunk-EOIBLKZO.js";import"./chunk-OJZHECGH.js";import"./chunk-U63T6LIQ.js";import"./chunk-I52NT6VG.js";function g(c,i,o){let e=c.filter(n=>n.readyState==="open");if(i){let n=e.find(r=>r.id===i);if(!n)throw new s(`no sim connected with id ${i} on bridge :${o}`+(e.length?` \u2014 connected: ${e.map(r=>r.id).join(", ")}`:" \u2014 no sims connected; open one with `rnx open <port>`"));return n}let t=f();if(t){let n=e.find(r=>r.id===t);if(n)return n}let m=e.find(n=>n.isPrimary)??e[0];if(!m)throw new s(`no sims connected on bridge :${o} \u2014 open one with \`rnx open <port>\``);return m}async function S(c={}){let i=c.port??a().bridgePort,o=c.timeoutMs??15e3,e=d(i,{commandTimeoutMs:o,cliLabel:"sdk"}),t;try{t=g(await e.listSims(),c.sim,i)}catch(n){if(e.close(),n instanceof s)throw n;let r=n instanceof Error?n.message:String(n);throw new s(`${r} \u2014 is the rnx daemon or dev shell running?`)}e.close();let m=d(i,{commandTimeoutMs:o,cliLabel:"sdk",simId:t.id,simIdSource:"flag"});return new p(m,t.id,{commandTimeoutMs:o})}export{S as connect};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w}from"./chunk-OTFTMGAL.js";import"./chunk-6S5LJV2O.js";import"./chunk-3UXXYJVD.js";import"./chunk-DMHSD6YJ.js";import"./chunk-PAUEZO6F.js";import"./chunk-6A6L3VJR.js";import"./chunk-3BG6UCQY.js";import"./chunk-5BR33NAZ.js";import"./chunk-NR2V2ONN.js";import"./chunk-D2GZASRV.js";import"./chunk-AALKIAUZ.js";import"./chunk-EWSWOWXK.js";import"./chunk-PNOENVMJ.js";import"./chunk-WFQHT4QD.js";import"./chunk-EQ3OE2AV.js";import"./chunk-JZLDHPB7.js";import"./chunk-CMVRTZ5G.js";import"./chunk-EOIBLKZO.js";import"./chunk-OJZHECGH.js";import"./chunk-AVJBT5LF.js";import"./chunk-FA75F34Z.js";import"./chunk-DHYTRCIP.js";import"./chunk-IDLFVRPN.js";import"./chunk-U63T6LIQ.js";import"./chunk-64JAEJ6N.js";import"./chunk-I52NT6VG.js";export{d as applyRuntimeGenerationOrigin,h as buildOpenUrl,g as buildShellUrl,u as closeSimsBulk,b as ensureBridgeForOpen,v as planBulkCloseTargets,m as playwrightHostPidForSim,j as printConnectedSims,c as resolveBundleTarget,e as resolveDefaultShellBaseUrl,a as resolveDriverConnectWaitOptions,f as resolveShellBaseUrlForBridgePort,t as runClaimCommand,w as runCloseCommand,s as runFocusCommand,p as runLinkCommand,q as runOpenCommand,r as runUseCommand,n as signalDriverLaunchConnected,i as summarizeSimUrl,o as terminatePlaywrightHostsForSims,k as waitForSimMatch,l as waitForSimMatchOrHostExit};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a,b,c,d,e,f}from"./chunk-6GPS7U4X.js";import"./chunk-5RKRVS5A.js";import"./chunk-PIZXOXBL.js";import"./chunk-C7BA5CCM.js";import"./chunk-NJMU5BN6.js";import"./chunk-JZLDHPB7.js";import"./chunk-CMVRTZ5G.js";import"./chunk-EOIBLKZO.js";import"./chunk-OJZHECGH.js";import"./chunk-AVJBT5LF.js";import"./chunk-RRX52O37.js";import"./chunk-U63T6LIQ.js";import"./chunk-MDCY532E.js";import"./chunk-64JAEJ6N.js";import"./chunk-I52NT6VG.js";export{c as daemonInstall,b as getDaemonServiceStatus,a as runDaemon,e as teardownDaemonService,d as teardownLegacyMacDaemonArtifacts,f as teardownSootsimHome};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.368 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{f as b,m as C}from"./chunk-RRALQ4WM.js";import{I as N,J as D,K as O,L as T,M as k}from"./chunk-M7COA4BE.js";import{t as A,v as _,x as S}from"./chunk-T2MGLXY5.js";import"./chunk-LPAOOJIW.js";import"./chunk-E6XYIIJK.js";import"./chunk-Q65KH25G.js";var B=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],F="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function R(){console.log(`
4
+ import{f as b,m as I}from"./chunk-NR2V2ONN.js";import{I as O,J as T,K as C,L as R,M as A}from"./chunk-AALKIAUZ.js";import{t as S,v as N,x as D}from"./chunk-EOIBLKZO.js";import"./chunk-OJZHECGH.js";import{b as _,c as u}from"./chunk-AVJBT5LF.js";import"./chunk-U63T6LIQ.js";import"./chunk-I52NT6VG.js";var L=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],H="__sootsimShellAnimationTrace",z="__sootsimDebugAnimation";function E(){console.log(`
5
5
  rnx debug \u2014 drive __sootsimDebug from the terminal
6
6
 
7
7
  usage:
@@ -9,7 +9,7 @@ usage:
9
9
 
10
10
  subcommands:
11
11
  enable <channels> turn on one or more debug channels
12
- channels: ${B.slice(0,-1).join(", ")}
12
+ channels: ${L.slice(0,-1).join(", ")}
13
13
  or 'all' for every channel
14
14
  disable <channels> turn off one or more debug channels (or 'all')
15
15
  toggle <channel> flip a single channel
@@ -77,9 +77,9 @@ examples:
77
77
  rnx debug trace shell 120
78
78
  rnx debug trace anim on 3 240
79
79
  rnx debug trace anim 3 60
80
- `)}function I(t){return t?t.split(",").map(a=>a.trim()).filter(Boolean):[]}function i(t,a){return t===void 0?"":JSON.stringify(t,null,a?2:0)}function $(t,a=240){let d=Number.isFinite(a)&&a>0?Math.max(1,Math.round(a)):240,m=JSON.stringify(F),f=JSON.stringify(q);return t==="on"?`(() => {
80
+ `)}function B(t){return t?t.split(",").map(a=>a.trim()).filter(Boolean):[]}function i(t,a){return t===void 0?"":JSON.stringify(t,null,a?2:0)}function x(t,a=240){let d=Number.isFinite(a)&&a>0?Math.max(1,Math.round(a)):240,g=JSON.stringify(H),p=JSON.stringify(z);return t==="on"?`(() => {
81
81
  const root = window
82
- const store = root[${m}] || (root[${m}] = {
82
+ const store = root[${g}] || (root[${g}] = {
83
83
  enabled: false,
84
84
  limit: ${d},
85
85
  seq: 0,
@@ -89,13 +89,13 @@ examples:
89
89
  })
90
90
  store.limit = ${d}
91
91
  store.enabled = true
92
- const currentHook = root[${f}]
92
+ const currentHook = root[${p}]
93
93
  if (store.hook !== currentHook) {
94
94
  store.prevHook = typeof currentHook === 'function' ? currentHook : undefined
95
95
  }
96
96
  if (typeof store.hook !== 'function') {
97
97
  store.hook = (sample) => {
98
- const target = root[${m}]
98
+ const target = root[${g}]
99
99
  if (!target || target.enabled !== true) return
100
100
  const samples = Array.isArray(target.samples) ? target.samples : (target.samples = [])
101
101
  target.seq = typeof target.seq === 'number' ? target.seq + 1 : 1
@@ -110,7 +110,7 @@ examples:
110
110
  }
111
111
  }
112
112
  }
113
- root[${f}] = store.hook
113
+ root[${p}] = store.hook
114
114
  return {
115
115
  enabled: true,
116
116
  limit: store.limit,
@@ -118,11 +118,11 @@ examples:
118
118
  }
119
119
  })()`:t==="off"?`(() => {
120
120
  const root = window
121
- const store = root[${m}]
121
+ const store = root[${g}]
122
122
  if (!store) return { enabled: false, limit: 0, count: 0 }
123
123
  store.enabled = false
124
- if (root[${f}] === store.hook) {
125
- root[${f}] = typeof store.prevHook === 'function' ? store.prevHook : undefined
124
+ if (root[${p}] === store.hook) {
125
+ root[${p}] = typeof store.prevHook === 'function' ? store.prevHook : undefined
126
126
  }
127
127
  return {
128
128
  enabled: false,
@@ -130,7 +130,7 @@ examples:
130
130
  count: Array.isArray(store.samples) ? store.samples.length : 0,
131
131
  }
132
132
  })()`:t==="clear"?`(() => {
133
- const store = window[${m}]
133
+ const store = window[${g}]
134
134
  if (!store) return { cleared: true, count: 0 }
135
135
  store.samples = []
136
136
  store.seq = 0
@@ -141,14 +141,14 @@ examples:
141
141
  count: 0,
142
142
  }
143
143
  })()`:`(() => {
144
- const store = window[${m}]
144
+ const store = window[${g}]
145
145
  return {
146
146
  enabled: !!store?.enabled,
147
147
  limit: typeof store?.limit === 'number' ? store.limit : 0,
148
148
  count: Array.isArray(store?.samples) ? store.samples.length : 0,
149
149
  }
150
- })()`}function P(t=50){let a=Number.isFinite(t)&&t>0?Math.max(1,Math.round(t)):50;return`(() => {
151
- const store = window[${JSON.stringify(F)}]
150
+ })()`}function J(t=50){let a=Number.isFinite(t)&&t>0?Math.max(1,Math.round(t)):50;return`(() => {
151
+ const store = window[${JSON.stringify(H)}]
152
152
  const all = Array.isArray(store?.samples) ? store.samples : []
153
153
  const samples = all.slice(-${a})
154
154
  const first = samples[0] ?? null
@@ -181,9 +181,9 @@ examples:
181
181
  } : null,
182
182
  samples,
183
183
  }
184
- })()`}async function u(t,a){return S(t,a)}function z(t,a){let d=t.indexOf(a);if(d<0)return null;let m=Number(t[d+1]);return Number.isFinite(m)?m:null}async function J(t){await u(t,"window.__sootsimCompositor.getStats(false, false, undefined, 'enable').then(() => 'enabled')"),await t.send({type:"screenshot"});let d=(await u(t,"window.__sootsimCompositor.getStats(false, false, undefined, 'disable').then((s) => ({ imageAudit: s.imageAudit }))"))?.imageAudit;if(!d)throw new Error("compositor returned no image audit");return d}function E(t){return t===null?" - ":t.toFixed(3).padStart(6)}function V(t){let a=t.sourceUri??t.testID??`node ${t.nodeId}`;return a.length<=58?a:`...${a.slice(-55)}`}function W(t,a,d){let f=t.rows.filter(c=>c.shortfall!==null).filter(c=>c.shortfall<d);if(console.log(` ${t.rows.length} images drawn (${t.draws} draws), ${f.length} below ${d} of what their source could deliver`),console.log(` sampling: mipmapped ${t.samplingCounts.mipmapped} \xB7 cubic ${t.samplingCounts.cubic} \xB7 repeat ${t.samplingCounts.repeat} \xB7 none ${t.samplingCounts.none}`),a.length===0){console.log(" every image delivered its source resolution");return}console.log(""),console.log(" short eff decoded source needed(dev) dest(pt) dpr image");for(let c of a){let x=`${c.decoded.width}x${c.decoded.height}`.padEnd(11),r=(c.vector?"vector":c.intrinsic?`${c.intrinsic.width}x${c.intrinsic.height}`:"?").padEnd(11),w=`${Math.round(c.needed.width)}x${Math.round(c.needed.height)}`.padEnd(12),y=`${Math.round(c.destination.width)}x${Math.round(c.destination.height)}`.padEnd(9);console.log(` ${E(c.shortfall)} ${E(c.effective.width)} ${x} ${r} ${w} ${y} ${c.dpr.toFixed(1)} ${V(c)}`)}}async function X(t,a){let d=A(t,{port:a.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),m=d.positional;(!m[0]||t.includes("--help")||t.includes("-h"))&&(R(),process.exit(0));let c=d.wsPort,x=d.simId,r=!t.includes("--json"),w=x?` --sim ${x}`:"",y=m[0],l=m.slice(1);if(new Set(["state","js","perf","memory","sample-color"]).has(y)){let{runInspect:e}=await import("./inspect-S3LR3R2A.js");await e(["debug",...t],{port:a.port,verbose:a.verbose});return}let o=_(d);try{switch(y){case"enable":{let e=I(l[0]);e.length===0&&(console.error(` usage: rnx debug enable <channel[,channel,...]>
185
- known: ${B.join(", ")}`),process.exit(1));let s=await k(o,"enable",e);console.log(i({active:s},r));break}case"disable":{let e=I(l[0]),s=await k(o,"disable",e);console.log(i({active:s},r));break}case"toggle":{let e=l[0];e||(console.error(" usage: rnx debug toggle <channel>"),process.exit(1));let s=await u(o,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(i({[e]:s},r));break}case"status":{let e=await N(o);console.log(i(e,r));break}case"channels":{let e=await u(o,"window.__sootsimDebug.channels()");console.log(i(e,r));break}case"flags":{let e=await D(o);console.log(i(e,r));break}case"snapshot":{let e=l[0],s=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",n=await u(o,`(() => { const s = ${s}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(i(n,r));break}case"snapshots":{let e=await u(o,"window.__sootsimDebug.snapshots()");console.log(i(e,r));break}case"diff":{let e=l[0],s=l[1];(!e||!s)&&(console.error(" usage: rnx debug diff <labelA> <labelB>"),process.exit(1));let n=`(() => {
186
- const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(s)});
184
+ })()`}async function m(t,a){return D(t,a)}function V(t,a){let d=t.indexOf(a);if(d<0)return null;let g=Number(t[d+1]);return Number.isFinite(g)?g:null}async function W(t){await m(t,"window.__sootsimCompositor.getStats(false, false, undefined, 'enable').then(() => 'enabled')"),await t.send({type:"screenshot"});let d=(await m(t,"window.__sootsimCompositor.getStats(false, false, undefined, 'disable').then((s) => ({ imageAudit: s.imageAudit }))"))?.imageAudit;if(!d)throw new Error("compositor returned no image audit");return d}function F(t){return t===null?" - ":t.toFixed(3).padStart(6)}function K(t){let a=t.sourceUri??t.testID??`node ${t.nodeId}`;return a.length<=58?a:`...${a.slice(-55)}`}function G(t,a,d){let p=t.rows.filter(c=>c.shortfall!==null).filter(c=>c.shortfall<d);if(console.log(` ${t.rows.length} images drawn (${t.draws} draws), ${p.length} below ${d} of what their source could deliver`),console.log(` sampling: mipmapped ${t.samplingCounts.mipmapped} \xB7 cubic ${t.samplingCounts.cubic} \xB7 repeat ${t.samplingCounts.repeat} \xB7 none ${t.samplingCounts.none}`),a.length===0){console.log(" every image delivered its source resolution");return}console.log(""),console.log(" short eff decoded source needed(dev) dest(pt) dpr image");for(let c of a){let $=`${c.decoded.width}x${c.decoded.height}`.padEnd(11),r=(c.vector?"vector":c.intrinsic?`${c.intrinsic.width}x${c.intrinsic.height}`:"?").padEnd(11),y=`${Math.round(c.needed.width)}x${Math.round(c.needed.height)}`.padEnd(12),v=`${Math.round(c.destination.width)}x${Math.round(c.destination.height)}`.padEnd(9);console.log(` ${F(c.shortfall)} ${F(c.effective.width)} ${$} ${r} ${y} ${v} ${c.dpr.toFixed(1)} ${K(c)}`)}}async function ne(t,a){let d=S(t,{port:a.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),g=d.positional;(!g[0]||t.includes("--help")||t.includes("-h"))&&(E(),u(0));let c=d.wsPort,$=d.simId,r=!t.includes("--json"),y=$?` --sim ${$}`:"",v=g[0],l=g.slice(1);if(new Set(["state","js","perf","memory","sample-color"]).has(v)){let{runInspect:e}=await import("./inspect-RQCTWDCC.js");await e(["debug",...t],{port:a.port,verbose:a.verbose});return}let o=N(d);try{switch(v){case"enable":{let e=B(l[0]);e.length===0&&(console.error(` usage: rnx debug enable <channel[,channel,...]>
185
+ known: ${L.join(", ")}`),u(1));let n=await A(o,"enable",e);console.log(i({active:n},r));break}case"disable":{let e=B(l[0]),n=await A(o,"disable",e);console.log(i({active:n},r));break}case"toggle":{let e=l[0];e||(console.error(" usage: rnx debug toggle <channel>"),u(1));let n=await m(o,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(i({[e]:n},r));break}case"status":{let e=await O(o);console.log(i(e,r));break}case"channels":{let e=await m(o,"window.__sootsimDebug.channels()");console.log(i(e,r));break}case"flags":{let e=await T(o);console.log(i(e,r));break}case"snapshot":{let e=l[0],n=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",s=await m(o,`(() => { const s = ${n}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(i(s,r));break}case"snapshots":{let e=await m(o,"window.__sootsimDebug.snapshots()");console.log(i(e,r));break}case"diff":{let e=l[0],n=l[1];(!e||!n)&&(console.error(" usage: rnx debug diff <labelA> <labelB>"),u(1));let s=`(() => {
186
+ const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(n)});
187
187
  if (!d) return null;
188
188
  return {
189
189
  a: d.a,
@@ -193,8 +193,8 @@ examples:
193
193
  removed: d.removed,
194
194
  changed: d.changed,
195
195
  };
196
- })()`,g=await u(o,n);console.log(i(g,r));break}case"clear-snapshots":{let e=l[0],s=e?`window.__sootsimDebug.clearSnapshots(${JSON.stringify(e)})`:"window.__sootsimDebug.clearSnapshots()";await u(o,s),console.log(i({cleared:e||"all"},r));break}case"image-audit":{let e=z(t,"--min")??.98,s=await J(o);s.draws===0&&(console.error(` the audit recorded zero image draws, so an empty result proves nothing.
196
+ })()`,f=await m(o,s);console.log(i(f,r));break}case"clear-snapshots":{let e=l[0],n=e?`window.__sootsimDebug.clearSnapshots(${JSON.stringify(e)})`:"window.__sootsimDebug.clearSnapshots()";await m(o,n),console.log(i({cleared:e||"all"},r));break}case"image-audit":{let e=V(t,"--min")??.98,n=await W(o);n.draws===0&&(console.error(` the audit recorded zero image draws, so an empty result proves nothing.
197
197
  while it records, paint boundaries rebuild and raster blits are
198
198
  bypassed, so every image on screen should reach the draw path.
199
199
  zero draws means either nothing on screen is an image, or the audit
200
- is not attached to the surface that paints.`),process.exit(2));let n=s.rows.filter(g=>g.shortfall!==null&&g.shortfall<e);r?W(s,t.includes("--all")?s.rows:n,e):console.log(i({...s,minimum:e,under:n.length},!1)),n.length>0&&process.exit(1);break}case"find":{let e=l[0];if(e==="sheets"||e==="portals"||e==="boundaries"){let s=await O(o,e);console.log(i(s,r))}else console.error(" usage: rnx debug find <sheets|portals|boundaries>"),process.exit(1);break}case"trace":{let e=l[0],s=l[1];if(e==="anim"){let n=l[1];if((!n||n==="--help"||n==="-h")&&(console.error(" usage: rnx debug trace anim <on|off|status|clear|<id>> [id|limit]"),process.exit(1)),n==="on"){let p=l[2]??"all",h=l[3]?Number(l[3]):void 0,v=p==="all"?"all":Number(p);v!=="all"&&!Number.isFinite(v)&&(console.error(` invalid target: ${p}`),process.exit(1)),await b(o,"enableAnimationTrace",v,h);let j=await b(o,"listAnimationTraces");console.log(i({enabled:v,traces:j},r));break}if(n==="off"){let p=l[2]??"all",h=p==="all"?"all":Number(p);h!=="all"&&!Number.isFinite(h)&&(console.error(` invalid target: ${p}`),process.exit(1)),await b(o,"disableAnimationTrace",h),console.log(i({disabled:h},r));break}if(n==="status"||n==="clear"){n==="clear"&&await b(o,"disableAnimationTrace","all");let p=await b(o,"listAnimationTraces");console.log(i({traces:p},r));break}let g=Number(n);Number.isFinite(g)||(console.error(` invalid id: ${n}`),process.exit(1));let L=l[2]?Number(l[2]):void 0,H=await b(o,"getAnimationTrace",g,L);console.log(i({id:g,samples:H},r));break}if(e!=="shell"&&(console.error(" usage: rnx debug trace <shell|anim> [args]"),process.exit(1)),!s||/^[0-9]+$/.test(s)){let n=s?Number(s):50,g=await u(o,P(n));console.log(i(g,r));break}if(s==="on"){let n=l[2]?Number(l[2]):240,g=await u(o,$("on",n));console.log(i(g,r));break}if(s==="off"){let n=await u(o,$("off"));console.log(i(n,r));break}if(s==="clear"){let n=await u(o,$("clear"));console.log(i(n,r));break}if(s==="status"){let n=await u(o,$("status"));console.log(i(n,r));break}console.error(" usage: rnx debug trace shell [on [limit]|off|status|clear|recentLimit]"),process.exit(1)}case"record":{let e=l[0],n=await u(o,`window.__sootsimDebug.record(${e==="on"?"true":e==="off"?"false":"undefined"})`);console.log(i({recording:n},r));break}case"recent":{let e=l[0],s=l[1]?Number(l[1]):50,n=await T(o,e,s);console.log(i(n,r));break}case"clear-events":{await u(o,"window.__sootsimDebug.clearEvents()"),console.log(i({cleared:!0},r));break}default:console.error(` unknown subcommand: ${y}`),R(),process.exit(1)}}catch(e){console.error(` debug failed: ${e.message}`),await C(o,{errorsCommand:`rnx get errors 5${w}`,warningsCommand:`rnx get warnings 5${w}`,requestsCommand:`rnx get requests 5${w}`}),process.exit(1)}finally{o.close()}}export{X as runDebug};
200
+ is not attached to the surface that paints.`),u(2));let s=n.rows.filter(f=>f.shortfall!==null&&f.shortfall<e);r?G(n,t.includes("--all")?n.rows:s,e):console.log(i({...n,minimum:e,under:s.length},!1)),s.length>0&&u(1);break}case"find":{let e=l[0];if(e==="sheets"||e==="portals"||e==="boundaries"){let n=await C(o,e);console.log(i(n,r))}else console.error(" usage: rnx debug find <sheets|portals|boundaries>"),u(1);break}case"trace":{let e=l[0],n=l[1];if(e==="anim"){let s=l[1];if((!s||s==="--help"||s==="-h")&&(console.error(" usage: rnx debug trace anim <on|off|status|clear|<id>> [id|limit]"),u(1)),s==="on"){let h=l[2]??"all",w=l[3]?Number(l[3]):void 0,k=h==="all"?"all":Number(h);k!=="all"&&!Number.isFinite(k)&&(console.error(` invalid target: ${h}`),u(1)),await b(o,"enableAnimationTrace",k,w);let q=await b(o,"listAnimationTraces");console.log(i({enabled:k,traces:q},r));break}if(s==="off"){let h=l[2]??"all",w=h==="all"?"all":Number(h);w!=="all"&&!Number.isFinite(w)&&(console.error(` invalid target: ${h}`),u(1)),await b(o,"disableAnimationTrace",w),console.log(i({disabled:w},r));break}if(s==="status"||s==="clear"){s==="clear"&&await b(o,"disableAnimationTrace","all");let h=await b(o,"listAnimationTraces");console.log(i({traces:h},r));break}let f=Number(s);Number.isFinite(f)||(console.error(` invalid id: ${s}`),u(1));let j=l[2]?Number(l[2]):void 0,M=await b(o,"getAnimationTrace",f,j);console.log(i({id:f,samples:M},r));break}if(e!=="shell"&&(console.error(" usage: rnx debug trace <shell|anim> [args]"),u(1)),!n||/^[0-9]+$/.test(n)){let s=n?Number(n):50,f=await m(o,J(s));console.log(i(f,r));break}if(n==="on"){let s=l[2]?Number(l[2]):240,f=await m(o,x("on",s));console.log(i(f,r));break}if(n==="off"){let s=await m(o,x("off"));console.log(i(s,r));break}if(n==="clear"){let s=await m(o,x("clear"));console.log(i(s,r));break}if(n==="status"){let s=await m(o,x("status"));console.log(i(s,r));break}console.error(" usage: rnx debug trace shell [on [limit]|off|status|clear|recentLimit]"),u(1)}case"record":{let e=l[0],s=await m(o,`window.__sootsimDebug.record(${e==="on"?"true":e==="off"?"false":"undefined"})`);console.log(i({recording:s},r));break}case"recent":{let e=l[0],n=l[1]?Number(l[1]):50,s=await R(o,e,n);console.log(i(s,r));break}case"clear-events":{await m(o,"window.__sootsimDebug.clearEvents()"),console.log(i({cleared:!0},r));break}default:console.error(` unknown subcommand: ${v}`),E(),u(1)}}catch(e){_(e),console.error(` debug failed: ${e.message}`),await I(o,{errorsCommand:`rnx get errors 5${y}`,warningsCommand:`rnx get warnings 5${y}`,requestsCommand:`rnx get requests 5${y}`}),u(1)}finally{o.close()}}export{ne as runDebug};
@@ -0,0 +1,31 @@
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import"./chunk-VVQCZ42C.js";import{a as m}from"./chunk-UFVAAWGZ.js";import{a as f}from"./chunk-D24EOJ4C.js";import{g as d}from"./chunk-OTFTMGAL.js";import"./chunk-6S5LJV2O.js";import"./chunk-3UXXYJVD.js";import{a as u}from"./chunk-DMHSD6YJ.js";import{c as a}from"./chunk-PAUEZO6F.js";import"./chunk-6A6L3VJR.js";import"./chunk-3BG6UCQY.js";import{a as l}from"./chunk-5BR33NAZ.js";import"./chunk-NR2V2ONN.js";import"./chunk-D2GZASRV.js";import"./chunk-AALKIAUZ.js";import"./chunk-EWSWOWXK.js";import"./chunk-PNOENVMJ.js";import"./chunk-WFQHT4QD.js";import"./chunk-EQ3OE2AV.js";import"./chunk-JZLDHPB7.js";import"./chunk-CMVRTZ5G.js";import"./chunk-EOIBLKZO.js";import"./chunk-OJZHECGH.js";import{c as r}from"./chunk-AVJBT5LF.js";import"./chunk-FA75F34Z.js";import"./chunk-DHYTRCIP.js";import{i as c}from"./chunk-GRO74J2X.js";import"./chunk-IDLFVRPN.js";import"./chunk-U63T6LIQ.js";import"./chunk-64JAEJ6N.js";import"./chunk-I52NT6VG.js";function v(e){let t=e.indexOf("--port");if(t<0)return;let n=e[t+1],o=n?Number(n):Number.NaN;return(!Number.isInteger(o)||o<=0)&&(console.error(` invalid --port value: ${n||"(missing)"}`),r(1)),o}async function w(e,t){let n=v(e)??t.port;return n?d(String(n)):void 0}async function h(e,t){(e.includes("--help")||e.includes("-h"))&&(console.log(`
5
+ rnx desktop \u2014 launch the desktop companion
6
+
7
+ usage:
8
+ rnx desktop [options]
9
+
10
+ options:
11
+ --port <number> connect to running dev server on this port
12
+ --profile <id> launch with an isolated persistent storage profile
13
+ --ephemeral launch with a temporary isolated storage profile
14
+
15
+ examples:
16
+ rnx desktop
17
+ rnx desktop --port 5173
18
+ rnx desktop --profile qa
19
+ `),r(0));let n=e.find((k,p)=>e[p-1]==="--profile"),o=e.includes("--ephemeral");n&&o&&(console.error(" rnx desktop: --profile cannot be combined with --ephemeral"),r(1));let x=n?a(n).id:void 0,i=l();if(!i){if(m(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await c("run rnx desktop install now?",!0)){console.log();let{runInstallDesktop:p}=await import("./install-desktop-GOWXCQUE.js");await p(["--yes"]),i=l()}i||r(1)}console.log(` launching ${i.path}`);let g=await w(e,t),s=await u.launch({url:g,device:t.device,profileId:x,ephemeralProfile:o});s.launched||(console.error(` ${s.message}`),r(1)),console.log(` ${s.message}`)}function b(){console.log(`
20
+ rnx desktop \u2014 launch or install the desktop companion
21
+
22
+ usage:
23
+ rnx desktop [options]
24
+ rnx desktop install [options]
25
+
26
+ options:
27
+ --port <number> connect to a running dev server on this port
28
+ --profile <id> launch with an isolated persistent storage profile
29
+ --ephemeral launch with a temporary isolated storage profile
30
+ -y, --yes install without prompting
31
+ `)}async function C(e,t){if(e.includes("--help")||e.includes("-h")){b();return}let n=e.find(o=>!o.startsWith("-"));if(n==="install"){let o=e.indexOf(n);await f([...e.slice(0,o),...e.slice(o+1)]);return}await h(e,t)}export{C as runDesktop};
@@ -0,0 +1,52 @@
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{f as U}from"./chunk-ARMXC3C3.js";import"./chunk-X6WQ4YWE.js";import"./chunk-BMIJZNKD.js";import"./chunk-HEKHLQ3B.js";import"./chunk-UFVAAWGZ.js";import"./chunk-LIMWG54N.js";import"./chunk-Q4MRJ6PO.js";import{c as $,d as k,e as J}from"./chunk-H5X5FJ63.js";import{a as N}from"./chunk-NTC46LSA.js";import"./chunk-6W4HIWC7.js";import"./chunk-LUOHRBJG.js";import"./chunk-DUXHYPBP.js";import"./chunk-OTFTMGAL.js";import"./chunk-6S5LJV2O.js";import"./chunk-3UXXYJVD.js";import"./chunk-DMHSD6YJ.js";import"./chunk-PAUEZO6F.js";import"./chunk-6A6L3VJR.js";import"./chunk-3BG6UCQY.js";import"./chunk-5BR33NAZ.js";import"./chunk-NR2V2ONN.js";import"./chunk-D2GZASRV.js";import"./chunk-AALKIAUZ.js";import"./chunk-EWSWOWXK.js";import"./chunk-PNOENVMJ.js";import"./chunk-WFQHT4QD.js";import"./chunk-EQ3OE2AV.js";import"./chunk-C7BA5CCM.js";import"./chunk-JZLDHPB7.js";import"./chunk-CMVRTZ5G.js";import"./chunk-EOIBLKZO.js";import"./chunk-OJZHECGH.js";import"./chunk-YIZGNT7A.js";import{c as f}from"./chunk-AVJBT5LF.js";import"./chunk-LXPHL6FO.js";import"./chunk-RRX52O37.js";import"./chunk-FA75F34Z.js";import"./chunk-DHYTRCIP.js";import"./chunk-IDLFVRPN.js";import"./chunk-U63T6LIQ.js";import{a as E}from"./chunk-64JAEJ6N.js";import"./chunk-I52NT6VG.js";import{spawn as H}from"child_process";import{existsSync as T,mkdirSync as V,readFileSync as z,writeFileSync as I,unlinkSync as C}from"fs";import{createRequire as K}from"module";import{tmpdir as A}from"os";import{dirname as Q,resolve as a,join as y,relative as X}from"path";function Y(){try{let t=import.meta.resolve(`${E.packageName}/detox`);return Q(t.startsWith("file://")?t.slice(7):t)}catch{return a(import.meta.dirname,"..","..","detox")}}var Z=`
5
+ rnx detox \u2014 run detox-style tests against an rnx shell
6
+
7
+ usage:
8
+ rnx detox [testFiles...] run all tests under e2e/, test/e2e/, or detox/
9
+ rnx detox --config <path> use a specific jest config
10
+ rnx detox init scaffold sootsim-detox.config.cjs + sample test
11
+ rnx detox --watch jest watch mode
12
+ rnx detox --headed keep the rnx shell window visible
13
+ rnx detox -t <pattern> pass a jest --testNamePattern
14
+ rnx detox --no-launch skip auto-launching an rnx shell
15
+
16
+ rnx detox auto-launches an rnx shell if none is running on the
17
+ expected port. disable with --no-launch if you're managing the shell yourself.
18
+ `;async function xe(t,o={}){if((t.includes("--help")||t.includes("-h"))&&(console.log(Z),f(0)),t[0]==="init")return oe();let l=e=>{let s=t.indexOf(e);return s>=0?t[s+1]:void 0},n=e=>t.includes(e),u=n("--watch"),m=n("--headed"),d=n("--no-launch"),S=l("--config"),x=o.port||Number(process.env.SOOTSIM_PORT)||5173,L=t.filter((e,s)=>{if(e.startsWith("--")||e==="-t"||e==="-h")return!1;let i=t[s-1];return!(i==="--config"||i==="-t"||i==="--testNamePattern"||i==="--grep"||i==="--maxWorkers"||i==="--shard")}),W=t.flatMap((e,s)=>e==="--runInBand"||e.startsWith("--maxWorkers=")||e.startsWith("--shard=")?[e]:(e==="--maxWorkers"||e==="--shard")&&t[s+1]?[e,t[s+1]]:[]),j=["e2e","test/e2e","detox"],c=process.env.SOOTSIM_TEST_DIR?a(process.cwd(),process.env.SOOTSIM_TEST_DIR):null;if(!c)for(let e of j){let s=a(process.cwd(),e);if(T(s)){c=s;break}}c||(console.error(` error: no detox tests found. expected one of: ${j.join(", ")}
19
+ run 'rnx detox init' to scaffold a starter suite.`),f(1)),d||await se(x);let r=["jest"],h=S||te(["sootsim-detox.config.cjs","jest.config.cjs","jest.config.js"]),p=null;if(h)r.push("--config",a(process.cwd(),h));else{let e=a(Y(),"jest-preset.cjs");p=y(A(),`sootsim-detox-${process.pid}.config.cjs`);let s={rootDir:c,roots:["<rootDir>"],testMatch:["<rootDir>/**/*.test.ts","<rootDir>/**/*.test.js"]};I(p,`module.exports = { ...require(${JSON.stringify(e)}), ...${JSON.stringify(s)} }
20
+ `),r.push("--config",p)}u&&r.push("--watch");let v=l("-t")||l("--testNamePattern")||l("--grep");v&&r.push("-t",v);let b=N(),R=!u&&$({uploadedShare:!1,auth:b}),g=process.env.SOOTSIM_JEST_OUTPUT_FILE||null;process.env.SOOTSIM_JEST_JSON==="1"&&r.push("--json"),process.env.SOOTSIM_JEST_OUTPUT_FILE?r.push("--outputFile",process.env.SOOTSIM_JEST_OUTPUT_FILE):R&&(g=y(A(),`sootsim-detox-results-${process.pid}.json`),r.push("--json","--outputFile",g)),r.push(...W),r.push(...L),console.log(" rnx detox"),console.log(` test dir: ${c}`),console.log(` port: ${x}${m?" (headed)":""}`),h&&console.log(` config: ${h}`);let _=process.env.CONFORMANCE_PROOF==="1"||!!process.env.CONFORMANCE_PROOF_DIR,G=_?"node":"npx",B=_?["--no-maglev",K(y(process.cwd(),"package.json")).resolve("jest/bin/jest"),...r.slice(1)]:r,O=H(G,B,{cwd:process.cwd(),stdio:"inherit",env:{...process.env,SOOTSIM_TEST_DIR:c,SOOTSIM_PORT:String(x),SOOTSIM_HEADED:m?"1":"",SOOTSIM_URL:process.env.SOOTSIM_URL||`http://localhost:${x}`}}),F=e=>()=>{O.kill(e)},P=F("SIGTERM"),D=F("SIGINT");process.on("SIGTERM",P),process.on("SIGINT",D);let q=Date.now(),w=await new Promise((e,s)=>{O.once("error",s),O.once("exit",(i,M)=>{if(M){console.error(` error: jest terminated by ${M}`),e(1);return}e(i??1)})});if(process.off("SIGTERM",P),process.off("SIGINT",D),p)try{C(p)}catch{}if(R){let e=g?ee(g):null,s=await J(),i=await k({origin:s,kind:"detox",name:X(process.cwd(),c)||"e2e",status:w===0?"passed":"failed",summary:e?`${e.numPassedTests}/${e.numTotalTests} tests passed`:null,failureMessage:w===0?null:e?.firstFailure??null,stepCount:e?.numTotalTests??null,failedStepIndex:e?.firstFailedIndex??null,durationMs:Date.now()-q,auth:b});i&&console.log(` run: ${i.id}`)}f(w)}function ee(t){try{let o=JSON.parse(z(t,"utf8")),l=null,n=null,u=0;for(let m of o.testResults??[])for(let d of m.testResults??[]){if(n==null&&d.status==="failed"){n=u;let S=d.failureMessages?.[0]?.split(`
21
+ `)[0];l=[d.fullName,S].filter(Boolean).join(": ")||null}u+=1}return typeof o.numTotalTests!="number"?null:{numTotalTests:o.numTotalTests,numPassedTests:o.numPassedTests??0,firstFailure:l,firstFailedIndex:n}}catch{return null}finally{if(!process.env.SOOTSIM_JEST_OUTPUT_FILE)try{C(t)}catch{}}}function te(t){for(let o of t)if(T(a(process.cwd(),o)))return o;return null}async function se(t){await U()||console.warn(` warn: no rnx shell reachable on :${t}. start your app, then run \`rnx open <app-port>\`
22
+ or pass --no-launch if you're managing the shell yourself.`)}function oe(){let t=process.cwd(),o=a(t,"sootsim-detox.config.cjs");T(o)?console.log(` skip: ${o} already exists`):(I(o,`// rnx detox jest config.
23
+ // extends the sootsim preset, which rewrites \`import ... from 'detox'\`
24
+ // to the sootsim driver and keeps your jest transforms intact.
25
+
26
+ /** @type {import('@jest/types').Config.InitialOptions} */
27
+ module.exports = {
28
+ preset: 'rnxsim/detox/jest-preset',
29
+ rootDir: __dirname,
30
+ testMatch: ['<rootDir>/e2e/**/*.test.ts', '<rootDir>/e2e/**/*.test.js'],
31
+ }
32
+ `),console.log(` created ${o}`));let l=a(t,"e2e"),n=a(l,"example.test.ts");T(n)?console.log(` skip: ${n} already exists`):(V(l,{recursive:!0}),I(n,`// sample rnx detox test. resolve \`detox\` via the jest preset in
33
+ // sootsim-detox.config.cjs \u2014 no extra imports required.
34
+
35
+ import { by, device, element, expect, waitFor } from 'detox'
36
+
37
+ describe('example', () => {
38
+ beforeAll(async () => {
39
+ await device.launchApp()
40
+ })
41
+
42
+ it('shows the welcome text', async () => {
43
+ await waitFor(element(by.text('Welcome'))).toBeVisible().withTimeout(5000)
44
+ })
45
+
46
+ it('taps a button by id', async () => {
47
+ await element(by.id('start-button')).tap()
48
+ await expect(element(by.id('home-screen'))).toBeVisible()
49
+ })
50
+ })
51
+ `),console.log(` created ${n}`)),console.log(`
52
+ next:`),console.log(" rnx detox # run the sample"),console.log(" rnx detox --watch"),f(0)}export{xe as runDetox};
@@ -0,0 +1,18 @@
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import"./chunk-3UXXYJVD.js";import"./chunk-EWSWOWXK.js";import"./chunk-JZLDHPB7.js";import{b as d,d as c,e as h}from"./chunk-CMVRTZ5G.js";import{t as l,v as a,y as m}from"./chunk-EOIBLKZO.js";import"./chunk-OJZHECGH.js";import{c as s}from"./chunk-AVJBT5LF.js";import"./chunk-U63T6LIQ.js";import"./chunk-I52NT6VG.js";function v(){console.log(`
5
+ rnx device \u2014 inspect or change the live device preset for a sim
6
+
7
+ usage:
8
+ rnx device
9
+ rnx device get
10
+ rnx device set <model> [--sim <id>]
11
+ rnx device list
12
+
13
+ examples:
14
+ rnx device
15
+ rnx device set iphone-14
16
+ rnx device set iphone-16-pro-max --sim a7
17
+ `)}function u(t){let n=c(t);console.log(` ${t.padEnd(14)} ${String(n.width).padStart(4)}x${String(n.height).padEnd(4)} pt ${String(n.width*n.scale).padStart(4)}x${String(n.height*n.scale).padEnd(4)} px ${n.name}`)}async function x(t){let n=a(t);try{let o=await m(n,"SootSim.bridges.settings.get")??{deviceModel:null},i=typeof o.deviceModel=="string"?o.deviceModel:null;if(!i||!(i in d))return null;let e=c(i);return{model:i,width:e.width,height:e.height,scale:e.scale,name:e.name}}finally{n.close()}}async function b(t,n){(t.includes("--help")||t.includes("-h"))&&(v(),s(0));let o=t[0];if(!o||o==="get"){let i=l(t,{port:n.port}),e=await x(i);e||(console.error(" error: could not read current device from the target sim"),s(1)),console.log(` ${e.model} ${e.width}x${e.height} pt ${e.width*e.scale}x${e.height*e.scale} px ${e.name}`);return}if(o==="list"){console.log(` available devices:
18
+ `);for(let i of h())u(i);return}if(o==="set"){let i=t[1];i||(console.error(" error: device set expects a model"),s(1)),i in d||(console.error(` error: unknown device "${i}"`),console.error(" run `rnx device list` to see valid models"),s(1));let e=l(t,{port:n.port}),g=a(e);try{let p=await m(g,"SootSim.bridges.settings.set","deviceModel",i),r=c(i);console.log(` ${p?"set":"kept"} device: ${i} (${r.width}x${r.height} pt, ${r.width*r.scale}x${r.height*r.scale} px)${p?" \u2014 reloading sim":""}`)}finally{g.close()}return}v(),console.error(` unknown subcommand: ${o}`),s(1)}export{b as runDeviceCommand};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.368 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{e as v,t as E,v as x,y as b}from"./chunk-T2MGLXY5.js";import"./chunk-LPAOOJIW.js";import"./chunk-E6XYIIJK.js";import"./chunk-Q65KH25G.js";function j(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(r=>typeof r=="string"?r:JSON.stringify(r)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
4
+ import{e as v,t as E,v as x,y as b}from"./chunk-EOIBLKZO.js";import"./chunk-OJZHECGH.js";import"./chunk-U63T6LIQ.js";import"./chunk-I52NT6VG.js";function j(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(r=>typeof r=="string"?r:JSON.stringify(r)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
5
5
  rnx get diagnosis \u2014 compact "what just went wrong?" report
6
6
 
7
7
  usage:
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.368 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a,b,c,d,e}from"./chunk-NPSPWMBO.js";import"./chunk-HKQXGCQT.js";import"./chunk-3S2J6IVC.js";import"./chunk-E6XYIIJK.js";import"./chunk-WVVAYLWZ.js";import"./chunk-Q65KH25G.js";export{e as applyAutomaticSootsimCleanup,d as applySootsimCleanup,b as formatSootsimBytes,a as isAutomaticSootsimCleanupComplete,c as planSootsimCleanup};
4
+ import{a,b,c,d,e}from"./chunk-GJRLPJQL.js";import"./chunk-FA75F34Z.js";import"./chunk-DHYTRCIP.js";import"./chunk-U63T6LIQ.js";import"./chunk-64JAEJ6N.js";import"./chunk-I52NT6VG.js";export{e as applyAutomaticSootsimCleanup,d as applySootsimCleanup,b as formatSootsimBytes,a as isAutomaticSootsimCleanupComplete,c as planSootsimCleanup};
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.368 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import"./chunk-Q65KH25G.js";var p=class extends Error{constructor(s){super(s),this.name="BridgeInputError"}};var k=new Set(["tap","tap-id","tap-text","double-tap","long-press","type","type-into","key","key-sequence","dismiss","scroll","drag","swipe","pinch","touch","sleep"]);function O(a){return a.includes("--then")}function o(a,s){throw new p(`do chain action ${a+1} has invalid arguments; usage: rnx do ${s}`)}function r(a,s,l){let n=Number(a);return(a===void 0||!Number.isFinite(n))&&o(s,l),n}function D(a){let s=[[]];for(let l of a){if(l!=="--then"){s[s.length-1].push(l);continue}if(s[s.length-1].length===0)throw new p("do chain contains an empty action");s.push([])}if(s.length<2)throw new p("do chain needs at least two actions separated by --then");if(s[s.length-1].length===0)throw new p("do chain cannot end with --then");return s.flatMap((l,n)=>{let[d,...t]=l;if(!d)throw new p("do chain contains an empty action");if(!k.has(d))throw new p(`do chain action ${n+1} cannot batch ${JSON.stringify(d)}; run it as a separate rnx do command`);switch(d){case"tap":return t.length===1&&!Number.isFinite(Number(t[0]))?[{type:"tapId",id:t[0]}]:(t.length!==2&&o(n,"tap <testid> | <x> <y>"),[{type:"tap",x:r(t[0],n,"tap <testid> | <x> <y>"),y:r(t[1],n,"tap <testid> | <x> <y>")}]);case"tap-id":return t.length!==1&&o(n,"tap-id <id>"),[{type:"tapId",id:t[0]}];case"tap-text":{let e=t.join(" ");return e||o(n,"tap-text <text>"),[{type:"tapText",text:e}]}case"double-tap":{let e="double-tap <testid> [gapMs] | <x> <y> [gapMs]";return t.length>0&&!Number.isFinite(Number(t[0]))?(t.length>2&&o(n,e),[{type:"targetedDoubleTap",id:t[0],gapMs:t.length===2?Math.max(0,Math.round(r(t[1],n,e))):80}]):((t.length<2||t.length>3)&&o(n,e),[{type:"doubleTap",x:r(t[0],n,e),y:r(t[1],n,e),gapMs:t.length===3?Math.max(0,Math.round(r(t[2],n,e))):80}])}case"long-press":{let e="long-press <testid> [durationMs] | <x> <y> [durationMs]";return t.length>0&&!Number.isFinite(Number(t[0]))?(t.length>2&&o(n,e),[{type:"targetedLongPress",id:t[0],durationMs:t.length===2?Math.max(0,Math.round(r(t[1],n,e))):600}]):((t.length<2||t.length>3)&&o(n,e),[{type:"longPress",x:r(t[0],n,e),y:r(t[1],n,e),durationMs:t.length===3?Math.max(0,Math.round(r(t[2],n,e))):600}])}case"type":{let e=t.join(" ");return e||o(n,"type <text>"),[{type:"type",text:e}]}case"type-into":{let e=t.slice(1).join(" ");return(!t[0]||!e)&&o(n,"type-into <id> <text>"),[{type:"tapId",id:t[0]},{type:"type",text:e}]}case"key":return t.length!==1&&o(n,"key <name>"),[{type:"key",key:t[0]}];case"key-sequence":return t.length===0&&o(n,"key-sequence <key> [<key> ...]"),t.map(e=>({type:"key",key:e}));case"dismiss":return t.length!==0&&o(n,"dismiss"),[{type:"dismissKeyboard"}];case"scroll":{let e="scroll <id> <x> <y>";return t.length!==3&&o(n,e),[{type:"scroll",id:t[0],x:r(t[1],n,e),y:r(t[2],n,e),animated:!1}]}case"drag":case"swipe":{let e=`${d} <x1> <y1> <x2> <y2> [steps] [stepMs]`;(t.length<4||t.length>6)&&o(n,e);let i=d==="swipe"?10:12,y=d==="swipe"?8:16;return[{type:"drag",fromX:r(t[0],n,e),fromY:r(t[1],n,e),toX:r(t[2],n,e),toY:r(t[3],n,e),steps:t.length>=5?Math.max(1,Math.round(r(t[4],n,e))):i,stepMs:t.length===6?Math.max(0,Math.round(r(t[5],n,e))):y}]}case"pinch":{let e="pinch <x1> <y1> <x2> <y2> <x1'> <y1'> <x2'> <y2'> [steps] [stepMs]";return(t.length<8||t.length>10)&&o(n,e),[{type:"pinch",fromX1:r(t[0],n,e),fromY1:r(t[1],n,e),fromX2:r(t[2],n,e),fromY2:r(t[3],n,e),toX1:r(t[4],n,e),toY1:r(t[5],n,e),toX2:r(t[6],n,e),toY2:r(t[7],n,e),steps:t.length>=9?Math.max(1,Math.round(r(t[8],n,e))):12,stepMs:t.length===10?Math.max(0,Math.round(r(t[9],n,e))):16}]}case"touch":{let e="touch <down|move|up|cancel> <x> <y> [pointerId]";(t.length<3||t.length>4)&&o(n,e);let i=t[0];i!=="down"&&i!=="move"&&i!=="up"&&i!=="cancel"&&o(n,e);let y=t.length===4?Math.max(1,Math.round(r(t[3],n,e))):999;return i==="cancel"?[{type:"touchCancel",pointerId:y}]:[{type:i==="down"?"touchDown":i==="move"?"touchMove":"touchUp",x:r(t[1],n,e),y:r(t[2],n,e),pointerId:y}]}case"sleep":{let e="sleep [seconds]";t.length>1&&o(n,e);let i=t.length===1?r(t[0],n,e):.5;return i<0&&o(n,e),[{type:"wait",ms:Math.round(i*1e3)}]}default:throw new p(`do chain action ${n+1} cannot batch ${JSON.stringify(d)}`)}})}async function Y(a,s={}){let[l,n,d,t,e]=await Promise.all([import("./connect-N4FV3DDV.js"),import("./sim-client-VTKFEDJX.js"),import("./ws-bridge-JXQUAWFA.js"),import("./env-YIBOMB24.js"),import("./resolve-target-KAAS274S.js")]),{connect:i}=l,{SimPerformError:y}=n,{checkSimHealth:M,parseBridgeCliArgs:S}=d,{isAgentEnv:$}=t,{resolveTargetCoords:x}=e,b=a.includes("--json"),I=a.includes("--no-wait")||process.env.SOOTSIM_NO_AUTO_WAIT==="1",m=S(a,{port:s.port,commandTimeoutMs:3e4,stripBooleanFlags:["--json","--no-wait"]});if(!Number.isFinite(m.commandTimeoutMs)||m.commandTimeoutMs<=0)return console.error(" do chain: --timeout must be a positive number"),1;let w;try{w=D(m.positional)}catch(u){return console.error(` do chain: ${u instanceof Error?u.message:u}`),1}let h=null;try{h=await i({port:m.wsPort,sim:m.simId,timeoutMs:m.commandTimeoutMs}),await M(h);let u=[];for(let c of w){if(c.type!=="targetedDoubleTap"&&c.type!=="targetedLongPress"){u.push(c);continue}let f=await x(h,{mode:"testid",value:c.id});if(!f)throw new p(`do chain could not find testID ${JSON.stringify(c.id)}`);u.push(c.type==="targetedDoubleTap"?{type:"doubleTap",x:f.x,y:f.y,gapMs:c.gapMs}:{type:"longPress",x:f.x,y:f.y,durationMs:c.durationMs})}let g=await h.perform(u,{timeoutMs:m.commandTimeoutMs});if(!I)try{let c=$()?400:200,f=await h.settle({maxMs:c});f.settled||process.stderr.write(` \u26A0 auto-wait timed out after ${f.elapsed??c}ms. next command may see mid-animation state. use \`rnx do settle\` for a longer wait.
4
+ import"./chunk-I52NT6VG.js";var p=class extends Error{constructor(s){super(s),this.name="BridgeInputError"}};var k=new Set(["tap","tap-id","tap-text","double-tap","long-press","type","type-into","key","key-sequence","dismiss","scroll","drag","swipe","pinch","touch","sleep"]);function O(a){return a.includes("--then")}function o(a,s){throw new p(`do chain action ${a+1} has invalid arguments; usage: rnx do ${s}`)}function r(a,s,l){let n=Number(a);return(a===void 0||!Number.isFinite(n))&&o(s,l),n}function D(a){let s=[[]];for(let l of a){if(l!=="--then"){s[s.length-1].push(l);continue}if(s[s.length-1].length===0)throw new p("do chain contains an empty action");s.push([])}if(s.length<2)throw new p("do chain needs at least two actions separated by --then");if(s[s.length-1].length===0)throw new p("do chain cannot end with --then");return s.flatMap((l,n)=>{let[d,...t]=l;if(!d)throw new p("do chain contains an empty action");if(!k.has(d))throw new p(`do chain action ${n+1} cannot batch ${JSON.stringify(d)}; run it as a separate rnx do command`);switch(d){case"tap":return t.length===1&&!Number.isFinite(Number(t[0]))?[{type:"tapId",id:t[0]}]:(t.length!==2&&o(n,"tap <testid> | <x> <y>"),[{type:"tap",x:r(t[0],n,"tap <testid> | <x> <y>"),y:r(t[1],n,"tap <testid> | <x> <y>")}]);case"tap-id":return t.length!==1&&o(n,"tap-id <id>"),[{type:"tapId",id:t[0]}];case"tap-text":{let e=t.join(" ");return e||o(n,"tap-text <text>"),[{type:"tapText",text:e}]}case"double-tap":{let e="double-tap <testid> [gapMs] | <x> <y> [gapMs]";return t.length>0&&!Number.isFinite(Number(t[0]))?(t.length>2&&o(n,e),[{type:"targetedDoubleTap",id:t[0],gapMs:t.length===2?Math.max(0,Math.round(r(t[1],n,e))):80}]):((t.length<2||t.length>3)&&o(n,e),[{type:"doubleTap",x:r(t[0],n,e),y:r(t[1],n,e),gapMs:t.length===3?Math.max(0,Math.round(r(t[2],n,e))):80}])}case"long-press":{let e="long-press <testid> [durationMs] | <x> <y> [durationMs]";return t.length>0&&!Number.isFinite(Number(t[0]))?(t.length>2&&o(n,e),[{type:"targetedLongPress",id:t[0],durationMs:t.length===2?Math.max(0,Math.round(r(t[1],n,e))):600}]):((t.length<2||t.length>3)&&o(n,e),[{type:"longPress",x:r(t[0],n,e),y:r(t[1],n,e),durationMs:t.length===3?Math.max(0,Math.round(r(t[2],n,e))):600}])}case"type":{let e=t.join(" ");return e||o(n,"type <text>"),[{type:"type",text:e}]}case"type-into":{let e=t.slice(1).join(" ");return(!t[0]||!e)&&o(n,"type-into <id> <text>"),[{type:"tapId",id:t[0]},{type:"type",text:e}]}case"key":return t.length!==1&&o(n,"key <name>"),[{type:"key",key:t[0]}];case"key-sequence":return t.length===0&&o(n,"key-sequence <key> [<key> ...]"),t.map(e=>({type:"key",key:e}));case"dismiss":return t.length!==0&&o(n,"dismiss"),[{type:"dismissKeyboard"}];case"scroll":{let e="scroll <id> <x> <y>";return t.length!==3&&o(n,e),[{type:"scroll",id:t[0],x:r(t[1],n,e),y:r(t[2],n,e),animated:!1}]}case"drag":case"swipe":{let e=`${d} <x1> <y1> <x2> <y2> [steps] [stepMs]`;(t.length<4||t.length>6)&&o(n,e);let i=d==="swipe"?10:12,y=d==="swipe"?8:16;return[{type:"drag",fromX:r(t[0],n,e),fromY:r(t[1],n,e),toX:r(t[2],n,e),toY:r(t[3],n,e),steps:t.length>=5?Math.max(1,Math.round(r(t[4],n,e))):i,stepMs:t.length===6?Math.max(0,Math.round(r(t[5],n,e))):y}]}case"pinch":{let e="pinch <x1> <y1> <x2> <y2> <x1'> <y1'> <x2'> <y2'> [steps] [stepMs]";return(t.length<8||t.length>10)&&o(n,e),[{type:"pinch",fromX1:r(t[0],n,e),fromY1:r(t[1],n,e),fromX2:r(t[2],n,e),fromY2:r(t[3],n,e),toX1:r(t[4],n,e),toY1:r(t[5],n,e),toX2:r(t[6],n,e),toY2:r(t[7],n,e),steps:t.length>=9?Math.max(1,Math.round(r(t[8],n,e))):12,stepMs:t.length===10?Math.max(0,Math.round(r(t[9],n,e))):16}]}case"touch":{let e="touch <down|move|up|cancel> <x> <y> [pointerId]";(t.length<3||t.length>4)&&o(n,e);let i=t[0];i!=="down"&&i!=="move"&&i!=="up"&&i!=="cancel"&&o(n,e);let y=t.length===4?Math.max(1,Math.round(r(t[3],n,e))):999;return i==="cancel"?[{type:"touchCancel",pointerId:y}]:[{type:i==="down"?"touchDown":i==="move"?"touchMove":"touchUp",x:r(t[1],n,e),y:r(t[2],n,e),pointerId:y}]}case"sleep":{let e="sleep [seconds]";t.length>1&&o(n,e);let i=t.length===1?r(t[0],n,e):.5;return i<0&&o(n,e),[{type:"wait",ms:Math.round(i*1e3)}]}default:throw new p(`do chain action ${n+1} cannot batch ${JSON.stringify(d)}`)}})}async function Y(a,s={}){let[l,n,d,t,e]=await Promise.all([import("./connect-QE4VU6GB.js"),import("./sim-client-KLAYIFOC.js"),import("./ws-bridge-QXFQLRE7.js"),import("./env-U67SQVTV.js"),import("./resolve-target-7R5BNYMM.js")]),{connect:i}=l,{SimPerformError:y}=n,{checkSimHealth:M,parseBridgeCliArgs:S}=d,{isAgentEnv:$}=t,{resolveTargetCoords:x}=e,b=a.includes("--json"),I=a.includes("--no-wait")||process.env.SOOTSIM_NO_AUTO_WAIT==="1",m=S(a,{port:s.port,commandTimeoutMs:3e4,stripBooleanFlags:["--json","--no-wait"]});if(!Number.isFinite(m.commandTimeoutMs)||m.commandTimeoutMs<=0)return console.error(" do chain: --timeout must be a positive number"),1;let w;try{w=D(m.positional)}catch(u){return console.error(` do chain: ${u instanceof Error?u.message:u}`),1}let h=null;try{h=await i({port:m.wsPort,sim:m.simId,timeoutMs:m.commandTimeoutMs}),await M(h);let u=[];for(let c of w){if(c.type!=="targetedDoubleTap"&&c.type!=="targetedLongPress"){u.push(c);continue}let f=await x(h,{mode:"testid",value:c.id});if(!f)throw new p(`do chain could not find testID ${JSON.stringify(c.id)}`);u.push(c.type==="targetedDoubleTap"?{type:"doubleTap",x:f.x,y:f.y,gapMs:c.gapMs}:{type:"longPress",x:f.x,y:f.y,durationMs:c.durationMs})}let g=await h.perform(u,{timeoutMs:m.commandTimeoutMs});if(!I)try{let c=$()?400:200,f=await h.settle({maxMs:c});f.settled||process.stderr.write(` \u26A0 auto-wait timed out after ${f.elapsed??c}ms. next command may see mid-animation state. use \`rnx do settle\` for a longer wait.
5
5
  `)}catch{}return console.log(b?JSON.stringify(g):` completed ${g.completed} batched ${g.completed===1?"step":"steps"} in ${g.durationMs}ms`),0}catch(u){return u instanceof y&&b?console.log(JSON.stringify(u.result)):console.error(` do chain failed: ${u instanceof Error?u.message:u}`),1}finally{h?.close()}}export{O as hasDoChain,D as parseDoChainActions,Y as runDoChain};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import"./chunk-VVQCZ42C.js";import{a,b,c,d,e,f,g}from"./chunk-DMHSD6YJ.js";import"./chunk-PAUEZO6F.js";import"./chunk-5BR33NAZ.js";import"./chunk-OJZHECGH.js";import"./chunk-FA75F34Z.js";import"./chunk-U63T6LIQ.js";import"./chunk-I52NT6VG.js";export{c as ALL_DRIVERS,g as buildDriverListRows,a as electronDriver,d as getAllDrivers,e as getDriver,b as playwrightDriver,f as resolveDriver};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.368 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a}from"./chunk-AUPJX4KI.js";import"./chunk-Q65KH25G.js";export{a as isAgentEnv};
4
+ import{a}from"./chunk-IDLFVRPN.js";import"./chunk-I52NT6VG.js";export{a as isAgentEnv};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.368 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{c as R,d as L}from"./chunk-X5MXQB3L.js";import{t as x,v as A,z as b}from"./chunk-T2MGLXY5.js";import"./chunk-LPAOOJIW.js";import"./chunk-E6XYIIJK.js";import"./chunk-Q65KH25G.js";import{spawnSync as T}from"node:child_process";import{existsSync as V,mkdirSync as W,unlinkSync as N,writeFileSync as E}from"node:fs";import{homedir as j}from"node:os";import{dirname as q,extname as H,join as K,resolve as I}from"node:path";var n=e=>new Promise(a=>setTimeout(a,e)),X=["--out","--fps","--script","--slow"],J=["--keep-three"],Q=["--background","--gradient","--gradient-angle","--colorway","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--room","--focus","--focus-amount","--focus-range"],Y=12e4,Z=16e6;function c(e,a){let s=e.indexOf(a);return s>=0?e[s+1]:void 0}async function r(e,a,s=3e4){return await e.send({type:"evaluate",code:a},{timeoutMs:s})}async function ae(e,a){if(e.length===0||e.includes("--help")||e.includes("-h"))return console.log(`
4
+ import{c as R,d as L}from"./chunk-O6QLKSAM.js";import{t as x,v as A,z as b}from"./chunk-EOIBLKZO.js";import"./chunk-OJZHECGH.js";import"./chunk-AVJBT5LF.js";import"./chunk-U63T6LIQ.js";import"./chunk-I52NT6VG.js";import{spawnSync as T}from"node:child_process";import{existsSync as V,mkdirSync as W,unlinkSync as N,writeFileSync as E}from"node:fs";import{homedir as j}from"node:os";import{dirname as q,extname as H,join as K,resolve as I}from"node:path";var n=e=>new Promise(a=>setTimeout(a,e)),X=["--out","--fps","--script","--slow"],J=["--keep-three"],Q=["--background","--gradient","--gradient-angle","--colorway","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--room","--focus","--focus-amount","--focus-range"],Y=12e4,Z=16e6;function c(e,a){let s=e.indexOf(a);return s>=0?e[s+1]:void 0}async function r(e,a,s=3e4){return await e.send({type:"evaluate",code:a},{timeoutMs:s})}async function ae(e,a){if(e.length===0||e.includes("--help")||e.includes("-h"))return console.log(`
5
5
  rnx film \u2014 record a flow flat, replay it on the 3d stage, save a clip
6
6
 
7
7
  usage:
@@ -35,7 +35,7 @@ examples:
35
35
  rnx film flows/swap.yaml --script hero-arc --background gradient-tide --out ~/Desktop/swap-3d.mp4
36
36
  rnx film flows/login.yaml --colorway deep-blue --environment on --env-shape pane --room on
37
37
  `),0;let s=e.find(d=>!d.startsWith("--")&&/\.ya?ml$/.test(d));if(!s||!V(I(s)))return console.error(` film: flow file not found: ${s??"(none given)"}`),1;let P=Number.parseInt(c(e,"--fps")??"30",10),h=c(e,"--script")??"hero-arc",z=e.includes("--keep-three"),v=s.replace(/^.*\//,"").replace(/\.ya?ml$/,""),O=c(e,"--out"),l=I(O??K(j(),"Desktop","sootsim-films",`${v}.webm`)),S=H(l).toLowerCase()===".mp4";if(S&&T("ffmpeg",["-version"]).status!==0)return console.error(" film: --out ends in .mp4 but ffmpeg is not installed"),console.error(" install ffmpeg or use a .webm output path"),1;let C=x(e,{port:a.port,stripValueFlags:[...X,...Q],stripBooleanFlags:J}),t=A({...C,commandTimeoutMs:6e4});try{let d=await r(t,`(() => { const s = window.SootSim?.bridges?.settings?.get?.() || {}
38
- return { threeMode: s.threeMode === true, editor: s.threeRecordingEditor === true } })()`);if(console.log(` film: recording flow ${v} on the flat canvas`),!await r(t,"(async () => !!(await window.SootSim?.bridges?.startRecording?.('video', undefined, { skipEntitlement: true })))()"))return console.error(" film: engine recording store did not start (is @sootsim/plugin-recording installed?)"),1;let D=Date.now();await n(500);let{runFlowPlayback:G}=await import("./flow-BDAA6BWL.js"),m=[s],y=c(e,"--sim");y&&m.push("--sim",y);let k=c(e,"--slow");k&&m.push("--slow",k);let f=await G(m);await n(400);let u=Math.min(Date.now()-D,Y);if(await r(t,"window.SootSim?.bridges?.stopRecording?.()"),f!==0)return console.error(` film: flow failed (exit ${f}) \u2014 not filming a broken take`),f;let F=!1;for(let o=0;o<50;o++){await n(400);let i=await r(t,`(() => { const s = window.SootSim?.bridges?.getRecordingState?.()
38
+ return { threeMode: s.threeMode === true, editor: s.threeRecordingEditor === true } })()`);if(console.log(` film: recording flow ${v} on the flat canvas`),!await r(t,"(async () => !!(await window.SootSim?.bridges?.startRecording?.('video', undefined, { skipEntitlement: true })))()"))return console.error(" film: engine recording store did not start (is @sootsim/plugin-recording installed?)"),1;let D=Date.now();await n(500);let{runFlowPlayback:G}=await import("./flow-FHZZD3P6.js"),m=[s],y=c(e,"--sim");y&&m.push("--sim",y);let k=c(e,"--slow");k&&m.push("--slow",k);let f=await G(m);await n(400);let u=Math.min(Date.now()-D,Y);if(await r(t,"window.SootSim?.bridges?.stopRecording?.()"),f!==0)return console.error(` film: flow failed (exit ${f}) \u2014 not filming a broken take`),f;let F=!1;for(let o=0;o<50;o++){await n(400);let i=await r(t,`(() => { const s = window.SootSim?.bridges?.getRecordingState?.()
39
39
  return { state: s?.state, hasBlob: !!s?.lastVideoBlob } })()`);if(i?.state==="idle"&&i.hasBlob){F=!0;break}}if(!F)return console.error(" film: flow recording never produced a video blob"),1;console.log(` film: flow captured (${(u/1e3).toFixed(1)}s)`),await r(t,"window.SootSim?.bridges?.settings?.set?.('threeMode', true)"),await R(t),await n(1400),await r(t,"window.SootSim?.bridges?.settings?.set?.('threeRecordingEditor', true)");let _=!1;for(let o=0;o<60;o++)if(await n(250),await r(t,`(() => { const rs = window.SootSim?.replayStore
40
40
  return rs?.value?.preview?.surface === 'video' && !!rs?.value?.preview?.flowVideoUrl })()`)){_=!0;break}if(!_)return console.error(" film: recording editor did not seed the replay store"),1;let p=L(e);delete p.script,p.resetPose=!0,await b(t,"SootSim.bridges.threeMode.configure",p),await n(2400),console.log(` film: filming the 3d stage (script: ${h})`);let M=await r(t,`(() => {
41
41
  const c = window.SootSim?.bridges?.threeMode?.getCanvas?.()
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c,d,e,f,g,h,i}from"./chunk-ARMXC3C3.js";import"./chunk-X6WQ4YWE.js";import"./chunk-BMIJZNKD.js";import{a,b}from"./chunk-HEKHLQ3B.js";import"./chunk-UFVAAWGZ.js";import"./chunk-LIMWG54N.js";import"./chunk-Q4MRJ6PO.js";import"./chunk-H5X5FJ63.js";import"./chunk-NTC46LSA.js";import"./chunk-6W4HIWC7.js";import"./chunk-LUOHRBJG.js";import"./chunk-DUXHYPBP.js";import"./chunk-OTFTMGAL.js";import"./chunk-6S5LJV2O.js";import"./chunk-3UXXYJVD.js";import"./chunk-DMHSD6YJ.js";import"./chunk-PAUEZO6F.js";import"./chunk-6A6L3VJR.js";import"./chunk-3BG6UCQY.js";import"./chunk-5BR33NAZ.js";import"./chunk-NR2V2ONN.js";import"./chunk-D2GZASRV.js";import"./chunk-AALKIAUZ.js";import"./chunk-EWSWOWXK.js";import"./chunk-PNOENVMJ.js";import"./chunk-WFQHT4QD.js";import"./chunk-EQ3OE2AV.js";import"./chunk-C7BA5CCM.js";import"./chunk-JZLDHPB7.js";import"./chunk-CMVRTZ5G.js";import"./chunk-EOIBLKZO.js";import"./chunk-OJZHECGH.js";import"./chunk-YIZGNT7A.js";import"./chunk-AVJBT5LF.js";import"./chunk-LXPHL6FO.js";import"./chunk-RRX52O37.js";import"./chunk-FA75F34Z.js";import"./chunk-DHYTRCIP.js";import"./chunk-IDLFVRPN.js";import"./chunk-U63T6LIQ.js";import"./chunk-64JAEJ6N.js";import"./chunk-I52NT6VG.js";export{f as discoverSootsimUrl,c as getLastFlowPreviewUploadResult,d as getLastFlowTraceSteps,h as hoistLeadingSimFlag,a as parseFlowFile,e as resolveAppFrontmatterTarget,g as runFlowPlayback,i as runMaestroAuthoring,b as validateFlowFile};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a,b,c}from"./chunk-5RKRVS5A.js";import"./chunk-PIZXOXBL.js";import"./chunk-C7BA5CCM.js";import"./chunk-NJMU5BN6.js";import"./chunk-JZLDHPB7.js";import"./chunk-CMVRTZ5G.js";import"./chunk-EOIBLKZO.js";import"./chunk-OJZHECGH.js";import"./chunk-RRX52O37.js";import"./chunk-U63T6LIQ.js";import"./chunk-MDCY532E.js";import"./chunk-64JAEJ6N.js";import"./chunk-I52NT6VG.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.368 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import"./chunk-DJSPNOF6.js";import{b as n}from"./chunk-SSUPPM6K.js";import"./chunk-Q65KH25G.js";var e=["do","get"];function i(t){if(t.command)return t;let o=t.commandArgs.find(r=>!r.startsWith("-"));if(!o)return t;for(let r of e)if(n(r,o))return{...t,command:r};return t}export{i as resolveHiddenRuntimeAlias};
4
+ import"./chunk-LXPHL6FO.js";import{b as n}from"./chunk-RRX52O37.js";import"./chunk-I52NT6VG.js";var e=["do","get"];function i(t){if(t.command)return t;let o=t.commandArgs.find(r=>!r.startsWith("-"));if(!o)return t;for(let r of e)if(n(r,o))return{...t,command:r};return t}export{i as resolveHiddenRuntimeAlias};