rnxsim 0.1.318 → 0.1.320

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 (164) hide show
  1. package/cli/commands/detox.ts +16 -5
  2. package/cli/commands/inspect.ts +35 -8
  3. package/cli/commands/maestro.ts +1 -1
  4. package/detox/index.ts +155 -15
  5. package/dist-cli/bin.js +5 -5
  6. package/dist-cli/chunks/{agent-OFH7IJEA.js → agent-E5UUPQXH.js} +2 -2
  7. package/dist-cli/chunks/{agent-wrapper-VF6BEPVN.js → agent-wrapper-LG33N5K3.js} +2 -2
  8. package/dist-cli/chunks/{app-fonts-ERM34FJ5.js → app-fonts-PCQ4B3U7.js} +2 -2
  9. package/dist-cli/chunks/{assert-IGMBFTLH.js → assert-2ADFEOQF.js} +2 -2
  10. package/dist-cli/chunks/{auth-HSBBTE4P.js → auth-NLB6E4XZ.js} +2 -2
  11. package/dist-cli/chunks/{beta-347FXXJ7.js → beta-AHSJMAOI.js} +2 -2
  12. package/dist-cli/chunks/{camera-OM4DK5HE.js → camera-IYDWHB6P.js} +2 -2
  13. package/dist-cli/chunks/{chunk-DCAN7GYY.js → chunk-2HKDCEHH.js} +2 -2
  14. package/dist-cli/chunks/{chunk-L7W6D2IV.js → chunk-2MJ3M5IF.js} +1 -1
  15. package/dist-cli/chunks/{chunk-JD5O4M44.js → chunk-3U24SEPY.js} +2 -2
  16. package/dist-cli/chunks/{chunk-6HOIAQW4.js → chunk-4FISS7J4.js} +1 -1
  17. package/dist-cli/chunks/{chunk-VAYHTDE7.js → chunk-4MGSHK3U.js} +2 -2
  18. package/dist-cli/chunks/{chunk-VWAZ2YDF.js → chunk-66W32ZAC.js} +3 -3
  19. package/dist-cli/chunks/{chunk-36N5TMLR.js → chunk-6TYW7J2S.js} +2 -2
  20. package/dist-cli/chunks/{chunk-7IZ5QXUO.js → chunk-6W4W2I2H.js} +1 -1
  21. package/dist-cli/chunks/{chunk-YLTTM35B.js → chunk-7QZCEUQH.js} +2 -2
  22. package/dist-cli/chunks/{chunk-SIGP7L6X.js → chunk-ACQPOL3N.js} +1 -1
  23. package/dist-cli/chunks/chunk-AGGO4OMP.js +4 -0
  24. package/dist-cli/chunks/{chunk-NOD2WL7K.js → chunk-AXCNZWS3.js} +3 -3
  25. package/dist-cli/chunks/{chunk-EBZQKLA4.js → chunk-BB2LGH5B.js} +1 -1
  26. package/dist-cli/chunks/{chunk-DD2XEHRT.js → chunk-BGG34LXF.js} +2 -2
  27. package/dist-cli/chunks/{chunk-FF6XN63V.js → chunk-BQQ2PVYQ.js} +1 -1
  28. package/dist-cli/chunks/{chunk-RUULSEKH.js → chunk-BVWMU5CV.js} +2 -2
  29. package/dist-cli/chunks/{chunk-SOWFP3GB.js → chunk-C2TJ2PLG.js} +1 -1
  30. package/dist-cli/chunks/{chunk-X2SNFQUB.js → chunk-C5VFP3FH.js} +2 -2
  31. package/dist-cli/chunks/{chunk-NZ3MD6WX.js → chunk-CQIH7FPK.js} +1 -1
  32. package/dist-cli/chunks/{chunk-ANCTBUP7.js → chunk-DNWMXDM5.js} +2 -2
  33. package/dist-cli/chunks/{chunk-PCS73SCM.js → chunk-F2BHWSSW.js} +2 -2
  34. package/dist-cli/chunks/{chunk-JBX2GVTM.js → chunk-FECIIPFS.js} +2 -2
  35. package/dist-cli/chunks/{chunk-6YA7ITPB.js → chunk-FEWMMQJW.js} +2 -2
  36. package/dist-cli/chunks/{chunk-MY37MGCH.js → chunk-FL3B7VQN.js} +1 -1
  37. package/dist-cli/chunks/{chunk-ZRQ5OUC3.js → chunk-FLBNTPBZ.js} +2 -2
  38. package/dist-cli/chunks/{chunk-526RTRUB.js → chunk-GBXRASTZ.js} +2 -2
  39. package/dist-cli/chunks/{chunk-KX5YGB6L.js → chunk-GTNGFY6G.js} +2 -2
  40. package/dist-cli/chunks/{chunk-GMR5HH6U.js → chunk-GTSF2TRR.js} +1 -1
  41. package/dist-cli/chunks/{chunk-HGEVJQ2Z.js → chunk-I76GK5JV.js} +2 -2
  42. package/dist-cli/chunks/{chunk-D35X4DGV.js → chunk-IETTTBIZ.js} +2 -2
  43. package/dist-cli/chunks/{chunk-PO5I6Q3N.js → chunk-IQKWVOTX.js} +2 -2
  44. package/dist-cli/chunks/{chunk-TEVDJAWR.js → chunk-JB2XWONS.js} +1 -1
  45. package/dist-cli/chunks/{chunk-KRYYXTD6.js → chunk-JMI7WP73.js} +2 -2
  46. package/dist-cli/chunks/{chunk-BPXQP2WT.js → chunk-KFZQQUKH.js} +2 -2
  47. package/dist-cli/chunks/{chunk-435RMSZJ.js → chunk-KX3OJSX7.js} +2 -2
  48. package/dist-cli/chunks/{chunk-PYKSLOEU.js → chunk-LEXXWNFD.js} +2 -2
  49. package/dist-cli/chunks/{chunk-YDK3RMDM.js → chunk-LRRJ3ORH.js} +2 -2
  50. package/dist-cli/chunks/{chunk-6VF3A4CX.js → chunk-LYC2SH2Y.js} +1 -1
  51. package/dist-cli/chunks/{chunk-C43A3HRV.js → chunk-MHWLXGJ3.js} +2 -2
  52. package/dist-cli/chunks/{chunk-SYUJCAYN.js → chunk-OI3DYYZV.js} +1 -1
  53. package/dist-cli/chunks/{chunk-BLBN76IW.js → chunk-OTZCVQOW.js} +1 -1
  54. package/dist-cli/chunks/{chunk-UPTSCAXP.js → chunk-QB35GBD5.js} +1 -1
  55. package/dist-cli/chunks/{chunk-GLMYWXLH.js → chunk-QSLD3RW7.js} +122 -122
  56. package/dist-cli/chunks/{chunk-FL5R6QVE.js → chunk-RHJFGX4A.js} +2 -2
  57. package/dist-cli/chunks/{chunk-MA5RZO4L.js → chunk-RY6GQZCH.js} +2 -2
  58. package/dist-cli/chunks/{chunk-IYCPNB23.js → chunk-VN56TL3M.js} +2 -2
  59. package/dist-cli/chunks/{chunk-MXSNB6VA.js → chunk-XMKZNJSL.js} +1 -1
  60. package/dist-cli/chunks/{chunk-V43DZ6MG.js → chunk-YK6FDOG6.js} +2 -2
  61. package/dist-cli/chunks/{chunk-W6BKNLC4.js → chunk-YNVC42AB.js} +1 -1
  62. package/dist-cli/chunks/{chunk-CCJGCZII.js → chunk-YUFTRNFC.js} +1 -1
  63. package/dist-cli/chunks/{chunk-5FR3XPEJ.js → chunk-Z2PV5BCT.js} +2 -2
  64. package/dist-cli/chunks/{chunk-XJPT7YWG.js → chunk-Z2TCDWQ7.js} +2 -2
  65. package/dist-cli/chunks/{chunk-53S3KEIU.js → chunk-ZWEBQ5MB.js} +3 -3
  66. package/dist-cli/chunks/{cleanup-JQOSDZEP.js → cleanup-TDZUWYSO.js} +2 -2
  67. package/dist-cli/chunks/cli-version-6BZFQWCZ.js +4 -0
  68. package/dist-cli/chunks/{compat-QHZRG5QJ.js → compat-A7N5NVPI.js} +2 -2
  69. package/dist-cli/chunks/{config-YF4L25Q3.js → config-LL62ATVZ.js} +2 -2
  70. package/dist-cli/chunks/{control-GRLJ3W27.js → control-ILH3IPOG.js} +2 -2
  71. package/dist-cli/chunks/daemon-ZUGLIV5U.js +4 -0
  72. package/dist-cli/chunks/{debug-PZOHF6WI.js → debug-WJN2YK7L.js} +3 -3
  73. package/dist-cli/chunks/{desktop-YX6QID7C.js → desktop-SACOU52P.js} +3 -3
  74. package/dist-cli/chunks/detox-HHA3KUST.js +52 -0
  75. package/dist-cli/chunks/{device-ZRHEHJ7R.js → device-K5DKLWPM.js} +2 -2
  76. package/dist-cli/chunks/{diagnose-ULSJOYWK.js → diagnose-XZYAGIEN.js} +2 -2
  77. package/dist-cli/chunks/{disk-cleanup-KLLOHU4N.js → disk-cleanup-BUHPEEFX.js} +2 -2
  78. package/dist-cli/chunks/drivers-4HU5USPO.js +4 -0
  79. package/dist-cli/chunks/{film-FDMTLO5O.js → film-XDVNORAX.js} +3 -3
  80. package/dist-cli/chunks/flow-Y42LVOVP.js +4 -0
  81. package/dist-cli/chunks/help-V6WBUFML.js +4 -0
  82. package/dist-cli/chunks/{hidden-runtime-alias-J5MGI3FF.js → hidden-runtime-alias-YIA5VZFO.js} +2 -2
  83. package/dist-cli/chunks/{home-paths-XNVF5J2H.js → home-paths-V276ZMFH.js} +2 -2
  84. package/dist-cli/chunks/inspect-WTEDX3A3.js +4 -0
  85. package/dist-cli/chunks/install-desktop-AFDKV7BH.js +4 -0
  86. package/dist-cli/chunks/{login-BIBNRKGQ.js → login-KZAVKL6H.js} +4 -4
  87. package/dist-cli/chunks/{logout-KI43UF3Y.js → logout-JFXC6U2P.js} +2 -2
  88. package/dist-cli/chunks/{maestro-4TUWVBVF.js → maestro-BS7T227L.js} +7 -7
  89. package/dist-cli/chunks/{maestro-generate-TWM4EXUJ.js → maestro-generate-WXDB2WUX.js} +3 -3
  90. package/dist-cli/chunks/{mode-AAHQAKIM.js → mode-DV2L7WE3.js} +2 -2
  91. package/dist-cli/chunks/{optional-demo-registry-E5QZ2HAL.js → optional-demo-registry-RRSPBGOI.js} +2 -2
  92. package/dist-cli/chunks/{perf-YYUZEBF7.js → perf-O3TENAUU.js} +2 -2
  93. package/dist-cli/chunks/{permissions-IGD736BA.js → permissions-DY5DNWIF.js} +2 -2
  94. package/dist-cli/chunks/{record-MOHHUJAY.js → record-XY5YEMJB.js} +3 -3
  95. package/dist-cli/chunks/{report-issue-NQT5KFBX.js → report-issue-NQA6W4LU.js} +2 -2
  96. package/dist-cli/chunks/reset-6JVRMIUQ.js +4 -0
  97. package/dist-cli/chunks/runtime-IQ5TU5BZ.js +4 -0
  98. package/dist-cli/chunks/{screenshot-command-GR5UBZGY.js → screenshot-command-26DMBR73.js} +3 -3
  99. package/dist-cli/chunks/{screenshot-layers-ZO3RNBJY.js → screenshot-layers-MVE2F5BO.js} +2 -2
  100. package/dist-cli/chunks/{screenshots-capture-LKZID6SS.js → screenshots-capture-DTSUAE6Q.js} +2 -2
  101. package/dist-cli/chunks/{serve-GW3TH5HX.js → serve-6PXVFH4O.js} +2 -2
  102. package/dist-cli/chunks/{setup-N3JKRPQK.js → setup-LDAY6QUQ.js} +2 -2
  103. package/dist-cli/chunks/{skills-IGHG3SV4.js → skills-RQWM2J2Q.js} +2 -2
  104. package/dist-cli/chunks/{state-CXCLASA5.js → state-IDQ43TIA.js} +2 -2
  105. package/dist-cli/chunks/{storage-RO6GHQ5L.js → storage-SNSBN3HY.js} +2 -2
  106. package/dist-cli/chunks/store-7L2QR4QG.js +4 -0
  107. package/dist-cli/chunks/telemetry-BHDOJRSL.js +4 -0
  108. package/dist-cli/chunks/{timeline-TUPEWR6V.js → timeline-36EQTWQZ.js} +2 -2
  109. package/dist-cli/chunks/{upgrade-HTNHXQDP.js → upgrade-MTJRBSTJ.js} +2 -2
  110. package/dist-cli/chunks/upload-76KYWLC7.js +4 -0
  111. package/dist-cli/chunks/{version-7ZYXM64U.js → version-CMVXNVHJ.js} +2 -2
  112. package/dist-cli/chunks/{web-PMRPY2NY.js → web-AHOIPBU3.js} +2 -2
  113. package/dist-cli/chunks/{what-happened-QSFD6H7W.js → what-happened-W3GZXD7R.js} +2 -2
  114. package/dist-lib/agent-daemon-client.cjs +1 -1
  115. package/dist-lib/agent-events.cjs +1 -1
  116. package/dist-lib/agent-identity.cjs +1 -1
  117. package/dist-lib/agent-sessions.cjs +1 -1
  118. package/dist-lib/attached-projects.cjs +1 -1
  119. package/dist-lib/auth/shared-session.cjs +1 -1
  120. package/dist-lib/backend-origin.cjs +1 -1
  121. package/dist-lib/beta.cjs +1 -1
  122. package/dist-lib/beta.mjs +1 -1
  123. package/dist-lib/bridge-constants.cjs +1 -1
  124. package/dist-lib/bridge-contract.cjs +1 -1
  125. package/dist-lib/cli-constants.cjs +1 -1
  126. package/dist-lib/config.cjs +1 -1
  127. package/dist-lib/detox/index.cjs +93 -11
  128. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  129. package/dist-lib/home-paths.cjs +1 -1
  130. package/dist-lib/host/bridge-host.cjs +1 -1
  131. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  132. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  133. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  134. package/dist-lib/host/websocket-proxy.cjs +1 -1
  135. package/dist-lib/index.cjs +1 -1
  136. package/dist-lib/jump-to-source-babel.cjs +1 -1
  137. package/dist-lib/menu.cjs +1 -1
  138. package/dist-lib/menu.mjs +1 -1
  139. package/dist-lib/metro.cjs +1 -1
  140. package/dist-lib/profiles.cjs +1 -1
  141. package/dist-lib/public-brand.cjs +1 -1
  142. package/dist-lib/render-mode.cjs +1 -1
  143. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  144. package/dist-lib/sdk.cjs +1 -1
  145. package/dist-lib/sdk.mjs +1 -1
  146. package/dist-lib/skills.cjs +54 -17
  147. package/dist-lib/vite.cjs +1 -1
  148. package/package.json +1 -1
  149. package/skills/rnx-perf/SKILL.md +17 -0
  150. package/src/vite-plugin.ts +5 -1
  151. package/dist-cli/chunks/chunk-QZ73ZUC7.js +0 -4
  152. package/dist-cli/chunks/cli-version-4ZJSLJIZ.js +0 -4
  153. package/dist-cli/chunks/daemon-4ICA6HT6.js +0 -4
  154. package/dist-cli/chunks/detox-ZCPGXLXA.js +0 -52
  155. package/dist-cli/chunks/drivers-IANQ4PS2.js +0 -4
  156. package/dist-cli/chunks/flow-2NM5A2NB.js +0 -4
  157. package/dist-cli/chunks/help-ZFLHXXET.js +0 -4
  158. package/dist-cli/chunks/inspect-JBEVVCFB.js +0 -4
  159. package/dist-cli/chunks/install-desktop-I4K4ESL3.js +0 -4
  160. package/dist-cli/chunks/reset-KC4YU4RE.js +0 -4
  161. package/dist-cli/chunks/runtime-UB6LX3HK.js +0 -4
  162. package/dist-cli/chunks/store-SFC4MMBY.js +0 -4
  163. package/dist-cli/chunks/telemetry-B5SBPVLX.js +0 -4
  164. package/dist-cli/chunks/upload-NXMYH3HR.js +0 -4
