rnxsim 0.1.331 → 0.1.333

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 (156) hide show
  1. package/dist-cli/bin.js +5 -5
  2. package/dist-cli/chunks/{agent-TIVJ2VQL.js → agent-4TY2APND.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-NAAH2TNP.js → agent-wrapper-7I4UG6NB.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-F4X4W4YK.js → app-fonts-VWVPRBEK.js} +2 -2
  5. package/dist-cli/chunks/{assert-3NYZ544E.js → assert-VKDIRZE2.js} +2 -2
  6. package/dist-cli/chunks/{auth-QUWQKG5S.js → auth-UAEHSDRV.js} +2 -2
  7. package/dist-cli/chunks/{beta-BO3LCCRQ.js → beta-ZKLXRT7W.js} +2 -2
  8. package/dist-cli/chunks/{camera-YWPE2C2E.js → camera-S75VVCBC.js} +2 -2
  9. package/dist-cli/chunks/{chunk-XY6S3SA5.js → chunk-2SAWRX3C.js} +1 -1
  10. package/dist-cli/chunks/{chunk-PFQ2GL6I.js → chunk-2UDDQL5S.js} +1 -1
  11. package/dist-cli/chunks/{chunk-FKP4RKI7.js → chunk-2W3DLSTL.js} +1 -1
  12. package/dist-cli/chunks/{chunk-XMB5EJKT.js → chunk-2WFJDUEP.js} +1 -1
  13. package/dist-cli/chunks/{chunk-WU3RVT52.js → chunk-3KRC63S4.js} +2 -2
  14. package/dist-cli/chunks/{chunk-UQAS5DKQ.js → chunk-3YUHY3RY.js} +1 -1
  15. package/dist-cli/chunks/{chunk-PMSGRATC.js → chunk-4MXBZD2N.js} +2 -2
  16. package/dist-cli/chunks/{chunk-EXIHWLOG.js → chunk-4WGS7ULT.js} +1 -1
  17. package/dist-cli/chunks/{chunk-YZ52AN7N.js → chunk-53DWFBL6.js} +3 -3
  18. package/dist-cli/chunks/{chunk-MXQNNVV4.js → chunk-6YYK6WL4.js} +2 -2
  19. package/dist-cli/chunks/{chunk-T3RYRPOL.js → chunk-76E5SSJE.js} +2 -2
  20. package/dist-cli/chunks/{chunk-2664O2SP.js → chunk-7D2RLML6.js} +2 -2
  21. package/dist-cli/chunks/{chunk-XR2ELPIS.js → chunk-7JD7XZ6J.js} +2 -2
  22. package/dist-cli/chunks/{chunk-CXKDXNRV.js → chunk-A2OABK5V.js} +2 -2
  23. package/dist-cli/chunks/{chunk-3M24TFEF.js → chunk-A7INKWBI.js} +2 -2
  24. package/dist-cli/chunks/{chunk-JDUNLHV4.js → chunk-AHITCGHF.js} +2 -2
  25. package/dist-cli/chunks/{chunk-DXOSLJQ7.js → chunk-AQYGM454.js} +1 -1
  26. package/dist-cli/chunks/{chunk-PPXPG2LH.js → chunk-AR33KVWV.js} +1 -1
  27. package/dist-cli/chunks/{chunk-BYO6P6AW.js → chunk-B6PR6YLO.js} +2 -2
  28. package/dist-cli/chunks/{chunk-FJIPXIGR.js → chunk-BPEXXNXX.js} +2 -2
  29. package/dist-cli/chunks/{chunk-CJJFG5KQ.js → chunk-BWWFYOKL.js} +1 -1
  30. package/dist-cli/chunks/{chunk-OKAQ3XRQ.js → chunk-CAWZ545B.js} +1 -1
  31. package/dist-cli/chunks/{chunk-YYR4BDUN.js → chunk-CJJI74AT.js} +2 -2
  32. package/dist-cli/chunks/{chunk-ADGT4K22.js → chunk-CS2B3W6C.js} +2 -2
  33. package/dist-cli/chunks/{chunk-XSW55GIR.js → chunk-DXAZX6Y4.js} +2 -2
  34. package/dist-cli/chunks/{chunk-RKNKWP63.js → chunk-EGXHBCDU.js} +1 -1
  35. package/dist-cli/chunks/{chunk-6MWOPKCZ.js → chunk-F7J4G76K.js} +2 -2
  36. package/dist-cli/chunks/{chunk-6QEYHQZH.js → chunk-FCLPIJ6G.js} +2 -2
  37. package/dist-cli/chunks/{chunk-3PKHK6G4.js → chunk-GPKK6UQL.js} +3 -3
  38. package/dist-cli/chunks/{chunk-5R5FCLE4.js → chunk-HTKS4EIQ.js} +2 -2
  39. package/dist-cli/chunks/{chunk-R465QKXY.js → chunk-I44IV7DO.js} +2 -2
  40. package/dist-cli/chunks/{chunk-FQNDTYZQ.js → chunk-JQBAVE6X.js} +1 -1
  41. package/dist-cli/chunks/{chunk-IXMPQ35S.js → chunk-KLLX5IWP.js} +1 -1
  42. package/dist-cli/chunks/{chunk-BW7RJZKD.js → chunk-LNPB4QNK.js} +3 -3
  43. package/dist-cli/chunks/{chunk-GMG63IR6.js → chunk-LXZJ5VX5.js} +2 -2
  44. package/dist-cli/chunks/{chunk-ENPMBKGL.js → chunk-M47UITXL.js} +1 -1
  45. package/dist-cli/chunks/{chunk-SRGYFE5A.js → chunk-MBRV35BV.js} +1 -1
  46. package/dist-cli/chunks/{chunk-ZXLX6VWG.js → chunk-MQPGJ54E.js} +3 -3
  47. package/dist-cli/chunks/{chunk-WRA524FO.js → chunk-MWOCKUXA.js} +1 -1
  48. package/dist-cli/chunks/{chunk-SOV5SHYG.js → chunk-OUXCE743.js} +1 -1
  49. package/dist-cli/chunks/{chunk-EIK7XWQ5.js → chunk-PA42GAHK.js} +2 -2
  50. package/dist-cli/chunks/{chunk-CWOSCFGT.js → chunk-QISLN6DC.js} +2 -2
  51. package/dist-cli/chunks/{chunk-XCAWIFDN.js → chunk-S6QDUPF2.js} +1 -1
  52. package/dist-cli/chunks/{chunk-IDFSGLP3.js → chunk-SCFRY5MT.js} +2 -2
  53. package/dist-cli/chunks/{chunk-HEY3X6S5.js → chunk-TCELYE7A.js} +2 -2
  54. package/dist-cli/chunks/{chunk-C53ASFDC.js → chunk-UJQO4GMX.js} +2 -2
  55. package/dist-cli/chunks/{chunk-CLI3SDZR.js → chunk-WBOJVCV7.js} +2 -2
  56. package/dist-cli/chunks/{chunk-X5XJUVTI.js → chunk-WBPBMC32.js} +1 -1
  57. package/dist-cli/chunks/{chunk-BPXOBH2S.js → chunk-WFPHEUH2.js} +2 -2
  58. package/dist-cli/chunks/{chunk-LTKFVWTL.js → chunk-X43U7QEK.js} +2 -2
  59. package/dist-cli/chunks/{chunk-XPGHWUUW.js → chunk-X6N6VPFL.js} +2 -2
  60. package/dist-cli/chunks/{chunk-PHEOSYZF.js → chunk-YR6HDAQL.js} +1 -1
  61. package/dist-cli/chunks/{chunk-NB5Y2UMJ.js → chunk-ZD4NF7Q2.js} +2 -2
  62. package/dist-cli/chunks/{cleanup-3SG25UHN.js → cleanup-5RPNH4RP.js} +2 -2
  63. package/dist-cli/chunks/cli-version-OCCHVUAW.js +4 -0
  64. package/dist-cli/chunks/{compat-K7WLYWBU.js → compat-ABWB7QZS.js} +2 -2
  65. package/dist-cli/chunks/{config-TKTI5L67.js → config-LRTKYTV2.js} +2 -2
  66. package/dist-cli/chunks/{control-4XG7HI7E.js → control-HZ6OURXV.js} +2 -2
  67. package/dist-cli/chunks/daemon-VISCUGN7.js +4 -0
  68. package/dist-cli/chunks/{debug-ZOXWDUDF.js → debug-NSYENL3N.js} +3 -3
  69. package/dist-cli/chunks/{desktop-QEFCE4TC.js → desktop-D2PVNSMA.js} +3 -3
  70. package/dist-cli/chunks/{detox-ZTTUHOJC.js → detox-LS6YPPAG.js} +2 -2
  71. package/dist-cli/chunks/{device-EQ2UGP5T.js → device-UYPWQLR7.js} +2 -2
  72. package/dist-cli/chunks/{diagnose-VUR2KXNV.js → diagnose-HW6RUMV2.js} +2 -2
  73. package/dist-cli/chunks/{disk-cleanup-BG3FSH3T.js → disk-cleanup-PAVLYNWF.js} +2 -2
  74. package/dist-cli/chunks/drivers-HPJOL2KF.js +4 -0
  75. package/dist-cli/chunks/{film-KXDF6PN6.js → film-GI6ZTSBV.js} +3 -3
  76. package/dist-cli/chunks/flow-7BSOIPKL.js +4 -0
  77. package/dist-cli/chunks/help-X2HGA2KN.js +4 -0
  78. package/dist-cli/chunks/{hidden-runtime-alias-ITAZXMMG.js → hidden-runtime-alias-4LFEPXZ4.js} +2 -2
  79. package/dist-cli/chunks/{home-paths-KGGUDHCZ.js → home-paths-TPMFLDM3.js} +2 -2
  80. package/dist-cli/chunks/inspect-25QBVPAW.js +4 -0
  81. package/dist-cli/chunks/install-desktop-QJXJR5AL.js +4 -0
  82. package/dist-cli/chunks/{login-4F7NERV7.js → login-XYJ6TC54.js} +4 -4
  83. package/dist-cli/chunks/{logout-2OKDBJHO.js → logout-VPUBPB3L.js} +2 -2
  84. package/dist-cli/chunks/{maestro-NW6WAYQV.js → maestro-FE57XW4M.js} +3 -3
  85. package/dist-cli/chunks/{maestro-generate-MISRGALN.js → maestro-generate-XCI4AGEB.js} +3 -3
  86. package/dist-cli/chunks/{mode-EKI72F2T.js → mode-ITGYARR2.js} +2 -2
  87. package/dist-cli/chunks/{optional-demo-registry-AAEIQVCY.js → optional-demo-registry-BLR5W6BI.js} +2 -2
  88. package/dist-cli/chunks/{perf-OW2JXHYV.js → perf-ZRVIZDNV.js} +2 -2
  89. package/dist-cli/chunks/{permissions-NNHXQKBS.js → permissions-NYYP52R3.js} +2 -2
  90. package/dist-cli/chunks/{record-VADDEEBX.js → record-LIRVKHFP.js} +3 -3
  91. package/dist-cli/chunks/{report-issue-DHT4PQBP.js → report-issue-AGTCOIEN.js} +2 -2
  92. package/dist-cli/chunks/reset-PN4CBAHW.js +4 -0
  93. package/dist-cli/chunks/runtime-IRTYWMVV.js +4 -0
  94. package/dist-cli/chunks/{screenshot-command-7DKY35CU.js → screenshot-command-IB2WP3VC.js} +3 -3
  95. package/dist-cli/chunks/{screenshot-layers-ESNJOBVU.js → screenshot-layers-ND2HKCLN.js} +2 -2
  96. package/dist-cli/chunks/{screenshots-capture-POJ5L7CV.js → screenshots-capture-YIHKMGYF.js} +2 -2
  97. package/dist-cli/chunks/{serve-CW32JPG4.js → serve-TANF54HN.js} +2 -2
  98. package/dist-cli/chunks/{setup-DKF75MGR.js → setup-SNVEDJIW.js} +2 -2
  99. package/dist-cli/chunks/{skills-CBFL5UON.js → skills-FFYAXA63.js} +2 -2
  100. package/dist-cli/chunks/{state-CT56FPBR.js → state-2VJWVT4N.js} +2 -2
  101. package/dist-cli/chunks/{storage-C6OPQ7HG.js → storage-XFCAKWA3.js} +2 -2
  102. package/dist-cli/chunks/store-IXRVVCTP.js +4 -0
  103. package/dist-cli/chunks/telemetry-H4CSF7YT.js +4 -0
  104. package/dist-cli/chunks/{timeline-42WFDMKB.js → timeline-LILDNJFG.js} +2 -2
  105. package/dist-cli/chunks/{upgrade-YBUFX2UK.js → upgrade-CKECNCGT.js} +2 -2
  106. package/dist-cli/chunks/upload-OPM4BK5X.js +4 -0
  107. package/dist-cli/chunks/{version-YFPV4YOP.js → version-BICGGSAT.js} +2 -2
  108. package/dist-cli/chunks/{web-I77YJ726.js → web-6CSTQ5XL.js} +2 -2
  109. package/dist-cli/chunks/{what-happened-6MXBXSSE.js → what-happened-IRCNWRKH.js} +2 -2
  110. package/dist-lib/agent-daemon-client.cjs +1 -1
  111. package/dist-lib/agent-events.cjs +1 -1
  112. package/dist-lib/agent-identity.cjs +1 -1
  113. package/dist-lib/agent-sessions.cjs +1 -1
  114. package/dist-lib/attached-projects.cjs +1 -1
  115. package/dist-lib/auth/shared-session.cjs +1 -1
  116. package/dist-lib/backend-origin.cjs +1 -1
  117. package/dist-lib/beta.cjs +1 -1
  118. package/dist-lib/beta.mjs +1 -1
  119. package/dist-lib/bridge-constants.cjs +1 -1
  120. package/dist-lib/bridge-contract.cjs +1 -1
  121. package/dist-lib/cli-constants.cjs +1 -1
  122. package/dist-lib/config.cjs +1 -1
  123. package/dist-lib/detox/index.cjs +1 -1
  124. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  125. package/dist-lib/home-paths.cjs +1 -1
  126. package/dist-lib/host/bridge-host.cjs +1 -1
  127. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  128. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  129. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  130. package/dist-lib/host/websocket-proxy.cjs +1 -1
  131. package/dist-lib/index.cjs +1 -1
  132. package/dist-lib/jump-to-source-babel.cjs +1 -1
  133. package/dist-lib/menu.cjs +1 -1
  134. package/dist-lib/menu.mjs +1 -1
  135. package/dist-lib/metro.cjs +1 -1
  136. package/dist-lib/profiles.cjs +1 -1
  137. package/dist-lib/public-brand.cjs +1 -1
  138. package/dist-lib/render-mode.cjs +1 -1
  139. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  140. package/dist-lib/sdk.cjs +1 -1
  141. package/dist-lib/sdk.mjs +1 -1
  142. package/dist-lib/skills.cjs +1 -1
  143. package/dist-lib/vite.cjs +1 -1
  144. package/package.json +1 -1
  145. package/dist-cli/chunks/cli-version-QO6EIJVH.js +0 -4
  146. package/dist-cli/chunks/daemon-DQZKHNAG.js +0 -4
  147. package/dist-cli/chunks/drivers-OV4G6634.js +0 -4
  148. package/dist-cli/chunks/flow-QW74XB5M.js +0 -4
  149. package/dist-cli/chunks/help-CUC4YFWC.js +0 -4
  150. package/dist-cli/chunks/inspect-GMZRQONO.js +0 -4
  151. package/dist-cli/chunks/install-desktop-SPCPW2J7.js +0 -4
  152. package/dist-cli/chunks/reset-XW3K66N7.js +0 -4
  153. package/dist-cli/chunks/runtime-J6CSXKS6.js +0 -4
  154. package/dist-cli/chunks/store-FEB6UD6M.js +0 -4
  155. package/dist-cli/chunks/telemetry-RLMA24YQ.js +0 -4
  156. package/dist-cli/chunks/upload-V4SXEM42.js +0 -4
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{c as E,d as O,g as L,h as R,i as P}from"./chunk-YZ52AN7N.js";import"./chunk-OKAQ3XRQ.js";import"./chunk-LTKFVWTL.js";import{b as k}from"./chunk-3PKHK6G4.js";import"./chunk-UQAS5DKQ.js";import"./chunk-PPXPG2LH.js";import{a as S}from"./chunk-IDFSGLP3.js";import"./chunk-2664O2SP.js";import"./chunk-JDUNLHV4.js";import"./chunk-FQNDTYZQ.js";import"./chunk-PMSGRATC.js";import"./chunk-MXQNNVV4.js";import"./chunk-PHEOSYZF.js";import"./chunk-XPGHWUUW.js";import{b as $,c as F,d as T,e as M}from"./chunk-YYR4BDUN.js";import{a as A}from"./chunk-WU3RVT52.js";import"./chunk-BPXOBH2S.js";import"./chunk-R465QKXY.js";import"./chunk-PFQ2GL6I.js";import"./chunk-T3RYRPOL.js";import"./chunk-ADGT4K22.js";import"./chunk-SRGYFE5A.js";import"./chunk-RKNKWP63.js";import"./chunk-XMB5EJKT.js";import"./chunk-GMG63IR6.js";import"./chunk-FJIPXIGR.js";import"./chunk-CXKDXNRV.js";import"./chunk-DXOSLJQ7.js";import"./chunk-6QEYHQZH.js";import"./chunk-3M24TFEF.js";import"./chunk-CLI3SDZR.js";import"./chunk-BYO6P6AW.js";import"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import"./chunk-SOV5SHYG.js";import"./chunk-IXMPQ35S.js";import"./chunk-ENPMBKGL.js";import"./chunk-X5XJUVTI.js";import*as n from"fs";import*as a from"path";var I=[".maestro","maestro"];function W(){console.log(`
4
+ import{c as E,d as O,g as L,h as R,i as P}from"./chunk-53DWFBL6.js";import"./chunk-CAWZ545B.js";import"./chunk-X43U7QEK.js";import{b as k}from"./chunk-GPKK6UQL.js";import"./chunk-3YUHY3RY.js";import"./chunk-AR33KVWV.js";import{a as S}from"./chunk-SCFRY5MT.js";import"./chunk-7D2RLML6.js";import"./chunk-AHITCGHF.js";import"./chunk-JQBAVE6X.js";import"./chunk-4MXBZD2N.js";import"./chunk-6YYK6WL4.js";import"./chunk-YR6HDAQL.js";import"./chunk-X6N6VPFL.js";import{b as $,c as F,d as T,e as M}from"./chunk-CJJI74AT.js";import{a as A}from"./chunk-3KRC63S4.js";import"./chunk-WFPHEUH2.js";import"./chunk-I44IV7DO.js";import"./chunk-2UDDQL5S.js";import"./chunk-76E5SSJE.js";import"./chunk-CS2B3W6C.js";import"./chunk-MBRV35BV.js";import"./chunk-EGXHBCDU.js";import"./chunk-2WFJDUEP.js";import"./chunk-LXZJ5VX5.js";import"./chunk-BPEXXNXX.js";import"./chunk-A2OABK5V.js";import"./chunk-AQYGM454.js";import"./chunk-FCLPIJ6G.js";import"./chunk-A7INKWBI.js";import"./chunk-WBOJVCV7.js";import"./chunk-B6PR6YLO.js";import"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-OUXCE743.js";import"./chunk-KLLX5IWP.js";import"./chunk-M47UITXL.js";import"./chunk-WBPBMC32.js";import*as n from"fs";import*as a from"path";var I=[".maestro","maestro"];function W(){console.log(`
5
5
  rnxsim maestro \u2014 author and run Maestro YAML flows against rnx
6
6
 
7
7
  usage:
@@ -91,7 +91,7 @@ appId: com.example.app
91
91
  - inputText: "secret123"
92
92
  - tapOn: "Sign in"
93
93
  - assertVisible: "Welcome"
94
- `,"utf8"),console.log(` + wrote ${e}`),console.log(" next: rnxsim maestro test .maestro/login.yaml"),0)}async function Q(t,s={}){if(t.includes("--help")||t.includes("-h"))return W(),0;if(t.includes("--list-compat"))return D(),0;let e;try{e=Y(t)}catch(o){return console.error(` error: ${o.message}`),1}e=R(e);let r=process.cwd(),i=e[0];if(i==="init")return _(r);if(i==="generate"){let{runMaestroGenerate:o}=await import("./maestro-generate-MISRGALN.js");return o(e.slice(1))}if(i==="start"||i==="keep"||i==="good"||i==="end"||i==="validate")return P(e);e=J(e);let c=null,p;if(i==="test"){let o=e.slice(1).find(f=>!U(f));o?(c=a.resolve(r,o),p=e.slice(1).filter(f=>f!==o)):(c=j(r),p=e.slice(1))}else i&&!U(i)?(c=a.resolve(r,i),p=e.slice(1)):(c=j(r),p=e);if(!c)return console.error(`
94
+ `,"utf8"),console.log(` + wrote ${e}`),console.log(" next: rnxsim maestro test .maestro/login.yaml"),0)}async function Q(t,s={}){if(t.includes("--help")||t.includes("-h"))return W(),0;if(t.includes("--list-compat"))return D(),0;let e;try{e=Y(t)}catch(o){return console.error(` error: ${o.message}`),1}e=R(e);let r=process.cwd(),i=e[0];if(i==="init")return _(r);if(i==="generate"){let{runMaestroGenerate:o}=await import("./maestro-generate-XCI4AGEB.js");return o(e.slice(1))}if(i==="start"||i==="keep"||i==="good"||i==="end"||i==="validate")return P(e);e=J(e);let c=null,p;if(i==="test"){let o=e.slice(1).find(f=>!U(f));o?(c=a.resolve(r,o),p=e.slice(1).filter(f=>f!==o)):(c=j(r),p=e.slice(1))}else i&&!U(i)?(c=a.resolve(r,i),p=e.slice(1)):(c=j(r),p=e);if(!c)return console.error(`
95
95
  error: no maestro flows found.
96
96
  expected one of: ${I.map(o=>`./${o}/`).join(", ")}
97
97
  or pass a flow explicitly: rnxsim maestro test path/to/flow.yaml
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as x}from"./chunk-IDFSGLP3.js";import{b as O,d as A,e as E}from"./chunk-YYR4BDUN.js";import{a as S,b as T}from"./chunk-WU3RVT52.js";import"./chunk-BPXOBH2S.js";import"./chunk-R465QKXY.js";import"./chunk-PFQ2GL6I.js";import{f as v}from"./chunk-SRGYFE5A.js";import"./chunk-RKNKWP63.js";import"./chunk-FJIPXIGR.js";import"./chunk-CXKDXNRV.js";import{q as y,s as b}from"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import"./chunk-IXMPQ35S.js";import"./chunk-ENPMBKGL.js";import"./chunk-X5XJUVTI.js";import{mkdtempSync as B,writeFileSync as N}from"fs";import{tmpdir as C}from"os";import{join as k}from"path";var J=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",_=18e3,j=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function V(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var F=new Set(["--origin","--preview-origin","--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]);function G(e){for(let t=0;t<e.length;t++){let r=e[t];if(r){if(F.has(r)){t+=1;continue}if(!r.startsWith("-"))return{prompt:r,index:t}}}return null}function H(e,t){return e.filter((r,o)=>o!==t)}async function Y(e,t){let r=H(e,t),o=y(r,{stripBooleanFlags:["--new","--headless","--headed","--electron","--preview-open"],stripValueFlags:[...F]}),i=b(o);try{let n=await v(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),s=[n.shell?`shell: ${JSON.stringify(n.shell)}`:"",n.keyboard?`keyboard: ${JSON.stringify(n.keyboard)}`:"",typeof n.nodeCount=="number"?`nodes: ${n.nodeCount}`:"",n.tree||""].filter(Boolean).join(`
4
+ import{a as x}from"./chunk-SCFRY5MT.js";import{b as O,d as A,e as E}from"./chunk-CJJI74AT.js";import{a as S,b as T}from"./chunk-3KRC63S4.js";import"./chunk-WFPHEUH2.js";import"./chunk-I44IV7DO.js";import"./chunk-2UDDQL5S.js";import{f as v}from"./chunk-MBRV35BV.js";import"./chunk-EGXHBCDU.js";import"./chunk-BPEXXNXX.js";import"./chunk-A2OABK5V.js";import{q as y,s as b}from"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-KLLX5IWP.js";import"./chunk-M47UITXL.js";import"./chunk-WBPBMC32.js";import{mkdtempSync as B,writeFileSync as N}from"fs";import{tmpdir as C}from"os";import{join as k}from"path";var J=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",_=18e3,j=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function V(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var F=new Set(["--origin","--preview-origin","--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]);function G(e){for(let t=0;t<e.length;t++){let r=e[t];if(r){if(F.has(r)){t+=1;continue}if(!r.startsWith("-"))return{prompt:r,index:t}}}return null}function H(e,t){return e.filter((r,o)=>o!==t)}async function Y(e,t){let r=H(e,t),o=y(r,{stripBooleanFlags:["--new","--headless","--headed","--electron","--preview-open"],stripValueFlags:[...F]}),i=b(o);try{let n=await v(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),s=[n.shell?`shell: ${JSON.stringify(n.shell)}`:"",n.keyboard?`keyboard: ${JSON.stringify(n.keyboard)}`:"",typeof n.nodeCount=="number"?`nodes: ${n.nodeCount}`:"",n.tree||""].filter(Boolean).join(`
5
5
  `);return s.length>_?s.slice(0,_)+`
6
6
  [tree truncated]`:s}finally{i.close()}}var K=`
7
7
  You write Maestro-compatible rnx YAML flows from a user's plain-language test goal.
@@ -32,5 +32,5 @@ ${t||"[no tree available]"}
32
32
 
33
33
  Generate the shortest replayable flow that verifies the goal from this current state.
34
34
  `.trim()}async function z(e){let t=await fetch(`${e.origin.replace(/\/$/,"")}/api/llm`,{method:"POST",headers:{"content-type":"application/json",authorization:e.authHeader},body:JSON.stringify({modelId:J,context:{systemPrompt:K,messages:[{role:"user",content:X(e.prompt,e.describe),timestamp:Date.now()}]},options:{maxTokens:1800,temperature:.2},threadId:null}),signal:AbortSignal.timeout(j)});if(!t.ok||!t.body){let a=await t.text().catch(()=>"");throw new Error(`/api/llm ${t.status}${a?`: ${a}`:""}`)}let r=t.body.getReader(),o=new TextDecoder,i=[],n="",c=a=>{let l=a.trim();if(!l)return;let u=JSON.parse(l);if(u.type==="text_delta"&&u.delta)i.push(u.delta);else if(u.type==="error")throw new Error(u.errorMessage||"llm error")};for(;;){let{value:a,done:l}=await r.read();if(l)break;n+=o.decode(a,{stream:!0});let u;for(;(u=n.indexOf(`
35
- `))>=0;)c(n.slice(0,u)),n=n.slice(u+1)}n+=o.decode(),n.trim()&&c(n);let s=i.join("").trim();if(!s)throw new Error("llm returned an empty test flow");return s}function W(e){let t=e.match(/```(?:json)?\s*([\s\S]*?)```/i),r=t?t[1]:e.slice(e.indexOf("{"),e.lastIndexOf("}")+1);return JSON.parse(r)}function P(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function q(e){let t=W(e);if(!P(t))throw new Error("llm did not return a JSON object");let r=typeof t.summary=="string"&&t.summary.trim()?t.summary.trim().slice(0,500):"rnx generated test",o=t.steps;if(!Array.isArray(o)||o.length===0)throw new Error("llm returned no flow steps");let i=o.map((n,c)=>{if(!P(n))throw new Error(`flow step ${c+1} is not an object`);return n});return{summary:r,steps:i,yamlText:x.stringify(i)}}function Q(e,t,r,o){let i=[r,"--preview","--preview-origin",o,"--billing-kind","test_run"],n=new Set(["--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]),c=new Set(["--new","--headless","--headed","--electron","--preview-open","--no-shell","--shell-only"]);for(let s=0;s<e.length;s++){if(s===t)continue;let a=e[s];if(a==="--origin"||a==="--preview-origin"){s+=1;continue}if(a==="--public-origin"){let l=e[s+1];l&&i.push("--preview-public-origin",l),s+=1;continue}if(n.has(a)){let l=e[s+1];l&&i.push(a,l),s+=1;continue}c.has(a)&&i.push(a)}return i}async function le(e){let t=G(e);if(!t)return console.error(' usage: rnxsim maestro generate "test goal"'),1;let{prompt:r,index:o}=t,i=S();if(!i||i.kind==="github")return console.error(' rnxsim maestro generate "<goal>" needs a login or RNX_API_KEY.'),console.error(" API keys must include preview_upload and llm scopes."),1;let n=T(i),c=await E(V(e,["--origin","--preview-origin"]));console.log(" inspecting current sim\u2026");let s=await Y(e,o);console.log(" generating Maestro flow\u2026");let a=await z({prompt:r,describe:s,origin:c,authHeader:n}),l=q(a),u=B(k(C(),"sootsim-maestro-generate-")),p=k(u,"flow.yaml");N(p,l.yamlText),console.log(` flow: ${p}`);let M=Date.now(),{runFlowPlayback:I,getLastFlowPreviewUploadResult:$,getLastFlowTraceSteps:D}=await import("./flow-QW74XB5M.js"),L=Q(e,o,p,c),w=await I(L),m=$(),h=D(),R=h.find(U=>U.status==="failure"),g=w===0?"passed":"failed",d=await A({origin:c,kind:"maestro",prompt:r,summary:l.summary,status:g,failureMessage:g==="failed"?R?.error??"flow playback failed":null,previewShareId:m?.shareId??null,owner:f(e,"--owner")??null,repo:f(e,"--repo")??null,durationMs:Date.now()-M,flowYamlSizeBytes:Buffer.byteLength(l.yamlText,"utf8"),...O(h),auth:i});return console.log(`
35
+ `))>=0;)c(n.slice(0,u)),n=n.slice(u+1)}n+=o.decode(),n.trim()&&c(n);let s=i.join("").trim();if(!s)throw new Error("llm returned an empty test flow");return s}function W(e){let t=e.match(/```(?:json)?\s*([\s\S]*?)```/i),r=t?t[1]:e.slice(e.indexOf("{"),e.lastIndexOf("}")+1);return JSON.parse(r)}function P(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function q(e){let t=W(e);if(!P(t))throw new Error("llm did not return a JSON object");let r=typeof t.summary=="string"&&t.summary.trim()?t.summary.trim().slice(0,500):"rnx generated test",o=t.steps;if(!Array.isArray(o)||o.length===0)throw new Error("llm returned no flow steps");let i=o.map((n,c)=>{if(!P(n))throw new Error(`flow step ${c+1} is not an object`);return n});return{summary:r,steps:i,yamlText:x.stringify(i)}}function Q(e,t,r,o){let i=[r,"--preview","--preview-origin",o,"--billing-kind","test_run"],n=new Set(["--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]),c=new Set(["--new","--headless","--headed","--electron","--preview-open","--no-shell","--shell-only"]);for(let s=0;s<e.length;s++){if(s===t)continue;let a=e[s];if(a==="--origin"||a==="--preview-origin"){s+=1;continue}if(a==="--public-origin"){let l=e[s+1];l&&i.push("--preview-public-origin",l),s+=1;continue}if(n.has(a)){let l=e[s+1];l&&i.push(a,l),s+=1;continue}c.has(a)&&i.push(a)}return i}async function le(e){let t=G(e);if(!t)return console.error(' usage: rnxsim maestro generate "test goal"'),1;let{prompt:r,index:o}=t,i=S();if(!i||i.kind==="github")return console.error(' rnxsim maestro generate "<goal>" needs a login or RNX_API_KEY.'),console.error(" API keys must include preview_upload and llm scopes."),1;let n=T(i),c=await E(V(e,["--origin","--preview-origin"]));console.log(" inspecting current sim\u2026");let s=await Y(e,o);console.log(" generating Maestro flow\u2026");let a=await z({prompt:r,describe:s,origin:c,authHeader:n}),l=q(a),u=B(k(C(),"sootsim-maestro-generate-")),p=k(u,"flow.yaml");N(p,l.yamlText),console.log(` flow: ${p}`);let M=Date.now(),{runFlowPlayback:I,getLastFlowPreviewUploadResult:$,getLastFlowTraceSteps:D}=await import("./flow-7BSOIPKL.js"),L=Q(e,o,p,c),w=await I(L),m=$(),h=D(),R=h.find(U=>U.status==="failure"),g=w===0?"passed":"failed",d=await A({origin:c,kind:"maestro",prompt:r,summary:l.summary,status:g,failureMessage:g==="failed"?R?.error??"flow playback failed":null,previewShareId:m?.shareId??null,owner:f(e,"--owner")??null,repo:f(e,"--repo")??null,durationMs:Date.now()-M,flowYamlSizeBytes:Buffer.byteLength(l.yamlText,"utf8"),...O(h),auth:i});return console.log(`
36
36
  result: ${g}`),d&&console.log(` run: ${d.id}`),m?.previewUrl&&console.log(` preview: ${m.previewUrl}`),d?.traceUrl&&console.log(` replay: ${d.traceUrl}`),w}export{le as runMaestroGenerate};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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 s,b as r}from"./chunk-XR2ELPIS.js";import"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import"./chunk-IXMPQ35S.js";import"./chunk-X5XJUVTI.js";async function i(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
4
+ import{a as s,b as r}from"./chunk-7JD7XZ6J.js";import"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-KLLX5IWP.js";import"./chunk-WBPBMC32.js";async function i(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
5
5
  rnxsim mode screenshot \u2014 toggle the screenshot-mode chrome overlay
6
6
 
7
7
  usage:
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a,b,c,d}from"./chunk-RKNKWP63.js";import"./chunk-X5XJUVTI.js";export{d as __withOptionalDemoAppsForTests,a as findInternalDemoRegistry,b as loadOptionalDemoApps,c as optionalDemoAppsSync};
4
+ import{a,b,c,d}from"./chunk-EGXHBCDU.js";import"./chunk-WBPBMC32.js";export{d as __withOptionalDemoAppsForTests,a as findInternalDemoRegistry,b as loadOptionalDemoApps,c as optionalDemoAppsSync};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{j as N}from"./chunk-3PKHK6G4.js";import"./chunk-UQAS5DKQ.js";import"./chunk-PPXPG2LH.js";import"./chunk-IDFSGLP3.js";import"./chunk-2664O2SP.js";import"./chunk-JDUNLHV4.js";import"./chunk-FQNDTYZQ.js";import"./chunk-PMSGRATC.js";import"./chunk-MXQNNVV4.js";import"./chunk-PHEOSYZF.js";import"./chunk-XPGHWUUW.js";import"./chunk-BPXOBH2S.js";import"./chunk-R465QKXY.js";import"./chunk-PFQ2GL6I.js";import"./chunk-T3RYRPOL.js";import"./chunk-ADGT4K22.js";import"./chunk-SRGYFE5A.js";import"./chunk-RKNKWP63.js";import"./chunk-XMB5EJKT.js";import"./chunk-GMG63IR6.js";import"./chunk-DXOSLJQ7.js";import"./chunk-6QEYHQZH.js";import"./chunk-3M24TFEF.js";import"./chunk-CLI3SDZR.js";import"./chunk-BYO6P6AW.js";import{q as P,s as R,v as d,w as x}from"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import"./chunk-SOV5SHYG.js";import"./chunk-IXMPQ35S.js";import"./chunk-ENPMBKGL.js";import"./chunk-X5XJUVTI.js";import{mkdirSync as D,writeFileSync as W}from"fs";import{dirname as A,resolve as J}from"path";import{WebSocket as B}from"ws";var C=e=>new Promise(o=>setTimeout(o,e)),S=class{ws;nextId=1;pending=new Map;listeners=new Set;ready;constructor(o){this.ws=new B(o,{maxPayload:1<<28}),this.ready=new Promise((r,n)=>{this.ws.once("open",()=>r()),this.ws.once("error",n)}),this.ws.on("message",r=>{let n=JSON.parse(r.toString());if(n.id&&this.pending.has(n.id)){let{res:t,rej:s}=this.pending.get(n.id);this.pending.delete(n.id),n.error?s(new Error(JSON.stringify(n.error))):t(n.result)}else if(n.method)for(let t of this.listeners)t(n.method,n.params)})}waitOpen(){return this.ready}on(o){this.listeners.add(o)}send(o,r={},n){let t=this.nextId++;return new Promise((s,a)=>{this.pending.set(t,{res:s,rej:a}),this.ws.send(JSON.stringify({id:t,method:o,params:r,...n?{sessionId:n}:{}}))})}close(){try{this.ws.close()}catch{}}};async function O(e,o){let r=Number(h(e,"--duration")??"5");if(!Number.isFinite(r)||r<=0)return console.error(" --duration must be a positive number (seconds)"),1;let n=Number(h(e,"--sample-interval")??"0.1"),t=Number(h(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=h(e,"--match")??"/rn/",a=h(e,"--output")??h(e,"-o"),i=J(process.cwd(),a??"/tmp/sootsim.cpuprofile"),l=[];try{l=await(await fetch(`http://localhost:${t}/json/list`)).json()}catch{return E(t),1}let f=l.find(m=>m.type==="page"&&m.url.includes(s));if(!f)return console.error(` no page target matching "${s}" on CDP :${t}`),console.error(` open targets: ${l.map(m=>m.url).join(", ")||"(none)"}`),1;let u=new S(f.webSocketDebuggerUrl);await u.waitOpen();try{let m=new Map;if(u.on((c,p)=>{c==="Target.attachedToTarget"&&p.targetInfo?.type==="worker"&&m.set(p.sessionId,p.targetInfo.url),c==="Target.detachedFromTarget"&&m.delete(p.sessionId)}),await u.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),await C(500),m.size===0)return console.error(" no worker targets attached \u2014 is the app loaded in this tab?"),1;for(let c of m.keys())await u.send("Profiler.enable",{},c),await u.send("Profiler.setSamplingInterval",{interval:n*1e3},c),await u.send("Profiler.start",{},c);console.log(` recording ${r}s across ${m.size} worker(s) \u2014 interact now\u2026`),await C(r*1e3);let b=[];for(let[c,p]of m){let{profile:y}=await u.send("Profiler.stop",{},c);b.push({url:p,profile:y})}return b.sort((c,p)=>p.profile.samples.length-c.profile.samples.length),D(A(i),{recursive:!0}),b.forEach((c,p)=>{let y=p===0?i:i.replace(/(\.[^.]+)?$/,`.worker${p}$1`);if(W(y,JSON.stringify(c.profile)),console.log(` ${v(c.url)}: ${c.profile.samples.length} samples \u2192 ${y}`),o.verbose&&c.profile.samples.length>0)for(let $ of U(c.profile,12))console.log(` ${$.pct.toFixed(1).padStart(5)}% ${$.name} ${$.url}`)}),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}finally{u.close()}}function E(e){console.error(` perf cpu needs a CDP-enabled browser on :${e}.`),console.error(" the tenant worker can't be profiled via the JS Self-Profiler API (F28),"),console.error(" so the sim must expose Chrome remote debugging. easiest path \u2014"),console.error(" open the sim with a CDP port (it stays driveable over the bridge,"),console.error(" so you can scroll/navigate while profiling):"),console.error(""),console.error(` rnxsim open <metro-port> --new --driver playwright --cdp-port ${e}`),console.error(` rnxsim perf cpu --cdp-port ${e} --match <metro-port>`),console.error(""),console.error(" or launch a standalone CDP Chrome (not bridge-driveable):"),console.error(""),console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\'),console.error(` --remote-debugging-port=${e} --user-data-dir=/tmp/sootsim-cdp \\`),console.error(" --no-sandbox --disable-gpu-sandbox \\"),console.error(" --use-gl=angle --use-angle=metal \\"),console.error(' "http://localhost:5173/rn/<metro-port>" &'),console.error(""),console.error(" override the port with --cdp-port or $SOOTSIM_CDP_PORT.")}function v(e){return e?e.replace(/^https?:\/\/[^/]+/,"").replace(/\?.*$/,"").slice(-50):"(native)"}function U(e,o){let r=e.samples.length||1,n=new Map;for(let t of e.nodes){let s=t.callFrame,a=`${s.functionName||"(anonymous)"}@${v(s.url)}:${s.lineNumber}`,i=n.get(a)??{self:0,name:s.functionName||"(anonymous)",url:`${v(s.url)}:${s.lineNumber}`};i.self+=t.hitCount??0,n.set(a,i)}return[...n.values()].map(t=>({...t,pct:t.self/r*100})).sort((t,s)=>s.self-t.self).slice(0,o)}function h(e,o){let r=e.indexOf(o);if(!(r<0||r===e.length-1))return e[r+1]}function j(){console.log(`
4
+ import{j as N}from"./chunk-GPKK6UQL.js";import"./chunk-3YUHY3RY.js";import"./chunk-AR33KVWV.js";import"./chunk-SCFRY5MT.js";import"./chunk-7D2RLML6.js";import"./chunk-AHITCGHF.js";import"./chunk-JQBAVE6X.js";import"./chunk-4MXBZD2N.js";import"./chunk-6YYK6WL4.js";import"./chunk-YR6HDAQL.js";import"./chunk-X6N6VPFL.js";import"./chunk-WFPHEUH2.js";import"./chunk-I44IV7DO.js";import"./chunk-2UDDQL5S.js";import"./chunk-76E5SSJE.js";import"./chunk-CS2B3W6C.js";import"./chunk-MBRV35BV.js";import"./chunk-EGXHBCDU.js";import"./chunk-2WFJDUEP.js";import"./chunk-LXZJ5VX5.js";import"./chunk-AQYGM454.js";import"./chunk-FCLPIJ6G.js";import"./chunk-A7INKWBI.js";import"./chunk-WBOJVCV7.js";import"./chunk-B6PR6YLO.js";import{q as P,s as R,v as d,w as x}from"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-OUXCE743.js";import"./chunk-KLLX5IWP.js";import"./chunk-M47UITXL.js";import"./chunk-WBPBMC32.js";import{mkdirSync as D,writeFileSync as W}from"fs";import{dirname as A,resolve as J}from"path";import{WebSocket as B}from"ws";var C=e=>new Promise(o=>setTimeout(o,e)),S=class{ws;nextId=1;pending=new Map;listeners=new Set;ready;constructor(o){this.ws=new B(o,{maxPayload:1<<28}),this.ready=new Promise((r,n)=>{this.ws.once("open",()=>r()),this.ws.once("error",n)}),this.ws.on("message",r=>{let n=JSON.parse(r.toString());if(n.id&&this.pending.has(n.id)){let{res:t,rej:s}=this.pending.get(n.id);this.pending.delete(n.id),n.error?s(new Error(JSON.stringify(n.error))):t(n.result)}else if(n.method)for(let t of this.listeners)t(n.method,n.params)})}waitOpen(){return this.ready}on(o){this.listeners.add(o)}send(o,r={},n){let t=this.nextId++;return new Promise((s,a)=>{this.pending.set(t,{res:s,rej:a}),this.ws.send(JSON.stringify({id:t,method:o,params:r,...n?{sessionId:n}:{}}))})}close(){try{this.ws.close()}catch{}}};async function O(e,o){let r=Number(h(e,"--duration")??"5");if(!Number.isFinite(r)||r<=0)return console.error(" --duration must be a positive number (seconds)"),1;let n=Number(h(e,"--sample-interval")??"0.1"),t=Number(h(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=h(e,"--match")??"/rn/",a=h(e,"--output")??h(e,"-o"),i=J(process.cwd(),a??"/tmp/sootsim.cpuprofile"),l=[];try{l=await(await fetch(`http://localhost:${t}/json/list`)).json()}catch{return E(t),1}let f=l.find(m=>m.type==="page"&&m.url.includes(s));if(!f)return console.error(` no page target matching "${s}" on CDP :${t}`),console.error(` open targets: ${l.map(m=>m.url).join(", ")||"(none)"}`),1;let u=new S(f.webSocketDebuggerUrl);await u.waitOpen();try{let m=new Map;if(u.on((c,p)=>{c==="Target.attachedToTarget"&&p.targetInfo?.type==="worker"&&m.set(p.sessionId,p.targetInfo.url),c==="Target.detachedFromTarget"&&m.delete(p.sessionId)}),await u.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),await C(500),m.size===0)return console.error(" no worker targets attached \u2014 is the app loaded in this tab?"),1;for(let c of m.keys())await u.send("Profiler.enable",{},c),await u.send("Profiler.setSamplingInterval",{interval:n*1e3},c),await u.send("Profiler.start",{},c);console.log(` recording ${r}s across ${m.size} worker(s) \u2014 interact now\u2026`),await C(r*1e3);let b=[];for(let[c,p]of m){let{profile:y}=await u.send("Profiler.stop",{},c);b.push({url:p,profile:y})}return b.sort((c,p)=>p.profile.samples.length-c.profile.samples.length),D(A(i),{recursive:!0}),b.forEach((c,p)=>{let y=p===0?i:i.replace(/(\.[^.]+)?$/,`.worker${p}$1`);if(W(y,JSON.stringify(c.profile)),console.log(` ${v(c.url)}: ${c.profile.samples.length} samples \u2192 ${y}`),o.verbose&&c.profile.samples.length>0)for(let $ of U(c.profile,12))console.log(` ${$.pct.toFixed(1).padStart(5)}% ${$.name} ${$.url}`)}),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}finally{u.close()}}function E(e){console.error(` perf cpu needs a CDP-enabled browser on :${e}.`),console.error(" the tenant worker can't be profiled via the JS Self-Profiler API (F28),"),console.error(" so the sim must expose Chrome remote debugging. easiest path \u2014"),console.error(" open the sim with a CDP port (it stays driveable over the bridge,"),console.error(" so you can scroll/navigate while profiling):"),console.error(""),console.error(` rnxsim open <metro-port> --new --driver playwright --cdp-port ${e}`),console.error(` rnxsim perf cpu --cdp-port ${e} --match <metro-port>`),console.error(""),console.error(" or launch a standalone CDP Chrome (not bridge-driveable):"),console.error(""),console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\'),console.error(` --remote-debugging-port=${e} --user-data-dir=/tmp/sootsim-cdp \\`),console.error(" --no-sandbox --disable-gpu-sandbox \\"),console.error(" --use-gl=angle --use-angle=metal \\"),console.error(' "http://localhost:5173/rn/<metro-port>" &'),console.error(""),console.error(" override the port with --cdp-port or $SOOTSIM_CDP_PORT.")}function v(e){return e?e.replace(/^https?:\/\/[^/]+/,"").replace(/\?.*$/,"").slice(-50):"(native)"}function U(e,o){let r=e.samples.length||1,n=new Map;for(let t of e.nodes){let s=t.callFrame,a=`${s.functionName||"(anonymous)"}@${v(s.url)}:${s.lineNumber}`,i=n.get(a)??{self:0,name:s.functionName||"(anonymous)",url:`${v(s.url)}:${s.lineNumber}`};i.self+=t.hitCount??0,n.set(a,i)}return[...n.values()].map(t=>({...t,pct:t.self/r*100})).sort((t,s)=>s.self-t.self).slice(0,o)}function h(e,o){let r=e.indexOf(o);if(!(r<0||r===e.length-1))return e[r+1]}function j(){console.log(`
5
5
  rnxsim perf react \u2014 inspect React component render cost in the tenant worker
6
6
 
7
7
  usage:
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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{q as h,s as w,v as l,w as u}from"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import"./chunk-IXMPQ35S.js";import"./chunk-X5XJUVTI.js";var A=["not-determined","restricted","denied","authorized","limited","provisional","ephemeral","unavailable"],E=["app-tracking-transparency","bluetooth","calendars","camera","contacts","face-id","local-network","location-always","location-when-in-use","media-library","microphone","motion","notifications","photo-library","photo-library-add-only","reminders","siri","speech-recognition"];function b(){console.log(`
4
+ import{q as h,s as w,v as l,w as u}from"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-KLLX5IWP.js";import"./chunk-WBPBMC32.js";var A=["not-determined","restricted","denied","authorized","limited","provisional","ephemeral","unavailable"],E=["app-tracking-transparency","bluetooth","calendars","camera","contacts","face-id","local-network","location-always","location-when-in-use","media-library","microphone","motion","notifications","photo-library","photo-library-add-only","reminders","siri","speech-recognition"];function b(){console.log(`
5
5
  rnxsim permissions \u2014 inspect and change simulated operating-system permissions
6
6
 
7
7
  usage:
@@ -1,12 +1,12 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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 W}from"./chunk-LTKFVWTL.js";import{a as oe}from"./chunk-YYR4BDUN.js";import{a as Z,c as ee}from"./chunk-WU3RVT52.js";import{d as Y}from"./chunk-BPXOBH2S.js";import"./chunk-R465QKXY.js";import"./chunk-PFQ2GL6I.js";import"./chunk-RKNKWP63.js";import"./chunk-FJIPXIGR.js";import"./chunk-CXKDXNRV.js";import{e as X,q as v,s as y,t as Q}from"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import"./chunk-IXMPQ35S.js";import"./chunk-ENPMBKGL.js";import"./chunk-X5XJUVTI.js";import{existsSync as he,mkdirSync as E,readdirSync as be,readFileSync as ve,rmSync as q,writeFileSync as I}from"fs";import{homedir as ye,tmpdir as Se}from"os";import{dirname as z,extname as re,join as F,resolve as $e}from"path";var J=24e4,Re=9e4,xe=3e4;async function D(e,r,o,i){let t=Math.max(2e4,i+xe);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
4
+ import{a as W}from"./chunk-X43U7QEK.js";import{a as oe}from"./chunk-CJJI74AT.js";import{a as Z,c as ee}from"./chunk-3KRC63S4.js";import{d as Y}from"./chunk-WFPHEUH2.js";import"./chunk-I44IV7DO.js";import"./chunk-2UDDQL5S.js";import"./chunk-EGXHBCDU.js";import"./chunk-BPEXXNXX.js";import"./chunk-A2OABK5V.js";import{e as X,q as v,s as y,t as Q}from"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-KLLX5IWP.js";import"./chunk-M47UITXL.js";import"./chunk-WBPBMC32.js";import{existsSync as he,mkdirSync as E,readdirSync as be,readFileSync as ve,rmSync as q,writeFileSync as I}from"fs";import{homedir as ye,tmpdir as Se}from"os";import{dirname as z,extname as re,join as F,resolve as $e}from"path";var J=24e4,Re=9e4,xe=3e4;async function D(e,r,o,i){let t=Math.max(2e4,i+xe);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
5
5
  the capture lock auto-releases, so simply retry the recording.
6
6
  if it persists, recover the sim with \`rnxsim close --sim <id>\`.`),process.exit(1)),/render host not available|already streaming|already recording|lock already held/i.test(s)&&(console.error(` ${o} failed: ${s}
7
7
  a prior recording was abandoned and its capture is still
8
8
  releasing. the lock self-heals in ~${Math.round((i+2e4)/1e3)}s \u2014 retry then, or recover now with
9
- \`rnxsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var _e=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),ke=new Set(["start","stop","cancel","status","prelude-start","upload"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){_e.has(o)&&r++;continue}return ke.has(o)?{name:o,index:r}:null}return null}function te(e){let r=u(e,"--owner")?.trim(),o=u(e,"--repo")?.trim();return(r&&!o||!r&&o)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),r&&o?{owner:r,repo:o}:null}async function He(e,r){let o=Oe(e);if(o){let d=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Te(d,r);return}if(o.name==="prelude-start"){await Ie(d,r);return}if(o.name==="upload"){let{runUpload:S}=await import("./upload-V4SXEM42.js");await S(d,r);return}if(o.name==="stop"){await Pe(d,r);return}if(o.name==="cancel"){await Ne(d,r);return}await Ae(d,r);return}let i=v(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open","--lockstep"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=se(u(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=u(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let c=u(e,"--output"),a=Number(u(e,"--duration")??"10");(!Number.isFinite(a)||a<=0)&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let l=600;a>l&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 exceeds the ${l}s (10m) maximum`),process.exit(1));let m=Number(u(e,"--fps")??"30"),p=u(e,"--frames");if(p!==void 0){let d=Number(p);(!Number.isInteger(d)||d<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let _=e.includes("--open"),k=u(e,"--max-width")?Number(u(e,"--max-width")):void 0;e.includes("--lockstep")&&(console.error(" --lockstep works with `record start` / `record stop` (stateful mode) \u2014 atomic --duration is wall-clock and cannot bound a virtual-time capture"),process.exit(1));let w=Math.max(100,Math.round(a*1e3)),K=u(e,"--origin"),fe=te(e);if(t==="live"||t==="combined"){c&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await W("record",{originOverride:K,allowGitHubAuth:!0});let d=y({...i,commandTimeoutMs:6e4});try{await H(d),await de(d,t),t==="combined"&&await B(d),await ce(d,K,fe);let S=await le(d,t,t==="combined"?n:void 0);S.ok||(console.error(` start failed: recording store refused to start (${t})`+(S.error?`: ${S.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(f=>setTimeout(f,w)),await ue(d);let O=await me(d);pe(O,_,t)}finally{d.close()}return}let A=p?Number(p):null,R=Be(s,c,A);_&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let b=y({...i,commandTimeoutMs:6e4});try{if(await ne(b),await B(b),R==="png"){let x=A??10,h=T(c,`sootsim-frames-${C()}`);c&&re(c)&&console.log(` note: --frames writes multiple pngs, so --output "${c}" is a directory \u2014 frame-NNN.png files land inside it`),E(h,{recursive:!0});for(let g of be(h))/^frame-\d+\.png$/.test(g)&&q(F(h,g),{force:!0});console.log(` sampling ${x} frames over ${a}s \u2192 ${h}`);let $=await b.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${x}, durationMs: ${w}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!$.ok||!$.requestId)&&(console.error(` frame capture start failed: ${$.error??"unknown error"}`),process.exit(1)),await new Promise(g=>setTimeout(g,w));let ge=Date.now()+Math.max(5e3,w),N=null;for(;;){let g=await b.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${$.requestId})`});if(g||(console.error(" frame capture result missing"),process.exit(1)),g.done){g.ok||(console.error(` frame capture failed: ${g.error??"unknown error"}`),process.exit(1)),N=g.frames??[];break}Date.now()>=ge&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(P=>setTimeout(P,100))}N.forEach((g,P)=>{let we=`${h}/frame-${String(P+1).padStart(3,"0")}.png`;I(we,Buffer.from(g.data,"base64"))}),console.log(` saved ${N.length} frames`);return}if(R==="gif"){let x=A??Math.max(10,Math.round(a*m/3)),h=T(c,`sootsim-${C()}.gif`);E(z(h),{recursive:!0}),console.log(` encoding gif: ${x} frames over ${a}s \u2192 ${h}`);let $=await D(b,`window.__sootsimRecorder.captureGif({ frames: ${x}, durationMs: ${w}${k?`, maxWidth: ${k}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",w);$||(console.error(" gif capture returned no frames"),process.exit(1)),I(h,Buffer.from($.data,"base64")),console.log(` saved: ${h} (${L($.size)})`);return}let d=T(c,`sootsim-${C()}.${R}`);E(z(d),{recursive:!0});let S={format:R,fps:m,durationMs:w};n&&(S.layers=n);let O=await D(b,`window.__sootsimRecorder.start(${JSON.stringify(S)})`,`${R} start`,w);O.ok||(console.error(` start failed: ${O.error??"unknown error"}`),/render host not available|already streaming|already recording|lock already held/i.test(O.error??"")&&console.error(" a prior recording was abandoned and its capture is still\n releasing. retry in ~20s, or recover now with\n `rnxsim close --sim <id>` then reopen the sim."),process.exit(1)),console.log(` recording ${R} for ${a}s \u2192 ${d}`),await new Promise(x=>setTimeout(x,w));let f=await D(b,"window.__sootsimRecorder.stop()",`${R} encode/flush`,w);f.ok||(console.error(` stop failed: ${f.error??"unknown error"}`),process.exit(1)),f.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await ie(b,d),console.log(` saved: ${d} (${L(f.size)})`),f.durationMs&&f.frameCount!==void 0&&console.log(` source frames: ${f.frameCount} over ${(f.durationMs/1e3).toFixed(2)}s (${(f.frameCount/(f.durationMs/1e3)).toFixed(1)}fps)`)}finally{b.close()}}var Me=6e3;async function V(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:Me})}catch(o){let i=o instanceof Error?o.message:String(o);throw/^command timed out after \d+s$/.test(i)&&(console.error(" sim did not respond \u2014 it is connected to the bridge but has not\n loaded an app (or its page is unresponsive). run `rnxsim list`\n and target a sim with a loaded app via --sim <id>."),process.exit(1)),o}}async function ne(e){await V(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is rnx engine running in this sim?"),process.exit(1))}async function B(e){let{hidden:r}=await Q(e);r&&(console.error(` refusing to record: the rnx tab is hidden, so frame capture
9
+ \`rnxsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var _e=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),ke=new Set(["start","stop","cancel","status","prelude-start","upload"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){_e.has(o)&&r++;continue}return ke.has(o)?{name:o,index:r}:null}return null}function te(e){let r=u(e,"--owner")?.trim(),o=u(e,"--repo")?.trim();return(r&&!o||!r&&o)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),r&&o?{owner:r,repo:o}:null}async function He(e,r){let o=Oe(e);if(o){let d=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Te(d,r);return}if(o.name==="prelude-start"){await Ie(d,r);return}if(o.name==="upload"){let{runUpload:S}=await import("./upload-OPM4BK5X.js");await S(d,r);return}if(o.name==="stop"){await Pe(d,r);return}if(o.name==="cancel"){await Ne(d,r);return}await Ae(d,r);return}let i=v(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open","--lockstep"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=se(u(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=u(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let c=u(e,"--output"),a=Number(u(e,"--duration")??"10");(!Number.isFinite(a)||a<=0)&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let l=600;a>l&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 exceeds the ${l}s (10m) maximum`),process.exit(1));let m=Number(u(e,"--fps")??"30"),p=u(e,"--frames");if(p!==void 0){let d=Number(p);(!Number.isInteger(d)||d<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let _=e.includes("--open"),k=u(e,"--max-width")?Number(u(e,"--max-width")):void 0;e.includes("--lockstep")&&(console.error(" --lockstep works with `record start` / `record stop` (stateful mode) \u2014 atomic --duration is wall-clock and cannot bound a virtual-time capture"),process.exit(1));let w=Math.max(100,Math.round(a*1e3)),K=u(e,"--origin"),fe=te(e);if(t==="live"||t==="combined"){c&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await W("record",{originOverride:K,allowGitHubAuth:!0});let d=y({...i,commandTimeoutMs:6e4});try{await H(d),await de(d,t),t==="combined"&&await B(d),await ce(d,K,fe);let S=await le(d,t,t==="combined"?n:void 0);S.ok||(console.error(` start failed: recording store refused to start (${t})`+(S.error?`: ${S.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(f=>setTimeout(f,w)),await ue(d);let O=await me(d);pe(O,_,t)}finally{d.close()}return}let A=p?Number(p):null,R=Be(s,c,A);_&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let b=y({...i,commandTimeoutMs:6e4});try{if(await ne(b),await B(b),R==="png"){let x=A??10,h=T(c,`sootsim-frames-${C()}`);c&&re(c)&&console.log(` note: --frames writes multiple pngs, so --output "${c}" is a directory \u2014 frame-NNN.png files land inside it`),E(h,{recursive:!0});for(let g of be(h))/^frame-\d+\.png$/.test(g)&&q(F(h,g),{force:!0});console.log(` sampling ${x} frames over ${a}s \u2192 ${h}`);let $=await b.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${x}, durationMs: ${w}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!$.ok||!$.requestId)&&(console.error(` frame capture start failed: ${$.error??"unknown error"}`),process.exit(1)),await new Promise(g=>setTimeout(g,w));let ge=Date.now()+Math.max(5e3,w),N=null;for(;;){let g=await b.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${$.requestId})`});if(g||(console.error(" frame capture result missing"),process.exit(1)),g.done){g.ok||(console.error(` frame capture failed: ${g.error??"unknown error"}`),process.exit(1)),N=g.frames??[];break}Date.now()>=ge&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(P=>setTimeout(P,100))}N.forEach((g,P)=>{let we=`${h}/frame-${String(P+1).padStart(3,"0")}.png`;I(we,Buffer.from(g.data,"base64"))}),console.log(` saved ${N.length} frames`);return}if(R==="gif"){let x=A??Math.max(10,Math.round(a*m/3)),h=T(c,`sootsim-${C()}.gif`);E(z(h),{recursive:!0}),console.log(` encoding gif: ${x} frames over ${a}s \u2192 ${h}`);let $=await D(b,`window.__sootsimRecorder.captureGif({ frames: ${x}, durationMs: ${w}${k?`, maxWidth: ${k}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",w);$||(console.error(" gif capture returned no frames"),process.exit(1)),I(h,Buffer.from($.data,"base64")),console.log(` saved: ${h} (${L($.size)})`);return}let d=T(c,`sootsim-${C()}.${R}`);E(z(d),{recursive:!0});let S={format:R,fps:m,durationMs:w};n&&(S.layers=n);let O=await D(b,`window.__sootsimRecorder.start(${JSON.stringify(S)})`,`${R} start`,w);O.ok||(console.error(` start failed: ${O.error??"unknown error"}`),/render host not available|already streaming|already recording|lock already held/i.test(O.error??"")&&console.error(" a prior recording was abandoned and its capture is still\n releasing. retry in ~20s, or recover now with\n `rnxsim close --sim <id>` then reopen the sim."),process.exit(1)),console.log(` recording ${R} for ${a}s \u2192 ${d}`),await new Promise(x=>setTimeout(x,w));let f=await D(b,"window.__sootsimRecorder.stop()",`${R} encode/flush`,w);f.ok||(console.error(` stop failed: ${f.error??"unknown error"}`),process.exit(1)),f.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await ie(b,d),console.log(` saved: ${d} (${L(f.size)})`),f.durationMs&&f.frameCount!==void 0&&console.log(` source frames: ${f.frameCount} over ${(f.durationMs/1e3).toFixed(2)}s (${(f.frameCount/(f.durationMs/1e3)).toFixed(1)}fps)`)}finally{b.close()}}var Me=6e3;async function V(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:Me})}catch(o){let i=o instanceof Error?o.message:String(o);throw/^command timed out after \d+s$/.test(i)&&(console.error(" sim did not respond \u2014 it is connected to the bridge but has not\n loaded an app (or its page is unresponsive). run `rnxsim list`\n and target a sim with a loaded app via --sim <id>."),process.exit(1)),o}}async function ne(e){await V(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is rnx engine running in this sim?"),process.exit(1))}async function B(e){let{hidden:r}=await Q(e);r&&(console.error(` refusing to record: the rnx tab is hidden, so frame capture
10
10
  would be throttled to ~1fps and produce a frozen-looking file.
11
11
  bring the chrome window to the foreground (un-minimize / switch to
12
12
  its tab) or run the recording in headless playwright, then retry.`),process.exit(1))}async function ie(e,r){let o=[],i=0;for(;;){let t=await e.send({type:"evaluate",code:`window.__sootsimRecorder.getBlobBase64({ offset: ${i}, chunk: 2097152 })`});if(!t)throw new Error("no blob available on recorder");if(o.push(Buffer.from(t.data,"base64")),i=t.offset,t.done)break}I(r,Buffer.concat(o))}function u(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function Ee(e){if(!e)return;let r=re(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function Be(e,r,o){return e||(o!=null?"png":Ee(r)??"webm")}function C(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function Ue(){let e=F(ye(),".sootsim","recordings");return E(e,{recursive:!0}),e}function T(e,r){return e?$e(process.cwd(),e):F(Ue(),r)}function L(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function se(e){if(!e)return"video";if(e==="video"||e==="live"||e==="combined")return e;console.error(` invalid --mode "${e}" \u2014 expected video | live | combined`),process.exit(1)}function G(){return F(Se(),`sootsim-recording-${X()}.json`)}function U(){let e=G();if(!he(e))return null;try{return{mode:"video",...JSON.parse(ve(e,"utf8"))}}catch{return q(e,{force:!0}),null}}function Ce(e){I(G(),JSON.stringify(e,null,2))}function M(){q(G(),{force:!0})}function j(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as m,b as f}from"./chunk-WU3RVT52.js";import{a as d}from"./chunk-WRA524FO.js";import"./chunk-CXKDXNRV.js";import{J as p}from"./chunk-IXMPQ35S.js";import{a as l}from"./chunk-XSW55GIR.js";import"./chunk-ENPMBKGL.js";import"./chunk-X5XJUVTI.js";import{existsSync as h,readFileSync as w}from"node:fs";import{resolve as b}from"node:path";var R="https://contrast.dev",g=8e3;function v(){return{request:(t,e)=>fetch(t,e),confirmSubmission:d,isInteractive:process.stdin.isTTY===!0,now:()=>new Date,stdout:t=>process.stdout.write(t),stderr:t=>process.stderr.write(t)}}function I(t,e){let n=t.indexOf(e);if(n===-1)return null;let r=t[n+1];if(!r||r.startsWith("-"))throw new Error(`${e} requires a value`);return r}function D(t,e=process.cwd()){let n=I(t,"--app"),r=new Set,s=t.indexOf("--app");s!==-1&&(r.add(s),r.add(s+1));let a=[];for(let c=0;c<t.length;c+=1){if(r.has(c))continue;let u=t[c];if(!(u==="--yes"||u==="-y"||u==="--dry-run")){if(u.startsWith("-"))throw new Error(`unknown flag: ${u}`);a.push(u)}}let i=a.join(" ").trim();if(!i)throw new Error("describe the missing or broken compatibility behavior");if(i.length>g)throw new Error(`description is too long (maximum ${g} characters)`);return{appDir:b(e,n??"."),description:i,dryRun:t.includes("--dry-run"),yes:t.includes("--yes")||t.includes("-y")}}function y(t){if(!t||typeof t!="object")return;let e={};for(let n of Object.keys(t)){let r=Object.getOwnPropertyDescriptor(t,n)?.value;typeof r=="string"&&(e[n]=r)}return e}function O(t){let e=b(t,"package.json");if(!h(e))return null;let n;try{n=JSON.parse(w(e,"utf8"))}catch{throw new Error(`could not parse ${e}`)}if(!n||typeof n!="object")throw new Error(`${e} must contain a JSON object`);let r=Object.getOwnPropertyDescriptor(n,"name")?.value,s=Object.getOwnPropertyDescriptor(n,"dependencies")?.value,a=Object.getOwnPropertyDescriptor(n,"devDependencies")?.value,i=y(s),c=y(a);return{...typeof r=="string"?{name:r}:{},...i?{dependencies:i}:{},...c?{devDependencies:c}:{}}}async function S(t,e=new Date){let n=O(t.appDir),r=n?(await import("./web-I77YJ726.js")).scanDeps(n):null,s=l(),a=p();return{note:t.description,timestamp:e.toISOString(),sootsim_version:a,cli_version:s,bundle:{activeApp:r&&r.projectName!=="unknown"?{appName:r.projectName}:null,reportSource:"cli",runtimeVersion:a,cliVersion:s,platform:process.platform,arch:process.arch,compatibility:r}}}function $(){let t=m(),e=t?.kind==="session"?t.origin.replace(/\/+$/,""):R,n=t&&t.kind!=="github"?f(t):null;return{url:`${e}/api/sootsim/report-issue`,authorization:n}}function k(t){if(!t)return"no package.json found; no compatibility scan attached";let e=t.packages.filter(n=>n.status!=="full"&&n.status!=="not-relevant").length;return`${t.packages.length} React Native ecosystem packages, ${e} needing attention`}function P(t){if(!t||typeof t!="object")return null;let e=Object.getOwnPropertyDescriptor(t,"id")?.value;return typeof e=="string"&&e?e:null}async function V(t,e=v()){let n;try{n=D(t)}catch(o){return e.stderr(` ${o instanceof Error?o.message:String(o)}
4
+ import{a as m,b as f}from"./chunk-3KRC63S4.js";import{a as d}from"./chunk-MWOCKUXA.js";import"./chunk-A2OABK5V.js";import{J as p}from"./chunk-KLLX5IWP.js";import{a as l}from"./chunk-DXAZX6Y4.js";import"./chunk-M47UITXL.js";import"./chunk-WBPBMC32.js";import{existsSync as h,readFileSync as w}from"node:fs";import{resolve as b}from"node:path";var R="https://contrast.dev",g=8e3;function v(){return{request:(t,e)=>fetch(t,e),confirmSubmission:d,isInteractive:process.stdin.isTTY===!0,now:()=>new Date,stdout:t=>process.stdout.write(t),stderr:t=>process.stderr.write(t)}}function I(t,e){let n=t.indexOf(e);if(n===-1)return null;let r=t[n+1];if(!r||r.startsWith("-"))throw new Error(`${e} requires a value`);return r}function D(t,e=process.cwd()){let n=I(t,"--app"),r=new Set,s=t.indexOf("--app");s!==-1&&(r.add(s),r.add(s+1));let a=[];for(let c=0;c<t.length;c+=1){if(r.has(c))continue;let u=t[c];if(!(u==="--yes"||u==="-y"||u==="--dry-run")){if(u.startsWith("-"))throw new Error(`unknown flag: ${u}`);a.push(u)}}let i=a.join(" ").trim();if(!i)throw new Error("describe the missing or broken compatibility behavior");if(i.length>g)throw new Error(`description is too long (maximum ${g} characters)`);return{appDir:b(e,n??"."),description:i,dryRun:t.includes("--dry-run"),yes:t.includes("--yes")||t.includes("-y")}}function y(t){if(!t||typeof t!="object")return;let e={};for(let n of Object.keys(t)){let r=Object.getOwnPropertyDescriptor(t,n)?.value;typeof r=="string"&&(e[n]=r)}return e}function O(t){let e=b(t,"package.json");if(!h(e))return null;let n;try{n=JSON.parse(w(e,"utf8"))}catch{throw new Error(`could not parse ${e}`)}if(!n||typeof n!="object")throw new Error(`${e} must contain a JSON object`);let r=Object.getOwnPropertyDescriptor(n,"name")?.value,s=Object.getOwnPropertyDescriptor(n,"dependencies")?.value,a=Object.getOwnPropertyDescriptor(n,"devDependencies")?.value,i=y(s),c=y(a);return{...typeof r=="string"?{name:r}:{},...i?{dependencies:i}:{},...c?{devDependencies:c}:{}}}async function S(t,e=new Date){let n=O(t.appDir),r=n?(await import("./web-6CSTQ5XL.js")).scanDeps(n):null,s=l(),a=p();return{note:t.description,timestamp:e.toISOString(),sootsim_version:a,cli_version:s,bundle:{activeApp:r&&r.projectName!=="unknown"?{appName:r.projectName}:null,reportSource:"cli",runtimeVersion:a,cliVersion:s,platform:process.platform,arch:process.arch,compatibility:r}}}function $(){let t=m(),e=t?.kind==="session"?t.origin.replace(/\/+$/,""):R,n=t&&t.kind!=="github"?f(t):null;return{url:`${e}/api/sootsim/report-issue`,authorization:n}}function k(t){if(!t)return"no package.json found; no compatibility scan attached";let e=t.packages.filter(n=>n.status!=="full"&&n.status!=="not-relevant").length;return`${t.packages.length} React Native ecosystem packages, ${e} needing attention`}function P(t){if(!t||typeof t!="object")return null;let e=Object.getOwnPropertyDescriptor(t,"id")?.value;return typeof e=="string"&&e?e:null}async function V(t,e=v()){let n;try{n=D(t)}catch(o){return e.stderr(` ${o instanceof Error?o.message:String(o)}
5
5
  usage: rnxsim report-issue [--app <dir>] [--dry-run] [--yes] "<description>"
6
6
  `),1}if(!h(n.appDir))return e.stderr(` directory not found: ${n.appDir}
7
7
  `),1;let r;try{r=await S(n,e.now())}catch(o){return e.stderr(` could not prepare the issue report: ${o instanceof Error?o.message:String(o)}
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.333 | (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-QISLN6DC.js";import"./chunk-CS2B3W6C.js";import"./chunk-MBRV35BV.js";import"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-KLLX5IWP.js";import"./chunk-WBPBMC32.js";export{a as runReset};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.333 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c as a}from"./chunk-MQPGJ54E.js";import"./chunk-4MXBZD2N.js";import"./chunk-2UDDQL5S.js";import"./chunk-FCLPIJ6G.js";import"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-KLLX5IWP.js";import"./chunk-M47UITXL.js";import"./chunk-WBPBMC32.js";export{a as runRuntime};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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 ne,b as se,g as ie}from"./chunk-YZ52AN7N.js";import{a as v}from"./chunk-OKAQ3XRQ.js";import"./chunk-LTKFVWTL.js";import"./chunk-3PKHK6G4.js";import"./chunk-UQAS5DKQ.js";import{a as ee}from"./chunk-PPXPG2LH.js";import{a as te}from"./chunk-IDFSGLP3.js";import"./chunk-2664O2SP.js";import"./chunk-JDUNLHV4.js";import"./chunk-FQNDTYZQ.js";import"./chunk-PMSGRATC.js";import"./chunk-MXQNNVV4.js";import"./chunk-PHEOSYZF.js";import"./chunk-XPGHWUUW.js";import"./chunk-YYR4BDUN.js";import{a as re,b as oe}from"./chunk-WU3RVT52.js";import"./chunk-BPXOBH2S.js";import"./chunk-R465QKXY.js";import"./chunk-PFQ2GL6I.js";import"./chunk-T3RYRPOL.js";import"./chunk-ADGT4K22.js";import{r as Z,s as Q}from"./chunk-SRGYFE5A.js";import"./chunk-RKNKWP63.js";import"./chunk-XMB5EJKT.js";import"./chunk-GMG63IR6.js";import"./chunk-FJIPXIGR.js";import"./chunk-CXKDXNRV.js";import"./chunk-DXOSLJQ7.js";import"./chunk-6QEYHQZH.js";import"./chunk-3M24TFEF.js";import"./chunk-CLI3SDZR.js";import{b as F,e as P,f as j,g as I,h as L,i as U,j as R}from"./chunk-BYO6P6AW.js";import{q as A,r as K,s as B,t as X,u as J,v as M,w as $}from"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import"./chunk-SOV5SHYG.js";import"./chunk-IXMPQ35S.js";import"./chunk-ENPMBKGL.js";import"./chunk-X5XJUVTI.js";import{mkdirSync as ce,writeFileSync as ae}from"fs";import{dirname as ue,resolve as de}from"path";async function pe(e,t){let r=Le(e);(r.includes("--help")||r.includes("-h"))&&(console.log(`
4
+ import{a as ne,b as se,g as ie}from"./chunk-53DWFBL6.js";import{a as v}from"./chunk-CAWZ545B.js";import"./chunk-X43U7QEK.js";import"./chunk-GPKK6UQL.js";import"./chunk-3YUHY3RY.js";import{a as ee}from"./chunk-AR33KVWV.js";import{a as te}from"./chunk-SCFRY5MT.js";import"./chunk-7D2RLML6.js";import"./chunk-AHITCGHF.js";import"./chunk-JQBAVE6X.js";import"./chunk-4MXBZD2N.js";import"./chunk-6YYK6WL4.js";import"./chunk-YR6HDAQL.js";import"./chunk-X6N6VPFL.js";import"./chunk-CJJI74AT.js";import{a as re,b as oe}from"./chunk-3KRC63S4.js";import"./chunk-WFPHEUH2.js";import"./chunk-I44IV7DO.js";import"./chunk-2UDDQL5S.js";import"./chunk-76E5SSJE.js";import"./chunk-CS2B3W6C.js";import{r as Z,s as Q}from"./chunk-MBRV35BV.js";import"./chunk-EGXHBCDU.js";import"./chunk-2WFJDUEP.js";import"./chunk-LXZJ5VX5.js";import"./chunk-BPEXXNXX.js";import"./chunk-A2OABK5V.js";import"./chunk-AQYGM454.js";import"./chunk-FCLPIJ6G.js";import"./chunk-A7INKWBI.js";import"./chunk-WBOJVCV7.js";import{b as F,e as P,f as j,g as I,h as L,i as U,j as R}from"./chunk-B6PR6YLO.js";import{q as A,r as K,s as B,t as X,u as J,v as M,w as $}from"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-OUXCE743.js";import"./chunk-KLLX5IWP.js";import"./chunk-M47UITXL.js";import"./chunk-WBPBMC32.js";import{mkdirSync as ce,writeFileSync as ae}from"fs";import{dirname as ue,resolve as de}from"path";async function pe(e,t){let r=Le(e);(r.includes("--help")||r.includes("-h"))&&(console.log(`
5
5
  rnxsim screenshot \u2014 capture the canvas as a PNG
6
6
 
7
7
  usage:
@@ -156,4 +156,4 @@ examples:
156
156
  await new Promise((r) => setTimeout(r, 40))
157
157
  }
158
158
  return false
159
- })()`,{acquireLock:!0}))throw new Error("could not enable screenshot mode \u2014 is this a browser sim with the screenshot plugin? (electron has no screenshot mode)")}function yt(e){console.log(` ${e.projectName} \u2014 canvas ${e.canvas} (${e.exportSize.width}\xD7${e.exportSize.height}), device ${e.deviceModel}`);for(let t of e.slides){let r=[t.focused?"focused":t.active?"active":null,t.captured?`captured${t.captureMode==="3d"?" 3d":""}`:"no capture"].filter(Boolean).join(", "),i=t.title?`"${t.title}"`:"(no title)",o=[`bg ${t.bgTop}\u2192${t.bgBottom}`,t.titleColor?`color ${t.titleColor}`:null,t.titleSize?`size ${t.titleSize}`:null,t.titleUnderlay?`underlay ${t.titleUnderlay}`:null,t.titleShadow?`shadow ${t.titleShadow}`:null].filter(Boolean).join(", ");console.log(` ${t.index}. ${i} \u2014 ${o} [${r}]`),t.subtitle&&console.log(` ${t.subtitle}`)}}function bt(e){let t=e.match(/^data:[^;]+;base64,(.+)$/);if(!t)throw new Error("export returned an unexpected payload");return Buffer.from(t[1],"base64")}async function Fe(e,t){if(e.includes("--help")||e.includes("-h")){console.log(mt);return}let{rest:r,values:i,json:o}=ft(e),s=A(r,{port:t.port,commandTimeoutMs:45e3}),n=s.positional[0]??"list",a=gt(s.positional[1]),l=Number(s.positional[2]),c=B(s),u=d=>{o?console.log(JSON.stringify(d,null,2)):yt(d)};try{switch(await wt(c),n){case"list":{u(await M(c,"SootSim.bridges.screenshotControl.getState"));break}case"set":{if(a==null)throw new Error("usage: rnxsim screenshot slides set <n> --title \u2026 (see --help)");let d={};for(let m of["title","subtitle","bgTop","bgBottom","titleColor","titleSize","titleUnderlay","titleShadow"])i[m]!=null&&(d[m]=i[m]);if(Object.keys(d).length===0)throw new Error("nothing to set \u2014 pass at least one field (see --help)");u(await $(c,"SootSim.bridges.screenshotControl.setSlide",a,d));break}case"add":{u(await $(c,"SootSim.bridges.screenshotControl.addSlide"));break}case"remove":{if(a==null)throw new Error("usage: rnxsim screenshot slides remove <n>");u(await $(c,"SootSim.bridges.screenshotControl.removeSlide",a));break}case"move":{if(a==null||!Number.isInteger(l)||l<1)throw new Error("usage: rnxsim screenshot slides move <n> <position>");u(await $(c,"SootSim.bridges.screenshotControl.moveSlide",a,l));break}case"focus":{if(a==null)throw new Error("usage: rnxsim screenshot slides focus <n>");u(await $(c,"SootSim.bridges.screenshotControl.focusSlide",a));break}case"overview":{u(await $(c,"SootSim.bridges.screenshotControl.overview"));break}case"capture":{let d=await $(c,"SootSim.bridges.screenshotControl.capture",...a!=null?[a]:[]);u(d);break}case"export":{let d=i.out?dt(i.out)?i.out:pt(process.cwd(),i.out):Ee(process.cwd(),"screenshots"),m=await M(c,"SootSim.bridges.screenshotControl.getState"),h=a!=null?m.slides.filter(p=>p.index===a||p.id===a):m.slides.filter(p=>p.captured);if(h.length===0)throw new Error(a!=null?`no slide ${a}`:"no captured slides to export \u2014 capture first");let w=[];for(let p of h){let y=await M(c,"SootSim.bridges.screenshotControl.exportSlide",p.index),f=Ee(d,y.name);lt(ut(f),{recursive:!0}),ct(f,bt(y.dataUrl)),w.push(f),console.log(` saved: ${f} (${y.width}\xD7${y.height})`)}o&&console.log(JSON.stringify({written:w},null,2));break}default:throw new Error(`unknown subcommand "${n}" \u2014 see rnxsim screenshot slides --help`)}}finally{c.close()}}var St=new Set(["--sim","--port","-p","--output","-o","--out","--plan","--app","--device","--org","--repo","--api-origin","--branch","--platform","--slides","--shell-origin","--timeout","--ids","--out-dir"]),xt=new Set(["capture","slides","appstore","layers"]);function Re(e){for(let t=0;t<e.length;t++){let r=e[t];if(r.startsWith("-")){St.has(r)&&t++;continue}return xt.has(r)?{name:r,index:t}:null}return null}function E(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function Pt(e){let t=[];for(let r=0;r<e.length;r++){if(e[r]==="--sim"){r++;continue}t.push(e[r])}return t}async function xr(e,t){let r=Re(e);if(!r||r.name==="capture"){await pe(r?E(e,r.index):e,t);return}if(r.name==="slides"){await Fe(E(e,r.index),t);return}if(r.name==="layers"){let{runScreenshotLayers:s}=await import("./screenshot-layers-ESNJOBVU.js");await s(E(e,r.index),t);return}let i=E(e,r.index),o=Re(i);if(o?.name==="capture")try{let{runScreenshotsCapture:s}=await import("./screenshots-capture-POJ5L7CV.js");return await s(Pt(E(i,o.index)))}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ERR_MODULE_NOT_FOUND")return console.error("screenshot appstore capture is repo-only tooling \u2014 it needs the rnx workspace (playwright is not shipped with the published CLI)."),1;throw s}return De(i,t)}export{xr as runScreenshotCommand};
159
+ })()`,{acquireLock:!0}))throw new Error("could not enable screenshot mode \u2014 is this a browser sim with the screenshot plugin? (electron has no screenshot mode)")}function yt(e){console.log(` ${e.projectName} \u2014 canvas ${e.canvas} (${e.exportSize.width}\xD7${e.exportSize.height}), device ${e.deviceModel}`);for(let t of e.slides){let r=[t.focused?"focused":t.active?"active":null,t.captured?`captured${t.captureMode==="3d"?" 3d":""}`:"no capture"].filter(Boolean).join(", "),i=t.title?`"${t.title}"`:"(no title)",o=[`bg ${t.bgTop}\u2192${t.bgBottom}`,t.titleColor?`color ${t.titleColor}`:null,t.titleSize?`size ${t.titleSize}`:null,t.titleUnderlay?`underlay ${t.titleUnderlay}`:null,t.titleShadow?`shadow ${t.titleShadow}`:null].filter(Boolean).join(", ");console.log(` ${t.index}. ${i} \u2014 ${o} [${r}]`),t.subtitle&&console.log(` ${t.subtitle}`)}}function bt(e){let t=e.match(/^data:[^;]+;base64,(.+)$/);if(!t)throw new Error("export returned an unexpected payload");return Buffer.from(t[1],"base64")}async function Fe(e,t){if(e.includes("--help")||e.includes("-h")){console.log(mt);return}let{rest:r,values:i,json:o}=ft(e),s=A(r,{port:t.port,commandTimeoutMs:45e3}),n=s.positional[0]??"list",a=gt(s.positional[1]),l=Number(s.positional[2]),c=B(s),u=d=>{o?console.log(JSON.stringify(d,null,2)):yt(d)};try{switch(await wt(c),n){case"list":{u(await M(c,"SootSim.bridges.screenshotControl.getState"));break}case"set":{if(a==null)throw new Error("usage: rnxsim screenshot slides set <n> --title \u2026 (see --help)");let d={};for(let m of["title","subtitle","bgTop","bgBottom","titleColor","titleSize","titleUnderlay","titleShadow"])i[m]!=null&&(d[m]=i[m]);if(Object.keys(d).length===0)throw new Error("nothing to set \u2014 pass at least one field (see --help)");u(await $(c,"SootSim.bridges.screenshotControl.setSlide",a,d));break}case"add":{u(await $(c,"SootSim.bridges.screenshotControl.addSlide"));break}case"remove":{if(a==null)throw new Error("usage: rnxsim screenshot slides remove <n>");u(await $(c,"SootSim.bridges.screenshotControl.removeSlide",a));break}case"move":{if(a==null||!Number.isInteger(l)||l<1)throw new Error("usage: rnxsim screenshot slides move <n> <position>");u(await $(c,"SootSim.bridges.screenshotControl.moveSlide",a,l));break}case"focus":{if(a==null)throw new Error("usage: rnxsim screenshot slides focus <n>");u(await $(c,"SootSim.bridges.screenshotControl.focusSlide",a));break}case"overview":{u(await $(c,"SootSim.bridges.screenshotControl.overview"));break}case"capture":{let d=await $(c,"SootSim.bridges.screenshotControl.capture",...a!=null?[a]:[]);u(d);break}case"export":{let d=i.out?dt(i.out)?i.out:pt(process.cwd(),i.out):Ee(process.cwd(),"screenshots"),m=await M(c,"SootSim.bridges.screenshotControl.getState"),h=a!=null?m.slides.filter(p=>p.index===a||p.id===a):m.slides.filter(p=>p.captured);if(h.length===0)throw new Error(a!=null?`no slide ${a}`:"no captured slides to export \u2014 capture first");let w=[];for(let p of h){let y=await M(c,"SootSim.bridges.screenshotControl.exportSlide",p.index),f=Ee(d,y.name);lt(ut(f),{recursive:!0}),ct(f,bt(y.dataUrl)),w.push(f),console.log(` saved: ${f} (${y.width}\xD7${y.height})`)}o&&console.log(JSON.stringify({written:w},null,2));break}default:throw new Error(`unknown subcommand "${n}" \u2014 see rnxsim screenshot slides --help`)}}finally{c.close()}}var St=new Set(["--sim","--port","-p","--output","-o","--out","--plan","--app","--device","--org","--repo","--api-origin","--branch","--platform","--slides","--shell-origin","--timeout","--ids","--out-dir"]),xt=new Set(["capture","slides","appstore","layers"]);function Re(e){for(let t=0;t<e.length;t++){let r=e[t];if(r.startsWith("-")){St.has(r)&&t++;continue}return xt.has(r)?{name:r,index:t}:null}return null}function E(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function Pt(e){let t=[];for(let r=0;r<e.length;r++){if(e[r]==="--sim"){r++;continue}t.push(e[r])}return t}async function xr(e,t){let r=Re(e);if(!r||r.name==="capture"){await pe(r?E(e,r.index):e,t);return}if(r.name==="slides"){await Fe(E(e,r.index),t);return}if(r.name==="layers"){let{runScreenshotLayers:s}=await import("./screenshot-layers-ND2HKCLN.js");await s(E(e,r.index),t);return}let i=E(e,r.index),o=Re(i);if(o?.name==="capture")try{let{runScreenshotsCapture:s}=await import("./screenshots-capture-YIHKMGYF.js");return await s(Pt(E(i,o.index)))}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ERR_MODULE_NOT_FOUND")return console.error("screenshot appstore capture is repo-only tooling \u2014 it needs the rnx workspace (playwright is not shipped with the published CLI)."),1;throw s}return De(i,t)}export{xr as runScreenshotCommand};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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 S}from"./chunk-PPXPG2LH.js";import"./chunk-FQNDTYZQ.js";import"./chunk-T3RYRPOL.js";import{r as b,s as I}from"./chunk-SRGYFE5A.js";import"./chunk-CLI3SDZR.js";import{b as m}from"./chunk-BYO6P6AW.js";import{q as y,s as v,v as w}from"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import"./chunk-IXMPQ35S.js";import"./chunk-X5XJUVTI.js";import{mkdirSync as B,writeFileSync as R}from"fs";import{resolve as f}from"path";async function L(s,$){(s.includes("--help")||s.includes("-h"))&&(console.log(`
4
+ import{a as S}from"./chunk-AR33KVWV.js";import"./chunk-JQBAVE6X.js";import"./chunk-76E5SSJE.js";import{r as b,s as I}from"./chunk-MBRV35BV.js";import"./chunk-WBOJVCV7.js";import{b as m}from"./chunk-B6PR6YLO.js";import{q as y,s as v,v as w}from"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-KLLX5IWP.js";import"./chunk-WBPBMC32.js";import{mkdirSync as B,writeFileSync as R}from"fs";import{resolve as f}from"path";async function L(s,$){(s.includes("--help")||s.includes("-h"))&&(console.log(`
5
5
  sootsim screenshot layers \u2014 export a screen as engine-isolated layers
6
6
 
7
7
  usage:
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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 U}from"./chunk-OKAQ3XRQ.js";import{a as M}from"./chunk-WU3RVT52.js";import"./chunk-CXKDXNRV.js";import"./chunk-IXMPQ35S.js";import{a as F}from"./chunk-ENPMBKGL.js";import"./chunk-X5XJUVTI.js";import{execSync as N}from"node:child_process";import{mkdirSync as O,mkdtempSync as E,rmSync as j,writeFileSync as G}from"node:fs";import{tmpdir as q}from"node:os";import{dirname as B,isAbsolute as L,join as I,resolve as z}from"node:path";import{chromium as W}from"playwright-core";var H=`
4
+ import{b as U}from"./chunk-CAWZ545B.js";import{a as M}from"./chunk-3KRC63S4.js";import"./chunk-A2OABK5V.js";import"./chunk-KLLX5IWP.js";import{a as F}from"./chunk-M47UITXL.js";import"./chunk-WBPBMC32.js";import{execSync as N}from"node:child_process";import{mkdirSync as O,mkdtempSync as E,rmSync as j,writeFileSync as G}from"node:fs";import{tmpdir as q}from"node:os";import{dirname as B,isAbsolute as L,join as I,resolve as z}from"node:path";import{chromium as W}from"playwright-core";var H=`
5
5
  rnxsim screenshot appstore capture \u2014 headlessly capture + upload App Store slides
6
6
 
7
7
  usage:
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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 ye,c as J,d as ve,e as V,f as be,h as we,i as P,j as Ae,k as Te,l as Ce,m as ke,q as Ie,t as C,u as Ee,v as Pe,w as Re,x as xe}from"./chunk-6MWOPKCZ.js";import"./chunk-XY6S3SA5.js";import{a as pe,b as me,d as he,e as L,f as fe}from"./chunk-JDUNLHV4.js";import{e as Se}from"./chunk-YYR4BDUN.js";import"./chunk-WU3RVT52.js";import{d as ge}from"./chunk-BPXOBH2S.js";import{g as _}from"./chunk-R465QKXY.js";import"./chunk-PFQ2GL6I.js";import"./chunk-RKNKWP63.js";import{a as F,b as G,c as ae,d as ce}from"./chunk-FJIPXIGR.js";import"./chunk-CXKDXNRV.js";import{f as O}from"./chunk-6QEYHQZH.js";import{c as le,d as ue}from"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import{A as W,B as Y,G as Z,I as x,J as $,K as Q,L as ee,M as te,O as ie,R as re,S as ne,T as se,U as j,V as oe,g as z,h as q,r as X}from"./chunk-IXMPQ35S.js";import{a as de}from"./chunk-XSW55GIR.js";import"./chunk-ENPMBKGL.js";import"./chunk-X5XJUVTI.js";import{spawn as wt}from"child_process";import T from"fs";import{createServer as At}from"http";import b from"path";import{WebSocket as S,WebSocketServer as Tt}from"ws";import _e from"node:fs";import M from"node:path";import{spawn as qe}from"node:child_process";function Xe(a){return typeof a.text=="string"?a.text.trim():""}function Ye(a){let e=a?.trim();return e||"tm"}async function Oe(a){let e=a.sessionId.trim();if(!G(e))throw new Error(`invalid Team Machine session id: ${e||"<empty>"}`);let t=Xe(a.prompt);if(!t)throw new Error("prompt text is empty");let i=Ye(a.command),s=a.timeoutMs??15e3;await new Promise((n,c)=>{let r=qe(i,["send",e,t],{stdio:["ignore","ignore","pipe"],env:process.env}),o="",l=setTimeout(()=>{try{r.kill("SIGTERM")}catch{}c(new Error(`tm send timed out after ${Math.round(s/1e3)}s`))},s);r.stderr?.setEncoding("utf8"),r.stderr?.on("data",d=>{o.length<4e3&&(o+=String(d))}),r.on("error",d=>{clearTimeout(l),c(d)}),r.on("exit",(d,u)=>{if(clearTimeout(l),d===0){n();return}let p=o.trim();c(new Error(p||`tm send exited with ${u?`signal ${u}`:`code ${d??"unknown"}`}`))})})}var B=1,Ze=25;function Qe(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_R2||9500)].filter(a=>Number.isFinite(a)&&a>0)}var D=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;pendingSessionStates=new Map;pendingSessionPatches=new Map;sessionStatusPersistTimer=null;opts;constructor(e={}){this.opts=e}registerSocket(e){this.allSockets.add(e)}unregisterSocket(e){let t=this.sessionsBySocket.get(e);if(t){for(let i of t)this.decrementSubscription(i);this.sessionsBySocket.delete(e)}this.allSockets.delete(e)}async handleMessage(e,t){let i=t?.type;if(typeof i!="string"||!i.startsWith("agent:"))return!1;let s=t.id;try{let n=await this.dispatch(e,i,t);this.respond(e,s,n)}catch(n){n instanceof C?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await ke()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
4
+ import{b as ye,c as J,d as ve,e as V,f as be,h as we,i as P,j as Ae,k as Te,l as Ce,m as ke,q as Ie,t as C,u as Ee,v as Pe,w as Re,x as xe}from"./chunk-F7J4G76K.js";import"./chunk-2SAWRX3C.js";import{a as pe,b as me,d as he,e as L,f as fe}from"./chunk-AHITCGHF.js";import{e as Se}from"./chunk-CJJI74AT.js";import"./chunk-3KRC63S4.js";import{d as ge}from"./chunk-WFPHEUH2.js";import{g as _}from"./chunk-I44IV7DO.js";import"./chunk-2UDDQL5S.js";import"./chunk-EGXHBCDU.js";import{a as F,b as G,c as ae,d as ce}from"./chunk-BPEXXNXX.js";import"./chunk-A2OABK5V.js";import{f as O}from"./chunk-FCLPIJ6G.js";import{c as le,d as ue}from"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import{A as W,B as Y,G as Z,I as x,J as $,K as Q,L as ee,M as te,O as ie,R as re,S as ne,T as se,U as j,V as oe,g as z,h as q,r as X}from"./chunk-KLLX5IWP.js";import{a as de}from"./chunk-DXAZX6Y4.js";import"./chunk-M47UITXL.js";import"./chunk-WBPBMC32.js";import{spawn as wt}from"child_process";import T from"fs";import{createServer as At}from"http";import b from"path";import{WebSocket as S,WebSocketServer as Tt}from"ws";import _e from"node:fs";import M from"node:path";import{spawn as qe}from"node:child_process";function Xe(a){return typeof a.text=="string"?a.text.trim():""}function Ye(a){let e=a?.trim();return e||"tm"}async function Oe(a){let e=a.sessionId.trim();if(!G(e))throw new Error(`invalid Team Machine session id: ${e||"<empty>"}`);let t=Xe(a.prompt);if(!t)throw new Error("prompt text is empty");let i=Ye(a.command),s=a.timeoutMs??15e3;await new Promise((n,c)=>{let r=qe(i,["send",e,t],{stdio:["ignore","ignore","pipe"],env:process.env}),o="",l=setTimeout(()=>{try{r.kill("SIGTERM")}catch{}c(new Error(`tm send timed out after ${Math.round(s/1e3)}s`))},s);r.stderr?.setEncoding("utf8"),r.stderr?.on("data",d=>{o.length<4e3&&(o+=String(d))}),r.on("error",d=>{clearTimeout(l),c(d)}),r.on("exit",(d,u)=>{if(clearTimeout(l),d===0){n();return}let p=o.trim();c(new Error(p||`tm send exited with ${u?`signal ${u}`:`code ${d??"unknown"}`}`))})})}var B=1,Ze=25;function Qe(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_R2||9500)].filter(a=>Number.isFinite(a)&&a>0)}var D=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;pendingSessionStates=new Map;pendingSessionPatches=new Map;sessionStatusPersistTimer=null;opts;constructor(e={}){this.opts=e}registerSocket(e){this.allSockets.add(e)}unregisterSocket(e){let t=this.sessionsBySocket.get(e);if(t){for(let i of t)this.decrementSubscription(i);this.sessionsBySocket.delete(e)}this.allSockets.delete(e)}async handleMessage(e,t){let i=t?.type;if(typeof i!="string"||!i.startsWith("agent:"))return!1;let s=t.id;try{let n=await this.dispatch(e,i,t);this.respond(e,s,n)}catch(n){n instanceof C?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await ke()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
5
5
  `)}}close(){this.sessionStatusPersistTimer&&(clearTimeout(this.sessionStatusPersistTimer),this.sessionStatusPersistTimer=null),this.flushSessionStatuses();for(let e of this.subscriptions.values())try{e.unsubscribe()}catch{}this.subscriptions.clear(),this.sessionsBySocket.clear(),this.allSockets.clear()}async dispatch(e,t,i){switch(t){case"agent:list-projects":return V();case"agent:upsert-project":return J(i.input??{});case"agent:delete-project":return we(String(i.projectId)),{ok:!0};case"agent:auto-attach-for-url":return this.autoAttachForUrl(i.input??{});case"agent:list-sessions":return Ae(i.projectId?String(i.projectId):void 0);case"agent:start-session":return this.doStartSession(i.input??{});case"agent:send-claimed-prompt":return this.sendClaimedPrompt(i);case"agent:send-prompt":{let n=String(i.sessionId),c=P(n);if(!c)throw new C("NO_SESSION",`no session: ${n}`);let r=this.normalizePromptEnvelope(i);return await Pe(n,r),this.notePromptAccepted(n,r,c.status==="working")}case"agent:end-session":this.dropSessionFanout(String(i.sessionId)),await Re(String(i.sessionId));let s=P(String(i.sessionId));return s&&this.broadcastSessionStatus(s),{ok:!0};case"agent:get-transcript":return this.getTranscript(String(i.sessionId));case"agent:get-paths":return this.getPaths();case"agent:subscribe-events":return this.subscribeSocket(e,String(i.sessionId));case"agent:unsubscribe-events":return this.unsubscribeSocket(e,String(i.sessionId));default:throw new C("UNKNOWN_AGENT_MSG",`unknown agent message: ${t}`)}}async sendClaimedPrompt(e){let t=typeof e.simId=="string"?e.simId.trim():"";if(!t)throw new C("NO_SIM","agent:send-claimed-prompt requires simId");let i=this.opts.resolveCliLease?.(t)??null;if(!i||i.kind!=="cli"||i.expiresAt<=Date.now())throw new C("NO_CLAIM",`sim ${t} has no active CLI claim`);let s=F(i.cliIdentityKey);if(!s)throw new C("UNSUPPORTED_CLAIM",`sim ${t} is claimed by a CLI identity that is not promptable`);return await Oe({sessionId:s,prompt:this.normalizePromptEnvelope(e)}),{ok:!0,routed:"team-machine",sessionId:s}}async doStartSession(e){if(!ve(e.projectId))throw new C("NO_PROJECT",`no project: ${e.projectId}`);let i=await Ee(e);return this.broadcastSessionStatus(i.session),i}async autoAttachForUrl(e){let t=e.bundleUrl??"",i=(()=>{try{return new URL(t).port||null}catch{return null}})();if(!i)return{project:null};let s=this.opts.getExcludePorts?.()??Qe(),c=(await _({excludePorts:s})).find(d=>String(d.port)===i);if(!c||!c.cwd)return{project:null};let r=V().find(d=>d.cwd===c.cwd)??null,o=Array.from(new Set([...r?.knownBundleUrls??[],c.bundleUrl,t]));return{project:J({cwd:c.cwd,name:c.projectName??M.basename(c.cwd),preferredProvider:e.provider??r?.preferredProvider,sourceRoots:r?.sourceRoots??[c.cwd],knownBundleUrls:o,framework:r?.framework??et(c.framework),bundleId:c.bundleId??r?.bundleId})}}getTranscript(e){let t=Ie(e);return _e.existsSync(t)?_e.readFileSync(t,"utf8"):{error:"transcript not found",code:"NO_TRANSCRIPT"}}getPaths(){let e=ye();return{userDataDir:e,storeFile:M.join(e,"attached-projects.json"),sessionsDir:M.join(e,"sessions"),transcriptsDir:M.join(e,"transcripts")}}subscribeSocket(e,t){let i=this.sessionsBySocket.get(e);if(i||(i=new Set,this.sessionsBySocket.set(e,i)),i.has(t))return{ok:!0,refCount:this.subscriptions.get(t)?.refCount??1};i.add(t);let s=this.subscriptions.get(t);if(s)return s.refCount++,{ok:!0,refCount:s.refCount};let n=xe(t,c=>{let r=this.coalescePromptEcho(t,c);if(r&&(this.applySessionEvent(t,r),this.fanOutEvent(t,r)),c.type==="turn-completed"){let o=P(t);if(o)try{be(o.projectId,{usd:c.costUsd,ts:c.ts})}catch(l){process.stderr.write(`[sootsim-agent] recordTurnTelemetry failed: ${l instanceof Error?l.message:String(l)}
6
6
  `)}}});return this.subscriptions.set(t,{unsubscribe:n,refCount:1}),{ok:!0,refCount:1}}unsubscribeSocket(e,t){let i=this.sessionsBySocket.get(e);return!i||!i.has(t)?{ok:!0,refCount:0}:(i.delete(t),this.decrementSubscription(t))}decrementSubscription(e){let t=this.subscriptions.get(e);if(!t)return{ok:!0,refCount:0};if(t.refCount--,t.refCount<=0){try{t.unsubscribe()}catch{}return this.subscriptions.delete(e),{ok:!0,refCount:0}}return{ok:!0,refCount:t.refCount}}dropSessionFanout(e){let t=this.subscriptions.get(e);if(t){try{t.unsubscribe()}catch{}this.subscriptions.delete(e)}for(let i of this.sessionsBySocket.values())i.delete(e);this.clearPromptTracking(e)}normalizePromptEnvelope(e){if(e?.prompt&&typeof e.prompt=="object"){let t=e.prompt;return{text:String(t.text??""),...typeof t.displayText=="string"?{displayText:t.displayText}:{},...typeof t.inspectSummary=="string"?{inspectSummary:t.inspectSummary}:{},...typeof t.inspectTrace=="string"?{inspectTrace:t.inspectTrace}:{}}}return{text:String(e?.text??""),...typeof e?.displayText=="string"?{displayText:e.displayText}:{},...typeof e?.inspectSummary=="string"?{inspectSummary:e.inspectSummary}:{},...typeof e?.inspectTrace=="string"?{inspectTrace:e.inspectTrace}:{}}}notePromptAccepted(e,t,i){let s=Date.now(),n=this.pendingPromptEchoes.get(e)??[];n.push({sentAt:s}),this.pendingPromptEchoes.set(e,n);let c=Math.max(this.pendingTurns.get(e)??0,i?1:0)+1;this.pendingTurns.set(e,c);let r=t.displayText??t.text;return this.patchSession(e,{lastPrompt:r,status:"working",needsAttention:!1}),this.fanOutEvent(e,{type:"prompt-received",text:r,...t.inspectSummary?{inspectSummary:t.inspectSummary}:{},...t.inspectTrace?{inspectTrace:t.inspectTrace}:{},ts:s}),{ok:!0,queued:c>1,pendingTurns:c,queueDepth:Math.max(0,c-1)}}applySessionEvent(e,t){switch(t.type){case"prompt-received":case"turn-started":this.patchSession(e,{status:"working",needsAttention:!1});return;case"turn-completed":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"idle",needsAttention:!1,lastTurnFiles:t.filesTouched,currentlyEditing:void 0});return}case"approval-needed":this.patchSession(e,{status:"needs-attention",needsAttention:!0});return;case"error":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"needs-attention",needsAttention:i<=0,currentlyEditing:void 0});return}case"exited":this.clearPromptTracking(e),this.patchSession(e,{status:"ended",needsAttention:!1,wrapperPid:void 0,currentlyEditing:void 0});return;case"ready":case"turn-reasoning":case"turn-message":case"turn-plan":case"tool-call":case"file-edited":case"file-diff-delta":return}}patchSession(e,t){let i=this.pendingSessionStates.get(e)??P(e);if(!i)return;let s=Te(i,t);this.pendingSessionStates.set(e,s),this.pendingSessionPatches.set(e,{...this.pendingSessionPatches.get(e),...t}),this.broadcastSessionStatus(s),!this.sessionStatusPersistTimer&&(this.sessionStatusPersistTimer=setTimeout(()=>{this.sessionStatusPersistTimer=null,this.flushSessionStatuses()},Ze))}flushSessionStatuses(){if(this.pendingSessionPatches.size===0)return;let e=this.pendingSessionStates,t=this.pendingSessionPatches;this.pendingSessionStates=new Map,this.pendingSessionPatches=new Map;try{Ce([...t].map(([i,s])=>({id:i,patch:s})))}catch(i){for(let[s,n]of e)this.pendingSessionStates.has(s)||this.pendingSessionStates.set(s,n);for(let[s,n]of t)this.pendingSessionPatches.set(s,{...n,...this.pendingSessionPatches.get(s)});process.stderr.write(`[sootsim-agent] session status persistence failed: ${i instanceof Error?i.message:String(i)}
7
7
  `)}}coalescePromptEcho(e,t){if(t.type!=="prompt-received")return t;let i=this.pendingPromptEchoes.get(e);if(!i||i.length===0)return t;for(;i.length>0&&Date.now()-i[0].sentAt>15e3;)i.shift();return i.length===0?(this.pendingPromptEchoes.delete(e),t):(i.shift(),i.length===0?this.pendingPromptEchoes.delete(e):this.pendingPromptEchoes.set(e,i),null)}consumeSettledTurn(e){let t=Math.max(0,(this.pendingTurns.get(e)??1)-1);return t>0?this.pendingTurns.set(e,t):this.pendingTurns.delete(e),t}clearPromptTracking(e){this.pendingPromptEchoes.delete(e),this.pendingTurns.delete(e)}fanOutEvent(e,t){let i=JSON.stringify({type:"agent:event",sessionId:e,event:t});for(let[s,n]of this.sessionsBySocket)if(n.has(e)&&s.readyState===B)try{s.send(i)}catch{}}broadcastSessionStatus(e){let t=JSON.stringify({type:"agent:session-status",session:e});for(let i of this.allSockets)if(i.readyState===B)try{i.send(t)}catch{}}respond(e,t,i){if(e.readyState===B)try{e.send(JSON.stringify({id:t,result:i}))}catch{}}respondError(e,t,i,s){if(e.readyState===B)try{e.send(JSON.stringify({id:t,error:i,...s?{code:s}:{}}))}catch{}}};function et(a){return a==="expo"?"expo":a==="one"||a==="vxrn"?"one":"unknown"}import Me from"http";import Be from"https";import{finished as rt,pipeline as nt}from"stream/promises";var K="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36",tt=[{hostSuffix:"uniswap.org",headers:{origin:"https://app.uniswap.org",referer:"https://app.uniswap.org/"},suppressBrowserUserAgent:!0}];function it(a){let e=a.toLowerCase();for(let t of tt)if(e===t.hostSuffix||e.endsWith(`.${t.hostSuffix}`))return t}function Le(a){let e=it(a.hostname);return{"accept-encoding":"identity",...e?.suppressBrowserUserAgent?{}:{"user-agent":K},...e?.headers}}var st=new Set(["host","origin","referer","user-agent","accept-encoding","cookie","connection","keep-alive","transfer-encoding","upgrade","content-length","sec-fetch-site","sec-fetch-mode","sec-fetch-dest","sec-ch-ua","sec-ch-ua-mobile","sec-ch-ua-platform"]),ot={"access-control-allow-origin":"*","access-control-allow-methods":"GET,POST,PUT,DELETE,PATCH,OPTIONS","access-control-allow-headers":"*","access-control-expose-headers":"*","access-control-max-age":"3600"},at=new Set(["host","origin","referer","sec-fetch-site","sec-fetch-mode","sec-fetch-dest"]);function De(a){return a.protocol!=="https:"?{}:pe(a.hostname)?{rejectUnauthorized:!1}:{}}function R(a){for(let[e,t]of Object.entries(ot))a.setHeader(e,t)}function ct(a,e){let t=[],i=e;i?.code&&t.push(i.code),i?.message&&t.push(i.message),i?.cause?.code&&t.push(i.cause.code),i?.cause?.message&&t.push(i.cause.message);let n=[...new Set(t.filter(Boolean))].join(" | ")||String(e);return a.includes("stored-in-.env.local")?`${n} | upstream url still contains placeholder env values`:n}function dt(a,e){let t={};for(let[i,s]of Object.entries(a))s&&(st.has(i.toLowerCase())||(t[i]=Array.isArray(s)?s.join(", "):s));return Object.assign(t,e?Le(e):{"user-agent":K}),t}function lt(a,e){let t={};for(let[i,s]of Object.entries(a))s&&(at.has(i.toLowerCase())||(t[i]=s));return t.host=e.host,t.origin=e.origin,t.referer=`${e.origin}/`,t}function Ne(a){return a?.startsWith("/__fetch-proxy?")||a?.startsWith("/__proxy?")||!1}function He(a){return a?!!(a.startsWith("/__app-api?")||a.startsWith("/__app-api/")):!1}async function Ue(a,e){if(a.method==="OPTIONS"){R(e),e.writeHead(204),e.end();return}let i=new URLSearchParams((a.url||"").split("?")[1]||"").get("url");if(!i){R(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("missing url param");return}let s;try{s=new URL(i)}catch{R(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("invalid url param");return}let n;if(a.method!=="GET"&&a.method!=="HEAD"){let o=[];for await(let l of a)o.push(Buffer.isBuffer(l)?l:Buffer.from(l));o.length>0&&(n=Buffer.concat(o))}let c=a.method||"GET",r=async(o,l,d,u)=>{let p=o.protocol==="https:"?Be:Me,m=dt(a.headers,o);o.origin!==s.origin&&(delete m.authorization,delete m["proxy-authorization"]),l==="GET"||l==="HEAD"?(delete m["content-length"],delete m["content-type"]):d&&(m["content-length"]=String(d.byteLength));let f=await new Promise((w,A)=>{let y=p.request({hostname:o.hostname,port:o.port||(o.protocol==="https:"?443:80),path:o.pathname+o.search,method:l,headers:m,...De(o)},w),I=()=>y.destroy(new Error("fetch proxy client disconnected"));a.once("aborted",I),y.once("close",()=>a.off("aborted",I)),y.once("error",A),d===void 0?y.end():y.end(d)}),h=f.statusCode??502,g=f.headers.location;if(g&&(h===301||h===302||h===303||h===307||h===308)){if(u>=10)throw f.destroy(),new Error("too many redirects");let w=(h===301||h===302)&&l==="POST"||h===303&&l!=="GET"&&l!=="HEAD",A=new URL(g,o);f.resume(),await rt(f),await r(A,w?"GET":l,w?void 0:d,u+1);return}for(let[w,A]of Object.entries(f.headers)){let y=w.toLowerCase();A===void 0||y==="set-cookie"||y==="connection"||y==="keep-alive"||y==="proxy-authenticate"||y==="proxy-authorization"||y==="te"||y==="trailer"||y==="transfer-encoding"||y==="upgrade"||y.startsWith("access-control-")||e.setHeader(w,A)}R(e);let v=f.headers["set-cookie"]??[];v.length>0&&e.setHeader("x-sootsim-set-cookie",(Array.isArray(v)?v:[v]).join(", ")),e.statusCode=h,await nt(f,e)};try{await r(s,c,n,0)}catch(o){if(e.headersSent){e.destroy(o instanceof Error?o:new Error(String(o)));return}R(e),e.writeHead(502,{"Content-Type":"text/plain"}),e.end(`fetch proxy error: ${ct(s.href,o)}`)}}function Fe(a,e){let t=a.url||"",i="",s="";if(t.startsWith("/__app-api?")){let l=new URL(t,"http://sootsim.local");i=l.searchParams.get("path")||"",s=l.searchParams.get("origin")?.trim()||""}else if(t.startsWith("/__app-api/"))i=t.slice(10);else return!1;if(!s)return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: missing origin query param"),!0;if(a.method==="OPTIONS")return e.writeHead(204,{"Access-Control-Allow-Origin":a.headers.origin||"*","Access-Control-Allow-Methods":"GET,POST,PUT,PATCH,DELETE,OPTIONS","Access-Control-Allow-Headers":a.headers["access-control-request-headers"]||"*","Access-Control-Allow-Credentials":"true","Access-Control-Max-Age":"86400"}),e.end(),!0;let n;try{n=new URL(i,s)}catch{return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: invalid origin or path"),!0}let c=n.protocol==="https:"?Be:Me,r=lt(a.headers,n),o=c.request({hostname:n.hostname,port:n.port||(n.protocol==="https:"?443:80),path:n.pathname+n.search,method:a.method,headers:r,...De(n)},l=>{let d=Object.keys(l.headers).filter(u=>{let p=u.toLowerCase();return!p.startsWith("access-control-")&&p!=="set-cookie"}).join(", ");e.writeHead(l.statusCode??502,{...l.headers,"access-control-allow-origin":a.headers.origin||"*","access-control-allow-credentials":"true","access-control-expose-headers":d}),l.pipe(e)});return o.on("error",l=>{e.statusCode=502,e.end(`app proxy error: ${l.message}`)}),a.pipe(o),!0}import{WebSocket as k,WebSocketServer as ut}from"ws";var pt="/__websocket-proxy",mt=new Set(["host","connection","upgrade","transfer-encoding","content-length","sec-websocket-accept","sec-websocket-extensions","sec-websocket-key","sec-websocket-protocol","sec-websocket-version"]);function E(a,e,t){try{a.write(`HTTP/1.1 ${e} ${t}\r
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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 d}from"./chunk-WRA524FO.js";import{d as V,f as q,g as J,i as F,j as B}from"./chunk-XCAWIFDN.js";import{b as x,c as L}from"./chunk-HEY3X6S5.js";import{c as k}from"./chunk-FJIPXIGR.js";import"./chunk-CXKDXNRV.js";import{f as y}from"./chunk-6QEYHQZH.js";import"./chunk-5R5FCLE4.js";import"./chunk-C53ASFDC.js";import"./chunk-3M24TFEF.js";import"./chunk-CLI3SDZR.js";import"./chunk-BYO6P6AW.js";import"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import"./chunk-SOV5SHYG.js";import{C as R,D as C,J as w,M as N,O as I,l as v}from"./chunk-IXMPQ35S.js";import{a as T}from"./chunk-XSW55GIR.js";import{a as s}from"./chunk-ENPMBKGL.js";import"./chunk-CJJFG5KQ.js";import"./chunk-X5XJUVTI.js";import $ from"node:fs";import z from"node:os";import P from"node:path";import{spawn as re}from"node:child_process";import l from"node:fs";import a from"node:path";function Y(e){let n=a.resolve(e);for(;;){if(l.existsSync(a.join(n,"package.json")))return n;let r=a.dirname(n);if(r===n)return null;n=r}}function j(e){let n=a.resolve(e);for(;;){if(l.existsSync(a.join(n,"bun.lock"))||l.existsSync(a.join(n,"bun.lockb")))return"bun";if(l.existsSync(a.join(n,"pnpm-lock.yaml")))return"pnpm";if(l.existsSync(a.join(n,"package-lock.json")))return"npm";let r=a.dirname(n);if(r===n)return"npm";n=r}}function H(e){let n=a.resolve(e.appDir),r=te(a.join(n,"package.json")),t=`${s.commandName} open`,o=r.scripts?.[s.commandName];if(o&&o!==t)throw new Error(`package.json already defines scripts.${s.commandName} as ${JSON.stringify(o)}; resolve that conflict before setup`);let i=j(n),c=[];return r.devDependencies?.[s.packageName]!==e.cliVersion&&c.push(oe(i,e.cliVersion)),o!==t&&c.push(ae(i)),{appDir:n,packageManager:i,operations:c}}async function U(e,n){for(let r of e.operations)n.dryRun||await se(r,e.appDir,n.json)}function O(e){return e.operations.map(n=>`${n.command} ${n.args.map(ie).join(" ")}`)}function te(e){let n;try{n=JSON.parse(l.readFileSync(e,"utf8"))}catch(o){let i=o instanceof Error?o.message:String(o);throw new Error(`could not read ${e}: ${i}`)}if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`${e} must contain a JSON object`);let r=W(Reflect.get(n,"scripts")),t=W(Reflect.get(n,"devDependencies"));return{...r?{scripts:r}:{},...t?{devDependencies:t}:{}}}function W(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let n=Object.entries(e).filter(r=>typeof r[1]=="string");return Object.fromEntries(n)}function oe(e,n){let r=`${s.packageName}@${n}`;switch(e){case"bun":return{command:"bun",args:["add","--dev","--exact",r],description:`install ${r} as an exact dev dependency`};case"pnpm":return{command:"pnpm",args:["add","--save-dev","--save-exact",r],description:`install ${r} as an exact dev dependency`};case"npm":return{command:"npm",args:["install","--save-dev","--save-exact",r],description:`install ${r} as an exact dev dependency`}}}function ie(e){return/^[a-zA-Z0-9_./@=-]+$/.test(e)?e:JSON.stringify(e)}function se(e,n,r){return new Promise((t,o)=>{let i=re(e.command,e.args,{cwd:n,stdio:r?["ignore",2,"inherit"]:"inherit"});i.once("error",o),i.once("exit",c=>{c===0?t():o(new Error(`${e.command} exited with code ${c??"unknown"}`))})})}function ae(e){return{command:e,args:e==="bun"?["pm","pkg","set",`scripts.${s.commandName}=${s.commandName} open`]:["pkg","set",`scripts.${s.commandName}=${s.commandName} open`],description:`add the \`${s.commandName}\` package script`}}async function Ye(e){if(e.includes("--help")||e.includes("-h")){je();return}let n=ue(e),r="decisions";try{let t=Y(n.appDir),o=x(),i=R(),c=await le(n,o),X=await de(n,t),g=await K(n,"productAnalytics",i.productAnalytics,i.configured),S=await K(n,"crashReports",i.crashReports,i.configured),ee=await y.fetchManifest(),f=y.resolveVersion(ee,{channel:"stable"}).version,A=T();if(A==="0.0.0")throw new Error("could not resolve the installed rnxsim CLI version");let p=null;X&&t&&(p=H({appDir:t,cliVersion:A})),he(n),be(n,o,c,f),ve(n,t,p),Re(n,g,S),r="runtime";let M=!1;if(!n.dryRun){let E=w();M=(await y.install({version:f,channel:"stable",setActive:!0,protectVersions:E?[E]:[]})).installed}r="repository",p&&await U(p,{dryRun:n.dryRun,json:n.json}),r="service";let h=o.installed;c&&!o.installed&&!n.dryRun&&(await L({port:7668,force:!1}),h=!0),r="privacy",n.dryRun||C({productAnalytics:g,crashReports:S}),r="compatibility";let u=t?me(t):null,b=await fe(n,u);b&&u&&t&&!n.dryRun&&await ye(t,u),we(n,u,b);let _={runtimeVersion:f,serviceInstalled:h,repositoryPrepared:p!==null,compatibilityShared:b&&!n.dryRun},ne=Se(f);n.json?console.log(JSON.stringify({..._,runtimeInstalled:n.dryRun?!1:M,dryRun:n.dryRun,cache:ne,repositoryOperations:p?O(p):[]},null,2)):ke(p);let m=u?q(u):null;return k({event:"cli_setup_completed",properties:{service_installed:h,repository_prepared:p!==null,product_analytics:g,crash_reports:S,compat_supported:m?.supported??0,compat_partial:m?.partial??0,compat_unsupported:m?.unsupported??0,compat_not_yet_verified:m?.notYetVerified??0,from_welcome:n.fromWelcome,ci:n.ci,dry_run:n.dryRun}}),_}catch(t){let o=xe(t);throw k({event:"cli_setup_failed",properties:{stage:r,message:o}}),t}}function pe(){let e=x(),n=N(),r=w();return{daemonSupported:e.supported,daemonInstalled:e.installed,daemonRunning:!!(n&&I(n)),runtimeInstalled:!!(r&&$.existsSync(v(r))),privacyConfigured:R().configured}}function He(e=pe()){return!e.runtimeInstalled||!e.privacyConfigured}function ue(e){let n=e.indexOf("--app"),r=n>=0?e[n+1]:void 0;if(n>=0&&(!r||r.startsWith("-")))throw new Error("--app requires a directory");let t=G(e,"--service","--no-service"),o=G(e,"--repo","--no-repo");return{appDir:P.resolve(r??process.cwd()),ci:e.includes("--ci"),dryRun:e.includes("--dry-run"),fromWelcome:e.includes("--from-welcome"),json:e.includes("--json"),yes:e.includes("--yes")||e.includes("-y"),service:t,repository:o,productAnalytics:Z(e,"--analytics"),crashReports:Z(e,"--crash-reports"),shareCompatibility:e.includes("--share-compat")}}function G(e,n,r){if(e.includes(n)&&e.includes(r))throw new Error(`${n} and ${r} cannot be used together`);if(e.includes(n))return!0;if(e.includes(r))return!1}function Z(e,n){let r=e.find(i=>i.startsWith(`${n}=`)),t=e.indexOf(n),o=r?.slice(n.length+1)??(t>=0?e[t+1]:void 0);if(o!==void 0){if(o==="on"||o==="yes"||o==="true")return!0;if(o==="off"||o==="no"||o==="false")return!1;throw new Error(`${n} must be on or off`)}}async function le(e,n){if(e.ci){if(e.service===!0)throw new Error("--ci cannot install a machine service");return!1}return n.supported?n.installed&&e.service===void 0?!0:e.service!==void 0?e.service:e.yes?!0:(D(e,"--service or --no-service"),d("Install the background service and shared managed runtime?",!0)):!1}async function de(e,n){if(!n){if(e.repository===!0)throw new Error("--repo requires a package.json");return!1}return e.repository!==void 0?e.repository:e.yes?!0:(D(e,"--repo or --no-repo"),d(`Prepare ${n} for reproducible rnx runs?`,!0))}async function K(e,n,r,t){let o=n==="productAnalytics"?e.productAnalytics:e.crashReports;return o!==void 0?o:t?r:e.yes?!0:(D(e,n==="productAnalytics"?"--analytics on|off":"--crash-reports on|off"),d(n==="productAnalytics"?"Share bounded product analytics?":"Send bounded crash reports?",!0))}async function fe(e,n){return n?e.shareCompatibility?!0:e.yes||!process.stdin.isTTY?!1:d("Share dependency names, requested versions, framework, and this compatibility result?",!1):!1}function D(e,n){if(!(process.stdin.isTTY&&!e.ci))throw new Error(`non-interactive setup requires ${n}, or --yes to accept defaults`)}function me(e){let n=JSON.parse($.readFileSync(P.join(e,"package.json"),"utf8"));if(!n||typeof n!="object")throw new Error("package.json must contain an object");return V(n)}async function ye(e,n){let r=JSON.parse($.readFileSync(P.join(e,"package.json"),"utf8"));if(!r||typeof r!="object")throw new Error("package.json must be an object");let t=await fetch("https://contrast.dev/api/scan",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(ge(r,n)),signal:AbortSignal.timeout(1e4)});if(!t.ok)throw new Error(`compatibility sharing failed with HTTP ${t.status}`)}function ge(e,n){return{dependencies:Q(Reflect.get(e,"dependencies")),devDependencies:Q(Reflect.get(e,"devDependencies")),framework:n.framework,result:{framework:n.framework,rnVersion:n.rnVersion,packages:n.packages.slice(0,200)},source:"desktop",shared:!0}}function Q(e){if(!e||typeof e!="object")return{};let n={};for(let[r,t]of Object.entries(e).slice(0,200))typeof t=="string"&&(n[r.slice(0,160)]=t.slice(0,80));return n}function Se(e){let n=z.platform(),r=z.arch();return{path:v(e),key:`sootsim-runtime-${n}-${r}-${e}`,inputs:{platform:n,arch:r,runtimeVersion:e}}}function he(e){e.json||console.log(`
4
+ import{a as d}from"./chunk-MWOCKUXA.js";import{d as V,f as q,g as J,i as F,j as B}from"./chunk-S6QDUPF2.js";import{b as x,c as L}from"./chunk-TCELYE7A.js";import{c as k}from"./chunk-BPEXXNXX.js";import"./chunk-A2OABK5V.js";import{f as y}from"./chunk-FCLPIJ6G.js";import"./chunk-HTKS4EIQ.js";import"./chunk-UJQO4GMX.js";import"./chunk-A7INKWBI.js";import"./chunk-WBOJVCV7.js";import"./chunk-B6PR6YLO.js";import"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-OUXCE743.js";import{C as R,D as C,J as w,M as N,O as I,l as v}from"./chunk-KLLX5IWP.js";import{a as T}from"./chunk-DXAZX6Y4.js";import{a as s}from"./chunk-M47UITXL.js";import"./chunk-BWWFYOKL.js";import"./chunk-WBPBMC32.js";import $ from"node:fs";import z from"node:os";import P from"node:path";import{spawn as re}from"node:child_process";import l from"node:fs";import a from"node:path";function Y(e){let n=a.resolve(e);for(;;){if(l.existsSync(a.join(n,"package.json")))return n;let r=a.dirname(n);if(r===n)return null;n=r}}function j(e){let n=a.resolve(e);for(;;){if(l.existsSync(a.join(n,"bun.lock"))||l.existsSync(a.join(n,"bun.lockb")))return"bun";if(l.existsSync(a.join(n,"pnpm-lock.yaml")))return"pnpm";if(l.existsSync(a.join(n,"package-lock.json")))return"npm";let r=a.dirname(n);if(r===n)return"npm";n=r}}function H(e){let n=a.resolve(e.appDir),r=te(a.join(n,"package.json")),t=`${s.commandName} open`,o=r.scripts?.[s.commandName];if(o&&o!==t)throw new Error(`package.json already defines scripts.${s.commandName} as ${JSON.stringify(o)}; resolve that conflict before setup`);let i=j(n),c=[];return r.devDependencies?.[s.packageName]!==e.cliVersion&&c.push(oe(i,e.cliVersion)),o!==t&&c.push(ae(i)),{appDir:n,packageManager:i,operations:c}}async function U(e,n){for(let r of e.operations)n.dryRun||await se(r,e.appDir,n.json)}function O(e){return e.operations.map(n=>`${n.command} ${n.args.map(ie).join(" ")}`)}function te(e){let n;try{n=JSON.parse(l.readFileSync(e,"utf8"))}catch(o){let i=o instanceof Error?o.message:String(o);throw new Error(`could not read ${e}: ${i}`)}if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`${e} must contain a JSON object`);let r=W(Reflect.get(n,"scripts")),t=W(Reflect.get(n,"devDependencies"));return{...r?{scripts:r}:{},...t?{devDependencies:t}:{}}}function W(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let n=Object.entries(e).filter(r=>typeof r[1]=="string");return Object.fromEntries(n)}function oe(e,n){let r=`${s.packageName}@${n}`;switch(e){case"bun":return{command:"bun",args:["add","--dev","--exact",r],description:`install ${r} as an exact dev dependency`};case"pnpm":return{command:"pnpm",args:["add","--save-dev","--save-exact",r],description:`install ${r} as an exact dev dependency`};case"npm":return{command:"npm",args:["install","--save-dev","--save-exact",r],description:`install ${r} as an exact dev dependency`}}}function ie(e){return/^[a-zA-Z0-9_./@=-]+$/.test(e)?e:JSON.stringify(e)}function se(e,n,r){return new Promise((t,o)=>{let i=re(e.command,e.args,{cwd:n,stdio:r?["ignore",2,"inherit"]:"inherit"});i.once("error",o),i.once("exit",c=>{c===0?t():o(new Error(`${e.command} exited with code ${c??"unknown"}`))})})}function ae(e){return{command:e,args:e==="bun"?["pm","pkg","set",`scripts.${s.commandName}=${s.commandName} open`]:["pkg","set",`scripts.${s.commandName}=${s.commandName} open`],description:`add the \`${s.commandName}\` package script`}}async function Ye(e){if(e.includes("--help")||e.includes("-h")){je();return}let n=ue(e),r="decisions";try{let t=Y(n.appDir),o=x(),i=R(),c=await le(n,o),X=await de(n,t),g=await K(n,"productAnalytics",i.productAnalytics,i.configured),S=await K(n,"crashReports",i.crashReports,i.configured),ee=await y.fetchManifest(),f=y.resolveVersion(ee,{channel:"stable"}).version,A=T();if(A==="0.0.0")throw new Error("could not resolve the installed rnxsim CLI version");let p=null;X&&t&&(p=H({appDir:t,cliVersion:A})),he(n),be(n,o,c,f),ve(n,t,p),Re(n,g,S),r="runtime";let M=!1;if(!n.dryRun){let E=w();M=(await y.install({version:f,channel:"stable",setActive:!0,protectVersions:E?[E]:[]})).installed}r="repository",p&&await U(p,{dryRun:n.dryRun,json:n.json}),r="service";let h=o.installed;c&&!o.installed&&!n.dryRun&&(await L({port:7668,force:!1}),h=!0),r="privacy",n.dryRun||C({productAnalytics:g,crashReports:S}),r="compatibility";let u=t?me(t):null,b=await fe(n,u);b&&u&&t&&!n.dryRun&&await ye(t,u),we(n,u,b);let _={runtimeVersion:f,serviceInstalled:h,repositoryPrepared:p!==null,compatibilityShared:b&&!n.dryRun},ne=Se(f);n.json?console.log(JSON.stringify({..._,runtimeInstalled:n.dryRun?!1:M,dryRun:n.dryRun,cache:ne,repositoryOperations:p?O(p):[]},null,2)):ke(p);let m=u?q(u):null;return k({event:"cli_setup_completed",properties:{service_installed:h,repository_prepared:p!==null,product_analytics:g,crash_reports:S,compat_supported:m?.supported??0,compat_partial:m?.partial??0,compat_unsupported:m?.unsupported??0,compat_not_yet_verified:m?.notYetVerified??0,from_welcome:n.fromWelcome,ci:n.ci,dry_run:n.dryRun}}),_}catch(t){let o=xe(t);throw k({event:"cli_setup_failed",properties:{stage:r,message:o}}),t}}function pe(){let e=x(),n=N(),r=w();return{daemonSupported:e.supported,daemonInstalled:e.installed,daemonRunning:!!(n&&I(n)),runtimeInstalled:!!(r&&$.existsSync(v(r))),privacyConfigured:R().configured}}function He(e=pe()){return!e.runtimeInstalled||!e.privacyConfigured}function ue(e){let n=e.indexOf("--app"),r=n>=0?e[n+1]:void 0;if(n>=0&&(!r||r.startsWith("-")))throw new Error("--app requires a directory");let t=G(e,"--service","--no-service"),o=G(e,"--repo","--no-repo");return{appDir:P.resolve(r??process.cwd()),ci:e.includes("--ci"),dryRun:e.includes("--dry-run"),fromWelcome:e.includes("--from-welcome"),json:e.includes("--json"),yes:e.includes("--yes")||e.includes("-y"),service:t,repository:o,productAnalytics:Z(e,"--analytics"),crashReports:Z(e,"--crash-reports"),shareCompatibility:e.includes("--share-compat")}}function G(e,n,r){if(e.includes(n)&&e.includes(r))throw new Error(`${n} and ${r} cannot be used together`);if(e.includes(n))return!0;if(e.includes(r))return!1}function Z(e,n){let r=e.find(i=>i.startsWith(`${n}=`)),t=e.indexOf(n),o=r?.slice(n.length+1)??(t>=0?e[t+1]:void 0);if(o!==void 0){if(o==="on"||o==="yes"||o==="true")return!0;if(o==="off"||o==="no"||o==="false")return!1;throw new Error(`${n} must be on or off`)}}async function le(e,n){if(e.ci){if(e.service===!0)throw new Error("--ci cannot install a machine service");return!1}return n.supported?n.installed&&e.service===void 0?!0:e.service!==void 0?e.service:e.yes?!0:(D(e,"--service or --no-service"),d("Install the background service and shared managed runtime?",!0)):!1}async function de(e,n){if(!n){if(e.repository===!0)throw new Error("--repo requires a package.json");return!1}return e.repository!==void 0?e.repository:e.yes?!0:(D(e,"--repo or --no-repo"),d(`Prepare ${n} for reproducible rnx runs?`,!0))}async function K(e,n,r,t){let o=n==="productAnalytics"?e.productAnalytics:e.crashReports;return o!==void 0?o:t?r:e.yes?!0:(D(e,n==="productAnalytics"?"--analytics on|off":"--crash-reports on|off"),d(n==="productAnalytics"?"Share bounded product analytics?":"Send bounded crash reports?",!0))}async function fe(e,n){return n?e.shareCompatibility?!0:e.yes||!process.stdin.isTTY?!1:d("Share dependency names, requested versions, framework, and this compatibility result?",!1):!1}function D(e,n){if(!(process.stdin.isTTY&&!e.ci))throw new Error(`non-interactive setup requires ${n}, or --yes to accept defaults`)}function me(e){let n=JSON.parse($.readFileSync(P.join(e,"package.json"),"utf8"));if(!n||typeof n!="object")throw new Error("package.json must contain an object");return V(n)}async function ye(e,n){let r=JSON.parse($.readFileSync(P.join(e,"package.json"),"utf8"));if(!r||typeof r!="object")throw new Error("package.json must be an object");let t=await fetch("https://contrast.dev/api/scan",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(ge(r,n)),signal:AbortSignal.timeout(1e4)});if(!t.ok)throw new Error(`compatibility sharing failed with HTTP ${t.status}`)}function ge(e,n){return{dependencies:Q(Reflect.get(e,"dependencies")),devDependencies:Q(Reflect.get(e,"devDependencies")),framework:n.framework,result:{framework:n.framework,rnVersion:n.rnVersion,packages:n.packages.slice(0,200)},source:"desktop",shared:!0}}function Q(e){if(!e||typeof e!="object")return{};let n={};for(let[r,t]of Object.entries(e).slice(0,200))typeof t=="string"&&(n[r.slice(0,160)]=t.slice(0,80));return n}function Se(e){let n=z.platform(),r=z.arch();return{path:v(e),key:`sootsim-runtime-${n}-${r}-${e}`,inputs:{platform:n,arch:r,runtimeVersion:e}}}function he(e){e.json||console.log(`
5
5
  ${e.fromWelcome?"welcome to rnx":"rnxsim setup"}`)}function be(e,n,r,t){e.json||(console.log(`
6
6
  1. machine`),console.log(` stable runtime: ${t}`),console.log(` background service: ${n.supported?r?"install":"skip":"unsupported on this platform"}`))}function ve(e,n,r){if(!e.json){if(console.log(`
7
7
  2. repository`),!n){console.log(" no package.json found; repository preparation skipped");return}if(!r){console.log(` skipped for ${n}`);return}console.log(` package manager: ${j(n)}`);for(let t of O(r))console.log(` ${e.dryRun?"would run":"run"}: ${t}`)}}function Re(e,n,r){e.json||(console.log(`
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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 h}from"./chunk-ENPMBKGL.js";import"./chunk-X5XJUVTI.js";import*as l from"fs";import*as L from"os";import*as a from"path";import{fileURLToPath as x}from"url";function D(){try{let e=x(import.meta.resolve(`${h.packageName}/package.json`));return a.join(a.dirname(e),"skills")}catch{let e=a.dirname(x(import.meta.url));return a.resolve(e,"../../skills")}}var d=D(),j=new Set(["all","codex","claude"]);function S(){console.log(`rnxsim skill
4
+ import{a as h}from"./chunk-M47UITXL.js";import"./chunk-WBPBMC32.js";import*as l from"fs";import*as L from"os";import*as a from"path";import{fileURLToPath as x}from"url";function D(){try{let e=x(import.meta.resolve(`${h.packageName}/package.json`));return a.join(a.dirname(e),"skills")}catch{let e=a.dirname(x(import.meta.url));return a.resolve(e,"../../skills")}}var d=D(),j=new Set(["all","codex","claude"]);function S(){console.log(`rnxsim skill
5
5
 
6
6
  install and inspect bundled rnx agent skills.
7
7
 
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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{m as a}from"./chunk-ADGT4K22.js";import"./chunk-SRGYFE5A.js";import{q as c,s as l}from"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import"./chunk-IXMPQ35S.js";import"./chunk-X5XJUVTI.js";function g(t){return!!t&&typeof t=="object"&&typeof Reflect.get(t,"capturedAt")=="number"}function p(){console.log(`
4
+ import{m as a}from"./chunk-CS2B3W6C.js";import"./chunk-MBRV35BV.js";import{q as c,s as l}from"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-KLLX5IWP.js";import"./chunk-WBPBMC32.js";function g(t){return!!t&&typeof t=="object"&&typeof Reflect.get(t,"capturedAt")=="number"}function p(){console.log(`
5
5
  rnxsim state - capture the current app state in one call
6
6
 
7
7
  usage:
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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,c as l,d as c,e as a,f}from"./chunk-XPGHWUUW.js";import{a as t}from"./chunk-CWOSCFGT.js";import"./chunk-ADGT4K22.js";import"./chunk-SRGYFE5A.js";import"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import"./chunk-IXMPQ35S.js";import"./chunk-X5XJUVTI.js";function p(){console.log(`
4
+ import{b as s,c as l,d as c,e as a,f}from"./chunk-X6N6VPFL.js";import{a as t}from"./chunk-QISLN6DC.js";import"./chunk-CS2B3W6C.js";import"./chunk-MBRV35BV.js";import"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-KLLX5IWP.js";import"./chunk-WBPBMC32.js";function p(){console.log(`
5
5
  rnxsim storage profile \u2014 manage isolated storage profiles
6
6
 
7
7
  usage:
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.333 | (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-76E5SSJE.js";import"./chunk-B6PR6YLO.js";import"./chunk-WBPBMC32.js";export{a as settingsStore};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.333 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c as a,d as b}from"./chunk-BPEXXNXX.js";import"./chunk-A2OABK5V.js";import"./chunk-KLLX5IWP.js";import"./chunk-WBPBMC32.js";export{b as flushCliTelemetry,a as trackCliEvent};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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{q as m,s as d,v as i}from"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import"./chunk-IXMPQ35S.js";import"./chunk-X5XJUVTI.js";import{writeFileSync as g}from"fs";function u(){console.log(`
4
+ import{q as m,s as d,v as i}from"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-KLLX5IWP.js";import"./chunk-WBPBMC32.js";import{writeFileSync as g}from"fs";function u(){console.log(`
5
5
  rnxsim timeline \u2014 control the semantic event timeline
6
6
 
7
7
  usage:
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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 h,b as v,c as $}from"./chunk-ZXLX6VWG.js";import{b as p}from"./chunk-PMSGRATC.js";import"./chunk-PFQ2GL6I.js";import{b as g}from"./chunk-6QEYHQZH.js";import"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import{J as a,g as m,h as u,l as d}from"./chunk-IXMPQ35S.js";import{a as f}from"./chunk-XSW55GIR.js";import"./chunk-ENPMBKGL.js";import"./chunk-X5XJUVTI.js";import{spawn as y}from"node:child_process";import x from"node:fs";import R from"node:os";import s from"node:path";var b="https://registry.npmjs.org/rnxsim/latest";async function W(t){let n=t.indexOf("--channel"),e=n>=0&&t[n+1]?t[n+1]:void 0;console.log(`rnxsim upgrade
4
+ import{a as h,b as v,c as $}from"./chunk-MQPGJ54E.js";import{b as p}from"./chunk-4MXBZD2N.js";import"./chunk-2UDDQL5S.js";import{b as g}from"./chunk-FCLPIJ6G.js";import"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import{J as a,g as m,h as u,l as d}from"./chunk-KLLX5IWP.js";import{a as f}from"./chunk-DXAZX6Y4.js";import"./chunk-M47UITXL.js";import"./chunk-WBPBMC32.js";import{spawn as y}from"node:child_process";import x from"node:fs";import R from"node:os";import s from"node:path";var b="https://registry.npmjs.org/rnxsim/latest";async function W(t){let n=t.indexOf("--channel"),e=n>=0&&t[n+1]?t[n+1]:void 0;console.log(`rnxsim upgrade
5
5
  `),console.log("runtime:");let o=a(),{config:l}=await p(),r=l?.runtimeVersion,c=r?x.existsSync(s.join(d(r),"index.html")):!1;r&&console.log(` project config: v${r}`);let i=(r&&c?null:await $(["install",...r?[r,"--set-active=false"]:[],...e?["--channel",e]:[]],{}))?.version??r??a();i&&console.log(r?c?` result: v${i} already installed for this project`:` result: not installed \u2192 v${i} for this project`:o&&o!==i?` result: v${o} \u2192 v${i}`:o?` result: v${i} already current`:` result: not installed \u2192 v${i}`);let k=i?await h(i):null;console.log(`
6
6
  cli:`),await j(),i&&console.log(`
7
7
  ${v(i,k)}`)}function w(){if(u())return{kind:"dev"};let t=process.argv[1]??"";try{t=x.realpathSync(t)}catch{}let n=s.sep;if(t.includes(`${n}_npx${n}`)||t.includes(`${n}.bunx${n}`))return{kind:"npx"};if(t.includes(`${n}.bun${n}`))return{kind:"global",command:"bun",args:["add","-g","rnxsim@latest"]};if(t.includes(`${n}pnpm${n}`))return{kind:"global",command:"pnpm",args:["add","-g","rnxsim@latest"]};let e=s.join(m(),"cli");if(t.startsWith(`${e}${n}`))return{kind:"global",command:"npm",args:["i","-g","--prefix",e,"rnxsim@latest"]};let o=s.resolve(process.env.SOOTSIM_CLI_PREFIX||s.join(R.homedir(),".local"));return t.startsWith(`${o}${n}`)?{kind:"global",command:"npm",args:["i","-g","--prefix",o,"rnxsim@latest"]}:{kind:"global",command:"npm",args:["i","-g","rnxsim@latest"]}}async function j(){let t=f(),n=await C();if(!n){console.log(` v${t} \u2014 couldn't reach the npm registry, skipped`);return}if(g(n,t)<=0){console.log(` v${t} (latest)`);return}let e=w();if(console.log(` v${t} \u2192 v${n}`),e.kind==="dev"){console.log(" running from the Contrast dev checkout \u2014 pull instead of upgrading");return}if(e.kind==="npx"){console.log(" running from the npx cache \u2014 get the latest with:"),console.log(" npx rnxsim@latest");return}let o=`${e.command} ${e.args.join(" ")}`;console.log(` updating global install (${o})\u2026`),await S(e.command,e.args)?console.log(` updated to v${n}`):(console.log(" update failed \u2014 run it yourself:"),console.log(` ${o}`))}function S(t,n){return new Promise(e=>{let o=y(t,n,{stdio:"inherit"});o.on("error",()=>e(!1)),o.on("exit",l=>e(l===0))})}async function C(){try{let t=await fetch(b,{headers:{accept:"application/json"},signal:AbortSignal.timeout(8e3)});if(!t.ok)return null;let n=await t.json();return typeof n.version=="string"&&n.version?n.version:null}catch{return null}}export{W as runUpgrade};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.333 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{e as a,f as b,g as c}from"./chunk-CJJI74AT.js";import"./chunk-3KRC63S4.js";import"./chunk-WFPHEUH2.js";import"./chunk-I44IV7DO.js";import"./chunk-2UDDQL5S.js";import"./chunk-EGXHBCDU.js";import"./chunk-BPEXXNXX.js";import"./chunk-A2OABK5V.js";import"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import"./chunk-KLLX5IWP.js";import"./chunk-M47UITXL.js";import"./chunk-WBPBMC32.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};
@@ -1,6 +1,6 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (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 a}from"./chunk-PMSGRATC.js";import"./chunk-PFQ2GL6I.js";import{d as s,f as t}from"./chunk-6QEYHQZH.js";import{a as m}from"./chunk-C53ASFDC.js";import"./chunk-NB5Y2UMJ.js";import"./chunk-EXIHWLOG.js";import{l as r}from"./chunk-IXMPQ35S.js";import{a as l}from"./chunk-XSW55GIR.js";import"./chunk-ENPMBKGL.js";import"./chunk-X5XJUVTI.js";import g from"node:fs";import d from"node:path";async function R($){let{IS_BETA:c,BETA_LABEL:u}=await import("./beta-BO3LCCRQ.js"),f=c?` \xB7 ${u}`:"";console.log(`rnxsim v${l()}${f}`);let o=m(),n=t.resolveChannel();o.isDevBridge?(console.log(o.primary),o.installedRuntime&&console.log(`${o.installedRuntime} \xB7 ${n}`)):o.primary==="runtime not installed"?console.log("runtime not installed \u2014 run `rnxsim runtime install`"):console.log(`${o.primary} \xB7 ${n}`);let{config:i}=await a();if(i?.runtimeVersion){let p=g.existsSync(d.join(r(i.runtimeVersion),"index.html"));console.log(`project runtime v${i.runtimeVersion} \xB7 configured \xB7 ${p?"installed":"installs on open"}`)}let e=await t.checkUpToDate({channel:n});e.outdated&&e.latest&&console.log(`
4
+ import{b as a}from"./chunk-4MXBZD2N.js";import"./chunk-2UDDQL5S.js";import{d as s,f as t}from"./chunk-FCLPIJ6G.js";import{a as m}from"./chunk-UJQO4GMX.js";import"./chunk-ZD4NF7Q2.js";import"./chunk-4WGS7ULT.js";import{l as r}from"./chunk-KLLX5IWP.js";import{a as l}from"./chunk-DXAZX6Y4.js";import"./chunk-M47UITXL.js";import"./chunk-WBPBMC32.js";import g from"node:fs";import d from"node:path";async function R($){let{IS_BETA:c,BETA_LABEL:u}=await import("./beta-ZKLXRT7W.js"),f=c?` \xB7 ${u}`:"";console.log(`rnxsim v${l()}${f}`);let o=m(),n=t.resolveChannel();o.isDevBridge?(console.log(o.primary),o.installedRuntime&&console.log(`${o.installedRuntime} \xB7 ${n}`)):o.primary==="runtime not installed"?console.log("runtime not installed \u2014 run `rnxsim runtime install`"):console.log(`${o.primary} \xB7 ${n}`);let{config:i}=await a();if(i?.runtimeVersion){let p=g.existsSync(d.join(r(i.runtimeVersion),"index.html"));console.log(`project runtime v${i.runtimeVersion} \xB7 configured \xB7 ${p?"installed":"installs on open"}`)}let e=await t.checkUpToDate({channel:n});e.outdated&&e.latest&&console.log(`
5
5
  \u2191 default runtime v${e.latest} available; run \`rnxsim upgrade\``),console.log(`
6
6
  what's new: ${s}`)}export{R as runVersion};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.331 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.333 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a,b,c,d,e,f,g,h,i,j}from"./chunk-XCAWIFDN.js";import"./chunk-X5XJUVTI.js";export{b as COMPAT_CATEGORIES,j as COMPAT_RESULT_CAVEAT,c as POLYFILL_REGISTRY,a as UNSUPPORTABLE,f as countScanResults,i as formatDetailedScanLines,h as formatPackageStatus,g as formatScanCounts,d as scanDeps,e as scanDepsWithData};
4
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-S6QDUPF2.js";import"./chunk-WBPBMC32.js";export{b as COMPAT_CATEGORIES,j as COMPAT_RESULT_CAVEAT,c as POLYFILL_REGISTRY,a as UNSUPPORTABLE,f as countScanResults,i as formatDetailedScanLines,h as formatPackageStatus,g as formatScanCounts,d as scanDeps,e as scanDepsWithData};