rnxsim 0.1.343 → 0.1.345

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 (209) hide show
  1. package/README.md +59 -31
  2. package/cli/app-fonts.ts +8 -28
  3. package/cli/app-project.ts +12 -184
  4. package/cli/app-splash.ts +3 -17
  5. package/cli/bin.ts +15 -28
  6. package/cli/commands/control.ts +20 -30
  7. package/cli/commands/daemon.ts +19 -44
  8. package/cli/commands/flow.ts +0 -27
  9. package/cli/commands/install-desktop.ts +2 -16
  10. package/cli/commands/login.ts +3 -43
  11. package/cli/commands/logout.ts +0 -7
  12. package/cli/commands/serve.ts +2 -32
  13. package/cli/commands/setup.ts +20 -194
  14. package/cli/commands/telemetry.ts +7 -5
  15. package/cli/commands/upload.ts +1 -48
  16. package/cli/commands/welcome.ts +64 -0
  17. package/cli/outbound-endpoints.ts +586 -0
  18. package/cli/privacy.ts +53 -0
  19. package/cli/runtime-notes.ts +2 -2
  20. package/cli/telemetry.ts +46 -149
  21. package/dist-cli/bin.js +6 -6
  22. package/dist-cli/chunks/{agent-RFD32ACU.js → agent-52G55XTO.js} +2 -2
  23. package/dist-cli/chunks/{agent-wrapper-2YLW2HQK.js → agent-wrapper-BOZM43ON.js} +2 -2
  24. package/dist-cli/chunks/{app-fonts-6OATDF3Y.js → app-fonts-A2L6V5EZ.js} +2 -2
  25. package/dist-cli/chunks/{assert-PSQICFOY.js → assert-CJKIP4LN.js} +2 -2
  26. package/dist-cli/chunks/{auth-XWLFKZT7.js → auth-VHHN3TOB.js} +2 -2
  27. package/dist-cli/chunks/{beta-I6WTVM6C.js → beta-EBDIGV3E.js} +2 -2
  28. package/dist-cli/chunks/{camera-45HKTLWG.js → camera-5F4KKCQ3.js} +2 -2
  29. package/dist-cli/chunks/chunk-3DBTS4MC.js +15 -0
  30. package/dist-cli/chunks/chunk-3N7M5HMJ.js +6 -0
  31. package/dist-cli/chunks/{chunk-RWYA2USN.js → chunk-4BIPA7MD.js} +1 -1
  32. package/dist-cli/chunks/chunk-4OKV7T5D.js +4 -0
  33. package/dist-cli/chunks/{chunk-T4T6DDKM.js → chunk-4ZILDTZX.js} +2 -2
  34. package/dist-cli/chunks/{chunk-R7X74I3I.js → chunk-5GXRRUOA.js} +26 -26
  35. package/dist-cli/chunks/chunk-63ASUHOV.js +4 -0
  36. package/dist-cli/chunks/{chunk-DASP2EKF.js → chunk-7GO2DSYQ.js} +1 -1
  37. package/dist-cli/chunks/{chunk-HJXIBZ35.js → chunk-7LGINKM6.js} +2 -2
  38. package/dist-cli/chunks/{chunk-2IPMH24A.js → chunk-7UIIAHVU.js} +2 -2
  39. package/dist-cli/chunks/{chunk-ES5BHPTS.js → chunk-7V4KPZ7O.js} +2 -2
  40. package/dist-cli/chunks/{chunk-FCHRGEHA.js → chunk-7YMQRA6L.js} +2 -2
  41. package/dist-cli/chunks/{chunk-DC7TS573.js → chunk-A2Q76LJV.js} +2 -2
  42. package/dist-cli/chunks/{chunk-SAUCA7SN.js → chunk-BCQV63BW.js} +45 -45
  43. package/dist-cli/chunks/{chunk-3FYJ7U3C.js → chunk-BFTDL2GX.js} +17 -17
  44. package/dist-cli/chunks/chunk-BHKSCNDC.js +4 -0
  45. package/dist-cli/chunks/{chunk-QPTJNLPT.js → chunk-DGTV3KOW.js} +1 -1
  46. package/dist-cli/chunks/chunk-DHM3JDCK.js +4 -0
  47. package/dist-cli/chunks/{chunk-TQRVLK64.js → chunk-DPP2M4AJ.js} +1 -1
  48. package/dist-cli/chunks/chunk-E2RGSCHT.js +4 -0
  49. package/dist-cli/chunks/{chunk-TQ5OPG33.js → chunk-EPLVIDPC.js} +1 -1
  50. package/dist-cli/chunks/{chunk-P3IDK7FR.js → chunk-GKGXULJK.js} +2 -2
  51. package/dist-cli/chunks/{chunk-34KDMQ6U.js → chunk-HK7YKH6N.js} +2 -2
  52. package/dist-cli/chunks/{chunk-BJUNXCPO.js → chunk-HXE344V3.js} +1 -1
  53. package/dist-cli/chunks/{chunk-HJHFC5ZZ.js → chunk-JC33TOAF.js} +1 -1
  54. package/dist-cli/chunks/{chunk-G3B2RZ47.js → chunk-KA4PJNTE.js} +2 -2
  55. package/dist-cli/chunks/{chunk-VC4TDPJQ.js → chunk-KH777UAO.js} +3 -3
  56. package/dist-cli/chunks/{chunk-4PFMDBLB.js → chunk-KRZPFXVN.js} +1 -1
  57. package/dist-cli/chunks/{chunk-6SLM6URN.js → chunk-KZFJNDH3.js} +1 -1
  58. package/dist-cli/chunks/{chunk-KLMWLQAO.js → chunk-LAQGSSTT.js} +1 -1
  59. package/dist-cli/chunks/chunk-LRM2XCEQ.js +11 -0
  60. package/dist-cli/chunks/{chunk-YKKVDKLE.js → chunk-NUPRHZQW.js} +2 -2
  61. package/dist-cli/chunks/{chunk-AKV2DGKM.js → chunk-OPHT4DUO.js} +1 -1
  62. package/dist-cli/chunks/{chunk-KON6XG4Y.js → chunk-P2CGGMU2.js} +2 -2
  63. package/dist-cli/chunks/{chunk-5FB4EA33.js → chunk-PLB6UVVX.js} +2 -2
  64. package/dist-cli/chunks/{chunk-FRRHCLG2.js → chunk-PLUWN2V5.js} +1 -1
  65. package/dist-cli/chunks/{chunk-WDA4QR6U.js → chunk-QNBBKRCA.js} +2 -2
  66. package/dist-cli/chunks/{chunk-G7S6T5OX.js → chunk-QNRWPAOA.js} +2 -2
  67. package/dist-cli/chunks/{chunk-2EVBZ37G.js → chunk-R7ZNRGQN.js} +1 -1
  68. package/dist-cli/chunks/{chunk-TMJGPUWJ.js → chunk-RB4VFUNM.js} +3 -3
  69. package/dist-cli/chunks/chunk-RT3DXTDP.js +25 -0
  70. package/dist-cli/chunks/{chunk-OYLIWHDB.js → chunk-RTDHX6CW.js} +2 -2
  71. package/dist-cli/chunks/{chunk-YLFDA4WW.js → chunk-T7SBFG5I.js} +2 -2
  72. package/dist-cli/chunks/{chunk-W7EXE22C.js → chunk-TEU5NGUA.js} +2 -2
  73. package/dist-cli/chunks/chunk-TMRD5MHL.js +99 -0
  74. package/dist-cli/chunks/{chunk-SU7RE3PV.js → chunk-TOF5TA5X.js} +11 -11
  75. package/dist-cli/chunks/{chunk-6IVEGYWV.js → chunk-U5YHXQHH.js} +2 -2
  76. package/dist-cli/chunks/{chunk-BA3HRFJ5.js → chunk-UVOEHIGP.js} +1 -1
  77. package/dist-cli/chunks/{chunk-SW4DV2TY.js → chunk-VLBN3KRC.js} +1 -1
  78. package/dist-cli/chunks/{chunk-7WKV6EKX.js → chunk-WPPGU5IK.js} +2 -2
  79. package/dist-cli/chunks/{chunk-JOE3J46E.js → chunk-WU72KL6Z.js} +2 -2
  80. package/dist-cli/chunks/chunk-XJBFJGNT.js +4 -0
  81. package/dist-cli/chunks/{chunk-3CMKNWRL.js → chunk-XXZLK4BY.js} +1 -1
  82. package/dist-cli/chunks/{chunk-BKMPV6N4.js → chunk-YVSUFVVB.js} +1 -1
  83. package/dist-cli/chunks/{chunk-RO3WVQPB.js → chunk-ZMTZ5G5H.js} +2 -2
  84. package/dist-cli/chunks/{cleanup-OU4VKFC3.js → cleanup-MAVZJXVW.js} +2 -2
  85. package/dist-cli/chunks/cli-version-2B4KRNML.js +4 -0
  86. package/dist-cli/chunks/{compat-GAEKP67T.js → compat-7AURLGCS.js} +2 -2
  87. package/dist-cli/chunks/config-TN3Y4J5N.js +13 -0
  88. package/dist-cli/chunks/{control-VQJURMFD.js → control-EV2ELU5R.js} +2 -2
  89. package/dist-cli/chunks/daemon-KKDG5MYR.js +4 -0
  90. package/dist-cli/chunks/{debug-F5N2LO4T.js → debug-JICITUB6.js} +3 -3
  91. package/dist-cli/chunks/{desktop-I4ILT4BS.js → desktop-4F5HGLLX.js} +3 -3
  92. package/dist-cli/chunks/{detox-2HMPYSP4.js → detox-ZC7NHLJI.js} +2 -2
  93. package/dist-cli/chunks/{device-5LWLOB5R.js → device-V57GHRXX.js} +2 -2
  94. package/dist-cli/chunks/{diagnose-5S4IQPAP.js → diagnose-FF4IWYXC.js} +2 -2
  95. package/dist-cli/chunks/{disk-cleanup-CJSZVJQX.js → disk-cleanup-T277L6ZO.js} +2 -2
  96. package/dist-cli/chunks/drivers-LCX7S76X.js +4 -0
  97. package/dist-cli/chunks/{film-HCPU2TDB.js → film-G7ZAPWB7.js} +3 -3
  98. package/dist-cli/chunks/flow-ONZGGFGD.js +4 -0
  99. package/dist-cli/chunks/help-DROVDXJM.js +4 -0
  100. package/dist-cli/chunks/{hidden-runtime-alias-YYUEZQPR.js → hidden-runtime-alias-VSJNNSNI.js} +2 -2
  101. package/dist-cli/chunks/{home-paths-3FXISM5I.js → home-paths-75HP3HKA.js} +2 -2
  102. package/dist-cli/chunks/inspect-MDA7ESGQ.js +4 -0
  103. package/dist-cli/chunks/install-desktop-EIVZHIFA.js +4 -0
  104. package/dist-cli/chunks/login-ZSIHGHUK.js +26 -0
  105. package/dist-cli/chunks/logout-Q4DXMI2C.js +4 -0
  106. package/dist-cli/chunks/{maestro-F5KK4RC4.js → maestro-LE5LCRBL.js} +3 -3
  107. package/dist-cli/chunks/{maestro-generate-6SUU3Y5I.js → maestro-generate-D3ZIJCRL.js} +3 -3
  108. package/dist-cli/chunks/{mode-CSWGOJLI.js → mode-BWX6MDPJ.js} +2 -2
  109. package/dist-cli/chunks/{optional-demo-registry-Y6VJ4SVV.js → optional-demo-registry-6CVASL3S.js} +2 -2
  110. package/dist-cli/chunks/{perf-NRWWAJL4.js → perf-NXQZISN6.js} +2 -2
  111. package/dist-cli/chunks/{permissions-OD62A3DJ.js → permissions-5PD67RRO.js} +2 -2
  112. package/dist-cli/chunks/privacy-H5KNRNIZ.js +4 -0
  113. package/dist-cli/chunks/{record-JZT2GM3G.js → record-YJF4KXMR.js} +3 -3
  114. package/dist-cli/chunks/{report-issue-ZWSNHOPB.js → report-issue-XOL5FQBG.js} +2 -2
  115. package/dist-cli/chunks/reset-5LZN5P5B.js +4 -0
  116. package/dist-cli/chunks/runtime-U36VWBH3.js +4 -0
  117. package/dist-cli/chunks/{screenshot-command-ZGJR7ICY.js → screenshot-command-VRPJXWFS.js} +3 -3
  118. package/dist-cli/chunks/{screenshot-layers-5AQKOJZK.js → screenshot-layers-QP4WA2F5.js} +2 -2
  119. package/dist-cli/chunks/{screenshots-capture-CPTWK5Y3.js → screenshots-capture-O2IBAVSP.js} +2 -2
  120. package/dist-cli/chunks/serve-WC6RZNJL.js +118 -0
  121. package/dist-cli/chunks/setup-A6BIG3KL.js +30 -0
  122. package/dist-cli/chunks/{skills-NVWRBMEO.js → skills-A7YC6RL5.js} +2 -2
  123. package/dist-cli/chunks/{state-QGLTKN6K.js → state-IJI5YROJ.js} +2 -2
  124. package/dist-cli/chunks/{storage-OZMEZ4AV.js → storage-Z2DBO2PQ.js} +4 -4
  125. package/dist-cli/chunks/store-BYTCKNIC.js +4 -0
  126. package/dist-cli/chunks/telemetry-JLHFMD7N.js +4 -0
  127. package/dist-cli/chunks/{timeline-EXLDREY3.js → timeline-N7V2M6QA.js} +2 -2
  128. package/dist-cli/chunks/{upgrade-4VWXQO6I.js → upgrade-P2NH3BOR.js} +2 -2
  129. package/dist-cli/chunks/upload-Z2WX5DCD.js +4 -0
  130. package/dist-cli/chunks/{version-WZM6XCD2.js → version-OUHCSCUS.js} +2 -2
  131. package/dist-cli/chunks/{web-ZYPEUVWL.js → web-6NRTF3UV.js} +2 -2
  132. package/dist-cli/chunks/welcome-6RS7PEJW.js +5 -0
  133. package/dist-cli/chunks/{what-happened-KF2HLWKW.js → what-happened-FUEL3BEF.js} +2 -2
  134. package/dist-lib/agent-daemon-client.cjs +1 -1
  135. package/dist-lib/agent-events.cjs +1 -1
  136. package/dist-lib/agent-identity.cjs +1 -1
  137. package/dist-lib/agent-sessions.cjs +1 -1
  138. package/dist-lib/attached-projects.cjs +1 -1
  139. package/dist-lib/auth/shared-session.cjs +1 -1
  140. package/dist-lib/backend-origin.cjs +1 -1
  141. package/dist-lib/beta.cjs +1 -1
  142. package/dist-lib/beta.mjs +1 -1
  143. package/dist-lib/bridge-constants.cjs +1 -1
  144. package/dist-lib/bridge-contract.cjs +1 -1
  145. package/dist-lib/cli-constants.cjs +1 -1
  146. package/dist-lib/config.cjs +1 -1
  147. package/dist-lib/detox/index.cjs +1 -1
  148. package/dist-lib/dev-bundle-resolution.cjs +18 -4
  149. package/dist-lib/home-paths.cjs +145 -11
  150. package/dist-lib/host/bridge-host.cjs +236 -31
  151. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  152. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  153. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  154. package/dist-lib/host/replacement-module-handler.cjs +71 -4
  155. package/dist-lib/host/websocket-proxy.cjs +1 -1
  156. package/dist-lib/index.cjs +337 -37
  157. package/dist-lib/jump-to-source-babel.cjs +1 -1
  158. package/dist-lib/menu.cjs +1 -1
  159. package/dist-lib/menu.mjs +1 -1
  160. package/dist-lib/metro-production-bundle.cjs +1 -1
  161. package/dist-lib/metro-production-bundle.mjs +1 -1
  162. package/dist-lib/metro.cjs +484 -14
  163. package/dist-lib/profiles.cjs +1 -1
  164. package/dist-lib/public-brand.cjs +1 -1
  165. package/dist-lib/react-native-host-modules.cjs +1 -1
  166. package/dist-lib/react-native-host-modules.mjs +1 -1
  167. package/dist-lib/render-mode.cjs +1 -1
  168. package/dist-lib/scripts/dev-server-scanner.cjs +25 -2
  169. package/dist-lib/sdk.cjs +1 -1
  170. package/dist-lib/sdk.mjs +1 -1
  171. package/dist-lib/skills.cjs +384 -385
  172. package/dist-lib/vite.cjs +193 -37
  173. package/package.json +2 -1
  174. package/scripts/dev-server-scanner.ts +12 -5
  175. package/skills/rnx-test/SKILL.md +4 -0
  176. package/src/dev-bundle-resolution.ts +13 -6
  177. package/src/dev-server-open.ts +197 -0
  178. package/src/home-paths.ts +168 -15
  179. package/src/host/bridge-host.ts +2 -2
  180. package/src/host/replacement-module-handler.ts +68 -2
  181. package/src/metro-plugin.ts +83 -5
  182. package/src/native-dev-bundle-url.ts +22 -0
  183. package/src/vite-plugin-one.ts +42 -28
  184. package/dist-cli/chunks/chunk-44LRQEU3.js +0 -4
  185. package/dist-cli/chunks/chunk-4RKTGL63.js +0 -9
  186. package/dist-cli/chunks/chunk-5SCIDXJD.js +0 -25
  187. package/dist-cli/chunks/chunk-CUVY4A2A.js +0 -4
  188. package/dist-cli/chunks/chunk-DPJGB7MP.js +0 -101
  189. package/dist-cli/chunks/chunk-HD6P3W5R.js +0 -4
  190. package/dist-cli/chunks/chunk-HFNESSHG.js +0 -15
  191. package/dist-cli/chunks/chunk-I7HHBFSD.js +0 -4
  192. package/dist-cli/chunks/chunk-LV2G34IX.js +0 -4
  193. package/dist-cli/chunks/cli-version-REQOM22G.js +0 -4
  194. package/dist-cli/chunks/config-QTFXJKD6.js +0 -13
  195. package/dist-cli/chunks/daemon-ETA375WE.js +0 -4
  196. package/dist-cli/chunks/drivers-R4YB2XAF.js +0 -4
  197. package/dist-cli/chunks/flow-3VQL6XZT.js +0 -4
  198. package/dist-cli/chunks/help-2RYCKZ2G.js +0 -4
  199. package/dist-cli/chunks/inspect-XDSX5D6D.js +0 -4
  200. package/dist-cli/chunks/install-desktop-OKVRLL35.js +0 -4
  201. package/dist-cli/chunks/login-4VCBPAY2.js +0 -28
  202. package/dist-cli/chunks/logout-WSL5JS5R.js +0 -4
  203. package/dist-cli/chunks/reset-3C52YQCV.js +0 -4
  204. package/dist-cli/chunks/runtime-4V2RBUOR.js +0 -4
  205. package/dist-cli/chunks/serve-ERAZQGCJ.js +0 -118
  206. package/dist-cli/chunks/setup-UG6PLYIL.js +0 -32
  207. package/dist-cli/chunks/store-VPBQKKWA.js +0 -4
  208. package/dist-cli/chunks/telemetry-FRW7OCYZ.js +0 -4
  209. package/dist-cli/chunks/upload-C6676NST.js +0 -4
