sootsim 0.1.255 → 0.1.257

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 (142) hide show
  1. package/detox/index.ts +8 -5
  2. package/dist-cli/bin.js +4 -4
  3. package/dist-cli/chunks/{agent-YM4BLOQ6.js → agent-EKFF5KRY.js} +2 -2
  4. package/dist-cli/chunks/{agent-wrapper-YUJFSPMC.js → agent-wrapper-CWO2UQ2X.js} +2 -2
  5. package/dist-cli/chunks/{app-fonts-63AR2NRG.js → app-fonts-72AU4YT5.js} +2 -2
  6. package/dist-cli/chunks/{assert-FENBCL7R.js → assert-4V7NVOUH.js} +2 -2
  7. package/dist-cli/chunks/{auth-QBG4KUYZ.js → auth-J5RXIWOV.js} +2 -2
  8. package/dist-cli/chunks/beta-CX2AA6VB.js +2 -0
  9. package/dist-cli/chunks/{camera-J6HFIL5Y.js → camera-YHWQC73Q.js} +2 -2
  10. package/dist-cli/chunks/{chunk-UAHQ7NA7.js → chunk-2KEXW2KK.js} +1 -1
  11. package/dist-cli/chunks/{chunk-OE6CZ77H.js → chunk-3N2GSIED.js} +3 -3
  12. package/dist-cli/chunks/{chunk-VEWQYXMJ.js → chunk-43AYW32Q.js} +2 -2
  13. package/dist-cli/chunks/{chunk-VPZQRZ2K.js → chunk-4JLTG5ZD.js} +2 -2
  14. package/dist-cli/chunks/{chunk-RE7Z6UPI.js → chunk-4ZY4XJWQ.js} +2 -2
  15. package/dist-cli/chunks/{chunk-OHXE373Z.js → chunk-5OANRIBW.js} +1 -1
  16. package/dist-cli/chunks/{chunk-NSUPW33Y.js → chunk-7HAL4BSF.js} +2 -2
  17. package/dist-cli/chunks/{chunk-J55D2SPY.js → chunk-7IRIUNGE.js} +2 -2
  18. package/dist-cli/chunks/{chunk-6KR4PDMI.js → chunk-A5L6KNKI.js} +1 -1
  19. package/dist-cli/chunks/{chunk-LHUQBNYW.js → chunk-APFSE7TV.js} +2 -2
  20. package/dist-cli/chunks/{chunk-CR77YDXG.js → chunk-BRQYKLNB.js} +1 -1
  21. package/dist-cli/chunks/{chunk-JPMJZCW5.js → chunk-BSI6HZ4J.js} +2 -2
  22. package/dist-cli/chunks/chunk-C7KZCQS4.js +1 -0
  23. package/dist-cli/chunks/{chunk-RQLU3VUC.js → chunk-CPNFO75T.js} +2 -2
  24. package/dist-cli/chunks/{chunk-FH2RGEYP.js → chunk-DG4TWQYN.js} +1 -1
  25. package/dist-cli/chunks/{chunk-BKCWNVLF.js → chunk-DWNTHMG3.js} +1 -1
  26. package/dist-cli/chunks/{chunk-Z5XWEBC7.js → chunk-DXW5WPQZ.js} +2 -2
  27. package/dist-cli/chunks/{chunk-VXVEZCEE.js → chunk-F3UP2DYC.js} +3 -3
  28. package/dist-cli/chunks/{chunk-XUUXQEYY.js → chunk-FD45JT2L.js} +2 -2
  29. package/dist-cli/chunks/{chunk-HHU7U4MQ.js → chunk-GBA2TXF3.js} +2 -2
  30. package/dist-cli/chunks/{chunk-3IOH6UDC.js → chunk-HE35PVHT.js} +2 -2
  31. package/dist-cli/chunks/{chunk-RRQWSOST.js → chunk-ICMUCK5N.js} +2 -2
  32. package/dist-cli/chunks/{chunk-V5AYW37H.js → chunk-IUMB6FFJ.js} +1 -1
  33. package/dist-cli/chunks/{chunk-IBMRHDPR.js → chunk-J2KTAKIN.js} +1 -1
  34. package/dist-cli/chunks/{chunk-7Q6XJZHT.js → chunk-J3TMUNVD.js} +2 -2
  35. package/dist-cli/chunks/{chunk-F3ZWHWG3.js → chunk-JBLWPWDL.js} +2 -2
  36. package/dist-cli/chunks/{chunk-2DPBG2CK.js → chunk-JUXYDTBR.js} +2 -2
  37. package/dist-cli/chunks/{chunk-UV6TJOL2.js → chunk-L2UUNXDV.js} +1 -1
  38. package/dist-cli/chunks/{chunk-ZDFPB2CX.js → chunk-L7ERS6QK.js} +1 -1
  39. package/dist-cli/chunks/{chunk-B5HY2SAQ.js → chunk-LNED5MBV.js} +3 -3
  40. package/dist-cli/chunks/{chunk-WPGK7WAS.js → chunk-MEDHQ56Z.js} +2 -2
  41. package/dist-cli/chunks/{chunk-ZI6LNH6I.js → chunk-N26E5CXX.js} +1 -1
  42. package/dist-cli/chunks/{chunk-SHJLA2MU.js → chunk-OHRUE654.js} +2 -2
  43. package/dist-cli/chunks/{chunk-H4UDU5I3.js → chunk-QRBWBRDH.js} +3 -3
  44. package/dist-cli/chunks/{chunk-GVV3Z5BX.js → chunk-S7BZXJGM.js} +1 -1
  45. package/dist-cli/chunks/{chunk-WENY5XO6.js → chunk-TPGYHYD6.js} +1 -1
  46. package/dist-cli/chunks/{chunk-XW4PU4AY.js → chunk-UCWI2GG4.js} +1 -1
  47. package/dist-cli/chunks/{chunk-5ETARURC.js → chunk-VAIO2YWB.js} +2 -2
  48. package/dist-cli/chunks/{chunk-ATGGTD4F.js → chunk-VVHBMGLB.js} +1 -1
  49. package/dist-cli/chunks/{chunk-UU4H225J.js → chunk-VZAQKG5M.js} +1 -1
  50. package/dist-cli/chunks/chunk-XZUTK4LT.js +1 -0
  51. package/dist-cli/chunks/{chunk-2O56ZCFZ.js → chunk-Y32LUBR6.js} +1 -1
  52. package/dist-cli/chunks/{chunk-Z3Z6IY3M.js → chunk-YHSHHL45.js} +1 -1
  53. package/dist-cli/chunks/{chunk-3DX24677.js → chunk-YRYOZXHH.js} +2 -2
  54. package/dist-cli/chunks/cli-version-626F5PG3.js +2 -0
  55. package/dist-cli/chunks/{compat-MIB44IWZ.js → compat-VU5S6YN6.js} +3 -3
  56. package/dist-cli/chunks/{config-LKAE2GM4.js → config-SGGYNGBD.js} +2 -2
  57. package/dist-cli/chunks/{control-YV56YC6V.js → control-JWGYUJUD.js} +2 -2
  58. package/dist-cli/chunks/daemon-YAGY67PM.js +2 -0
  59. package/dist-cli/chunks/{debug-VEWEUOOM.js → debug-U3CYKYSI.js} +3 -3
  60. package/dist-cli/chunks/{desktop-E4TJPYKI.js → desktop-2OKQY5GB.js} +3 -3
  61. package/dist-cli/chunks/{detox-662UHXJG.js → detox-C4FEIZHT.js} +2 -2
  62. package/dist-cli/chunks/{device-XKEWVDXS.js → device-Z2USMO2I.js} +2 -2
  63. package/dist-cli/chunks/{diagnose-G42DEMRD.js → diagnose-62JXMVQ4.js} +2 -2
  64. package/dist-cli/chunks/drivers-LBBVC44R.js +2 -0
  65. package/dist-cli/chunks/{film-44MWBMM5.js → film-QSPDYWMS.js} +3 -3
  66. package/dist-cli/chunks/flow-UKQI6HNI.js +2 -0
  67. package/dist-cli/chunks/help-H323YTCX.js +2 -0
  68. package/dist-cli/chunks/{hidden-runtime-alias-HVZGEGYV.js → hidden-runtime-alias-CQFFZG76.js} +2 -2
  69. package/dist-cli/chunks/{home-paths-YDOFRTC4.js → home-paths-KLZ2FOYL.js} +2 -2
  70. package/dist-cli/chunks/inspect-HORZIVB2.js +2 -0
  71. package/dist-cli/chunks/install-desktop-Z2ABTOFB.js +2 -0
  72. package/dist-cli/chunks/{login-YUO6UVVR.js → login-PGQY6W2D.js} +4 -4
  73. package/dist-cli/chunks/{logout-HPDQV47R.js → logout-5KS7UKNU.js} +2 -2
  74. package/dist-cli/chunks/{maestro-JMCYNI5B.js → maestro-JRSGE642.js} +3 -3
  75. package/dist-cli/chunks/{maestro-generate-KLCYQMRJ.js → maestro-generate-ZSBSG3UB.js} +3 -3
  76. package/dist-cli/chunks/{mode-7BTPMN73.js → mode-YMDD6CIQ.js} +2 -2
  77. package/dist-cli/chunks/optional-demo-registry-LACUW5ED.js +2 -0
  78. package/dist-cli/chunks/{perf-B6Q6PEGM.js → perf-KNG2STGA.js} +2 -2
  79. package/dist-cli/chunks/{record-MUUN5XNT.js → record-COMKU5DY.js} +3 -3
  80. package/dist-cli/chunks/runtime-QOHRQKXF.js +2 -0
  81. package/dist-cli/chunks/{screenshot-command-AOFCXTSA.js → screenshot-command-OK3RCCGC.js} +3 -3
  82. package/dist-cli/chunks/{screenshots-capture-BONMILN5.js → screenshots-capture-I246YLW3.js} +2 -2
  83. package/dist-cli/chunks/{serve-GZHGO4IL.js → serve-3V3TRCLM.js} +2 -2
  84. package/dist-cli/chunks/{setup-AAEKPHD2.js → setup-KLZEZZGI.js} +3 -3
  85. package/dist-cli/chunks/{skills-N7QNKPK3.js → skills-ECMEDUPZ.js} +2 -2
  86. package/dist-cli/chunks/{storage-SJYNBHZ2.js → storage-YE2DYWXF.js} +2 -2
  87. package/dist-cli/chunks/store-2GO5PWM3.js +2 -0
  88. package/dist-cli/chunks/telemetry-YBRVEGW7.js +2 -0
  89. package/dist-cli/chunks/{timeline-5B6I7V4X.js → timeline-G6D6JGBN.js} +2 -2
  90. package/dist-cli/chunks/{upgrade-FGQTHT6F.js → upgrade-FYIV5IW4.js} +2 -2
  91. package/dist-cli/chunks/upload-LWBMLHPF.js +2 -0
  92. package/dist-cli/chunks/{version-26GHHDOZ.js → version-27JLNA32.js} +2 -2
  93. package/dist-cli/chunks/{web-FTONC5U3.js → web-XT5WUJ7Q.js} +2 -2
  94. package/dist-cli/chunks/{what-happened-KYVNA3OD.js → what-happened-N3BJEWDK.js} +2 -2
  95. package/dist-lib/agent-daemon-client.cjs +1 -1
  96. package/dist-lib/agent-events.cjs +1 -1
  97. package/dist-lib/agent-identity.cjs +1 -1
  98. package/dist-lib/agent-sessions.cjs +1 -1
  99. package/dist-lib/attached-projects.cjs +1 -1
  100. package/dist-lib/auth/shared-session.cjs +1 -1
  101. package/dist-lib/backend-origin.cjs +1 -1
  102. package/dist-lib/beta.cjs +1 -1
  103. package/dist-lib/beta.mjs +1 -1
  104. package/dist-lib/bridge-constants.cjs +1 -1
  105. package/dist-lib/cli-constants.cjs +1 -1
  106. package/dist-lib/config.cjs +1 -1
  107. package/dist-lib/detox/index.cjs +10 -7
  108. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  109. package/dist-lib/home-paths.cjs +1 -1
  110. package/dist-lib/host/bridge-host.cjs +1 -1
  111. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  112. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  113. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  114. package/dist-lib/host/websocket-proxy.cjs +1 -1
  115. package/dist-lib/index.cjs +1 -1
  116. package/dist-lib/jump-to-source-babel.cjs +1 -1
  117. package/dist-lib/menu.cjs +1 -1
  118. package/dist-lib/menu.mjs +1 -1
  119. package/dist-lib/metro.cjs +1 -1
  120. package/dist-lib/profiles.cjs +1 -1
  121. package/dist-lib/render-mode.cjs +1 -1
  122. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  123. package/dist-lib/sdk.cjs +1 -1
  124. package/dist-lib/sdk.mjs +1 -1
  125. package/dist-lib/skills.cjs +1 -1
  126. package/dist-lib/vite.cjs +1 -1
  127. package/package.json +1 -1
  128. package/dist-cli/chunks/beta-4MPIWKGP.js +0 -2
  129. package/dist-cli/chunks/chunk-3UXANNI7.js +0 -1
  130. package/dist-cli/chunks/chunk-5IMXH4QV.js +0 -1
  131. package/dist-cli/chunks/cli-version-ZU5BQZPV.js +0 -2
  132. package/dist-cli/chunks/daemon-FY3LNYST.js +0 -2
  133. package/dist-cli/chunks/drivers-F7WSZESK.js +0 -2
  134. package/dist-cli/chunks/flow-TUFXBQK2.js +0 -2
  135. package/dist-cli/chunks/help-46DY5U3A.js +0 -2
  136. package/dist-cli/chunks/inspect-YJ7XUJ6Y.js +0 -2
  137. package/dist-cli/chunks/install-desktop-S4IUWPB7.js +0 -2
  138. package/dist-cli/chunks/optional-demo-registry-T2MGOXQW.js +0 -2
  139. package/dist-cli/chunks/runtime-HXWRA4KS.js +0 -2
  140. package/dist-cli/chunks/store-XMV7KZ5E.js +0 -2
  141. package/dist-cli/chunks/telemetry-I4Q4O4PI.js +0 -2
  142. package/dist-cli/chunks/upload-GHSEBKXO.js +0 -2
package/detox/index.ts CHANGED
@@ -537,7 +537,9 @@ function ensureScreenshotDir() {
537
537
  function decodePngDataUrl(dataUrl: string): Buffer {
538
538
  const match = /^data:image\/png;base64,(.+)$/.exec(dataUrl)
539
539
  if (!match) {
540
- throw new Error('sootsim screenshot bridge returned a non-png payload')
540
+ throw new Error(
541
+ `sootsim screenshot bridge returned a non-png payload: ${JSON.stringify(dataUrl.slice(0, 120))}`,
542
+ )
541
543
  }
542
544
  return Buffer.from(match[1], 'base64')
543
545
  }
@@ -560,7 +562,7 @@ async function captureSootsimPngFast(opts?: {
560
562
  }
561
563
  return screenshot(captureOpts)
562
564
  },
563
- { crop: opts?.crop },
565
+ { crop: opts?.crop, format: 'png' },
564
566
  )