@@ -83,15 +83,26 @@ export async function runDetox(args: string[], opts: RunDetoxOpts = {}): Promise
83
83
  prev === '--config' ||
84
84
  prev === '-t' ||
85
85
  prev === '--testNamePattern' ||
86
- prev === '--grep'
86
+ prev === '--grep' ||
87
+ prev === '--maxWorkers' ||
88
+ prev === '--shard'
87
89
  )
88
90
  return false
89
91
  return true
90
92
  })
91
- const passthroughJestFlags = args.filter(
92
- (a) =>
93
- a === '--runInBand' || a.startsWith('--maxWorkers=') || a.startsWith('--shard='),
94
- )
93
+ const passthroughJestFlags = args.flatMap((arg, index) => {
94
+ if (
95
+ arg === '--runInBand' ||
96
+ arg.startsWith('--maxWorkers=') ||
97
+ arg.startsWith('--shard=')
98
+ ) {
99
+ return [arg]
100
+ }
101
+ if ((arg === '--maxWorkers' || arg === '--shard') && args[index + 1]) {
102
+ return [arg, args[index + 1]]
103
+ }
104
+ return []
105
+ })
95
106
 
96
107
  // test dir discovery. external test suites set SOOTSIM_TEST_DIR; otherwise
97
108
  // we auto-detect the conventional locations.
@@ -616,6 +616,41 @@ export function printShellPerfReport(result: Record<string, any>) {
616
616
  printPhase('CanvasKit submission', compositorCadence.canvaskitSubmission)
617
617
  }
618
618
  const surfaces = Array.isArray(result.auxSurfaces) ? result.auxSurfaces : []
619
+ const graphiteCaches = result.graphiteCaches
620
+ const decodedImageCache = result.decodedImageCache
621
+ if (graphiteCaches || decodedImageCache) {
622
+ const printCache = (
623
+ label: string,
624
+ cache: { bytes?: number; limitBytes?: number; purgeableBytes?: number } | null,
625
+ ) => {
626
+ if (typeof cache?.bytes !== 'number' || typeof cache.limitBytes !== 'number') {
627
+ return
628
+ }
629
+ const purgeable =
630
+ typeof cache.purgeableBytes === 'number'
631
+ ? ` · ${(cache.purgeableBytes / 1024 / 1024).toFixed(1)}MB purgeable`
632
+ : ''
633
+ console.log(
634
+ ` ${label.padEnd(29)} ${(cache.bytes / 1024 / 1024).toFixed(1)}MB/${(cache.limitBytes / 1024 / 1024).toFixed(1)}MB${purgeable}`,
635
+ )
636
+ }
637
+ console.log(``)
638
+ console.log(` device-wide caches:`)
639
+ printCache('Graphite context resources', graphiteCaches?.contextResources ?? null)
640
+ printCache('Graphite recorder resources', graphiteCaches?.recorderResources ?? null)
641
+ printCache('Graphite image provider', graphiteCaches?.imageProvider ?? null)
642
+ printCache('decoded image pixels', decodedImageCache ?? null)
643
+ if (graphiteCaches?.imageProvider) {
644
+ console.log(
645
+ ` ${''.padEnd(29)} ${graphiteCaches.imageProvider.entries} entries · ${graphiteCaches.imageProvider.uploads} uploads · ${graphiteCaches.imageProvider.evictions} evictions`,
646
+ )
647
+ }
648
+ if (decodedImageCache) {
649
+ console.log(
650
+ ` ${''.padEnd(29)} ${decodedImageCache.entries} entries/${decodedImageCache.maxEntries} max`,
651
+ )
652
+ }
653
+ }
619
654
  if (surfaces.length > 0) {
620
655
  console.log(``)
621
656
  console.log(` surfaces (last 100 frames):`)
@@ -623,14 +658,6 @@ export function printShellPerfReport(result: Record<string, any>) {
623
658
  console.log(
624
659
  ` ${String(s.surfaceId).padEnd(10)} ${String(s.frames).padStart(4)} paints avg ${s.avgMs}ms (layout ${s.avgLayoutMs}, render ${s.avgRenderMs}, flush ${s.avgFlushMs}) max ${s.maxMs}ms`,
625
660
  )
626
- if (
627
- typeof s.gpuCacheBytes === 'number' &&
628
- typeof s.gpuCacheLimitBytes === 'number'
629
- ) {
630
- console.log(
631
- ` ${''.padEnd(10)} gpu cache ${(s.gpuCacheBytes / 1024 / 1024).toFixed(1)}MB/${(s.gpuCacheLimitBytes / 1024 / 1024).toFixed(1)}MB`,
632
- )
633
- }
634
661
  }
635
662
  }