@@ -1,28 +1,28 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (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 H,d as V}from"./chunk-I7HHBFSD.js";import{c as G}from"./chunk-FCHRGEHA.js";import{M,O as j,g as O,j as A,s as U,t as D,u as F}from"./chunk-4RKTGL63.js";import{a as Y}from"./chunk-YLFDA4WW.js";import{a as k}from"./chunk-FRRHCLG2.js";import{execFileSync as ee,spawnSync as c}from"child_process";import{existsSync as s,mkdirSync as P,readFileSync as ue,realpathSync as pe,rmSync as h,writeFileSync as X}from"fs";import{homedir as v}from"os";import{basename as de,dirname as C,resolve as u,sep as Q}from"path";import{execFileSync as oe}from"child_process";import{chmodSync as ne,mkdirSync as I,rmSync as se,writeFileSync as N}from"fs";import{dirname as T}from"path";var ie="dev.sootsim.daemon",q="SootSim Daemon",W="0.1.36";function K(e,t,r){let n=D(),o=F(),a=T(T(o)),l=T(o),p=`${a}/Resources`;se(n,{recursive:!0,force:!0}),I(U(),{recursive:!0}),I(l,{recursive:!0}),I(p,{recursive:!0}),N(`${a}/Info.plist`,ae()),N(`${a}/PkgInfo`,"APPL????"),N(o,ce(e,t,r)),ne(o,493);try{oe("codesign",["--force","--sign","-","--deep",n],{stdio:"pipe"})}catch(i){let f=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${n} failed: ${f}
5
- the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:n,launcherPath:o}}function ae(){return`<?xml version="1.0" encoding="UTF-8"?>
4
+ import{c as V}from"./chunk-7YMQRA6L.js";import{M as j,O as M,g as F,j as I,s as U,t as D,u as O}from"./chunk-LRM2XCEQ.js";import{a as H}from"./chunk-T7SBFG5I.js";import{a as k}from"./chunk-PLUWN2V5.js";import{execFileSync as J,spawnSync as c}from"child_process";import{existsSync as s,mkdirSync as P,readFileSync as ae,realpathSync as le,rmSync as h,writeFileSync as X}from"fs";import{homedir as v}from"os";import{basename as ue,dirname as C,resolve as u,sep as Q}from"path";import{execFileSync as te}from"child_process";import{chmodSync as re,mkdirSync as A,rmSync as oe,writeFileSync as T}from"fs";import{dirname as _}from"path";var ne="dev.sootsim.daemon",Y="SootSim Daemon",G="0.1.36";function q(e,t,r){let n=D(),o=O(),a=_(_(o)),l=_(o),p=`${a}/Resources`;oe(n,{recursive:!0,force:!0}),A(U(),{recursive:!0}),A(l,{recursive:!0}),A(p,{recursive:!0}),T(`${a}/Info.plist`,se()),T(`${a}/PkgInfo`,"APPL????"),T(o,ie(e,t,r)),re(o,493);try{te("codesign",["--force","--sign","-","--deep",n],{stdio:"pipe"})}catch(i){let f=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${n} failed: ${f}
5
+ the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:n,launcherPath:o}}function se(){return`<?xml version="1.0" encoding="UTF-8"?>
6
6
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
7
7
  <plist version="1.0">
8
8
  <dict>
9
9
  <key>CFBundleDevelopmentRegion</key><string>en</string>
10
- <key>CFBundleDisplayName</key><string>${q}</string>
10
+ <key>CFBundleDisplayName</key><string>${Y}</string>
11
11
  <key>CFBundleExecutable</key><string>sootsim-daemon</string>
12
- <key>CFBundleIdentifier</key><string>${ie}</string>
12
+ <key>CFBundleIdentifier</key><string>${ne}</string>
13
13
  <key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
14
- <key>CFBundleName</key><string>${q}</string>
14
+ <key>CFBundleName</key><string>${Y}</string>
15
15
  <key>CFBundlePackageType</key><string>APPL</string>
16
- <key>CFBundleShortVersionString</key><string>${W}</string>
16
+ <key>CFBundleShortVersionString</key><string>${G}</string>
17
17
  <key>CFBundleSignature</key><string>????</string>
18
- <key>CFBundleVersion</key><string>${W}</string>
18
+ <key>CFBundleVersion</key><string>${G}</string>
19
19
  <key>LSBackgroundOnly</key><true/>
20
20
  <key>LSUIElement</key><true/>
21
21
  <key>LSMinimumSystemVersion</key><string>13.0</string>
22
22
  <key>NSHumanReadableCopyright</key><string>Tamagui LLC</string>
23
23
  </dict>
24
24
  </plist>
25
- `}function ce(e,t,r){let o=[e.executable,...e.prefixArgs,"serve","--quiet","--port",String(t)].map(_).join(" "),a=_(r.stdout),l=_(r.stderr);return`#!/bin/sh
25
+ `}function ie(e,t,r){let o=[e.executable,...e.prefixArgs,"serve","--quiet","--port",String(t)].map(N).join(" "),a=N(r.stdout),l=N(r.stderr);return`#!/bin/sh
26
26
  # SootSim Daemon launcher \u2014 auto-generated by 'rnx setup'.
27
27
  # launchd spawns this; we exec the real rnx invocation in place so
28
28
  # launchd tracks the daemon process, not the shell wrapper.
@@ -40,7 +40,7 @@ for log_path in ${a} ${l}; do
40
40
  fi
41
41
  done
42
42
  exec ${o}
43
- `}function _(e){return`'${e.replace(/'/g,"'\\''")}'`}var te=60,y="dev.sootsim.daemon",B="dev.sootsim.server",g="sootsim-daemon",m=u(v(),"Library/Logs/sootsim"),L=u(v(),".local/state/sootsim");async function Xe(e,t={}){let[r,...n]=e,o=t.port??7668;if(!r||r==="--help"||r==="-h"){z();return}new Set(["install","uninstall","restart","start","stop","logs"]).has(r)&&H({event:`daemon_${r}`,properties:{platform:process.platform,subsource:"daemon"}});try{switch(r){case"install":return await we({port:o,force:n.includes("--force")});case"uninstall":return await Le();case"status":return await Pe();case"restart":return await Ee();case"start":return await Ae();case"stop":return await Ie();case"logs":return await Ne(n);default:console.error(` unknown daemon subcommand: ${r}`),z(),process.exit(1)}}finally{await V()}}function z(){G("daemon")}function ge(){let e=me();if(e)return e;let t=ye();return{executable:process.execPath,prefixArgs:[t]}}function me(){if(!fe())return null;let e=he();if(!e)return null;let t=Y(),r=t==="0.0.0"?k.packageName:`${k.packageName}@${t}`;return{executable:process.execPath,prefixArgs:[e,"exec","--yes","--package",r,"--",k.commandName]}}function fe(){let e=process.argv[1];return process.env.npm_command==="exec"?!0:e?E(e).includes(`${Q}_npx${Q}`):!1}function he(){try{let t=ee("which",["npm"],{encoding:"utf8"}).trim();if(t&&s(t))return J(t)}catch{}let e=process.env.npm_execpath;return e&&s(e)?J(e):null}function J(e){let t=E(e);if(de(t)==="npx-cli.js"){let r=u(C(t),"npm-cli.js");if(s(r))return r}return t}function ye(){try{let t=ee("which",[k.commandName],{encoding:"utf8"}).trim();if(t&&s(t))return E(t)}catch{}let e=process.argv[1];if(e&&s(e))return E(e);throw new Error(`could not locate the ${k.commandName} binary`)}function E(e){try{return pe(e)}catch{return e}}function $e(e,t){P(m,{recursive:!0});let r=u(m,"bridge.out.log"),n=u(m,"bridge.err.log"),{launcherPath:o}=K(e,t,{stdout:r,stderr:n}),a=` <string>${xe(o)}</string>`;return`<?xml version="1.0" encoding="UTF-8"?>
43
+ `}function N(e){return`'${e.replace(/'/g,"'\\''")}'`}var Z=60,y="dev.sootsim.daemon",B="dev.sootsim.server",g="sootsim-daemon",m=u(v(),"Library/Logs/sootsim"),L=u(v(),".local/state/sootsim");async function qe(e,t={}){let[r,...n]=e,o=t.port??7668;if(!r||r==="--help"||r==="-h"){W();return}switch(r){case"install":return ke({port:o,force:n.includes("--force")});case"uninstall":return we();case"status":return De();case"restart":return Le();case"start":return Pe();case"stop":return Ee();case"logs":return Ie(n);default:console.error(` unknown daemon subcommand: ${r}`),W(),process.exit(1)}}function W(){V("daemon")}function pe(){let e=de();if(e)return e;let t=fe();return{executable:process.execPath,prefixArgs:[t]}}function de(){if(!ge())return null;let e=me();if(!e)return null;let t=H(),r=t==="0.0.0"?k.packageName:`${k.packageName}@${t}`;return{executable:process.execPath,prefixArgs:[e,"exec","--yes","--package",r,"--",k.commandName]}}function ge(){let e=process.argv[1];return process.env.npm_command==="exec"?!0:e?E(e).includes(`${Q}_npx${Q}`):!1}function me(){try{let t=J("which",["npm"],{encoding:"utf8"}).trim();if(t&&s(t))return K(t)}catch{}let e=process.env.npm_execpath;return e&&s(e)?K(e):null}function K(e){let t=E(e);if(ue(t)==="npx-cli.js"){let r=u(C(t),"npm-cli.js");if(s(r))return r}return t}function fe(){try{let t=J("which",[k.commandName],{encoding:"utf8"}).trim();if(t&&s(t))return E(t)}catch{}let e=process.argv[1];if(e&&s(e))return E(e);throw new Error(`could not locate the ${k.commandName} binary`)}function E(e){try{return le(e)}catch{return e}}function he(e,t){P(m,{recursive:!0});let r=u(m,"bridge.out.log"),n=u(m,"bridge.err.log"),{launcherPath:o}=q(e,t,{stdout:r,stderr:n}),a=` <string>${$e(o)}</string>`;return`<?xml version="1.0" encoding="UTF-8"?>
44
44
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
45
45
  <plist version="1.0">