565
567
  if (!dataUrl) {
566
568
  throw new Error('sootsim screenshot bridge returned an empty image')
@@ -616,6 +618,7 @@ async function captureSootsimPng(opts?: {
616
618
  },
617
619
  {
618
620
  crop: opts?.crop,
621
+ format: 'png',
619
622
  },
620
623
  )
621
624
  if (!result.dataUrl) {
@@ -1387,7 +1390,7 @@ export const device = {
1387
1390
  // (a pump at higher cadence was tried and starved tap propagation —
1388
1391
  // the tenant React commit for setOpen never landed between
1389
1392
  // forceRender calls.)
1390
- await screenshot()
1393
+ await screenshot({ format: 'png' })
1391
1394
  const start = performance.now()
1392
1395
  type Snapshot = {
1393
1396
  label: string
@@ -1427,7 +1430,7 @@ export const device = {
1427
1430
  }
1428
1431
  }
1429
1432
  if (!dataUrl) {
1430
- dataUrl = await screenshot()
1433
+ dataUrl = await screenshot({ format: 'png' })
1431
1434
  }
1432
1435
  resolve({
1433
1436
  label: stage.label,
@@ -1524,7 +1527,7 @@ export const device = {
1524
1527
  const wait = Math.max(0, stage.offsetMs - elapsed)
1525
1528
  if (wait > 0) await new Promise((r) => setTimeout(r, wait))
1526
1529
  const actualMs = Date.now() - start
1527
- const dataUrl = await screenshot()
1530
+ const dataUrl = await screenshot({ format: 'png' })
1528
1531
  out.push({ label: stage.label, offsetMs: stage.offsetMs, actualMs, dataUrl })
1529
1532
  }
1530
1533
  return out
package/dist-cli/bin.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
- import{a as w,b as u}from"./chunks/chunk-6KR4PDMI.js";import"./chunks/chunk-GVV3Z5BX.js";function f(t){let a=t instanceof Error?t.message:String(t);(/^command timed out after \d+s$/.test(a)||a.startsWith("sim disconnected:")||a.startsWith("bridge never reconnected")||a.startsWith("no sim connected with id ")||a.startsWith("could not connect to ws://")||a.startsWith("sootsim bridge daemon is not running")||a.startsWith("sootsim bridge lockfile is fresh")||a.startsWith("sootsim bridge exited before becoming ready")||a.startsWith("background daemon setup is unavailable")||a.startsWith("sootsim bridge did not start within"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${a}
2
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
+ import{a as w,b as u}from"./chunks/chunk-A5L6KNKI.js";import"./chunks/chunk-S7BZXJGM.js";function f(t){let a=t instanceof Error?t.message:String(t);(/^command timed out after \d+s$/.test(a)||a.startsWith("sim disconnected:")||a.startsWith("bridge never reconnected")||a.startsWith("no sim connected with id ")||a.startsWith("could not connect to ws://")||a.startsWith("sootsim bridge daemon is not running")||a.startsWith("sootsim bridge lockfile is fresh")||a.startsWith("sootsim bridge exited before becoming ready")||a.startsWith("background daemon setup is unavailable")||a.startsWith("sootsim bridge did not start within"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${a}
4
4
  `),process.exit(1)),t instanceof Error&&t.stack?process.stderr.write(`${t.stack}
5
5
  `):process.stderr.write(`${a}
6
6
  `),process.exit(1)}process.on("unhandledRejection",f);process.on("uncaughtException",f);var h=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,A=new Set(["desktop"]);function k(t){!h||!A.has(t)||(process.stderr.write(` sootsim ${t} isn't available in the standalone binary \u2014
7
7
  it needs vite / electron / playwright from a project's node_modules.
8
8
  run the npm package instead:
9
9
  sootsim ${t}
10
- `),process.exit(1))}var e=u(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:t}=await import("./chunks/hidden-runtime-alias-HVZGEGYV.js");e=t(e)}{let{trackCliEvent:t}=await import("./chunks/telemetry-I4Q4O4PI.js");t({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:t}=await import("./chunks/home-paths-YDOFRTC4.js"),a=t();a&&process.stderr.write(` SootSim engine upgraded to v${a.to}`+(a.from?` (from v${a.from})`:"")+` \xB7 what's new: https://sootsim.com/changelog
11
- `)}async function c(t){let{flushCliTelemetry:a}=await import("./chunks/telemetry-I4Q4O4PI.js");await a(),process.exit(t)}if(e.version){let{getCliVersion:t}=await import("./chunks/cli-version-ZU5BQZPV.js"),{IS_BETA:a,BETA_LABEL:i}=await import("./chunks/beta-4MPIWKGP.js"),p=a?` \xB7 ${i}`:"";console.log(`sootsim v${t()}${p}`);let{readActiveRuntime:b}=await import("./chunks/home-paths-YDOFRTC4.js"),l=b();console.log(l?`runtime v${l}`:"runtime not installed"),await c(0)}if(e.help&&!e.command){let{printHelp:t}=await import("./chunks/help-46DY5U3A.js");t(),await c(0)}var o=e.globalFlags.port,r=e.verbose,m=e.globalFlags.device,d=e.globalFlags.theme,v=e.globalFlags.driver,_=e.globalFlags.headless===!0,g=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,n=g?["--sim",g,...e.commandArgs]:e.commandArgs;if(m||d){let{settingsStore:t}=await import("./chunks/store-XMV7KZ5E.js"),a={};m&&(a.deviceModel=m),d&&(a.colorScheme=d),t.apply(a)}if(!e.command&&e.commandArgs.length===0){let{runSetup:t,shouldRunSetupForBareCommand:a}=await import("./chunks/setup-AAEKPHD2.js");a()&&(await t(["--from-welcome"]),await c(0));let{printHelp:i}=await import("./chunks/help-46DY5U3A.js");i(),await c(0)}var s=e.command??"";if(!s){if(e.commandArgs.length>0){let a=e.commandArgs.find(i=>!i.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${a}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:t}=await import("./chunks/help-46DY5U3A.js");t(),await c(0)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(s==="skill"){let{runSkill:i}=await import("./chunks/skills-N7QNKPK3.js");await i(e.commandArgs),await c(0)}let t=s==="do"||s==="get"||s==="debug"||s==="shell"||s==="perf"||s==="wait",a=e.commandArgs.find(i=>!i.startsWith("-"));if(!(s==="shell"||s==="perf"))if(t&&!a){let{printGroupHelp:i}=await import("./chunks/help-46DY5U3A.js");i(s)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-46DY5U3A.js");i(t&&a?a:s,{prefer:t&&a?"verb":"command",group:t&&a?s:void 0}),await c(0)}}k(s);if(w.has(s)){let{runInspect:t}=await import("./chunks/inspect-YJ7XUJ6Y.js");await t([s,...n],{port:o,verbose:r})}else switch(s){case"assert":{let{runAssert:t}=await import("./chunks/assert-FENBCL7R.js");await t(e.commandArgs);break}case"detox":{let{runDetox:t}=await import("./chunks/detox-662UHXJG.js");await t(e.commandArgs,{port:o,verbose:r});break}case"maestro":{let{runMaestro:t}=await import("./chunks/maestro-JMCYNI5B.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"record":{let{runRecord:t}=await import("./chunks/record-MUUN5XNT.js");await t(n,{port:o,verbose:r});break}case"film":{let{runFilm:t}=await import("./chunks/film-44MWBMM5.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"storage":{let{runStorage:t}=await import("./chunks/storage-SJYNBHZ2.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"perf":{let{runPerf:t}=await import("./chunks/perf-B6Q6PEGM.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"screenshot":{let{runScreenshotCommand:t}=await import("./chunks/screenshot-command-AOFCXTSA.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"mode":{let{runMode:t}=await import("./chunks/mode-7BTPMN73.js");await t(n,{port:o,verbose:r});break}case"inspect":{let{runInspect:t}=await import("./chunks/inspect-YJ7XUJ6Y.js");await t(n,{port:o,verbose:r});break}case"debug":{let{runDebug:t}=await import("./chunks/debug-VEWEUOOM.js");await t(n,{port:o,verbose:r});break}case"timeline":{let{runTimeline:t}=await import("./chunks/timeline-5B6I7V4X.js");await t(n,{port:o,verbose:r});break}case"what-happened":{let{runWhatHappened:t}=await import("./chunks/what-happened-KYVNA3OD.js");await t(n,{port:o,verbose:r});break}case"open":{let{runOpenCommand:t}=await import("./chunks/control-YV56YC6V.js");await t(n,{port:o});break}case"use":{let{runUseCommand:t}=await import("./chunks/control-YV56YC6V.js");await t(n,{port:o});break}case"claim":{let{runClaimCommand:t}=await import("./chunks/control-YV56YC6V.js");await t(n,{port:o});break}case"close":{let{runCloseCommand:t}=await import("./chunks/control-YV56YC6V.js");await t(n,{port:o});break}case"device":{let{runDeviceCommand:t}=await import("./chunks/device-XKEWVDXS.js");await t(n,{port:o});break}case"compat":{let{runCompat:t}=await import("./chunks/compat-MIB44IWZ.js");await t(e.commandArgs);break}case"desktop":{let{runDesktop:t}=await import("./chunks/desktop-E4TJPYKI.js");await t(e.commandArgs,{port:o,device:m,driver:v});break}case"login":{let{runLogin:t}=await import("./chunks/login-YUO6UVVR.js");await t(e.commandArgs);break}case"logout":{let{runLogout:t}=await import("./chunks/logout-HPDQV47R.js");await t();break}case"auth":{let{runAuth:t}=await import("./chunks/auth-QBG4KUYZ.js");await t(e.commandArgs);break}case"setup":{let{runSetup:t}=await import("./chunks/setup-AAEKPHD2.js");await t(e.commandArgs);break}case"serve":{let{runServe:t}=await import("./chunks/serve-GZHGO4IL.js");await t(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:t}=await import("./chunks/daemon-FY3LNYST.js");await t(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:t}=await import("./chunks/runtime-HXWRA4KS.js");await t(e.commandArgs);break}case"upgrade":{let{runUpgrade:t}=await import("./chunks/upgrade-FGQTHT6F.js");await t(e.commandArgs);break}case"version":{let{runVersion:t}=await import("./chunks/version-26GHHDOZ.js");await t(e.commandArgs);break}case"agent":{let{runAgentCommand:t}=await import("./chunks/agent-YM4BLOQ6.js"),a=await t(e.commandArgs);process.exit(a)}case"agent-wrapper":{let{runAgentWrapper:t}=await import("./chunks/agent-wrapper-YUJFSPMC.js"),a=await t(e.commandArgs);process.exit(a)}case"skill":{let{runSkill:t}=await import("./chunks/skills-N7QNKPK3.js");await t(e.commandArgs);break}case"app-fonts":{let{runAppFonts:t}=await import("./chunks/app-fonts-63AR2NRG.js");await t(e.commandArgs);break}case"config":{let{runConfig:t}=await import("./chunks/config-LKAE2GM4.js");await t(e.commandArgs);break}default:console.error(` unknown command: ${s}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
10
+ `),process.exit(1))}var e=u(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:t}=await import("./chunks/hidden-runtime-alias-CQFFZG76.js");e=t(e)}{let{trackCliEvent:t}=await import("./chunks/telemetry-YBRVEGW7.js");t({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:t}=await import("./chunks/home-paths-KLZ2FOYL.js"),a=t();a&&process.stderr.write(` SootSim engine upgraded to v${a.to}`+(a.from?` (from v${a.from})`:"")+` \xB7 what's new: https://sootsim.com/changelog
11
+ `)}async function c(t){let{flushCliTelemetry:a}=await import("./chunks/telemetry-YBRVEGW7.js");await a(),process.exit(t)}if(e.version){let{getCliVersion:t}=await import("./chunks/cli-version-626F5PG3.js"),{IS_BETA:a,BETA_LABEL:i}=await import("./chunks/beta-CX2AA6VB.js"),p=a?` \xB7 ${i}`:"";console.log(`sootsim v${t()}${p}`);let{readActiveRuntime:b}=await import("./chunks/home-paths-KLZ2FOYL.js"),l=b();console.log(l?`runtime v${l}`:"runtime not installed"),await c(0)}if(e.help&&!e.command){let{printHelp:t}=await import("./chunks/help-H323YTCX.js");t(),await c(0)}var o=e.globalFlags.port,r=e.verbose,m=e.globalFlags.device,d=e.globalFlags.theme,v=e.globalFlags.driver,_=e.globalFlags.headless===!0,g=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,n=g?["--sim",g,...e.commandArgs]:e.commandArgs;if(m||d){let{settingsStore:t}=await import("./chunks/store-2GO5PWM3.js"),a={};m&&(a.deviceModel=m),d&&(a.colorScheme=d),t.apply(a)}if(!e.command&&e.commandArgs.length===0){let{runSetup:t,shouldRunSetupForBareCommand:a}=await import("./chunks/setup-KLZEZZGI.js");a()&&(await t(["--from-welcome"]),await c(0));let{printHelp:i}=await import("./chunks/help-H323YTCX.js");i(),await c(0)}var s=e.command??"";if(!s){if(e.commandArgs.length>0){let a=e.commandArgs.find(i=>!i.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${a}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:t}=await import("./chunks/help-H323YTCX.js");t(),await c(0)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(s==="skill"){let{runSkill:i}=await import("./chunks/skills-ECMEDUPZ.js");await i(e.commandArgs),await c(0)}let t=s==="do"||s==="get"||s==="debug"||s==="shell"||s==="perf"||s==="wait",a=e.commandArgs.find(i=>!i.startsWith("-"));if(!(s==="shell"||s==="perf"))if(t&&!a){let{printGroupHelp:i}=await import("./chunks/help-H323YTCX.js");i(s)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-H323YTCX.js");i(t&&a?a:s,{prefer:t&&a?"verb":"command",group:t&&a?s:void 0}),await c(0)}}k(s);if(w.has(s)){let{runInspect:t}=await import("./chunks/inspect-HORZIVB2.js");await t([s,...n],{port:o,verbose:r})}else switch(s){case"assert":{let{runAssert:t}=await import("./chunks/assert-4V7NVOUH.js");await t(e.commandArgs);break}case"detox":{let{runDetox:t}=await import("./chunks/detox-C4FEIZHT.js");await t(e.commandArgs,{port:o,verbose:r});break}case"maestro":{let{runMaestro:t}=await import("./chunks/maestro-JRSGE642.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"record":{let{runRecord:t}=await import("./chunks/record-COMKU5DY.js");await t(n,{port:o,verbose:r});break}case"film":{let{runFilm:t}=await import("./chunks/film-QSPDYWMS.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"storage":{let{runStorage:t}=await import("./chunks/storage-YE2DYWXF.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"perf":{let{runPerf:t}=await import("./chunks/perf-KNG2STGA.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"screenshot":{let{runScreenshotCommand:t}=await import("./chunks/screenshot-command-OK3RCCGC.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"mode":{let{runMode:t}=await import("./chunks/mode-YMDD6CIQ.js");await t(n,{port:o,verbose:r});break}case"inspect":{let{runInspect:t}=await import("./chunks/inspect-HORZIVB2.js");await t(n,{port:o,verbose:r});break}case"debug":{let{runDebug:t}=await import("./chunks/debug-U3CYKYSI.js");await t(n,{port:o,verbose:r});break}case"timeline":{let{runTimeline:t}=await import("./chunks/timeline-G6D6JGBN.js");await t(n,{port:o,verbose:r});break}case"what-happened":{let{runWhatHappened:t}=await import("./chunks/what-happened-N3BJEWDK.js");await t(n,{port:o,verbose:r});break}case"open":{let{runOpenCommand:t}=await import("./chunks/control-JWGYUJUD.js");await t(n,{port:o});break}case"use":{let{runUseCommand:t}=await import("./chunks/control-JWGYUJUD.js");await t(n,{port:o});break}case"claim":{let{runClaimCommand:t}=await import("./chunks/control-JWGYUJUD.js");await t(n,{port:o});break}case"close":{let{runCloseCommand:t}=await import("./chunks/control-JWGYUJUD.js");await t(n,{port:o});break}case"device":{let{runDeviceCommand:t}=await import("./chunks/device-Z2USMO2I.js");await t(n,{port:o});break}case"compat":{let{runCompat:t}=await import("./chunks/compat-VU5S6YN6.js");await t(e.commandArgs);break}case"desktop":{let{runDesktop:t}=await import("./chunks/desktop-2OKQY5GB.js");await t(e.commandArgs,{port:o,device:m,driver:v});break}case"login":{let{runLogin:t}=await import("./chunks/login-PGQY6W2D.js");await t(e.commandArgs);break}case"logout":{let{runLogout:t}=await import("./chunks/logout-5KS7UKNU.js");await t();break}case"auth":{let{runAuth:t}=await import("./chunks/auth-J5RXIWOV.js");await t(e.commandArgs);break}case"setup":{let{runSetup:t}=await import("./chunks/setup-KLZEZZGI.js");await t(e.commandArgs);break}case"serve":{let{runServe:t}=await import("./chunks/serve-3V3TRCLM.js");await t(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:t}=await import("./chunks/daemon-YAGY67PM.js");await t(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:t}=await import("./chunks/runtime-QOHRQKXF.js");await t(e.commandArgs);break}case"upgrade":{let{runUpgrade:t}=await import("./chunks/upgrade-FYIV5IW4.js");await t(e.commandArgs);break}case"version":{let{runVersion:t}=await import("./chunks/version-27JLNA32.js");await t(e.commandArgs);break}case"agent":{let{runAgentCommand:t}=await import("./chunks/agent-EKFF5KRY.js"),a=await t(e.commandArgs);process.exit(a)}case"agent-wrapper":{let{runAgentWrapper:t}=await import("./chunks/agent-wrapper-CWO2UQ2X.js"),a=await t(e.commandArgs);process.exit(a)}case"skill":{let{runSkill:t}=await import("./chunks/skills-ECMEDUPZ.js");await t(e.commandArgs);break}case"app-fonts":{let{runAppFonts:t}=await import("./chunks/app-fonts-72AU4YT5.js");await t(e.commandArgs);break}case"config":{let{runConfig:t}=await import("./chunks/config-SGGYNGBD.js");await t(e.commandArgs);break}default:console.error(` unknown command: ${s}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as b,b as E,c as A,d as l,e as S,g as j,h as T,j as I,m as k,n as D,o as x,p as g,q as O,r as C}from"./chunk-SHJLA2MU.js";import"./chunk-OHXE373Z.js";import{c as $}from"./chunk-RE7Z6UPI.js";import"./chunk-RQLU3VUC.js";import"./chunk-NSUPW33Y.js";import"./chunk-Z5XWEBC7.js";import"./chunk-V5AYW37H.js";import"./chunk-IBMRHDPR.js";import"./chunk-BKCWNVLF.js";import{j as y}from"./chunk-WENY5XO6.js";import"./chunk-CR77YDXG.js";import"./chunk-FH2RGEYP.js";import"./chunk-2O56ZCFZ.js";import"./chunk-GVV3Z5BX.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 sootsim 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 sootsim bridge on port ${e}. run \`sootsim setup\` to install the background daemon, or \`sootsim 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 sootsim daemon on port ${e} but it did not come up in time. run \`sootsim 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}
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as b,b as E,c as A,d as l,e as S,g as j,h as T,j as I,m as k,n as D,o as x,p as g,q as O,r as C}from"./chunk-OHRUE654.js";import"./chunk-5OANRIBW.js";import{c as $}from"./chunk-4ZY4XJWQ.js";import"./chunk-CPNFO75T.js";import"./chunk-7HAL4BSF.js";import"./chunk-DXW5WPQZ.js";import"./chunk-IUMB6FFJ.js";import"./chunk-J2KTAKIN.js";import"./chunk-DWNTHMG3.js";import{j as y}from"./chunk-TPGYHYD6.js";import"./chunk-BRQYKLNB.js";import"./chunk-DG4TWQYN.js";import"./chunk-Y32LUBR6.js";import"./chunk-S7BZXJGM.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 sootsim 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 sootsim bridge on port ${e}. run \`sootsim setup\` to install the background daemon, or \`sootsim 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 sootsim daemon on port ${e} but it did not come up in time. run \`sootsim 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}
3
3
  `),L(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
4
4
  `),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: sootsim agent attach <dir> [--name X] [--provider codex|claude]
5
5
  `),2;let s=d.resolve(r);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as M}from"./chunk-OHXE373Z.js";import"./chunk-GVV3Z5BX.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 I,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,g=!1,a=new Promise(s=>{t.on("exit",(i,e)=>{g=!0;let p=new Error(`codex app-server exited (code=${i}, signal=${e??""})`);for(let{reject:f}of r.values())f(p);r.clear(),s({code:i,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let i=s.trim();if(!i)return;let e;try{e=JSON.parse(i)}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,f=p!=null?r.get(p):void 0;if(!f)return;r.delete(p),e.error?f.reject(new b(e.error.message,e.error.code,e.error.data)):f.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let f of p)try{f(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 i=m.get("__stderr__");if(i)for(let e of i)try{e({text:s})}catch{}});function n(s){if(!g)try{t.stdin.write(JSON.stringify(s)+`
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as M}from"./chunk-5OANRIBW.js";import"./chunk-S7BZXJGM.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 I,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,g=!1,a=new Promise(s=>{t.on("exit",(i,e)=>{g=!0;let p=new Error(`codex app-server exited (code=${i}, signal=${e??""})`);for(let{reject:f}of r.values())f(p);r.clear(),s({code:i,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let i=s.trim();if(!i)return;let e;try{e=JSON.parse(i)}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,f=p!=null?r.get(p):void 0;if(!f)return;r.delete(p),e.error?f.reject(new b(e.error.message,e.error.code,e.error.data)):f.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let f of p)try{f(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 i=m.get("__stderr__");if(i)for(let e of i)try{e({text:s})}catch{}});function n(s){if(!g)try{t.stdin.write(JSON.stringify(s)+`
3
3
  `)}catch{}}return{exited:a,on(s,i){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(i),()=>{e?.delete(i)}},request(s,i){if(g)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,f)=>{r.set(e,{resolve:l=>p(l),reject:f,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:i})})},notify(s,i){n({jsonrpc:"2.0",method:s,params:i})},async shutdown(s=1500){if(g)return;try{t.stdin.end()}catch{}let i=setTimeout(()=>{if(!g)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(i)}},kill(s="SIGTERM"){if(!g)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 I(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 g=t[u];g&&(r[g]=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: sootsim agent-wrapper --session-id <id> --project-id <id>
4
4
  --provider codex|claude --cwd <path>
5
5
  --prompt-in <fifo> --events-out <fifo>
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as p}from"./chunk-ZDFPB2CX.js";import"./chunk-GVV3Z5BX.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 S(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),i=f(t,"manifest");if((!o||!i)&&(console.error(" usage: sootsim 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 S(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as p}from"./chunk-L7ERS6QK.js";import"./chunk-S7BZXJGM.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 S(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),i=f(t,"manifest");if((!o||!i)&&(console.error(" usage: sootsim 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 S(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-GVV3Z5BX.js";import{spawn as x}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=x(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(`
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-S7BZXJGM.js";import{spawn as x}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=x(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(`
3
3
  `).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=x("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}
4
4
  `),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(" ")}
5
5
  supported: ${Array.from(w).sort().join(", ")}
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as t}from"./chunk-5ETARURC.js";import{d as s}from"./chunk-3IOH6UDC.js";import"./chunk-WENY5XO6.js";import"./chunk-GVV3Z5BX.js";function i(){console.log(`
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as t}from"./chunk-VAIO2YWB.js";import{d as s}from"./chunk-HE35PVHT.js";import"./chunk-TPGYHYD6.js";import"./chunk-S7BZXJGM.js";function i(){console.log(`
3
3
  sootsim auth \u2014 inspect CLI auth
4
4
 
5
5
  usage:
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d}from"./chunk-DG4TWQYN.js";import"./chunk-S7BZXJGM.js";export{d as BETA_ASK_HEADLINE,b as BETA_LABEL,c as BETA_TAGLINE,a as IS_BETA};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{m as d}from"./chunk-2DPBG2CK.js";import"./chunk-Z3Z6IY3M.js";import{g as l,i as m,k as p}from"./chunk-F3ZWHWG3.js";import"./chunk-V5AYW37H.js";import"./chunk-IBMRHDPR.js";import"./chunk-WENY5XO6.js";import"./chunk-GVV3Z5BX.js";function f(){console.log(`
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{m as d}from"./chunk-JUXYDTBR.js";import"./chunk-YHSHHL45.js";import{g as l,i as m,k as p}from"./chunk-JBLWPWDL.js";import"./chunk-IUMB6FFJ.js";import"./chunk-J2KTAKIN.js";import"./chunk-TPGYHYD6.js";import"./chunk-S7BZXJGM.js";function f(){console.log(`
3
3
  sootsim do scan \u2014 inject a barcode scan
4
4
 
5
5
  usage:
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{execFileSync as b,execSync as A}from"node:child_process";var p=new WeakMap,u=new Set,y=!1;function d(){return{platform:process.platform,env:process.env}}function g(e=d()){return e.platform==="linux"&&e.env.GITHUB_ACTIONS==="true"&&e.env.RUNNER_OS==="Linux"}function I(e){let r=String(e);return/^--disable-gpu(?:=.*)?$/i.test(r)||/^--enable-unsafe-swiftshader(?:=.*)?$/i.test(r)||/^--use-angle=(?:swiftshader|swiftshader-webgl)$/i.test(r)||/^--use-gl=swiftshader$/i.test(r)}function E(e){return e.match(/(?:^|\s)(--disable-gpu(?:=[^\s]+)?|--enable-unsafe-swiftshader(?:=[^\s]+)?|--use-angle=(?:swiftshader|swiftshader-webgl)|--use-gl=swiftshader)(?=\s|$)/i)?.[1]??null}function C(e){return e==="darwin"?"metal":e==="linux"?"vulkan":"default"}function P(e,r=d()){if(g(r))return;let n=E(e);if(n)throw new Error(`[reap-browser] refused software-rendering Chrome process argument ${n}`);let o=C(r.platform),s=e.split(/\s+/);if(!s.includes(`--use-angle=${o}`)||!s.includes("--enable-gpu"))throw new Error(`[reap-browser] Chrome process did not retain the required ${o} GPU arguments`);if(r.platform==="darwin"&&e.includes("/Applications/Google Chrome.app/"))throw new Error("[reap-browser] refused the user's installed Google Chrome; use Playwright channel chromium")}function G(e){if(!e||typeof e!="object")return[];let n=e.gpu;if(!n||typeof n!="object")return[];let o=n,s=[],a=o.auxAttributes;if(a&&typeof a=="object")for(let t of Object.values(a))typeof t=="string"&&s.push(t);let i=o.devices;if(Array.isArray(i)){for(let t of i)if(!(!t||typeof t!="object"))for(let c of Object.values(t))typeof c=="string"&&s.push(c)}return s}function S(e){if(!e||typeof e!="object")return null;let r=e;if(!Array.isArray(r.processInfo))return null;for(let n of r.processInfo){if(!n||typeof n!="object")continue;let o=n;if(o.type==="browser"&&typeof o.id=="number"&&Number.isInteger(o.id)&&o.id>0)return o.id}return null}function L(e,r=d()){if(g(r))return;let o=G(e).join(" | ");if(!o||/swiftshader|llvmpipe|software rasterizer/i.test(o))throw new Error(`[reap-browser] Chrome reported a software renderer${o?`: ${o}`:""}`);if(r.platform==="darwin"&&!/metal/i.test(o))throw new Error(`[reap-browser] Chrome did not report an ANGLE Metal renderer: ${o}`)}function w(e){if(e&&typeof e=="object"){let n=p.get(e);if(n!==void 0)return n}let r=e;if(r&&typeof r.process=="function")try{let n=r.process();if(n&&typeof n.pid=="number"&&n.pid>0)return n.pid}catch{}if(r&&typeof r.browser=="function")try{let n=r.browser();if(n)return w(n)}catch{}return null}function h(e){let r=[];try{r=A(`pgrep -P ${e} || true`).toString().split(`
3
3
  `).filter(Boolean)}catch{}for(let n of r)h(Number(n));try{process.kill(e,"SIGKILL")}catch{}}function f(e){let r=e;if(!r||typeof r!="object")return null;if(typeof r.newBrowserCDPSession=="function"||typeof r.process=="function")return r;if(typeof r.browser!="function")return null;try{let n=r.browser();return n?f(n):null}catch{return null}}function m(e,r,n){e&&typeof e=="object"&&p.set(e,n),p.set(r,n),u.add(n),B()}async function N(e){let r=w(e);if(r!==null)return r;let n=f(e);if(!n||typeof n.newBrowserCDPSession!="function")return null;let o=await n.newBrowserCDPSession();try{let s=S(await o.send("SystemInfo.getProcessInfo"));return s===null?null:(m(e,n,s),s)}finally{await o.detach?.()}}async function j(e){let r=w(e);if(r!==null){u.delete(r),h(r);return}let n=e;if(n&&typeof n.close=="function")try{await n.close()}catch{}}async function T(e,r,n){if(g(r))return;let o=w(e),s=f(e);if(o!==null&&s&&m(e,s,o),o!==null&&(r.platform==="darwin"||r.platform==="linux")){let t=b("ps",["-p",String(o),"-o","command="],{encoding:"utf8"}).trim();P(t,r)}let a=n?await n(e):e,i=f(a);if(i&&typeof i.newBrowserCDPSession=="function"){let t=await i.newBrowserCDPSession();try{let c=S(await t.send("SystemInfo.getProcessInfo"));if(c===null)throw new Error("[reap-browser] Chrome did not report its browser process id");if(m(e,i,c),a&&typeof a=="object"&&p.set(a,c),r.platform==="darwin"||r.platform==="linux"){let l=b("ps",["-p",String(c),"-o","command="],{encoding:"utf8"}).trim();P(l,r)}L(await t.send("SystemInfo.getInfo"),r);return}finally{await t.detach?.()}}throw new Error("[reap-browser] could not validate the launched Chrome GPU renderer")}function B(){if(y)return;y=!0;let e=()=>{for(let r of u)h(r)};process.on("SIGTERM",()=>{e(),process.exit(0)}),process.on("SIGINT",()=>{e(),process.exit(0)}),process.on("exit",e)}async function R(e){let r=await e(),n=w(r);if(n===null)try{n=await N(r)}catch{n=null}let o=new Set;n!=null&&(o.add(n),u.add(n),B());let s=f(r)??r;if(typeof s.on=="function"){let i=typeof s.newBrowserCDPSession=="function"?"disconnected":"close";s.on(i,()=>{for(let t of o)u.delete(t)})}return{browser:r,reapNow:()=>{for(let i of o)h(i),u.delete(i);o.clear()}}}async function $(e){let{browser:r}=await R(e);return r}var k=!1;function D(e=process.platform){return[`--use-angle=${C(e)}`,"--enable-gpu","--enable-gpu-rasterization","--enable-zero-copy","--ignore-gpu-blocklist"]}function W(e={},r=d()){let n=Array.isArray(e.args)?e.args:[],o=n.find(I);if(o!==void 0)throw new Error(`[reap-browser] refused software-rendering Chrome launch argument ${String(o)}`);if(e.executablePath!==void 0)throw new Error("[reap-browser] executablePath bypasses Playwright Chrome for Testing and is not allowed");if(e.ignoreDefaultArgs===!0)throw new Error("[reap-browser] ignoreDefaultArgs=true bypasses required Chrome launch defaults");let s=new Set(["--enable-gpu","--enable-gpu-rasterization","--enable-zero-copy","--ignore-gpu-blocklist"]),a=n.filter(c=>{let l=String(c);return!s.has(l)&&!l.startsWith("--use-angle=")}),i=Array.isArray(e.ignoreDefaultArgs)?e.ignoreDefaultArgs:[],t=[...new Set([...i,"--disable-gpu","--enable-unsafe-swiftshader"])];return{...e,channel:"chromium",args:[...a,...D(r.platform)],ignoreDefaultArgs:t}}function x(e,r,n){return async()=>{let o=d(),s=g(o),a=W(r,o);if(!k){let i;try{i=await e(a)}catch(t){let c=t instanceof Error?t.message:String(t);if(!/not found at|not installed|Chromium distribution|Executable doesn't exist|No such file/i.test(c))throw t;if(!s)throw new Error("[reap-browser] Playwright Chrome for Testing is required for local GPU browser work; chromium_headless_shell fallback is disabled. Run `bunx playwright install chromium`.",{cause:t});return k=!0,console.warn("[reap-browser] GitHub Actions Linux Chrome for Testing not found, falling back to chromium_headless_shell software rendering."),e(v(r))}try{await T(i,o,n)}catch(t){throw await j(i),t}return i}return e(v(r))}}function v(e){let r={...e};return delete r.channel,delete r.executablePath,r}async function _(e,r={},n){return $(x(e,r,n))}async function z(e,r={},n){return R(x(e,r,n))}export{_ as a,z as b};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as ce}from"./chunk-7Q6XJZHT.js";import{b as Pt,c as Rt,k as At}from"./chunk-VPZQRZ2K.js";import{a as oe,b as A,c as D,d as Ie,e as ie,f as X,g as ue,h as ye,i as Ft,j as Ot,k as Te,l as Et}from"./chunk-2DPBG2CK.js";import{A as $t,B as xt,E as St,G as vt,I as de,J as kt,P as Le,a as ke,b as rt,c as it,d as at,e as lt,f as ct,g as dt,h as ut,i as pt,j as mt,k as Be,l as Ce,q as je,r as ft,s as gt,t as fe,u as yt,v as _e,w as qe,x as ht,y as bt,z as wt}from"./chunk-Z3Z6IY3M.js";import{e as _t,g as It,i as Tt,j as Mt,k as Nt,l as ge}from"./chunk-F3ZWHWG3.js";import{a as ot}from"./chunk-6KR4PDMI.js";import{a as Q}from"./chunk-NSUPW33Y.js";import{c as st}from"./chunk-V5AYW37H.js";import{c as nt}from"./chunk-IBMRHDPR.js";import{c as Ae,e as De}from"./chunk-BKCWNVLF.js";function We(e){return`(async () => {
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as ce}from"./chunk-J3TMUNVD.js";import{b as Pt,c as Rt,k as At}from"./chunk-4JLTG5ZD.js";import{a as oe,b as A,c as D,d as Ie,e as ie,f as X,g as ue,h as ye,i as Ft,j as Ot,k as Te,l as Et}from"./chunk-JUXYDTBR.js";import{A as $t,B as xt,E as St,G as vt,I as de,J as kt,P as Le,a as ke,b as rt,c as it,d as at,e as lt,f as ct,g as dt,h as ut,i as pt,j as mt,k as Be,l as Ce,q as je,r as ft,s as gt,t as fe,u as yt,v as _e,w as qe,x as ht,y as bt,z as wt}from"./chunk-YHSHHL45.js";import{e as _t,g as It,i as Tt,j as Mt,k as Nt,l as ge}from"./chunk-JBLWPWDL.js";import{a as ot}from"./chunk-A5L6KNKI.js";import{a as Q}from"./chunk-7HAL4BSF.js";import{c as st}from"./chunk-IUMB6FFJ.js";import{c as nt}from"./chunk-J2KTAKIN.js";import{c as Ae,e as De}from"./chunk-DWNTHMG3.js";function We(e){return`(async () => {
3
3
  const bridge = globalThis.SootSim && globalThis.SootSim.bridges && globalThis.SootSim.bridges.hotRemount
4
4
  if (!bridge || typeof bridge.reloadExternalApp !== 'function') return false
5
5
  await bridge.reloadExternalApp({ resetStorage: ${e?"true":"false"} })
@@ -588,7 +588,7 @@ import{a as ce}from"./chunk-7Q6XJZHT.js";import{b as Pt,c as Rt,k as At}from"./c
588
588
  `);console.log(`${o??""}
589
589
 
590
590
  ${n}
591
- `),process.exit(0)}let N=u.wsPort,M=u.simId,j=u.simIdSource,O=u.commandTimeoutMs;if(f==="get"&&m==="diagnosis"){let $=i.indexOf("diagnosis"),o=$>=0?[...i.slice(0,$),...i.slice($+1)]:i,{runDiagnose:n}=await import("./diagnose-G42DEMRD.js"),r=await n(["recent",...o],t);process.exitCode=r;return}if(f==="do"&&m==="scan"){let{runCamera:$}=await import("./camera-J6HFIL5Y.js");await $(i,{port:t.port});return}if(m==="list"&&i.some($=>$==="--drivers"||$==="-D")){let{buildDriverListRows:$}=await import("./drivers-F7WSZESK.js"),o=$();console.log(` available drivers (${o.length}):
591
+ `),process.exit(0)}let N=u.wsPort,M=u.simId,j=u.simIdSource,O=u.commandTimeoutMs;if(f==="get"&&m==="diagnosis"){let $=i.indexOf("diagnosis"),o=$>=0?[...i.slice(0,$),...i.slice($+1)]:i,{runDiagnose:n}=await import("./diagnose-62JXMVQ4.js"),r=await n(["recent",...o],t);process.exitCode=r;return}if(f==="do"&&m==="scan"){let{runCamera:$}=await import("./camera-YHWQC73Q.js");await $(i,{port:t.port});return}if(m==="list"&&i.some($=>$==="--drivers"||$==="-D")){let{buildDriverListRows:$}=await import("./drivers-LBBVC44R.js"),o=$();console.log(` available drivers (${o.length}):
592
592
  `);let n=Math.max(...o.map(a=>a.id.length),6),r=Math.max(...o.map(a=>a.kind.length),4);for(let a of o){let d=a.available?"\u2713":"\u2717",p=a.id.padEnd(n),g=a.kind.padEnd(r);console.log(` ${d} ${p} ${g} ${a.description}`),a.available&&a.detail?console.log(` ${a.detail}`):!a.available&&a.reason&&console.log(` unavailable: ${a.reason}`)}return}let c=Tt(u),q=M||"default",R=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","storage-clear","list","wait","sleep"]),P=200;function K($){let o=$.replace(/\s+/g," ").trim();if(!o)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(o)){let r=/<title[^>]*>([^<]+)<\/title>/i.exec($)?.[1]?.trim(),a=/<body[^>]*>([\s\S]*?)<\//i.exec($)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),d=r||a||"html error page";return`<html ${$.length}B> "${d}" (body elided \u2014 add --json for the full payload)`}return o.length<=P?o:`${o.slice(0,P)}\u2026 (+${o.length-P} more bytes)`}function U($){let o=$.displayUrl||$.url;return $.status!=null?`${$.method} ${o} -> ${$.status}${$.statusText?` ${$.statusText}`:""}`:$.error?`${$.method} ${o} -> ${$.error}`:`${$.method} ${o}`}async function _($){let o=me()?400:200;try{let{settled:n,elapsed:r}=await se({bridge:$,maxMs:o,pollMs:32,stablePolls:2});n||process.stderr.write(` \u26A0 auto-wait timed out after ${r??o}ms \u2014 next command may see mid-animation state. use \`sootsim do settle\` for a longer wait.
593
593
  `)}catch{}}function F($,o){if(o.result?.reason==="offscreen"){let{x:n,y:r,screen:a}=o.result;console.error(` tap failed: ${$} resolved to (${Math.round(n)},${Math.round(r)}), outside the ${a?.width}x${a?.height} screen`),console.error(" the node exists but is scrolled out of view \u2014 scroll it on-screen first (sootsim do scroll / swipe), then tap.");return}console.error(` tap failed: ${$} stayed visible but did not receive a hittable press after ${o.attempts} attempt${o.attempts===1?"":"s"}`),o.result&&console.error(` last result: ${JSON.stringify(o.result)}`)}async function J(){try{return await c.send({type:"evaluate",code:`(() => ({
594
594
  console: ${_e},
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{h as b,j as f,k,l as w}from"./chunk-2O56ZCFZ.js";var y="sootsim:settings",g=["errorReporting","colorScheme","reduceMotion","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","alwaysShowLiveWebViews","agentProvider","onboardingComplete","betaConsentVersion","detailedTelemetry"];function m(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function u(e){let n={};for(let t of g){if(!(t in e))continue;let i=e[t],o=f[t];o.validate&&!o.validate(i)||o.options&&!o.options.includes(i)||(n[t]=i)}return n}function V(e){let n={};for(let t of g)n[t]=e[t];return n}function D(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(y);return e?u(JSON.parse(e)):{}}catch{return{}}}function j(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(y,JSON.stringify(e))}catch{}}function x(){let n=m()?.sharedConfig?.settings;return!n||typeof n!="object"?{}:u(n)}function M(e){let n=m();if(n?.writeSharedConfig)try{n.writeSharedConfig({settings:e})}catch{}}function C(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function T(){let e=C()?.settings;return!e||typeof e!="object"?{}:u(e)}function I(e){if(!C())return;let n={settings:e};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(n))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}catch{}}function K(){let e=D(),n=T(),t=x();return{...e,...n,...t}}function P(e,n={}){let t=V(e);for(let i of g)n[i]!==void 0&&(t[i]=n[i]);j(t),M(t),I(t)}function _(e){if(typeof window>"u")return()=>{};let n=r=>{if(!(r.key!==y||r.newValue==null))try{e(u(JSON.parse(r.newValue)))}catch{}};window.addEventListener("storage",n);let t=m(),i;t?.onSharedConfigChanged&&(i=t.onSharedConfigChanged(r=>{let d=r?.settings;!d||typeof d!="object"||e(u(d))}));let c=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(r=>{let d=r?.settings;!d||typeof d!="object"||e(u(d))});return()=>{window.removeEventListener("storage",n),i?.(),c?.()}}var B=k(),L=w(),S=K(),l=new Set,h={};for(let e of g)B[e]!==void 0&&(l.add(e),S[e]!==void 0&&(h[e]=S[e]),delete S[e]);var s={...L,...S},p=[],a=null;function v(){for(let e of p)e()}function R(){v(),P(s,h)}function E(e,n){let t=f[e];return t.validate&&!t.validate(n)||t.options&&!t.options.includes(n)||s[e]===n?!1:(s={...s,[e]:n},e==="deviceModel"&&(a=null),!0)}_(e=>{let n={...s},t=!1;for(let[i,o]of Object.entries(e)){let c=i;if(l.has(c)){h[c]=o;continue}n[c]!==o&&(n[c]=o,t=!0)}t&&(s=n,a=null,v())});var N={get(e){return s[e]},set(e,n){E(e,n)&&R()},setRuntime(e,n){l.has(e)||(l.add(e),g.includes(e)&&(h[e]=s[e])),E(e,n)&&v()},isRuntimeControlled(e){return l.has(e)},getAll(){return s},apply(e){let n=!1,t={...s};for(let[i,o]of Object.entries(e)){if(o===void 0)continue;let c=i,r=f[c];r&&(r.validate&&!r.validate(o)||r.options&&!r.options.includes(o)||t[c]!==o&&(t[c]=o,n=!0))}n&&(s=t,a=null,R())},reset(){s=w(),a=null,R()},subscribe(e){return p.push(e),()=>{p=p.filter(n=>n!==e)}},getDeviceSpec(){return a||(a=b(s.deviceModel)),a},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{N as a};
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{h as b,j as f,k,l as w}from"./chunk-Y32LUBR6.js";var y="sootsim:settings",g=["errorReporting","colorScheme","reduceMotion","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","alwaysShowLiveWebViews","agentProvider","onboardingComplete","betaConsentVersion","detailedTelemetry"];function m(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function u(e){let n={};for(let t of g){if(!(t in e))continue;let i=e[t],o=f[t];o.validate&&!o.validate(i)||o.options&&!o.options.includes(i)||(n[t]=i)}return n}function V(e){let n={};for(let t of g)n[t]=e[t];return n}function D(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(y);return e?u(JSON.parse(e)):{}}catch{return{}}}function j(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(y,JSON.stringify(e))}catch{}}function x(){let n=m()?.sharedConfig?.settings;return!n||typeof n!="object"?{}:u(n)}function M(e){let n=m();if(n?.writeSharedConfig)try{n.writeSharedConfig({settings:e})}catch{}}function C(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function T(){let e=C()?.settings;return!e||typeof e!="object"?{}:u(e)}function I(e){if(!C())return;let n={settings:e};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(n))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}catch{}}function K(){let e=D(),n=T(),t=x();return{...e,...n,...t}}function P(e,n={}){let t=V(e);for(let i of g)n[i]!==void 0&&(t[i]=n[i]);j(t),M(t),I(t)}function _(e){if(typeof window>"u")return()=>{};let n=r=>{if(!(r.key!==y||r.newValue==null))try{e(u(JSON.parse(r.newValue)))}catch{}};window.addEventListener("storage",n);let t=m(),i;t?.onSharedConfigChanged&&(i=t.onSharedConfigChanged(r=>{let d=r?.settings;!d||typeof d!="object"||e(u(d))}));let c=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(r=>{let d=r?.settings;!d||typeof d!="object"||e(u(d))});return()=>{window.removeEventListener("storage",n),i?.(),c?.()}}var B=k(),L=w(),S=K(),l=new Set,h={};for(let e of g)B[e]!==void 0&&(l.add(e),S[e]!==void 0&&(h[e]=S[e]),delete S[e]);var s={...L,...S},p=[],a=null;function v(){for(let e of p)e()}function R(){v(),P(s,h)}function E(e,n){let t=f[e];return t.validate&&!t.validate(n)||t.options&&!t.options.includes(n)||s[e]===n?!1:(s={...s,[e]:n},e==="deviceModel"&&(a=null),!0)}_(e=>{let n={...s},t=!1;for(let[i,o]of Object.entries(e)){let c=i;if(l.has(c)){h[c]=o;continue}n[c]!==o&&(n[c]=o,t=!0)}t&&(s=n,a=null,v())});var N={get(e){return s[e]},set(e,n){E(e,n)&&R()},setRuntime(e,n){l.has(e)||(l.add(e),g.includes(e)&&(h[e]=s[e])),E(e,n)&&v()},isRuntimeControlled(e){return l.has(e)},getAll(){return s},apply(e){let n=!1,t={...s};for(let[i,o]of Object.entries(e)){if(o===void 0)continue;let c=i,r=f[c];r&&(r.validate&&!r.validate(o)||r.options&&!r.options.includes(o)||t[c]!==o&&(t[c]=o,n=!0))}n&&(s=t,a=null,R())},reset(){s=w(),a=null,R()},subscribe(e){return p.push(e),()=>{p=p.filter(n=>n!==e)}},getDeviceSpec(){return a||(a=b(s.deviceModel)),a},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{N as a};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as K,b as ne,c as re,d as xe,e as ke,g as P,h as Pe}from"./chunk-J55D2SPY.js";import{b as Ie,l as ce}from"./chunk-WPGK7WAS.js";import{a as O,b as ae}from"./chunk-ZI6LNH6I.js";import{a as Me,b as Te}from"./chunk-UU4H225J.js";import{a as Ce,b as se,c as Ee}from"./chunk-ZDFPB2CX.js";import{d as le}from"./chunk-UV6TJOL2.js";import{m as R}from"./chunk-2DPBG2CK.js";import{m as _e,o as Ue}from"./chunk-Z3Z6IY3M.js";import{a as Re,b as Oe,c as ie,e as Be,f as De,g as E,h as v,i as M}from"./chunk-F3ZWHWG3.js";import{e as _,f as b,g as U}from"./chunk-IBMRHDPR.js";import{H as Se,K as te,M as j,l as ve}from"./chunk-WENY5XO6.js";import{g as oe,i as $e}from"./chunk-2O56ZCFZ.js";import{spawn as je,spawnSync as Ke}from"node:child_process";import L from"node:fs";import ut from"node:os";import T from"node:path";import{WebSocket as pt}from"ws";function Le(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function st(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function Ne(e,o,t){return`${e}//${o}:${t}`}function it(e){if(typeof window>"u")return!1;try{let o=new URL(e);return P(o.hostname)&&P(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function Ae(e,o){let t={...o,cache:o?.cache??"no-store"};return it(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function at(e){return e==="https:"?443:80}function lt(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function ct(e){try{let o=await fetch("/__server-scan",{cache:"no-store"});if(!o.ok||!(o.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await o.json();if(!Array.isArray(t))return null;let n=t.find(r=>!!r&&typeof r=="object"&&r.port===e&&typeof r.bundleUrl=="string");return n?{bundleUrl:re(n.bundleUrl),port:e,framework:typeof n.framework=="string"?n.framework:"unknown",projectName:typeof n.projectName=="string"?n.projectName:void 0}:null}catch{return null}}async function Fe(e,o){let t=e.replace(/\/+$/,"");try{if(P(new URL(t).hostname)){let n=await ct(o);if(n)return n}}catch{}try{let n=await Ae(`${t}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},i=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(i||s.name)return{bundleUrl:re(i||`${t}${ne}`),port:o,framework:st(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await Ae(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${ne}`,port:o,framework:"metro"}}catch{}return null}async function dt(e){return Fe(Ne("http:","localhost",e),e)}async function He(e){let o=e.trim();if(/^\d+$/.test(o)){let a=parseInt(o,10),l=await dt(a);if(l)return l;throw Le(`localhost:${a}`)}let t=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(t)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let r=n.protocol||"http:",s=n.port?parseInt(n.port,10):at(r),i=Ne(r,n.hostname,s);if(lt(n)){let a=await Fe(i,s);if(a)return a;throw Le(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function io(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim desktop install"),console.error(""),console.error(" or run setup to install the background daemon:"),console.error(" sootsim setup"),console.error("")}function We(e){let o=O();if(console.log(` note: no sootsim bridge detected on port ${e}`),o){console.log(" launch the installed companion with:"),console.log(" sootsim desktop");return}console.log(""),console.log(" run `sootsim setup` to install the background daemon,"),console.log(" or run `sootsim serve` in another shell for a foreground bridge.")}function mt(e){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${e}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function ao(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){mt(o);return}console.error(` no sim with id "${t}" is connected to the bridge on port ${o}.`),console.error(""),console.error(" connected sims:");for(let r of n){let s=[r.isPrimary?"primary":null,r.readyState,r.userVisible===!1?"hidden":r.userVisible===!0?"visible":null,r.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${r.id} (${s})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}var ft=12e4,qe=100,ht=5e3,ze=1e4,gt={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function $(e){return new Promise(o=>setTimeout(o,e))}function Ve(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function wt(){let e=Ve("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??Ve("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??ft;return{timeoutMs:e,hostTimeoutMs:e+ht,intervalMs:qe,attempts:Math.max(1,Math.ceil(e/qe))}}function bt(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function yt(e,o){return e.includes("--headless")?!0:e.includes("--headed")?!1:o==="playwright"&&process.platform==="linux"&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY?(console.error(" no display detected \u2192 running playwright headless (override with --headed)"),!0):!1}function V(e){return e.trim()}var Ye=/^[A-Za-z][A-Za-z0-9+.-]*:/;function vt(e){let o=e.trim();if(!o)throw new Error("expected <url-or-route>");return Ye.test(o)||o.startsWith("/")?o:`/${o}`}function St(e){return e!==null&&typeof e=="object"}function $t(e){let o=e.trim();return o?o.startsWith("/")?!0:Ye.test(o)?!/^https?:\/\//i.test(o):!1:!1}async function xt(e){if(await q(e,250))return e;let o=te();if(o&&j(o)&&await q(o.bridgePort,500))return o.bridgePort;if(o&&j(o))throw new Error(`sootsim bridge lockfile is fresh (port ${o.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`);await kt();let t=It(["serve","--quiet","--port",String(e)]),n=null;t.once("exit",(s,i)=>{n=String(s??i??"unknown")}),t.unref();let r=Date.now()+ze;for(;Date.now()<r;){let s=te();if(s&&j(s)&&await q(s.bridgePort,250))return console.error(` started local bridge on port ${s.bridgePort}; run \`sootsim setup\` to install the background daemon`),s.bridgePort;if(await q(e,250))return console.error(` started local bridge on port ${e}; run \`sootsim setup\` to install the background daemon`),e;if(n)throw new Error(`sootsim bridge exited before becoming ready (exit ${n})`);await $(150)}throw new Error(`sootsim bridge did not start within ${Math.round(ze/1e3)}s`)}async function kt(){let e=Se();if(e&&L.existsSync(ve(e)))return;console.error(" installing sootsim engine runtime...");let{runRuntime:o}=await import("./runtime-HXWRA4KS.js");await o(["install"],{})}function It(e){let o=process.argv[1];return o&&L.existsSync(o)?je(process.execPath,[o,...e],{detached:!0,stdio:"ignore",env:process.env}):je("sootsim",e,{detached:!0,stdio:"ignore",env:process.env})}function q(e,o){return new Promise(t=>{let n=new pt(`ws://127.0.0.1:${e}`,{handshakeTimeout:o}),r=!1,s=i=>{if(!r){r=!0;try{n.close()}catch{}t(i)}};n.once("open",()=>s(!0)),n.once("error",()=>s(!1)),setTimeout(()=>s(!1),o)})}function ue(e){try{let o=new URL(e),t=o.pathname.replace(/\/+$/,"")||"/";return o.searchParams.has("open")||o.searchParams.has("port")||o.searchParams.has("bundle")||o.searchParams.has("demo")||o.pathname.includes("/sootsim/index.html")||t==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Pt(e){try{let o=new URL(e,"http://sootsim.local");if(o.origin!=="http://sootsim.local")return!1;let t=o.pathname.replace(/\/+$/,"")||"/";return t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Ct(e,o){let t=new URL(e,"http://sootsim.local"),n=new URL(o),r=G(n.pathname),s=t.pathname.startsWith("/__soot/")?t.pathname.slice(7):t.pathname;return n.pathname=`${r}${s}`,n.search=t.search,n.hash=t.hash,n.toString()}function Et(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function Oo(e){let o=V(e);return(await Ze(o)).bundleUrl}function Mt(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||o.search||o.hash||!P(o.hostname))return null;let n=o.port?Number(o.port):o.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function Ze(e){let o=V(e),t=/^\d+$/.test(o)?Number(o):Mt(o);if(t&&t>0){let n=await ke(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return He(o)}function G(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function Tt(e,o){let t=V(e),n=new URL(o),r=G(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),/^\d+$/.test(t)?n.pathname=`${r}/rn/${t}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",t)),n.toString()}function _t(e){let o=V(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function Ut(e,o,t={}){let n=await Ze(e),r=new URL(o),s=G(r.pathname);r.pathname=`${s}/rn`,r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("demo"),r.searchParams.delete("app");let i=t.hot===void 0?n.bundleUrl:xe(n.bundleUrl,t.hot);return r.searchParams.set("bundle",i),r.toString()}function Rt(e){return e.startsWith("~/")?T.join(ut.homedir(),e.slice(2)):T.isAbsolute(e)?e:T.resolve(process.cwd(),e)}function Ot(e){let o={},t={};for(let r=0;r<e.length;r++){if(e[r]==="--replace"){let s=e[r+1];s||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let i=s.indexOf("=");(i<=0||i===s.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let a=s.slice(0,i).trim(),l=Rt(s.slice(i+1).trim());L.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),o[a]={file:l},r++;continue}if(e[r]==="--remap"){let s=e[r+1],i=s?s.indexOf("="):-1;(!s||i<=0||i===s.length-1)&&(console.error(" sootsim open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(o).length>0&&(n.modules=o),Object.keys(t).length>0&&(n.network={remap:t}),n.modules||n.network?n:void 0}function Xe(){return Re().shellBaseUrl}async function Bt(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.CONTRAST_REPO_DIR||await se(t)||void 0,r=Ce({bundleUrl:t,repoDir:n});if(r.length===0)return e;let s=await Dt(r);return s.length===0?e:(o.searchParams.set("appFonts",Ee(s)),o.toString())}catch{return e}}async function Dt(e){let o=await Promise.all(e.map(async n=>{let r=new AbortController,s=setTimeout(()=>r.abort(),1500);try{let i=await fetch(n.url,{method:"HEAD",signal:r.signal});return i.status>=200&&i.status<400?n:null}catch{return null}finally{clearTimeout(s)}})),t=[];for(let n of o)n!==null&&t.push(n);return t}async function Lt(e,o,t={}){if(!e)return new URL(o).toString();if(ue(e))return new URL(e).toString();if(Pt(e))return Ct(e,o);let n=gt[e.toLowerCase()];if(n){let r=new URL(o),s=G(r.pathname);return r.pathname=`${s}${n}`,r.toString()}return _t(e)?Ut(e,o,t):Tt(e,o)}async function At(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.CONTRAST_REPO_DIR||await se(t)||void 0,r=Me({bundleUrl:t,repoDir:n});return!r||r.imageUrl&&!await Nt(r.imageUrl)?e:(o.searchParams.set("appSplash",Te(r)),o.toString())}catch{return e}}async function Nt(e){let o=new AbortController,t=setTimeout(()=>o.abort(),1500);try{let n=await fetch(e,{method:"HEAD",signal:o.signal});return n.status>=200&&n.status<400}catch{return!1}finally{clearTimeout(t)}}async function z(e,o=Xe(),t={}){let n=await Lt(e,o,t),r=await At(await Bt(n));if(!t.device)return r;let s=new URL(r);return s.searchParams.set("device",t.device),s.toString()}function Ge(e,o){let t=e?.url||e?.origin||o;try{let n=new URL(t);return n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("inspectOpen"),n.searchParams.delete("appFonts"),n.searchParams.delete("appSplash"),n.toString()}catch{return o}}async function Ft(e,o,t,n={}){let r=new URL(await z(e,o,n));return r.searchParams.set("inspectOpen",t),r.toString()}async function Ht(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500,i=n.minNodeCount??10;for(let a=0;a<r;a++){let l=v(e,{commandTimeoutMs:o,simId:t,simIdSource:"flag"});try{let d=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof d=="number"&&d>i)return{bridge:l,count:d}}catch{}l.close(),await $(s)}return null}function Wt(e){if(!e)return null;try{let o=new URL(e);if(o.searchParams.has("bundle")){let t=o.searchParams.get("bundle")||"";try{let n=new URL(t),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return o.searchParams.has("port")?`connect :${o.searchParams.get("port")||""}`:o.searchParams.has("open")?`connect ${o.searchParams.get("open")||""}`:o.searchParams.has("demo")?`demo ${o.searchParams.get("demo")||"default"}`:o.pathname.includes("/sootsim/index.html")||o.pathname==="/sootsim/"||o.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function jt(e){let o=e.indexOf(":");if(o<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,o),n=e.slice(o+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return t==="AGENTBUS_SESSION"||t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function Bo(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as K,b as ne,c as re,d as xe,e as ke,g as P,h as Pe}from"./chunk-7IRIUNGE.js";import{b as Ie,l as ce}from"./chunk-MEDHQ56Z.js";import{a as O,b as ae}from"./chunk-N26E5CXX.js";import{a as Me,b as Te}from"./chunk-VZAQKG5M.js";import{a as Ce,b as se,c as Ee}from"./chunk-L7ERS6QK.js";import{d as le}from"./chunk-L2UUNXDV.js";import{m as R}from"./chunk-JUXYDTBR.js";import{m as _e,o as Ue}from"./chunk-YHSHHL45.js";import{a as Re,b as Oe,c as ie,e as Be,f as De,g as E,h as v,i as M}from"./chunk-JBLWPWDL.js";import{e as _,f as b,g as U}from"./chunk-J2KTAKIN.js";import{H as Se,K as te,M as j,l as ve}from"./chunk-TPGYHYD6.js";import{g as oe,i as $e}from"./chunk-Y32LUBR6.js";import{spawn as je,spawnSync as Ke}from"node:child_process";import L from"node:fs";import ut from"node:os";import T from"node:path";import{WebSocket as pt}from"ws";function Le(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function st(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function Ne(e,o,t){return`${e}//${o}:${t}`}function it(e){if(typeof window>"u")return!1;try{let o=new URL(e);return P(o.hostname)&&P(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function Ae(e,o){let t={...o,cache:o?.cache??"no-store"};return it(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function at(e){return e==="https:"?443:80}function lt(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function ct(e){try{let o=await fetch("/__server-scan",{cache:"no-store"});if(!o.ok||!(o.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await o.json();if(!Array.isArray(t))return null;let n=t.find(r=>!!r&&typeof r=="object"&&r.port===e&&typeof r.bundleUrl=="string");return n?{bundleUrl:re(n.bundleUrl),port:e,framework:typeof n.framework=="string"?n.framework:"unknown",projectName:typeof n.projectName=="string"?n.projectName:void 0}:null}catch{return null}}async function Fe(e,o){let t=e.replace(/\/+$/,"");try{if(P(new URL(t).hostname)){let n=await ct(o);if(n)return n}}catch{}try{let n=await Ae(`${t}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},i=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(i||s.name)return{bundleUrl:re(i||`${t}${ne}`),port:o,framework:st(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await Ae(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${ne}`,port:o,framework:"metro"}}catch{}return null}async function dt(e){return Fe(Ne("http:","localhost",e),e)}async function He(e){let o=e.trim();if(/^\d+$/.test(o)){let a=parseInt(o,10),l=await dt(a);if(l)return l;throw Le(`localhost:${a}`)}let t=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(t)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let r=n.protocol||"http:",s=n.port?parseInt(n.port,10):at(r),i=Ne(r,n.hostname,s);if(lt(n)){let a=await Fe(i,s);if(a)return a;throw Le(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function io(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim desktop install"),console.error(""),console.error(" or run setup to install the background daemon:"),console.error(" sootsim setup"),console.error("")}function We(e){let o=O();if(console.log(` note: no sootsim bridge detected on port ${e}`),o){console.log(" launch the installed companion with:"),console.log(" sootsim desktop");return}console.log(""),console.log(" run `sootsim setup` to install the background daemon,"),console.log(" or run `sootsim serve` in another shell for a foreground bridge.")}function mt(e){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${e}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function ao(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){mt(o);return}console.error(` no sim with id "${t}" is connected to the bridge on port ${o}.`),console.error(""),console.error(" connected sims:");for(let r of n){let s=[r.isPrimary?"primary":null,r.readyState,r.userVisible===!1?"hidden":r.userVisible===!0?"visible":null,r.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${r.id} (${s})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}var ft=12e4,qe=100,ht=5e3,ze=1e4,gt={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function $(e){return new Promise(o=>setTimeout(o,e))}function Ve(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function wt(){let e=Ve("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??Ve("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??ft;return{timeoutMs:e,hostTimeoutMs:e+ht,intervalMs:qe,attempts:Math.max(1,Math.ceil(e/qe))}}function bt(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function yt(e,o){return e.includes("--headless")?!0:e.includes("--headed")?!1:o==="playwright"&&process.platform==="linux"&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY?(console.error(" no display detected \u2192 running playwright headless (override with --headed)"),!0):!1}function V(e){return e.trim()}var Ye=/^[A-Za-z][A-Za-z0-9+.-]*:/;function vt(e){let o=e.trim();if(!o)throw new Error("expected <url-or-route>");return Ye.test(o)||o.startsWith("/")?o:`/${o}`}function St(e){return e!==null&&typeof e=="object"}function $t(e){let o=e.trim();return o?o.startsWith("/")?!0:Ye.test(o)?!/^https?:\/\//i.test(o):!1:!1}async function xt(e){if(await q(e,250))return e;let o=te();if(o&&j(o)&&await q(o.bridgePort,500))return o.bridgePort;if(o&&j(o))throw new Error(`sootsim bridge lockfile is fresh (port ${o.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`);await kt();let t=It(["serve","--quiet","--port",String(e)]),n=null;t.once("exit",(s,i)=>{n=String(s??i??"unknown")}),t.unref();let r=Date.now()+ze;for(;Date.now()<r;){let s=te();if(s&&j(s)&&await q(s.bridgePort,250))return console.error(` started local bridge on port ${s.bridgePort}; run \`sootsim setup\` to install the background daemon`),s.bridgePort;if(await q(e,250))return console.error(` started local bridge on port ${e}; run \`sootsim setup\` to install the background daemon`),e;if(n)throw new Error(`sootsim bridge exited before becoming ready (exit ${n})`);await $(150)}throw new Error(`sootsim bridge did not start within ${Math.round(ze/1e3)}s`)}async function kt(){let e=Se();if(e&&L.existsSync(ve(e)))return;console.error(" installing sootsim engine runtime...");let{runRuntime:o}=await import("./runtime-QOHRQKXF.js");await o(["install"],{})}function It(e){let o=process.argv[1];return o&&L.existsSync(o)?je(process.execPath,[o,...e],{detached:!0,stdio:"ignore",env:process.env}):je("sootsim",e,{detached:!0,stdio:"ignore",env:process.env})}function q(e,o){return new Promise(t=>{let n=new pt(`ws://127.0.0.1:${e}`,{handshakeTimeout:o}),r=!1,s=i=>{if(!r){r=!0;try{n.close()}catch{}t(i)}};n.once("open",()=>s(!0)),n.once("error",()=>s(!1)),setTimeout(()=>s(!1),o)})}function ue(e){try{let o=new URL(e),t=o.pathname.replace(/\/+$/,"")||"/";return o.searchParams.has("open")||o.searchParams.has("port")||o.searchParams.has("bundle")||o.searchParams.has("demo")||o.pathname.includes("/sootsim/index.html")||t==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Pt(e){try{let o=new URL(e,"http://sootsim.local");if(o.origin!=="http://sootsim.local")return!1;let t=o.pathname.replace(/\/+$/,"")||"/";return t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Ct(e,o){let t=new URL(e,"http://sootsim.local"),n=new URL(o),r=G(n.pathname),s=t.pathname.startsWith("/__soot/")?t.pathname.slice(7):t.pathname;return n.pathname=`${r}${s}`,n.search=t.search,n.hash=t.hash,n.toString()}function Et(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function Oo(e){let o=V(e);return(await Ze(o)).bundleUrl}function Mt(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||o.search||o.hash||!P(o.hostname))return null;let n=o.port?Number(o.port):o.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function Ze(e){let o=V(e),t=/^\d+$/.test(o)?Number(o):Mt(o);if(t&&t>0){let n=await ke(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return He(o)}function G(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function Tt(e,o){let t=V(e),n=new URL(o),r=G(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),/^\d+$/.test(t)?n.pathname=`${r}/rn/${t}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",t)),n.toString()}function _t(e){let o=V(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function Ut(e,o,t={}){let n=await Ze(e),r=new URL(o),s=G(r.pathname);r.pathname=`${s}/rn`,r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("demo"),r.searchParams.delete("app");let i=t.hot===void 0?n.bundleUrl:xe(n.bundleUrl,t.hot);return r.searchParams.set("bundle",i),r.toString()}function Rt(e){return e.startsWith("~/")?T.join(ut.homedir(),e.slice(2)):T.isAbsolute(e)?e:T.resolve(process.cwd(),e)}function Ot(e){let o={},t={};for(let r=0;r<e.length;r++){if(e[r]==="--replace"){let s=e[r+1];s||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let i=s.indexOf("=");(i<=0||i===s.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let a=s.slice(0,i).trim(),l=Rt(s.slice(i+1).trim());L.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),o[a]={file:l},r++;continue}if(e[r]==="--remap"){let s=e[r+1],i=s?s.indexOf("="):-1;(!s||i<=0||i===s.length-1)&&(console.error(" sootsim open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(o).length>0&&(n.modules=o),Object.keys(t).length>0&&(n.network={remap:t}),n.modules||n.network?n:void 0}function Xe(){return Re().shellBaseUrl}async function Bt(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.CONTRAST_REPO_DIR||await se(t)||void 0,r=Ce({bundleUrl:t,repoDir:n});if(r.length===0)return e;let s=await Dt(r);return s.length===0?e:(o.searchParams.set("appFonts",Ee(s)),o.toString())}catch{return e}}async function Dt(e){let o=await Promise.all(e.map(async n=>{let r=new AbortController,s=setTimeout(()=>r.abort(),1500);try{let i=await fetch(n.url,{method:"HEAD",signal:r.signal});return i.status>=200&&i.status<400?n:null}catch{return null}finally{clearTimeout(s)}})),t=[];for(let n of o)n!==null&&t.push(n);return t}async function Lt(e,o,t={}){if(!e)return new URL(o).toString();if(ue(e))return new URL(e).toString();if(Pt(e))return Ct(e,o);let n=gt[e.toLowerCase()];if(n){let r=new URL(o),s=G(r.pathname);return r.pathname=`${s}${n}`,r.toString()}return _t(e)?Ut(e,o,t):Tt(e,o)}async function At(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.CONTRAST_REPO_DIR||await se(t)||void 0,r=Me({bundleUrl:t,repoDir:n});return!r||r.imageUrl&&!await Nt(r.imageUrl)?e:(o.searchParams.set("appSplash",Te(r)),o.toString())}catch{return e}}async function Nt(e){let o=new AbortController,t=setTimeout(()=>o.abort(),1500);try{let n=await fetch(e,{method:"HEAD",signal:o.signal});return n.status>=200&&n.status<400}catch{return!1}finally{clearTimeout(t)}}async function z(e,o=Xe(),t={}){let n=await Lt(e,o,t),r=await At(await Bt(n));if(!t.device)return r;let s=new URL(r);return s.searchParams.set("device",t.device),s.toString()}function Ge(e,o){let t=e?.url||e?.origin||o;try{let n=new URL(t);return n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("inspectOpen"),n.searchParams.delete("appFonts"),n.searchParams.delete("appSplash"),n.toString()}catch{return o}}async function Ft(e,o,t,n={}){let r=new URL(await z(e,o,n));return r.searchParams.set("inspectOpen",t),r.toString()}async function Ht(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500,i=n.minNodeCount??10;for(let a=0;a<r;a++){let l=v(e,{commandTimeoutMs:o,simId:t,simIdSource:"flag"});try{let d=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof d=="number"&&d>i)return{bridge:l,count:d}}catch{}l.close(),await $(s)}return null}function Wt(e){if(!e)return null;try{let o=new URL(e);if(o.searchParams.has("bundle")){let t=o.searchParams.get("bundle")||"";try{let n=new URL(t),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return o.searchParams.has("port")?`connect :${o.searchParams.get("port")||""}`:o.searchParams.has("open")?`connect ${o.searchParams.get("open")||""}`:o.searchParams.has("demo")?`demo ${o.searchParams.get("demo")||"default"}`:o.pathname.includes("/sootsim/index.html")||o.pathname==="/sootsim/"||o.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function jt(e){let o=e.indexOf(":");if(o<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,o),n=e.slice(o+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return t==="AGENTBUS_SESSION"||t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function Bo(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
3
3
  `);for(let t of e){let n=t.lockedBy&&t.lockExpiresAt?`locked by ${jt(t.lockedBy)} (${Math.max(0,Math.round((t.lockExpiresAt-Date.now())/1e3))}s)`:"",r=[t.isPrimary?"primary":"",t.id===o?"selected":"",t.readyState,t.userVisible===!1?"hidden":t.userVisible===!0?"visible":"",t.attachedCliCount&&t.attachedCliCount>0?"in use":"",t.userFocused?"focused":"",n].filter(Boolean);console.log(` ${t.id}${r.length?` [${r.join(", ")}]`:""}`);let s=Wt(t.url);if(s)console.log(` loaded: ${s}`);else if(t.url){let a=t.url.length>96?`${t.url.slice(0,93)}\u2026`:t.url;console.log(` url: ${a}`)}else t.origin&&console.log(` origin: ${t.origin}`);let i=Kt(t);i&&console.log(` engine: ${i}`),t.title&&console.log(` title: ${t.title}`),t.visibilityState&&t.visibilityState!=="visible"&&console.log(` visibility: ${t.visibilityState}`),console.log(` connected: ${Je(Date.now()-t.connectedAt)}`),t.lastActiveAt&&t.lastActiveAt>0&&console.log(` last active: ${Je(Date.now()-t.lastActiveAt)}`)}}function Kt(e){let o=e.url||e.origin||"";if(!o)return null;try{let t=new URL(o).port;return t==="5173"?"dev \u2014 local source (:5173)":t==="3000"?"Contrast app embedded (:3000)":Pe()?`dev \u2014 local build (:${t||"?"})`:`runtime \u2014 published engine (:${t||"?"})`}catch{return null}}function Je(e){let o=Math.max(0,Math.round(e/1e3));return o<60?`${o}s ago`:o<3600?`${Math.round(o/60)}m ago`:o<86400?`${Math.round(o/3600)}h ago`:`${Math.round(o/86400)}d ago`}async function de(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:o});try{let d=(await a.listSims()).find(t);if(d)return d}catch{}finally{a.close()}await $(s)}return null}async function qt(e,o,t,n,r={}){let s=r.attempts??30,i=r.intervalMs??500,a=!!n&&Number.isInteger(n)&&n>1,l=()=>a&&n!==void 0&&!pe(n);for(let d=0;d<s;d++){if(l())return{kind:"host-exit"};let m=v(e,{commandTimeoutMs:o});try{let g=(await m.listSims()).find(t);if(g)return l()?{kind:"host-exit"}:{kind:"match",sim:g}}catch{}finally{m.close()}if(l())return{kind:"host-exit"};await $(i)}return{kind:"timeout"}}async function zt(e,o,t,n={}){let r=n.attempts??20,s=n.intervalMs??250;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:o});try{let d=(await a.listSims()).find(m=>m.id===t);if(!d||d.readyState!=="open")return!0}catch{return!0}finally{a.close()}await $(s)}return!1}function Vt(e){let o=e.meta;if(!o||o.sootsimHostDriver!=="playwright")return null;let t=Number(o.sootsimHostPid);return!Number.isInteger(t)||t<=1||t===process.pid?null:t}function Gt(e){if(!e.connectAckFile)return!1;try{return L.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
4
4
  `,{flag:"w"}),!0}catch{return!1}}function Qe(e){if(e.diagnosticLogPath)try{let o=L.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!o){console.error(` ${T.basename(e.diagnosticLogPath)} was empty`);return}let t=o.length>4e3?`\u2026
5
5
  ${o.slice(-4e3)}`:o;console.error(` ${T.basename(e.diagnosticLogPath)}:`),console.error(t)}catch(o){let t=o instanceof Error?o.message:String(o);console.error(` failed to read ${T.basename(e.diagnosticLogPath)}: ${t}`)}}function pe(e){try{return process.kill(e,0),!0}catch(o){return o?.code==="EPERM"}}async function Jt(e,o=2500){let t=Date.now()+o;for(;Date.now()<t;){if(!pe(e))return!0;await $(100)}return!pe(e)}function Qt(e){let o=Ke("ps",["-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]}),t=Ke("ps",["eww","-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(o.status!==0||t.status!==0)return!1;let n=(o.stdout||"").trimEnd(),r=(t.stdout||"").trimEnd();return(r.startsWith(n)?r.slice(n.length):r).includes("SOOTSIM_PW_URL=")}async function me(e,o){let t=new Set(o),n=new Set;for(let r of e){if(!t.has(r.id))continue;let s=Vt(r);s&&n.add(s)}for(let r of n){if(!Qt(r)){console.log(` skipped pid ${r}: not a sootsim playwright host (stale sim record)`);continue}try{process.kill(r,"SIGTERM")}catch{}if(await Jt(r)){console.log(` closed playwright host process ${r}`);continue}try{process.kill(r,"SIGKILL"),console.log(` force-closed playwright host process ${r}`)}catch{}}}function J(e,o){if(o){let r=o.trim(),s=e.find(i=>i.id===r);if(!s)throw new Error(`no sim connected with id ${r}`);return s}let t=e.find(r=>r.isPrimary&&r.readyState==="open");if(t)return t;let n=e.find(r=>r.readyState==="open");if(n)return n;throw new Error("no sim connected")}function B(e,o,t){console.log(` ${t==="current sim"?"loaded":"opened"}: ${e} [${t}]`),console.log(` current sim: ${o.id}`),console.log(JSON.stringify({simId:o.id,url:o.url},null,2))}async function D(e,o,t){if(t.includes("--no-describe"))return;let n=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await Yt(e,o,{stableMs:150,maxMs:400});let r=v(e,{commandTimeoutMs:3e3,simId:o,cliLabel:"open --describe",simIdSource:"flag"});try{let s=null;try{s=await r.send({type:"evaluate",code:_e})}catch{}if(s&&!(s.flag===!0&&!s.loadingText&&Ue(s))){let m=s.loadingText?`still showing "${s.loadingText}"`:s.flag!==!0?"guest ready event has not fired":s.targets<=0?"no visible app content is inspectable yet":"app tree is still stabilizing";console.log(` app still loading: ${m} (nodes: ${s.nodes}, targets: ${s.targets})`),console.log(" before interacting, run: sootsim wait ready --max-ms 120000")}let a=`(async () => {
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as c}from"./chunk-RQLU3VUC.js";import{a}from"./chunk-NSUPW33Y.js";import{a as e}from"./chunk-Z5XWEBC7.js";import{c as n}from"./chunk-V5AYW37H.js";import{c as i,d as m,e as p}from"./chunk-BKCWNVLF.js";import{a as u}from"./chunk-CR77YDXG.js";import{a as f,c as s}from"./chunk-FH2RGEYP.js";function g(){return`sootsim CLI v${u()} \xB7 ${c().primary}`}function C(){let r=m({bridgePort:7668,defaultShellUrl:n},e()),o=`
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as c}from"./chunk-CPNFO75T.js";import{a}from"./chunk-7HAL4BSF.js";import{a as e}from"./chunk-DXW5WPQZ.js";import{c as n}from"./chunk-IUMB6FFJ.js";import{c as i,d as m,e as p}from"./chunk-DWNTHMG3.js";import{a as u}from"./chunk-BRQYKLNB.js";import{a as f,c as s}from"./chunk-DG4TWQYN.js";function g(){return`sootsim CLI v${u()} \xB7 ${c().primary}`}function C(){let r=m({bridgePort:7668,defaultShellUrl:n},e()),o=`
3
3
  ${s}
4
4
  `;console.log(`${g()}
5
5
  ${o}${r}
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var c="sootsim-agent-prompt-v1";function r(n){return typeof n=="string"?n.trim():""}function m(n){let e=r(n.text);if(!e)return"";let t=r(n.displayText),s=r(n.inspectSummary),o=r(n.inspectTrace);return!!s||!!o||/[\r\n]/.test(e)||!!t&&t!==e?JSON.stringify({__sootsimAgentPrompt:c,text:e,displayText:t,inspectSummary:s,inspectTrace:o}):e}function u(n){let e=r(n);if(!e)return null;try{let t=JSON.parse(e);if(t.__sootsimAgentPrompt!==c)return{text:e};let s=r(typeof t.text=="string"?t.text:void 0);if(!s)return null;let o=r(typeof t.displayText=="string"?t.displayText:void 0),i=r(typeof t.inspectSummary=="string"?t.inspectSummary:void 0),p=r(typeof t.inspectTrace=="string"?t.inspectTrace:void 0);return{text:s,...o?{displayText:o}:{},...i?{inspectSummary:i}:{},...p?{inspectTrace:p}:{}}}catch{return{text:e}}}export{m as a,u as b};
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as f}from"./chunk-IBMRHDPR.js";import{existsSync as g,mkdirSync as h,readFileSync as S,writeFileSync as b,rmSync as x}from"fs";import{tmpdir as y}from"os";import{dirname as v,join as m}from"path";var p=new Map;function s(e,t){p.set(e,t)}var i=1;function a(){return m(y(),`sootsim-cli-hints-${f()}.json`)}function d(){return m(y(),"sootsim-cli-hints-global.json")}function u(e){if(!g(e))return{version:i,shown:{}};try{let t=JSON.parse(S(e,"utf8"));return t?.version!==i||!t?.shown?{version:i,shown:{}}:t}catch{return{version:i,shown:{}}}}function l(e,t){try{h(v(e),{recursive:!0}),b(e,JSON.stringify(t)+`
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as f}from"./chunk-J2KTAKIN.js";import{existsSync as g,mkdirSync as h,readFileSync as S,writeFileSync as b,rmSync as x}from"fs";import{tmpdir as y}from"os";import{dirname as v,join as m}from"path";var p=new Map;function s(e,t){p.set(e,t)}var i=1;function a(){return m(y(),`sootsim-cli-hints-${f()}.json`)}function d(){return m(y(),"sootsim-cli-hints-global.json")}function u(e){if(!g(e))return{version:i,shown:{}};try{let t=JSON.parse(S(e,"utf8"));return t?.version!==i||!t?.shown?{version:i,shown:{}}:t}catch{return{version:i,shown:{}}}}function l(e,t){try{h(v(e),{recursive:!0}),b(e,JSON.stringify(t)+`
3
3
  `)}catch{}}function H(){let e=(process.env.SOOTSIM_HINTS||"").toLowerCase();return e==="off"||e==="0"||e==="false"?"off":e==="always"||e==="verbose"?"always":"normal"}function F(e,t){let o=H();if(o==="off")return!1;if(o==="always"||t==="always")return!0;let n=Date.now();if(t==="once-per-identity"){let r=u(a());return r.shown[e]?!1:(r.shown[e]=n,l(a(),r),!0)}if(t==="once-ever"){let r=u(d());return r.shown[e]?!1:(r.shown[e]=n,l(d(),r),!0)}if(typeof t=="object"&&"cooldownMs"in t){let r=u(a()),c=r.shown[e]??0;return n-c<t.cooldownMs?!1:(r.shown[e]=n,l(a(),r),!0)}return!0}function $(e,...t){let o=p.get(e);if(!o)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!F(e,o.frequency))return!1;let n=o.render(...t);if(n==null)return!1;let r=Array.isArray(n)?n:[n],c=o.stream==="error"?console.error:console.log;for(let w of r)c(` hint: ${w}`);return!0}s("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`sootsim wait ready\` first.`});s("wait-selector-for-missing-testid",{frequency:"once-per-identity",render:e=>`sootsim wait selector ${e}`,stream:"error"});s("prefer-cli-over-eval",{frequency:"once-per-identity",render:e=>e.length?["try the CLI shortcut instead:",...e.map(t=>` ${t}`)]:null,stream:"error"});s("describe-use-filters",{frequency:"once-per-identity",render:()=>["describe output is long. narrow it with:"," sootsim describe --only '*Bottom Sheet*'"," sootsim describe --testid-like 'swap-*'"," sootsim describe --subtree <testID>"]});s("describe-filter-context",{frequency:"once-per-identity",render:()=>["filtered describe is search output, not current-route proof.","run `sootsim describe` without filters after navigation; clipped nodes are marked `(clipped:...)`."]});s("subtree-root-not-found",{frequency:"always",render:e=>`no node with testID/id "${e}" \u2014 try \`sootsim find --testid ${e}\` to discover available ids.`,stream:"error"});s("clean-uninstall",{frequency:"once-ever",render:()=>["to uninstall sootsim completely, run `sootsim daemon uninstall`.","it removes the launchd / systemd agent and the ~/.sootsim cache (~80MB)."]});export{$ as a};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as E,b as D}from"./chunk-ATGGTD4F.js";import{H as U}from"./chunk-WENY5XO6.js";var N="sootsimConfig";function p(e){return!!e&&Object.keys(e).length>0}function $(e){return e?p(e.modules)||p(e.turboModules)||p(e.nativeModules)||p(e.env)||p(e.network?.remap)||p(e.settings)||p(e.initialState):!1}function A(e,n){let t=new URL(e);return $(n)?t.searchParams.set(N,JSON.stringify(n)):t.searchParams.delete(N),t.toString()}var pe="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function j(e){return/^https?:\/\//i.test(e)}function O(e){return e.endsWith(".bundle")}function H(e){process.env.SOOTSIM_PREVIEW_PROD_BUNDLE&&(e.searchParams.set("dev","false"),e.searchParams.set("minify","true"),e.searchParams.has("hot")&&e.searchParams.set("hot","false"))}function I(e){try{let n=j(e),t=new URL(e,"http://sootsim.local");return t.pathname=t.pathname.replace(/\.\.bundle$/,".bundle"),O(t.pathname)?(t.searchParams.delete("transform.bytecode"),t.searchParams.get("lazy")==="true"&&t.searchParams.set("lazy","false"),H(t),n?t.toString():`${t.pathname}${t.search}${t.hash}`):e}catch{return e}}function ge(e,n){try{let t=j(e),o=new URL(e,"http://sootsim.local");return O(o.pathname)?(o.searchParams.set("hot",n?"true":"false"),t?o.toString():`${o.pathname}${o.search}${o.hash}`):e}catch{return e}}import{exec as B}from"child_process";import W from"http";import F from"net";import{promisify as G}from"util";var _=G(B);E();var z=250,J=1500,K=120;function V(e,n=K){return new Promise(t=>{let o=new F.Socket,s=!1,i=a=>{s||(s=!0,o.destroy(),t(a))};o.setTimeout(n),o.once("connect",()=>i(!0)),o.once("timeout",()=>i(!1)),o.once("error",()=>i(!1)),o.connect(e,"localhost")})}function h(e,n,t="GET",o=z,s={}){return new Promise(i=>{let a=W.request({hostname:"localhost",port:e,path:n,method:t,timeout:o,headers:s},r=>{let c="";r.on("data",l=>c+=l.toString());let u=(()=>{let l=r.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();r.on("end",()=>i({statusCode:r.statusCode||0,body:c,contentType:u}))});a.on("error",()=>i(null)),a.setTimeout(o,()=>{a.destroy(),i(null)}),a.end()})}var q=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function C(e,n){return!(e<=0||e>=2e4||n.has(e)||e>=5170&&e<=5200)}async function Y(e=[]){let n=new Set(e);try{let{stdout:t}=await _("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(t.trim()){let o=new Map;for(let s of t.trim().split(`
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as E,b as D}from"./chunk-VVHBMGLB.js";import{H as U}from"./chunk-TPGYHYD6.js";var N="sootsimConfig";function p(e){return!!e&&Object.keys(e).length>0}function $(e){return e?p(e.modules)||p(e.turboModules)||p(e.nativeModules)||p(e.env)||p(e.network?.remap)||p(e.settings)||p(e.initialState):!1}function A(e,n){let t=new URL(e);return $(n)?t.searchParams.set(N,JSON.stringify(n)):t.searchParams.delete(N),t.toString()}var pe="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function j(e){return/^https?:\/\//i.test(e)}function O(e){return e.endsWith(".bundle")}function H(e){process.env.SOOTSIM_PREVIEW_PROD_BUNDLE&&(e.searchParams.set("dev","false"),e.searchParams.set("minify","true"),e.searchParams.has("hot")&&e.searchParams.set("hot","false"))}function I(e){try{let n=j(e),t=new URL(e,"http://sootsim.local");return t.pathname=t.pathname.replace(/\.\.bundle$/,".bundle"),O(t.pathname)?(t.searchParams.delete("transform.bytecode"),t.searchParams.get("lazy")==="true"&&t.searchParams.set("lazy","false"),H(t),n?t.toString():`${t.pathname}${t.search}${t.hash}`):e}catch{return e}}function ge(e,n){try{let t=j(e),o=new URL(e,"http://sootsim.local");return O(o.pathname)?(o.searchParams.set("hot",n?"true":"false"),t?o.toString():`${o.pathname}${o.search}${o.hash}`):e}catch{return e}}import{exec as B}from"child_process";import W from"http";import F from"net";import{promisify as G}from"util";var _=G(B);E();var z=250,J=1500,K=120;function V(e,n=K){return new Promise(t=>{let o=new F.Socket,s=!1,i=a=>{s||(s=!0,o.destroy(),t(a))};o.setTimeout(n),o.once("connect",()=>i(!0)),o.once("timeout",()=>i(!1)),o.once("error",()=>i(!1)),o.connect(e,"localhost")})}function h(e,n,t="GET",o=z,s={}){return new Promise(i=>{let a=W.request({hostname:"localhost",port:e,path:n,method:t,timeout:o,headers:s},r=>{let c="";r.on("data",l=>c+=l.toString());let u=(()=>{let l=r.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();r.on("end",()=>i({statusCode:r.statusCode||0,body:c,contentType:u}))});a.on("error",()=>i(null)),a.setTimeout(o,()=>{a.destroy(),i(null)}),a.end()})}var q=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function C(e,n){return!(e<=0||e>=2e4||n.has(e)||e>=5170&&e<=5200)}async function Y(e=[]){let n=new Set(e);try{let{stdout:t}=await _("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(t.trim()){let o=new Map;for(let s of t.trim().split(`
3
3
  `)){let i=s.trim().split(/\s+/);if(i.length<9)continue;let a=Number(i[1]),c=i[8].match(/:(\d+)$/);if(!c)continue;let u=Number(c[1]);C(u,n)&&(o.has(u)||o.set(u,a))}if(o.size>0)return[...o.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}try{let{stdout:t}=await _(`ss -tlnp 2>/dev/null | grep -E '"(node|bun)"'`,{encoding:"utf8",timeout:2e3});if(t.trim()){let o=new Map;for(let s of t.trim().split(`
4
4
  `)){let i=s.match(/:(\d+)\s/),a=s.match(/pid=(\d+)/);if(!i)continue;let r=Number(i[1]),c=a?Number(a[1]):0;C(r,n)&&(o.has(r)||o.set(r,c))}if(o.size>0)return[...o.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}return q.filter(t=>C(t.port,n))}var x=new Map;async function Q(e){if(e<=0)return null;let n=x.get(e);if(n)return n;try{let{stdout:t}=await _(`lsof -p ${e} -a -d cwd -Fn 2>/dev/null`,{encoding:"utf8",timeout:1500});for(let o of t.split(`
5
5
  `))if(o.startsWith("n")&&o.length>1){let s=o.slice(1).trim();if(s)return x.set(e,s),s}}catch{}return null}function X(e,n){return{port:e,framework:n,bundleUrl:S(e,`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()}}function S(e,n){let t=D().find(s=>s.preferredPort===e),o=t?.runtimeConfig?A(n,t.runtimeConfig):n;return I(o)}function Z(e){return e.includes("/node_modules/one/metro-entry.bundle")}function ee(e){try{let n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}function w(e,n,t){if(!n)return e;try{let o=JSON.parse(n.body),s=o?.extra?.expoClient||o?.extra||{};s.name&&(e.projectName=s.name),s.ios?.bundleIdentifier&&(e.bundleId=s.ios.bundleIdentifier),e.framework==="metro"&&s.sdkVersion&&(e.framework="expo");let i=o?.launchAsset?.url;i&&!e.patched&&!Z(e.bundleUrl)&&(e.bundleUrl=S(e.port,i));let a=s.iconUrl||s.ios?.iconUrl||s.icon||s.ios?.icon;if(a)if(e.iconPath=a,t)if(a.startsWith("http"))e.iconUrl=t(a);else{let r=a.replace(/^\.\//,"");e.iconUrl=t(`http://localhost:${e.port}/assets/${r}`)}else e.iconUrl=a.startsWith("http")?a:`http://localhost:${e.port}/assets/${a.replace(/^\.\//,"")}`}catch{}return e}var ne=2e4,v=new Map,k=new Set;function M(e,n){if(e.projectName)return e;let t=v.get(e.port);if(t)return t.projectName&&(e.projectName=t.projectName),t.iconUrl&&!e.iconUrl&&(e.iconUrl=t.iconUrl,e.iconPath=t.iconPath),t.bundleId&&!e.bundleId&&(e.bundleId=t.bundleId),e;if(!k.has(e.port)){k.add(e.port);let o=e.port;te(o,n).finally(()=>k.delete(o))}return e}async function te(e,n){let t=await h(e,"/","GET",ne,{"expo-platform":"ios"});if(!t||t.statusCode!==200)return;let o=w({port:e,framework:"one",bundleUrl:"",lastSeen:0},t,n);!o.projectName&&!o.iconUrl||(v.set(e,{projectName:o.projectName,iconUrl:o.iconUrl,iconPath:o.iconPath,bundleId:o.bundleId}),b.delete(e))}var d=new Set,g=new Set,y=new Set;async function oe(e,n){if(!await V(e))return null;let t="/node_modules/one/metro-entry.bundle?platform=ios&dev=true",[o,s,i,a]=await Promise.all([d.has(e)?Promise.resolve(null):h(e,"/__soot/"),h(e,"/status"),y.has(e)?Promise.resolve(null):h(e,"/","GET",J,{"expo-platform":"ios"}),g.has(e)?Promise.resolve(null):h(e,"/_expo/status")]);a&&a.statusCode===200?g.delete(e):g.has(e)||g.add(e);let r=i?ee(i.body):null,c=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:null,u=r?.extra?.expoClient||r?.extra||{};if(r&&(c||typeof u.name=="string")){d.add(e);let T=c||`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`,L=T.includes("/one/metro-entry.bundle")?"one":"expo";return w({port:e,framework:L,bundleUrl:S(e,T),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,n)}if(s&&s.body.includes("packager-status:running"))return d.add(e),M(w(X(e,a&&a.statusCode===200?"expo":"metro"),i,n),n);if(o&&o.statusCode===200&&o.body.includes("sootsim-patched"))return d.delete(e),M(w({port:e,framework:"one",bundleUrl:S(e,`http://localhost:${e}/__soot/bundle.js`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now(),patched:!0},i,n),n);if(s&&s.statusCode===200||a&&a.statusCode===200||i&&i.statusCode===200&&r!=null)return null;let m=await h(e,t,"HEAD");return m&&m.statusCode>0&&m.statusCode<400&&/application\/javascript/i.test(m.contentType||"")?(d.add(e),y.add(e),M(w({port:e,framework:"one",bundleUrl:S(e,`http://localhost:${e}${t}&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,n),n)):(d.add(e),null)}function re(e){return!!e.bundleId?.trim().toLowerCase()?.startsWith("dev.sootsim.")}var b=new Map,se=3e4,ie=1500;function ae(e){return!e||e.framework==="metro"||e.framework==="unknown"}function ce(e){return e?S(e.port,e.bundleUrl)===e.bundleUrl:!0}function ue(e,n,t=Date.now()){if(n===0||e.pid!==n||!ce(e.result))return!1;let o=t-e.cachedAt;return!(e.result===null&&o>=se||ae(e.result)&&o>=ie)}async function Pe(e={}){let n=await Y(e.excludePorts),t=new Set(n.map(r=>r.port));for(let r of[...b.keys()])t.has(r)||b.delete(r);for(let r of[...d])t.has(r)||d.delete(r);for(let r of[...g])t.has(r)||g.delete(r);for(let r of[...y])t.has(r)||y.delete(r);for(let r of[...v.keys()])t.has(r)||v.delete(r);let o=[],s=[];for(let{port:r,pid:c}of n){let u=b.get(r);if(u&&ue(u,c)){u.result&&o.push(u.result);continue}u&&u.pid!==c&&(d.delete(r),g.delete(r),y.delete(r),v.delete(r)),s.push({port:r,pid:c})}s.length>0&&(await Promise.all(s.map(c=>oe(c.port,e.buildIconProxyUrl)))).forEach((c,u)=>{let{port:l,pid:m}=s[u];m!==0&&b.set(l,{pid:m,result:c,cachedAt:Date.now()}),c&&o.push(c)});let i=new Map;for(let{port:r,pid:c}of n)c>0&&i.set(r,c);await Promise.all(o.map(async r=>{let c=i.get(r.port);if(!c)return;r.pid=c;let u=await Q(c);u&&(r.cwd=u)}));let a=new Set(i.values());for(let r of[...x.keys()])a.has(r)||x.delete(r);return o.filter(r=>!re(r))}function le(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function ke(e){let n=le(e);return n==="localhost"||n.endsWith(".localhost")||n==="0.0.0.0"||n==="::1"||/^127(?:\.\d{1,3}){3}$/.test(n)}import R from"fs";import f from"path";import{fileURLToPath as de}from"url";var P;function fe(){if(P!==void 0)return P;let e=f.dirname(de(import.meta.url));for(let n=0;n<12&&e!==f.dirname(e);n++){if(R.existsSync(f.join(e,"packages/sootsim-engine/package.json"))&&R.existsSync(f.join(e,"public/sootsim")))return P=e,e;e=f.dirname(e)}return P=null,null}function Ne(){if(process.env.SOOTSIM_HOME&&U())return null;let e=fe();if(!e)return null;let n=f.join(e,"public/sootsim");return R.existsSync(f.join(n,"index.html"))&&R.existsSync(f.join(n,"engine/index.html"))&&R.existsSync(f.join(n,"engine-tenant/worker.js"))?n:null}export{A as a,pe as b,I as c,ge as d,oe as e,Pe as f,ke as g,Ne as h};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var m={"--help":{type:"boolean",short:"-h"},"--version":{type:"boolean",short:"-V"},"--verbose":{type:"boolean",short:"-v"},"--port":{type:"number",short:"-p"},"--device":{type:"string",short:"-d"},"--theme":{type:"string",short:"-t"},"--headless":{type:"boolean"},"--driver":{type:"string"},"--sim":{type:"string"},"--session":{type:"string"},"--tab":{type:"string"}},p=new Set(["list","describe","find","get","do","wait","network","logs","shell"]),b=new Set(["do","get","wait","shell","debug"]),d=new Set(["detox","maestro","record","film","storage","perf","screenshot","mode","inspect","debug","timeline","what-happened","shell","assert","device","open","list","use","claim","close","compat","desktop","login","logout","auth","setup","serve","daemon","runtime","upgrade","version","skill","config","app-fonts","agent-wrapper","agent",...p]);function h(c){let r=c.slice(2),e={command:null,commandArgs:[],globalFlags:{},help:!1,version:!1,verbose:!1},s=0;for(;s<r.length;){let o=r[s];if(o==="--"){e.commandArgs.push(...r.slice(s+1));break}let i=Object.entries(m).find(([l,t])=>l===o||t.short===o);if(i){let[l,t]=i,a=l.replace(/^--/,"");if(t.type==="boolean")e.globalFlags[a]=!0,s++;else{let n=r[s+1];if(n===void 0||n.startsWith("-")){console.error(` warning: ${o} requires a value`),s++;continue}if(t.type==="number"){let g=Number(n);if(Number.isNaN(g)){console.error(` warning: ${o} requires a number, got "${n}"`),s+=2;continue}e.globalFlags[a]=g}else e.globalFlags[a]=n;s+=2}continue}if(!e.command&&!o.startsWith("-")){let l=o.indexOf("-");if(l>0){let t=o.slice(0,l),a=o.slice(l+1);if(b.has(t)&&a.length>0){e.command=t;let n=r.slice(s+1);e.commandArgs=[a,...n[0]==="--"?n.slice(1):n];break}}if(d.has(o)){e.command=o;let t=r.slice(s+1);e.commandArgs=t[0]==="--"?t.slice(1):t;break}e.commandArgs=r.slice(s);break}e.commandArgs.push(o),s++}return e.help=!!e.globalFlags.help,e.version=!!e.globalFlags.version,e.verbose=!!e.globalFlags.verbose,e}export{p as a,h as b};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{g as E,i as O,l as K,m as v}from"./chunk-F3ZWHWG3.js";import{createHash as Y}from"node:crypto";import{mkdirSync as L,readFileSync as W,readdirSync as Q,unlinkSync as X,writeFileSync as D}from"node:fs";import{dirname as q,extname as Z,resolve as R}from"node:path";function H(t){let e=t[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function U(t,e,o){let n=E(t,{port:e.port}),r=H(n.positional),u=O({...n,commandTimeoutMs:5e3});try{let s=!!(await K(u,"SootSim.bridges.settings.get"))?.[o.modeKey],p=r==="on"?!0:r==="off"?!1:!s;if(s===p)return console.log(` ${o.displayName}: already ${p?"on":"off"}`),{current:s,target:p,changed:!1};if(!await u.send({type:"evaluate",acquireLock:!0,code:`(async () => {
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{g as E,i as O,l as K,m as v}from"./chunk-JBLWPWDL.js";import{createHash as Y}from"node:crypto";import{mkdirSync as L,readFileSync as W,readdirSync as Q,unlinkSync as X,writeFileSync as D}from"node:fs";import{dirname as q,extname as Z,resolve as R}from"node:path";function H(t){let e=t[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function U(t,e,o){let n=E(t,{port:e.port}),r=H(n.positional),u=O({...n,commandTimeoutMs:5e3});try{let s=!!(await K(u,"SootSim.bridges.settings.get"))?.[o.modeKey],p=r==="on"?!0:r==="off"?!1:!s;if(s===p)return console.log(` ${o.displayName}: already ${p?"on":"off"}`),{current:s,target:p,changed:!1};if(!await u.send({type:"evaluate",acquireLock:!0,code:`(async () => {
3
3
  const modeKey = ${JSON.stringify(o.modeKey)}
4
4
  const target = ${JSON.stringify(p)}
5
5
  window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{readFileSync as i}from"node:fs";import{fileURLToPath as e}from"node:url";var r=null;function l(){if(r!=null)return r;let o=[()=>e(import.meta.resolve("sootsim/package.json")),()=>e(new URL("../package.json",import.meta.url))];for(let n of o)try{let t=JSON.parse(i(n(),"utf8")).version;if(typeof t=="string"&&t)return r=t,r}catch{}return r="0.0.0",r}export{l as a};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{G as N,H as U,I as A,k as $,l as C,u as T,x as V}from"./chunk-WENY5XO6.js";import F from"node:fs";import H from"node:path";function D(n){try{return F.readdirSync(n.runtimesDir(),{withFileTypes:!0}).filter(s=>s.isDirectory()).map(s=>s.name).sort(I)}catch{return[]}}function M(n,s){return H.posix.basename(n.tarballPath(s))}function I(n,s){let a=m=>{let d=m.indexOf("-"),p=d>=0?m.slice(0,d):m,x=d>=0?m.slice(d+1):"",b=p.split(".").map(e=>Number.parseInt(e,10));return b.some(e=>!Number.isFinite(e))?[[Number.POSITIVE_INFINITY],m]:[b,x]},[o,c]=a(n),[f,y]=a(s);for(let m=0;m<Math.max(o.length,f.length);m++){let d=o[m]??0,p=f[m]??0;if(d!==p)return d-p}return c===y?0:c?y?c<y?-1:1:-1:1}import{spawn as L}from"node:child_process";import G from"node:crypto";import u from"node:fs";import O from"node:path";import{Readable as z}from"node:stream";import{pipeline as W}from"node:stream/promises";function E(n){function s(){try{let e=JSON.parse(u.readFileSync(n.configFile(),"utf8"));return e&&typeof e=="object"?e:{}}catch{return{}}}function a(e){let t=s();return(e||process.env[n.env.cdnOrigin]||t.cdnOrigin||n.defaultCdnOrigin).replace(/\/+$/,"")}function o(e){let t=s();return e||process.env[n.env.channel]||t.runtimeChannel||"stable"}function c(){let e=process.env[n.env.pin];if(e&&e.trim())return e.trim();let t=s();return typeof t.runtimeVersion=="string"&&t.runtimeVersion.trim()?t.runtimeVersion.trim():null}function f(e){let t=new URL(`${a(e)}${n.manifestPath}`);return t.searchParams.set("t",String(Date.now())),t.toString()}function y(e,t){return`${a(t)}${n.tarballPath(e)}`}async function m(e){let t=f(e),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 d(e,t={}){let r=o(t.channel),i=t.version||c()||e.channels[r]?.latest;if(!i)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let g=e.versions[i];if(!g)throw new Error(`version ${i} not found in manifest; available: ${Object.keys(e.versions).slice(-10).join(", ")||"(none)"}`);return{version:i,channel:r,entry:g}}async function p(e={}){n.ensureHome();let t=a(e.cdnOrigin),r=await m(t),{version:i,channel:g,entry:l}=d(r,e),v=n.runtimeDir(i),h=e.setActive!==!1;if(!e.force&&u.existsSync(O.join(v,n.installedMarker)))return h&&n.writeActiveRuntime(i),{version:i,channel:g,cdnOrigin:t,runtimeDir:v,installed:!1,activated:h,manifest:r};let P=l.tarball||y(i,t),w=O.join(n.cacheDir(),M(n,i));process.stderr.write(`${n.id}: downloading runtime ${i}\u2026
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{G as N,H as U,I as A,k as $,l as C,u as T,x as V}from"./chunk-TPGYHYD6.js";import F from"node:fs";import H from"node:path";function D(n){try{return F.readdirSync(n.runtimesDir(),{withFileTypes:!0}).filter(s=>s.isDirectory()).map(s=>s.name).sort(I)}catch{return[]}}function M(n,s){return H.posix.basename(n.tarballPath(s))}function I(n,s){let a=m=>{let d=m.indexOf("-"),p=d>=0?m.slice(0,d):m,x=d>=0?m.slice(d+1):"",b=p.split(".").map(e=>Number.parseInt(e,10));return b.some(e=>!Number.isFinite(e))?[[Number.POSITIVE_INFINITY],m]:[b,x]},[o,c]=a(n),[f,y]=a(s);for(let m=0;m<Math.max(o.length,f.length);m++){let d=o[m]??0,p=f[m]??0;if(d!==p)return d-p}return c===y?0:c?y?c<y?-1:1:-1:1}import{spawn as L}from"node:child_process";import G from"node:crypto";import u from"node:fs";import O from"node:path";import{Readable as z}from"node:stream";import{pipeline as W}from"node:stream/promises";function E(n){function s(){try{let e=JSON.parse(u.readFileSync(n.configFile(),"utf8"));return e&&typeof e=="object"?e:{}}catch{return{}}}function a(e){let t=s();return(e||process.env[n.env.cdnOrigin]||t.cdnOrigin||n.defaultCdnOrigin).replace(/\/+$/,"")}function o(e){let t=s();return e||process.env[n.env.channel]||t.runtimeChannel||"stable"}function c(){let e=process.env[n.env.pin];if(e&&e.trim())return e.trim();let t=s();return typeof t.runtimeVersion=="string"&&t.runtimeVersion.trim()?t.runtimeVersion.trim():null}function f(e){let t=new URL(`${a(e)}${n.manifestPath}`);return t.searchParams.set("t",String(Date.now())),t.toString()}function y(e,t){return`${a(t)}${n.tarballPath(e)}`}async function m(e){let t=f(e),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 d(e,t={}){let r=o(t.channel),i=t.version||c()||e.channels[r]?.latest;if(!i)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let g=e.versions[i];if(!g)throw new Error(`version ${i} not found in manifest; available: ${Object.keys(e.versions).slice(-10).join(", ")||"(none)"}`);return{version:i,channel:r,entry:g}}async function p(e={}){n.ensureHome();let t=a(e.cdnOrigin),r=await m(t),{version:i,channel:g,entry:l}=d(r,e),v=n.runtimeDir(i),h=e.setActive!==!1;if(!e.force&&u.existsSync(O.join(v,n.installedMarker)))return h&&n.writeActiveRuntime(i),{version:i,channel:g,cdnOrigin:t,runtimeDir:v,installed:!1,activated:h,manifest:r};let P=l.tarball||y(i,t),w=O.join(n.cacheDir(),M(n,i));process.stderr.write(`${n.id}: downloading runtime ${i}\u2026
3
3
  `),await J(P,w),process.stderr.write(`${n.id}: extracting runtime ${i}\u2026
4
4
  `);let k=await Y(w);if(k!==l.sha256)throw u.rmSync(w,{force:!0}),new Error(`sha256 mismatch for runtime ${i}: expected ${l.sha256}, actual ${k}`);let R=O.join(O.dirname(v),`.installing-${i}-${process.pid}`);u.rmSync(R,{recursive:!0,force:!0}),u.mkdirSync(R,{recursive:!0});try{if(await q(w,R),!u.existsSync(O.join(R,n.installedMarker)))throw new Error(`extracted tarball for runtime ${i} is missing ${n.installedMarker}`);u.rmSync(v,{recursive:!0,force:!0}),u.renameSync(R,v)}catch(S){throw u.rmSync(R,{recursive:!0,force:!0}),S}return h&&n.writeActiveRuntime(i),{version:i,channel:g,cdnOrigin:t,runtimeDir:v,installed:!0,activated:h,manifest:r}}async function x(e={}){n.ensureHome();let t=a(e.cdnOrigin),r=o(e.channel),i=c();if(i){let S=n.readActiveRuntime(),_=u.existsSync(O.join(n.runtimeDir(i),n.installedMarker));if(S===i&&_)return{checked:!0,updated:!1,reason:`runtime is pinned to ${i}`,activeVersion:S,latestVersion:i};let j=await p({version:i,channel:r,cdnOrigin:t,setActive:!1});return{checked:!0,updated:!0,reason:`runtime is pinned to ${i}`,activeVersion:i,latestVersion:i,install:j}}let g=await m(t),l=g.channels[r]?.latest;if(!l)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:n.readActiveRuntime()};if(!g.versions[l])return{checked:!0,updated:!1,reason:`manifest is missing version ${l}`,activeVersion:n.readActiveRuntime(),latestVersion:l};let h=n.readActiveRuntime(),P=h?n.runtimeDir(h):null,w=P?u.existsSync(O.join(P,n.installedMarker)):!1;if(!(!h||!w||I(l,h)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:h,latestVersion:l};let R=await p({version:l,channel:r,cdnOrigin:t,setActive:!1});return{checked:!0,updated:!0,activeVersion:l,latestVersion:l,install:R}}async function b(e={}){let t=n.readActiveRuntime(),r=c();if(r)return{active:t,latest:r,pinned:r,outdated:t!==r};try{let i=await m(a(e.cdnOrigin)),g=o(e.channel),l=i.channels[g]?.latest??null,v=!!(l&&(!t||I(l,t)>0));return{active:t,latest:l,pinned:null,outdated:v}}catch{return{active:t,latest:null,pinned:null,outdated:!1}}}return{product:n,resolveCdnOrigin:a,resolveChannel:o,resolvePin:c,manifestUrl:f,tarballUrl:y,fetchManifest:m,resolveVersion:d,install:p,updateToLatest:x,checkUpToDate:b,listInstalled:()=>D(n)}}async function J(n,s){let a=await fetch(n);if(!a.ok||!a.body)throw new Error(`download failed: ${a.status} ${a.statusText} (${n})`);u.mkdirSync(O.dirname(s),{recursive:!0});let o=`${s}.partial`;try{await W(z.fromWeb(a.body),u.createWriteStream(o)),u.renameSync(o,s)}catch(c){try{u.unlinkSync(o)}catch{}throw c}}function Y(n){return new Promise((s,a)=>{let o=G.createHash("sha256"),c=u.createReadStream(n);c.on("data",f=>o.update(f)),c.on("error",a),c.on("end",()=>s(o.digest("hex")))})}function q(n,s){return new Promise((a,o)=>{let c=L("tar",["-xzf",n,"-C",s],{stdio:["ignore","inherit","inherit"]});c.on("error",o),c.on("exit",f=>{f===0?a():o(new Error(`tar exited with code ${f}`))})})}var B="https://contrast.dev",fn="https://sootsim.com/changelog",K={id:"sootsim",defaultCdnOrigin:B,manifestPath:"/runtimes/manifest.json",tarballPath:n=>`/runtimes/sootsim-runtime-${n}.tar.gz`,installedMarker:"index.html",env:{cdnOrigin:"SOOTSIM_CDN_ORIGIN",channel:"SOOTSIM_RUNTIME_CHANNEL",pin:"SOOTSIM_RUNTIME_VERSION"},ensureHome:N,configFile:V,runtimesDir:$,runtimeDir:C,cacheDir:T,readActiveRuntime:U,writeActiveRuntime:A},dn=E(K);export{I as a,B as b,fn as c,dn as d};
@@ -0,0 +1 @@
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{H as t,L as n,N as l,j as r}from"./chunk-WENY5XO6.js";function m(){let e=t(),i=r()?n():null;return i&&l(i)?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{m as a};
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{H as t,L as n,N as l,j as r}from"./chunk-TPGYHYD6.js";function m(){let e=t(),i=r()?n():null;return i&&l(i)?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{m as a};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.255 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.257 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  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};