rnxsim 0.0.0 → 0.1.312

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 (228) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +512 -0
  3. package/detox/colors.ts +54 -0
  4. package/detox/config-loader.ts +135 -0
  5. package/detox/element-types.ts +39 -0
  6. package/detox/expectations.ts +537 -0
  7. package/detox/gestures.ts +480 -0
  8. package/detox/index.ts +2118 -0
  9. package/detox/jest-preset.cjs +51 -0
  10. package/detox/jest-setup-after-env.cjs +18 -0
  11. package/detox/matchers.ts +30 -0
  12. package/detox/motion-change.cjs +109 -0
  13. package/detox/motion-change.d.cts +35 -0
  14. package/detox/navigation.ts +43 -0
  15. package/detox/screenshots/animated-color-test-rest-norngh.png +0 -0
  16. package/detox/screenshots/color-test-after-drag-norngh.png +0 -0
  17. package/detox/screenshots/color-test-rest-norngh.png +0 -0
  18. package/detox/screenshots/theme-blue-toggle.png +0 -0
  19. package/detox/screenshots/theme-blue.png +0 -0
  20. package/detox/screenshots/theme-red-toggle.png +0 -0
  21. package/detox/screenshots/theme-red.png +0 -0
  22. package/dist-cli/bin.js +15 -0
  23. package/dist-cli/chunks/agent-NXVDDCFG.js +48 -0
  24. package/dist-cli/chunks/agent-wrapper-DXJCFKL3.js +17 -0
  25. package/dist-cli/chunks/app-fonts-W5AJZQJF.js +4 -0
  26. package/dist-cli/chunks/assert-3LOJEUDT.js +49 -0
  27. package/dist-cli/chunks/auth-MFTYYPNX.js +12 -0
  28. package/dist-cli/chunks/beta-GT3NN67B.js +4 -0
  29. package/dist-cli/chunks/camera-6EAK7CUL.js +22 -0
  30. package/dist-cli/chunks/chunk-274UD5FD.js +4 -0
  31. package/dist-cli/chunks/chunk-2SA2VTGP.js +5 -0
  32. package/dist-cli/chunks/chunk-33FKQH54.js +5 -0
  33. package/dist-cli/chunks/chunk-37I5AIS7.js +3 -0
  34. package/dist-cli/chunks/chunk-3D57IBPC.js +4 -0
  35. package/dist-cli/chunks/chunk-4BXCZHAU.js +4 -0
  36. package/dist-cli/chunks/chunk-5OX7ANRA.js +5 -0
  37. package/dist-cli/chunks/chunk-66NF2KNG.js +9 -0
  38. package/dist-cli/chunks/chunk-6UKJB2VC.js +125 -0
  39. package/dist-cli/chunks/chunk-7INBNA3U.js +26 -0
  40. package/dist-cli/chunks/chunk-7VWOSTD5.js +5 -0
  41. package/dist-cli/chunks/chunk-AY47WKS5.js +23 -0
  42. package/dist-cli/chunks/chunk-B7KMNHX7.js +4 -0
  43. package/dist-cli/chunks/chunk-BKNOLP3J.js +4 -0
  44. package/dist-cli/chunks/chunk-BRIZOR4K.js +28 -0
  45. package/dist-cli/chunks/chunk-DM6KUAOZ.js +4 -0
  46. package/dist-cli/chunks/chunk-EUAVBTKU.js +4 -0
  47. package/dist-cli/chunks/chunk-FTC4M26Q.js +4 -0
  48. package/dist-cli/chunks/chunk-FWYYCUAZ.js +4 -0
  49. package/dist-cli/chunks/chunk-G74YIEVS.js +7 -0
  50. package/dist-cli/chunks/chunk-GZDHEONW.js +507 -0
  51. package/dist-cli/chunks/chunk-HG7ORJMT.js +5 -0
  52. package/dist-cli/chunks/chunk-HMDOLCKG.js +15 -0
  53. package/dist-cli/chunks/chunk-JG6S4RSH.js +4 -0
  54. package/dist-cli/chunks/chunk-KR5BGMBZ.js +4 -0
  55. package/dist-cli/chunks/chunk-KZW5WBGU.js +983 -0
  56. package/dist-cli/chunks/chunk-L24Z3CRS.js +30 -0
  57. package/dist-cli/chunks/chunk-LDQ7HVCW.js +4 -0
  58. package/dist-cli/chunks/chunk-MENV7VLD.js +4 -0
  59. package/dist-cli/chunks/chunk-MNGQ42QE.js +568 -0
  60. package/dist-cli/chunks/chunk-N6A3SXMR.js +4 -0
  61. package/dist-cli/chunks/chunk-NLEMQ4PY.js +6 -0
  62. package/dist-cli/chunks/chunk-NPVGMH2N.js +101 -0
  63. package/dist-cli/chunks/chunk-OR3XTXEB.js +107 -0
  64. package/dist-cli/chunks/chunk-PEPUGJVI.js +4 -0
  65. package/dist-cli/chunks/chunk-Q3RGLERJ.js +142 -0
  66. package/dist-cli/chunks/chunk-SI3BUTQR.js +4 -0
  67. package/dist-cli/chunks/chunk-T4FT6CM7.js +4 -0
  68. package/dist-cli/chunks/chunk-TBMVBI26.js +7 -0
  69. package/dist-cli/chunks/chunk-TCWQJILS.js +5 -0
  70. package/dist-cli/chunks/chunk-TGQNQ6XT.js +766 -0
  71. package/dist-cli/chunks/chunk-TYE3WBSR.js +5 -0
  72. package/dist-cli/chunks/chunk-U4PN6JOT.js +6 -0
  73. package/dist-cli/chunks/chunk-VUFRB347.js +4 -0
  74. package/dist-cli/chunks/chunk-VZBLFMYC.js +10 -0
  75. package/dist-cli/chunks/chunk-WBT32R6N.js +25 -0
  76. package/dist-cli/chunks/chunk-XRGEEPJ5.js +38 -0
  77. package/dist-cli/chunks/chunk-Y2FSZSO7.js +71 -0
  78. package/dist-cli/chunks/chunk-YRV7HR3P.js +74 -0
  79. package/dist-cli/chunks/chunk-YZRFF4YA.js +14 -0
  80. package/dist-cli/chunks/chunk-ZMZTHU7V.js +4 -0
  81. package/dist-cli/chunks/cleanup-H3GWQB63.js +25 -0
  82. package/dist-cli/chunks/cli-version-3QPAJ3LC.js +4 -0
  83. package/dist-cli/chunks/compat-5WG2XJV7.js +20 -0
  84. package/dist-cli/chunks/config-ANMBVVLL.js +13 -0
  85. package/dist-cli/chunks/control-NSGNQFJG.js +4 -0
  86. package/dist-cli/chunks/daemon-JHF4BJ3U.js +4 -0
  87. package/dist-cli/chunks/debug-CHV2O2KF.js +200 -0
  88. package/dist-cli/chunks/desktop-FIPIK4CH.js +31 -0
  89. package/dist-cli/chunks/detox-CVUJP7K6.js +52 -0
  90. package/dist-cli/chunks/device-6WCUM4W6.js +18 -0
  91. package/dist-cli/chunks/diagnose-I6EMWEII.js +43 -0
  92. package/dist-cli/chunks/disk-cleanup-P27CYFTN.js +4 -0
  93. package/dist-cli/chunks/drivers-HQ6AKZT6.js +4 -0
  94. package/dist-cli/chunks/film-UOQFFYNF.js +74 -0
  95. package/dist-cli/chunks/flow-N27MRRNL.js +4 -0
  96. package/dist-cli/chunks/help-SF6FEGEE.js +4 -0
  97. package/dist-cli/chunks/hidden-runtime-alias-NJYFSJKZ.js +4 -0
  98. package/dist-cli/chunks/home-paths-XOV44JEF.js +4 -0
  99. package/dist-cli/chunks/inspect-CWFRFQTY.js +4 -0
  100. package/dist-cli/chunks/install-desktop-KLQDNXZQ.js +4 -0
  101. package/dist-cli/chunks/login-BPFQENCX.js +28 -0
  102. package/dist-cli/chunks/logout-5A45ZGY7.js +4 -0
  103. package/dist-cli/chunks/maestro-E4CSDMLM.js +104 -0
  104. package/dist-cli/chunks/maestro-generate-CKMOJQX2.js +36 -0
  105. package/dist-cli/chunks/mode-SZYNMIQF.js +26 -0
  106. package/dist-cli/chunks/optional-demo-registry-FRH4SFVG.js +4 -0
  107. package/dist-cli/chunks/perf-VXU2XJAX.js +48 -0
  108. package/dist-cli/chunks/permissions-IRIAOVND.js +13 -0
  109. package/dist-cli/chunks/record-RY7FPLLH.js +72 -0
  110. package/dist-cli/chunks/report-issue-KNWXOE53.js +29 -0
  111. package/dist-cli/chunks/runtime-AR3GJTGK.js +4 -0
  112. package/dist-cli/chunks/screenshot-command-QLALR6GY.js +159 -0
  113. package/dist-cli/chunks/screenshot-layers-OQFMFVRL.js +20 -0
  114. package/dist-cli/chunks/screenshots-capture-6TSRJFGB.js +42 -0
  115. package/dist-cli/chunks/serve-F54J2NQO.js +44 -0
  116. package/dist-cli/chunks/setup-7V6UKX4U.js +32 -0
  117. package/dist-cli/chunks/skills-QQBOSETH.js +50 -0
  118. package/dist-cli/chunks/storage-TAPMKK5O.js +37 -0
  119. package/dist-cli/chunks/store-7NX3S43H.js +4 -0
  120. package/dist-cli/chunks/telemetry-E7BUK6RA.js +4 -0
  121. package/dist-cli/chunks/timeline-IAM564NA.js +24 -0
  122. package/dist-cli/chunks/upgrade-CD55QXIX.js +7 -0
  123. package/dist-cli/chunks/upload-GZ6LIMYM.js +4 -0
  124. package/dist-cli/chunks/version-3DYJ5AS3.js +6 -0
  125. package/dist-cli/chunks/web-6NW6YLPI.js +4 -0
  126. package/dist-cli/chunks/what-happened-CZZDOOVG.js +25 -0
  127. package/dist-lib/agent-daemon-client.cjs +468 -0
  128. package/dist-lib/agent-events.cjs +48 -0
  129. package/dist-lib/agent-identity.cjs +53 -0
  130. package/dist-lib/agent-sessions.cjs +725 -0
  131. package/dist-lib/attached-projects.cjs +526 -0
  132. package/dist-lib/auth/shared-session.cjs +195 -0
  133. package/dist-lib/backend-origin.cjs +70 -0
  134. package/dist-lib/beta.cjs +41 -0
  135. package/dist-lib/beta.mjs +13 -0
  136. package/dist-lib/bridge-constants.cjs +161 -0
  137. package/dist-lib/cli-constants.cjs +32 -0
  138. package/dist-lib/config.cjs +96 -0
  139. package/dist-lib/detox/index.cjs +2863 -0
  140. package/dist-lib/detox/jest-preset.cjs +51 -0
  141. package/dist-lib/dev-bundle-resolution.cjs +223 -0
  142. package/dist-lib/home-paths.cjs +421 -0
  143. package/dist-lib/host/bridge-host.cjs +5600 -0
  144. package/dist-lib/host/fetch-proxy-handler.cjs +373 -0
  145. package/dist-lib/host/fetch-proxy-overrides.cjs +63 -0
  146. package/dist-lib/host/fetch-proxy-overrides.mjs +37 -0
  147. package/dist-lib/host/websocket-proxy.cjs +214 -0
  148. package/dist-lib/index.cjs +513 -0
  149. package/dist-lib/jump-to-source-babel.cjs +93 -0
  150. package/dist-lib/menu.cjs +620 -0
  151. package/dist-lib/menu.mjs +581 -0
  152. package/dist-lib/metro.cjs +297 -0
  153. package/dist-lib/profiles.cjs +246 -0
  154. package/dist-lib/public-brand.cjs +39 -0
  155. package/dist-lib/render-mode.cjs +54 -0
  156. package/dist-lib/scripts/dev-server-scanner.cjs +1034 -0
  157. package/dist-lib/sdk.cjs +2333 -0
  158. package/dist-lib/sdk.mjs +2240 -0
  159. package/dist-lib/skills.cjs +23911 -0
  160. package/dist-lib/vite.cjs +358 -0
  161. package/package.json +189 -18
  162. package/scripts/dev-server-scanner.ts +941 -0
  163. package/scripts/optional-demo-registry.ts +113 -0
  164. package/scripts/postinstall.cjs +3 -0
  165. package/scripts/preuninstall.cjs +118 -0
  166. package/skills/contrast/SKILL.md +171 -0
  167. package/skills/rnx-debug/SKILL.md +425 -0
  168. package/skills/rnx-perf/SKILL.md +295 -0
  169. package/skills/rnx-setup/SKILL.md +160 -0
  170. package/skills/rnx-test/SKILL.md +292 -0
  171. package/skills/rnx-visual/SKILL.md +122 -0
  172. package/src/agent-daemon-client.ts +410 -0
  173. package/src/agent-events.ts +71 -0
  174. package/src/agent-identity.ts +23 -0
  175. package/src/agent-prompt.ts +71 -0
  176. package/src/agent-sessions.ts +573 -0
  177. package/src/attached-projects.ts +539 -0
  178. package/src/auth/shared-session.ts +204 -0
  179. package/src/backend-origin.ts +49 -0
  180. package/src/beta.ts +19 -0
  181. package/src/bridge-constants.ts +171 -0
  182. package/src/browser-cache.ts +16 -0
  183. package/src/cli-constants.ts +1 -0
  184. package/src/cli-version.ts +32 -0
  185. package/src/codex-client.ts +215 -0
  186. package/src/config.ts +134 -0
  187. package/src/dev-bundle-resolution.ts +236 -0
  188. package/src/disk-cleanup.ts +466 -0
  189. package/src/home-paths.ts +552 -0
  190. package/src/host/agent-host.ts +666 -0
  191. package/src/host/bridge-host.ts +2626 -0
  192. package/src/host/fetch-proxy-handler.ts +397 -0
  193. package/src/host/fetch-proxy-overrides.ts +51 -0
  194. package/src/host/open-url.ts +89 -0
  195. package/src/host/websocket-proxy.ts +210 -0
  196. package/src/index.ts +12 -705
  197. package/src/jump-to-source-babel.ts +135 -0
  198. package/src/menu.ts +734 -0
  199. package/src/metro-plugin.ts +139 -0
  200. package/src/native-dev-bundle-url.ts +96 -0
  201. package/src/native-seam-manifest.ts +341 -0
  202. package/src/plist.ts +27 -0
  203. package/src/poll-until.ts +92 -0
  204. package/src/profiles.ts +179 -0
  205. package/src/public-brand.ts +9 -0
  206. package/src/render-mode.ts +27 -0
  207. package/src/runtime-assets.ts +228 -0
  208. package/src/runtime-delivery.ts +54 -0
  209. package/src/screenshots/compose.ts +422 -0
  210. package/src/screenshots/frame-compose.ts +454 -0
  211. package/src/screenshots/orchestrate.ts +256 -0
  212. package/src/screenshots/org-deck.ts +91 -0
  213. package/src/screenshots/registry.ts +58 -0
  214. package/src/screenshots/schema.ts +364 -0
  215. package/src/sdk.ts +7 -0
  216. package/src/settings-bundle.ts +418 -0
  217. package/src/skills/builtin/a11y-review.ts +132 -0
  218. package/src/skills/builtin/compat-check.ts +71 -0
  219. package/src/skills/builtin/maestro-test.ts +121 -0
  220. package/src/skills/builtin/perf-profile.ts +90 -0
  221. package/src/skills/builtin/screenshot-all.ts +52 -0
  222. package/src/skills/builtin/visual-diff.ts +100 -0
  223. package/src/skills/registry.ts +107 -0
  224. package/src/skills/types.ts +41 -0
  225. package/src/team-machine-prompt.ts +73 -0
  226. package/src/vite-plugin-one.ts +190 -0
  227. package/src/vite-plugin.ts +1750 -0
  228. package/src/worklets-babel.ts +134 -0