46
46
  <dict>
@@ -51,24 +51,24 @@ ${a}
51
51
  </array>
52
52
  <key>RunAtLoad</key><true/>
53
53
  <key>KeepAlive</key><true/>
54
- <key>ThrottleInterval</key><integer>${te}</integer>
54
+ <key>ThrottleInterval</key><integer>${Z}</integer>
55
55
  <key>ProcessType</key><string>Background</string>
56
56
  <key>StandardOutPath</key><string>${r}</string>
57
57
  <key>StandardErrorPath</key><string>${n}</string>
58
58
  </dict>
59
59
  </plist>
60
- `}function be(e,t){return P(L,{recursive:!0}),`[Unit]
60
+ `}function ye(e,t){return P(L,{recursive:!0}),`[Unit]
61
61
  Description=rnx bridge daemon
62
62
  After=default.target
63
63
 
64
64
  [Service]
65
65
  Type=simple
66
- ExecStart=${[e.executable,...e.prefixArgs].map(ke).join(" ")} serve --quiet --port ${t}
66
+ ExecStart=${[e.executable,...e.prefixArgs].map(xe).join(" ")} serve --quiet --port ${t}
67
67
  Restart=always
68
- RestartSec=${te}
68
+ RestartSec=${Z}
69
69
 
70
70
  [Install]
71
71
  WantedBy=default.target
