rnxsim 0.1.352 → 0.1.354

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 (198) hide show
  1. package/README.md +17 -16
  2. package/cli/bin.ts +5 -4
  3. package/cli/commands/control.ts +20 -5
  4. package/cli/commands/daemon-mac-app.ts +1 -1
  5. package/cli/commands/daemon.ts +6 -8
  6. package/cli/commands/install-desktop.ts +42 -32
  7. package/cli/commands/no-bridge-hint.ts +3 -3
  8. package/cli/commands/serve.ts +1 -1
  9. package/cli/commands/setup.ts +215 -176
  10. package/cli/commands/welcome.ts +9 -58
  11. package/cli/desktop-companion.ts +31 -16
  12. package/cli/prompt.ts +12 -7
  13. package/cli/setup-repository.ts +6 -2
  14. package/cli/ui.ts +68 -0
  15. package/dist-cli/bin.js +5 -5
  16. package/dist-cli/chunks/{agent-27WDUXK5.js → agent-FB7RPXO6.js} +2 -2
  17. package/dist-cli/chunks/{agent-wrapper-XAUWPZ6O.js → agent-wrapper-LFU3XEIG.js} +2 -2
  18. package/dist-cli/chunks/{app-fonts-COAZFLDG.js → app-fonts-FK6SETRG.js} +2 -2
  19. package/dist-cli/chunks/{assert-ZR2UE3EH.js → assert-3KQYZDDK.js} +2 -2
  20. package/dist-cli/chunks/{auth-LISHWKCC.js → auth-RFE3J27C.js} +2 -2
  21. package/dist-cli/chunks/{beta-AQQUYVA5.js → beta-XVY4WOYH.js} +2 -2
  22. package/dist-cli/chunks/{camera-KE44ZN3U.js → camera-JROBX5GM.js} +2 -2
  23. package/dist-cli/chunks/chunk-24DA3Y2Z.js +9 -0
  24. package/dist-cli/chunks/{chunk-E42ZJLPN.js → chunk-37S36DFW.js} +1 -1
  25. package/dist-cli/chunks/{chunk-LRKODRWI.js → chunk-3QLERZYJ.js} +2 -2
  26. package/dist-cli/chunks/{chunk-VQDY7NEJ.js → chunk-3RW6W3ZO.js} +1 -1
  27. package/dist-cli/chunks/{chunk-R4P7WO4L.js → chunk-4AQCDL24.js} +2 -2
  28. package/dist-cli/chunks/{chunk-M6DC6JZL.js → chunk-4OS3SXPZ.js} +2 -2
  29. package/dist-cli/chunks/{chunk-TF6VBUZ7.js → chunk-766UIGCS.js} +2 -2
  30. package/dist-cli/chunks/{chunk-PEBQKBEP.js → chunk-77CBLMD4.js} +1 -1
  31. package/dist-cli/chunks/{chunk-7T7DR34H.js → chunk-7WANPS3W.js} +2 -2
  32. package/dist-cli/chunks/{chunk-MJB6N7WS.js → chunk-ATQPDEED.js} +2 -2
  33. package/dist-cli/chunks/chunk-B7OMSJXC.js +15 -0
  34. package/dist-cli/chunks/{chunk-MJJP2BEI.js → chunk-BAWV2UEF.js} +3 -3
  35. package/dist-cli/chunks/{chunk-DSF4WC4X.js → chunk-BNXXNT3I.js} +2 -2
  36. package/dist-cli/chunks/{chunk-BZ32JGFC.js → chunk-CKKDXTKV.js} +1 -1
  37. package/dist-cli/chunks/{chunk-P5YC5VGA.js → chunk-CUK6Y2RR.js} +2 -2
  38. package/dist-cli/chunks/{chunk-XI4W6LRQ.js → chunk-ENPWD62S.js} +2 -2
  39. package/dist-cli/chunks/{chunk-ZK5HYQ4I.js → chunk-EWPX6LEN.js} +2 -2
  40. package/dist-cli/chunks/{chunk-AIGZ3TSW.js → chunk-FEHHM2LV.js} +3 -3
  41. package/dist-cli/chunks/{chunk-QP7KGSU4.js → chunk-FPH4TYZO.js} +3 -3
  42. package/dist-cli/chunks/{chunk-XHZEKHB2.js → chunk-GNKXRXND.js} +6 -6
  43. package/dist-cli/chunks/{chunk-3ZV4WSCR.js → chunk-GYGDIT5V.js} +2 -2
  44. package/dist-cli/chunks/{chunk-YAMKV3UB.js → chunk-HIYCRDUP.js} +2 -2
  45. package/dist-cli/chunks/{chunk-5JINX2IB.js → chunk-HUU7ZUQK.js} +2 -2
  46. package/dist-cli/chunks/{chunk-4AOAJXE2.js → chunk-IGV4KCCM.js} +2 -2
  47. package/dist-cli/chunks/{chunk-5JE5PNIV.js → chunk-IICFLREN.js} +1 -1
  48. package/dist-cli/chunks/chunk-IUL2WUWW.js +32 -0
  49. package/dist-cli/chunks/{chunk-EHQHK7KN.js → chunk-JJOHJNUQ.js} +2 -2
  50. package/dist-cli/chunks/{chunk-ESVF72YH.js → chunk-JT435OOM.js} +2 -2
  51. package/dist-cli/chunks/{chunk-R2BFC3AC.js → chunk-JT4IMNCO.js} +2 -2
  52. package/dist-cli/chunks/{chunk-S2PJOB2C.js → chunk-JWXAXCC6.js} +2 -2
  53. package/dist-cli/chunks/{chunk-CY6HBAOB.js → chunk-JXNR2KAB.js} +2 -2
  54. package/dist-cli/chunks/{chunk-45D2GGIA.js → chunk-LC77IVGY.js} +2 -2
  55. package/dist-cli/chunks/{chunk-H6MTPXZS.js → chunk-LCPZNPIB.js} +1 -1
  56. package/dist-cli/chunks/chunk-LETVUC6M.js +11 -0
  57. package/dist-cli/chunks/chunk-LRVL5MAX.js +4 -0
  58. package/dist-cli/chunks/{chunk-24CIPQT5.js → chunk-MIK6LMG4.js} +1 -1
  59. package/dist-cli/chunks/{chunk-JEPQ5YX3.js → chunk-N3CE6AZP.js} +2 -2
  60. package/dist-cli/chunks/{chunk-AR3CPCW3.js → chunk-OKFSCCFC.js} +1 -1
  61. package/dist-cli/chunks/{chunk-3Y7NWE22.js → chunk-P4GCLNFM.js} +2 -2
  62. package/dist-cli/chunks/{chunk-NQMZOJPX.js → chunk-PHIYWV44.js} +2 -2
  63. package/dist-cli/chunks/{chunk-WNJDE2JT.js → chunk-QQNNY43R.js} +1 -1
  64. package/dist-cli/chunks/{chunk-FHLEA4S5.js → chunk-QRYTCPNO.js} +2 -2
  65. package/dist-cli/chunks/{chunk-Q4ROOH3W.js → chunk-SLD2EMLZ.js} +2 -2
  66. package/dist-cli/chunks/{chunk-ELNSQ352.js → chunk-THFM2CFT.js} +1 -1
  67. package/dist-cli/chunks/{chunk-EGKGCDG5.js → chunk-TJRKLRNP.js} +1 -1
  68. package/dist-cli/chunks/{chunk-H4IF54WS.js → chunk-UAYXEP74.js} +1 -1
  69. package/dist-cli/chunks/{chunk-BQE4E24T.js → chunk-UI2IFVHB.js} +1 -1
  70. package/dist-cli/chunks/chunk-UVIWE3LD.js +124 -0
  71. package/dist-cli/chunks/chunk-UX6D4X6B.js +24 -0
  72. package/dist-cli/chunks/{chunk-RH6FJI5O.js → chunk-X2DJK3TB.js} +2 -2
  73. package/dist-cli/chunks/chunk-Y4GUWO3X.js +7 -0
  74. package/dist-cli/chunks/{chunk-DJAYEBF3.js → chunk-YATZ7U4S.js} +1 -1
  75. package/dist-cli/chunks/{chunk-RASWCAJJ.js → chunk-YIUIFZAE.js} +2 -2
  76. package/dist-cli/chunks/{chunk-QJTW4QQW.js → chunk-YXBNGSG6.js} +1 -1
  77. package/dist-cli/chunks/{chunk-2OME2KGY.js → chunk-ZJUFI3R7.js} +1 -1
  78. package/dist-cli/chunks/{chunk-6NSUY346.js → chunk-ZNABCRWX.js} +2 -2
  79. package/dist-cli/chunks/{cleanup-JUY2WU24.js → cleanup-F74ISXJC.js} +2 -2
  80. package/dist-cli/chunks/cli-version-VSDCFXXN.js +4 -0
  81. package/dist-cli/chunks/{compat-S2TBISY3.js → compat-C3RGYGXL.js} +2 -2
  82. package/dist-cli/chunks/{config-3PHD4J5N.js → config-CDY2RB7Q.js} +2 -2
  83. package/dist-cli/chunks/control-J35HAFZA.js +4 -0
  84. package/dist-cli/chunks/daemon-DLLEODJY.js +4 -0
  85. package/dist-cli/chunks/{debug-PFAJONVV.js → debug-3P2DUTUQ.js} +3 -3
  86. package/dist-cli/chunks/{desktop-Z7EOBMNV.js → desktop-XIXW34VW.js} +4 -4
  87. package/dist-cli/chunks/{detox-KRSP5SLY.js → detox-KAKTJ4P4.js} +2 -2
  88. package/dist-cli/chunks/{device-ZXJ7GRBO.js → device-4MAWLZMR.js} +2 -2
  89. package/dist-cli/chunks/{diagnose-JIMLEOEJ.js → diagnose-A3R7HUYA.js} +2 -2
  90. package/dist-cli/chunks/{disk-cleanup-YY7FFGVA.js → disk-cleanup-5R7JYCO6.js} +2 -2
  91. package/dist-cli/chunks/drivers-BB3BRKDS.js +4 -0
  92. package/dist-cli/chunks/{film-LKSJPU2A.js → film-GY5U752Q.js} +3 -3
  93. package/dist-cli/chunks/flow-ALMSRBVL.js +4 -0
  94. package/dist-cli/chunks/help-3ZL7MRUX.js +4 -0
  95. package/dist-cli/chunks/{hidden-runtime-alias-ZN3WZ3ND.js → hidden-runtime-alias-HSGN3GN4.js} +2 -2
  96. package/dist-cli/chunks/home-paths-BIUN4CBO.js +4 -0
  97. package/dist-cli/chunks/inspect-RCU7XVAO.js +4 -0
  98. package/dist-cli/chunks/install-desktop-LYVKLTCU.js +4 -0
  99. package/dist-cli/chunks/{login-XKLIFTAU.js → login-WKNMS4GG.js} +2 -2
  100. package/dist-cli/chunks/{logout-DR22RB5H.js → logout-6UFUOESK.js} +2 -2
  101. package/dist-cli/chunks/{maestro-SLCX6HBV.js → maestro-SJGV7B3W.js} +3 -3
  102. package/dist-cli/chunks/{maestro-generate-GBFZ5INV.js → maestro-generate-PMF2LLKX.js} +3 -3
  103. package/dist-cli/chunks/{mode-F4R2KNXX.js → mode-MN7LZCLB.js} +2 -2
  104. package/dist-cli/chunks/{optional-demo-registry-HM55KXGB.js → optional-demo-registry-HFA27YSP.js} +2 -2
  105. package/dist-cli/chunks/{perf-VBS5GEPG.js → perf-XGANSJT3.js} +2 -2
  106. package/dist-cli/chunks/{permissions-F46PQIUE.js → permissions-25UWEJKW.js} +2 -2
  107. package/dist-cli/chunks/privacy-SIDMP5EF.js +4 -0
  108. package/dist-cli/chunks/{record-NLZ6DFAA.js → record-MA3AI752.js} +3 -3
  109. package/dist-cli/chunks/{report-issue-XIE5BVR4.js → report-issue-4DTESWE2.js} +2 -2
  110. package/dist-cli/chunks/reset-GPHG5XN3.js +4 -0
  111. package/dist-cli/chunks/runtime-VOEIOODA.js +4 -0
  112. package/dist-cli/chunks/{screenshot-command-SD4JPNKW.js → screenshot-command-JUXMWXS5.js} +3 -3
  113. package/dist-cli/chunks/{screenshot-layers-X65RC3GT.js → screenshot-layers-DJF2E4PE.js} +2 -2
  114. package/dist-cli/chunks/{screenshots-capture-BBXN7FEZ.js → screenshots-capture-UGZU5GOW.js} +2 -2
  115. package/dist-cli/chunks/{serve-M6ZKMSAG.js → serve-H7GNKJSM.js} +2 -2
  116. package/dist-cli/chunks/setup-G2WYLPM6.js +4 -0
  117. package/dist-cli/chunks/{skills-KDWGQBOP.js → skills-4JGPOSFE.js} +2 -2
  118. package/dist-cli/chunks/{state-NWABXG2P.js → state-DEAQFKVP.js} +2 -2
  119. package/dist-cli/chunks/{storage-QQE3G65Q.js → storage-Y6F5NTGH.js} +2 -2
  120. package/dist-cli/chunks/store-3EQT7VU6.js +4 -0
  121. package/dist-cli/chunks/telemetry-FANCQHKG.js +4 -0
  122. package/dist-cli/chunks/{timeline-2VZ45MMB.js → timeline-HOHYYDOC.js} +2 -2
  123. package/dist-cli/chunks/{upgrade-T7PDR6T5.js → upgrade-QF5YHLSG.js} +2 -2
  124. package/dist-cli/chunks/upload-QKJHFAX7.js +4 -0
  125. package/dist-cli/chunks/{version-BX6QX5XA.js → version-PDCKYJLB.js} +2 -2
  126. package/dist-cli/chunks/{web-4J6JRZN2.js → web-C5EUAFFW.js} +2 -2
  127. package/dist-cli/chunks/welcome-3CQ2GE4F.js +5 -0
  128. package/dist-cli/chunks/{what-happened-CHQKFNCM.js → what-happened-L56ZFIMJ.js} +2 -2
  129. package/dist-lib/agent-daemon-client.cjs +2 -2
  130. package/dist-lib/agent-events.cjs +1 -1
  131. package/dist-lib/agent-identity.cjs +1 -1
  132. package/dist-lib/agent-sessions.cjs +1 -1
  133. package/dist-lib/attached-projects.cjs +1 -1
  134. package/dist-lib/auth/shared-session.cjs +1 -1
  135. package/dist-lib/backend-origin.cjs +1 -1
  136. package/dist-lib/beta.cjs +1 -1
  137. package/dist-lib/beta.mjs +1 -1
  138. package/dist-lib/bridge-constants.cjs +1 -1
  139. package/dist-lib/bridge-contract.cjs +1 -1
  140. package/dist-lib/cli-constants.cjs +1 -1
  141. package/dist-lib/config.cjs +1 -1
  142. package/dist-lib/detox/index.cjs +1 -1
  143. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  144. package/dist-lib/home-paths.cjs +21 -1
  145. package/dist-lib/host/bridge-host.cjs +1 -1
  146. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  147. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  148. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  149. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  150. package/dist-lib/host/websocket-proxy.cjs +1 -1
  151. package/dist-lib/index.cjs +2 -2
  152. package/dist-lib/jump-to-source-babel.cjs +1 -1
  153. package/dist-lib/menu.cjs +1 -1
  154. package/dist-lib/menu.mjs +1 -1
  155. package/dist-lib/metro-production-bundle.cjs +1 -1
  156. package/dist-lib/metro-production-bundle.mjs +1 -1
  157. package/dist-lib/metro.cjs +2 -2
  158. package/dist-lib/profiles.cjs +1 -1
  159. package/dist-lib/public-brand.cjs +1 -1
  160. package/dist-lib/react-native-host-modules.cjs +1 -1
  161. package/dist-lib/react-native-host-modules.mjs +1 -1
  162. package/dist-lib/render-mode.cjs +1 -1
  163. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  164. package/dist-lib/sdk.cjs +1 -1
  165. package/dist-lib/sdk.mjs +1 -1
  166. package/dist-lib/skills.cjs +87 -22
  167. package/dist-lib/vite.cjs +2 -2
  168. package/package.json +1 -1
  169. package/skills/contrast/SKILL.md +3 -3
  170. package/skills/rnx-setup/SKILL.md +17 -5
  171. package/src/agent-daemon-client.ts +1 -1
  172. package/src/home-paths.ts +22 -0
  173. package/src/metro-plugin.ts +1 -1
  174. package/src/runtime-assets.ts +1 -1
  175. package/dist-cli/chunks/chunk-2JZXOHH6.js +0 -4
  176. package/dist-cli/chunks/chunk-2WJABJ6C.js +0 -15
  177. package/dist-cli/chunks/chunk-5OVXQKUP.js +0 -25
  178. package/dist-cli/chunks/chunk-DFTG53TX.js +0 -11
  179. package/dist-cli/chunks/chunk-HF2FZ2WN.js +0 -7
  180. package/dist-cli/chunks/chunk-S63ENXGH.js +0 -6
  181. package/dist-cli/chunks/chunk-UHP33XGC.js +0 -124
  182. package/dist-cli/chunks/cli-version-6SQSIFNQ.js +0 -4
  183. package/dist-cli/chunks/control-GLBCTKAA.js +0 -4
  184. package/dist-cli/chunks/daemon-H4OVIEMH.js +0 -4
  185. package/dist-cli/chunks/drivers-63LY2NCK.js +0 -4
  186. package/dist-cli/chunks/flow-JHKPF7BN.js +0 -4
  187. package/dist-cli/chunks/help-Q6OY6VVA.js +0 -4
  188. package/dist-cli/chunks/home-paths-UOATIRKF.js +0 -4
  189. package/dist-cli/chunks/inspect-DW3V2FD4.js +0 -4
  190. package/dist-cli/chunks/install-desktop-GWY5H22W.js +0 -4
  191. package/dist-cli/chunks/privacy-34FNXPJP.js +0 -4
  192. package/dist-cli/chunks/reset-BAGCFYTS.js +0 -4
  193. package/dist-cli/chunks/runtime-JTYB4CM7.js +0 -4
  194. package/dist-cli/chunks/setup-KTWKZOJB.js +0 -30
  195. package/dist-cli/chunks/store-6XW4YZM6.js +0 -4
  196. package/dist-cli/chunks/telemetry-MVSV7JHI.js +0 -4
  197. package/dist-cli/chunks/upload-RF2MNO2X.js +0 -4
  198. package/dist-cli/chunks/welcome-3MJHGERV.js +0 -5
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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-HF2FZ2WN.js";import{a as y,c as P}from"./chunk-3Y7NWE22.js";import{b}from"./chunk-EGKGCDG5.js";import{a as v}from"./chunk-H6MTPXZS.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 y,c as P}from"./chunk-P4GCLNFM.js";import{b}from"./chunk-TJRKLRNP.js";import{a as f,b as S}from"./chunk-Y4GUWO3X.js";import{a as v}from"./chunk-LCPZNPIB.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 {
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{e as p}from"./chunk-7T7DR34H.js";import{a as c,b as l}from"./chunk-XI4W6LRQ.js";import{a}from"./chunk-R4P7WO4L.js";async function g(e,i){if(i)return i.replace(/\/$/,"");if(e.kind==="session"&&e.origin)return e.origin.replace(/\/$/,"");let r=a();return r?.origin?r.origin.replace(/\/$/,""):(await p()).replace(/\/$/,"")}async function x(e,i={}){let r=c();if(r||(process.stderr.write(`
4
+ import{e as p}from"./chunk-7WANPS3W.js";import{a as c,b as l}from"./chunk-ENPWD62S.js";import{a}from"./chunk-4AQCDL24.js";async function g(e,i){if(i)return i.replace(/\/$/,"");if(e.kind==="session"&&e.origin)return e.origin.replace(/\/$/,"");let r=a();return r?.origin?r.origin.replace(/\/$/,""):(await p()).replace(/\/$/,"")}async function x(e,i={}){let r=c();if(r||(process.stderr.write(`
5
5
  rnx ${e} needs auth before it can check recording access.
6
6
 
7
7
  pick one:
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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 t}from"./chunk-BQE4E24T.js";import{readFileSync as a}from"node:fs";import{fileURLToPath as n}from"node:url";var r=null;function f(){if(r!=null)return r;let o=[()=>n(import.meta.resolve(`${t.packageName}/package.json`)),()=>n(new URL("../package.json",import.meta.url))];for(let i of o)try{let e=JSON.parse(a(i(),"utf8")).version;if(typeof e=="string"&&e)return r=e,r}catch{}return r="0.0.0",r}export{f as a};
4
+ import{a as t}from"./chunk-UI2IFVHB.js";import{readFileSync as a}from"node:fs";import{fileURLToPath as n}from"node:url";var r=null;function f(){if(r!=null)return r;let o=[()=>n(import.meta.resolve(`${t.packageName}/package.json`)),()=>n(new URL("../package.json",import.meta.url))];for(let i of o)try{let e=JSON.parse(a(i(),"utf8")).version;if(typeof e=="string"&&e)return r=e,r}catch{}return r="0.0.0",r}export{f as a};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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 j,s as A,v as K,w as v}from"./chunk-EHQHK7KN.js";import{createHash as Y}from"node:crypto";import{mkdirSync as L,readFileSync as W,readdirSync as Q,unlinkSync as X,writeFileSync as D}from"node:fs";import{dirname as q,extname as Z,resolve as B}from"node:path";function H(t){let e=t[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function U(t,e,n){let o=j(t,{port:e.port}),i=H(o.positional),u=A({...o,commandTimeoutMs:5e3});try{let a=!!(await K(u,"SootSim.bridges.settings.get"))?.[n.modeKey],m=i==="on"?!0:i==="off"?!1:!a;if(a===m)return console.log(` ${n.displayName}: already ${m?"on":"off"}`),{current:a,target:m,changed:!1};if(!await u.send({type:"evaluate",acquireLock:!0,code:`(async () => {
4
+ import{q as j,s as A,v as K,w as v}from"./chunk-JJOHJNUQ.js";import{createHash as Y}from"node:crypto";import{mkdirSync as L,readFileSync as W,readdirSync as Q,unlinkSync as X,writeFileSync as D}from"node:fs";import{dirname as q,extname as Z,resolve as B}from"node:path";function H(t){let e=t[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function U(t,e,n){let o=j(t,{port:e.port}),i=H(o.positional),u=A({...o,commandTimeoutMs:5e3});try{let a=!!(await K(u,"SootSim.bridges.settings.get"))?.[n.modeKey],m=i==="on"?!0:i==="off"?!1:!a;if(a===m)return console.log(` ${n.displayName}: already ${m?"on":"off"}`),{current:a,target:m,changed:!1};if(!await u.send({type:"evaluate",acquireLock:!0,code:`(async () => {
5
5
  const modeKey = ${JSON.stringify(n.modeKey)}
6
6
  const target = ${JSON.stringify(m)}
7
7
  window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{e as f}from"./chunk-EHQHK7KN.js";import{existsSync as m,mkdirSync as g,readFileSync as h,writeFileSync as S,rmSync as F}from"fs";import{tmpdir as y}from"os";import{dirname as b,join as p}from"path";var w=new Map;function o(e,n){w.set(e,n)}var s=1;function a(){return p(y(),`sootsim-cli-hints-${f()}.json`)}function d(){return p(y(),"sootsim-cli-hints-global.json")}function u(e){if(!m(e))return{version:s,shown:{}};try{let n=JSON.parse(h(e,"utf8"));return n?.version!==s||!n?.shown?{version:s,shown:{}}:n}catch{return{version:s,shown:{}}}}function l(e,n){try{g(b(e),{recursive:!0}),S(e,JSON.stringify(n)+`
4
+ import{e as f}from"./chunk-JJOHJNUQ.js";import{existsSync as m,mkdirSync as g,readFileSync as h,writeFileSync as S,rmSync as F}from"fs";import{tmpdir as y}from"os";import{dirname as b,join as p}from"path";var w=new Map;function o(e,n){w.set(e,n)}var s=1;function a(){return p(y(),`sootsim-cli-hints-${f()}.json`)}function d(){return p(y(),"sootsim-cli-hints-global.json")}function u(e){if(!m(e))return{version:s,shown:{}};try{let n=JSON.parse(h(e,"utf8"));return n?.version!==s||!n?.shown?{version:s,shown:{}}:n}catch{return{version:s,shown:{}}}}function l(e,n){try{g(b(e),{recursive:!0}),S(e,JSON.stringify(n)+`
5
5
  `)}catch{}}function v(){let e=(process.env.SOOTSIM_HINTS||"").toLowerCase();return e==="off"||e==="0"||e==="false"?"off":e==="always"||e==="verbose"?"always":"normal"}function x(e,n){let i=v();if(i==="off")return!1;if(i==="always"||n==="always")return!0;let t=Date.now();if(n==="once-per-identity"){let r=u(a());return r.shown[e]?!1:(r.shown[e]=t,l(a(),r),!0)}if(n==="once-ever"){let r=u(d());return r.shown[e]?!1:(r.shown[e]=t,l(d(),r),!0)}if(typeof n=="object"&&"cooldownMs"in n){let r=u(a()),c=r.shown[e]??0;return t-c<n.cooldownMs?!1:(r.shown[e]=t,l(a(),r),!0)}return!0}function A(e,...n){let i=w.get(e);if(!i)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!x(e,i.frequency))return!1;let t=i.render(...n);if(t==null)return!1;let r=Array.isArray(t)?t:[t];for(let c of r)console.error(` hint: ${c}`);return!0}o("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`rnx wait ready\` first.`});o("wait-selector-for-missing-testid",{frequency:"once-per-identity",render:e=>`rnx wait selector ${e}`});o("prefer-cli-over-eval",{frequency:"once-per-identity",render:e=>e.length?["try the CLI shortcut instead:",...e.map(n=>` ${n}`)]:null});o("describe-use-filters",{frequency:"once-per-identity",render:()=>["describe output is long. narrow it with:"," rnx describe --only '*Bottom Sheet*'"," rnx describe --testid-like 'swap-*'"," rnx describe --subtree <testID>"]});o("describe-filter-context",{frequency:"once-per-identity",render:()=>["filtered describe is search output, not current-route proof.","run `rnx describe` without filters after navigation; clipped nodes are marked `(clipped:...)`."]});o("subtree-root-not-found",{frequency:"always",render:e=>`no node with testID/id "${e}" \u2014 try \`rnx find --testid ${e}\` to discover available ids.`});o("clean-uninstall",{frequency:"once-ever",render:()=>["to remove the background daemon and all ~/.sootsim data, run `rnx daemon uninstall`.","the optional desktop app and its macOS preference plist are separate from the daemon."]});export{A as a};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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 a=["Cache","Code Cache","DawnCache","DawnGraphiteCache","DawnWebGPUCache","GPUCache","GrShaderCache","ShaderCache"],r=new Set(a);function s(e){return r.has(e)}export{a,s as b};
@@ -0,0 +1,11 @@
1
+ /*! rnx v0.1.354 | (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 x}from"node:crypto";import n from"node:fs";import{homedir as I}from"node:os";import i from"node:path";var $="SOOTSIM_HOME",B="active",M="daemon.json",T="dev-bridges",J="config.json",L=3e4;function s(){let e=process.env[$];return e&&e.length>0?i.resolve(e):i.join(I(),".sootsim")}function U(){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 V(){return process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1"?!1:process.env.IS_TAMAGUI_DEV==="1"}function ce(){return U()||V()}function v(){return i.join(s(),"runtimes")}function H(e){return i.join(v(),e)}function w(){return i.join(v(),B)}function A(){return i.join(s(),"electron")}function se(){return i.join(A(),"userData")}function ae(e){return i.join(A(),e)}function G(){return i.join(s(),"profiles")}function ue(){return i.join(s(),"camera-fixtures")}function K(){return i.join(s(),"daemon-app")}function X(){return i.join(K(),"SootSim Daemon.app")}function fe(){return i.join(X(),"Contents","MacOS","sootsim-daemon")}function q(){return i.join(s(),"cache")}function m(){return i.join(s(),M)}function y(){return i.join(s(),T)}function O(e){if(!Number.isInteger(e)||e<=0)throw new Error(`invalid development bridge port: ${e}`);return i.join(y(),`${e}.json`)}function b(){return i.join(s(),J)}function p(){try{let e=n.readFileSync(b(),"utf8"),t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function P(e){h();let t=p(),r={...t,...e};e.settings&&typeof e.settings=="object"&&(r.settings={...t.settings&&typeof t.settings=="object"?t.settings:{},...e.settings});let c=`${b()}.tmp`;return n.writeFileSync(c,`${JSON.stringify(r,null,2)}
5
+ `,"utf8"),n.renameSync(c,b()),r}var E=1;function le(){return p().onboardingVersion===E}function de(){let e=p().simulatorDriver;return e==="electron"||e==="playwright"?e:null}function me(e){P({onboardingVersion:E,simulatorDriver:e})}function pe(){let e=p().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 ye(e){P({settings:{productAnalytics:e.productAnalytics,crashReports:e.crashReports}})}function ge(){let e=p().anonymousId;if(typeof e=="string"&&e.trim())return e;let t=`anon-cli-${x()}`;return P({anonymousId:t}),t}function g(){return i.join(s(),"runtime-upgraded.json")}function Se(e){h();let t=`${g()}.tmp`;n.writeFileSync(t,`${JSON.stringify(e)}
6
+ `,"utf8"),n.renameSync(t,g())}function ve(){try{let e=n.readFileSync(g(),"utf8");n.unlinkSync(g());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 h(){n.mkdirSync(s(),{recursive:!0}),n.mkdirSync(v(),{recursive:!0}),n.mkdirSync(A(),{recursive:!0}),n.mkdirSync(G(),{recursive:!0}),n.mkdirSync(q(),{recursive:!0})}function z(){try{let e=n.readFileSync(w(),"utf8").trim();return e.length>0?e:null}catch{return null}}function he(e){n.mkdirSync(v(),{recursive:!0}),n.writeFileSync(w(),`${e}
7
+ `,"utf8")}function De(){let e=z();if(!e)return null;let t=H(e);try{if(n.statSync(t).isDirectory())return t}catch{}return null}var S=16*1024,W=3e4;function d(){try{let e=n.openSync(m(),"r");try{let t=Buffer.alloc(S),r=n.readSync(e,t,0,S,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(a=>typeof a=="string"))?o:null}finally{n.closeSync(e)}}catch{return null}}function N(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 Y(){let e;try{e=n.readdirSync(y(),{withFileTypes:!0})}catch{return[]}let t=[];for(let r of e)if(!(!r.isFile()||!/^\d+\.json$/.test(r.name)))try{let c=i.join(y(),r.name),o=n.openSync(c,"r");try{let a=Buffer.alloc(S),u=n.readSync(o,a,0,S,0),D=N(a.subarray(0,u).toString("utf8"));D&&r.name===`${D.bridgePort}.json`&&t.push(D)}finally{n.closeSync(o)}}catch{}return t.sort((r,c)=>r.bridgePort-c.bridgePort)}function k(e,t=Date.now()){if(!e||t-e.heartbeatAt>L)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function Q(e,t=Date.now()){if(!e||t-e.heartbeatAt>L)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function be(){let e=new Set,t=d();if(k(t)){t.activeRuntime&&e.add(t.activeRuntime);for(let r of t.servedRuntimes??[])e.add(r)}for(let r of Y())if(Q(r))for(let c of r.servedRuntimes??[])e.add(c);return[...e].sort()}function Z(e){h();let t=m(),r=d();if(!r){if(_(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}.${x()}.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 ke(e){n.mkdirSync(y(),{recursive:!0});let t=O(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 C(e){return e instanceof Error&&"code"in e&&Reflect.get(e,"code")==="EEXIST"}function _(e){let t=m(),r=`${t}.${e.pid}.${x()}.claim`;n.writeFileSync(r,`${JSON.stringify(e,null,2)}
10
+ `,"utf8");try{return n.linkSync(r,t),!0}catch(c){if(C(c))return!1;throw c}finally{try{n.unlinkSync(r)}catch{}}}function l(){return`${m()}.claim`}function j(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 j(n.readFileSync(l(),"utf8"))}catch{return null}}function R(e,t=Date.now()){if(t-e.createdAt>W)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function ee(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(u){if(!C(u))throw u}let o=F();if(o&&f(o,t))return!0;if(o&&R(o))return!1;let a;try{a=n.readFileSync(l(),"utf8");let u=j(a);if(u&&R(u))return!1;if(n.readFileSync(l(),"utf8")!==a)continue;n.unlinkSync(l())}catch{}}return!1}function te(e){try{let t=F();if(!t||!f(t,e))return;n.unlinkSync(l())}catch{}}function xe(e){if(h(),!ee(e))return!1;try{let t=d();if(t&&f(t,e))return Z(e),!0;if(t&&k(t))return!1;if(t){let r=d();if(!r||!f(r,t)||k(r))return!1;try{n.unlinkSync(m())}catch{return!1}}return _(e)}finally{te(e)}}function Ae(e){try{let t=d();if(!t||!f(t,e))return;n.unlinkSync(m())}catch{}}function Pe(e){try{let t=O(e.bridgePort),r=N(n.readFileSync(t,"utf8"));if(r?.pid!==e.pid||r.startedAt!==e.startedAt)return;n.unlinkSync(t)}catch{}}export{$ as a,B as b,M as c,T as d,J as e,L as f,s as g,U as h,V as i,ce as j,v as k,H as l,w as m,A as n,se as o,ae as p,G as q,ue as r,K as s,X as t,fe as u,q as v,m as w,y as x,O as y,b as z,p as A,P as B,le as C,de as D,me as E,pe as F,ye as G,ge as H,g as I,Se as J,ve as K,h as L,z as M,he as N,De as O,d as P,Y as Q,k as R,Q as S,be as T,Z as U,ke as V,xe as W,Ae as X,Pe as Y};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ function a(){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 install the recommended background service:"),console.error(" rnx daemon install"),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 d(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{a,t as b,d as c};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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{k as n}from"./chunk-EHQHK7KN.js";import{J as t,j as r}from"./chunk-DFTG53TX.js";function l(){let e=t(),i=r()?n():null;return i?.source==="dev-bridge"?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{l as a};
4
+ import{k as n}from"./chunk-JJOHJNUQ.js";import{M as t,j as r}from"./chunk-LETVUC6M.js";function l(){let e=t(),i=r()?n():null;return i?.source==="dev-bridge"?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{l as a};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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 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,5 +1,5 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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{I as m,o as P,q as a}from"./chunk-DFTG53TX.js";import l from"fs";import c from"path";var s="default",S="profiles.json",i=1;function o(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function d(){return c.join(a(),S)}function I(e){return`sootsim-profile-${o(e)}`}function h(e){return c.join(P(),"Partitions",I(e))}function A(e){return c.join(a(),"playwright",o(e))}function u(){try{let e=JSON.parse(l.readFileSync(d(),"utf8"));if(!e||e.version!==i)return{version:i,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:o(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:i,profiles:r}}catch{return{version:i,profiles:[]}}}function x(e){return[...e].sort((r,t)=>r.id===s?-1:t.id===s?1:r.id.localeCompare(t.id))}function p(e){if(e.profiles.some(t=>t.id===s))return{...e,profiles:x(e.profiles)};let r=new Date().toISOString();return{version:i,profiles:x([{id:s,createdAt:r,updatedAt:r},...e.profiles])}}function g(e){m();let r=p(e),t=`${d()}.tmp`;return l.writeFileSync(t,`${JSON.stringify(r,null,2)}
4
+ import{L as m,o as P,q as a}from"./chunk-LETVUC6M.js";import l from"fs";import c from"path";var s="default",S="profiles.json",i=1;function o(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function d(){return c.join(a(),S)}function I(e){return`sootsim-profile-${o(e)}`}function h(e){return c.join(P(),"Partitions",I(e))}function A(e){return c.join(a(),"playwright",o(e))}function u(){try{let e=JSON.parse(l.readFileSync(d(),"utf8"));if(!e||e.version!==i)return{version:i,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:o(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:i,profiles:r}}catch{return{version:i,profiles:[]}}}function x(e){return[...e].sort((r,t)=>r.id===s?-1:t.id===s?1:r.id.localeCompare(t.id))}function p(e){if(e.profiles.some(t=>t.id===s))return{...e,profiles:x(e.profiles)};let r=new Date().toISOString();return{version:i,profiles:x([{id:s,createdAt:r,updatedAt:r},...e.profiles])}}function g(e){m();let r=p(e),t=`${d()}.tmp`;return l.writeFileSync(t,`${JSON.stringify(r,null,2)}
5
5
  `,"utf8"),l.renameSync(t,d()),r}function y(){return g(u()).profiles}function E(e){let r=o(e);return y().find(t=>t.id===r)??null}function _(e=s){let r=o(e),t=E(r);return t||D(r)}function D(e){let r=o(e),t=p(u());if(t.profiles.some(w=>w.id===r))throw new Error(`profile already exists: ${r}`);let f=new Date().toISOString(),n={id:r,createdAt:f,updatedAt:f};return g({version:i,profiles:[...t.profiles,n]}),n}function F(e){let r=o(e);if(r===s)throw new Error("the default profile cannot be deleted; clear it instead");let t=p(u()),f=t.profiles.find(n=>n.id===r);if(!f)throw new Error(`profile not found: ${r}`);return g({version:i,profiles:t.profiles.filter(n=>n.id!==r)}),v(r),f}function v(e){let r=o(e);for(let t of[h(r),A(r)])try{l.rmSync(t,{recursive:!0,force:!0})}catch{}}export{A as a,y as b,_ as c,D as d,F as e,v as f};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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-TF6VBUZ7.js";import{q as l,s as i}from"./chunk-EHQHK7KN.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-766UIGCS.js";import{q as l,s as i}from"./chunk-JJOHJNUQ.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.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{b as r}from"./chunk-YAMKV3UB.js";function o(){if(!r())return null;let t=process.env.VITE_POSTHOG_API_KEY||"";if(!t)return null;let e=process.env.CONTRAST_POSTHOG_HOST||process.env.VITE_POSTHOG_HOST||"https://us.i.posthog.com";return{apiKey:t,host:e.replace(/\/+$/,"")}}function i(t,e){return t.trim().slice(0,e)}function s(t){let e=t.kind==="package_incompatibility"?{package_name:i(t.packageName,160),package_version:i(t.packageVersion,80),...t.unsupportedApi?{unsupported_api:i(t.unsupportedApi,160)}:{}}:{error_class:i(t.errorClass,160)};return{event:t.kind,distinct_id:"rnx-cli-diagnostic",properties:e}}var n=[];function a(t){r()&&n.push(t)}function c(t){let e=t instanceof Error?t.constructor.name:typeof t;a({kind:"error_shape",errorClass:e})}async function l(){if(n.length===0)return;let t=o();if(!t){n.length=0;return}let e=n.splice(0,n.length).map(s);try{await fetch(`${t.host}/batch/`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:t.apiKey,batch:e}),signal:AbortSignal.timeout(2e3)})}catch{}}export{s as a,a as b,c,l as d};
4
+ import{b as r}from"./chunk-HIYCRDUP.js";function o(){if(!r())return null;let t=process.env.VITE_POSTHOG_API_KEY||"";if(!t)return null;let e=process.env.CONTRAST_POSTHOG_HOST||process.env.VITE_POSTHOG_HOST||"https://us.i.posthog.com";return{apiKey:t,host:e.replace(/\/+$/,"")}}function i(t,e){return t.trim().slice(0,e)}function s(t){let e=t.kind==="package_incompatibility"?{package_name:i(t.packageName,160),package_version:i(t.packageVersion,80),...t.unsupportedApi?{unsupported_api:i(t.unsupportedApi,160)}:{}}:{error_class:i(t.errorClass,160)};return{event:t.kind,distinct_id:"rnx-cli-diagnostic",properties:e}}var n=[];function a(t){r()&&n.push(t)}function c(t){let e=t instanceof Error?t.constructor.name:typeof t;a({kind:"error_shape",errorClass:e})}async function l(){if(n.length===0)return;let t=o();if(!t){n.length=0;return}let e=n.splice(0,n.length).map(s);try{await fetch(`${t.host}/batch/`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:t.apiKey,batch:e}),signal:AbortSignal.timeout(2e3)})}catch{}}export{s as a,a as b,c,l as d};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as N}from"./chunk-24CIPQT5.js";import{o as R}from"./chunk-DFTG53TX.js";import{a as I}from"./chunk-BQE4E24T.js";import{a as T}from"./chunk-WNJDE2JT.js";function G(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function O(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return G(r)?r:null}catch{return null}}import{randomBytes as q,createHash as X}from"node:crypto";import f from"node:fs";import h from"node:path";var $=null;function B(){if($)return $;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||R()}function y(){return B()}function U(){return h.join(B(),"attached-projects.json")}function _(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=f.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return _();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{f.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return _()}}function K(e){let t=U();f.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=f.openSync(r,"w",384);try{f.writeFileSync(n,JSON.stringify(e,null,2)),f.fsyncSync(n)}finally{f.closeSync(n)}f.renameSync(r,t)}function w(e){let t=S();return e(t),K(t),t}function F(e){return X("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function Q(){return`s_${q(10).toString("hex")}`}function Se(e){let t=h.resolve(e.cwd),r=F(t),n;return w(o=>{let s=o.attachedProjects.find(a=>a.id===r);if(s){let a={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=a,n=a;return}let c=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:c,updatedAt:c};o.attachedProjects.push(d),n=d}),n}function M(e){return S().attachedProjects.find(t=>t.id===e)??null}function we(){return S().attachedProjects}var V=336*60*60*1e3;function ve(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],c=o-V,d=s.filter(a=>a.ts>=c);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Ae(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function xe(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function C(e){let t;return w(r=>{if(e.id){let c=r.agentSessions.find(d=>d.id===e.id);if(c){let d={...c,...e,lastSeenAt:Date.now()},a=r.agentSessions.indexOf(c);r.agentSessions[a]=d,t=d;return}}let n=r.attachedProjects.find(c=>c.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??Q(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function L(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function z(e,t,r=Date.now()){return{...e,...t,id:e.id,projectId:e.projectId,createdAt:e.createdAt,lastSeenAt:r}}function Z(e){e.length!==0&&w(t=>{let r=Date.now(),n=new Map(t.agentSessions.map((o,s)=>[o.id,s]));for(let{id:o,patch:s}of e){let c=n.get(o);c!==void 0&&(t.agentSessions[c]=z(t.agentSessions[c],s,r))}})}function v(e,t){Z([{id:e,patch:t}])}async function Pe(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-HM55KXGB.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!f.existsSync(o.dir))continue;let s=h.resolve(o.dir),c=F(s);if(n.attachedProjects.some(a=>a.id===c))continue;let d=Date.now();n.attachedProjects.push({id:c,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as ee,spawnSync as te}from"node:child_process";import{randomUUID as re}from"node:crypto";import i,{constants as m}from"node:fs";import u from"node:path";import ne from"node:readline";function b(e){return u.join(y(),"sessions",e)}function J(e){return u.join(b(e),"prompt.in")}function H(e){return u.join(b(e),"events.out")}function se(e){return u.join(y(),"transcripts",`${e}.log`)}function E(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(b(t)))}function oe(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ie();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("rnx CLI not found. set SOOTSIM_BIN to the path of the rnx binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ie(){try{let e=ce();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[rnx] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli`.")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function ce(){try{let r=T.resolve(`${I.packageName}/package.json`);return u.dirname(r)}catch{}let e=ae();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name===I.packageName)return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function ae(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function de(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,c=null;for(;c===null;)try{c=i.openSync(o,m.O_WRONLY|m.O_CREAT|m.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let a=Number(i.readFileSync(o,"utf8").trim());if(a&&!ue(a)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(a=>setTimeout(a,50))}try{return i.writeFileSync(c,String(process.pid)),await r()}finally{try{i.closeSync(c)}catch{}try{i.unlinkSync(o)}catch{}}}function ue(e){try{return process.kill(e,0),!0}catch{return!1}}function W(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=te("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function $e(e){let t=M(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return de(t.id,r,async()=>{let n=L(t.id).find(p=>p.provider===r&&p.status!=="ended"&&E(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`rnx agent end <sessionId>\`.`);let o=r==="claude"?re():void 0,s=C({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),c=J(s.id),d=H(s.id),a=se(s.id);W(c),W(d);let g=u.dirname(a);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:Y}=oe(),x=[...Y,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",c,"--events-out",d,"--transcript",a];e.codexBin&&x.push("--codex-bin",e.codexBin),e.claudeBin&&x.push("--claude-bin",e.claudeBin),e.freshThread&&x.push("--fresh-thread"),o&&x.push("--claude-session-uuid",o);let P=ee(A,x,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});P.unref();let D=e.readyTimeoutMs??6e3,j=await le(d,p=>p.type==="ready"||p.type==="error",D);if(!j||j.type==="error"){if(P.pid)try{process.kill(P.pid,"SIGTERM")}catch{}try{i.rmSync(b(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=j&&j.type==="error"?j.message:`no ready event within ${D}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:P.pid,status:"idle"}),{session:k(s.id),wrapperPid:P.pid}})}async function _e(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!E(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=J(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,m.O_WRONLY);try{let s=N(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
4
+ import{a as N}from"./chunk-MIK6LMG4.js";import{o as R}from"./chunk-LETVUC6M.js";import{a as I}from"./chunk-UI2IFVHB.js";import{a as T}from"./chunk-QQNNY43R.js";function G(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function O(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return G(r)?r:null}catch{return null}}import{randomBytes as q,createHash as X}from"node:crypto";import f from"node:fs";import h from"node:path";var $=null;function B(){if($)return $;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||R()}function y(){return B()}function U(){return h.join(B(),"attached-projects.json")}function _(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=f.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return _();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{f.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return _()}}function K(e){let t=U();f.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=f.openSync(r,"w",384);try{f.writeFileSync(n,JSON.stringify(e,null,2)),f.fsyncSync(n)}finally{f.closeSync(n)}f.renameSync(r,t)}function w(e){let t=S();return e(t),K(t),t}function F(e){return X("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function Q(){return`s_${q(10).toString("hex")}`}function Se(e){let t=h.resolve(e.cwd),r=F(t),n;return w(o=>{let s=o.attachedProjects.find(a=>a.id===r);if(s){let a={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=a,n=a;return}let c=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:c,updatedAt:c};o.attachedProjects.push(d),n=d}),n}function M(e){return S().attachedProjects.find(t=>t.id===e)??null}function we(){return S().attachedProjects}var V=336*60*60*1e3;function ve(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],c=o-V,d=s.filter(a=>a.ts>=c);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Ae(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function xe(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function C(e){let t;return w(r=>{if(e.id){let c=r.agentSessions.find(d=>d.id===e.id);if(c){let d={...c,...e,lastSeenAt:Date.now()},a=r.agentSessions.indexOf(c);r.agentSessions[a]=d,t=d;return}}let n=r.attachedProjects.find(c=>c.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??Q(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function L(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function z(e,t,r=Date.now()){return{...e,...t,id:e.id,projectId:e.projectId,createdAt:e.createdAt,lastSeenAt:r}}function Z(e){e.length!==0&&w(t=>{let r=Date.now(),n=new Map(t.agentSessions.map((o,s)=>[o.id,s]));for(let{id:o,patch:s}of e){let c=n.get(o);c!==void 0&&(t.agentSessions[c]=z(t.agentSessions[c],s,r))}})}function v(e,t){Z([{id:e,patch:t}])}async function Pe(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-HFA27YSP.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!f.existsSync(o.dir))continue;let s=h.resolve(o.dir),c=F(s);if(n.attachedProjects.some(a=>a.id===c))continue;let d=Date.now();n.attachedProjects.push({id:c,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as ee,spawnSync as te}from"node:child_process";import{randomUUID as re}from"node:crypto";import i,{constants as m}from"node:fs";import u from"node:path";import ne from"node:readline";function b(e){return u.join(y(),"sessions",e)}function J(e){return u.join(b(e),"prompt.in")}function H(e){return u.join(b(e),"events.out")}function se(e){return u.join(y(),"transcripts",`${e}.log`)}function E(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(b(t)))}function oe(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ie();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("rnx CLI not found. set SOOTSIM_BIN to the path of the rnx binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ie(){try{let e=ce();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[rnx] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli`.")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function ce(){try{let r=T.resolve(`${I.packageName}/package.json`);return u.dirname(r)}catch{}let e=ae();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name===I.packageName)return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function ae(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function de(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,c=null;for(;c===null;)try{c=i.openSync(o,m.O_WRONLY|m.O_CREAT|m.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let a=Number(i.readFileSync(o,"utf8").trim());if(a&&!ue(a)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(a=>setTimeout(a,50))}try{return i.writeFileSync(c,String(process.pid)),await r()}finally{try{i.closeSync(c)}catch{}try{i.unlinkSync(o)}catch{}}}function ue(e){try{return process.kill(e,0),!0}catch{return!1}}function W(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=te("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function $e(e){let t=M(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return de(t.id,r,async()=>{let n=L(t.id).find(p=>p.provider===r&&p.status!=="ended"&&E(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`rnx agent end <sessionId>\`.`);let o=r==="claude"?re():void 0,s=C({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),c=J(s.id),d=H(s.id),a=se(s.id);W(c),W(d);let g=u.dirname(a);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:Y}=oe(),x=[...Y,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",c,"--events-out",d,"--transcript",a];e.codexBin&&x.push("--codex-bin",e.codexBin),e.claudeBin&&x.push("--claude-bin",e.claudeBin),e.freshThread&&x.push("--fresh-thread"),o&&x.push("--claude-session-uuid",o);let P=ee(A,x,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});P.unref();let D=e.readyTimeoutMs??6e3,j=await le(d,p=>p.type==="ready"||p.type==="error",D);if(!j||j.type==="error"){if(P.pid)try{process.kill(P.pid,"SIGTERM")}catch{}try{i.rmSync(b(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=j&&j.type==="error"?j.message:`no ready event within ${D}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:P.pid,status:"idle"}),{session:k(s.id),wrapperPid:P.pid}})}async function _e(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!E(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=J(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,m.O_WRONLY);try{let s=N(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
5
5
  `)}finally{i.closeSync(o)}v(e,{lastPrompt:t.displayText??t.text,status:"working"})}async function Be(e){let t=k(e);if(!t)throw new l("NO_SESSION",`no session with id=${e}`);if(E(t.wrapperPid,e))try{process.kill(t.wrapperPid,"SIGTERM")}catch{}let r=b(e),n=y();if(r.startsWith(n))try{i.rmSync(r,{recursive:!0,force:!0})}catch{}v(e,{status:"ended",wrapperPid:void 0})}function Ue(e,t){let r=H(e);if(!i.existsSync(r))throw new l("NO_FIFO",`events FIFO missing: ${r}`);let n=i.openSync(r,m.O_RDWR),o=i.createReadStream("",{fd:n,autoClose:!0}),s=ne.createInterface({input:o,crlfDelay:1/0});s.on("line",d=>{let a=O(d);a&&t(a)});let c=!1;return()=>{if(!c){c=!0;try{i.writeSync(n,`
6
6
  `)}catch{}try{s.close()}catch{}try{o.destroy()}catch{}}}}async function le(e,t,r){let n=i.openSync(e,m.O_RDWR|m.O_NONBLOCK),o=Buffer.alloc(8192),s="",c=Date.now()+r;try{for(;Date.now()<c;){let d=0;try{d=i.readSync(n,o,0,o.length,null)}catch(a){if(a.code!=="EAGAIN")throw a;d=0}if(d>0){s+=o.subarray(0,d).toString("utf8");let a;for(;(a=s.indexOf(`
7
7
  `))>=0;){let g=s.slice(0,a);s=s.slice(a+1);let A=O(g);if(A&&t(A))return A}}else await new Promise(a=>setTimeout(a,30))}return null}finally{i.closeSync(n)}}export{O as a,y as b,Se as c,M as d,we as e,ve as f,Ae as g,xe as h,k as i,L as j,z as k,Z as l,Pe as m,b as n,J as o,H as p,se as q,E as r,oe as s,l as t,$e as u,_e as v,Be as w,Ue as x};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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 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.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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 Q(t,e){let r=["--max-ms","--maxMs","--maxms","--max_ms"];for(let n of r){let o=t.indexOf(n);if(o>=0&&t[o+1]){let s=Number(t[o+1]);if(Number.isFinite(s))return Math.max(100,s)}}return e}var P=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function N(t){return typeof t=="string"&&P.has(t)}async function M(t){return await t.send({type:"evaluate",code:"window.__sootsimEngineState?.inspectActive === true"})===!0}async function X(t,e){if(!N(e))return!1;try{return await M(t)}catch{return!1}}async function Z(t){let e=await t.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof e=="number"?e:0}}async function ee(t,e=5,r){let n=r?.format?`, ${JSON.stringify(r)}`:"",o=await t.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${e}${n}))()`});if(r?.format==="boxes"&&typeof o=="string")try{return{depth:e,tree:JSON.parse(o)}}catch{return{depth:e,tree:o}}return{depth:e,tree:o}}async function te(t){let e=await t.send({type:"evaluate",code:"window.location.href"});return{url:typeof e=="string"?e:""}}async function ne(t,e){let r=e.maxDepth??12,n=`(async () => {
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.352 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.354 | (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 n=Object.freeze({name:"rnx",packageName:"rnxsim",commandName:"rnx",domain:"rnxsim.com",origin:"https://rnxsim.com"});export{n as a};