sootsim 0.1.310 → 0.1.311

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 (151) hide show
  1. package/dist-cli/bin.js +5 -5
  2. package/dist-cli/chunks/{agent-CPD4GIXP.js → agent-KOPVOZ7G.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-JZTNUUZE.js → agent-wrapper-KVAIIK7K.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-CFIBFEVF.js → app-fonts-5ZX2IRBS.js} +2 -2
  5. package/dist-cli/chunks/{assert-C5WAWJ6I.js → assert-NRKM4ZIK.js} +2 -2
  6. package/dist-cli/chunks/{auth-UY7RPLPH.js → auth-MSLDV5HR.js} +2 -2
  7. package/dist-cli/chunks/{beta-NM7T7MDN.js → beta-L5QKFHWI.js} +2 -2
  8. package/dist-cli/chunks/{camera-4YUYYYJI.js → camera-5JUNQPSI.js} +2 -2
  9. package/dist-cli/chunks/{chunk-RYPPRVBM.js → chunk-3Y6476ZM.js} +2 -2
  10. package/dist-cli/chunks/{chunk-GQVBLBUJ.js → chunk-5V5MOREL.js} +2 -2
  11. package/dist-cli/chunks/{chunk-FT2XATWO.js → chunk-6JYTKF5O.js} +1 -1
  12. package/dist-cli/chunks/{chunk-LKAAQBT6.js → chunk-6QZY6YO2.js} +1 -1
  13. package/dist-cli/chunks/{chunk-TAQV44LZ.js → chunk-6SICKWPQ.js} +3 -3
  14. package/dist-cli/chunks/{chunk-Z6H5FR3U.js → chunk-75KNNHMR.js} +2 -2
  15. package/dist-cli/chunks/{chunk-YRRUK3EK.js → chunk-75YOUNTE.js} +1 -1
  16. package/dist-cli/chunks/chunk-7PHOEBKV.js +4 -0
  17. package/dist-cli/chunks/{chunk-S7WXPIOY.js → chunk-7W63IKAP.js} +2 -2
  18. package/dist-cli/chunks/chunk-CJKSD5BZ.js +5 -0
  19. package/dist-cli/chunks/{chunk-SY7E43UY.js → chunk-CKMQ2YXQ.js} +3 -3
  20. package/dist-cli/chunks/{chunk-QPZVGHRV.js → chunk-CUVLXG63.js} +1 -1
  21. package/dist-cli/chunks/{chunk-7RJEULWN.js → chunk-EHBHUE6S.js} +2 -2
  22. package/dist-cli/chunks/{chunk-NLTJE335.js → chunk-F2WH6XM7.js} +2 -2
  23. package/dist-cli/chunks/{chunk-63JWRDM6.js → chunk-GEUU2WIL.js} +2 -2
  24. package/dist-cli/chunks/{chunk-ZNK3ZAA5.js → chunk-GFKP5JIA.js} +2 -2
  25. package/dist-cli/chunks/{chunk-6UXXOG6P.js → chunk-GLECQIGB.js} +2 -2
  26. package/dist-cli/chunks/{chunk-3S7UEXZW.js → chunk-HI5MWY32.js} +1 -1
  27. package/dist-cli/chunks/{chunk-GH2OE6F6.js → chunk-J6ZKDIRN.js} +2 -2
  28. package/dist-cli/chunks/{chunk-PJKCYUT3.js → chunk-JGFIT5X5.js} +2 -2
  29. package/dist-cli/chunks/{chunk-3EO5JEG7.js → chunk-KGIXNUUM.js} +2 -2
  30. package/dist-cli/chunks/{chunk-BFNAFH27.js → chunk-KKXSWEYS.js} +1 -1
  31. package/dist-cli/chunks/{chunk-EPMLSKSB.js → chunk-NBNEISXX.js} +2 -2
  32. package/dist-cli/chunks/{chunk-EWRPLFYI.js → chunk-P7MI3VFY.js} +1 -1
  33. package/dist-cli/chunks/{chunk-YIJFCR5T.js → chunk-PHFRI2QF.js} +1 -1
  34. package/dist-cli/chunks/{chunk-RMIKUUCO.js → chunk-PJ27D3WO.js} +1 -1
  35. package/dist-cli/chunks/{chunk-MUQDPJUP.js → chunk-QCEMDWL4.js} +1 -1
  36. package/dist-cli/chunks/{chunk-2TRPGEZE.js → chunk-QILKSUH6.js} +2 -2
  37. package/dist-cli/chunks/{chunk-WWIQEYHT.js → chunk-QMHUIADD.js} +1 -1
  38. package/dist-cli/chunks/{chunk-66Z2ADUQ.js → chunk-QUAY5AZB.js} +2 -2
  39. package/dist-cli/chunks/{chunk-C3GMSIRT.js → chunk-RATCQLQA.js} +2 -2
  40. package/dist-cli/chunks/{chunk-C3O6UUPY.js → chunk-RHGVZJIY.js} +3 -3
  41. package/dist-cli/chunks/{chunk-BMIIHY6K.js → chunk-RIT4KI4Y.js} +3 -3
  42. package/dist-cli/chunks/{chunk-4XMPRQGE.js → chunk-S5U22PVL.js} +1 -1
  43. package/dist-cli/chunks/{chunk-XBBNRESY.js → chunk-SKGITCWL.js} +1 -1
  44. package/dist-cli/chunks/{chunk-RX4CFOVV.js → chunk-ULJT3HDO.js} +1 -1
  45. package/dist-cli/chunks/{chunk-XMOULANJ.js → chunk-VAFDFOE6.js} +2 -2
  46. package/dist-cli/chunks/{chunk-M2LP2VYQ.js → chunk-VJMY2MX6.js} +2 -2
  47. package/dist-cli/chunks/{chunk-IS5OOCN5.js → chunk-VNS6KYRJ.js} +1 -1
  48. package/dist-cli/chunks/{chunk-R7AS52NA.js → chunk-W4S7GGPG.js} +3 -3
  49. package/dist-cli/chunks/{chunk-YMD6WWI7.js → chunk-WIYIQQQS.js} +2 -2
  50. package/dist-cli/chunks/{chunk-VAGUPECL.js → chunk-WTNKX7QD.js} +2 -2
  51. package/dist-cli/chunks/{chunk-STWCCIBA.js → chunk-Y5O5GK2Q.js} +11 -11
  52. package/dist-cli/chunks/{chunk-YZPSUNTO.js → chunk-Y7RQGSZD.js} +2 -2
  53. package/dist-cli/chunks/{chunk-XKAXZ4DS.js → chunk-YOIHAHR5.js} +1 -1
  54. package/dist-cli/chunks/{chunk-ZS7OXPHR.js → chunk-YS7YDOGW.js} +1 -1
  55. package/dist-cli/chunks/{chunk-CORSX7M5.js → chunk-YTP5VCDL.js} +1 -1
  56. package/dist-cli/chunks/{chunk-2KSLGBIU.js → chunk-ZB3UAYJ4.js} +2 -2
  57. package/dist-cli/chunks/{chunk-EPZUFQMX.js → chunk-ZDQO6TJQ.js} +2 -2
  58. package/dist-cli/chunks/{chunk-C4O4VRN5.js → chunk-ZHPLBK34.js} +2 -2
  59. package/dist-cli/chunks/{cleanup-2ZM4QSDV.js → cleanup-436GW67Y.js} +2 -2
  60. package/dist-cli/chunks/{cli-version-WXOEWZDA.js → cli-version-BY3A3SBN.js} +2 -2
  61. package/dist-cli/chunks/{compat-MGY3FZSI.js → compat-DDJSQ3WI.js} +2 -2
  62. package/dist-cli/chunks/{config-3W5VNME6.js → config-XFLK4XZN.js} +2 -2
  63. package/dist-cli/chunks/{control-7LNRM2BK.js → control-W6KUVHYU.js} +2 -2
  64. package/dist-cli/chunks/daemon-E5MGIR55.js +4 -0
  65. package/dist-cli/chunks/{debug-4CMFC2CO.js → debug-PHSYXSNH.js} +3 -3
  66. package/dist-cli/chunks/{desktop-Q6CZSS4R.js → desktop-6V5ALYCZ.js} +3 -3
  67. package/dist-cli/chunks/{detox-2AF4MXXN.js → detox-SA27XGTO.js} +2 -2
  68. package/dist-cli/chunks/{device-E2WCI2N2.js → device-XURVFXBT.js} +2 -2
  69. package/dist-cli/chunks/{diagnose-CZGCKNVY.js → diagnose-HMUQWQOK.js} +2 -2
  70. package/dist-cli/chunks/disk-cleanup-KYAFCV6S.js +4 -0
  71. package/dist-cli/chunks/drivers-INII4IWR.js +4 -0
  72. package/dist-cli/chunks/{film-UDSAJZXL.js → film-3UM6EUYF.js} +3 -3
  73. package/dist-cli/chunks/flow-RP4UVYUA.js +4 -0
  74. package/dist-cli/chunks/help-STHBZD6I.js +4 -0
  75. package/dist-cli/chunks/{hidden-runtime-alias-CHAB56GM.js → hidden-runtime-alias-DVVAGM4I.js} +2 -2
  76. package/dist-cli/chunks/{home-paths-WFCI5ORX.js → home-paths-LVGGR4AJ.js} +2 -2
  77. package/dist-cli/chunks/inspect-5W52ZHKD.js +4 -0
  78. package/dist-cli/chunks/install-desktop-H4HLLT7K.js +4 -0
  79. package/dist-cli/chunks/{login-57UP2EKB.js → login-2QTBTTGJ.js} +4 -4
  80. package/dist-cli/chunks/{logout-UYNCJTOC.js → logout-PUBLDHVY.js} +2 -2
  81. package/dist-cli/chunks/{maestro-QMAPXPZ7.js → maestro-2UJ27MKD.js} +3 -3
  82. package/dist-cli/chunks/{maestro-generate-N2BJXJDH.js → maestro-generate-P4MDFYMV.js} +3 -3
  83. package/dist-cli/chunks/{mode-SY5G7WQD.js → mode-RRHPX23W.js} +2 -2
  84. package/dist-cli/chunks/{optional-demo-registry-DH3L6FFX.js → optional-demo-registry-5IRF7M7Z.js} +2 -2
  85. package/dist-cli/chunks/{perf-NZ6VEDLA.js → perf-BOLWOAKV.js} +2 -2
  86. package/dist-cli/chunks/{permissions-EMH2K5LX.js → permissions-ZIOTIBPV.js} +2 -2
  87. package/dist-cli/chunks/{record-44PMWGYY.js → record-DU2IKPFK.js} +3 -3
  88. package/dist-cli/chunks/{report-issue-PLGMRWXG.js → report-issue-4CQDUWT2.js} +2 -2
  89. package/dist-cli/chunks/runtime-QWPQ3M7H.js +4 -0
  90. package/dist-cli/chunks/{screenshot-command-GJT5XS7P.js → screenshot-command-XEN26NJV.js} +3 -3
  91. package/dist-cli/chunks/{screenshot-layers-4JSTS5VY.js → screenshot-layers-CRCQ4CEF.js} +2 -2
  92. package/dist-cli/chunks/{screenshots-capture-AQQISSQD.js → screenshots-capture-XGQFYINL.js} +2 -2
  93. package/dist-cli/chunks/{serve-TJMO4KGX.js → serve-UBSRDYA3.js} +2 -2
  94. package/dist-cli/chunks/{setup-7ZSYCUX6.js → setup-AKYIOBVO.js} +2 -2
  95. package/dist-cli/chunks/{skills-GRQPAAD5.js → skills-V5WV4LWH.js} +2 -2
  96. package/dist-cli/chunks/{storage-GWRZNBAU.js → storage-3PJPIHNM.js} +2 -2
  97. package/dist-cli/chunks/store-A27JYIGF.js +4 -0
  98. package/dist-cli/chunks/telemetry-LLD24AVX.js +4 -0
  99. package/dist-cli/chunks/{timeline-2FXM7HEU.js → timeline-OHQNHG52.js} +2 -2
  100. package/dist-cli/chunks/{upgrade-AV7UOK2X.js → upgrade-Q2TYYVIX.js} +2 -2
  101. package/dist-cli/chunks/upload-57FIDO2B.js +4 -0
  102. package/dist-cli/chunks/{version-C72O2LMS.js → version-SW6VCJVI.js} +2 -2
  103. package/dist-cli/chunks/{web-4V3YGWNC.js → web-BXVM3HJ3.js} +2 -2
  104. package/dist-cli/chunks/{what-happened-RGD2DOQI.js → what-happened-H62ASSI5.js} +2 -2
  105. package/dist-lib/agent-daemon-client.cjs +1 -1
  106. package/dist-lib/agent-events.cjs +1 -1
  107. package/dist-lib/agent-identity.cjs +1 -1
  108. package/dist-lib/agent-sessions.cjs +1 -1
  109. package/dist-lib/attached-projects.cjs +1 -1
  110. package/dist-lib/auth/shared-session.cjs +1 -1
  111. package/dist-lib/backend-origin.cjs +1 -1
  112. package/dist-lib/beta.cjs +1 -1
  113. package/dist-lib/beta.mjs +1 -1
  114. package/dist-lib/bridge-constants.cjs +1 -1
  115. package/dist-lib/cli-constants.cjs +1 -1
  116. package/dist-lib/config.cjs +1 -1
  117. package/dist-lib/detox/index.cjs +20 -16
  118. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  119. package/dist-lib/home-paths.cjs +1 -1
  120. package/dist-lib/host/bridge-host.cjs +164 -102
  121. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  122. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  123. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  124. package/dist-lib/host/websocket-proxy.cjs +1 -1
  125. package/dist-lib/index.cjs +1 -1
  126. package/dist-lib/jump-to-source-babel.cjs +1 -1
  127. package/dist-lib/menu.cjs +1 -1
  128. package/dist-lib/menu.mjs +1 -1
  129. package/dist-lib/metro.cjs +1 -1
  130. package/dist-lib/profiles.cjs +1 -1
  131. package/dist-lib/render-mode.cjs +1 -1
  132. package/dist-lib/scripts/dev-server-scanner.cjs +43 -23
  133. package/dist-lib/sdk.cjs +1 -1
  134. package/dist-lib/sdk.mjs +1 -1
  135. package/dist-lib/skills.cjs +277 -206
  136. package/dist-lib/vite.cjs +1 -1
  137. package/package.json +1 -1
  138. package/scripts/dev-server-scanner.ts +34 -8
  139. package/dist-cli/chunks/chunk-63EKEKDF.js +0 -4
  140. package/dist-cli/chunks/chunk-OQO3HU4Y.js +0 -5
  141. package/dist-cli/chunks/daemon-ZNCVHOWJ.js +0 -4
  142. package/dist-cli/chunks/disk-cleanup-4T6MDZBA.js +0 -4
  143. package/dist-cli/chunks/drivers-NEB27ZKQ.js +0 -4
  144. package/dist-cli/chunks/flow-GXXVEHEW.js +0 -4
  145. package/dist-cli/chunks/help-3RVUJUAN.js +0 -4
  146. package/dist-cli/chunks/inspect-4H4VNQJ4.js +0 -4
  147. package/dist-cli/chunks/install-desktop-RGCBPM4J.js +0 -4
  148. package/dist-cli/chunks/runtime-CUSKTS2J.js +0 -4
  149. package/dist-cli/chunks/store-MLODFZBM.js +0 -4
  150. package/dist-cli/chunks/telemetry-XL3UDJSE.js +0 -4
  151. package/dist-cli/chunks/upload-6DXF4DAQ.js +0 -4
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{h,j as w,m as l,n as u}from"./chunk-7RJEULWN.js";import"./chunk-NLTJE335.js";import"./chunk-IS5OOCN5.js";import"./chunk-XBBNRESY.js";import"./chunk-XKAXZ4DS.js";var A=["not-determined","restricted","denied","authorized","limited","provisional","ephemeral","unavailable"],E=["app-tracking-transparency","bluetooth","calendars","camera","contacts","face-id","local-network","location-always","location-when-in-use","media-library","microphone","motion","notifications","photo-library","photo-library-add-only","reminders","siri","speech-recognition"];function b(){console.log(`
4
+ import{h,j as w,m as l,n as u}from"./chunk-EHBHUE6S.js";import"./chunk-F2WH6XM7.js";import"./chunk-VNS6KYRJ.js";import"./chunk-SKGITCWL.js";import"./chunk-YOIHAHR5.js";var A=["not-determined","restricted","denied","authorized","limited","provisional","ephemeral","unavailable"],E=["app-tracking-transparency","bluetooth","calendars","camera","contacts","face-id","local-network","location-always","location-when-in-use","media-library","microphone","motion","notifications","photo-library","photo-library-add-only","reminders","siri","speech-recognition"];function b(){console.log(`
5
5
  sootsim permissions \u2014 inspect and change simulated operating-system permissions
6
6
 
7
7
  usage:
@@ -1,12 +1,12 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as W}from"./chunk-6UXXOG6P.js";import{a as oe}from"./chunk-GQVBLBUJ.js";import{a as Z,c as ee}from"./chunk-C4O4VRN5.js";import{d as Y}from"./chunk-VAGUPECL.js";import"./chunk-STWCCIBA.js";import"./chunk-BFNAFH27.js";import"./chunk-YIJFCR5T.js";import{h as b,j as v,k as Q}from"./chunk-7RJEULWN.js";import"./chunk-C3GMSIRT.js";import"./chunk-2KSLGBIU.js";import{f as X}from"./chunk-NLTJE335.js";import"./chunk-IS5OOCN5.js";import"./chunk-XBBNRESY.js";import"./chunk-XKAXZ4DS.js";import{existsSync as he,mkdirSync as B,readdirSync as be,readFileSync as ve,rmSync as q,writeFileSync as C}from"fs";import{homedir as ye,tmpdir as Se}from"os";import{dirname as z,extname as re,join as A,resolve as $e}from"path";var J=24e4,Re=9e4,xe=3e4;async function D(e,r,o,i){let t=Math.max(2e4,i+xe);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
4
+ import{a as W}from"./chunk-GLECQIGB.js";import{a as oe}from"./chunk-5V5MOREL.js";import{a as Z,c as ee}from"./chunk-ZHPLBK34.js";import{d as Y}from"./chunk-WTNKX7QD.js";import"./chunk-Y5O5GK2Q.js";import"./chunk-KKXSWEYS.js";import"./chunk-PHFRI2QF.js";import{h as b,j as v,k as Q}from"./chunk-EHBHUE6S.js";import"./chunk-RATCQLQA.js";import"./chunk-ZB3UAYJ4.js";import{f as X}from"./chunk-F2WH6XM7.js";import"./chunk-VNS6KYRJ.js";import"./chunk-SKGITCWL.js";import"./chunk-YOIHAHR5.js";import{existsSync as he,mkdirSync as B,readdirSync as be,readFileSync as ve,rmSync as q,writeFileSync as C}from"fs";import{homedir as ye,tmpdir as Se}from"os";import{dirname as z,extname as re,join as A,resolve as $e}from"path";var J=24e4,Re=9e4,xe=3e4;async function D(e,r,o,i){let t=Math.max(2e4,i+xe);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
5
5
  the capture lock auto-releases, so simply retry the recording.
6
6
  if it persists, recover the sim with \`sootsim close --sim <id>\`.`),process.exit(1)),/render host not available|already streaming|already recording|lock already held/i.test(s)&&(console.error(` ${o} failed: ${s}
7
7
  a prior recording was abandoned and its capture is still
8
8
  releasing. the lock self-heals in ~${Math.round((i+2e4)/1e3)}s \u2014 retry then, or recover now with
9
- \`sootsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var _e=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),ke=new Set(["start","stop","cancel","status","prelude-start","upload"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){_e.has(o)&&r++;continue}return ke.has(o)?{name:o,index:r}:null}return null}function te(e){let r=l(e,"--owner")?.trim(),o=l(e,"--repo")?.trim();return(r&&!o||!r&&o)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),r&&o?{owner:r,repo:o}:null}async function He(e,r){let o=Oe(e);if(o){let d=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Ie(d,r);return}if(o.name==="prelude-start"){await Ce(d,r);return}if(o.name==="upload"){let{runUpload:y}=await import("./upload-6DXF4DAQ.js");await y(d,r);return}if(o.name==="stop"){await Pe(d,r);return}if(o.name==="cancel"){await Ne(d,r);return}await Fe(d,r);return}let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open","--lockstep"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=se(l(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=l(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let c=l(e,"--output"),a=Number(l(e,"--duration")??"10");(!Number.isFinite(a)||a<=0)&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let u=600;a>u&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 exceeds the ${u}s (10m) maximum`),process.exit(1));let m=Number(l(e,"--fps")??"30"),p=l(e,"--frames");if(p!==void 0){let d=Number(p);(!Number.isInteger(d)||d<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let x=e.includes("--open"),k=l(e,"--max-width")?Number(l(e,"--max-width")):void 0;e.includes("--lockstep")&&(console.error(" --lockstep works with `record start` / `record stop` (stateful mode) \u2014 atomic --duration is wall-clock and cannot bound a virtual-time capture"),process.exit(1));let g=Math.max(100,Math.round(a*1e3)),K=l(e,"--origin"),fe=te(e);if(t==="live"||t==="combined"){c&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await W("record",{originOverride:K,allowGitHubAuth:!0});let d=v({...i,commandTimeoutMs:6e4});try{await H(d),await de(d,t),t==="combined"&&await M(d),await ce(d,K,fe);let y=await le(d,t,t==="combined"?n:void 0);y.ok||(console.error(` start failed: recording store refused to start (${t})`+(y.error?`: ${y.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(_=>setTimeout(_,g)),await ue(d);let O=await me(d);pe(O,x,t)}finally{d.close()}return}let F=p?Number(p):null,$=Me(s,c,F);x&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let h=v({...i,commandTimeoutMs:6e4});try{if(await ne(h),await M(h),$==="png"){let R=F??10,w=I(c,`sootsim-frames-${T()}`);c&&re(c)&&console.log(` note: --frames writes multiple pngs, so --output "${c}" is a directory \u2014 frame-NNN.png files land inside it`),B(w,{recursive:!0});for(let f of be(w))/^frame-\d+\.png$/.test(f)&&q(A(w,f),{force:!0});console.log(` sampling ${R} frames over ${a}s \u2192 ${w}`);let S=await h.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${R}, durationMs: ${g}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!S.ok||!S.requestId)&&(console.error(` frame capture start failed: ${S.error??"unknown error"}`),process.exit(1)),await new Promise(f=>setTimeout(f,g));let ge=Date.now()+Math.max(5e3,g),N=null;for(;;){let f=await h.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${S.requestId})`});if(f||(console.error(" frame capture result missing"),process.exit(1)),f.done){f.ok||(console.error(` frame capture failed: ${f.error??"unknown error"}`),process.exit(1)),N=f.frames??[];break}Date.now()>=ge&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(P=>setTimeout(P,100))}N.forEach((f,P)=>{let we=`${w}/frame-${String(P+1).padStart(3,"0")}.png`;C(we,Buffer.from(f.data,"base64"))}),console.log(` saved ${N.length} frames`);return}if($==="gif"){let R=F??Math.max(10,Math.round(a*m/3)),w=I(c,`sootsim-${T()}.gif`);B(z(w),{recursive:!0}),console.log(` encoding gif: ${R} frames over ${a}s \u2192 ${w}`);let S=await D(h,`window.__sootsimRecorder.captureGif({ frames: ${R}, durationMs: ${g}${k?`, maxWidth: ${k}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",g);S||(console.error(" gif capture returned no frames"),process.exit(1)),C(w,Buffer.from(S.data,"base64")),console.log(` saved: ${w} (${L(S.size)})`);return}let d=I(c,`sootsim-${T()}.${$}`);B(z(d),{recursive:!0});let y={format:$,fps:m,durationMs:g};n&&(y.layers=n);let O=await D(h,`window.__sootsimRecorder.start(${JSON.stringify(y)})`,`${$} start`,g);O.ok||(console.error(` start failed: ${O.error??"unknown error"}`),/render host not available|already streaming|already recording|lock already held/i.test(O.error??"")&&console.error(" a prior recording was abandoned and its capture is still\n releasing. retry in ~20s, or recover now with\n `sootsim close --sim <id>` then reopen the sim."),process.exit(1)),console.log(` recording ${$} for ${a}s \u2192 ${d}`),await new Promise(R=>setTimeout(R,g));let _=await D(h,"window.__sootsimRecorder.stop()",`${$} encode/flush`,g);_.ok||(console.error(` stop failed: ${_.error??"unknown error"}`),process.exit(1)),_.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await ie(h,d),console.log(` saved: ${d} (${L(_.size)})`)}finally{h.close()}}var Ee=6e3;async function V(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:Ee})}catch(o){let i=o instanceof Error?o.message:String(o);throw/^command timed out after \d+s$/.test(i)&&(console.error(" sim did not respond \u2014 it is connected to the bridge but has not\n loaded an app (or its page is unresponsive). run `sootsim list`\n and target a sim with a loaded app via --sim <id>."),process.exit(1)),o}}async function ne(e){await V(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function M(e){let{hidden:r}=await Q(e);r&&(console.error(` refusing to record: the sootsim tab is hidden, so frame capture
9
+ \`sootsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var _e=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),ke=new Set(["start","stop","cancel","status","prelude-start","upload"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){_e.has(o)&&r++;continue}return ke.has(o)?{name:o,index:r}:null}return null}function te(e){let r=l(e,"--owner")?.trim(),o=l(e,"--repo")?.trim();return(r&&!o||!r&&o)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),r&&o?{owner:r,repo:o}:null}async function He(e,r){let o=Oe(e);if(o){let d=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Ie(d,r);return}if(o.name==="prelude-start"){await Ce(d,r);return}if(o.name==="upload"){let{runUpload:y}=await import("./upload-57FIDO2B.js");await y(d,r);return}if(o.name==="stop"){await Pe(d,r);return}if(o.name==="cancel"){await Ne(d,r);return}await Fe(d,r);return}let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open","--lockstep"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=se(l(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=l(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let c=l(e,"--output"),a=Number(l(e,"--duration")??"10");(!Number.isFinite(a)||a<=0)&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let u=600;a>u&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 exceeds the ${u}s (10m) maximum`),process.exit(1));let m=Number(l(e,"--fps")??"30"),p=l(e,"--frames");if(p!==void 0){let d=Number(p);(!Number.isInteger(d)||d<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let x=e.includes("--open"),k=l(e,"--max-width")?Number(l(e,"--max-width")):void 0;e.includes("--lockstep")&&(console.error(" --lockstep works with `record start` / `record stop` (stateful mode) \u2014 atomic --duration is wall-clock and cannot bound a virtual-time capture"),process.exit(1));let g=Math.max(100,Math.round(a*1e3)),K=l(e,"--origin"),fe=te(e);if(t==="live"||t==="combined"){c&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await W("record",{originOverride:K,allowGitHubAuth:!0});let d=v({...i,commandTimeoutMs:6e4});try{await H(d),await de(d,t),t==="combined"&&await M(d),await ce(d,K,fe);let y=await le(d,t,t==="combined"?n:void 0);y.ok||(console.error(` start failed: recording store refused to start (${t})`+(y.error?`: ${y.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(_=>setTimeout(_,g)),await ue(d);let O=await me(d);pe(O,x,t)}finally{d.close()}return}let F=p?Number(p):null,$=Me(s,c,F);x&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let h=v({...i,commandTimeoutMs:6e4});try{if(await ne(h),await M(h),$==="png"){let R=F??10,w=I(c,`sootsim-frames-${T()}`);c&&re(c)&&console.log(` note: --frames writes multiple pngs, so --output "${c}" is a directory \u2014 frame-NNN.png files land inside it`),B(w,{recursive:!0});for(let f of be(w))/^frame-\d+\.png$/.test(f)&&q(A(w,f),{force:!0});console.log(` sampling ${R} frames over ${a}s \u2192 ${w}`);let S=await h.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${R}, durationMs: ${g}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!S.ok||!S.requestId)&&(console.error(` frame capture start failed: ${S.error??"unknown error"}`),process.exit(1)),await new Promise(f=>setTimeout(f,g));let ge=Date.now()+Math.max(5e3,g),N=null;for(;;){let f=await h.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${S.requestId})`});if(f||(console.error(" frame capture result missing"),process.exit(1)),f.done){f.ok||(console.error(` frame capture failed: ${f.error??"unknown error"}`),process.exit(1)),N=f.frames??[];break}Date.now()>=ge&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(P=>setTimeout(P,100))}N.forEach((f,P)=>{let we=`${w}/frame-${String(P+1).padStart(3,"0")}.png`;C(we,Buffer.from(f.data,"base64"))}),console.log(` saved ${N.length} frames`);return}if($==="gif"){let R=F??Math.max(10,Math.round(a*m/3)),w=I(c,`sootsim-${T()}.gif`);B(z(w),{recursive:!0}),console.log(` encoding gif: ${R} frames over ${a}s \u2192 ${w}`);let S=await D(h,`window.__sootsimRecorder.captureGif({ frames: ${R}, durationMs: ${g}${k?`, maxWidth: ${k}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",g);S||(console.error(" gif capture returned no frames"),process.exit(1)),C(w,Buffer.from(S.data,"base64")),console.log(` saved: ${w} (${L(S.size)})`);return}let d=I(c,`sootsim-${T()}.${$}`);B(z(d),{recursive:!0});let y={format:$,fps:m,durationMs:g};n&&(y.layers=n);let O=await D(h,`window.__sootsimRecorder.start(${JSON.stringify(y)})`,`${$} start`,g);O.ok||(console.error(` start failed: ${O.error??"unknown error"}`),/render host not available|already streaming|already recording|lock already held/i.test(O.error??"")&&console.error(" a prior recording was abandoned and its capture is still\n releasing. retry in ~20s, or recover now with\n `sootsim close --sim <id>` then reopen the sim."),process.exit(1)),console.log(` recording ${$} for ${a}s \u2192 ${d}`),await new Promise(R=>setTimeout(R,g));let _=await D(h,"window.__sootsimRecorder.stop()",`${$} encode/flush`,g);_.ok||(console.error(` stop failed: ${_.error??"unknown error"}`),process.exit(1)),_.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await ie(h,d),console.log(` saved: ${d} (${L(_.size)})`)}finally{h.close()}}var Ee=6e3;async function V(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:Ee})}catch(o){let i=o instanceof Error?o.message:String(o);throw/^command timed out after \d+s$/.test(i)&&(console.error(" sim did not respond \u2014 it is connected to the bridge but has not\n loaded an app (or its page is unresponsive). run `sootsim list`\n and target a sim with a loaded app via --sim <id>."),process.exit(1)),o}}async function ne(e){await V(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function M(e){let{hidden:r}=await Q(e);r&&(console.error(` refusing to record: the sootsim tab is hidden, so frame capture
10
10
  would be throttled to ~1fps and produce a frozen-looking file.
11
11
  bring the chrome window to the foreground (un-minimize / switch to
12
12
  its tab) or run the recording in headless playwright, then retry.`),process.exit(1))}async function ie(e,r){let o=[],i=0;for(;;){let t=await e.send({type:"evaluate",code:`window.__sootsimRecorder.getBlobBase64({ offset: ${i}, chunk: 2097152 })`});if(!t)throw new Error("no blob available on recorder");if(o.push(Buffer.from(t.data,"base64")),i=t.offset,t.done)break}C(r,Buffer.concat(o))}function l(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function Be(e){if(!e)return;let r=re(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function Me(e,r,o){return e||(o!=null?"png":Be(r)??"webm")}function T(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function Ue(){let e=A(ye(),".sootsim","recordings");return B(e,{recursive:!0}),e}function I(e,r){return e?$e(process.cwd(),e):A(Ue(),r)}function L(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function se(e){if(!e)return"video";if(e==="video"||e==="live"||e==="combined")return e;console.error(` invalid --mode "${e}" \u2014 expected video | live | combined`),process.exit(1)}function G(){return A(Se(),`sootsim-recording-${X()}.json`)}function U(){let e=G();if(!he(e))return null;try{return{mode:"video",...JSON.parse(ve(e,"utf8"))}}catch{return q(e,{force:!0}),null}}function Te(e){C(G(),JSON.stringify(e,null,2))}function E(){q(G(),{force:!0})}function j(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as m,b as f}from"./chunk-C4O4VRN5.js";import{a as d}from"./chunk-FT2XATWO.js";import"./chunk-2KSLGBIU.js";import{H as p}from"./chunk-XBBNRESY.js";import{a as l}from"./chunk-3S7UEXZW.js";import"./chunk-XKAXZ4DS.js";import{existsSync as h,readFileSync as w}from"node:fs";import{resolve as b}from"node:path";var R="https://contrast.dev",g=8e3;function v(){return{request:(t,e)=>fetch(t,e),confirmSubmission:d,isInteractive:process.stdin.isTTY===!0,now:()=>new Date,stdout:t=>process.stdout.write(t),stderr:t=>process.stderr.write(t)}}function S(t,e){let n=t.indexOf(e);if(n===-1)return null;let r=t[n+1];if(!r||r.startsWith("-"))throw new Error(`${e} requires a value`);return r}function I(t,e=process.cwd()){let n=S(t,"--app"),r=new Set,s=t.indexOf("--app");s!==-1&&(r.add(s),r.add(s+1));let a=[];for(let c=0;c<t.length;c+=1){if(r.has(c))continue;let u=t[c];if(!(u==="--yes"||u==="-y"||u==="--dry-run")){if(u.startsWith("-"))throw new Error(`unknown flag: ${u}`);a.push(u)}}let i=a.join(" ").trim();if(!i)throw new Error("describe the missing or broken compatibility behavior");if(i.length>g)throw new Error(`description is too long (maximum ${g} characters)`);return{appDir:b(e,n??"."),description:i,dryRun:t.includes("--dry-run"),yes:t.includes("--yes")||t.includes("-y")}}function y(t){if(!t||typeof t!="object")return;let e={};for(let n of Object.keys(t)){let r=Object.getOwnPropertyDescriptor(t,n)?.value;typeof r=="string"&&(e[n]=r)}return e}function D(t){let e=b(t,"package.json");if(!h(e))return null;let n;try{n=JSON.parse(w(e,"utf8"))}catch{throw new Error(`could not parse ${e}`)}if(!n||typeof n!="object")throw new Error(`${e} must contain a JSON object`);let r=Object.getOwnPropertyDescriptor(n,"name")?.value,s=Object.getOwnPropertyDescriptor(n,"dependencies")?.value,a=Object.getOwnPropertyDescriptor(n,"devDependencies")?.value,i=y(s),c=y(a);return{...typeof r=="string"?{name:r}:{},...i?{dependencies:i}:{},...c?{devDependencies:c}:{}}}async function O(t,e=new Date){let n=D(t.appDir),r=n?(await import("./web-4V3YGWNC.js")).scanDeps(n):null,s=l(),a=p();return{note:t.description,timestamp:e.toISOString(),sootsim_version:a,cli_version:s,bundle:{activeApp:r&&r.projectName!=="unknown"?{appName:r.projectName}:null,reportSource:"cli",runtimeVersion:a,cliVersion:s,platform:process.platform,arch:process.arch,compatibility:r}}}function $(){let t=m(),e=t?.kind==="session"?t.origin.replace(/\/+$/,""):R,n=t&&t.kind!=="github"?f(t):null;return{url:`${e}/api/sootsim/report-issue`,authorization:n}}function k(t){if(!t)return"no package.json found; no compatibility scan attached";let e=t.packages.filter(n=>n.status!=="full"&&n.status!=="not-relevant").length;return`${t.packages.length} React Native ecosystem packages, ${e} needing attention`}function P(t){if(!t||typeof t!="object")return null;let e=Object.getOwnPropertyDescriptor(t,"id")?.value;return typeof e=="string"&&e?e:null}async function V(t,e=v()){let n;try{n=I(t)}catch(o){return e.stderr(` ${o instanceof Error?o.message:String(o)}
4
+ import{a as m,b as f}from"./chunk-ZHPLBK34.js";import{a as d}from"./chunk-6JYTKF5O.js";import"./chunk-ZB3UAYJ4.js";import{H as p}from"./chunk-SKGITCWL.js";import{a as l}from"./chunk-HI5MWY32.js";import"./chunk-YOIHAHR5.js";import{existsSync as h,readFileSync as w}from"node:fs";import{resolve as b}from"node:path";var R="https://contrast.dev",g=8e3;function v(){return{request:(t,e)=>fetch(t,e),confirmSubmission:d,isInteractive:process.stdin.isTTY===!0,now:()=>new Date,stdout:t=>process.stdout.write(t),stderr:t=>process.stderr.write(t)}}function S(t,e){let n=t.indexOf(e);if(n===-1)return null;let r=t[n+1];if(!r||r.startsWith("-"))throw new Error(`${e} requires a value`);return r}function I(t,e=process.cwd()){let n=S(t,"--app"),r=new Set,s=t.indexOf("--app");s!==-1&&(r.add(s),r.add(s+1));let a=[];for(let c=0;c<t.length;c+=1){if(r.has(c))continue;let u=t[c];if(!(u==="--yes"||u==="-y"||u==="--dry-run")){if(u.startsWith("-"))throw new Error(`unknown flag: ${u}`);a.push(u)}}let i=a.join(" ").trim();if(!i)throw new Error("describe the missing or broken compatibility behavior");if(i.length>g)throw new Error(`description is too long (maximum ${g} characters)`);return{appDir:b(e,n??"."),description:i,dryRun:t.includes("--dry-run"),yes:t.includes("--yes")||t.includes("-y")}}function y(t){if(!t||typeof t!="object")return;let e={};for(let n of Object.keys(t)){let r=Object.getOwnPropertyDescriptor(t,n)?.value;typeof r=="string"&&(e[n]=r)}return e}function D(t){let e=b(t,"package.json");if(!h(e))return null;let n;try{n=JSON.parse(w(e,"utf8"))}catch{throw new Error(`could not parse ${e}`)}if(!n||typeof n!="object")throw new Error(`${e} must contain a JSON object`);let r=Object.getOwnPropertyDescriptor(n,"name")?.value,s=Object.getOwnPropertyDescriptor(n,"dependencies")?.value,a=Object.getOwnPropertyDescriptor(n,"devDependencies")?.value,i=y(s),c=y(a);return{...typeof r=="string"?{name:r}:{},...i?{dependencies:i}:{},...c?{devDependencies:c}:{}}}async function O(t,e=new Date){let n=D(t.appDir),r=n?(await import("./web-BXVM3HJ3.js")).scanDeps(n):null,s=l(),a=p();return{note:t.description,timestamp:e.toISOString(),sootsim_version:a,cli_version:s,bundle:{activeApp:r&&r.projectName!=="unknown"?{appName:r.projectName}:null,reportSource:"cli",runtimeVersion:a,cliVersion:s,platform:process.platform,arch:process.arch,compatibility:r}}}function $(){let t=m(),e=t?.kind==="session"?t.origin.replace(/\/+$/,""):R,n=t&&t.kind!=="github"?f(t):null;return{url:`${e}/api/sootsim/report-issue`,authorization:n}}function k(t){if(!t)return"no package.json found; no compatibility scan attached";let e=t.packages.filter(n=>n.status!=="full"&&n.status!=="not-relevant").length;return`${t.packages.length} React Native ecosystem packages, ${e} needing attention`}function P(t){if(!t||typeof t!="object")return null;let e=Object.getOwnPropertyDescriptor(t,"id")?.value;return typeof e=="string"&&e?e:null}async function V(t,e=v()){let n;try{n=I(t)}catch(o){return e.stderr(` ${o instanceof Error?o.message:String(o)}
5
5
  usage: sootsim report-issue [--app <dir>] [--dry-run] [--yes] "<description>"
6
6
  `),1}if(!h(n.appDir))return e.stderr(` directory not found: ${n.appDir}
7
7
  `),1;let r;try{r=await O(n,e.now())}catch(o){return e.stderr(` could not prepare the issue report: ${o instanceof Error?o.message:String(o)}
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c as a}from"./chunk-6SICKWPQ.js";import"./chunk-QUAY5AZB.js";import"./chunk-PHFRI2QF.js";import"./chunk-EHBHUE6S.js";import"./chunk-W4S7GGPG.js";import"./chunk-F2WH6XM7.js";import"./chunk-VNS6KYRJ.js";import"./chunk-SKGITCWL.js";import"./chunk-YOIHAHR5.js";export{a as runRuntime};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as ne,b as se,f as ie}from"./chunk-C3O6UUPY.js";import"./chunk-6UXXOG6P.js";import{a as v}from"./chunk-OQO3HU4Y.js";import"./chunk-SY7E43UY.js";import"./chunk-QPZVGHRV.js";import{a as te}from"./chunk-63JWRDM6.js";import{a as ee}from"./chunk-YRRUK3EK.js";import"./chunk-GQVBLBUJ.js";import{a as oe,b as re}from"./chunk-C4O4VRN5.js";import"./chunk-S7WXPIOY.js";import"./chunk-3EO5JEG7.js";import"./chunk-MUQDPJUP.js";import"./chunk-YZPSUNTO.js";import{r as K,s as X}from"./chunk-4XMPRQGE.js";import"./chunk-XMOULANJ.js";import"./chunk-RX4CFOVV.js";import"./chunk-VAGUPECL.js";import"./chunk-STWCCIBA.js";import"./chunk-Z6H5FR3U.js";import"./chunk-BFNAFH27.js";import"./chunk-66Z2ADUQ.js";import"./chunk-YIJFCR5T.js";import{h as R,i as J,j as B,k as Z,l as Q,m as M,n as $}from"./chunk-7RJEULWN.js";import"./chunk-ZS7OXPHR.js";import"./chunk-C3GMSIRT.js";import"./chunk-2KSLGBIU.js";import"./chunk-RMIKUUCO.js";import"./chunk-R7AS52NA.js";import"./chunk-M2LP2VYQ.js";import"./chunk-EPZUFQMX.js";import{b as F,e as P,f as j,g as I,h as L,i as U,j as A}from"./chunk-GH2OE6F6.js";import"./chunk-NLTJE335.js";import"./chunk-IS5OOCN5.js";import"./chunk-LKAAQBT6.js";import"./chunk-XBBNRESY.js";import"./chunk-XKAXZ4DS.js";import{mkdirSync as ce,writeFileSync as ae}from"fs";import{dirname as ue,resolve as de}from"path";async function pe(e,t){let o=Le(e);(o.includes("--help")||o.includes("-h"))&&(console.log(`
4
+ import{a as ne,b as se,f as ie}from"./chunk-RHGVZJIY.js";import"./chunk-GLECQIGB.js";import{a as v}from"./chunk-CJKSD5BZ.js";import"./chunk-CKMQ2YXQ.js";import"./chunk-CUVLXG63.js";import{a as te}from"./chunk-GEUU2WIL.js";import{a as ee}from"./chunk-75YOUNTE.js";import"./chunk-5V5MOREL.js";import{a as oe,b as re}from"./chunk-ZHPLBK34.js";import"./chunk-7W63IKAP.js";import"./chunk-KGIXNUUM.js";import"./chunk-QCEMDWL4.js";import"./chunk-Y7RQGSZD.js";import{r as K,s as X}from"./chunk-S5U22PVL.js";import"./chunk-VAFDFOE6.js";import"./chunk-ULJT3HDO.js";import"./chunk-WTNKX7QD.js";import"./chunk-Y5O5GK2Q.js";import"./chunk-75KNNHMR.js";import"./chunk-KKXSWEYS.js";import"./chunk-QUAY5AZB.js";import"./chunk-PHFRI2QF.js";import{h as R,i as J,j as B,k as Z,l as Q,m as M,n as $}from"./chunk-EHBHUE6S.js";import"./chunk-YS7YDOGW.js";import"./chunk-RATCQLQA.js";import"./chunk-ZB3UAYJ4.js";import"./chunk-PJ27D3WO.js";import"./chunk-W4S7GGPG.js";import"./chunk-VJMY2MX6.js";import"./chunk-ZDQO6TJQ.js";import{b as F,e as P,f as j,g as I,h as L,i as U,j as A}from"./chunk-J6ZKDIRN.js";import"./chunk-F2WH6XM7.js";import"./chunk-VNS6KYRJ.js";import"./chunk-6QZY6YO2.js";import"./chunk-SKGITCWL.js";import"./chunk-YOIHAHR5.js";import{mkdirSync as ce,writeFileSync as ae}from"fs";import{dirname as ue,resolve as de}from"path";async function pe(e,t){let o=Le(e);(o.includes("--help")||o.includes("-h"))&&(console.log(`
5
5
  sootsim screenshot \u2014 capture the canvas as a PNG
6
6
 
7
7
  usage:
@@ -156,4 +156,4 @@ examples:
156
156
  await new Promise((r) => setTimeout(r, 40))
157
157
  }
158
158
  return false
159
- })()`,{acquireLock:!0}))throw new Error("could not enable screenshot mode \u2014 is this a browser sim with the screenshot plugin? (electron has no screenshot mode)")}function yt(e){console.log(` ${e.projectName} \u2014 canvas ${e.canvas} (${e.exportSize.width}\xD7${e.exportSize.height}), device ${e.deviceModel}`);for(let t of e.slides){let o=[t.focused?"focused":t.active?"active":null,t.captured?`captured${t.captureMode==="3d"?" 3d":""}`:"no capture"].filter(Boolean).join(", "),i=t.title?`"${t.title}"`:"(no title)",r=[`bg ${t.bgTop}\u2192${t.bgBottom}`,t.titleColor?`color ${t.titleColor}`:null,t.titleSize?`size ${t.titleSize}`:null,t.titleUnderlay?`underlay ${t.titleUnderlay}`:null,t.titleShadow?`shadow ${t.titleShadow}`:null].filter(Boolean).join(", ");console.log(` ${t.index}. ${i} \u2014 ${r} [${o}]`),t.subtitle&&console.log(` ${t.subtitle}`)}}function bt(e){let t=e.match(/^data:[^;]+;base64,(.+)$/);if(!t)throw new Error("export returned an unexpected payload");return Buffer.from(t[1],"base64")}async function Fe(e,t){if(e.includes("--help")||e.includes("-h")){console.log(mt);return}let{rest:o,values:i,json:r}=ft(e),s=R(o,{port:t.port,commandTimeoutMs:45e3}),n=s.positional[0]??"list",a=gt(s.positional[1]),l=Number(s.positional[2]),c=B(s),u=d=>{r?console.log(JSON.stringify(d,null,2)):yt(d)};try{switch(await wt(c),n){case"list":{u(await M(c,"SootSim.bridges.screenshotControl.getState"));break}case"set":{if(a==null)throw new Error("usage: sootsim screenshot slides set <n> --title \u2026 (see --help)");let d={};for(let m of["title","subtitle","bgTop","bgBottom","titleColor","titleSize","titleUnderlay","titleShadow"])i[m]!=null&&(d[m]=i[m]);if(Object.keys(d).length===0)throw new Error("nothing to set \u2014 pass at least one field (see --help)");u(await $(c,"SootSim.bridges.screenshotControl.setSlide",a,d));break}case"add":{u(await $(c,"SootSim.bridges.screenshotControl.addSlide"));break}case"remove":{if(a==null)throw new Error("usage: sootsim screenshot slides remove <n>");u(await $(c,"SootSim.bridges.screenshotControl.removeSlide",a));break}case"move":{if(a==null||!Number.isInteger(l)||l<1)throw new Error("usage: sootsim screenshot slides move <n> <position>");u(await $(c,"SootSim.bridges.screenshotControl.moveSlide",a,l));break}case"focus":{if(a==null)throw new Error("usage: sootsim screenshot slides focus <n>");u(await $(c,"SootSim.bridges.screenshotControl.focusSlide",a));break}case"overview":{u(await $(c,"SootSim.bridges.screenshotControl.overview"));break}case"capture":{let d=await $(c,"SootSim.bridges.screenshotControl.capture",...a!=null?[a]:[]);u(d);break}case"export":{let d=i.out?dt(i.out)?i.out:pt(process.cwd(),i.out):Ee(process.cwd(),"screenshots"),m=await M(c,"SootSim.bridges.screenshotControl.getState"),h=a!=null?m.slides.filter(p=>p.index===a||p.id===a):m.slides.filter(p=>p.captured);if(h.length===0)throw new Error(a!=null?`no slide ${a}`:"no captured slides to export \u2014 capture first");let w=[];for(let p of h){let y=await M(c,"SootSim.bridges.screenshotControl.exportSlide",p.index),f=Ee(d,y.name);lt(ut(f),{recursive:!0}),ct(f,bt(y.dataUrl)),w.push(f),console.log(` saved: ${f} (${y.width}\xD7${y.height})`)}r&&console.log(JSON.stringify({written:w},null,2));break}default:throw new Error(`unknown subcommand "${n}" \u2014 see sootsim screenshot slides --help`)}}finally{c.close()}}var St=new Set(["--sim","--port","-p","--output","-o","--out","--plan","--app","--device","--org","--repo","--api-origin","--branch","--platform","--slides","--shell-origin","--timeout","--ids","--out-dir"]),xt=new Set(["capture","slides","appstore","layers"]);function Ae(e){for(let t=0;t<e.length;t++){let o=e[t];if(o.startsWith("-")){St.has(o)&&t++;continue}return xt.has(o)?{name:o,index:t}:null}return null}function E(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function Pt(e){let t=[];for(let o=0;o<e.length;o++){if(e[o]==="--sim"){o++;continue}t.push(e[o])}return t}async function Po(e,t){let o=Ae(e);if(!o||o.name==="capture"){await pe(o?E(e,o.index):e,t);return}if(o.name==="slides"){await Fe(E(e,o.index),t);return}if(o.name==="layers"){let{runScreenshotLayers:s}=await import("./screenshot-layers-4JSTS5VY.js");await s(E(e,o.index),t);return}let i=E(e,o.index),r=Ae(i);if(r?.name==="capture")try{let{runScreenshotsCapture:s}=await import("./screenshots-capture-AQQISSQD.js");return await s(Pt(E(i,r.index)))}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ERR_MODULE_NOT_FOUND")return console.error("screenshot appstore capture is repo-only tooling \u2014 it needs the sootsim workspace (playwright is not shipped with the published CLI)."),1;throw s}return Ne(i,t)}export{Po as runScreenshotCommand};
159
+ })()`,{acquireLock:!0}))throw new Error("could not enable screenshot mode \u2014 is this a browser sim with the screenshot plugin? (electron has no screenshot mode)")}function yt(e){console.log(` ${e.projectName} \u2014 canvas ${e.canvas} (${e.exportSize.width}\xD7${e.exportSize.height}), device ${e.deviceModel}`);for(let t of e.slides){let o=[t.focused?"focused":t.active?"active":null,t.captured?`captured${t.captureMode==="3d"?" 3d":""}`:"no capture"].filter(Boolean).join(", "),i=t.title?`"${t.title}"`:"(no title)",r=[`bg ${t.bgTop}\u2192${t.bgBottom}`,t.titleColor?`color ${t.titleColor}`:null,t.titleSize?`size ${t.titleSize}`:null,t.titleUnderlay?`underlay ${t.titleUnderlay}`:null,t.titleShadow?`shadow ${t.titleShadow}`:null].filter(Boolean).join(", ");console.log(` ${t.index}. ${i} \u2014 ${r} [${o}]`),t.subtitle&&console.log(` ${t.subtitle}`)}}function bt(e){let t=e.match(/^data:[^;]+;base64,(.+)$/);if(!t)throw new Error("export returned an unexpected payload");return Buffer.from(t[1],"base64")}async function Fe(e,t){if(e.includes("--help")||e.includes("-h")){console.log(mt);return}let{rest:o,values:i,json:r}=ft(e),s=R(o,{port:t.port,commandTimeoutMs:45e3}),n=s.positional[0]??"list",a=gt(s.positional[1]),l=Number(s.positional[2]),c=B(s),u=d=>{r?console.log(JSON.stringify(d,null,2)):yt(d)};try{switch(await wt(c),n){case"list":{u(await M(c,"SootSim.bridges.screenshotControl.getState"));break}case"set":{if(a==null)throw new Error("usage: sootsim screenshot slides set <n> --title \u2026 (see --help)");let d={};for(let m of["title","subtitle","bgTop","bgBottom","titleColor","titleSize","titleUnderlay","titleShadow"])i[m]!=null&&(d[m]=i[m]);if(Object.keys(d).length===0)throw new Error("nothing to set \u2014 pass at least one field (see --help)");u(await $(c,"SootSim.bridges.screenshotControl.setSlide",a,d));break}case"add":{u(await $(c,"SootSim.bridges.screenshotControl.addSlide"));break}case"remove":{if(a==null)throw new Error("usage: sootsim screenshot slides remove <n>");u(await $(c,"SootSim.bridges.screenshotControl.removeSlide",a));break}case"move":{if(a==null||!Number.isInteger(l)||l<1)throw new Error("usage: sootsim screenshot slides move <n> <position>");u(await $(c,"SootSim.bridges.screenshotControl.moveSlide",a,l));break}case"focus":{if(a==null)throw new Error("usage: sootsim screenshot slides focus <n>");u(await $(c,"SootSim.bridges.screenshotControl.focusSlide",a));break}case"overview":{u(await $(c,"SootSim.bridges.screenshotControl.overview"));break}case"capture":{let d=await $(c,"SootSim.bridges.screenshotControl.capture",...a!=null?[a]:[]);u(d);break}case"export":{let d=i.out?dt(i.out)?i.out:pt(process.cwd(),i.out):Ee(process.cwd(),"screenshots"),m=await M(c,"SootSim.bridges.screenshotControl.getState"),h=a!=null?m.slides.filter(p=>p.index===a||p.id===a):m.slides.filter(p=>p.captured);if(h.length===0)throw new Error(a!=null?`no slide ${a}`:"no captured slides to export \u2014 capture first");let w=[];for(let p of h){let y=await M(c,"SootSim.bridges.screenshotControl.exportSlide",p.index),f=Ee(d,y.name);lt(ut(f),{recursive:!0}),ct(f,bt(y.dataUrl)),w.push(f),console.log(` saved: ${f} (${y.width}\xD7${y.height})`)}r&&console.log(JSON.stringify({written:w},null,2));break}default:throw new Error(`unknown subcommand "${n}" \u2014 see sootsim screenshot slides --help`)}}finally{c.close()}}var St=new Set(["--sim","--port","-p","--output","-o","--out","--plan","--app","--device","--org","--repo","--api-origin","--branch","--platform","--slides","--shell-origin","--timeout","--ids","--out-dir"]),xt=new Set(["capture","slides","appstore","layers"]);function Ae(e){for(let t=0;t<e.length;t++){let o=e[t];if(o.startsWith("-")){St.has(o)&&t++;continue}return xt.has(o)?{name:o,index:t}:null}return null}function E(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function Pt(e){let t=[];for(let o=0;o<e.length;o++){if(e[o]==="--sim"){o++;continue}t.push(e[o])}return t}async function Po(e,t){let o=Ae(e);if(!o||o.name==="capture"){await pe(o?E(e,o.index):e,t);return}if(o.name==="slides"){await Fe(E(e,o.index),t);return}if(o.name==="layers"){let{runScreenshotLayers:s}=await import("./screenshot-layers-CRCQ4CEF.js");await s(E(e,o.index),t);return}let i=E(e,o.index),r=Ae(i);if(r?.name==="capture")try{let{runScreenshotsCapture:s}=await import("./screenshots-capture-XGQFYINL.js");return await s(Pt(E(i,r.index)))}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ERR_MODULE_NOT_FOUND")return console.error("screenshot appstore capture is repo-only tooling \u2014 it needs the sootsim workspace (playwright is not shipped with the published CLI)."),1;throw s}return Ne(i,t)}export{Po as runScreenshotCommand};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as S}from"./chunk-YRRUK3EK.js";import"./chunk-MUQDPJUP.js";import{r as y,s as v}from"./chunk-4XMPRQGE.js";import"./chunk-Z6H5FR3U.js";import{h as w,j as b,m as I}from"./chunk-7RJEULWN.js";import"./chunk-EPZUFQMX.js";import{b as m}from"./chunk-GH2OE6F6.js";import"./chunk-NLTJE335.js";import"./chunk-IS5OOCN5.js";import"./chunk-XBBNRESY.js";import"./chunk-XKAXZ4DS.js";import{mkdirSync as B,writeFileSync as R}from"fs";import{resolve as f}from"path";async function L(s,$){(s.includes("--help")||s.includes("-h"))&&(console.log(`
4
+ import{a as S}from"./chunk-75YOUNTE.js";import"./chunk-QCEMDWL4.js";import{r as y,s as v}from"./chunk-S5U22PVL.js";import"./chunk-75KNNHMR.js";import{h as w,j as b,m as I}from"./chunk-EHBHUE6S.js";import"./chunk-ZDQO6TJQ.js";import{b as m}from"./chunk-J6ZKDIRN.js";import"./chunk-F2WH6XM7.js";import"./chunk-VNS6KYRJ.js";import"./chunk-SKGITCWL.js";import"./chunk-YOIHAHR5.js";import{mkdirSync as B,writeFileSync as R}from"fs";import{resolve as f}from"path";async function L(s,$){(s.includes("--help")||s.includes("-h"))&&(console.log(`
5
5
  sootsim screenshot layers \u2014 export a screen as engine-isolated layers
6
6
 
7
7
  usage:
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{b as M}from"./chunk-OQO3HU4Y.js";import{a as x}from"./chunk-C4O4VRN5.js";import"./chunk-2KSLGBIU.js";import"./chunk-XBBNRESY.js";import"./chunk-XKAXZ4DS.js";import{execSync as T}from"node:child_process";import{mkdirSync as D,mkdtempSync as O,rmSync as E,writeFileSync as j}from"node:fs";import{tmpdir as G}from"node:os";import{dirname as q,isAbsolute as B,join as U,resolve as L}from"node:path";import{chromium as W}from"playwright-core";var z=`
4
+ import{b as M}from"./chunk-CJKSD5BZ.js";import{a as x}from"./chunk-ZHPLBK34.js";import"./chunk-ZB3UAYJ4.js";import"./chunk-SKGITCWL.js";import"./chunk-YOIHAHR5.js";import{execSync as T}from"node:child_process";import{mkdirSync as D,mkdtempSync as O,rmSync as E,writeFileSync as j}from"node:fs";import{tmpdir as G}from"node:os";import{dirname as q,isAbsolute as B,join as U,resolve as L}from"node:path";import{chromium as W}from"playwright-core";var z=`
5
5
  sootsim screenshot appstore capture \u2014 headlessly capture + upload App Store slides
6
6
 
7
7
  usage:
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{b as ge,c as J,d as Se,e as K,f as ye,h as ve,i as E,j as be,k as we,l as Ae,m as ke,q as Te,t as k,u as Ce,v as Ie,w as Ee,x as Pe}from"./chunk-PJKCYUT3.js";import"./chunk-WWIQEYHT.js";import{e as fe}from"./chunk-GQVBLBUJ.js";import"./chunk-C4O4VRN5.js";import{a as ue,b as pe,d as L,e as me}from"./chunk-3EO5JEG7.js";import{d as he}from"./chunk-VAGUPECL.js";import{g as _}from"./chunk-STWCCIBA.js";import"./chunk-BFNAFH27.js";import"./chunk-YIJFCR5T.js";import"./chunk-7RJEULWN.js";import{a as F,b as G,c as oe,d as ae}from"./chunk-C3GMSIRT.js";import"./chunk-2KSLGBIU.js";import{f as x}from"./chunk-R7AS52NA.js";import{c as de,d as le}from"./chunk-NLTJE335.js";import"./chunk-IS5OOCN5.js";import{E as Y,G as O,H as j,I as Z,J as Q,K as ee,M as te,P as ie,Q as re,R as ne,S as $,T as se,g as q,h as z,y as W,z as X}from"./chunk-XBBNRESY.js";import{a as ce}from"./chunk-3S7UEXZW.js";import"./chunk-XKAXZ4DS.js";import{spawn as gt}from"child_process";import C from"fs";import{createServer as St}from"http";import w from"path";import{WebSocket as g,WebSocketServer as yt}from"ws";import Oe from"node:fs";import B from"node:path";import{spawn as Je}from"node:child_process";function Ke(o){return typeof o.text=="string"?o.text.trim():""}function Ve(o){let e=o?.trim();return e||"tm"}async function Re(o){let e=o.sessionId.trim();if(!G(e))throw new Error(`invalid Team Machine session id: ${e||"<empty>"}`);let t=Ke(o.prompt);if(!t)throw new Error("prompt text is empty");let i=Ve(o.command),s=o.timeoutMs??15e3;await new Promise((n,c)=>{let r=Je(i,["send",e,t],{stdio:["ignore","ignore","pipe"],env:process.env}),a="",l=setTimeout(()=>{try{r.kill("SIGTERM")}catch{}c(new Error(`tm send timed out after ${Math.round(s/1e3)}s`))},s);r.stderr?.setEncoding("utf8"),r.stderr?.on("data",d=>{a.length<4e3&&(a+=String(d))}),r.on("error",d=>{clearTimeout(l),c(d)}),r.on("exit",(d,p)=>{if(clearTimeout(l),d===0){n();return}let u=a.trim();c(new Error(u||`tm send exited with ${p?`signal ${p}`:`code ${d??"unknown"}`}`))})})}var M=1,Ge=25;function qe(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_R2||9500)].filter(o=>Number.isFinite(o)&&o>0)}var D=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;pendingSessionStates=new Map;pendingSessionPatches=new Map;sessionStatusPersistTimer=null;opts;constructor(e={}){this.opts=e}registerSocket(e){this.allSockets.add(e)}unregisterSocket(e){let t=this.sessionsBySocket.get(e);if(t){for(let i of t)this.decrementSubscription(i);this.sessionsBySocket.delete(e)}this.allSockets.delete(e)}async handleMessage(e,t){let i=t?.type;if(typeof i!="string"||!i.startsWith("agent:"))return!1;let s=t.id;try{let n=await this.dispatch(e,i,t);this.respond(e,s,n)}catch(n){n instanceof k?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await ke()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
4
+ import{b as ge,c as J,d as Se,e as K,f as ye,h as ve,i as E,j as be,k as we,l as Ae,m as ke,q as Te,t as k,u as Ce,v as Ie,w as Ee,x as Pe}from"./chunk-JGFIT5X5.js";import"./chunk-QMHUIADD.js";import{e as fe}from"./chunk-5V5MOREL.js";import"./chunk-ZHPLBK34.js";import{a as ue,b as pe,d as L,e as me}from"./chunk-KGIXNUUM.js";import{d as he}from"./chunk-WTNKX7QD.js";import{g as _}from"./chunk-Y5O5GK2Q.js";import"./chunk-KKXSWEYS.js";import"./chunk-PHFRI2QF.js";import"./chunk-EHBHUE6S.js";import{a as F,b as G,c as oe,d as ae}from"./chunk-RATCQLQA.js";import"./chunk-ZB3UAYJ4.js";import{f as x}from"./chunk-W4S7GGPG.js";import{c as de,d as le}from"./chunk-F2WH6XM7.js";import"./chunk-VNS6KYRJ.js";import{E as Y,G as O,H as j,I as Z,J as Q,K as ee,M as te,P as ie,Q as re,R as ne,S as $,T as se,g as q,h as z,y as W,z as X}from"./chunk-SKGITCWL.js";import{a as ce}from"./chunk-HI5MWY32.js";import"./chunk-YOIHAHR5.js";import{spawn as gt}from"child_process";import C from"fs";import{createServer as St}from"http";import w from"path";import{WebSocket as g,WebSocketServer as yt}from"ws";import Oe from"node:fs";import B from"node:path";import{spawn as Je}from"node:child_process";function Ke(o){return typeof o.text=="string"?o.text.trim():""}function Ve(o){let e=o?.trim();return e||"tm"}async function Re(o){let e=o.sessionId.trim();if(!G(e))throw new Error(`invalid Team Machine session id: ${e||"<empty>"}`);let t=Ke(o.prompt);if(!t)throw new Error("prompt text is empty");let i=Ve(o.command),s=o.timeoutMs??15e3;await new Promise((n,c)=>{let r=Je(i,["send",e,t],{stdio:["ignore","ignore","pipe"],env:process.env}),a="",l=setTimeout(()=>{try{r.kill("SIGTERM")}catch{}c(new Error(`tm send timed out after ${Math.round(s/1e3)}s`))},s);r.stderr?.setEncoding("utf8"),r.stderr?.on("data",d=>{a.length<4e3&&(a+=String(d))}),r.on("error",d=>{clearTimeout(l),c(d)}),r.on("exit",(d,p)=>{if(clearTimeout(l),d===0){n();return}let u=a.trim();c(new Error(u||`tm send exited with ${p?`signal ${p}`:`code ${d??"unknown"}`}`))})})}var M=1,Ge=25;function qe(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_R2||9500)].filter(o=>Number.isFinite(o)&&o>0)}var D=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;pendingSessionStates=new Map;pendingSessionPatches=new Map;sessionStatusPersistTimer=null;opts;constructor(e={}){this.opts=e}registerSocket(e){this.allSockets.add(e)}unregisterSocket(e){let t=this.sessionsBySocket.get(e);if(t){for(let i of t)this.decrementSubscription(i);this.sessionsBySocket.delete(e)}this.allSockets.delete(e)}async handleMessage(e,t){let i=t?.type;if(typeof i!="string"||!i.startsWith("agent:"))return!1;let s=t.id;try{let n=await this.dispatch(e,i,t);this.respond(e,s,n)}catch(n){n instanceof k?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await ke()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
5
5
  `)}}close(){this.sessionStatusPersistTimer&&(clearTimeout(this.sessionStatusPersistTimer),this.sessionStatusPersistTimer=null),this.flushSessionStatuses();for(let e of this.subscriptions.values())try{e.unsubscribe()}catch{}this.subscriptions.clear(),this.sessionsBySocket.clear(),this.allSockets.clear()}async dispatch(e,t,i){switch(t){case"agent:list-projects":return K();case"agent:upsert-project":return J(i.input??{});case"agent:delete-project":return ve(String(i.projectId)),{ok:!0};case"agent:auto-attach-for-url":return this.autoAttachForUrl(i.input??{});case"agent:list-sessions":return be(i.projectId?String(i.projectId):void 0);case"agent:start-session":return this.doStartSession(i.input??{});case"agent:send-claimed-prompt":return this.sendClaimedPrompt(i);case"agent:send-prompt":{let n=String(i.sessionId),c=E(n);if(!c)throw new k("NO_SESSION",`no session: ${n}`);let r=this.normalizePromptEnvelope(i);return await Ie(n,r),this.notePromptAccepted(n,r,c.status==="working")}case"agent:end-session":this.dropSessionFanout(String(i.sessionId)),await Ee(String(i.sessionId));let s=E(String(i.sessionId));return s&&this.broadcastSessionStatus(s),{ok:!0};case"agent:get-transcript":return this.getTranscript(String(i.sessionId));case"agent:get-paths":return this.getPaths();case"agent:subscribe-events":return this.subscribeSocket(e,String(i.sessionId));case"agent:unsubscribe-events":return this.unsubscribeSocket(e,String(i.sessionId));default:throw new k("UNKNOWN_AGENT_MSG",`unknown agent message: ${t}`)}}async sendClaimedPrompt(e){let t=typeof e.simId=="string"?e.simId.trim():"";if(!t)throw new k("NO_SIM","agent:send-claimed-prompt requires simId");let i=this.opts.resolveCliLease?.(t)??null;if(!i||i.kind!=="cli"||i.expiresAt<=Date.now())throw new k("NO_CLAIM",`sim ${t} has no active CLI claim`);let s=F(i.cliIdentityKey);if(!s)throw new k("UNSUPPORTED_CLAIM",`sim ${t} is claimed by a CLI identity that is not promptable`);return await Re({sessionId:s,prompt:this.normalizePromptEnvelope(e)}),{ok:!0,routed:"team-machine",sessionId:s}}async doStartSession(e){if(!Se(e.projectId))throw new k("NO_PROJECT",`no project: ${e.projectId}`);let i=await Ce(e);return this.broadcastSessionStatus(i.session),i}async autoAttachForUrl(e){let t=e.bundleUrl??"",i=(()=>{try{return new URL(t).port||null}catch{return null}})();if(!i)return{project:null};let s=this.opts.getExcludePorts?.()??qe(),c=(await _({excludePorts:s})).find(d=>String(d.port)===i);if(!c||!c.cwd)return{project:null};let r=K().find(d=>d.cwd===c.cwd)??null,a=Array.from(new Set([...r?.knownBundleUrls??[],c.bundleUrl,t]));return{project:J({cwd:c.cwd,name:c.projectName??B.basename(c.cwd),preferredProvider:e.provider??r?.preferredProvider,sourceRoots:r?.sourceRoots??[c.cwd],knownBundleUrls:a,framework:r?.framework??ze(c.framework),bundleId:c.bundleId??r?.bundleId})}}getTranscript(e){let t=Te(e);return Oe.existsSync(t)?Oe.readFileSync(t,"utf8"):{error:"transcript not found",code:"NO_TRANSCRIPT"}}getPaths(){let e=ge();return{userDataDir:e,storeFile:B.join(e,"attached-projects.json"),sessionsDir:B.join(e,"sessions"),transcriptsDir:B.join(e,"transcripts")}}subscribeSocket(e,t){let i=this.sessionsBySocket.get(e);if(i||(i=new Set,this.sessionsBySocket.set(e,i)),i.has(t))return{ok:!0,refCount:this.subscriptions.get(t)?.refCount??1};i.add(t);let s=this.subscriptions.get(t);if(s)return s.refCount++,{ok:!0,refCount:s.refCount};let n=Pe(t,c=>{let r=this.coalescePromptEcho(t,c);if(r&&(this.applySessionEvent(t,r),this.fanOutEvent(t,r)),c.type==="turn-completed"){let a=E(t);if(a)try{ye(a.projectId,{usd:c.costUsd,ts:c.ts})}catch(l){process.stderr.write(`[sootsim-agent] recordTurnTelemetry failed: ${l instanceof Error?l.message:String(l)}
6
6
  `)}}});return this.subscriptions.set(t,{unsubscribe:n,refCount:1}),{ok:!0,refCount:1}}unsubscribeSocket(e,t){let i=this.sessionsBySocket.get(e);return!i||!i.has(t)?{ok:!0,refCount:0}:(i.delete(t),this.decrementSubscription(t))}decrementSubscription(e){let t=this.subscriptions.get(e);if(!t)return{ok:!0,refCount:0};if(t.refCount--,t.refCount<=0){try{t.unsubscribe()}catch{}return this.subscriptions.delete(e),{ok:!0,refCount:0}}return{ok:!0,refCount:t.refCount}}dropSessionFanout(e){let t=this.subscriptions.get(e);if(t){try{t.unsubscribe()}catch{}this.subscriptions.delete(e)}for(let i of this.sessionsBySocket.values())i.delete(e);this.clearPromptTracking(e)}normalizePromptEnvelope(e){if(e?.prompt&&typeof e.prompt=="object"){let t=e.prompt;return{text:String(t.text??""),...typeof t.displayText=="string"?{displayText:t.displayText}:{},...typeof t.inspectSummary=="string"?{inspectSummary:t.inspectSummary}:{},...typeof t.inspectTrace=="string"?{inspectTrace:t.inspectTrace}:{}}}return{text:String(e?.text??""),...typeof e?.displayText=="string"?{displayText:e.displayText}:{},...typeof e?.inspectSummary=="string"?{inspectSummary:e.inspectSummary}:{},...typeof e?.inspectTrace=="string"?{inspectTrace:e.inspectTrace}:{}}}notePromptAccepted(e,t,i){let s=Date.now(),n=this.pendingPromptEchoes.get(e)??[];n.push({sentAt:s}),this.pendingPromptEchoes.set(e,n);let c=Math.max(this.pendingTurns.get(e)??0,i?1:0)+1;this.pendingTurns.set(e,c);let r=t.displayText??t.text;return this.patchSession(e,{lastPrompt:r,status:"working",needsAttention:!1}),this.fanOutEvent(e,{type:"prompt-received",text:r,...t.inspectSummary?{inspectSummary:t.inspectSummary}:{},...t.inspectTrace?{inspectTrace:t.inspectTrace}:{},ts:s}),{ok:!0,queued:c>1,pendingTurns:c,queueDepth:Math.max(0,c-1)}}applySessionEvent(e,t){switch(t.type){case"prompt-received":case"turn-started":this.patchSession(e,{status:"working",needsAttention:!1});return;case"turn-completed":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"idle",needsAttention:!1,lastTurnFiles:t.filesTouched,currentlyEditing:void 0});return}case"approval-needed":this.patchSession(e,{status:"needs-attention",needsAttention:!0});return;case"error":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"needs-attention",needsAttention:i<=0,currentlyEditing:void 0});return}case"exited":this.clearPromptTracking(e),this.patchSession(e,{status:"ended",needsAttention:!1,wrapperPid:void 0,currentlyEditing:void 0});return;case"ready":case"turn-reasoning":case"turn-message":case"turn-plan":case"tool-call":case"file-edited":case"file-diff-delta":return}}patchSession(e,t){let i=this.pendingSessionStates.get(e)??E(e);if(!i)return;let s=we(i,t);this.pendingSessionStates.set(e,s),this.pendingSessionPatches.set(e,{...this.pendingSessionPatches.get(e),...t}),this.broadcastSessionStatus(s),!this.sessionStatusPersistTimer&&(this.sessionStatusPersistTimer=setTimeout(()=>{this.sessionStatusPersistTimer=null,this.flushSessionStatuses()},Ge))}flushSessionStatuses(){if(this.pendingSessionPatches.size===0)return;let e=this.pendingSessionStates,t=this.pendingSessionPatches;this.pendingSessionStates=new Map,this.pendingSessionPatches=new Map;try{Ae([...t].map(([i,s])=>({id:i,patch:s})))}catch(i){for(let[s,n]of e)this.pendingSessionStates.has(s)||this.pendingSessionStates.set(s,n);for(let[s,n]of t)this.pendingSessionPatches.set(s,{...n,...this.pendingSessionPatches.get(s)});process.stderr.write(`[sootsim-agent] session status persistence failed: ${i instanceof Error?i.message:String(i)}
7
7
  `)}}coalescePromptEcho(e,t){if(t.type!=="prompt-received")return t;let i=this.pendingPromptEchoes.get(e);if(!i||i.length===0)return t;for(;i.length>0&&Date.now()-i[0].sentAt>15e3;)i.shift();return i.length===0?(this.pendingPromptEchoes.delete(e),t):(i.shift(),i.length===0?this.pendingPromptEchoes.delete(e):this.pendingPromptEchoes.set(e,i),null)}consumeSettledTurn(e){let t=Math.max(0,(this.pendingTurns.get(e)??1)-1);return t>0?this.pendingTurns.set(e,t):this.pendingTurns.delete(e),t}clearPromptTracking(e){this.pendingPromptEchoes.delete(e),this.pendingTurns.delete(e)}fanOutEvent(e,t){let i=JSON.stringify({type:"agent:event",sessionId:e,event:t});for(let[s,n]of this.sessionsBySocket)if(n.has(e)&&s.readyState===M)try{s.send(i)}catch{}}broadcastSessionStatus(e){let t=JSON.stringify({type:"agent:session-status",session:e});for(let i of this.allSockets)if(i.readyState===M)try{i.send(t)}catch{}}respond(e,t,i){if(e.readyState===M)try{e.send(JSON.stringify({id:t,result:i}))}catch{}}respondError(e,t,i,s){if(e.readyState===M)try{e.send(JSON.stringify({id:t,error:i,...s?{code:s}:{}}))}catch{}}};function ze(o){return o==="expo"?"expo":o==="one"||o==="vxrn"?"one":"unknown"}import _e from"http";import Le from"https";import{finished as Ze,pipeline as Qe}from"stream/promises";var V="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36",Xe=[{hostSuffix:"uniswap.org",headers:{origin:"https://app.uniswap.org",referer:"https://app.uniswap.org/"},suppressBrowserUserAgent:!0}];function Ye(o){let e=o.toLowerCase();for(let t of Xe)if(e===t.hostSuffix||e.endsWith(`.${t.hostSuffix}`))return t}function xe(o){let e=Ye(o.hostname);return{"accept-encoding":"identity",...e?.suppressBrowserUserAgent?{}:{"user-agent":V},...e?.headers}}var et=new Set(["host","origin","referer","user-agent","accept-encoding","cookie","connection","keep-alive","transfer-encoding","upgrade","content-length","sec-fetch-site","sec-fetch-mode","sec-fetch-dest","sec-ch-ua","sec-ch-ua-mobile","sec-ch-ua-platform"]),tt={"access-control-allow-origin":"*","access-control-allow-methods":"GET,POST,PUT,DELETE,PATCH,OPTIONS","access-control-allow-headers":"*","access-control-expose-headers":"*","access-control-max-age":"3600"},it=new Set(["host","origin","referer","sec-fetch-site","sec-fetch-mode","sec-fetch-dest"]);function Be(o){return o.protocol!=="https:"?{}:ue(o.hostname)?{rejectUnauthorized:!1}:{}}function P(o){for(let[e,t]of Object.entries(tt))o.setHeader(e,t)}function rt(o,e){let t=[],i=e;i?.code&&t.push(i.code),i?.message&&t.push(i.message),i?.cause?.code&&t.push(i.cause.code),i?.cause?.message&&t.push(i.cause.message);let n=[...new Set(t.filter(Boolean))].join(" | ")||String(e);return o.includes("stored-in-.env.local")?`${n} | upstream url still contains placeholder env values`:n}function nt(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(et.has(i.toLowerCase())||(t[i]=Array.isArray(s)?s.join(", "):s));return Object.assign(t,e?xe(e):{"user-agent":V}),t}function st(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(it.has(i.toLowerCase())||(t[i]=s));return t.host=e.host,t.origin=e.origin,t.referer=`${e.origin}/`,t}function Me(o){return o?.startsWith("/__fetch-proxy?")||o?.startsWith("/__proxy?")||!1}function De(o){return o?!!(o.startsWith("/__app-api?")||o.startsWith("/__app-api/")):!1}async function Ne(o,e){if(o.method==="OPTIONS"){P(e),e.writeHead(204),e.end();return}let i=new URLSearchParams((o.url||"").split("?")[1]||"").get("url");if(!i){P(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("missing url param");return}let s;try{s=new URL(i)}catch{P(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("invalid url param");return}let n;if(o.method!=="GET"&&o.method!=="HEAD"){let a=[];for await(let l of o)a.push(Buffer.isBuffer(l)?l:Buffer.from(l));a.length>0&&(n=Buffer.concat(a))}let c=o.method||"GET",r=async(a,l,d,p)=>{let u=a.protocol==="https:"?Le:_e,h=nt(o.headers,a);a.origin!==s.origin&&(delete h.authorization,delete h["proxy-authorization"]),l==="GET"||l==="HEAD"?(delete h["content-length"],delete h["content-type"]):d&&(h["content-length"]=String(d.byteLength));let m=await new Promise((b,v)=>{let y=u.request({hostname:a.hostname,port:a.port||(a.protocol==="https:"?443:80),path:a.pathname+a.search,method:l,headers:h,...Be(a)},b),R=()=>y.destroy(new Error("fetch proxy client disconnected"));o.once("aborted",R),y.once("close",()=>o.off("aborted",R)),y.once("error",v),d===void 0?y.end():y.end(d)}),f=m.statusCode??502,S=m.headers.location;if(S&&(f===301||f===302||f===303||f===307||f===308)){if(p>=10)throw m.destroy(),new Error("too many redirects");let b=(f===301||f===302)&&l==="POST"||f===303&&l!=="GET"&&l!=="HEAD",v=new URL(S,a);m.resume(),await Ze(m),await r(v,b?"GET":l,b?void 0:d,p+1);return}for(let[b,v]of Object.entries(m.headers)){let y=b.toLowerCase();v===void 0||y==="set-cookie"||y==="connection"||y==="keep-alive"||y==="proxy-authenticate"||y==="proxy-authorization"||y==="te"||y==="trailer"||y==="transfer-encoding"||y==="upgrade"||y.startsWith("access-control-")||e.setHeader(b,v)}P(e);let A=m.headers["set-cookie"]??[];A.length>0&&e.setHeader("x-sootsim-set-cookie",(Array.isArray(A)?A:[A]).join(", ")),e.statusCode=f,await Qe(m,e)};try{await r(s,c,n,0)}catch(a){if(e.headersSent){e.destroy(a instanceof Error?a:new Error(String(a)));return}P(e),e.writeHead(502,{"Content-Type":"text/plain"}),e.end(`fetch proxy error: ${rt(s.href,a)}`)}}function He(o,e){let t=o.url||"",i="",s="";if(t.startsWith("/__app-api?")){let l=new URL(t,"http://sootsim.local");i=l.searchParams.get("path")||"",s=l.searchParams.get("origin")?.trim()||""}else if(t.startsWith("/__app-api/"))i=t.slice(10);else return!1;if(!s)return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: missing origin query param"),!0;if(o.method==="OPTIONS")return e.writeHead(204,{"Access-Control-Allow-Origin":o.headers.origin||"*","Access-Control-Allow-Methods":"GET,POST,PUT,PATCH,DELETE,OPTIONS","Access-Control-Allow-Headers":o.headers["access-control-request-headers"]||"*","Access-Control-Allow-Credentials":"true","Access-Control-Max-Age":"86400"}),e.end(),!0;let n;try{n=new URL(i,s)}catch{return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: invalid origin or path"),!0}let c=n.protocol==="https:"?Le:_e,r=st(o.headers,n),a=c.request({hostname:n.hostname,port:n.port||(n.protocol==="https:"?443:80),path:n.pathname+n.search,method:o.method,headers:r,...Be(n)},l=>{let d=Object.keys(l.headers).filter(p=>{let u=p.toLowerCase();return!u.startsWith("access-control-")&&u!=="set-cookie"}).join(", ");e.writeHead(l.statusCode??502,{...l.headers,"access-control-allow-origin":o.headers.origin||"*","access-control-allow-credentials":"true","access-control-expose-headers":d}),l.pipe(e)});return a.on("error",l=>{e.statusCode=502,e.end(`app proxy error: ${l.message}`)}),o.pipe(a),!0}import{WebSocket as T,WebSocketServer as ot}from"ws";var at="/__websocket-proxy",ct=new Set(["host","connection","upgrade","transfer-encoding","content-length","sec-websocket-accept","sec-websocket-extensions","sec-websocket-key","sec-websocket-protocol","sec-websocket-version"]);function I(o,e,t){try{o.write(`HTTP/1.1 ${e} ${t}\r
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as l}from"./chunk-FT2XATWO.js";import{d as V,f as q,g as J,i as N,j as F}from"./chunk-63EKEKDF.js";import{b as k,c as L}from"./chunk-RYPPRVBM.js";import{c as w}from"./chunk-C3GMSIRT.js";import"./chunk-2KSLGBIU.js";import{f as m}from"./chunk-R7AS52NA.js";import"./chunk-2TRPGEZE.js";import"./chunk-ZNK3ZAA5.js";import"./chunk-M2LP2VYQ.js";import"./chunk-EPZUFQMX.js";import"./chunk-GH2OE6F6.js";import"./chunk-NLTJE335.js";import"./chunk-IS5OOCN5.js";import"./chunk-LKAAQBT6.js";import{A as v,B as E,H as R,K as C,M as I,l as b}from"./chunk-XBBNRESY.js";import{a as T}from"./chunk-3S7UEXZW.js";import"./chunk-EWRPLFYI.js";import"./chunk-XKAXZ4DS.js";import P from"node:fs";import U from"node:os";import $ from"node:path";import{spawn as ne}from"node:child_process";import u from"node:fs";import s from"node:path";function B(e){let n=s.resolve(e);for(;;){if(u.existsSync(s.join(n,"package.json")))return n;let o=s.dirname(n);if(o===n)return null;n=o}}function j(e){let n=s.resolve(e);for(;;){if(u.existsSync(s.join(n,"bun.lock"))||u.existsSync(s.join(n,"bun.lockb")))return"bun";if(u.existsSync(s.join(n,"pnpm-lock.yaml")))return"pnpm";if(u.existsSync(s.join(n,"package-lock.json")))return"npm";let o=s.dirname(n);if(o===n)return"npm";n=o}}function Y(e){let n=s.resolve(e.appDir),o=oe(s.join(n,"package.json")),t=o.scripts?.sootsim;if(t&&t!=="sootsim open")throw new Error(`package.json already defines scripts.sootsim as ${JSON.stringify(t)}; resolve that conflict before setup`);let r=j(n),i=[];return o.devDependencies?.sootsim!==e.cliVersion&&i.push(te(r,e.cliVersion)),t!=="sootsim open"&&i.push(se(r)),{appDir:n,packageManager:r,operations:i}}async function H(e,n){for(let o of e.operations)n.dryRun||await ie(o,e.appDir,n.json)}function O(e){return e.operations.map(n=>`${n.command} ${n.args.map(re).join(" ")}`)}function oe(e){let n;try{n=JSON.parse(u.readFileSync(e,"utf8"))}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(`could not read ${e}: ${i}`)}if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`${e} must contain a JSON object`);let o=W(Reflect.get(n,"scripts")),t=W(Reflect.get(n,"devDependencies"));return{...o?{scripts:o}:{},...t?{devDependencies:t}:{}}}function W(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let n=Object.entries(e).filter(o=>typeof o[1]=="string");return Object.fromEntries(n)}function te(e,n){let o=`sootsim@${n}`;switch(e){case"bun":return{command:"bun",args:["add","--dev","--exact",o],description:`install ${o} as an exact dev dependency`};case"pnpm":return{command:"pnpm",args:["add","--save-dev","--save-exact",o],description:`install ${o} as an exact dev dependency`};case"npm":return{command:"npm",args:["install","--save-dev","--save-exact",o],description:`install ${o} as an exact dev dependency`}}}function re(e){return/^[a-zA-Z0-9_./@=-]+$/.test(e)?e:JSON.stringify(e)}function ie(e,n,o){return new Promise((t,r)=>{let i=ne(e.command,e.args,{cwd:n,stdio:o?["ignore",2,"inherit"]:"inherit"});i.once("error",r),i.once("exit",c=>{c===0?t():r(new Error(`${e.command} exited with code ${c??"unknown"}`))})})}function se(e){return{command:e,args:e==="bun"?["pm","pkg","set","scripts.sootsim=sootsim open"]:["pkg","set","scripts.sootsim=sootsim open"],description:"add the `sootsim` package script"}}async function We(e){if(e.includes("--help")||e.includes("-h")){je();return}let n=pe(e),o="decisions";try{let t=B(n.appDir),r=k(),i=v(),c=await ue(n,r),Q=await le(n,t),y=await Z(n,"productAnalytics",i.productAnalytics,i.configured),g=await Z(n,"crashReports",i.crashReports,i.configured),X=await m.fetchManifest(),d=m.resolveVersion(X,{channel:"stable"}).version,D=T();if(D==="0.0.0")throw new Error("could not resolve the installed SootSim CLI version");let a=null;Q&&t&&(a=Y({appDir:t,cliVersion:D})),Se(n),he(n,r,c,d),be(n,t,a),ve(n,y,g),o="runtime";let A=!1;if(!n.dryRun){let _=R();A=(await m.install({version:d,channel:"stable",setActive:!0,protectVersions:_?[_]:[]})).installed}o="repository",a&&await H(a,{dryRun:n.dryRun,json:n.json}),o="service";let S=r.installed;c&&!r.installed&&!n.dryRun&&(await L({port:7668,force:!1}),S=!0),o="privacy",n.dryRun||E({productAnalytics:y,crashReports:g}),o="compatibility";let p=t?fe(t):null,h=await de(n,p);h&&p&&t&&!n.dryRun&&await me(t,p),Re(n,p,h);let M={runtimeVersion:d,serviceInstalled:S,repositoryPrepared:a!==null,compatibilityShared:h&&!n.dryRun},ee=ge(d);n.json?console.log(JSON.stringify({...M,runtimeInstalled:n.dryRun?!1:A,dryRun:n.dryRun,cache:ee,repositoryOperations:a?O(a):[]},null,2)):we(a);let f=p?q(p):null;return w({event:"cli_setup_completed",properties:{service_installed:S,repository_prepared:a!==null,product_analytics:y,crash_reports:g,compat_supported:f?.supported??0,compat_partial:f?.partial??0,compat_unsupported:f?.unsupported??0,compat_not_yet_verified:f?.notYetVerified??0,from_welcome:n.fromWelcome,ci:n.ci,dry_run:n.dryRun}}),M}catch(t){let r=ke(t);throw w({event:"cli_setup_failed",properties:{stage:o,message:r}}),t}}function ce(){let e=k(),n=C(),o=R();return{daemonSupported:e.supported,daemonInstalled:e.installed,daemonRunning:!!(n&&I(n)),runtimeInstalled:!!(o&&P.existsSync(b(o))),privacyConfigured:v().configured}}function Be(e=ce()){return!e.runtimeInstalled||!e.privacyConfigured}function pe(e){let n=e.indexOf("--app"),o=n>=0?e[n+1]:void 0;if(n>=0&&(!o||o.startsWith("-")))throw new Error("--app requires a directory");let t=z(e,"--service","--no-service"),r=z(e,"--repo","--no-repo");return{appDir:$.resolve(o??process.cwd()),ci:e.includes("--ci"),dryRun:e.includes("--dry-run"),fromWelcome:e.includes("--from-welcome"),json:e.includes("--json"),yes:e.includes("--yes")||e.includes("-y"),service:t,repository:r,productAnalytics:G(e,"--analytics"),crashReports:G(e,"--crash-reports"),shareCompatibility:e.includes("--share-compat")}}function z(e,n,o){if(e.includes(n)&&e.includes(o))throw new Error(`${n} and ${o} cannot be used together`);if(e.includes(n))return!0;if(e.includes(o))return!1}function G(e,n){let o=e.find(i=>i.startsWith(`${n}=`)),t=e.indexOf(n),r=o?.slice(n.length+1)??(t>=0?e[t+1]:void 0);if(r!==void 0){if(r==="on"||r==="yes"||r==="true")return!0;if(r==="off"||r==="no"||r==="false")return!1;throw new Error(`${n} must be on or off`)}}async function ue(e,n){if(e.ci){if(e.service===!0)throw new Error("--ci cannot install a machine service");return!1}return n.supported?n.installed&&e.service===void 0?!0:e.service!==void 0?e.service:e.yes?!0:(x(e,"--service or --no-service"),l("Install the background service and shared managed runtime?",!0)):!1}async function le(e,n){if(!n){if(e.repository===!0)throw new Error("--repo requires a package.json");return!1}return e.repository!==void 0?e.repository:e.yes?!0:(x(e,"--repo or --no-repo"),l(`Prepare ${n} for reproducible SootSim runs?`,!0))}async function Z(e,n,o,t){let r=n==="productAnalytics"?e.productAnalytics:e.crashReports;return r!==void 0?r:t?o:e.yes?!0:(x(e,n==="productAnalytics"?"--analytics on|off":"--crash-reports on|off"),l(n==="productAnalytics"?"Share bounded product analytics?":"Send bounded crash reports?",!0))}async function de(e,n){return n?e.shareCompatibility?!0:e.yes||!process.stdin.isTTY?!1:l("Share dependency names, requested versions, framework, and this compatibility result?",!1):!1}function x(e,n){if(!(process.stdin.isTTY&&!e.ci))throw new Error(`non-interactive setup requires ${n}, or --yes to accept defaults`)}function fe(e){let n=JSON.parse(P.readFileSync($.join(e,"package.json"),"utf8"));if(!n||typeof n!="object")throw new Error("package.json must contain an object");return V(n)}async function me(e,n){let o=JSON.parse(P.readFileSync($.join(e,"package.json"),"utf8"));if(!o||typeof o!="object")throw new Error("package.json must be an object");let t=await fetch("https://contrast.dev/api/scan",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(ye(o,n)),signal:AbortSignal.timeout(1e4)});if(!t.ok)throw new Error(`compatibility sharing failed with HTTP ${t.status}`)}function ye(e,n){return{dependencies:K(Reflect.get(e,"dependencies")),devDependencies:K(Reflect.get(e,"devDependencies")),framework:n.framework,result:{framework:n.framework,rnVersion:n.rnVersion,packages:n.packages.slice(0,200)},source:"desktop",shared:!0}}function K(e){if(!e||typeof e!="object")return{};let n={};for(let[o,t]of Object.entries(e).slice(0,200))typeof t=="string"&&(n[o.slice(0,160)]=t.slice(0,80));return n}function ge(e){let n=U.platform(),o=U.arch();return{path:b(e),key:`sootsim-runtime-${n}-${o}-${e}`,inputs:{platform:n,arch:o,runtimeVersion:e}}}function Se(e){e.json||console.log(`
4
+ import{a as l}from"./chunk-6JYTKF5O.js";import{d as V,f as q,g as J,i as N,j as F}from"./chunk-7PHOEBKV.js";import{b as k,c as L}from"./chunk-3Y6476ZM.js";import{c as w}from"./chunk-RATCQLQA.js";import"./chunk-ZB3UAYJ4.js";import{f as m}from"./chunk-W4S7GGPG.js";import"./chunk-QILKSUH6.js";import"./chunk-GFKP5JIA.js";import"./chunk-VJMY2MX6.js";import"./chunk-ZDQO6TJQ.js";import"./chunk-J6ZKDIRN.js";import"./chunk-F2WH6XM7.js";import"./chunk-VNS6KYRJ.js";import"./chunk-6QZY6YO2.js";import{A as v,B as E,H as R,K as C,M as I,l as b}from"./chunk-SKGITCWL.js";import{a as T}from"./chunk-HI5MWY32.js";import"./chunk-P7MI3VFY.js";import"./chunk-YOIHAHR5.js";import P from"node:fs";import U from"node:os";import $ from"node:path";import{spawn as ne}from"node:child_process";import u from"node:fs";import s from"node:path";function B(e){let n=s.resolve(e);for(;;){if(u.existsSync(s.join(n,"package.json")))return n;let o=s.dirname(n);if(o===n)return null;n=o}}function j(e){let n=s.resolve(e);for(;;){if(u.existsSync(s.join(n,"bun.lock"))||u.existsSync(s.join(n,"bun.lockb")))return"bun";if(u.existsSync(s.join(n,"pnpm-lock.yaml")))return"pnpm";if(u.existsSync(s.join(n,"package-lock.json")))return"npm";let o=s.dirname(n);if(o===n)return"npm";n=o}}function Y(e){let n=s.resolve(e.appDir),o=oe(s.join(n,"package.json")),t=o.scripts?.sootsim;if(t&&t!=="sootsim open")throw new Error(`package.json already defines scripts.sootsim as ${JSON.stringify(t)}; resolve that conflict before setup`);let r=j(n),i=[];return o.devDependencies?.sootsim!==e.cliVersion&&i.push(te(r,e.cliVersion)),t!=="sootsim open"&&i.push(se(r)),{appDir:n,packageManager:r,operations:i}}async function H(e,n){for(let o of e.operations)n.dryRun||await ie(o,e.appDir,n.json)}function O(e){return e.operations.map(n=>`${n.command} ${n.args.map(re).join(" ")}`)}function oe(e){let n;try{n=JSON.parse(u.readFileSync(e,"utf8"))}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(`could not read ${e}: ${i}`)}if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`${e} must contain a JSON object`);let o=W(Reflect.get(n,"scripts")),t=W(Reflect.get(n,"devDependencies"));return{...o?{scripts:o}:{},...t?{devDependencies:t}:{}}}function W(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let n=Object.entries(e).filter(o=>typeof o[1]=="string");return Object.fromEntries(n)}function te(e,n){let o=`sootsim@${n}`;switch(e){case"bun":return{command:"bun",args:["add","--dev","--exact",o],description:`install ${o} as an exact dev dependency`};case"pnpm":return{command:"pnpm",args:["add","--save-dev","--save-exact",o],description:`install ${o} as an exact dev dependency`};case"npm":return{command:"npm",args:["install","--save-dev","--save-exact",o],description:`install ${o} as an exact dev dependency`}}}function re(e){return/^[a-zA-Z0-9_./@=-]+$/.test(e)?e:JSON.stringify(e)}function ie(e,n,o){return new Promise((t,r)=>{let i=ne(e.command,e.args,{cwd:n,stdio:o?["ignore",2,"inherit"]:"inherit"});i.once("error",r),i.once("exit",c=>{c===0?t():r(new Error(`${e.command} exited with code ${c??"unknown"}`))})})}function se(e){return{command:e,args:e==="bun"?["pm","pkg","set","scripts.sootsim=sootsim open"]:["pkg","set","scripts.sootsim=sootsim open"],description:"add the `sootsim` package script"}}async function We(e){if(e.includes("--help")||e.includes("-h")){je();return}let n=pe(e),o="decisions";try{let t=B(n.appDir),r=k(),i=v(),c=await ue(n,r),Q=await le(n,t),y=await Z(n,"productAnalytics",i.productAnalytics,i.configured),g=await Z(n,"crashReports",i.crashReports,i.configured),X=await m.fetchManifest(),d=m.resolveVersion(X,{channel:"stable"}).version,D=T();if(D==="0.0.0")throw new Error("could not resolve the installed SootSim CLI version");let a=null;Q&&t&&(a=Y({appDir:t,cliVersion:D})),Se(n),he(n,r,c,d),be(n,t,a),ve(n,y,g),o="runtime";let A=!1;if(!n.dryRun){let _=R();A=(await m.install({version:d,channel:"stable",setActive:!0,protectVersions:_?[_]:[]})).installed}o="repository",a&&await H(a,{dryRun:n.dryRun,json:n.json}),o="service";let S=r.installed;c&&!r.installed&&!n.dryRun&&(await L({port:7668,force:!1}),S=!0),o="privacy",n.dryRun||E({productAnalytics:y,crashReports:g}),o="compatibility";let p=t?fe(t):null,h=await de(n,p);h&&p&&t&&!n.dryRun&&await me(t,p),Re(n,p,h);let M={runtimeVersion:d,serviceInstalled:S,repositoryPrepared:a!==null,compatibilityShared:h&&!n.dryRun},ee=ge(d);n.json?console.log(JSON.stringify({...M,runtimeInstalled:n.dryRun?!1:A,dryRun:n.dryRun,cache:ee,repositoryOperations:a?O(a):[]},null,2)):we(a);let f=p?q(p):null;return w({event:"cli_setup_completed",properties:{service_installed:S,repository_prepared:a!==null,product_analytics:y,crash_reports:g,compat_supported:f?.supported??0,compat_partial:f?.partial??0,compat_unsupported:f?.unsupported??0,compat_not_yet_verified:f?.notYetVerified??0,from_welcome:n.fromWelcome,ci:n.ci,dry_run:n.dryRun}}),M}catch(t){let r=ke(t);throw w({event:"cli_setup_failed",properties:{stage:o,message:r}}),t}}function ce(){let e=k(),n=C(),o=R();return{daemonSupported:e.supported,daemonInstalled:e.installed,daemonRunning:!!(n&&I(n)),runtimeInstalled:!!(o&&P.existsSync(b(o))),privacyConfigured:v().configured}}function Be(e=ce()){return!e.runtimeInstalled||!e.privacyConfigured}function pe(e){let n=e.indexOf("--app"),o=n>=0?e[n+1]:void 0;if(n>=0&&(!o||o.startsWith("-")))throw new Error("--app requires a directory");let t=z(e,"--service","--no-service"),r=z(e,"--repo","--no-repo");return{appDir:$.resolve(o??process.cwd()),ci:e.includes("--ci"),dryRun:e.includes("--dry-run"),fromWelcome:e.includes("--from-welcome"),json:e.includes("--json"),yes:e.includes("--yes")||e.includes("-y"),service:t,repository:r,productAnalytics:G(e,"--analytics"),crashReports:G(e,"--crash-reports"),shareCompatibility:e.includes("--share-compat")}}function z(e,n,o){if(e.includes(n)&&e.includes(o))throw new Error(`${n} and ${o} cannot be used together`);if(e.includes(n))return!0;if(e.includes(o))return!1}function G(e,n){let o=e.find(i=>i.startsWith(`${n}=`)),t=e.indexOf(n),r=o?.slice(n.length+1)??(t>=0?e[t+1]:void 0);if(r!==void 0){if(r==="on"||r==="yes"||r==="true")return!0;if(r==="off"||r==="no"||r==="false")return!1;throw new Error(`${n} must be on or off`)}}async function ue(e,n){if(e.ci){if(e.service===!0)throw new Error("--ci cannot install a machine service");return!1}return n.supported?n.installed&&e.service===void 0?!0:e.service!==void 0?e.service:e.yes?!0:(x(e,"--service or --no-service"),l("Install the background service and shared managed runtime?",!0)):!1}async function le(e,n){if(!n){if(e.repository===!0)throw new Error("--repo requires a package.json");return!1}return e.repository!==void 0?e.repository:e.yes?!0:(x(e,"--repo or --no-repo"),l(`Prepare ${n} for reproducible SootSim runs?`,!0))}async function Z(e,n,o,t){let r=n==="productAnalytics"?e.productAnalytics:e.crashReports;return r!==void 0?r:t?o:e.yes?!0:(x(e,n==="productAnalytics"?"--analytics on|off":"--crash-reports on|off"),l(n==="productAnalytics"?"Share bounded product analytics?":"Send bounded crash reports?",!0))}async function de(e,n){return n?e.shareCompatibility?!0:e.yes||!process.stdin.isTTY?!1:l("Share dependency names, requested versions, framework, and this compatibility result?",!1):!1}function x(e,n){if(!(process.stdin.isTTY&&!e.ci))throw new Error(`non-interactive setup requires ${n}, or --yes to accept defaults`)}function fe(e){let n=JSON.parse(P.readFileSync($.join(e,"package.json"),"utf8"));if(!n||typeof n!="object")throw new Error("package.json must contain an object");return V(n)}async function me(e,n){let o=JSON.parse(P.readFileSync($.join(e,"package.json"),"utf8"));if(!o||typeof o!="object")throw new Error("package.json must be an object");let t=await fetch("https://contrast.dev/api/scan",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(ye(o,n)),signal:AbortSignal.timeout(1e4)});if(!t.ok)throw new Error(`compatibility sharing failed with HTTP ${t.status}`)}function ye(e,n){return{dependencies:K(Reflect.get(e,"dependencies")),devDependencies:K(Reflect.get(e,"devDependencies")),framework:n.framework,result:{framework:n.framework,rnVersion:n.rnVersion,packages:n.packages.slice(0,200)},source:"desktop",shared:!0}}function K(e){if(!e||typeof e!="object")return{};let n={};for(let[o,t]of Object.entries(e).slice(0,200))typeof t=="string"&&(n[o.slice(0,160)]=t.slice(0,80));return n}function ge(e){let n=U.platform(),o=U.arch();return{path:b(e),key:`sootsim-runtime-${n}-${o}-${e}`,inputs:{platform:n,arch:o,runtimeVersion:e}}}function Se(e){e.json||console.log(`
5
5
  ${e.fromWelcome?"welcome to sootsim":"sootsim setup"}`)}function he(e,n,o,t){e.json||(console.log(`
6
6
  1. machine`),console.log(` stable runtime: ${t}`),console.log(` background service: ${n.supported?o?"install":"skip":"unsupported on this platform"}`))}function be(e,n,o){if(!e.json){if(console.log(`
7
7
  2. repository`),!n){console.log(" no package.json found; repository preparation skipped");return}if(!o){console.log(` skipped for ${n}`);return}console.log(` package manager: ${j(n)}`);for(let t of O(o))console.log(` ${e.dryRun?"would run":"run"}: ${t}`)}}function ve(e,n,o){e.json||(console.log(`
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import"./chunk-XKAXZ4DS.js";import*as i from"fs";import*as I from"os";import*as a from"path";import{fileURLToPath as h}from"url";function $(){try{let t=h(import.meta.resolve("sootsim/package.json"));return a.join(a.dirname(t),"skills")}catch{let t=a.dirname(h(import.meta.url));return a.resolve(t,"../../skills")}}var d=$(),w=new Set(["all","codex","claude"]);function S(){console.log(`sootsim skill
4
+ import"./chunk-YOIHAHR5.js";import*as i from"fs";import*as I from"os";import*as a from"path";import{fileURLToPath as h}from"url";function $(){try{let t=h(import.meta.resolve("sootsim/package.json"));return a.join(a.dirname(t),"skills")}catch{let t=a.dirname(h(import.meta.url));return a.resolve(t,"../../skills")}}var d=$(),w=new Set(["all","codex","claude"]);function S(){console.log(`sootsim skill
5
5
 
6
6
  install and inspect bundled SootSim agent skills.
7
7
 
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{j as f}from"./chunk-SY7E43UY.js";import"./chunk-QPZVGHRV.js";import"./chunk-63JWRDM6.js";import"./chunk-YRRUK3EK.js";import"./chunk-S7WXPIOY.js";import"./chunk-3EO5JEG7.js";import"./chunk-MUQDPJUP.js";import"./chunk-YZPSUNTO.js";import"./chunk-4XMPRQGE.js";import{a as t,b as n,c as l,d as c,e as a}from"./chunk-XMOULANJ.js";import"./chunk-RX4CFOVV.js";import"./chunk-VAGUPECL.js";import"./chunk-STWCCIBA.js";import"./chunk-Z6H5FR3U.js";import"./chunk-BFNAFH27.js";import"./chunk-66Z2ADUQ.js";import"./chunk-YIJFCR5T.js";import"./chunk-7RJEULWN.js";import"./chunk-ZS7OXPHR.js";import"./chunk-RMIKUUCO.js";import"./chunk-R7AS52NA.js";import"./chunk-M2LP2VYQ.js";import"./chunk-EPZUFQMX.js";import"./chunk-GH2OE6F6.js";import"./chunk-NLTJE335.js";import"./chunk-IS5OOCN5.js";import"./chunk-LKAAQBT6.js";import"./chunk-XBBNRESY.js";import"./chunk-XKAXZ4DS.js";function p(){console.log(`
4
+ import{j as f}from"./chunk-CKMQ2YXQ.js";import"./chunk-CUVLXG63.js";import"./chunk-GEUU2WIL.js";import"./chunk-75YOUNTE.js";import"./chunk-7W63IKAP.js";import"./chunk-KGIXNUUM.js";import"./chunk-QCEMDWL4.js";import"./chunk-Y7RQGSZD.js";import"./chunk-S5U22PVL.js";import{a as t,b as n,c as l,d as c,e as a}from"./chunk-VAFDFOE6.js";import"./chunk-ULJT3HDO.js";import"./chunk-WTNKX7QD.js";import"./chunk-Y5O5GK2Q.js";import"./chunk-75KNNHMR.js";import"./chunk-KKXSWEYS.js";import"./chunk-QUAY5AZB.js";import"./chunk-PHFRI2QF.js";import"./chunk-EHBHUE6S.js";import"./chunk-YS7YDOGW.js";import"./chunk-PJ27D3WO.js";import"./chunk-W4S7GGPG.js";import"./chunk-VJMY2MX6.js";import"./chunk-ZDQO6TJQ.js";import"./chunk-J6ZKDIRN.js";import"./chunk-F2WH6XM7.js";import"./chunk-VNS6KYRJ.js";import"./chunk-6QZY6YO2.js";import"./chunk-SKGITCWL.js";import"./chunk-YOIHAHR5.js";function p(){console.log(`
5
5
  sootsim storage profile \u2014 manage isolated storage profiles
6
6
 
7
7
  usage:
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a}from"./chunk-75KNNHMR.js";import"./chunk-J6ZKDIRN.js";import"./chunk-YOIHAHR5.js";export{a as settingsStore};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c as a,d as b}from"./chunk-RATCQLQA.js";import"./chunk-ZB3UAYJ4.js";import"./chunk-SKGITCWL.js";import"./chunk-YOIHAHR5.js";export{b as flushCliTelemetry,a as trackCliEvent};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{h as m,j as d,m as s}from"./chunk-7RJEULWN.js";import"./chunk-NLTJE335.js";import"./chunk-IS5OOCN5.js";import"./chunk-XBBNRESY.js";import"./chunk-XKAXZ4DS.js";import{writeFileSync as g}from"fs";function u(){console.log(`
4
+ import{h as m,j as d,m as s}from"./chunk-EHBHUE6S.js";import"./chunk-F2WH6XM7.js";import"./chunk-VNS6KYRJ.js";import"./chunk-SKGITCWL.js";import"./chunk-YOIHAHR5.js";import{writeFileSync as g}from"fs";function u(){console.log(`
5
5
  sootsim timeline \u2014 control the semantic event timeline
6
6
 
7
7
  usage:
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as h,b as v,c as $}from"./chunk-TAQV44LZ.js";import{b as p}from"./chunk-66Z2ADUQ.js";import"./chunk-YIJFCR5T.js";import"./chunk-7RJEULWN.js";import{b as g}from"./chunk-R7AS52NA.js";import"./chunk-NLTJE335.js";import"./chunk-IS5OOCN5.js";import{H as a,g as m,h as u,l as d}from"./chunk-XBBNRESY.js";import{a as f}from"./chunk-3S7UEXZW.js";import"./chunk-XKAXZ4DS.js";import{spawn as y}from"node:child_process";import k from"node:fs";import R from"node:os";import r from"node:path";var b="https://registry.npmjs.org/sootsim/latest";async function W(o){let n=o.indexOf("--channel"),t=n>=0&&o[n+1]?o[n+1]:void 0;console.log(`sootsim upgrade
4
+ import{a as h,b as v,c as $}from"./chunk-6SICKWPQ.js";import{b as p}from"./chunk-QUAY5AZB.js";import"./chunk-PHFRI2QF.js";import"./chunk-EHBHUE6S.js";import{b as g}from"./chunk-W4S7GGPG.js";import"./chunk-F2WH6XM7.js";import"./chunk-VNS6KYRJ.js";import{H as a,g as m,h as u,l as d}from"./chunk-SKGITCWL.js";import{a as f}from"./chunk-HI5MWY32.js";import"./chunk-YOIHAHR5.js";import{spawn as y}from"node:child_process";import k from"node:fs";import R from"node:os";import r from"node:path";var b="https://registry.npmjs.org/sootsim/latest";async function W(o){let n=o.indexOf("--channel"),t=n>=0&&o[n+1]?o[n+1]:void 0;console.log(`sootsim upgrade
5
5
  `),console.log("runtime:");let e=a(),{config:l}=await p(),s=l?.runtimeVersion,c=s?k.existsSync(r.join(d(s),"index.html")):!1;s&&console.log(` project config: v${s}`);let i=(s&&c?null:await $(["install",...s?[s,"--set-active=false"]:[],...t?["--channel",t]:[]],{}))?.version??s??a();i&&console.log(s?c?` result: v${i} already installed for this project`:` result: not installed \u2192 v${i} for this project`:e&&e!==i?` result: v${e} \u2192 v${i}`:e?` result: v${i} already current`:` result: not installed \u2192 v${i}`);let x=i?await h(i):null;console.log(`
6
6
  cli:`),await j(),i&&console.log(`
7
7
  ${v(i,x)}`)}function w(){if(u())return{kind:"dev"};let o=process.argv[1]??"";try{o=k.realpathSync(o)}catch{}let n=r.sep;if(o.includes(`${n}_npx${n}`)||o.includes(`${n}.bunx${n}`))return{kind:"npx"};if(o.includes(`${n}.bun${n}`))return{kind:"global",command:"bun",args:["add","-g","sootsim@latest"]};if(o.includes(`${n}pnpm${n}`))return{kind:"global",command:"pnpm",args:["add","-g","sootsim@latest"]};let t=r.join(m(),"cli");if(o.startsWith(`${t}${n}`))return{kind:"global",command:"npm",args:["i","-g","--prefix",t,"sootsim@latest"]};let e=r.resolve(process.env.SOOTSIM_CLI_PREFIX||r.join(R.homedir(),".local"));return o.startsWith(`${e}${n}`)?{kind:"global",command:"npm",args:["i","-g","--prefix",e,"sootsim@latest"]}:{kind:"global",command:"npm",args:["i","-g","sootsim@latest"]}}async function j(){let o=f(),n=await C();if(!n){console.log(` v${o} \u2014 couldn't reach the npm registry, skipped`);return}if(g(n,o)<=0){console.log(` v${o} (latest)`);return}let t=w();if(console.log(` v${o} \u2192 v${n}`),t.kind==="dev"){console.log(" running from the Contrast dev checkout \u2014 pull instead of upgrading");return}if(t.kind==="npx"){console.log(" running from the npx cache \u2014 get the latest with:"),console.log(" npx sootsim@latest");return}let e=`${t.command} ${t.args.join(" ")}`;console.log(` updating global install (${e})\u2026`),await S(t.command,t.args)?console.log(` updated to v${n}`):(console.log(" update failed \u2014 run it yourself:"),console.log(` ${e}`))}function S(o,n){return new Promise(t=>{let e=y(o,n,{stdio:"inherit"});e.on("error",()=>t(!1)),e.on("exit",l=>t(l===0))})}async function C(){try{let o=await fetch(b,{headers:{accept:"application/json"},signal:AbortSignal.timeout(8e3)});if(!o.ok)return null;let n=await o.json();return typeof n.version=="string"&&n.version?n.version:null}catch{return null}}export{W as runUpgrade};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{e as a,f as b,g as c}from"./chunk-5V5MOREL.js";import"./chunk-ZHPLBK34.js";import"./chunk-WTNKX7QD.js";import"./chunk-Y5O5GK2Q.js";import"./chunk-KKXSWEYS.js";import"./chunk-PHFRI2QF.js";import"./chunk-EHBHUE6S.js";import"./chunk-RATCQLQA.js";import"./chunk-ZB3UAYJ4.js";import"./chunk-F2WH6XM7.js";import"./chunk-VNS6KYRJ.js";import"./chunk-SKGITCWL.js";import"./chunk-YOIHAHR5.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};
@@ -1,6 +1,6 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{b as a}from"./chunk-66Z2ADUQ.js";import"./chunk-YIJFCR5T.js";import{d as r,f as e}from"./chunk-R7AS52NA.js";import{a as m}from"./chunk-ZNK3ZAA5.js";import{l as s}from"./chunk-XBBNRESY.js";import{a as l}from"./chunk-3S7UEXZW.js";import"./chunk-XKAXZ4DS.js";import g from"node:fs";import d from"node:path";async function V($){let{IS_BETA:c,BETA_LABEL:u}=await import("./beta-NM7T7MDN.js"),f=c?` \xB7 ${u}`:"";console.log(`sootsim v${l()}${f}`);let o=m(),i=e.resolveChannel();o.isDevBridge?(console.log(o.primary),o.installedRuntime&&console.log(`${o.installedRuntime} \xB7 ${i}`)):o.primary==="runtime not installed"?console.log("runtime not installed \u2014 run `sootsim runtime install`"):console.log(`${o.primary} \xB7 ${i}`);let{config:n}=await a();if(n?.runtimeVersion){let p=g.existsSync(d.join(s(n.runtimeVersion),"index.html"));console.log(`project runtime v${n.runtimeVersion} \xB7 configured \xB7 ${p?"installed":"installs on open"}`)}let t=await e.checkUpToDate({channel:i});t.outdated&&t.latest&&console.log(`
4
+ import{b as a}from"./chunk-QUAY5AZB.js";import"./chunk-PHFRI2QF.js";import{d as r,f as e}from"./chunk-W4S7GGPG.js";import{a as m}from"./chunk-GFKP5JIA.js";import{l as s}from"./chunk-SKGITCWL.js";import{a as l}from"./chunk-HI5MWY32.js";import"./chunk-YOIHAHR5.js";import g from"node:fs";import d from"node:path";async function V($){let{IS_BETA:c,BETA_LABEL:u}=await import("./beta-L5QKFHWI.js"),f=c?` \xB7 ${u}`:"";console.log(`sootsim v${l()}${f}`);let o=m(),i=e.resolveChannel();o.isDevBridge?(console.log(o.primary),o.installedRuntime&&console.log(`${o.installedRuntime} \xB7 ${i}`)):o.primary==="runtime not installed"?console.log("runtime not installed \u2014 run `sootsim runtime install`"):console.log(`${o.primary} \xB7 ${i}`);let{config:n}=await a();if(n?.runtimeVersion){let p=g.existsSync(d.join(s(n.runtimeVersion),"index.html"));console.log(`project runtime v${n.runtimeVersion} \xB7 configured \xB7 ${p?"installed":"installs on open"}`)}let t=await e.checkUpToDate({channel:i});t.outdated&&t.latest&&console.log(`
5
5
  \u2191 default runtime v${t.latest} available; run \`sootsim upgrade\``),console.log(`
6
6
  what's new: ${r}`)}export{V as runVersion};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a,b,c,d,e,f,g,h,i,j}from"./chunk-63EKEKDF.js";import"./chunk-XKAXZ4DS.js";export{b as COMPAT_CATEGORIES,j as COMPAT_RESULT_CAVEAT,c as POLYFILL_REGISTRY,a as UNSUPPORTABLE,f as countScanResults,i as formatDetailedScanLines,h as formatPackageStatus,g as formatScanCounts,d as scanDeps,e as scanDepsWithData};
4
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-7PHOEBKV.js";import"./chunk-YOIHAHR5.js";export{b as COMPAT_CATEGORIES,j as COMPAT_RESULT_CAVEAT,c as POLYFILL_REGISTRY,a as UNSUPPORTABLE,f as countScanResults,i as formatDetailedScanLines,h as formatPackageStatus,g as formatScanCounts,d as scanDeps,e as scanDepsWithData};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{D as N,E as F,G as y,R as T,S as b,T as S}from"./chunk-4XMPRQGE.js";import{h as A,j as _}from"./chunk-7RJEULWN.js";import{f as k}from"./chunk-NLTJE335.js";import"./chunk-IS5OOCN5.js";import"./chunk-XBBNRESY.js";import"./chunk-XKAXZ4DS.js";function O(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--since"&&e+1<n.length){t.push(e,e+1);let s=n[e+1].trim(),l=/^(\d+(?:\.\d+)?)(ms|s|m)?$/.exec(s);if(l){let r=Number(l[1]),u=l[2]??"ms",v=u==="s"?r*1e3:u==="m"?r*6e4:r;return{since:Date.now()-v,consumed:t}}let i=Number(s);if(Number.isFinite(i)&&i>1e12)return{since:i,consumed:t}}return{consumed:t}}function B(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--kinds"&&e+1<n.length)return t.push(e,e+1),{kinds:n[e+1].split(",").map(s=>s.trim()).filter(Boolean),consumed:t};return{consumed:t}}function D(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--limit"&&e+1<n.length){t.push(e,e+1);let s=Number(n[e+1]);if(Number.isFinite(s)&&s>0)return{limit:s,consumed:t}}return{consumed:t}}function x(n){let t=[],e={label:"initial state",events:[],startedAt:n[0]?.t??null};t.push(e);for(let s of n)if(e.events.push(s),s.kind==="screen"||s.kind==="route"){let l=s.data,i=l?.phase;if(!i||i==="enter"||i==="appear"||i==="active"){let r=l?.name||l?.activeName||l?.path||l?.pathname||s.kind;t.length===1&&e.events.length===1?e.label=`${s.kind}: ${r}`:(e={label:`${s.kind}: ${r}`,events:[],startedAt:s.t},t.push(e))}}return t}async function J(n,t){let e=A(n,{port:t.port,stripBooleanFlags:["--summary","--all","--json","--no-advance","--help","-h","--flow","--noisy"],stripValueFlags:["--since","--kinds","--limit"]});(n.includes("--help")||n.includes("-h"))&&(console.log(`
4
+ import{D as N,E as F,G as y,R as T,S as b,T as S}from"./chunk-S5U22PVL.js";import{h as A,j as _}from"./chunk-EHBHUE6S.js";import{f as k}from"./chunk-F2WH6XM7.js";import"./chunk-VNS6KYRJ.js";import"./chunk-SKGITCWL.js";import"./chunk-YOIHAHR5.js";function O(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--since"&&e+1<n.length){t.push(e,e+1);let s=n[e+1].trim(),l=/^(\d+(?:\.\d+)?)(ms|s|m)?$/.exec(s);if(l){let r=Number(l[1]),u=l[2]??"ms",v=u==="s"?r*1e3:u==="m"?r*6e4:r;return{since:Date.now()-v,consumed:t}}let i=Number(s);if(Number.isFinite(i)&&i>1e12)return{since:i,consumed:t}}return{consumed:t}}function B(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--kinds"&&e+1<n.length)return t.push(e,e+1),{kinds:n[e+1].split(",").map(s=>s.trim()).filter(Boolean),consumed:t};return{consumed:t}}function D(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--limit"&&e+1<n.length){t.push(e,e+1);let s=Number(n[e+1]);if(Number.isFinite(s)&&s>0)return{limit:s,consumed:t}}return{consumed:t}}function x(n){let t=[],e={label:"initial state",events:[],startedAt:n[0]?.t??null};t.push(e);for(let s of n)if(e.events.push(s),s.kind==="screen"||s.kind==="route"){let l=s.data,i=l?.phase;if(!i||i==="enter"||i==="appear"||i==="active"){let r=l?.name||l?.activeName||l?.path||l?.pathname||s.kind;t.length===1&&e.events.length===1?e.label=`${s.kind}: ${r}`:(e={label:`${s.kind}: ${r}`,events:[],startedAt:s.t},t.push(e))}}return t}async function J(n,t){let e=A(n,{port:t.port,stripBooleanFlags:["--summary","--all","--json","--no-advance","--help","-h","--flow","--noisy"],stripValueFlags:["--since","--kinds","--limit"]});(n.includes("--help")||n.includes("-h"))&&(console.log(`
5
5
  sootsim what-happened \u2014 show recent events from the semantic timeline
6
6
 
7
7
  usage:
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/beta.ts
4
4
  var IS_BETA = true;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;