72
- `}function xe(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function ke(e){return/[^\w@%+=:,./-]/.test(e)?`'${e.replace(/'/g,"'\\''")}'`:e}function $(){return u(v(),"Library/LaunchAgents",`${y}.plist`)}function ve(e=v()){return u(e,"Library/LaunchAgents",`${B}.plist`)}function b(){return u(v(),".config/systemd/user",`${g}.service`)}function Qe(){if(A())return{supported:!1,installed:!1};if(process.platform==="darwin"){let e=$();return{supported:!0,installed:s(e),path:e}}if(process.platform==="linux"){let e=b();return{supported:!0,installed:s(e),path:e}}return{supported:!1,installed:!1}}async function we({port:e,force:t}){if(A())throw new Error("background daemon setup is unavailable in this environment");let r=ge();if(console.log(` binary: ${[r.executable,...r.prefixArgs].join(" ")}`),console.log(` port: ${e}`),process.platform==="darwin"){re().missing||console.log(` removed legacy ${B} service`);let o=$();if(s(o)&&!t){console.log(` already installed at ${o}`),console.log(" pass --force to overwrite, or use 'rnx daemon restart' to reload");return}P(C(o),{recursive:!0}),X(o,$e(r,e)),console.log(` wrote ${o}`);let a=`gui/${process.getuid()}`,l=`${a}/${y}`,p=()=>{let d=c("launchctl",["bootstrap",a,o],{stdio:"pipe",encoding:"utf8"}),S=(d.stderr||d.stdout||"").trim();if(d.status!==0)return{ok:!1,reason:`bootstrap exit ${d.status}${S?`: ${S}`:""}`};let R=c("launchctl",["print",l],{encoding:"utf8"});return R.status!==0?{ok:!1,reason:`bootstrap returned 0 but service not registered (print exit ${R.status})`}:{ok:!0}},i=p();if(!i.ok){let d=i.reason;if(c("launchctl",["bootout",l],{stdio:"ignore"}),i=p(),!i.ok)throw new Error(`launchctl bootstrap failed: ${i.reason}`+(d!==i.reason?` (initial: ${d})`:"")+" \u2014 try `rnx daemon uninstall` then retry, or reboot if launchd state is stuck.")}let f=Date.now()+4e3,x,w;for(;Date.now()<f;){let d=c("launchctl",["print",l],{encoding:"utf8"});if(d.status===0&&(x=d.stdout?.match(/state\s*=\s*(\w+)/)?.[1],w=d.stdout?.match(/pid\s*=\s*(\d+)/)?.[1],x==="running"||w))break;await new Promise(S=>setTimeout(S,150))}if(x!=="running"&&!w)throw new Error(`daemon registered but did not reach running state within 4s (last state: ${x||"unknown"}). check ${u(m,"bridge.err.log")} \u2014 typically a stale runtime or a port already bound by another process.`);console.log(` registered (state: ${x||"unknown"}${w?`, pid ${w}`:""}, log: ${u(m,"bridge.err.log")})`);return}if(process.platform==="linux"){let n=b();if(s(n)&&!t){console.log(` already installed at ${n}`),console.log(" pass --force to overwrite, or use 'rnx daemon restart' to reload");return}P(C(n),{recursive:!0}),X(n,be(r,e)),console.log(` wrote ${n}`);let o=c("systemctl",["--user","daemon-reload"],{stdio:"pipe",encoding:"utf8"});if(o.status!==0){let i=(o.stderr||o.stdout||"").trim();throw new Error(`systemctl daemon-reload failed${i?`: ${i}`:""}`)}let a=c("systemctl",["--user","enable","--now",g],{stdio:"pipe",encoding:"utf8"});if(a.status!==0){let i=(a.stderr||a.stdout||"").trim();throw new Error(`systemctl enable --now failed${i?`: ${i}`:""} \u2014 try \`rnx daemon uninstall\` then retry.`)}let p=(c("systemctl",["--user","is-active",g],{encoding:"utf8"}).stdout||"").trim()||"unknown";console.log(` registered (state: ${p}, journalctl --user -u ${g} to tail logs)`);try{let i=process.env.USER||process.env.LOGNAME||"";if(i){let f=c("loginctl",["show-user",i,"--property=Linger","--value"],{encoding:"utf8"});!((f.stdout||"").trim().toLowerCase()==="yes")&&f.status===0&&console.log(` note: linger is not enabled for "${i}". the daemon will exit at logout.
73
- enable persistence with: sudo loginctl enable-linger ${i}`)}}catch{}return}console.error(` background daemon is not supported on ${process.platform}`),console.error(" run 'rnx serve' in a persistent shell instead"),process.exit(1)}function re(e={}){let t=e.userHome??v(),r=ve(t),n=u(t,"Library/Logs/sootsim"),o=[];if(s(r)){let a=`${e.launchTarget??`gui/${process.getuid?.()??0}`}/${B}`;(e.bootout??(p=>{c("launchctl",["bootout",p],{stdio:"ignore"})}))(a),h(r,{force:!0}),o.push(r)}for(let a of["server.err.log","server.out.log"]){let l=u(n,a);s(l)&&(h(l,{force:!0}),o.push(l))}return{removed:o,missing:o.length===0}}function Se(){let e=[];if(process.platform==="darwin"){let t=re();e.push(...t.removed);let r=$();s(r)&&(c("launchctl",["bootout",`gui/${process.getuid()}/${y}`],{stdio:"ignore"}),h(r,{force:!0}),e.push(r));let n=D();return s(n)&&(h(n,{recursive:!0,force:!0}),e.push(n)),s(m)&&(h(m,{recursive:!0,force:!0}),e.push(m)),{removed:e,missing:e.length===0}}if(process.platform==="linux"){let t=b();return s(t)&&(c("systemctl",["--user","disable","--now",g],{stdio:"ignore"}),h(t,{force:!0}),c("systemctl",["--user","daemon-reload"],{stdio:"ignore"}),c("systemctl",["--user","reset-failed",g],{stdio:"ignore"}),e.push(t)),s(L)&&(h(L,{recursive:!0,force:!0}),e.push(L)),{removed:e,missing:e.length===0}}return{removed:e,missing:!0}}function De(){let e=[],t=O();return s(t)&&(h(t,{recursive:!0,force:!0}),e.push(t)),{removed:e,missing:e.length===0}}async function Le(){let e=Se();for(let r of e.removed)console.log(` removed ${r}`);let t=De();for(let r of t.removed)console.log(` removed ${r}`);e.missing&&t.missing&&console.log(" not installed")}function Z(){let e=M();if(j(e)){console.log(` bridge: responding on port ${e.bridgePort} (pid ${e.pid})`);return}console.log(e?" bridge: NOT responding \u2014 stale lockfile; check `rnx daemon logs`":" bridge: NOT responding \u2014 no lockfile; check `rnx daemon logs`")}async function Pe(){if(process.platform==="darwin"){let e=$();if(!s(e)){console.log(" installed: no");return}console.log(` installed: yes (${e})`);let t=Te(e);t&&console.log(` binary: ${t}`);let r=c("launchctl",["print",`gui/${process.getuid()}/${y}`],{encoding:"utf8"});if(r.status===0){let n=r.stdout.match(/state\s*=\s*(\w+)/)?.[1],o=r.stdout.match(/pid\s*=\s*(\d+)/)?.[1];console.log(` state: ${n||"unknown"}${o?` (pid ${o})`:""}`)}else console.log(" state: not running");Z();return}if(process.platform==="linux"){let e=b();if(!s(e)){console.log(" installed: no");return}console.log(` installed: yes (${e})`);let t=c("systemctl",["--user","is-active",g],{encoding:"utf8"});console.log(` state: ${t.stdout.trim()||"unknown"}`),Z();return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Ee(){if(process.platform==="darwin"){let e=$();s(e)||(console.error(" daemon not registered \u2014 run `rnx setup`"),process.exit(1));let t=c("launchctl",["kickstart","-k",`gui/${process.getuid()}/${y}`],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` kickstart failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}if(process.platform==="linux"){let e=b();s(e)||(console.error(" daemon not registered \u2014 run `rnx setup`"),process.exit(1));let t=c("systemctl",["--user","restart",g],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` restart failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Ae(){if(process.platform==="darwin"){let e=$();s(e)||(console.error(" daemon not registered \u2014 run `rnx setup`"),process.exit(1));let t=c("launchctl",["kickstart",`gui/${process.getuid()}/${y}`],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` start failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" started");return}if(process.platform==="linux"){let e=b();s(e)||(console.error(" daemon not registered \u2014 run `rnx setup`"),process.exit(1));let t=c("systemctl",["--user","start",g],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` start failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" started");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Ie(){if(process.platform==="darwin"){let e=$();s(e)||(console.error(" daemon not registered \u2014 nothing to stop"),process.exit(1));let t=c("launchctl",["bootout",`gui/${process.getuid()}/${y}`],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` stop failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" stopped");return}if(process.platform==="linux"){let e=b();s(e)||(console.error(" daemon not registered \u2014 nothing to stop"),process.exit(1));let t=c("systemctl",["--user","stop",g],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` stop failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" stopped");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Ne(e){let t=e.find(o=>/^-n\d+$|^--lines=\d+$|^\d+$/.test(o)),r=t?Number(t.replace(/\D/g,"")):200,n=e.includes("-f")||e.includes("--follow");if(process.platform==="darwin"){let o=u(m,"bridge.out.log"),a=u(m,"bridge.err.log"),l=[o,a].filter(i=>s(i));l.length===0&&(console.error(` no daemon logs yet at ${m} \u2014 run \`rnx setup\` to install the daemon`),process.exit(1));let p=n?["-n",String(r),"-F",...l]:["-n",String(r),...l];c("tail",p,{stdio:"inherit"});return}if(process.platform==="linux"){let o=`${g}.service`,a=["--user","-u",o,"-n",String(r),"--no-pager"],l=c("journalctl",n?[...a,"-f"]:a,{encoding:"utf8",stdio:n?"inherit":"pipe"});if(n)return;let p=`${l.stdout||""}${l.stderr||""}`,i=/insufficient permissions|No journal files were opened/i.test(p);if(l.status===0&&!i){process.stdout.write(l.stdout||"");return}let f=c("journalctl",[`_SYSTEMD_USER_UNIT=${o}`,"-n",String(r),"--no-pager"],{encoding:"utf8"});if(f.status===0&&(f.stdout||"").trim()){process.stdout.write(f.stdout);return}console.error(` could not read --user journal for ${o} (this user isn't in the systemd-journal group yet).
74
- run: sudo journalctl _SYSTEMD_USER_UNIT=${o} -n ${r} --no-pager`),process.exit(1)}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}function Te(e){try{return ue(e,"utf8").match(/<array>\s*<string>([^<]+)<\/string>/)?.[1]||null}catch{return null}}export{Xe as a,Qe as b,we as c,re as d,Se as e,De as f};
72
+ `}function $e(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function xe(e){return/[^\w@%+=:,./-]/.test(e)?`'${e.replace(/'/g,"'\\''")}'`:e}function $(){return u(v(),"Library/LaunchAgents",`${y}.plist`)}function be(e=v()){return u(e,"Library/LaunchAgents",`${B}.plist`)}function x(){return u(v(),".config/systemd/user",`${g}.service`)}function Xe(){if(I())return{supported:!1,installed:!1};if(process.platform==="darwin"){let e=$();return{supported:!0,installed:s(e),path:e}}if(process.platform==="linux"){let e=x();return{supported:!0,installed:s(e),path:e}}return{supported:!1,installed:!1}}async function ke({port:e,force:t}){if(I())throw new Error("background daemon setup is unavailable in this environment");let r=pe();if(console.log(` binary: ${[r.executable,...r.prefixArgs].join(" ")}`),console.log(` port: ${e}`),process.platform==="darwin"){ee().missing||console.log(` removed legacy ${B} service`);let o=$();if(s(o)&&!t){console.log(` already installed at ${o}`),console.log(" pass --force to overwrite, or use 'rnx daemon restart' to reload");return}P(C(o),{recursive:!0}),X(o,he(r,e)),console.log(` wrote ${o}`);let a=`gui/${process.getuid()}`,l=`${a}/${y}`,p=()=>{let d=c("launchctl",["bootstrap",a,o],{stdio:"pipe",encoding:"utf8"}),w=(d.stderr||d.stdout||"").trim();if(d.status!==0)return{ok:!1,reason:`bootstrap exit ${d.status}${w?`: ${w}`:""}`};let R=c("launchctl",["print",l],{encoding:"utf8"});return R.status!==0?{ok:!1,reason:`bootstrap returned 0 but service not registered (print exit ${R.status})`}:{ok:!0}},i=p();if(!i.ok){let d=i.reason;if(c("launchctl",["bootout",l],{stdio:"ignore"}),i=p(),!i.ok)throw new Error(`launchctl bootstrap failed: ${i.reason}`+(d!==i.reason?` (initial: ${d})`:"")+" \u2014 try `rnx daemon uninstall` then retry, or reboot if launchd state is stuck.")}let f=Date.now()+4e3,b,S;for(;Date.now()<f;){let d=c("launchctl",["print",l],{encoding:"utf8"});if(d.status===0&&(b=d.stdout?.match(/state\s*=\s*(\w+)/)?.[1],S=d.stdout?.match(/pid\s*=\s*(\d+)/)?.[1],b==="running"||S))break;await new Promise(w=>setTimeout(w,150))}if(b!=="running"&&!S)throw new Error(`daemon registered but did not reach running state within 4s (last state: ${b||"unknown"}). check ${u(m,"bridge.err.log")} \u2014 typically a stale runtime or a port already bound by another process.`);console.log(` registered (state: ${b||"unknown"}${S?`, pid ${S}`:""}, log: ${u(m,"bridge.err.log")})`);return}if(process.platform==="linux"){let n=x();if(s(n)&&!t){console.log(` already installed at ${n}`),console.log(" pass --force to overwrite, or use 'rnx daemon restart' to reload");return}P(C(n),{recursive:!0}),X(n,ye(r,e)),console.log(` wrote ${n}`);let o=c("systemctl",["--user","daemon-reload"],{stdio:"pipe",encoding:"utf8"});if(o.status!==0){let i=(o.stderr||o.stdout||"").trim();throw new Error(`systemctl daemon-reload failed${i?`: ${i}`:""}`)}let a=c("systemctl",["--user","enable","--now",g],{stdio:"pipe",encoding:"utf8"});if(a.status!==0){let i=(a.stderr||a.stdout||"").trim();throw new Error(`systemctl enable --now failed${i?`: ${i}`:""} \u2014 try \`rnx daemon uninstall\` then retry.`)}let p=(c("systemctl",["--user","is-active",g],{encoding:"utf8"}).stdout||"").trim()||"unknown";console.log(` registered (state: ${p}, journalctl --user -u ${g} to tail logs)`);try{let i=process.env.USER||process.env.LOGNAME||"";if(i){let f=c("loginctl",["show-user",i,"--property=Linger","--value"],{encoding:"utf8"});!((f.stdout||"").trim().toLowerCase()==="yes")&&f.status===0&&console.log(` note: linger is not enabled for "${i}". the daemon will exit at logout.
73
+ enable persistence with: sudo loginctl enable-linger ${i}`)}}catch{}return}console.error(` background daemon is not supported on ${process.platform}`),console.error(" run 'rnx serve' in a persistent shell instead"),process.exit(1)}function ee(e={}){let t=e.userHome??v(),r=be(t),n=u(t,"Library/Logs/sootsim"),o=[];if(s(r)){let a=`${e.launchTarget??`gui/${process.getuid?.()??0}`}/${B}`;(e.bootout??(p=>{c("launchctl",["bootout",p],{stdio:"ignore"})}))(a),h(r,{force:!0}),o.push(r)}for(let a of["server.err.log","server.out.log"]){let l=u(n,a);s(l)&&(h(l,{force:!0}),o.push(l))}return{removed:o,missing:o.length===0}}function ve(){let e=[];if(process.platform==="darwin"){let t=ee();e.push(...t.removed);let r=$();s(r)&&(c("launchctl",["bootout",`gui/${process.getuid()}/${y}`],{stdio:"ignore"}),h(r,{force:!0}),e.push(r));let n=D();return s(n)&&(h(n,{recursive:!0,force:!0}),e.push(n)),s(m)&&(h(m,{recursive:!0,force:!0}),e.push(m)),{removed:e,missing:e.length===0}}if(process.platform==="linux"){let t=x();return s(t)&&(c("systemctl",["--user","disable","--now",g],{stdio:"ignore"}),h(t,{force:!0}),c("systemctl",["--user","daemon-reload"],{stdio:"ignore"}),c("systemctl",["--user","reset-failed",g],{stdio:"ignore"}),e.push(t)),s(L)&&(h(L,{recursive:!0,force:!0}),e.push(L)),{removed:e,missing:e.length===0}}return{removed:e,missing:!0}}function Se(){let e=[],t=F();return s(t)&&(h(t,{recursive:!0,force:!0}),e.push(t)),{removed:e,missing:e.length===0}}async function we(){let e=ve();for(let r of e.removed)console.log(` removed ${r}`);let t=Se();for(let r of t.removed)console.log(` removed ${r}`);e.missing&&t.missing&&console.log(" not installed")}function z(){let e=j();if(M(e)){console.log(` bridge: responding on port ${e.bridgePort} (pid ${e.pid})`);return}console.log(e?" bridge: NOT responding \u2014 stale lockfile; check `rnx daemon logs`":" bridge: NOT responding \u2014 no lockfile; check `rnx daemon logs`")}async function De(){if(process.platform==="darwin"){let e=$();if(!s(e)){console.log(" installed: no");return}console.log(` installed: yes (${e})`);let t=Ae(e);t&&console.log(` binary: ${t}`);let r=c("launchctl",["print",`gui/${process.getuid()}/${y}`],{encoding:"utf8"});if(r.status===0){let n=r.stdout.match(/state\s*=\s*(\w+)/)?.[1],o=r.stdout.match(/pid\s*=\s*(\d+)/)?.[1];console.log(` state: ${n||"unknown"}${o?` (pid ${o})`:""}`)}else console.log(" state: not running");z();return}if(process.platform==="linux"){let e=x();if(!s(e)){console.log(" installed: no");return}console.log(` installed: yes (${e})`);let t=c("systemctl",["--user","is-active",g],{encoding:"utf8"});console.log(` state: ${t.stdout.trim()||"unknown"}`),z();return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Le(){if(process.platform==="darwin"){let e=$();s(e)||(console.error(" daemon not registered \u2014 run `rnx setup`"),process.exit(1));let t=c("launchctl",["kickstart","-k",`gui/${process.getuid()}/${y}`],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` kickstart failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}if(process.platform==="linux"){let e=x();s(e)||(console.error(" daemon not registered \u2014 run `rnx setup`"),process.exit(1));let t=c("systemctl",["--user","restart",g],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` restart failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Pe(){if(process.platform==="darwin"){let e=$();s(e)||(console.error(" daemon not registered \u2014 run `rnx setup`"),process.exit(1));let t=c("launchctl",["kickstart",`gui/${process.getuid()}/${y}`],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` start failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" started");return}if(process.platform==="linux"){let e=x();s(e)||(console.error(" daemon not registered \u2014 run `rnx setup`"),process.exit(1));let t=c("systemctl",["--user","start",g],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` start failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" started");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Ee(){if(process.platform==="darwin"){let e=$();s(e)||(console.error(" daemon not registered \u2014 nothing to stop"),process.exit(1));let t=c("launchctl",["bootout",`gui/${process.getuid()}/${y}`],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` stop failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" stopped");return}if(process.platform==="linux"){let e=x();s(e)||(console.error(" daemon not registered \u2014 nothing to stop"),process.exit(1));let t=c("systemctl",["--user","stop",g],{stdio:"pipe",encoding:"utf8"});t.status!==0&&(console.error(` stop failed: ${t.stderr?.trim()}`),process.exit(1)),console.log(" stopped");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Ie(e){let t=e.find(o=>/^-n\d+$|^--lines=\d+$|^\d+$/.test(o)),r=t?Number(t.replace(/\D/g,"")):200,n=e.includes("-f")||e.includes("--follow");if(process.platform==="darwin"){let o=u(m,"bridge.out.log"),a=u(m,"bridge.err.log"),l=[o,a].filter(i=>s(i));l.length===0&&(console.error(` no daemon logs yet at ${m} \u2014 run \`rnx setup\` to install the daemon`),process.exit(1));let p=n?["-n",String(r),"-F",...l]:["-n",String(r),...l];c("tail",p,{stdio:"inherit"});return}if(process.platform==="linux"){let o=`${g}.service`,a=["--user","-u",o,"-n",String(r),"--no-pager"],l=c("journalctl",n?[...a,"-f"]:a,{encoding:"utf8",stdio:n?"inherit":"pipe"});if(n)return;let p=`${l.stdout||""}${l.stderr||""}`,i=/insufficient permissions|No journal files were opened/i.test(p);if(l.status===0&&!i){process.stdout.write(l.stdout||"");return}let f=c("journalctl",[`_SYSTEMD_USER_UNIT=${o}`,"-n",String(r),"--no-pager"],{encoding:"utf8"});if(f.status===0&&(f.stdout||"").trim()){process.stdout.write(f.stdout);return}console.error(` could not read --user journal for ${o} (this user isn't in the systemd-journal group yet).
74
+ run: sudo journalctl _SYSTEMD_USER_UNIT=${o} -n ${r} --no-pager`),process.exit(1)}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}function Ae(e){try{return ae(e,"utf8").match(/<array>\s*<string>([^<]+)<\/string>/)?.[1]||null}catch{return null}}export{qe as a,Xe as b,ke as c,ee as d,ve as e,Se as f};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.345 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ var e=["SOOTSIM_AGENT","TM_SESSION","CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","CURSOR_TRACE_ID","AIDER_MODEL"];function n(){if(process.env.SOOTSIM_AGENT==="0")return!1;for(let _ of e){let E=process.env[_];if(E&&E.trim()&&E!=="0")return!0}return!1}export{n as a};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (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
4
  var c="sootsim-agent-prompt-v1";function r(n){return typeof n=="string"?n.trim():""}function m(n){let e=r(n.text);if(!e)return"";let t=r(n.displayText),s=r(n.inspectSummary),o=r(n.inspectTrace);return!!s||!!o||/[\r\n]/.test(e)||!!t&&t!==e?JSON.stringify({__sootsimAgentPrompt:c,text:e,displayText:t,inspectSummary:s,inspectTrace:o}):e}function u(n){let e=r(n);if(!e)return null;try{let t=JSON.parse(e);if(t.__sootsimAgentPrompt!==c)return{text:e};let s=r(typeof t.text=="string"?t.text:void 0);if(!s)return null;let o=r(typeof t.displayText=="string"?t.displayText:void 0),i=r(typeof t.inspectSummary=="string"?t.inspectSummary:void 0),p=r(typeof t.inspectTrace=="string"?t.inspectTrace:void 0);return{text:s,...o?{displayText:o}:{},...i?{inspectSummary:i}:{},...p?{inspectTrace:p}:{}}}catch{return{text:e}}}export{m as a,u as b};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.345 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a as s}from"./chunk-3N7M5HMJ.js";import{a as t}from"./chunk-BHKSCNDC.js";import{C as o,D as n}from"./chunk-LRM2XCEQ.js";function a(){return process.env.CI==="1"||process.env.CI==="true"||process.env.GITHUB_ACTIONS==="true"}function c(){return process.stdin.isTTY===!0&&!a()&&!t()}function l(e=o()){let r=process.env.DO_NOT_TRACK;return r==="1"||r==="true"||!c()?!1:e.configured&&e.productAnalytics}async function P(e){let r=o();if(r.configured)return r;if(!e.prompt||!c())return{productAnalytics:!1,crashReports:!1,configured:!1};let i=await s("Share anonymous package incompatibilities and error classes to improve rnx?",!1);return n({productAnalytics:i,crashReports:!1}),o()}export{c as a,l as b,P as c};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (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
4
  function p(){console.error(" no rnx desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" rnx desktop install"),console.error(""),console.error(" or run setup to install the background daemon:"),console.error(" rnx setup"),console.error("")}function t(r){console.error(""),console.error(` no sim is connected to the rnx bridge on port ${r}.`),console.error(""),console.error(" start your app dev server, then open it in rnx:"),console.error(" npx expo start --localhost --port 8081"),console.error(" rnx open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" rnx describe")}async function a(r,n,s){let e=[];try{e=await r.listSims()}catch{}if(console.error(""),e.length===0){t(n);return}console.error(` no sim with id "${s}" is connected to the bridge on port ${n}.`),console.error(""),console.error(" connected sims:");for(let o of e){let i=[o.isPrimary?"primary":null,o.readyState,o.userVisible===!1?"hidden":o.userVisible===!0?"visible":null,o.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${o.id} (${i})`)}console.error(""),console.error(" pass a valid --sim id, or run `rnx list` to see all sessions.")}export{p as a,t as b,a as c};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.345 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import i from"node:fs";import r from"node:path";var e=["app.config.js","app.config.ts","app.config.cjs","app.config.mjs","app.json"],p=["sootsim.config.ts","sootsim.config.js","sootsim.config.mjs","sootsim.config.cjs"];function c(n,t){for(let o of t){let s=r.join(n,o);try{if(i.statSync(s).isFile())return s}catch{}}return null}function f(n){return c(n,e)}function l(n){return c(n,p)}function u(n){let t=r.resolve(n);try{if(!i.statSync(t).isDirectory())return null}catch{return null}let o=l(t);return!o&&!f(t)&&!i.existsSync(r.join(t,"package.json"))?null:{appDir:t,configPath:o}}export{u as a};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (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
4
  import{execFileSync as h,spawn as g}from"child_process";import{existsSync as s,readdirSync as k}from"fs";import{dirname as m,join as l,resolve as a}from"path";import{fileURLToPath as w}from"url";var c;function p(){if(c!==void 0)return c;try{c=m(w(import.meta.resolve("sootsim-engine/package.json")))}catch{c=null}return c}var v="dev.sootsim.simulator";function I(){let e=p();if(!e)return null;let n=l(e,"dist-electron/main.cjs");if(!s(n))return null;let i=P(e);return i?{path:i,platform:process.platform,kind:"dev-electron",engineDir:e}:null}function x(){let e=p();return e?s(l(e,"src-electron/main.ts")):!1}function P(e){let n=e;for(let i=0;i<6;i++){let t=l(n,"node_modules/.bin/electron");if(s(t))return t;let r=m(n);if(r===n)break;n=r}return null}function b(){let e=p(),i=["/Applications/sootsim.app",a(process.env.HOME||"","Applications/sootsim.app"),...e?[a(e,"app/sootsim.app")]:[]].find(t=>s(t));if(i)return{path:i,platform:"darwin",kind:"mac-app"};try{let t=h("mdfind",[`kMDItemCFBundleIdentifier == "${v}"`],{encoding:"utf8",timeout:3e3}).trim();if(t)return{path:t.split(`
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (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 r}from"./chunk-SW4DV2TY.js";var i=[{title:"Overview",route:"/docs/rnx/cli"},...r.slice().sort((o,t)=>o.order-t.order).map(o=>({title:o.navTitle,route:`/docs/rnx/cli/${o.slug}`}))];
4
+ import{a as r}from"./chunk-VLBN3KRC.js";var i=[{title:"Overview",route:"/docs/rnx/cli"},...r.slice().sort((o,t)=>o.order-t.order).map(o=>({title:o.navTitle,route:`/docs/rnx/cli/${o.slug}`}))];
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (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-RO3WVQPB.js";import{q as l,s as i}from"./chunk-G3B2RZ47.js";function c(r){if(!r||typeof r!="object")return!1;let t=Reflect.get(r,"strategy");return typeof Reflect.get(r,"ok")=="boolean"&&(t==="data"||t==="full")&&Array.isArray(Reflect.get(r,"cleared"))&&typeof Reflect.get(r,"relaunched")=="boolean"}function d(){console.log(`
4
+ import{m as a}from"./chunk-ZMTZ5G5H.js";import{q as l,s as i}from"./chunk-KA4PJNTE.js";function c(r){if(!r||typeof r!="object")return!1;let t=Reflect.get(r,"strategy");return typeof Reflect.get(r,"ok")=="boolean"&&(t==="data"||t==="full")&&Array.isArray(Reflect.get(r,"cleared"))&&typeof Reflect.get(r,"relaunched")=="boolean"}function d(){console.log(`
5
5
  rnx reset - clear the current guest app and relaunch it
6
6
 
7
7
  usage:
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (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
4
  var m={"--help":{type:"boolean",short:"-h"},"--version":{type:"boolean",short:"-V"},"--verbose":{type:"boolean",short:"-v"},"--port":{type:"number",short:"-p"},"--device":{type:"string",short:"-d"},"--theme":{type:"string",short:"-t"},"--headless":{type:"boolean"},"--driver":{type:"string"},"--sim":{type:"string"},"--session":{type:"string"},"--tab":{type:"string"}},p=new Set(["list","describe","find","get","do","wait","network","logs","shell"]),b=new Set(["do","get","wait","shell","debug"]),d=new Set(["detox","maestro","record","film","storage","permissions","perf","screenshot","state","reset","camera","mode","debug","timeline","what-happened","shell","assert","device","open","list","use","claim","close","compat","report-issue","desktop","login","logout","auth","setup","serve","daemon","runtime","upgrade","version","skill","config","cleanup","app-fonts","agent-wrapper","agent",...p]);function u(c){let n=c.slice(2),e={command:null,commandArgs:[],globalFlags:{},help:!1,version:!1,verbose:!1},s=0;for(;s<n.length;){let o=n[s];if(o==="--"){e.commandArgs.push(...n.slice(s+1));break}let i=Object.entries(m).find(([a,r])=>a===o||r.short===o);if(i){let[a,r]=i,l=a.replace(/^--/,"");if(r.type==="boolean")e.globalFlags[l]=!0,s++;else{let t=n[s+1];if(t===void 0||t.startsWith("-")){console.error(` warning: ${o} requires a value`),s++;continue}if(r.type==="number"){let g=Number(t);if(Number.isNaN(g)){console.error(` warning: ${o} requires a number, got "${t}"`),s+=2;continue}e.globalFlags[l]=g}else e.globalFlags[l]=t;s+=2}continue}if(!e.command&&!o.startsWith("-")){let a=o.indexOf("-");if(a>0){let r=o.slice(0,a),l=o.slice(a+1);if(b.has(r)&&l.length>0){e.command=r;let t=n.slice(s+1);e.commandArgs=[l,...t[0]==="--"?t.slice(1):t];break}}if(d.has(o)){e.command=o;let r=n.slice(s+1);e.commandArgs=r[0]==="--"?r.slice(1):r;break}e.commandArgs=n.slice(s);break}e.commandArgs.push(o),s++}return e.help=!!e.globalFlags.help,e.version=!!e.globalFlags.version,e.verbose=!!e.globalFlags.verbose,e}export{p as a,u as b};
@@ -1,3 +1,3 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (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 O,b as B}from"./chunk-6SLM6URN.js";import{M as T,N,O as _,P as W,g as F}from"./chunk-4RKTGL63.js";var Ie="http://localhost:7668/";function H(e){if(typeof e=="number")return Number.isInteger(e)&&e>0?e:null;if(typeof e!="string")return null;let t=e.trim();if(!t)return null;let r=Number(t);return Number.isInteger(r)&&r>0?r:null}function X(e){let t=H(e);return t===null?0:t}function V(e={}){let t=H(e.explicitPort);return t!==null?t:7668+X(e.portOffset)}var z=5173;var Q=2e3;function Pe(e){let t=e-7668;return t<0||t>Q?null:`http://localhost:${z+t}/`}var ye=4001,Te="sootsim close";import{existsSync as Z,mkdirSync as ee,readFileSync as te,rmSync as E,writeFileSync as re}from"fs";import{tmpdir as ne}from"os";import{dirname as ie,join as oe,resolve as se}from"path";var v=1,G="SOOTSIM_CLI_CURRENT_SIM_PATH",le=["SOOTSIM_CLI_IDENTITY","TM_SESSION","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"],j=/^(?:tmux|screen)|^tm$/i;function q(e,t=20){let r=e,n=O(e);if(!n||n<=1){let o=B(e);return e>1&&o&&!j.test(o)?e:null}for(let o=0;o<t;o++){let s=B(n);if(s&&j.test(s))return r;let u=O(n);if(!u||u<=1)return s?n:r;r=n,n=u}return n}function x(){for(let t of le){let r=process.env[t];if(r&&r.trim())return{key:`${t}:${r.trim()}`,source:t,stable:!0}}let e=q(process.ppid);return e&&e>1?{key:`gppid-${e}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}function ce(){return x().key}function ve(){return q(process.ppid)}function k(){if(process.env[G])return se(process.env[G]);let e=ce();return oe(ne(),`sootsim-current-sim-${e}.json`)}function de(){let e=k();if(!Z(e))return null;try{let t=JSON.parse(te(e,"utf8"));return t.version!==v||typeof t.simId!="string"||!t.simId.trim()||typeof t.updatedAt!="string"?(E(e,{force:!0}),null):{version:v,simId:t.simId.trim(),updatedAt:t.updatedAt}}catch{return E(e,{force:!0}),null}}function R(){return de()?.simId||null}function xe(e){let t=e.trim();if(!t)return;let r=k();ee(ie(r),{recursive:!0}),re(r,JSON.stringify({version:v,simId:t,updatedAt:new Date().toISOString()},null,2)+`
4
+ import{a as O,b as B}from"./chunk-KZFJNDH3.js";import{M as T,N,O as _,P as W,g as F}from"./chunk-LRM2XCEQ.js";var Ie="http://localhost:7668/";function H(e){if(typeof e=="number")return Number.isInteger(e)&&e>0?e:null;if(typeof e!="string")return null;let t=e.trim();if(!t)return null;let r=Number(t);return Number.isInteger(r)&&r>0?r:null}function X(e){let t=H(e);return t===null?0:t}function V(e={}){let t=H(e.explicitPort);return t!==null?t:7668+X(e.portOffset)}var z=5173;var Q=2e3;function Pe(e){let t=e-7668;return t<0||t>Q?null:`http://localhost:${z+t}/`}var ye=4001,Te="sootsim close";import{existsSync as Z,mkdirSync as ee,readFileSync as te,rmSync as E,writeFileSync as re}from"fs";import{tmpdir as ne}from"os";import{dirname as ie,join as oe,resolve as se}from"path";var v=1,G="SOOTSIM_CLI_CURRENT_SIM_PATH",le=["SOOTSIM_CLI_IDENTITY","TM_SESSION","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"],j=/^(?:tmux|screen)|^tm$/i;function q(e,t=20){let r=e,n=O(e);if(!n||n<=1){let o=B(e);return e>1&&o&&!j.test(o)?e:null}for(let o=0;o<t;o++){let s=B(n);if(s&&j.test(s))return r;let u=O(n);if(!u||u<=1)return s?n:r;r=n,n=u}return n}function x(){for(let t of le){let r=process.env[t];if(r&&r.trim())return{key:`${t}:${r.trim()}`,source:t,stable:!0}}let e=q(process.ppid);return e&&e>1?{key:`gppid-${e}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}function ce(){return x().key}function ve(){return q(process.ppid)}function k(){if(process.env[G])return se(process.env[G]);let e=ce();return oe(ne(),`sootsim-current-sim-${e}.json`)}function de(){let e=k();if(!Z(e))return null;try{let t=JSON.parse(te(e,"utf8"));return t.version!==v||typeof t.simId!="string"||!t.simId.trim()||typeof t.updatedAt!="string"?(E(e,{force:!0}),null):{version:v,simId:t.simId.trim(),updatedAt:t.updatedAt}}catch{return E(e,{force:!0}),null}}function R(){return de()?.simId||null}function xe(e){let t=e.trim();if(!t)return;let r=k();ee(ie(r),{recursive:!0}),re(r,JSON.stringify({version:v,simId:t,updatedAt:new Date().toISOString()},null,2)+`
5
5
  `)}function J(){E(k(),{force:!0})}var h="http://localhost:5173/";import ue from"node:fs";import S from"node:path";import{WebSocket as D}from"ws";var C=null;function M(){return N().filter(e=>W(e))}function Y(e){let t=S.resolve(e);for(;;){if(ue.existsSync(S.join(t,".git")))return t;let r=S.dirname(t);if(r===t)return null;t=r}}function K(e,t){let r=S.relative(e,t);return r===""||r!==".."&&!r.startsWith(`..${S.sep}`)&&!S.isAbsolute(r)}function ae(){let e=M();if(e.length===0)return null;if(process.env.SOOTSIM_BRIDGE_PORT!==void 0||process.env.PORT_OFFSET!==void 0){let r=V({explicitPort:process.env.SOOTSIM_BRIDGE_PORT,portOffset:process.env.PORT_OFFSET}),n=e.find(o=>o.bridgePort===r);if(n)return n}let t=null;try{t=process.cwd()}catch{}if(t){let r=Y(t),n=e.filter(o=>{let s=Y(o.cwd);return r&&s?r===s:K(t,o.cwd)||K(o.cwd,t)});if(n.length>0)return n.find(o=>o.bridgePort===7668)??n[0]}return e.find(r=>r.bridgePort===7668)??e[0]}function me(){let e=F();if(C?.homeDir===e)return C.world;let t=fe();return C={homeDir:e,world:t},t}function fe(){let e=ae();if(e)return{source:"dev-bridge",bridgePort:e.bridgePort,shellBaseUrl:e.shellPort?`http://localhost:${e.shellPort}/`:h};let t=T();return t&&_(t)?{source:"daemon",bridgePort:t.bridgePort,shellBaseUrl:t.runtimePort>0?`http://localhost:${t.runtimePort}/`:h}:{source:"default",bridgePort:7668,shellBaseUrl:h}}function ge(e){let t=M().find(n=>n.bridgePort===e);if(t)return{source:"dev-bridge",shellBaseUrl:t.shellPort?`http://localhost:${t.shellPort}/`:h};let r=T();return r&&_(r)&&r.bridgePort===e?{source:"daemon",shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:h}:null}function Fe(e){let t;try{let o=new URL(e);t=o.port?Number(o.port):o.protocol==="https:"?443:80}catch{return null}if(!Number.isFinite(t)||t<=0)return null;let r=M().find(o=>o.shellPort===t||o.runtimePort===t||o.bridgePort===t);if(r)return r.bridgePort;let n=T();return n&&_(n)&&(n.runtimePort===t||n.bridgePort===t)?n.bridgePort:null}function pe(){return me().bridgePort}function Ne(e,t){let r=ge(e),n=r?.source==="dev-bridge"?"dev bridge":r?.source==="daemon"?"daemon bridge":"bridge",o=r?.source==="dev-bridge"?`dev-bridges/${e}.json`:r?.source==="daemon"?"daemon.json":"no lockfile",s=t??r?.shellBaseUrl;process.stderr.write(` \u2192 ${n} :${e} (${s?`shell ${s}, `:""}${o})
6
6
  `)}var A=class extends Error{lock;constructor(t,r){super(t),this.name="BridgeSimLockedError",this.lock=r}};function he(e){return e==="flag"?"via --sim":e==="saved"?"saved via `rnx use`":"primary fallback \u2014 no sim pinned"}function We(e,t={}){let r=new Set,n=t.port??pe(),o=t.port!==void 0,s=t.commandTimeoutMs??15e3,u,a="none",I=new Set(t.stripBooleanFlags??[]),P=new Set(t.stripValueFlags??[]);for(let l=0;l<e.length;l++){let i=e[l];if(i==="--port"||i==="-p"){r.add(l),o=!0,l+1<e.length&&(r.add(l+1),n=Number(e[l+1])),l++;continue}if(i.startsWith("--port=")){r.add(l),o=!0,n=Number(i.slice(7));continue}if(i==="--timeout"){r.add(l),l+1<e.length&&(r.add(l+1),s=Number(e[l+1])),l++;continue}if(i==="--sim"||i==="--session"||i==="--tab"){r.add(l),l+1<e.length&&(r.add(l+1),u=e[l+1]?.trim()||void 0,a="flag"),l++;continue}let c=i.startsWith("--sim=")?i.slice(6):i.startsWith("--session=")?i.slice(10):i.startsWith("--tab=")?i.slice(6):void 0;if(c!==void 0){r.add(l),u=c.trim()||void 0,a="flag";continue}if(I.has(i)){r.add(l);continue}P.has(i)&&(r.add(l),l+1<e.length&&r.add(l+1),l++)}if(!u){let l=R();l&&(u=l.trim()||void 0,a="saved")}return{positional:e.filter((l,i)=>!r.has(i)),wsPort:n,explicitPort:o,simId:u,simIdSource:a,commandTimeoutMs:s}}function Se(e,t={}){let r=1,n=t.commandTimeoutMs??15e3,o=new Map,s=new D(`ws://localhost:${e}`),u=x(),a=new Promise((i,c)=>{s.on("open",()=>{try{s.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:u.key,cliIdentitySource:u.source,cliLabel:t.cliLabel}))}catch{}i()}),s.on("error",d=>{let m=d.message?`: ${d.message}`:"";c(new Error(`could not connect to ws://localhost:${e}${m}`))})});a.catch(()=>{});let I=!1,P=!1;function l(i,c){if(P||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||i.startsWith("bridge:")||i==="focus"||i==="close")return;P=!0;let d=c??"primary",m=he(c?t.simIdSource:"none");process.stderr.write(` \u2192 ${d} (${m})
7
7
  `)}return s.on("message",i=>{let c;try{c=JSON.parse(i.toString())}catch{return}if(c.id===0)return;let d=o.get(c.id);d&&(o.delete(c.id),c._otherCliCount>0&&!I&&(I=!0,process.stderr.write(`
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (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 $}from"./chunk-OYLIWHDB.js";import{b as y,c as R,d as f,e as w,f as a}from"./chunk-W7EXE22C.js";import{n as x}from"./chunk-G3B2RZ47.js";import{I as g,J as u,K as d,Q as h,l as p}from"./chunk-4RKTGL63.js";import O from"fs";import{WebSocket as E}from"ws";function C(t){if(!t||typeof t!="object")return!1;let e=Reflect.get(t,"sections");return typeof Reflect.get(t,"title")=="string"&&Array.isArray(e)&&e.every(o=>o&&typeof o=="object"&&typeof Reflect.get(o,"title")=="string"&&Array.isArray(Reflect.get(o,"items"))&&Reflect.get(o,"items").every(n=>n&&typeof n=="object"&&typeof Reflect.get(n,"summary")=="string"&&typeof Reflect.get(n,"hash")=="string"))}async function b(t,e=fetch){try{let o=new URL(w);o.searchParams.set("version",t);let n=await e(o,{headers:{accept:"application/json"},signal:AbortSignal.timeout(5e3)});if(!n.ok)return null;let s=await n.json();if(!s||typeof s!="object")return null;let i=Reflect.get(s,"entries");return!Array.isArray(i)||!C(i[0])?null:i[0]}catch{return null}}function A(t,e){let o=[`what's new in rnx engine v${t}:`];if(!e||e.sections.length===0)o.push(" release notes are not available yet");else for(let n of e.sections){o.push(` ${n.title}:`);for(let s of n.items)o.push(` \u2022 ${s.summary}`)}return o.push(` full changelog: ${f}`),o.join(`
4
+ import{b as $}from"./chunk-RTDHX6CW.js";import{n as x}from"./chunk-KA4PJNTE.js";import{b as y,c as R,d as f,e as w,f as a}from"./chunk-TEU5NGUA.js";import{I as g,J as u,K as d,Q as h,l as p}from"./chunk-LRM2XCEQ.js";import O from"fs";import{WebSocket as E}from"ws";function C(t){if(!t||typeof t!="object")return!1;let e=Reflect.get(t,"sections");return typeof Reflect.get(t,"title")=="string"&&Array.isArray(e)&&e.every(o=>o&&typeof o=="object"&&typeof Reflect.get(o,"title")=="string"&&Array.isArray(Reflect.get(o,"items"))&&Reflect.get(o,"items").every(n=>n&&typeof n=="object"&&typeof Reflect.get(n,"summary")=="string"&&typeof Reflect.get(n,"hash")=="string"))}async function b(t,e=fetch){try{let o=new URL(w);o.searchParams.set("version",t);let n=await e(o,{headers:{accept:"application/json"},signal:AbortSignal.timeout(5e3)});if(!n.ok)return null;let s=await n.json();if(!s||typeof s!="object")return null;let i=Reflect.get(s,"entries");return!Array.isArray(i)||!C(i[0])?null:i[0]}catch{return null}}function A(t,e){let o=[`what's new in rnx engine v${t}:`];if(!e||e.sections.length===0)o.push(" release notes are not available yet");else for(let n of e.sections){o.push(` ${n.title}:`);for(let s of n.items)o.push(` \u2022 ${s.summary}`)}return o.push(` full changelog: ${f}`),o.join(`
5
5
  `)}async function Q(t,e={}){let[o,...n]=t;if(!o||o==="--help"||o==="-h"){S();return}switch(o){case"install":return L(n,e);case"list":return j(n);case"use":return T(n);case"remove":return D(n);case"which":return G();case"notes":return U(n);default:console.error(` unknown runtime subcommand: ${o}`),S(),process.exit(1)}}function S(){console.log(`
6
6
  rnx runtime \u2014 manage engine runtimes under ~/.sootsim/runtimes/
7
7
 
@@ -27,4 +27,4 @@ examples:
27
27
  rnx runtime install --channel beta
28
28
  rnx runtime use 1.2.3
29
29
  rnx runtime notes
30
- `)}async function L(t,e){let{version:o,flags:n}=F(t),s=n.channel??e.channel??"stable",i=n.force===!0,l=n.setActive!==!1;g(),console.log("rnx runtime install"),console.log(` cdn: ${a.resolveCdnOrigin()}`);try{let r=await a.install({version:o,channel:s,force:i,setActive:l,protectVersions:h()});return console.log(` version: ${r.version} (channel: ${r.channel})`),r.installed?console.log(` installed ${r.version}`):console.log(` already installed at ${r.runtimeDir}`),l&&await k(r.version),r}catch(r){console.error(` ${I(r)}`),process.exit(1)}}async function k(t){d(t),console.log(` active: ${t}`),await _(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function _(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-3FXISM5I.js"),n=o();if(!e(n))return!1;let s=x();return new Promise(i=>{let l=!1,r=!1,m=N=>{l||(l=!0,i(N))},c=new E(`ws://127.0.0.1:${s}`,{handshakeTimeout:800}),v=setTimeout(()=>{try{c.close()}catch{}m(r)},1500);c.on("open",()=>{try{c.send(JSON.stringify({type:"runtime:use",version:t,id:0})),r=!0}catch{}setTimeout(()=>{try{c.close()}catch{}},100)}),c.on("close",()=>{clearTimeout(v),m(r)}),c.on("error",()=>{clearTimeout(v),m(!1)})})}async function j(t){g();let e=a.listInstalled(),o=u();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let n of e)console.log(` ${n===o?"*":" "} ${n}`);try{let n=await a.fetchManifest();console.log("available (latest per channel):");for(let[i,l]of Object.entries(n.channels))console.log(` ${i.padEnd(8)} ${l.latest}`);let s=Object.keys(n.versions).sort(y).reverse();if(s.length>1){console.log("hosted versions:");for(let i of s)console.log(` ${i}`)}}catch(n){console.log(`available: (could not fetch manifest: ${I(n)})`)}}async function T(t){let e=t[0];e||(console.error(" usage: rnx runtime use <version>"),process.exit(1));let o=a.listInstalled();o.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${o.join(", ")||"(none)"}`),console.error(` run \`rnx runtime install ${e}\` first`),process.exit(1)),await k(e)}async function D(t){let e=t[0];e||(console.error(" usage: rnx runtime remove <version>"),process.exit(1)),u()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `rnx runtime use <other>` first, or install another version"),process.exit(1)),h().includes(e)&&(console.error(` cannot remove runtime ${e} while a project is using it`),process.exit(1));let n=p(e);if(!O.existsSync(n)){console.error(` ${e} is not installed`);return}O.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function G(){let t=u();if(!t){console.log(" no active runtime");return}console.log(t)}async function U(t){t.length>0&&(console.error(" usage: rnx runtime notes"),process.exit(1));let{config:e}=await $(),o=e?.runtimeVersion??u();if(!o){console.log(" no active runtime"),console.log(` release notes: ${f}`);return}console.log(A(o,await b(o)))}function F(t){let e={},o=[];for(let n=0;n<t.length;n++){let s=t[n];if(s==="--channel"&&n+1<t.length){e.channel=t[n+1],n++;continue}if(s.startsWith("--channel=")){e.channel=s.slice(10);continue}if(s==="--force"){e.force=!0;continue}if(s==="--set-active=false"||s==="--no-set-active"){e.setActive=!1;continue}o.push(s)}return{version:o[0]??null,flags:e}}function I(t){return t instanceof Error?t.message:String(t)}export{b as a,A as b,Q as c};
30
+ `)}async function L(t,e){let{version:o,flags:n}=F(t),s=n.channel??e.channel??"stable",i=n.force===!0,l=n.setActive!==!1;g(),console.log("rnx runtime install"),console.log(` cdn: ${a.resolveCdnOrigin()}`);try{let r=await a.install({version:o,channel:s,force:i,setActive:l,protectVersions:h()});return console.log(` version: ${r.version} (channel: ${r.channel})`),r.installed?console.log(` installed ${r.version}`):console.log(` already installed at ${r.runtimeDir}`),l&&await k(r.version),r}catch(r){console.error(` ${I(r)}`),process.exit(1)}}async function k(t){d(t),console.log(` active: ${t}`),await _(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function _(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-75HP3HKA.js"),n=o();if(!e(n))return!1;let s=x();return new Promise(i=>{let l=!1,r=!1,m=N=>{l||(l=!0,i(N))},c=new E(`ws://127.0.0.1:${s}`,{handshakeTimeout:800}),v=setTimeout(()=>{try{c.close()}catch{}m(r)},1500);c.on("open",()=>{try{c.send(JSON.stringify({type:"runtime:use",version:t,id:0})),r=!0}catch{}setTimeout(()=>{try{c.close()}catch{}},100)}),c.on("close",()=>{clearTimeout(v),m(r)}),c.on("error",()=>{clearTimeout(v),m(!1)})})}async function j(t){g();let e=a.listInstalled(),o=u();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let n of e)console.log(` ${n===o?"*":" "} ${n}`);try{let n=await a.fetchManifest();console.log("available (latest per channel):");for(let[i,l]of Object.entries(n.channels))console.log(` ${i.padEnd(8)} ${l.latest}`);let s=Object.keys(n.versions).sort(y).reverse();if(s.length>1){console.log("hosted versions:");for(let i of s)console.log(` ${i}`)}}catch(n){console.log(`available: (could not fetch manifest: ${I(n)})`)}}async function T(t){let e=t[0];e||(console.error(" usage: rnx runtime use <version>"),process.exit(1));let o=a.listInstalled();o.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${o.join(", ")||"(none)"}`),console.error(` run \`rnx runtime install ${e}\` first`),process.exit(1)),await k(e)}async function D(t){let e=t[0];e||(console.error(" usage: rnx runtime remove <version>"),process.exit(1)),u()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `rnx runtime use <other>` first, or install another version"),process.exit(1)),h().includes(e)&&(console.error(` cannot remove runtime ${e} while a project is using it`),process.exit(1));let n=p(e);if(!O.existsSync(n)){console.error(` ${e} is not installed`);return}O.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function G(){let t=u();if(!t){console.log(" no active runtime");return}console.log(t)}async function U(t){t.length>0&&(console.error(" usage: rnx runtime notes"),process.exit(1));let{config:e}=await $(),o=e?.runtimeVersion??u();if(!o){console.log(" no active runtime"),console.log(` release notes: ${f}`);return}console.log(A(o,await b(o)))}function F(t){let e={},o=[];for(let n=0;n<t.length;n++){let s=t[n];if(s==="--channel"&&n+1<t.length){e.channel=t[n+1],n++;continue}if(s.startsWith("--channel=")){e.channel=s.slice(10);continue}if(s==="--force"){e.force=!0;continue}if(s==="--set-active=false"||s==="--no-set-active"){e.setActive=!1;continue}o.push(s)}return{version:o[0]??null,flags:e}}function I(t){return t instanceof Error?t.message:String(t)}export{b as a,A as b,Q as c};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (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
4
  var t=Object.freeze({id:"ios",displayName:"iOS",isIOS:!0,isAndroid:!1,select:e=>e.ios}),r=Object.freeze({id:"android",displayName:"Android",isIOS:!1,isAndroid:!0,select:e=>e.android}),i=Object.freeze({ios:t,android:r});
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (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
4
  import{execFileSync as P}from"child_process";import{readFileSync as a}from"fs";import{createRequire as d}from"module";var s=null,p=null;function k(r){s||(s=w());try{return s(r)}catch{return null}}function x(r){p||(p=_());try{return p(r)}catch{return null}}function _(){if(process.platform==="linux")return r=>{try{return a(`/proc/${r}/comm`,"utf8").trim()||null}catch{return null}};if(process.platform==="darwin"){let r=B();return r||(t=>b().get(t)?.comm||null)}return()=>null}function w(){let r=Number(process.env.PPID);if(Number.isFinite(r)&&r>1&&r!==process.ppid)return()=>r;if(process.platform==="linux")return C();if(process.platform==="darwin"){let t=h();return t||(n=>{let o=b().get(n)?.ppid;return o!==void 0&&o>0?o:null})}return()=>null}var L=2e3,i={readAt:0,rows:new Map};function b(){let r=Date.now();if(i.readAt&&r-i.readAt<L)return i.rows;let t=new Map;try{let n=P("ps",["-eo","pid=,ppid=,comm="],{encoding:"utf8",timeout:5e3,maxBuffer:8388608,stdio:["ignore","pipe","ignore"]});for(let o of n.split(`
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (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
4
  var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d};
@@ -0,0 +1,11 @@
1
+ /*! rnx v0.1.345 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{randomUUID as k}from"node:crypto";import n from"node:fs";import{homedir as _}from"node:os";import i from"node:path";var $="SOOTSIM_HOME",I="active",B="daemon.json",M="dev-bridges",T="config.json",P=3e4;function s(){let e=process.env[$];return e&&e.length>0?i.resolve(e):i.join(_(),".sootsim")}function J(){if(process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1")return!1;let e=process.env.SOOTSIM_DEV;if(e==="1"||e==="true")return!0;if(e==="0"||e==="false")return!1;let t=process.argv[1];if(!t)return!1;try{return n.realpathSync(t).includes(`${i.sep}packages${i.sep}sootsim${i.sep}`)}catch{return!1}}function U(){return process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1"?!1:process.env.IS_TAMAGUI_DEV==="1"}function oe(){return J()||U()}function S(){return i.join(s(),"runtimes")}function V(e){return i.join(S(),e)}function R(){return i.join(S(),I)}function x(){return i.join(s(),"electron")}function ce(){return i.join(x(),"userData")}function se(e){return i.join(x(),e)}function H(){return i.join(s(),"profiles")}function ue(){return i.join(s(),"camera-fixtures")}function G(){return i.join(s(),"daemon-app")}function K(){return i.join(G(),"SootSim Daemon.app")}function ae(){return i.join(K(),"Contents","MacOS","sootsim-daemon")}function X(){return i.join(s(),"cache")}function m(){return i.join(s(),B)}function p(){return i.join(s(),M)}function w(e){if(!Number.isInteger(e)||e<=0)throw new Error(`invalid development bridge port: ${e}`);return i.join(p(),`${e}.json`)}function D(){return i.join(s(),T)}function A(){try{let e=n.readFileSync(D(),"utf8"),t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function O(e){v();let t=A(),r={...t,...e};e.settings&&typeof e.settings=="object"&&(r.settings={...t.settings&&typeof t.settings=="object"?t.settings:{},...e.settings});let c=`${D()}.tmp`;return n.writeFileSync(c,`${JSON.stringify(r,null,2)}
5
+ `,"utf8"),n.renameSync(c,D()),r}function fe(){let e=A().settings,t=e?.productAnalytics,r=e?.crashReports;return{productAnalytics:typeof t=="boolean"?t:!1,crashReports:typeof r=="boolean"?r:!1,configured:typeof t=="boolean"&&typeof r=="boolean"}}function le(e){O({settings:{productAnalytics:e.productAnalytics,crashReports:e.crashReports}})}function de(){let e=A().anonymousId;if(typeof e=="string"&&e.trim())return e;let t=`anon-cli-${k()}`;return O({anonymousId:t}),t}function y(){return i.join(s(),"runtime-upgraded.json")}function me(e){v();let t=`${y()}.tmp`;n.writeFileSync(t,`${JSON.stringify(e)}
6
+ `,"utf8"),n.renameSync(t,y())}function pe(){try{let e=n.readFileSync(y(),"utf8");n.unlinkSync(y());let t=JSON.parse(e);return typeof t?.to!="string"||!t.to?null:{from:typeof t.from=="string"?t.from:null,to:t.to,at:typeof t.at=="number"?t.at:0}}catch{return null}}function v(){n.mkdirSync(s(),{recursive:!0}),n.mkdirSync(S(),{recursive:!0}),n.mkdirSync(x(),{recursive:!0}),n.mkdirSync(H(),{recursive:!0}),n.mkdirSync(X(),{recursive:!0})}function q(){try{let e=n.readFileSync(R(),"utf8").trim();return e.length>0?e:null}catch{return null}}function ye(e){n.mkdirSync(S(),{recursive:!0}),n.writeFileSync(R(),`${e}
7
+ `,"utf8")}function ge(){let e=q();if(!e)return null;let t=V(e);try{if(n.statSync(t).isDirectory())return t}catch{}return null}var g=16*1024,z=3e4;function d(){try{let e=n.openSync(m(),"r");try{let t=Buffer.alloc(g),r=n.readSync(e,t,0,g,0),c=t.subarray(0,r).toString("utf8"),o=JSON.parse(c);return o&&o.schema===1&&typeof o.pid=="number"&&typeof o.bridgePort=="number"&&typeof o.runtimePort=="number"&&typeof o.startedAt=="number"&&typeof o.heartbeatAt=="number"&&(o.servedRuntimes===void 0||Array.isArray(o.servedRuntimes)&&o.servedRuntimes.every(u=>typeof u=="string"))?o:null}finally{n.closeSync(e)}}catch{return null}}function E(e){try{let t=JSON.parse(e);return t&&t.schema===1&&t.source==="vite-dev"&&typeof t.pid=="number"&&typeof t.bridgePort=="number"&&typeof t.runtimePort=="number"&&typeof t.cwd=="string"&&typeof t.startedAt=="number"&&typeof t.heartbeatAt=="number"&&(t.shellPort===void 0||typeof t.shellPort=="number")&&(t.servedRuntimes===void 0||Array.isArray(t.servedRuntimes)&&t.servedRuntimes.every(r=>typeof r=="string"))?t:null}catch{return null}}function W(){let e;try{e=n.readdirSync(p(),{withFileTypes:!0})}catch{return[]}let t=[];for(let r of e)if(!(!r.isFile()||!/^\d+\.json$/.test(r.name)))try{let c=i.join(p(),r.name),o=n.openSync(c,"r");try{let u=Buffer.alloc(g),a=n.readSync(o,u,0,g,0),h=E(u.subarray(0,a).toString("utf8"));h&&r.name===`${h.bridgePort}.json`&&t.push(h)}finally{n.closeSync(o)}}catch{}return t.sort((r,c)=>r.bridgePort-c.bridgePort)}function b(e,t=Date.now()){if(!e||t-e.heartbeatAt>P)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function Y(e,t=Date.now()){if(!e||t-e.heartbeatAt>P)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function Se(){let e=new Set,t=d();if(b(t)){t.activeRuntime&&e.add(t.activeRuntime);for(let r of t.servedRuntimes??[])e.add(r)}for(let r of W())if(Y(r))for(let c of r.servedRuntimes??[])e.add(c);return[...e].sort()}function Q(e){v();let t=m(),r=d();if(!r){if(j(e))return;throw new Error("another rnx daemon claimed the lockfile before this write")}if(!f(r,e))throw new Error("refusing to overwrite another rnx daemon lockfile");let c=`${t}.${e.pid}.${k()}.tmp`;n.writeFileSync(c,`${JSON.stringify(e,null,2)}
8
+ `,"utf8");try{let o=d();if(!o||!f(o,e))throw new Error("rnx daemon lock ownership changed during heartbeat");n.renameSync(c,t)}finally{try{n.unlinkSync(c)}catch{}}}function ve(e){n.mkdirSync(p(),{recursive:!0});let t=w(e.bridgePort),r=`${t}.${e.pid}.tmp`;n.writeFileSync(r,`${JSON.stringify(e,null,2)}
9
+ `,"utf8"),n.renameSync(r,t)}function f(e,t){return e.pid===t.pid&&e.startedAt===t.startedAt}function N(e){return e instanceof Error&&"code"in e&&Reflect.get(e,"code")==="EEXIST"}function j(e){let t=m(),r=`${t}.${e.pid}.${k()}.claim`;n.writeFileSync(r,`${JSON.stringify(e,null,2)}
10
+ `,"utf8");try{return n.linkSync(r,t),!0}catch(c){if(N(c))return!1;throw c}finally{try{n.unlinkSync(r)}catch{}}}function l(){return`${m()}.claim`}function C(e){try{let t=JSON.parse(e);if(t!==null&&typeof t=="object"&&typeof Reflect.get(t,"pid")=="number"&&typeof Reflect.get(t,"startedAt")=="number"&&typeof Reflect.get(t,"createdAt")=="number")return{pid:Reflect.get(t,"pid"),startedAt:Reflect.get(t,"startedAt"),createdAt:Reflect.get(t,"createdAt")}}catch{}return null}function F(){try{return C(n.readFileSync(l(),"utf8"))}catch{return null}}function L(e,t=Date.now()){if(t-e.createdAt>z)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function Z(e){let t={pid:e.pid,startedAt:e.startedAt,createdAt:Date.now()},r=`${JSON.stringify(t)}
11
+ `;for(let c=0;c<8;c++){try{return n.writeFileSync(l(),r,{encoding:"utf8",flag:"wx"}),!0}catch(a){if(!N(a))throw a}let o=F();if(o&&f(o,t))return!0;if(o&&L(o))return!1;let u;try{u=n.readFileSync(l(),"utf8");let a=C(u);if(a&&L(a))return!1;if(n.readFileSync(l(),"utf8")!==u)continue;n.unlinkSync(l())}catch{}}return!1}function ee(e){try{let t=F();if(!t||!f(t,e))return;n.unlinkSync(l())}catch{}}function he(e){if(v(),!Z(e))return!1;try{let t=d();if(t&&f(t,e))return Q(e),!0;if(t&&b(t))return!1;if(t){let r=d();if(!r||!f(r,t)||b(r))return!1;try{n.unlinkSync(m())}catch{return!1}}return j(e)}finally{ee(e)}}function De(e){try{let t=d();if(!t||!f(t,e))return;n.unlinkSync(m())}catch{}}function be(e){try{let t=w(e.bridgePort),r=E(n.readFileSync(t,"utf8"));if(r?.pid!==e.pid||r.startedAt!==e.startedAt)return;n.unlinkSync(t)}catch{}}export{$ as a,I as b,B as c,M as d,T as e,P as f,s as g,J as h,U as i,oe as j,S as k,V as l,R as m,x as n,ce as o,se as p,H as q,ue as r,G as s,K as t,ae as u,X as v,m as w,p as x,w as y,D as z,A,O as B,fe as C,le as D,de as E,y as F,me as G,pe as H,v as I,q as J,ye as K,ge as L,d as M,W as N,b as O,Y as P,Se as Q,Q as R,ve as S,he as T,De as U,be as V};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.345 | (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 f,b as S}from"./chunk-TQ5OPG33.js";import{a as y,c as P}from"./chunk-G7S6T5OX.js";import{a as v}from"./chunk-BKMPV6N4.js";import{b}from"./chunk-6SLM6URN.js";function M(){let e=f();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"rnx desktop app not installed (run `rnx desktop install`)"}}async function A(e){let o=f();if(!o)return{launched:!1,message:"rnx desktop app not installed"};try{let r=await S(e.url,o,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile,ownerPid:e.ownerPid});return r.launched?{launched:!0,message:e.url?`electron launched via ${r.via} \u2192 ${e.url}`:`electron launched via ${r.via}`,target:r.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(r){return{launched:!1,message:`electron launch failed: ${r instanceof Error?r.message:String(r)}`}}}var k={id:"electron",name:"electron",description:"rnx desktop companion app (native window, menu bar)",kind:"native",availability:M,launch:A};import{spawn as B}from"child_process";import{closeSync as F,mkdtempSync as G,openSync as U,readFileSync as q}from"fs";import{tmpdir as T}from"os";import{join as I}from"path";import{spawnSync as O}from"node:child_process";import{existsSync as _,readFileSync as R}from"node:fs";import{createRequire as L}from"node:module";import{dirname as W,join as N}from"node:path";var $=`
4
+ import{a as f,b as S}from"./chunk-EPLVIDPC.js";import{a as y,c as P}from"./chunk-QNRWPAOA.js";import{b}from"./chunk-KZFJNDH3.js";import{a as v}from"./chunk-YVSUFVVB.js";function M(){let e=f();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"rnx desktop app not installed (run `rnx desktop install`)"}}async function A(e){let o=f();if(!o)return{launched:!1,message:"rnx desktop app not installed"};try{let r=await S(e.url,o,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile,ownerPid:e.ownerPid});return r.launched?{launched:!0,message:e.url?`electron launched via ${r.via} \u2192 ${e.url}`:`electron launched via ${r.via}`,target:r.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(r){return{launched:!1,message:`electron launch failed: ${r instanceof Error?r.message:String(r)}`}}}var k={id:"electron",name:"electron",description:"rnx desktop companion app (native window, menu bar)",kind:"native",availability:M,launch:A};import{spawn as B}from"child_process";import{closeSync as F,mkdtempSync as G,openSync as U,readFileSync as q}from"fs";import{tmpdir as T}from"os";import{join as I}from"path";import{spawnSync as O}from"node:child_process";import{existsSync as _,readFileSync as R}from"node:fs";import{createRequire as L}from"node:module";import{dirname as W,join as N}from"node:path";var $=`
5
5
  const { existsSync } = require('node:fs');
6
6
  const modulePath = process.env.SOOTSIM_PW_MODULE;
7
7
  try {