@@ -0,0 +1,5 @@
1
+ /*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{l as n}from"./chunk-5OX7ANRA.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
5
+ `)}export{g as a};
@@ -0,0 +1,6 @@
1
+ /*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{G as F,H as j,I as H,k as N,l as U,u as _,x as E}from"./chunk-66NF2KNG.js";import{a as L}from"./chunk-ZMZTHU7V.js";import G from"node:fs";import Z from"node:path";function A(e){return e.length<=100&&/^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(e)}function D(e){try{return G.readdirSync(e.runtimesDir(),{withFileTypes:!0}).filter(c=>c.isDirectory()).map(c=>c.name).sort(k)}catch{return[]}}function M(e,c){return Z.posix.basename(e.tarballPath(c))}function k(e,c){let l=f=>{let v=f.indexOf("-"),V=v>=0?f.slice(0,v):f,T=v>=0?f.slice(v+1):"",$=V.split(".").map(S=>Number.parseInt(S,10));return $.some(S=>!Number.isFinite(S))?[[Number.POSITIVE_INFINITY],f]:[$,T]},[m,u]=l(e),[R,x]=l(c);for(let f=0;f<Math.max(m.length,R.length);f++){let v=m[f]??0,V=R[f]??0;if(v!==V)return v-V}return u===x?0:u?x?u<x?-1:1:-1:1}import{spawn as B}from"node:child_process";import J from"node:crypto";import o from"node:fs";import Y from"node:os";import y from"node:path";import{Readable as q}from"node:stream";import{pipeline as K}from"node:stream/promises";var Q=2;function W(e){function c(){try{let n=JSON.parse(o.readFileSync(e.configFile(),"utf8"));return n&&typeof n=="object"?n:{}}catch{return{}}}function l(n){let t=c();return(n||process.env[e.env.cdnOrigin]||t.cdnOrigin||e.defaultCdnOrigin).replace(/\/+$/,"")}function m(n){let t=c();return n||process.env[e.env.channel]||t.runtimeChannel||"stable"}function u(){if(!e.env.pin)return null;let n=process.env[e.env.pin];if(n&&n.trim())return n.trim();let t=c();return typeof t.runtimeVersion=="string"&&t.runtimeVersion.trim()?t.runtimeVersion.trim():null}function R(n){let t=new URL(`${l(n)}${e.manifestPath}`);return t.searchParams.set("t",String(Date.now())),t.toString()}function x(n,t){return`${l(t)}${e.tarballPath(n)}`}async function f(n){let t=R(n),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function v(n,t={}){let r=m(t.channel),i=t.version||u()||n.channels[r]?.latest;if(!i)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);if(!A(i))throw new Error(`invalid runtime version: ${i}`);let h=n.versions[i];if(!h)throw new Error(`version ${i} not found in manifest; available: ${Object.keys(n.versions).slice(-10).join(", ")||"(none)"}`);return{version:i,channel:r,entry:h}}async function V(n={}){e.ensureHome();let t=l(n.cdnOrigin),r=await f(t),{version:i,channel:h,entry:a}=v(r,n),d=e.runtimeDir(i),g=n.setActive!==!1,O=[i,...n.protectVersions??[]];if(I({protectVersions:O}),!n.force&&o.existsSync(y.join(d,e.installedMarker)))return g&&e.writeActiveRuntime(i),I({protectVersions:O}),{version:i,channel:h,cdnOrigin:t,runtimeDir:d,installed:!1,activated:g,manifest:r};let P=a.tarball||x(i,t),b=o.mkdtempSync(y.join(Y.tmpdir(),`${e.id}-runtime-download-`)),w=y.join(b,M(e,i)),p=y.join(y.dirname(d),`.installing-${i}-${process.pid}`);o.rmSync(p,{recursive:!0,force:!0});try{process.stderr.write(`${e.id}: downloading runtime ${i}\u2026
5
+ `),await X(P,w),process.stderr.write(`${e.id}: extracting runtime ${i}\u2026
6
+ `);let s=await ee(w);if(s!==a.sha256)throw new Error(`sha256 mismatch for runtime ${i}: expected ${a.sha256}, actual ${s}`);if(o.mkdirSync(p,{recursive:!0}),await ne(w,p),!o.existsSync(y.join(p,e.installedMarker)))throw new Error(`extracted tarball for runtime ${i} is missing ${e.installedMarker}`);o.rmSync(d,{recursive:!0,force:!0}),o.renameSync(p,d)}catch(s){throw o.rmSync(p,{recursive:!0,force:!0}),s}finally{o.rmSync(b,{recursive:!0,force:!0})}return g&&e.writeActiveRuntime(i),I({protectVersions:O}),{version:i,channel:h,cdnOrigin:t,runtimeDir:d,installed:!0,activated:g,manifest:r}}async function T(n={}){e.ensureHome(),I({protectVersions:n.protectVersions});let t=l(n.cdnOrigin),r=m(n.channel),i=u();if(i){let p=e.readActiveRuntime(),s=o.existsSync(y.join(e.runtimeDir(i),e.installedMarker));if(p===i&&s)return{checked:!0,updated:!1,reason:`runtime is pinned to ${i}`,activeVersion:p,latestVersion:i};let C=await V({version:i,channel:r,cdnOrigin:t,setActive:!1,protectVersions:n.protectVersions});return{checked:!0,updated:!0,reason:`runtime is pinned to ${i}`,activeVersion:i,latestVersion:i,install:C}}let h=await f(t),a=h.channels[r]?.latest;if(!a)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:e.readActiveRuntime()};if(!h.versions[a])return{checked:!0,updated:!1,reason:`manifest is missing version ${a}`,activeVersion:e.readActiveRuntime(),latestVersion:a};let g=e.readActiveRuntime(),O=g?e.runtimeDir(g):null,P=O?o.existsSync(y.join(O,e.installedMarker)):!1;if(!(!g||!P||k(a,g)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:g,latestVersion:a};let w=await V({version:a,channel:r,cdnOrigin:t,setActive:!1,protectVersions:n.protectVersions});return{checked:!0,updated:!0,activeVersion:a,latestVersion:a,install:w}}async function $(n={}){let t=e.readActiveRuntime(),r=u();if(r)return{active:t,latest:r,pinned:r,outdated:t!==r};try{let i=await f(l(n.cdnOrigin)),h=m(n.channel),a=i.channels[h]?.latest??null,d=!!(a&&(!t||k(a,t)>0));return{active:t,latest:a,pinned:null,outdated:d}}catch{return{active:t,latest:null,pinned:null,outdated:!1}}}function S(n={}){e.ensureHome();let t=Math.max(1,Math.floor(n.retainVersions??Q)),r=D(e),i=new Set(r),h=e.readActiveRuntime(),a=u(),d=new Set;for(let s of[h,a,...n.protectVersions??[]])s&&i.has(s)&&d.add(s);for(let s of[...r].reverse()){if(d.size>=t)break;d.add(s)}let g="__RUNTIME_VERSION__",O=M(e,g),P=O.indexOf(g),b=O.slice(0,P),w=O.slice(P+g.length),p=[];if(P>=0)try{p=o.readdirSync(e.cacheDir(),{withFileTypes:!0}).filter(s=>{if(!s.isFile())return!1;let C=s.name.startsWith(b)&&s.name.endsWith(w),z=s.name.startsWith(b)&&s.name.endsWith(`${w}.partial`);return C||z}).map(s=>y.join(e.cacheDir(),s.name)).sort()}catch{}return{activeVersion:h,pinnedVersion:a,keepVersions:r.filter(s=>d.has(s)),removeVersions:r.filter(s=>!d.has(s)),removeCacheFiles:p}}function I(n={}){let t=S(n);for(let r of t.removeVersions)o.rmSync(e.runtimeDir(r),{recursive:!0,force:!0});for(let r of t.removeCacheFiles)o.rmSync(r,{force:!0});return t}return{product:e,resolveCdnOrigin:l,resolveChannel:m,resolvePin:u,manifestUrl:R,tarballUrl:x,fetchManifest:f,resolveVersion:v,install:V,updateToLatest:T,checkUpToDate:$,planLocalRetention:S,pruneLocalRetention:I,listInstalled:()=>D(e)}}async function X(e,c){let l=await fetch(e);if(!l.ok||!l.body)throw new Error(`download failed: ${l.status} ${l.statusText} (${e})`);o.mkdirSync(y.dirname(c),{recursive:!0});let m=`${c}.partial`;try{await K(q.fromWeb(l.body),o.createWriteStream(m)),o.renameSync(m,c)}catch(u){try{o.unlinkSync(m)}catch{}throw u}}function ee(e){return new Promise((c,l)=>{let m=J.createHash("sha256"),u=o.createReadStream(e);u.on("data",R=>m.update(R)),u.on("error",l),u.on("end",()=>c(m.digest("hex")))})}function ne(e,c){return new Promise((l,m)=>{let u=B("tar",["-xzf",e,"-C",c],{stdio:["ignore","inherit","inherit"]});u.on("error",m),u.on("exit",R=>{R===0?l():m(new Error(`tar exited with code ${R}`))})})}var te="https://contrast.dev",ye=`${L.origin}/changelog`,Ve="https://contrast.dev/api/changelog/sootsim",ie={id:"sootsim",defaultCdnOrigin:te,manifestPath:"/runtimes/manifest.json",tarballPath:e=>`/runtimes/sootsim-runtime-${e}.tar.gz`,installedMarker:"index.html",env:{cdnOrigin:"SOOTSIM_CDN_ORIGIN",channel:"SOOTSIM_RUNTIME_CHANNEL"},ensureHome:F,configFile:E,runtimesDir:N,runtimeDir:U,cacheDir:_,readActiveRuntime:j,writeActiveRuntime:H},we=W(ie);export{A as a,k as b,te as c,ye as d,Ve as e,we as f};
@@ -0,0 +1,4 @@
1
+ /*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{createInterface as e}from"readline";var s=()=>e({input:process.stdin,output:process.stdout});function i(r){return new Promise(n=>{let t=s();t.question(r,o=>{t.close(),n(o.trim())})})}async function l(r,n=!0){let t=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${r} ${t} ${n?"y":"n"} (non-interactive)`),n;let o=await i(` ${r} ${t} `);return o===""?n:o.toLowerCase().startsWith("y")}export{l as a};
@@ -0,0 +1,10 @@
1
+ /*! rnx v0.1.312 | (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 d}from"./chunk-KR5BGMBZ.js";import{a as s}from"./chunk-HG7ORJMT.js";import{a as e}from"./chunk-TYE3WBSR.js";import{a as n}from"./chunk-33FKQH54.js";import{c as m,d as p,e as u}from"./chunk-6UKJB2VC.js";import{a}from"./chunk-EUAVBTKU.js";import{a as i}from"./chunk-ZMZTHU7V.js";import{a as f,c}from"./chunk-FTC4M26Q.js";function g(){return`${i.commandName} CLI v${a()} \xB7 ${d().primary}`}function E(){let r=p({bridgePort:7668,defaultShellUrl:n},e()),o=`
5
+ ${c}
6
+ `;console.log(`${g()}
7
+ ${o}${r}
8
+ `),s("clean-uninstall")}function L(r){let o=m(r,{bridgePort:7668,defaultShellUrl:n},e());return o?(console.log(`${o}
9
+ `),!0):!1}function U(r,o={}){let l=u(r,{bridgePort:7668,defaultShellUrl:n},o);if(!l){console.log(`unknown command: ${r}`);return}console.log(`${l}
10
+ `)}export{E as a,L as b,U as c};
@@ -0,0 +1,25 @@
1
+ /*! rnx v0.1.312 | (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 $}from"./chunk-VUFRB347.js";import{a as k}from"./chunk-G74YIEVS.js";import{spawn as v,spawnSync as m}from"child_process";import{chmodSync as S,copyFileSync as T,createWriteStream as E,existsSync as w,mkdirSync as y,rmSync as g,statSync as P,unlinkSync as D}from"fs";import{tmpdir as M}from"os";import{dirname as A,join as f,resolve as b}from"path";var h="https://contrast.dev/api/electron-release";function O(){let r=process.arch;if(process.platform==="darwin"){let t=r==="arm64"?"mac-arm64":"mac-x64",e=`sootsim-latest-${t}.dmg`;return{platform:t,filename:e,url:`${h}/${e}`,install:L}}if(process.platform==="linux"){let t=r==="arm64"?"linux-arm64":"linux-x64",e=`sootsim-latest-${t}.AppImage`;return{platform:t,filename:e,url:`${h}/${e}`,install:C}}if(process.platform==="win32"){let t="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:t,url:`${h}/${t}`,install:B}}return null}async function I({url:r,dest:t,onProgress:e}){let s=await fetch(r,{redirect:"follow"});if(!s.ok)throw new Error(`${s.status} ${s.statusText} (${r})`);let o=s.headers.get("content-length"),a=o?Number(o):null;if(!s.body)throw new Error(`empty response body (${r})`);y(A(t),{recursive:!0});let i=E(t),d=s.body.getReader(),c=0;try{for(;;){let{done:l,value:p}=await d.read();if(l)break;i.write(Buffer.from(p)),c+=p.byteLength,e?.(c,a)}}finally{await new Promise((l,p)=>{i.end(n=>n?p(n):l())})}}function _(r,t){let e=(r/1048576).toFixed(1);if(!t)return` ${e} MB`;let s=Math.min(100,Math.round(r/t*100)),o=(t/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${e} / ${o} MB`}async function L(r){let t=m("hdiutil",["attach","-nobrowse","-readonly",r],{encoding:"utf8"});if(t.status!==0)throw new Error(`hdiutil attach failed: ${t.stderr||t.stdout}`.trim());let e=t.stdout.trim().split(`
5
+ `),o=e[e.length-1].split(" ").pop()?.trim();if(!o||!w(o))throw new Error(`could not determine dmg mount point (output: ${t.stdout})`);let a=f(o,"sootsim.app");if(!w(a))throw m("hdiutil",["detach","-force",o]),new Error(`sootsim.app not found inside ${o}`);let i="/Applications",d=b(process.env.HOME||"","Applications"),c=i;try{let u=f(i,`.sootsim-write-probe-${process.pid}`);m("touch",[u]),w(u)?g(u,{force:!0}):c=d}catch{c=d}c===d&&y(c,{recursive:!0});let l=f(c,"sootsim.app");w(l)&&g(l,{recursive:!0,force:!0});let p=m("cp",["-R",a,l]),n=m("hdiutil",["detach","-force",o]);if(p.status!==0)throw new Error(`copy to ${l} failed: ${p.stderr?.toString()||""}`.trim());return n.status!==0&&console.warn(` warning: failed to unmount ${o} (${n.stderr?.toString().trim()||"unknown error"})`),m("xattr",["-dr","com.apple.quarantine",l]),l}async function C(r){let t=b(process.env.HOME||"","Applications");y(t,{recursive:!0});let e=f(t,"sootsim.AppImage");return w(e)&&g(e,{force:!0}),T(r,e),D(r),S(e,493),e}async function B(r){return await new Promise((t,e)=>{let s=v("cmd",["/c","start",'""',"/wait",r],{stdio:"inherit"});s.once("error",e),s.once("exit",o=>{o===0?t():e(new Error(`installer exited with code ${o}`))})}),r}async function q(r){(r.includes("--help")||r.includes("-h"))&&(console.log(`
6
+ rnxsim desktop install \u2014 download and install the optional desktop GUI
7
+
8
+ the CLI + daemon are the canonical rnx surface; the GUI is optional.
9
+ if you just want to drive a running metro/expo dev server from the
10
+ terminal, you don't need this.
11
+
12
+ usage:
13
+ rnxsim desktop install [options]
14
+
15
+ options:
16
+ -y, --yes skip confirmation and install immediately
17
+ --force reinstall even if the companion is already present
18
+
19
+ examples:
20
+ rnxsim desktop install
21
+ rnxsim desktop install --yes
22
+ `),process.exit(0));let t=r.includes("--yes")||r.includes("-y")||process.env.SOOTSIM_NO_PROMPT==="1"||process.env.CI==="1"||!process.stdin.isTTY,e=r.includes("--force"),s=k();if(s&&!e){console.log(` rnxsim desktop already installed at: ${s.path}`),console.log(" pass --force to reinstall.");return}let o=O();if(o||(console.error(` no desktop build available for ${process.platform}/${process.arch}.`),console.error(" supported: darwin-arm64, darwin-x64, linux-x64, linux-arm64, win32-x64"),process.exit(1)),console.log(` platform: ${o.platform}`),console.log(` download: ${o.url}`),console.log(),!t){if(!await $("download and install now?",!0)){console.log(" cancelled.");return}console.log()}let a=f(M(),`sootsim-install-${Date.now()}`),i=f(a,o.filename),d=0;process.stdout.write(` downloading ${o.filename}...
23
+ `);try{await I({url:o.url,dest:i,onProgress:(n,u)=>{let x=Date.now();x-d<100&&n<(u??1/0)||(d=x,process.stdout.isTTY&&process.stdout.write(`\r\x1B[2K${_(n,u)}`))}})}catch(n){g(a,{recursive:!0,force:!0});let u=n instanceof Error?n.message:String(n);console.error(`
24
+ download failed: ${u}`),console.error(` the ${o.platform} desktop build may not be published yet, or your`),console.error(" network blocked the request. check your connection and try again later;"),console.error(" the CLI + daemon work without the desktop app (run: rnxsim --help)."),process.exit(1)}process.stdout.isTTY&&process.stdout.write(`
25
+ `);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-E7BUK6RA.js");try{let n=await o.install(i);l({event:"cli_install_desktop_succeeded",properties:{platform:o.platform,size_bytes:c}}),console.log(` installed: ${n}`)}catch(n){l({event:"cli_install_desktop_failed",properties:{platform:o.platform,error:n instanceof Error?n.message:String(n)}}),await p(),console.error(` install failed: ${n instanceof Error?n.message:String(n)}`),console.error(` keeping download at ${i} for manual install.`),process.exit(1)}finally{g(a,{recursive:!0,force:!0})}console.log(),console.log(" next steps:"),console.log(" rnxsim desktop launch the desktop app"),console.log(" rnxsim open <target> open a demo or bundle in it")}export{q as a};
@@ -0,0 +1,38 @@
1
+ /*! rnx v0.1.312 | (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 as F,m as B,n as A,p as h,u as E,w as P}from"./chunk-TGQNQ6XT.js";import{i as y,m as N,n as I}from"./chunk-7INBNA3U.js";var k={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function z(e){return e.includes("--json")}function K(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
5
+ `)}function Q(e){process.stderr.write(`${e}
6
+ `)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function O(e,t,...r){return N(e,`__sootsimTest.${t}`,...r)}async function j(e,t,...r){return I(e,`SootSim.bridges.mainShell.${t}`,...r)}async function X(e,t={}){try{let r=await O(e,"waitForScreenTransitions",k);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function Z(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await j(e,t,...n)}catch(o){if(!F(o)||Date.now()>=s)throw o;await w(50)}}async function ee(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let i=0;i<s;i++){let u=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await w(o)}return null}async function te(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let i=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await i.send({type:"evaluate",code:"1"}),i}catch{i.close()}await w(o)}return null}async function ne(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,i=-1,u=o,c=null,d=!1,m={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,liveFrameActive:!1,liveFrameChannels:0,liveFramePublishes:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let a=await e.send({type:"evaluate",code:B}),g=Date.now()-o,f=Number(a?.nodes)||0,$=Number(a?.targets)||0,C=a?.liveFrameActive===!0,W=Number(a?.liveFrameChannels)||0,q=Number(a?.liveFramePublishes)||0,x=Number(a?.errors)||0,T=a?.flag===!0,p=a?.externalReady,M=typeof a?.loadingText=="string"?a.loadingText.trim():"",D=typeof a?.externalStatus=="string"?a.externalStatus.trim():"",R=typeof a?.externalError=="string"?a.externalError.trim():"",v=typeof a?.externalError=="string"&&R.length>0;if(c=p,d=v,f!==i&&(i=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,liveFrameActive:C,liveFrameChannels:W,liveFramePublishes:q,flag:a?.flag,loadingText:M,externalReady:typeof p=="boolean"?p:null,externalStatus:D,externalError:R,errors:x},T&&p!==!1&&!v&&!M&&h({liveFrameActive:C,nodes:f,targets:$})&&g-u>=A)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!T)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&h(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function H(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function L(e,t={}){let r=await e.send({type:"evaluate",code:P});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
7
+ console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await E(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
8
+ recent console errors:
9
+ `);for(let i of l){let u=b(i.timestamp),c=Array.isArray(i.args)?i.args.map(d=>typeof d=="object"?JSON.stringify(d):String(d)).join(" "):String(i);console.log(` [${u}] ${c}`)}}}async function G(e,t={}){let r=await _(e,"getRequestCounts");if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.failed)||0);if(n===0||(console.log(`
10
+ network: ${n} failed request${n===1?"":"s"}`),t.requestsCommand&&console.log(` inspect: ${t.requestsCommand}`),!t.includeTail))return;let s=await _(e,"getFailedRequests",5);if(!(!Array.isArray(s)||s.length===0)){console.log(`
11
+ recent failed requests:
12
+ `);for(let o of s){let l=b(o.timestamp);console.log(` [${l}] ${H(o)}`),o.responseBody?console.log(` ${o.responseBody}`):o.error&&console.log(` ${o.error}`)}}}async function J(e){let t=await e.send({type:"evaluate",code:`(async () => {
13
+ const test = window.__sootsimTest
14
+ const mainShell = window.SootSim?.bridges?.mainShell
15
+ let shell = null
16
+ try {
17
+ shell = typeof mainShell?.getState === 'function' ? await mainShell.getState() : null
18
+ } catch {}
19
+ let nodeCount = 0
20
+ try {
21
+ nodeCount = typeof test?.getNodeCount === 'function' ? await test.getNodeCount() : 0
22
+ } catch {}
23
+ return {
24
+ url: window.location.href,
25
+ simId: window.__sootsimSimId || null,
26
+ nodeCount,
27
+ mode: window.__sootsimRenderHost ? 'render-worker' : 'main-thread',
28
+ shell: shell
29
+ ? {
30
+ state: shell.state || null,
31
+ activeApp: shell.activeApp || null,
32
+ showSwitcher: !!shell.showSwitcher,
33
+ switcherPhase: shell.switcherPhase || null,
34
+ }
35
+ : null,
36
+ }
37
+ })()`});if(!t||typeof t!="object")return;console.log(`
38
+ state:`),t.simId&&console.log(` sim: ${t.simId}`),t.url&&console.log(` url: ${t.url}`),t.mode&&console.log(` mode: ${t.mode}`);let r=Number(t.nodeCount)||0;console.log(` nodes: ${r}${r>10?" (ready)":" (not ready)"}`);let n=t.shell;if(n&&typeof n=="object"){let s=[n.state?`state=${n.state}`:null,n.activeApp?`app=${n.activeApp}`:null,n.showSwitcher?"switcher=open":null,n.switcherPhase?`phase=${n.switcherPhase}`:null].filter(Boolean);s.length>0&&console.log(` shell: ${s.join(" ")}`)}}async function ae(e,t={}){try{await J(e)}catch{}try{await L(e,{includeTail:!0,errorsCommand:t.errorsCommand,warningsCommand:t.warningsCommand})}catch{}try{await G(e,{includeTail:!0,requestsCommand:t.requestsCommand})}catch{}}export{w as a,z as b,K as c,Q as d,b as e,O as f,X as g,Z as h,ee as i,te as j,ne as k,J as l,ae as m};
@@ -0,0 +1,71 @@
1
+ /*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ function t(_){return`(async () => {
5
+ const __t = window.__sootsimTest
6
+ if (!__t) throw new Error('__sootsimTest not available')
7
+ const __id = ${JSON.stringify(_.id||"")}
8
+ const __text = ${JSON.stringify(_.text||"")}
9
+ let __node = null
10
+ if (__id) {
11
+ __node = (__t.findByTestId && await __t.findByTestId(__id)) ||
12
+ (__t.findById && await __t.findById(__id)) || null
13
+ } else if (__text) {
14
+ __node = __t.findByText ? await __t.findByText(__text) : null
15
+ }
16
+ if (!__node) return null
17
+ const __pos = __node.absolutePosition || { x: __node.layout?.x || 0, y: __node.layout?.y || 0 }
18
+ const __layout = __node.layout || {}
19
+ return {
20
+ x: __pos.x,
21
+ y: __pos.y,
22
+ w: __layout.width || 1,
23
+ h: __layout.height || 1,
24
+ }
25
+ })()`}function e(_){return`(async () => {
26
+ const __rect = ${JSON.stringify(_)}
27
+ const __screenshot = window.__sootsimScreenshot
28
+ if (typeof __screenshot !== 'function') {
29
+ throw new Error('screenshot bridge not installed')
30
+ }
31
+ const __dataUrl = await __screenshot({ crop: __rect })
32
+ const __img = await new Promise((res, rej) => {
33
+ const img = new Image()
34
+ img.onload = () => res(img)
35
+ img.onerror = () => rej(new Error('failed to decode cropped screenshot'))
36
+ img.src = __dataUrl
37
+ })
38
+ const __w = __img.naturalWidth
39
+ const __h = __img.naturalHeight
40
+ const __canvas = document.createElement('canvas')
41
+ __canvas.width = __w
42
+ __canvas.height = __h
43
+ const __ctx = __canvas.getContext('2d')
44
+ if (!__ctx) throw new Error('could not acquire 2d context')
45
+ __ctx.drawImage(__img, 0, 0)
46
+ const __data = __ctx.getImageData(0, 0, __w, __h).data
47
+ const __n = __data.length / 4
48
+ let __r = 0, __g = 0, __b = 0, __a = 0
49
+ for (let __i = 0; __i < __data.length; __i += 4) {
50
+ __r += __data[__i]
51
+ __g += __data[__i + 1]
52
+ __b += __data[__i + 2]
53
+ __a += __data[__i + 3]
54
+ }
55
+ const __round = (v) => Math.round(v / __n)
56
+ const __rr = __round(__r), __gg = __round(__g), __bb = __round(__b), __aa = __round(__a)
57
+ const __hex =
58
+ '#' +
59
+ [__rr, __gg, __bb]
60
+ .map((v) => v.toString(16).padStart(2, '0'))
61
+ .join('')
62
+ const __dpr = window.devicePixelRatio || 1
63
+ return {
64
+ r: __rr, g: __gg, b: __bb, a: __aa,
65
+ hex: __hex,
66
+ samples: __n,
67
+ rect: { x: __rect.x, y: __rect.y, w: __rect.w, h: __rect.h },
68
+ deviceWidth: __w / __dpr,
69
+ deviceHeight: __h / __dpr,
70
+ }
71
+ })()`}export{t as a,e as b};
@@ -0,0 +1,74 @@
1
+ /*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c as H,d as V}from"./chunk-N6A3SXMR.js";import{c as G}from"./chunk-VZBLFMYC.js";import{K as M,M as j,g as O,j as A,r as U,s as D,t as F}from"./chunk-66NF2KNG.js";import{a as Y}from"./chunk-EUAVBTKU.js";import{a as k}from"./chunk-ZMZTHU7V.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"?>
6
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
7
+ <plist version="1.0">
8
+ <dict>
9
+ <key>CFBundleDevelopmentRegion</key><string>en</string>
10
+ <key>CFBundleDisplayName</key><string>${q}</string>
11
+ <key>CFBundleExecutable</key><string>sootsim-daemon</string>
12
+ <key>CFBundleIdentifier</key><string>${ie}</string>
13
+ <key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
14
+ <key>CFBundleName</key><string>${q}</string>
15
+ <key>CFBundlePackageType</key><string>APPL</string>
16
+ <key>CFBundleShortVersionString</key><string>${W}</string>
17
+ <key>CFBundleSignature</key><string>????</string>
18
+ <key>CFBundleVersion</key><string>${W}</string>
19
+ <key>LSBackgroundOnly</key><true/>
20
+ <key>LSUIElement</key><true/>
21
+ <key>LSMinimumSystemVersion</key><string>13.0</string>
22
+ <key>NSHumanReadableCopyright</key><string>Tamagui LLC</string>
23
+ </dict>
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
26
+ # SootSim Daemon launcher \u2014 auto-generated by 'rnxsim setup'.
27
+ # launchd spawns this; we exec the real rnxsim invocation in place so
28
+ # launchd tracks the daemon process, not the shell wrapper.
29
+ #
30
+ # stdout: ${r.stdout}
31
+ # stderr: ${r.stderr}
32
+ # a missing or broken executable can make launchd retry forever. truncate a
33
+ # retry log before it passes 10 MiB so that failure stays bounded on disk.
34
+ for log_path in ${a} ${l}; do
35
+ if [ -f "$log_path" ]; then
36
+ log_bytes=$(wc -c < "$log_path" 2>/dev/null || echo 0)
37
+ if [ "$log_bytes" -gt 10485760 ]; then
38
+ : > "$log_path"
39
+ fi
40
+ fi
41
+ done
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"?>
44
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
45
+ <plist version="1.0">
46
+ <dict>
47
+ <key>Label</key><string>${y}</string>
48
+ <key>ProgramArguments</key>
49
+ <array>
50
+ ${a}
51
+ </array>
52
+ <key>RunAtLoad</key><true/>
53
+ <key>KeepAlive</key><true/>
54
+ <key>ThrottleInterval</key><integer>${te}</integer>
55
+ <key>ProcessType</key><string>Background</string>
56
+ <key>StandardOutPath</key><string>${r}</string>
57
+ <key>StandardErrorPath</key><string>${n}</string>
58
+ </dict>
59
+ </plist>
60
+ `}function be(e,t){return P(L,{recursive:!0}),`[Unit]
61
+ Description=rnx bridge daemon
62
+ After=default.target
63
+
64
+ [Service]
65
+ Type=simple
66
+ ExecStart=${[e.executable,...e.prefixArgs].map(ke).join(" ")} serve --quiet --port ${t}
67
+ Restart=always
68
+ RestartSec=${te}
69
+
70
+ [Install]
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 'rnxsim 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 `rnxsim 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 'rnxsim 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 \`rnxsim 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 'rnxsim 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 `rnxsim daemon logs`":" bridge: NOT responding \u2014 no lockfile; check `rnxsim 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 `rnxsim 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 `rnxsim 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 `rnxsim 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 `rnxsim 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 \`rnxsim 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};