636
663
  // two profiles, two workers: the shell paints chrome/overlays, the
@@ -94,7 +94,7 @@ workspace mode (directory runs):
94
94
 
95
95
  partial:
96
96
  clearKeychain — warn-only, rnx has no keychain surface.
97
- when.platform — rnx reports iOS.
97
+ when.platform — rnx reports iOS for this runner.
98
98
  openLink — dispatched into the app via the Linking emulation
99
99
  (react-navigation deep links work); no OS-level Safari fallback.
100
100
  launchApp.arguments — ignored; rnx has no native process.
package/detox/index.ts CHANGED
@@ -608,6 +608,7 @@ type FastScreenshotData = {
608
608
  label: string
609
609
  offsetMs: number
610
610
  actualMs: number
611
+ captureRequestedAtMs?: number
611
612
  dataUrl: string
612
613
  frameIndex?: number
613
614
  virtualTimestampMs?: number
@@ -1854,17 +1855,44 @@ export const device = {
1854
1855
  async takeScreenshotStagesFast(
1855
1856
  namePrefix: string,
1856
1857
  stages: Array<{ label: string; offsetMs: number }>,
1857
- options?: { skipWarmup?: boolean },
1858
- ): Promise<Array<{ label: string; offsetMs: number; actualMs: number; path: string }>> {
1859
- const page = getPage()
1860
- const frames: Array<{
1858
+ options: {
1859
+ anchorAfterTrigger?: boolean
1860
+ skipWarmup?: boolean
1861
+ trigger: () => unknown
1862
+ },
1863
+ ): Promise<{
1864
+ captureAnchorMs: number
1865
+ frames: Array<{
1861
1866
  label: string
1862
1867
  offsetMs: number
1863
1868
  actualMs: number
1864
- dataUrl: string
1865
- }> = await page.evaluate(
1869
+ captureRequestedAtMs: number
1870
+ path: string
1871
+ }>
1872
+ triggerCompletedMs: number
1873
+ triggerStartMs: number
1874
+ }> {
1875
+ const page = getPage()
1876
+ const token = `timed-${process.pid}-${Date.now()}-${Math.random()}`
1877
+ const capturePromise: Promise<{
1878
+ captureAnchorMs: number
1879
+ frames: Array<{
1880
+ label: string
1881
+ offsetMs: number
1882
+ actualMs: number
1883
+ captureRequestedAtMs: number
1884
+ dataUrl: string
1885
+ }>
1886
+ }> = page.evaluate(
1866
1887
  async (input) => {
1867
- const sim = window as {
1888
+ type CaptureState = {
1889
+ anchorPerformanceMs: number | null
1890
+ anchorWallMs: number | null
1891
+ cancelled: boolean
1892
+ ready: boolean
1893
+ }
1894
+ type CaptureWindow = Window & {
1895
+ __sootsimTimedCaptures?: Record<string, CaptureState>
1868
1896
  SootSim?: {
1869
1897
  bridges?: {
1870
1898
  screenshot?: (opts?: unknown) => Promise<string>
@@ -1877,11 +1905,22 @@ export const device = {
1877
1905
  }
1878
1906
  }
1879
1907
  }
1880
- const screenshot = sim.SootSim?.bridges?.screenshot
1881
- const live = sim.SootSim?.bridges?.liveComposite
1908
+ const captureWindow = window as unknown as CaptureWindow
1909
+ const screenshot = captureWindow.SootSim?.bridges?.screenshot
1910
+ const live = captureWindow.SootSim?.bridges?.liveComposite
1882
1911
  if (typeof screenshot !== 'function') {
1883
1912
  throw new Error('rnx screenshot bridge is not installed')
1884
1913
  }
1914
+ const registry =
1915
+ captureWindow.__sootsimTimedCaptures ??
1916
+ (captureWindow.__sootsimTimedCaptures = {})
1917
+ const state: CaptureState = {
1918
+ anchorPerformanceMs: null,
1919
+ anchorWallMs: null,
1920
+ cancelled: false,
1921
+ ready: false,
1922
+ }
1923
+ registry[input.token] = state
1885
1924
  // initial warm-up: ensure the worker has produced at least one
1886
1925
  // frame after the menu's portal mount before we start sampling.
1887
1926
  // (a pump at higher cadence was tried and starved tap propagation —
@@ -1890,11 +1929,18 @@ export const device = {
1890
1929
  if (!input.skipWarmup) {
1891
1930
  await screenshot({ format: 'png' })
1892
1931
  }
1893
- const start = performance.now()
1932
+ state.ready = true
1933
+ while (state.anchorPerformanceMs === null || state.anchorWallMs === null) {
1934
+ if (state.cancelled) throw new Error('rnx timed capture was cancelled')
1935
+ await new Promise((resolve) => setTimeout(resolve, 0))
1936
+ }
1937
+ const captureAnchorMs = state.anchorWallMs
1938
+ const captureAnchorPerformanceMs = state.anchorPerformanceMs
1894
1939
  type Snapshot = {
1895
1940
  label: string
1896
1941
  offsetMs: number
1897
1942
  actualMs: number
1943
+ captureRequestedAtMs: number
1898
1944
  dataUrl: string | null
1899
1945
  }
1900
1946
  // each stage fires at its requested offset and SYNCHRONOUSLY
@@ -1907,7 +1953,8 @@ export const device = {
1907
1953
  (stage) =>
1908
1954
  new Promise<Snapshot>((resolve) => {
1909
1955
  const fire = async () => {
1910
- const actualMs = performance.now() - start
1956
+ const actualMs = performance.now() - captureAnchorPerformanceMs
1957
+ const captureRequestedAtMs = Date.now()
1911
1958
  try {
1912
1959
  let dataUrl: string | null = null
1913
1960
  if (live && typeof live.captureFresh === 'function') {
@@ -1935,6 +1982,7 @@ export const device = {
1935
1982
  label: stage.label,
1936
1983
  offsetMs: stage.offsetMs,
1937
1984
  actualMs,
1985
+ captureRequestedAtMs,
1938
1986
  dataUrl,
1939
1987
  })
1940
1988
  } catch {
@@ -1942,6 +1990,7 @@ export const device = {
1942
1990
  label: stage.label,
1943
1991
  offsetMs: stage.offsetMs,
1944
1992
  actualMs,
1993
+ captureRequestedAtMs,
1945
1994
  dataUrl: null,
1946
1995
  })
1947
1996
  }
@@ -1950,7 +1999,10 @@ export const device = {
1950
1999
  () => {
1951
2000
  void fire()
1952
2001
  },
1953
- Math.max(0, stage.offsetMs),
2002
+ Math.max(
2003
+ 0,
2004
+ captureAnchorPerformanceMs + stage.offsetMs - performance.now(),
2005
+ ),
1954
2006
  )
1955
2007
  }),
1956
2008
  ),
@@ -1959,6 +2011,7 @@ export const device = {
1959
2011
  label: string
1960
2012
  offsetMs: number
1961
2013
  actualMs: number
2014
+ captureRequestedAtMs: number
1962
2015
  dataUrl: string
1963
2016
  }> = []
1964
2017
  for (const snap of snaps) {
@@ -1967,14 +2020,101 @@ export const device = {
1967
2020
  label: snap.label,
1968
2021
  offsetMs: snap.offsetMs,
1969
2022
  actualMs: snap.actualMs,
2023
+ captureRequestedAtMs: snap.captureRequestedAtMs,
1970
2024
  dataUrl: snap.dataUrl,
1971
2025
  })
1972
2026
  }
1973
- return out
2027
+ delete registry[input.token]
2028
+ return { captureAnchorMs, frames: out }
1974
2029
  },
1975
- { stages, skipWarmup: options?.skipWarmup === true },
2030
+ { stages, skipWarmup: options.skipWarmup === true, token },
1976
2031
  )
1977
- return writeFastScreenshotFrames(namePrefix, frames)
2032
+
2033
+ await page.waitForFunction(
2034
+ (captureToken) => {
2035
+ const registry = (
2036
+ window as Window & {
2037
+ __sootsimTimedCaptures?: Record<string, { ready: boolean }>
2038
+ }
2039
+ ).__sootsimTimedCaptures
2040
+ return registry?.[captureToken]?.ready === true
2041
+ },
2042
+ token,
2043
+ { timeout: 5000 },
2044
+ )
2045
+
2046
+ const armCapture = (anchorMs?: number) =>
2047
+ page.evaluate(
2048
+ ({ anchorMs, captureToken }) => {
2049
+ const registry = (
2050
+ window as Window & {
2051
+ __sootsimTimedCaptures?: Record<
2052
+ string,
2053
+ {
2054
+ anchorPerformanceMs: number | null
2055
+ anchorWallMs: number | null
2056
+ ready: boolean
2057
+ }
2058
+ >
2059
+ }
2060
+ ).__sootsimTimedCaptures
2061
+ const capture = registry?.[captureToken]
2062
+ if (!capture?.ready) throw new Error('rnx timed capture was not armed')
2063
+ const nowMs = Date.now()
2064
+ capture.anchorWallMs = anchorMs ?? nowMs
2065
+ capture.anchorPerformanceMs = performance.now() - (nowMs - capture.anchorWallMs)
2066
+ return capture.anchorWallMs
2067
+ },
2068
+ { anchorMs, captureToken: token },
2069
+ )
2070
+
2071
+ let triggerStartMs = 0
2072
+ let triggerCompletedMs = 0
2073
+ try {
2074
+ let captureAnchorMs: number
2075
+ if (options.anchorAfterTrigger === false) {
2076
+ captureAnchorMs = await armCapture()
2077
+ triggerStartMs = captureAnchorMs
2078
+ const triggerPromise = Promise.resolve()
2079
+ .then(options.trigger)
2080
+ .then(() => {
2081
+ triggerCompletedMs = Date.now()
2082
+ })
2083
+ const [capture] = await Promise.all([capturePromise, triggerPromise])
2084
+ return {
2085
+ captureAnchorMs,
2086
+ frames: writeFastScreenshotFrames(namePrefix, capture.frames),
2087
+ triggerCompletedMs,
2088
+ triggerStartMs,
2089
+ }
2090
+ }
2091
+
2092
+ triggerStartMs = Date.now()
2093
+ await Promise.resolve(options.trigger())
2094
+ triggerCompletedMs = Date.now()
2095
+ captureAnchorMs = await armCapture(triggerCompletedMs)
2096
+ const capture = await capturePromise
2097
+ return {
2098
+ captureAnchorMs,
2099
+ frames: writeFastScreenshotFrames(namePrefix, capture.frames),
2100
+ triggerCompletedMs,
2101
+ triggerStartMs,
2102
+ }
2103
+ } catch (error) {
2104
+ await page
2105
+ .evaluate((captureToken) => {
2106
+ const registry = (
2107
+ window as Window & {
2108
+ __sootsimTimedCaptures?: Record<string, { cancelled: boolean }>
2109
+ }
2110
+ ).__sootsimTimedCaptures
2111
+ const capture = registry?.[captureToken]
2112
+ if (capture) capture.cancelled = true
2113
+ }, token)
2114
+ .catch(() => {})
2115
+ await capturePromise.catch(() => {})
2116
+ throw error
2117
+ }
1978
2118
  },
1979
2119
 
1980
2120
  // batched multi-stage capture for animation diffs. all N captures happen
package/dist-cli/bin.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
- /*! rnx v0.1.318 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ /*! rnx v0.1.320 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
3
  import { createRequire as __sootsimCreateRequire } from 'node:module'
4
4
  var require = __sootsimCreateRequire(import.meta.url)
5
- import{a as g,b as f}from"./chunks/chunk-MY37MGCH.js";import{a as m}from"./chunks/chunk-EBZQKLA4.js";import"./chunks/chunk-7IZ5QXUO.js";function A(a){let t=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(t)||t.startsWith("sim disconnected:")||t.startsWith("bridge never reconnected")||t.startsWith("multiple sims are connected:")||t.startsWith("saved sim ")||t.startsWith("no sim connected with id ")||t.startsWith("could not connect to ws://")||t.startsWith("rnx bridge daemon is not running")||t.startsWith("rnx bridge lockfile is fresh")||t.startsWith("rnx bridge exited before becoming ready")||t.startsWith(`${m.commandName} open: requested bridge port`)||t.startsWith("background daemon setup is unavailable")||t.startsWith("rnx bridge did not start within"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${t}
5
+ import{a as g,b as f}from"./chunks/chunk-FL3B7VQN.js";import{a as m}from"./chunks/chunk-BB2LGH5B.js";import"./chunks/chunk-6W4W2I2H.js";function A(a){let t=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(t)||t.startsWith("sim disconnected:")||t.startsWith("bridge never reconnected")||t.startsWith("multiple sims are connected:")||t.startsWith("saved sim ")||t.startsWith("no sim connected with id ")||t.startsWith("could not connect to ws://")||t.startsWith("rnx bridge daemon is not running")||t.startsWith("rnx bridge lockfile is fresh")||t.startsWith("rnx bridge exited before becoming ready")||t.startsWith(`${m.commandName} open: requested bridge port`)||t.startsWith("background daemon setup is unavailable")||t.startsWith("rnx bridge did not start within"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${t}
6
6
  `),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
7
7
  `):process.stderr.write(`${t}
8
8
  `),process.exit(1)}process.on("unhandledRejection",A);process.on("uncaughtException",A);var v=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,S=new Set(["desktop"]);function _(a){!v||!S.has(a)||(process.stderr.write(` ${m.commandName} ${a} isn't available in the standalone binary \u2014
9
9
  it needs vite / electron / playwright from a project's node_modules.
10
10
  run the npm package instead:
11
11
  ${m.commandName} ${a}
12
- `),process.exit(1))}var e=f(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:a}=await import("./chunks/hidden-runtime-alias-J5MGI3FF.js");e=a(e)}var C=e.command==="cleanup"&&e.commandArgs.length===1&&e.commandArgs[0]==="--automatic-worker";if(!C){let{trackCliEvent:a}=await import("./chunks/telemetry-B5SBPVLX.js");a({event:"cli_command_invoked",properties:{command:e.command||(e.version?"version":e.help?"help":"none"),arg_count:e.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}if(e.command!=="serve"&&e.command!=="daemon"){let{consumeRuntimeUpgradeNotice:a}=await import("./chunks/home-paths-XNVF5J2H.js"),t=a();t&&process.stderr.write(` ${m.name} engine upgraded to v${t.to}`+(t.from?` (from v${t.from})`:"")+` \xB7 what's new: ${m.origin}/changelog
13
- `)}var h=!1;async function k(){if(!h&&(h=!0,!(e.command==="cleanup"||e.command==="serve"||e.command==="agent-wrapper"||e.command==="daemon"&&e.commandArgs[0]==="uninstall")))try{let{isAutomaticSootsimCleanupComplete:a}=await import("./chunks/disk-cleanup-KLLOHU4N.js");if(a())return;let{spawn:t}=await import("node:child_process"),r=["cleanup","--automatic-worker"],d=process.argv[1],p=v?t(process.execPath,r,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):d?t(process.execPath,[d,...r],{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):t(m.commandName,r,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env});p.once("error",u=>{process.stderr.write(` ${m.name} automatic cleanup will retry on the next run: ${u.message}
12
+ `),process.exit(1))}var e=f(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:a}=await import("./chunks/hidden-runtime-alias-YIA5VZFO.js");e=a(e)}var C=e.command==="cleanup"&&e.commandArgs.length===1&&e.commandArgs[0]==="--automatic-worker";if(!C){let{trackCliEvent:a}=await import("./chunks/telemetry-BHDOJRSL.js");a({event:"cli_command_invoked",properties:{command:e.command||(e.version?"version":e.help?"help":"none"),arg_count:e.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}if(e.command!=="serve"&&e.command!=="daemon"){let{consumeRuntimeUpgradeNotice:a}=await import("./chunks/home-paths-V276ZMFH.js"),t=a();t&&process.stderr.write(` ${m.name} engine upgraded to v${t.to}`+(t.from?` (from v${t.from})`:"")+` \xB7 what's new: ${m.origin}/changelog
13
+ `)}var h=!1;async function k(){if(!h&&(h=!0,!(e.command==="cleanup"||e.command==="serve"||e.command==="agent-wrapper"||e.command==="daemon"&&e.commandArgs[0]==="uninstall")))try{let{isAutomaticSootsimCleanupComplete:a}=await import("./chunks/disk-cleanup-BUHPEEFX.js");if(a())return;let{spawn:t}=await import("node:child_process"),r=["cleanup","--automatic-worker"],d=process.argv[1],p=v?t(process.execPath,r,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):d?t(process.execPath,[d,...r],{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):t(m.commandName,r,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env});p.once("error",u=>{process.stderr.write(` ${m.name} automatic cleanup will retry on the next run: ${u.message}
14
14
  `)}),p.unref()}catch(a){process.stderr.write(` ${m.name} automatic cleanup will retry on the next run: ${a instanceof Error?a.message:String(a)}
15
- `)}}async function o(a){let{flushCliTelemetry:t}=await import("./chunks/telemetry-B5SBPVLX.js");await t(),await k(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-4ZJSLJIZ.js"),{IS_BETA:t,BETA_LABEL:r}=await import("./chunks/beta-347FXXJ7.js"),d=t?` \xB7 ${r}`:"";console.log(`rnxsim v${a()}${d}`);let{readActiveRuntime:p}=await import("./chunks/home-paths-XNVF5J2H.js"),u=p();console.log(u?`runtime v${u}`:"runtime not installed"),await o(0)}if(e.help&&!e.command){let{printHelp:a}=await import("./chunks/help-ZFLHXXET.js");a(),await o(0)}var n=e.globalFlags.port,c=e.verbose,w=e.globalFlags.device,l=e.globalFlags.theme,E=e.globalFlags.driver,N=e.globalFlags.headless===!0,b=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,i=b?["--sim",b,...e.commandArgs]:e.commandArgs;if(w||l){let{settingsStore:a}=await import("./chunks/store-SFC4MMBY.js"),t={};w&&(t.deviceModel=w),l&&(t.colorScheme=l),a.apply(t)}if(!e.command&&e.commandArgs.length===0){let{runSetup:a,shouldRunSetupForBareCommand:t}=await import("./chunks/setup-N3JKRPQK.js");t()&&(await a(["--from-welcome"]),await o(0));let{printHelp:r}=await import("./chunks/help-ZFLHXXET.js");r(),await o(0)}var s=e.command??"";if(!s){if(e.commandArgs.length>0){let t=e.commandArgs.find(r=>!r.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${t}`),console.error(" run `rnxsim --help` to see the full surface."),await o(1)}let{printHelp:a}=await import("./chunks/help-ZFLHXXET.js");a(),await o(0)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(s==="skill"){let{runSkill:r}=await import("./chunks/skills-IGHG3SV4.js");await r(e.commandArgs),await o(0)}if(s==="state"){let{runState:r}=await import("./chunks/state-CXCLASA5.js");await o(await r(i,{port:n}))}if(s==="reset"){let{runReset:r}=await import("./chunks/reset-KC4YU4RE.js");await o(await r(i,{port:n}))}let a=s==="do"||s==="get"||s==="debug"||s==="shell"||s==="perf"||s==="wait",t=e.commandArgs.find(r=>!r.startsWith("-"));if(!(s==="shell"||s==="perf"))if(a&&!t){let{printGroupHelp:r}=await import("./chunks/help-ZFLHXXET.js");r(s)&&await o(0)}else{let{printCommandHelp:r}=await import("./chunks/help-ZFLHXXET.js");r(a&&t?t:s,{prefer:a&&t?"verb":"command",group:a&&t?s:void 0}),await o(0)}}_(s);if(g.has(s)){let{runInspect:a}=await import("./chunks/inspect-JBEVVCFB.js");await a([s,...i],{port:n,verbose:c})}else switch(s){case"assert":{let{runAssert:a}=await import("./chunks/assert-IGMBFTLH.js");await a(e.commandArgs);break}case"detox":{let{runDetox:a}=await import("./chunks/detox-ZCPGXLXA.js");await a(e.commandArgs,{port:n,verbose:c});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-4TUWVBVF.js"),t=await a(i,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"record":{let{runRecord:a}=await import("./chunks/record-MOHHUJAY.js");await a(i,{port:n,verbose:c});break}case"film":{let{runFilm:a}=await import("./chunks/film-FDMTLO5O.js"),t=await a(i,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"storage":{let{runStorage:a}=await import("./chunks/storage-RO6GHQ5L.js"),t=await a(i,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"state":{let{runState:a}=await import("./chunks/state-CXCLASA5.js"),t=await a(i,{port:n});await o(t)}case"reset":{let{runReset:a}=await import("./chunks/reset-KC4YU4RE.js"),t=await a(i,{port:n});await o(t)}case"perf":{let{runPerf:a}=await import("./chunks/perf-YYUZEBF7.js"),t=await a(i,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"screenshot":{let{runScreenshotCommand:a}=await import("./chunks/screenshot-command-GR5UBZGY.js"),t=await a(i,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"camera":{let{runCamera:a}=await import("./chunks/camera-OM4DK5HE.js"),t=await a(i,{port:n});await o(typeof t=="number"?t:0)}case"mode":{let{runMode:a}=await import("./chunks/mode-AAHQAKIM.js");await a(i,{port:n,verbose:c});break}case"permissions":{let{runPermissions:a}=await import("./chunks/permissions-IGD736BA.js"),t=await a(i,{port:n,verbose:c});await o(t)}case"debug":{let{runDebug:a}=await import("./chunks/debug-PZOHF6WI.js");await a(i,{port:n,verbose:c});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-TUPEWR6V.js");await a(i,{port:n,verbose:c});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-QSFD6H7W.js");await a(i,{port:n,verbose:c});break}case"open":{let{runOpenCommand:a}=await import("./chunks/control-GRLJ3W27.js");await a(i,{port:n});break}case"use":{let{runUseCommand:a}=await import("./chunks/control-GRLJ3W27.js");await a(i,{port:n});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-GRLJ3W27.js");await a(i,{port:n});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-GRLJ3W27.js");await a(i,{port:n});break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-ZRHEHJ7R.js");await a(i,{port:n});break}case"compat":{let{runCompat:a}=await import("./chunks/compat-QHZRG5QJ.js");await a(e.commandArgs);break}case"report-issue":{let{runReportIssue:a}=await import("./chunks/report-issue-NQT5KFBX.js"),t=await a(e.commandArgs);await o(t)}case"desktop":{let{runDesktop:a}=await import("./chunks/desktop-YX6QID7C.js");await a(e.commandArgs,{port:n,device:w});break}case"login":{let{runLogin:a}=await import("./chunks/login-BIBNRKGQ.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-KI43UF3Y.js");await a();break}case"auth":{let{runAuth:a}=await import("./chunks/auth-HSBBTE4P.js");await a(e.commandArgs);break}case"setup":{let{runSetup:a}=await import("./chunks/setup-N3JKRPQK.js");await a(e.commandArgs);break}case"serve":{let{runServe:a}=await import("./chunks/serve-GW3TH5HX.js");await a(e.commandArgs,{port:n});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-4ICA6HT6.js");await a(e.commandArgs,{port:n});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-UB6LX3HK.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-HTNHXQDP.js");await a(e.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-7ZYXM64U.js");await a(e.commandArgs);break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-OFH7IJEA.js"),t=await a(e.commandArgs);await o(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-VF6BEPVN.js"),t=await a(e.commandArgs);await o(t)}case"skill":{let{runSkill:a}=await import("./chunks/skills-IGHG3SV4.js");await a(e.commandArgs);break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-ERM34FJ5.js");await a(e.commandArgs);break}case"config":{let{runConfig:a}=await import("./chunks/config-YF4L25Q3.js");await a(e.commandArgs);break}case"cleanup":{let{runCleanup:a}=await import("./chunks/cleanup-JQOSDZEP.js"),t=await a(e.commandArgs);await o(t)}default:console.error(` unknown command: ${s}`),console.error(" run `rnxsim --help` to see the full surface."),await o(1)}await k();
15
+ `)}}async function o(a){let{flushCliTelemetry:t}=await import("./chunks/telemetry-BHDOJRSL.js");await t(),await k(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-6BZFQWCZ.js"),{IS_BETA:t,BETA_LABEL:r}=await import("./chunks/beta-AHSJMAOI.js"),d=t?` \xB7 ${r}`:"";console.log(`rnxsim v${a()}${d}`);let{readActiveRuntime:p}=await import("./chunks/home-paths-V276ZMFH.js"),u=p();console.log(u?`runtime v${u}`:"runtime not installed"),await o(0)}if(e.help&&!e.command){let{printHelp:a}=await import("./chunks/help-V6WBUFML.js");a(),await o(0)}var n=e.globalFlags.port,c=e.verbose,w=e.globalFlags.device,l=e.globalFlags.theme,E=e.globalFlags.driver,N=e.globalFlags.headless===!0,b=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,i=b?["--sim",b,...e.commandArgs]:e.commandArgs;if(w||l){let{settingsStore:a}=await import("./chunks/store-7L2QR4QG.js"),t={};w&&(t.deviceModel=w),l&&(t.colorScheme=l),a.apply(t)}if(!e.command&&e.commandArgs.length===0){let{runSetup:a,shouldRunSetupForBareCommand:t}=await import("./chunks/setup-LDAY6QUQ.js");t()&&(await a(["--from-welcome"]),await o(0));let{printHelp:r}=await import("./chunks/help-V6WBUFML.js");r(),await o(0)}var s=e.command??"";if(!s){if(e.commandArgs.length>0){let t=e.commandArgs.find(r=>!r.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${t}`),console.error(" run `rnxsim --help` to see the full surface."),await o(1)}let{printHelp:a}=await import("./chunks/help-V6WBUFML.js");a(),await o(0)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(s==="skill"){let{runSkill:r}=await import("./chunks/skills-RQWM2J2Q.js");await r(e.commandArgs),await o(0)}if(s==="state"){let{runState:r}=await import("./chunks/state-IDQ43TIA.js");await o(await r(i,{port:n}))}if(s==="reset"){let{runReset:r}=await import("./chunks/reset-6JVRMIUQ.js");await o(await r(i,{port:n}))}let a=s==="do"||s==="get"||s==="debug"||s==="shell"||s==="perf"||s==="wait",t=e.commandArgs.find(r=>!r.startsWith("-"));if(!(s==="shell"||s==="perf"))if(a&&!t){let{printGroupHelp:r}=await import("./chunks/help-V6WBUFML.js");r(s)&&await o(0)}else{let{printCommandHelp:r}=await import("./chunks/help-V6WBUFML.js");r(a&&t?t:s,{prefer:a&&t?"verb":"command",group:a&&t?s:void 0}),await o(0)}}_(s);if(g.has(s)){let{runInspect:a}=await import("./chunks/inspect-WTEDX3A3.js");await a([s,...i],{port:n,verbose:c})}else switch(s){case"assert":{let{runAssert:a}=await import("./chunks/assert-2ADFEOQF.js");await a(e.commandArgs);break}case"detox":{let{runDetox:a}=await import("./chunks/detox-HHA3KUST.js");await a(e.commandArgs,{port:n,verbose:c});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-BS7T227L.js"),t=await a(i,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"record":{let{runRecord:a}=await import("./chunks/record-XY5YEMJB.js");await a(i,{port:n,verbose:c});break}case"film":{let{runFilm:a}=await import("./chunks/film-XDVNORAX.js"),t=await a(i,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"storage":{let{runStorage:a}=await import("./chunks/storage-SNSBN3HY.js"),t=await a(i,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"state":{let{runState:a}=await import("./chunks/state-IDQ43TIA.js"),t=await a(i,{port:n});await o(t)}case"reset":{let{runReset:a}=await import("./chunks/reset-6JVRMIUQ.js"),t=await a(i,{port:n});await o(t)}case"perf":{let{runPerf:a}=await import("./chunks/perf-O3TENAUU.js"),t=await a(i,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"screenshot":{let{runScreenshotCommand:a}=await import("./chunks/screenshot-command-26DMBR73.js"),t=await a(i,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"camera":{let{runCamera:a}=await import("./chunks/camera-IYDWHB6P.js"),t=await a(i,{port:n});await o(typeof t=="number"?t:0)}case"mode":{let{runMode:a}=await import("./chunks/mode-DV2L7WE3.js");await a(i,{port:n,verbose:c});break}case"permissions":{let{runPermissions:a}=await import("./chunks/permissions-DY5DNWIF.js"),t=await a(i,{port:n,verbose:c});await o(t)}case"debug":{let{runDebug:a}=await import("./chunks/debug-WJN2YK7L.js");await a(i,{port:n,verbose:c});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-36EQTWQZ.js");await a(i,{port:n,verbose:c});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-W3GZXD7R.js");await a(i,{port:n,verbose:c});break}case"open":{let{runOpenCommand:a}=await import("./chunks/control-ILH3IPOG.js");await a(i,{port:n});break}case"use":{let{runUseCommand:a}=await import("./chunks/control-ILH3IPOG.js");await a(i,{port:n});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-ILH3IPOG.js");await a(i,{port:n});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-ILH3IPOG.js");await a(i,{port:n});break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-K5DKLWPM.js");await a(i,{port:n});break}case"compat":{let{runCompat:a}=await import("./chunks/compat-A7N5NVPI.js");await a(e.commandArgs);break}case"report-issue":{let{runReportIssue:a}=await import("./chunks/report-issue-NQA6W4LU.js"),t=await a(e.commandArgs);await o(t)}case"desktop":{let{runDesktop:a}=await import("./chunks/desktop-SACOU52P.js");await a(e.commandArgs,{port:n,device:w});break}case"login":{let{runLogin:a}=await import("./chunks/login-KZAVKL6H.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-JFXC6U2P.js");await a();break}case"auth":{let{runAuth:a}=await import("./chunks/auth-NLB6E4XZ.js");await a(e.commandArgs);break}case"setup":{let{runSetup:a}=await import("./chunks/setup-LDAY6QUQ.js");await a(e.commandArgs);break}case"serve":{let{runServe:a}=await import("./chunks/serve-6PXVFH4O.js");await a(e.commandArgs,{port:n});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-ZUGLIV5U.js");await a(e.commandArgs,{port:n});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-IQ5TU5BZ.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-MTJRBSTJ.js");await a(e.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-CMVXNVHJ.js");await a(e.commandArgs);break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-E5UUPQXH.js"),t=await a(e.commandArgs);await o(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-LG33N5K3.js"),t=await a(e.commandArgs);await o(t)}case"skill":{let{runSkill:a}=await import("./chunks/skills-RQWM2J2Q.js");await a(e.commandArgs);break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-PCQ4B3U7.js");await a(e.commandArgs);break}case"config":{let{runConfig:a}=await import("./chunks/config-LL62ATVZ.js");await a(e.commandArgs);break}case"cleanup":{let{runCleanup:a}=await import("./chunks/cleanup-TDZUWYSO.js"),t=await a(e.commandArgs);await o(t)}default:console.error(` unknown command: ${s}`),console.error(" run `rnxsim --help` to see the full surface."),await o(1)}await k();
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.318 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.320 | (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 b,b as E,c as A,d as l,e as S,g as x,h as j,j as T,n as I,o as k,p as D,q as g,r as O,s as C}from"./chunk-YLTTM35B.js";import"./chunk-SIGP7L6X.js";import{c as $}from"./chunk-KX5YGB6L.js";import"./chunk-PCS73SCM.js";import"./chunk-526RTRUB.js";import"./chunk-DCAN7GYY.js";import"./chunk-PYKSLOEU.js";import"./chunk-435RMSZJ.js";import"./chunk-6VF3A4CX.js";import"./chunk-HGEVJQ2Z.js";import{j as y}from"./chunk-NZ3MD6WX.js";import"./chunk-XJPT7YWG.js";import"./chunk-EBZQKLA4.js";import"./chunk-L7W6D2IV.js";import"./chunk-7IZ5QXUO.js";import w from"node:fs";import d from"node:path";import{spawn as _}from"node:child_process";import F from"node:net";import{WebSocket as R}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new R(`ws://localhost:${this.port}`),this.ready=new Promise((t,r)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),r(new c(`could not connect to rnx daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async sendClaimedPrompt(e,t){return this.send("agent:send-claimed-prompt",{simId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==R.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let r=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(r),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(r,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:r,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(r),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let r=this.pending.get(t.id);r&&(this.pending.delete(t.id),clearTimeout(r.timer),t.error?r.reject(new c(t.error,t.code)):r.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function M(n=7668,e=400){return new Promise(t=>{let r=new F.Socket,s=!1,o=i=>{s||(s=!0,r.destroy(),t(i))};r.setTimeout(e),r.once("connect",()=>o(!0)),r.once("timeout",()=>o(!1)),r.once("error",()=>o(!1)),r.connect(n,"127.0.0.1")})}async function B(n={}){let e=n.port??7668;if(await M(e))return{alreadyRunning:!0};if(y())throw new c(`no rnx bridge on port ${e}. run \`rnxsim setup\` to install the background daemon, or \`rnxsim serve\` in another shell.`,"DEV_HOST_REFUSED");let{cmd:t,prefixArgs:r}=C(),s=[...r,"serve","--quiet"];e!==7668&&s.push("--port",String(e));let o=_(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(n.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await M(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned rnx daemon on port ${e} but it did not come up in time. run \`rnxsim serve\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await B({port:n.port,startupTimeoutMs:n.startupTimeoutMs});let e=new f(n);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function ge(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return L(),0;case"attach":return await W(t);case"projects":return await J();case"project":return await V(t);case"sessions":return await H(t);case"start":return await G(t);case"prompt":return await q(t);case"watch":return await K(t);case"transcript":return await z(t);case"end":return await Q(t);case"paths":return await Y();default:return process.stderr.write(`unknown agent subcommand: ${e}
4
+ import{a as b,b as E,c as A,d as l,e as S,g as x,h as j,j as T,n as I,o as k,p as D,q as g,r as O,s as C}from"./chunk-7QZCEUQH.js";import"./chunk-ACQPOL3N.js";import{c as $}from"./chunk-GTNGFY6G.js";import"./chunk-F2BHWSSW.js";import"./chunk-GBXRASTZ.js";import"./chunk-2HKDCEHH.js";import"./chunk-LEXXWNFD.js";import"./chunk-KX3OJSX7.js";import"./chunk-LYC2SH2Y.js";import"./chunk-I76GK5JV.js";import{j as y}from"./chunk-CQIH7FPK.js";import"./chunk-Z2TCDWQ7.js";import"./chunk-BB2LGH5B.js";import"./chunk-2MJ3M5IF.js";import"./chunk-6W4W2I2H.js";import w from"node:fs";import d from"node:path";import{spawn as _}from"node:child_process";import F from"node:net";import{WebSocket as R}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new R(`ws://localhost:${this.port}`),this.ready=new Promise((t,r)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),r(new c(`could not connect to rnx daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async sendClaimedPrompt(e,t){return this.send("agent:send-claimed-prompt",{simId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==R.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let r=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(r),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(r,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:r,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(r),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let r=this.pending.get(t.id);r&&(this.pending.delete(t.id),clearTimeout(r.timer),t.error?r.reject(new c(t.error,t.code)):r.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function M(n=7668,e=400){return new Promise(t=>{let r=new F.Socket,s=!1,o=i=>{s||(s=!0,r.destroy(),t(i))};r.setTimeout(e),r.once("connect",()=>o(!0)),r.once("timeout",()=>o(!1)),r.once("error",()=>o(!1)),r.connect(n,"127.0.0.1")})}async function B(n={}){let e=n.port??7668;if(await M(e))return{alreadyRunning:!0};if(y())throw new c(`no rnx bridge on port ${e}. run \`rnxsim setup\` to install the background daemon, or \`rnxsim serve\` in another shell.`,"DEV_HOST_REFUSED");let{cmd:t,prefixArgs:r}=C(),s=[...r,"serve","--quiet"];e!==7668&&s.push("--port",String(e));let o=_(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(n.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await M(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned rnx daemon on port ${e} but it did not come up in time. run \`rnxsim serve\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await B({port:n.port,startupTimeoutMs:n.startupTimeoutMs});let e=new f(n);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function ge(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return L(),0;case"attach":return await W(t);case"projects":return await J();case"project":return await V(t);case"sessions":return await H(t);case"start":return await G(t);case"prompt":return await q(t);case"watch":return await K(t);case"transcript":return await z(t);case"end":return await Q(t);case"paths":return await Y();default:return process.stderr.write(`unknown agent subcommand: ${e}
5
5
  `),L(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
6
6
  `),1;throw r}}async function v(n){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await n(e)}finally{e.close()}}function L(){$("agent")}function P(n,e){let t={},r=[];for(let s=0;s<n.length;s++){let o=n[s],i=e[o];i==="value"?(t[o]=n[s+1]??"",s++):i==="bool"?t[o]=!0:r.push(o)}return{flags:t,positional:r}}function U(n,e="codex"){return n==="codex"||n==="claude"?n:e}async function W(n){let{flags:e,positional:t}=P(n,{"--name":"value","--provider":"value"}),r=t[0];if(!r)return process.stderr.write(`usage: rnxsim agent attach <dir> [--name X] [--provider codex|claude]
7
7
  `),2;let s=d.resolve(r);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.318 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.320 | (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 M}from"./chunk-SIGP7L6X.js";import"./chunk-7IZ5QXUO.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as C,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,f=!1,a=new Promise(s=>{t.on("exit",(o,e)=>{f=!0;let p=new Error(`codex app-server exited (code=${o}, signal=${e??""})`);for(let{reject:y}of r.values())y(p);r.clear(),s({code:o,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let o=s.trim();if(!o)return;let e;try{e=JSON.parse(o)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,y=p!=null?r.get(p):void 0;if(!y)return;r.delete(p),e.error?y.reject(new b(e.error.message,e.error.code,e.error.data)):y.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let y of p)try{y(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let o=m.get("__stderr__");if(o)for(let e of o)try{e({text:s})}catch{}});function n(s){if(!f)try{t.stdin.write(JSON.stringify(s)+`
4
+ import{b as M}from"./chunk-ACQPOL3N.js";import"./chunk-6W4W2I2H.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as C,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,f=!1,a=new Promise(s=>{t.on("exit",(o,e)=>{f=!0;let p=new Error(`codex app-server exited (code=${o}, signal=${e??""})`);for(let{reject:y}of r.values())y(p);r.clear(),s({code:o,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let o=s.trim();if(!o)return;let e;try{e=JSON.parse(o)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,y=p!=null?r.get(p):void 0;if(!y)return;r.delete(p),e.error?y.reject(new b(e.error.message,e.error.code,e.error.data)):y.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let y of p)try{y(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let o=m.get("__stderr__");if(o)for(let e of o)try{e({text:s})}catch{}});function n(s){if(!f)try{t.stdin.write(JSON.stringify(s)+`
5
5
  `)}catch{}}return{exited:a,on(s,o){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(o),()=>{e?.delete(o)}},request(s,o){if(f)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,y)=>{r.set(e,{resolve:l=>p(l),reject:y,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:o})})},notify(s,o){n({jsonrpc:"2.0",method:s,params:o})},async shutdown(s=1500){if(f)return;try{t.stdin.end()}catch{}let o=setTimeout(()=>{if(!f)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(o)}},kill(s="SIGTERM"){if(!f)try{t.kill(s)}catch{}}}}var O="never",F="danger-full-access",Z={type:"dangerFullAccess"},D="fast",ee="medium",te=Q(G);async function ne(d,t){let r=t||d;if(r.includes("/")||r.includes("\\"))return C(r)?{ok:!0,path:r}:{ok:!1,message:`agent binary not found at path: ${r}`};try{let{stdout:m}=await te("which",[r],{timeout:1500}),u=m.trim();return u?{ok:!0,path:u}:{ok:!1,message:`${r} not found on PATH`}}catch{return{ok:!1,message:`${r} not found on PATH. install the ${d} CLI and retry, or pass --${d}-bin /path/to/${d} to agent start.`}}}function re(d){let t={"--session-id":"sessionId","--project-id":"projectId","--provider":"provider","--cwd":"cwd","--prompt-in":"promptIn","--events-out":"eventsOut","--transcript":"transcript","--codex-bin":"codexBin","--claude-bin":"claudeBin","--claude-session-uuid":"claudeSessionUuid"},r={};for(let m=0;m<d.length;m++){let u=d[m];if(u==="--fresh-thread"){r.freshThread=!0;continue}let f=t[u];f&&(r[f]=d[m+1],m++)}return r}async function Ie(d){let t=re(d);if(!t.sessionId||!t.projectId||!t.provider||!t.cwd||!t.promptIn||!t.eventsOut)return process.stderr.write(`usage: rnxsim agent-wrapper --session-id <id> --project-id <id>
6
6
  --provider codex|claude --cwd <path>
7
7
  --prompt-in <fifo> --events-out <fifo>
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.318 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.320 | (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 p}from"./chunk-PO5I6Q3N.js";import"./chunk-BLBN76IW.js";import"./chunk-MXSNB6VA.js";import"./chunk-7IZ5QXUO.js";import{existsSync as h,mkdirSync as d,readFileSync as y,writeFileSync as g}from"node:fs";import{join as m}from"node:path";import{gzipSync as w}from"node:zlib";function f(t,e){let o=t.indexOf(`--${e}`);if(o!==-1&&o+1<t.length)return t[o+1];let i=t.find(r=>r.startsWith(`--${e}=`));return i?i.slice(e.length+3):void 0}async function x(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),i=f(t,"manifest");if((!o||!i)&&(console.error(" usage: rnxsim app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>"),process.exit(1)),!e.trim()){console.log("no app fonts declared \u2014 nothing to stage");return}d(o,{recursive:!0});let r=await p(e,{onStaged:({url:n,byteLength:s})=>console.log(` staged app font: ${n} (${(s/1024).toFixed(1)} KiB)`),onError:(n,s)=>console.error(` warning: failed to fetch app font ${n}: ${s instanceof Error?s.message:s}`)}),a=[];for(let n of r){let s=w(n.bytes);g(m(o,n.urlhash),s),a.push({url:n.url,urlhash:n.urlhash,contentType:n.contentType,encoding:"gzip",sizeBytes:s.length,rawBytes:n.bytes.byteLength})}let c=[];if(h(i))try{let n=JSON.parse(y(i,"utf8"));Array.isArray(n)&&(c=n)}catch{}let u=new Set(c.map(n=>n.urlhash)),l=[...c,...a.filter(n=>!u.has(n.urlhash))];g(i,JSON.stringify(l)),console.log(`staged ${a.length} app font(s); manifest now has ${l.length} file(s)`)}async function E(t){let e=t[0];if(e==="stage"){await x(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
4
+ import{k as p}from"./chunk-IQKWVOTX.js";import"./chunk-OTZCVQOW.js";import"./chunk-XMKZNJSL.js";import"./chunk-6W4W2I2H.js";import{existsSync as h,mkdirSync as d,readFileSync as y,writeFileSync as g}from"node:fs";import{join as m}from"node:path";import{gzipSync as w}from"node:zlib";function f(t,e){let o=t.indexOf(`--${e}`);if(o!==-1&&o+1<t.length)return t[o+1];let i=t.find(r=>r.startsWith(`--${e}=`));return i?i.slice(e.length+3):void 0}async function x(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),i=f(t,"manifest");if((!o||!i)&&(console.error(" usage: rnxsim app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>"),process.exit(1)),!e.trim()){console.log("no app fonts declared \u2014 nothing to stage");return}d(o,{recursive:!0});let r=await p(e,{onStaged:({url:n,byteLength:s})=>console.log(` staged app font: ${n} (${(s/1024).toFixed(1)} KiB)`),onError:(n,s)=>console.error(` warning: failed to fetch app font ${n}: ${s instanceof Error?s.message:s}`)}),a=[];for(let n of r){let s=w(n.bytes);g(m(o,n.urlhash),s),a.push({url:n.url,urlhash:n.urlhash,contentType:n.contentType,encoding:"gzip",sizeBytes:s.length,rawBytes:n.bytes.byteLength})}let c=[];if(h(i))try{let n=JSON.parse(y(i,"utf8"));Array.isArray(n)&&(c=n)}catch{}let u=new Set(c.map(n=>n.urlhash)),l=[...c,...a.filter(n=>!u.has(n.urlhash))];g(i,JSON.stringify(l)),console.log(`staged ${a.length} app font(s); manifest now has ${l.length} file(s)`)}async function E(t){let e=t[0];if(e==="stage"){await x(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.318 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.320 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import"./chunk-7IZ5QXUO.js";import{spawn as v}from"child_process";var w=new Set(["describe","find","list","network","logs","count","tree","url","a11y","node","layout","keyboard","errors","warnings","requests","animations","animation","state","sample-color"]),S=new Set(["--exists","--empty","--negate","--quiet","--allow-timeout","!"]),q=new Set(["--count","--count-at-least","--count-at-most","--contains","--not-contains","--matches","--not-matches","--equals","--jq","--has-path","--within"]),P=new Set(["--path-equals"]);function j(s){let r=[],u=[],n=0,e=!1,t=!1,i=!1;for(let o=0;o<s.length;o++){let a=s[o];if(a==="--within"){let c=Number(s[o+1]);if(!Number.isFinite(c)||c<0)return{error:`--within requires a non-negative number, got: ${s[o+1]}`};n=c,o++;continue}if(a==="--negate"||a==="!"){e=!0;continue}if(a==="--quiet"){t=!0;continue}if(a==="--allow-timeout"){i=!0;continue}if(S.has(a)){u.push({kind:a,args:[]});continue}if(q.has(a)){let c=s[o+1];if(c==null)return{error:`${a} requires a value`};u.push({kind:a,args:[c]}),o++;continue}if(P.has(a)){let c=s[o+1],f=s[o+2];if(c==null||f==null)return{error:`${a} requires <path> <value>`};u.push({kind:a,args:[c,f]}),o+=2;continue}r.push(a)}return r.length===0?{error:"assert requires a verb (e.g. find, describe, get errors)"}:{verbArgs:r,predicates:u,withinMs:n,negate:e,quiet:t,allowTimeout:i}}function N(s){return s[0]==="get"||s[0]==="debug"?w.has(s[1])?s[1]:null:s[0]==="do"||s[0]==="wait"?null:w.has(s[0])?s[0]:null}async function R(s){let u=[process.argv[1],...s,"--json"];return new Promise(n=>{let e=v(process.execPath,u,{stdio:["ignore","pipe","pipe"],env:process.env}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",o=>{n({ok:!1,payload:null,reason:`spawn failed: ${o.message}`})}),e.on("close",o=>{if(o!==0){let a=i.trim().split(`
4
+ import"./chunk-6W4W2I2H.js";import{spawn as v}from"child_process";var w=new Set(["describe","find","list","network","logs","count","tree","url","a11y","node","layout","keyboard","errors","warnings","requests","animations","animation","state","sample-color"]),S=new Set(["--exists","--empty","--negate","--quiet","--allow-timeout","!"]),q=new Set(["--count","--count-at-least","--count-at-most","--contains","--not-contains","--matches","--not-matches","--equals","--jq","--has-path","--within"]),P=new Set(["--path-equals"]);function j(s){let r=[],u=[],n=0,e=!1,t=!1,i=!1;for(let o=0;o<s.length;o++){let a=s[o];if(a==="--within"){let c=Number(s[o+1]);if(!Number.isFinite(c)||c<0)return{error:`--within requires a non-negative number, got: ${s[o+1]}`};n=c,o++;continue}if(a==="--negate"||a==="!"){e=!0;continue}if(a==="--quiet"){t=!0;continue}if(a==="--allow-timeout"){i=!0;continue}if(S.has(a)){u.push({kind:a,args:[]});continue}if(q.has(a)){let c=s[o+1];if(c==null)return{error:`${a} requires a value`};u.push({kind:a,args:[c]}),o++;continue}if(P.has(a)){let c=s[o+1],f=s[o+2];if(c==null||f==null)return{error:`${a} requires <path> <value>`};u.push({kind:a,args:[c,f]}),o+=2;continue}r.push(a)}return r.length===0?{error:"assert requires a verb (e.g. find, describe, get errors)"}:{verbArgs:r,predicates:u,withinMs:n,negate:e,quiet:t,allowTimeout:i}}function N(s){return s[0]==="get"||s[0]==="debug"?w.has(s[1])?s[1]:null:s[0]==="do"||s[0]==="wait"?null:w.has(s[0])?s[0]:null}async function R(s){let u=[process.argv[1],...s,"--json"];return new Promise(n=>{let e=v(process.execPath,u,{stdio:["ignore","pipe","pipe"],env:process.env}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",o=>{n({ok:!1,payload:null,reason:`spawn failed: ${o.message}`})}),e.on("close",o=>{if(o!==0){let a=i.trim().split(`
5
5
  `).slice(-2).join(" | ").slice(0,200);n({ok:!1,payload:null,reason:`verb exited ${o}${a?`: ${a}`:""}`});return}if(!t.trim()){n({ok:!1,payload:null,reason:"verb produced no output"});return}try{let a=JSON.parse(t);n({ok:!0,payload:a})}catch{n({ok:!1,payload:null,reason:`verb output was not valid json: ${t.slice(0,120)}`})}})})}function y(s,r){let u=r.split(".").filter(e=>e.length>0),n=s;for(let e of u){if(n==null)return{found:!1};if(Array.isArray(n)){let t=Number(e);if(!Number.isInteger(t)||t<0||t>=n.length)return{found:!1};n=n[t];continue}if(typeof n=="object"){let t=n;if(!(e in t))return{found:!1};n=t[e];continue}return{found:!1}}return{found:!0,value:n}}function d(s){return Array.isArray(s)?s.length:s&&typeof s=="object"?Object.keys(s).length:null}async function A(s,r){let{kind:u,args:n}=s;switch(u){case"--exists":return r==null?{ok:!1,reason:"payload is null"}:d(r)===0?{ok:!1,reason:"payload is empty"}:{ok:!0,reason:"exists"};case"--empty":{if(r==null)return{ok:!0,reason:"payload is null"};let e=d(r);return e===0?{ok:!0,reason:"payload is empty"}:{ok:!1,reason:`payload has ${e} item(s)`}}case"--count":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:`payload not countable (${typeof r})`}:{ok:t===e,reason:`count=${t}, want=${e}`}}case"--count-at-least":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t>=e,reason:`count=${t}, want>=${e}`}}case"--count-at-most":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t<=e,reason:`count=${t}, want<=${e}`}}case"--contains":{let e=n[0],t=JSON.stringify(r);return{ok:t.includes(e),reason:t.includes(e)?`contains "${e}"`:`missing "${e}"`}}case"--not-contains":{let e=n[0],t=JSON.stringify(r);return{ok:!t.includes(e),reason:t.includes(e)?`unexpected "${e}"`:`not contains "${e}"`}}case"--matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=e.test(t);return{ok:i,reason:i?`matches /${n[0]}/`:`no match for /${n[0]}/`}}case"--not-matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=!e.test(t);return{ok:i,reason:i?`not matches /${n[0]}/`:`unexpected /${n[0]}/`}}case"--equals":{let e=n[0],t=typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(r):JSON.stringify(r);return{ok:t===e,reason:`got=${JSON.stringify(t)}, want=${JSON.stringify(e)}`}}case"--has-path":{let e=y(r,n[0]);return{ok:e.found,reason:e.found?`path ${n[0]} present`:`path ${n[0]} missing`}}case"--path-equals":{let[e,t]=n,i=y(r,e);if(!i.found)return{ok:!1,reason:`path ${e} missing`};let o=typeof i.value=="string"||typeof i.value=="number"||typeof i.value=="boolean"?String(i.value):JSON.stringify(i.value);return{ok:o===t,reason:`${e}=${o}, want=${t}`}}case"--jq":{let e=n[0];try{let i=(await O(e,r)).trim();return{ok:i.length>0&&i!=="null"&&i!=="false"&&i!=='""',reason:`jq: ${i.slice(0,120)}`}}catch(t){throw new Error(`jq evaluation failed: ${t.message}`)}}default:return{ok:!1,reason:`unknown predicate ${u}`}}}function O(s,r){return new Promise((u,n)=>{let e=v("jq",[s],{stdio:["pipe","pipe","pipe"]}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",n),e.on("close",o=>{if(o!==0){n(new Error(i.trim()||`jq exited ${o}`));return}u(t)}),e.stdin.end(JSON.stringify(r))})}async function T(s){(s[0]==="--help"||s[0]==="-h"||s.length===0)&&(J(),process.exit(s.length===0?2:0));let r=j(s);"error"in r&&(process.stderr.write(` assert: ${r.error}
6
6
  `),process.exit(2));let{verbArgs:u,predicates:n,withinMs:e,negate:t,quiet:i,allowTimeout:o}=r;N(u)||(process.stderr.write(` assert: unknown or non-read verb: ${u.join(" ")}
7
7
  supported: ${Array.from(w).sort().join(", ")}
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.318 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.320 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as s}from"./chunk-BPXQP2WT.js";import{d as i}from"./chunk-36N5TMLR.js";import"./chunk-NZ3MD6WX.js";import"./chunk-7IZ5QXUO.js";function t(){console.log(`
4
+ import{a as s}from"./chunk-KFZQQUKH.js";import{d as i}from"./chunk-6TYW7J2S.js";import"./chunk-CQIH7FPK.js";import"./chunk-6W4W2I2H.js";function t(){console.log(`
5
5
  rnxsim auth \u2014 inspect CLI auth
6
6
 
7
7
  usage:
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.318 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.320 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a,b,c,d}from"./chunk-L7W6D2IV.js";import"./chunk-7IZ5QXUO.js";export{d as BETA_ASK_HEADLINE,b as BETA_LABEL,c as BETA_TAGLINE,a as IS_BETA};
4
+ import{a,b,c,d}from"./chunk-2MJ3M5IF.js";import"./chunk-6W4W2I2H.js";export{d as BETA_ASK_HEADLINE,b as BETA_LABEL,c as BETA_TAGLINE,a as IS_BETA};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.318 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.320 | (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 O}from"./chunk-RUULSEKH.js";import"./chunk-TEVDJAWR.js";import{q as E,s as F,u as N}from"./chunk-435RMSZJ.js";import"./chunk-6VF3A4CX.js";import{r as S}from"./chunk-NZ3MD6WX.js";import"./chunk-7IZ5QXUO.js";import{createHash as I,randomUUID as q}from"node:crypto";import{createReadStream as D}from"node:fs";import l from"node:fs/promises";import f from"node:path";var T="/__camera-fixtures/",J=new Set([".m4v",".mov",".mp4",".webm"]);function _(){console.log(`
4
+ import{m as O}from"./chunk-BVWMU5CV.js";import"./chunk-JB2XWONS.js";import{q as E,s as F,u as N}from"./chunk-KX3OJSX7.js";import"./chunk-LYC2SH2Y.js";import{r as S}from"./chunk-CQIH7FPK.js";import"./chunk-6W4W2I2H.js";import{createHash as I,randomUUID as q}from"node:crypto";import{createReadStream as D}from"node:fs";import l from"node:fs/promises";import f from"node:path";var T="/__camera-fixtures/",J=new Set([".m4v",".mov",".mp4",".webm"]);function _(){console.log(`
5
5
  rnxsim camera \u2014 control the simulator camera source
6
6
 
7
7
  usage:
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.318 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.320 | (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{l as n}from"./chunk-PYKSLOEU.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(`
4
+ import{l as n}from"./chunk-LEXXWNFD.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
5
  `)}export{g as a};
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.318 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.320 | (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 o=!0,e="public beta",t=e,n="we send anonymous error and dependency data while you use it";export{o as a,e as b,t as c,n as d};
@@ -1,7 +1,7 @@
1
- /*! rnx v0.1.318 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.320 | (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-DD2XEHRT.js";import{a as c,b as l}from"./chunk-BPXQP2WT.js";import{a}from"./chunk-36N5TMLR.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-BGG34LXF.js";import{a as c,b as l}from"./chunk-KFZQQUKH.js";import{a}from"./chunk-6TYW7J2S.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.318 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.320 | (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 t(_){return`(async () => {
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.318 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.320 | (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 c}from"./chunk-V43DZ6MG.js";import{J as u,l}from"./chunk-NZ3MD6WX.js";function m(t){return t.replace(/^\[|\]$/g,"").toLowerCase()}function R(t){let n=m(t);return n==="localhost"||n.endsWith(".localhost")||n==="0.0.0.0"||n==="::1"||/^127(?:\.\d{1,3}){3}$/.test(n)}import i from"fs";import e from"path";import{fileURLToPath as d}from"url";var s;function g(){if(s!==void 0)return s;let t=e.dirname(d(import.meta.url));for(let n=0;n<12&&t!==e.dirname(t);n++){if(i.existsSync(e.join(t,"packages/sootsim-engine/package.json"))&&i.existsSync(e.join(t,"public/sootsim")))return s=t,t;t=e.dirname(t)}return s=null,null}function p(){if(process.env.SOOTSIM_HOME&&u())return null;let t=g();if(!t)return null;let n=e.join(t,"public/sootsim");return i.existsSync(e.join(n,"index.html"))&&i.existsSync(e.join(n,"engine/index.html"))&&i.existsSync(e.join(n,"engine-tenant/worker.js"))?n:null}function x(){let t=p();if(t)return t;let n=u();if(!n)return null;let o=l(n);return i.existsSync(e.join(o,"index.html"))?o:null}var a=".runtime.localhost";function H(t){let n=t.trim();if(!c(n))throw new Error(`invalid rnx runtime version: ${t}`);let r=Buffer.from(n,"utf8").toString("hex").match(/.{1,60}/g);if(!r)throw new Error(`invalid rnx runtime version: ${t}`);return`${r.join(".")}${a}`}function f(t){return t.toLowerCase().endsWith(a)}function h(t){if(!f(t))return null;let n=t.slice(0,-a.length).split(".");if(n.length===0||n.some(r=>!/^[0-9a-f]{1,60}$/i.test(r)))return null;let o=n.join("");if(o.length%2!==0)return null;try{let r=Buffer.from(o,"hex").toString("utf8");return c(r)?r:null}catch{return null}}function v(t){let n=l(t);return i.existsSync(e.join(n,"index.html"))?n:null}function T(t){if(!f(t))return x();let n=h(t);return n?v(n):null}export{R as a,p as b,H as c,f as d,h as e,T as f};
4
+ import{a as c}from"./chunk-YK6FDOG6.js";import{J as u,l}from"./chunk-CQIH7FPK.js";function m(t){return t.replace(/^\[|\]$/g,"").toLowerCase()}function R(t){let n=m(t);return n==="localhost"||n.endsWith(".localhost")||n==="0.0.0.0"||n==="::1"||/^127(?:\.\d{1,3}){3}$/.test(n)}import i from"fs";import e from"path";import{fileURLToPath as d}from"url";var s;function g(){if(s!==void 0)return s;let t=e.dirname(d(import.meta.url));for(let n=0;n<12&&t!==e.dirname(t);n++){if(i.existsSync(e.join(t,"packages/sootsim-engine/package.json"))&&i.existsSync(e.join(t,"public/sootsim")))return s=t,t;t=e.dirname(t)}return s=null,null}function p(){if(process.env.SOOTSIM_HOME&&u())return null;let t=g();if(!t)return null;let n=e.join(t,"public/sootsim");return i.existsSync(e.join(n,"index.html"))&&i.existsSync(e.join(n,"engine/index.html"))&&i.existsSync(e.join(n,"engine-tenant/worker.js"))?n:null}function x(){let t=p();if(t)return t;let n=u();if(!n)return null;let o=l(n);return i.existsSync(e.join(o,"index.html"))?o:null}var a=".runtime.localhost";function H(t){let n=t.trim();if(!c(n))throw new Error(`invalid rnx runtime version: ${t}`);let r=Buffer.from(n,"utf8").toString("hex").match(/.{1,60}/g);if(!r)throw new Error(`invalid rnx runtime version: ${t}`);return`${r.join(".")}${a}`}function f(t){return t.toLowerCase().endsWith(a)}function h(t){if(!f(t))return null;let n=t.slice(0,-a.length).split(".");if(n.length===0||n.some(r=>!/^[0-9a-f]{1,60}$/i.test(r)))return null;let o=n.join("");if(o.length%2!==0)return null;try{let r=Buffer.from(o,"hex").toString("utf8");return c(r)?r:null}catch{return null}}function v(t){let n=l(t);return i.existsSync(e.join(n,"index.html"))?n:null}function T(t){if(!f(t))return x();let n=h(t);return n?v(n):null}export{R as a,p as b,H as c,f as d,h as e,T as f};