sootsim 0.1.168 → 0.1.169

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 (160) hide show
  1. package/dist-cli/bin.js +3 -3
  2. package/dist-cli/chunks/{agent-V5N6TSVL.js → agent-V3GVCRPL.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-M32Q4WRZ.js → agent-wrapper-Y5FQA3RL.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-QJCMHTWY.js → app-fonts-FYVA4XV6.js} +2 -2
  5. package/dist-cli/chunks/{assert-FUPVKOCV.js → assert-U64QBDM2.js} +2 -2
  6. package/dist-cli/chunks/auto-bootstrap-YXDP3WKH.js +2 -0
  7. package/dist-cli/chunks/beta-FGSMZWLP.js +2 -0
  8. package/dist-cli/chunks/{camera-6Z3YMMEG.js → camera-3GXBVIAM.js} +2 -2
  9. package/dist-cli/chunks/chunk-2IFWVIKM.js +2 -0
  10. package/dist-cli/chunks/{chunk-VHVFXSXT.js → chunk-2TYEWVS4.js} +2 -2
  11. package/dist-cli/chunks/{chunk-QWNLVJ4P.js → chunk-3L4NRJ6C.js} +1 -1
  12. package/dist-cli/chunks/chunk-3T36XLP3.js +119 -0
  13. package/dist-cli/chunks/{chunk-MGB5W5VY.js → chunk-4F3BBP7B.js} +2 -2
  14. package/dist-cli/chunks/{chunk-MHEP6UMF.js → chunk-5C6BR24W.js} +3 -3
  15. package/dist-cli/chunks/{chunk-MQWZBKOF.js → chunk-5KY7TQ42.js} +1 -1
  16. package/dist-cli/chunks/{chunk-BSKD5K5N.js → chunk-5Q7IHJ7K.js} +2 -2
  17. package/dist-cli/chunks/{chunk-ENK2SG5R.js → chunk-B7BMSU7H.js} +1 -1
  18. package/dist-cli/chunks/{chunk-YNTWHWFY.js → chunk-BIWJE7CB.js} +1 -1
  19. package/dist-cli/chunks/chunk-BQOMDL4K.js +1 -0
  20. package/dist-cli/chunks/{chunk-OC4Y3UIV.js → chunk-CR6DOLUD.js} +1 -1
  21. package/dist-cli/chunks/{chunk-LCHPOJOO.js → chunk-DNA6VS6M.js} +1 -1
  22. package/dist-cli/chunks/{chunk-FZ656TJA.js → chunk-DQZEN256.js} +1 -1
  23. package/dist-cli/chunks/{chunk-BLRVSHCX.js → chunk-FHMPJZKM.js} +3 -3
  24. package/dist-cli/chunks/{chunk-QMQBMB4S.js → chunk-FIDPRJYH.js} +2 -2
  25. package/dist-cli/chunks/{chunk-HIAR3KTT.js → chunk-G2ZFDIPK.js} +2 -2
  26. package/dist-cli/chunks/{chunk-MO3L5VGD.js → chunk-GC4THE6K.js} +1 -1
  27. package/dist-cli/chunks/{chunk-BKYCQJKE.js → chunk-GLRFKYDV.js} +2 -2
  28. package/dist-cli/chunks/{chunk-L7F7QBGM.js → chunk-GQAWFQNN.js} +2 -2
  29. package/dist-cli/chunks/{chunk-WUKEI6SL.js → chunk-HC72ILJK.js} +2 -2
  30. package/dist-cli/chunks/{chunk-PPIRXSWS.js → chunk-HJTKKF7M.js} +2 -2
  31. package/dist-cli/chunks/{chunk-TXZKEW6C.js → chunk-IACEJQIO.js} +2 -2
  32. package/dist-cli/chunks/{chunk-QGL6XWHB.js → chunk-IBEMMV5E.js} +2 -2
  33. package/dist-cli/chunks/{chunk-YR7WIUVL.js → chunk-IODOTOOP.js} +2 -2
  34. package/dist-cli/chunks/{chunk-BUCBIG2A.js → chunk-JDGLBW64.js} +1 -1
  35. package/dist-cli/chunks/chunk-K4JAWKOY.js +1 -0
  36. package/dist-cli/chunks/{chunk-QBYYAPTB.js → chunk-KUUFY6FC.js} +1 -1
  37. package/dist-cli/chunks/{chunk-SMBSZIDN.js → chunk-KZIXAYN5.js} +2 -2
  38. package/dist-cli/chunks/{chunk-2DDHS4Z3.js → chunk-LZEL2RU3.js} +1 -1
  39. package/dist-cli/chunks/chunk-M2TMFGZH.js +2 -0
  40. package/dist-cli/chunks/{chunk-IHVCKNFX.js → chunk-MVOHANJG.js} +2 -2
  41. package/dist-cli/chunks/{chunk-L62FIJ3P.js → chunk-NXGQS7IR.js} +1 -1
  42. package/dist-cli/chunks/{chunk-XWG6NJJE.js → chunk-OGLWXPVG.js} +2 -2
  43. package/dist-cli/chunks/{chunk-SHCQRQJA.js → chunk-PV6MBKKE.js} +2 -2
  44. package/dist-cli/chunks/chunk-R2INPDGW.js +1 -0
  45. package/dist-cli/chunks/{chunk-27Q45J2N.js → chunk-SIB6I72P.js} +2 -2
  46. package/dist-cli/chunks/{chunk-4PXQB4KC.js → chunk-SLL5SZN4.js} +1 -1
  47. package/dist-cli/chunks/{chunk-5GGI6NGS.js → chunk-SNX3M4XD.js} +3 -3
  48. package/dist-cli/chunks/{chunk-MRPFNK2L.js → chunk-VMYMPL6H.js} +2 -2
  49. package/dist-cli/chunks/{chunk-XUABY4IN.js → chunk-WZG3YVJR.js} +1 -1
  50. package/dist-cli/chunks/{chunk-JJIJVKAV.js → chunk-X2HNVXNM.js} +2 -2
  51. package/dist-cli/chunks/{chunk-7YQ7CJFO.js → chunk-XEH4QGWB.js} +2 -2
  52. package/dist-cli/chunks/{chunk-N6CHIBHJ.js → chunk-XM66K64H.js} +2 -2
  53. package/dist-cli/chunks/{chunk-AFPKG2L6.js → chunk-Y6IDAARY.js} +1 -1
  54. package/dist-cli/chunks/{chunk-ZIEXUO4S.js → chunk-YADWU7OZ.js} +2 -2
  55. package/dist-cli/chunks/cli-version-3L6FFDIX.js +2 -0
  56. package/dist-cli/chunks/{compat-CH6BYJ4T.js → compat-ORRWNXVT.js} +3 -3
  57. package/dist-cli/chunks/{config-ST33XAYN.js → config-5IB6ONJ2.js} +2 -2
  58. package/dist-cli/chunks/control-BM4V27OB.js +2 -0
  59. package/dist-cli/chunks/{cpu-profile-VMHZN3WB.js → cpu-profile-6PRSBZ2F.js} +2 -2
  60. package/dist-cli/chunks/{daemon-5DEUBHYC.js → daemon-62MZT4G4.js} +2 -2
  61. package/dist-cli/chunks/{debug-WQP3TJ62.js → debug-Q3J2X4WW.js} +3 -3
  62. package/dist-cli/chunks/{detox-IAWL5YVJ.js → detox-DN57GMMJ.js} +2 -2
  63. package/dist-cli/chunks/{device-GYJ6BHY7.js → device-IL5TPYGU.js} +2 -2
  64. package/dist-cli/chunks/{diagnose-GFDUQYHG.js → diagnose-BW6QWP4F.js} +2 -2
  65. package/dist-cli/chunks/drivers-V6QDFZQD.js +2 -0
  66. package/dist-cli/chunks/{electron-CF7HUVQL.js → electron-DGMSXQWG.js} +3 -3
  67. package/dist-cli/chunks/flow-VBM6TU32.js +2 -0
  68. package/dist-cli/chunks/help-XWKNL743.js +2 -0
  69. package/dist-cli/chunks/{hints-HF2LDTK7.js → hints-TK3EHB4U.js} +2 -2
  70. package/dist-cli/chunks/{home-paths-ZBDTVPMF.js → home-paths-G23H3RO6.js} +2 -2
  71. package/dist-cli/chunks/{inspect-P2MPMFR3.js → inspect-NFWFGU4B.js} +3 -3
  72. package/dist-cli/chunks/install-5YL7FITA.js +2 -0
  73. package/dist-cli/chunks/{install-desktop-QYLXYZQJ.js → install-desktop-GB3JKSNX.js} +3 -3
  74. package/dist-cli/chunks/{keys-LJ37JUG2.js → keys-RAAHRIFH.js} +2 -2
  75. package/dist-cli/chunks/{launch-3TUC2YGM.js → launch-DYFE4CAD.js} +3 -3
  76. package/dist-cli/chunks/{login-RUZ7MAPC.js → login-KQ37GHDE.js} +4 -4
  77. package/dist-cli/chunks/{logout-4RE2BP3H.js → logout-63SH2Y25.js} +2 -2
  78. package/dist-cli/chunks/{maestro-V62C4AQM.js → maestro-24BT3MML.js} +2 -2
  79. package/dist-cli/chunks/optional-demo-registry-JJXPB3UD.js +2 -0
  80. package/dist-cli/chunks/{preview-3HWBUCVM.js → preview-KQAOVN6R.js} +2 -2
  81. package/dist-cli/chunks/{profile-D2CAEFO5.js → profile-AN2B4NJT.js} +2 -2
  82. package/dist-cli/chunks/{react-PXYQBCAK.js → react-ATGV35B4.js} +2 -2
  83. package/dist-cli/chunks/{record-R7IDN3T6.js → record-36662T3R.js} +2 -2
  84. package/dist-cli/chunks/runtime-NRMC3U3D.js +2 -0
  85. package/dist-cli/chunks/{runtime-delivery-K4LFILF7.js → runtime-delivery-RO6CTYPQ.js} +2 -2
  86. package/dist-cli/chunks/{screenshot-YGGPEX7B.js → screenshot-K4N5MPAT.js} +2 -2
  87. package/dist-cli/chunks/{screenshot-mode-QDUWRQUF.js → screenshot-mode-4QOJDLSH.js} +2 -2
  88. package/dist-cli/chunks/{screenshots-6PNFJNLF.js → screenshots-TB35YMSR.js} +2 -2
  89. package/dist-cli/chunks/screenshots-capture-W6X33BZ4.js +41 -0
  90. package/dist-cli/chunks/{server-7Q3NW5MV.js → server-L2PKDJZ2.js} +3 -3
  91. package/dist-cli/chunks/setup-repo-AK6QOUE7.js +2 -0
  92. package/dist-cli/chunks/{skills-GDYPRMR5.js → skills-KDSOWUOE.js} +2 -2
  93. package/dist-cli/chunks/{slides-HJXHSWEF.js → slides-TORKO36P.js} +2 -2
  94. package/dist-cli/chunks/{start-HDWGM5WJ.js → start-GH2AOUX6.js} +4 -4
  95. package/dist-cli/chunks/store-JHW65VGQ.js +2 -0
  96. package/dist-cli/chunks/telemetry-SZLRXJXW.js +2 -0
  97. package/dist-cli/chunks/{test-4TUHEODP.js → test-5VCENVW3.js} +3 -3
  98. package/dist-cli/chunks/{three-mode-IL5442GI.js → three-mode-ZVS2DSX6.js} +2 -2
  99. package/dist-cli/chunks/{timeline-JILPOKRF.js → timeline-TNC5OWLF.js} +2 -2
  100. package/dist-cli/chunks/{upgrade-SL5WMHSF.js → upgrade-E7IO6A7Z.js} +2 -2
  101. package/dist-cli/chunks/upload-KKEWETA5.js +2 -0
  102. package/dist-cli/chunks/{version-ZEBIO5HC.js → version-37OD33SE.js} +2 -2
  103. package/dist-cli/chunks/{web-JICQ5RN4.js → web-4JVMIBTB.js} +2 -2
  104. package/dist-cli/chunks/{what-happened-KKAJOJWO.js → what-happened-RMHZ7DGX.js} +2 -2
  105. package/dist-cli/chunks/{whoami-QDJPYI2O.js → whoami-D53ANHR5.js} +2 -2
  106. package/dist-lib/agent-daemon-client.cjs +1 -1
  107. package/dist-lib/agent-events.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 +1 -1
  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 +1 -1
  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/menu.cjs +1 -1
  127. package/dist-lib/menu.mjs +1 -1
  128. package/dist-lib/metro.cjs +1 -1
  129. package/dist-lib/profiles.cjs +1 -1
  130. package/dist-lib/render-mode.cjs +1 -1
  131. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  132. package/dist-lib/sdk.cjs +1 -1
  133. package/dist-lib/sdk.mjs +1 -1
  134. package/dist-lib/skills.cjs +13 -13
  135. package/dist-lib/vite.cjs +1 -1
  136. package/package.json +1 -1
  137. package/src/skills/builtin/a11y-review.ts +4 -1
  138. package/src/skills/builtin/perf-profile.ts +4 -1
  139. package/src/skills/builtin/screenshot-all.ts +4 -1
  140. package/src/skills/builtin/visual-diff.ts +4 -1
  141. package/dist-cli/chunks/auto-bootstrap-BMAKK4FR.js +0 -2
  142. package/dist-cli/chunks/beta-ERD6Z2EE.js +0 -2
  143. package/dist-cli/chunks/chunk-2UDB2A2Z.js +0 -119
  144. package/dist-cli/chunks/chunk-4TJ2FLZX.js +0 -2
  145. package/dist-cli/chunks/chunk-5PEYA6XI.js +0 -1
  146. package/dist-cli/chunks/chunk-6MBEHPFK.js +0 -1
  147. package/dist-cli/chunks/chunk-EMWWY2MH.js +0 -2
  148. package/dist-cli/chunks/chunk-FAEIKMNH.js +0 -1
  149. package/dist-cli/chunks/cli-version-P4CDXF4L.js +0 -2
  150. package/dist-cli/chunks/control-FW6XTHQE.js +0 -2
  151. package/dist-cli/chunks/drivers-VTVBB4KQ.js +0 -2
  152. package/dist-cli/chunks/flow-GZZ7OVM3.js +0 -2
  153. package/dist-cli/chunks/help-EUSCLRLF.js +0 -2
  154. package/dist-cli/chunks/install-N4QT365P.js +0 -2
  155. package/dist-cli/chunks/optional-demo-registry-ZEPUCMEO.js +0 -2
  156. package/dist-cli/chunks/runtime-RQOM2I2S.js +0 -2
  157. package/dist-cli/chunks/setup-repo-UZMY3JFZ.js +0 -2
  158. package/dist-cli/chunks/store-5DYIIFYH.js +0 -2
  159. package/dist-cli/chunks/telemetry-TMT3DYZU.js +0 -2
  160. package/dist-cli/chunks/upload-35XW4DMZ.js +0 -2
@@ -0,0 +1,41 @@
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as I}from"./chunk-SIB6I72P.js";import"./chunk-PV6MBKKE.js";import"./chunk-5KY7TQ42.js";import"./chunk-JDGLBW64.js";import{execSync as E}from"node:child_process";import{mkdirSync as L,mkdtempSync as W,rmSync as q,writeFileSync as z}from"node:fs";import{tmpdir as H}from"node:os";import{dirname as J,isAbsolute as K,join as A,resolve as V}from"node:path";import{chromium as Y}from"playwright-core";import{execSync as j}from"node:child_process";function N(o){let e=o;if(e&&typeof e.process=="function")try{let t=e.process();if(t&&typeof t.pid=="number"&&t.pid>0)return t.pid}catch{}if(e&&typeof e.browser=="function")try{let t=e.browser();if(t)return N(t)}catch{}return null}function x(o){let e=[];try{e=j(`pgrep -P ${o} || true`).toString().split(`
3
+ `).filter(Boolean)}catch{}for(let t of e)x(Number(t));try{process.kill(o,"SIGKILL")}catch{}}var C=new Set,M=!1;function B(){if(M)return;M=!0;let o=()=>{for(let e of C)x(e)};process.on("SIGTERM",()=>{o(),process.exit(0)}),process.on("SIGINT",()=>{o(),process.exit(0)}),process.on("exit",o)}async function U(o){let e=await o(),t=N(e),n=new Set;t!=null&&(n.add(t),C.add(t),B());let i=e;return typeof i.on=="function"&&i.on("disconnected",()=>{for(let c of n)C.delete(c)}),{browser:e,reapNow:()=>{for(let c of n)x(c),C.delete(c);n.clear()}}}var Q=`
4
+ sootsim screenshots capture \u2014 headlessly capture + upload App Store slides
5
+
6
+ usage:
7
+ sootsim screenshots capture --org <org> --repo <repo> [options]
8
+
9
+ what it does:
10
+ boots the org-mode build shell in headless GPU Chrome (authed via your
11
+ \`sootsim login\` session), captures each slide through the live screenshot
12
+ composer so every slide gets editable layers (captureRef + cleanRef +
13
+ screenRef), and lets the shell auto-upload them to your org deck.
14
+
15
+ options:
16
+ --org <org> github org slug (required)
17
+ --repo <repo> repo name (required)
18
+ --branch <branch> build branch to boot (default: main)
19
+ --platform <p> ios | android (default: ios)
20
+ --slides <list> 1-based indices to capture, e.g. 1,3,5 (default: all)
21
+ --dry-run capture + report refs, do NOT upload (PUTs aborted)
22
+ --force allow overwriting a NON-EMPTY existing deck
23
+ --out <dir> also write composed App-Store PNGs locally
24
+ --shell-origin <url> origin serving /build (default: your session origin)
25
+ --api-origin <url> origin for deck/capture APIs (default: session origin)
26
+ --timeout <ms> per-step bridge timeout (default: 45000)
27
+ --json machine-readable summary
28
+
29
+ examples:
30
+ sootsim screenshots capture --org acme --repo my-app --dry-run
31
+ sootsim screenshots capture --org acme --repo my-app --branch main --force
32
+ `;function X(o){let e=a=>{let c=o.indexOf(a);return c>=0?o[c+1]:void 0},t=a=>o.includes(a),n=e("--slides"),i=n?n.split(",").map(a=>Number(a.trim())).filter(a=>Number.isInteger(a)&&a>0):null;return{org:e("--org")??"",repo:e("--repo")??"",branch:e("--branch")??"main",platform:e("--platform")??"ios",slides:i&&i.length?i:null,dryRun:t("--dry-run"),force:t("--force"),out:e("--out")??null,shellOrigin:e("--shell-origin")??null,apiOrigin:e("--api-origin")??null,timeoutMs:Number(e("--timeout")??"45000")||45e3,json:t("--json")}}function Z(){let o=I();if(o&&o.kind==="session")return{token:o.token,origin:o.origin};process.stderr.write(`
33
+ sootsim screenshots capture needs a logged-in session.
34
+ run \`sootsim login\` first (the captured slides upload to that account).
35
+
36
+ `),process.exit(1)}function _(o){let e=o.replace(/^\[|\]$/g,"").toLowerCase();return e==="localhost"||e.endsWith(".localhost")||e==="::1"||/^127(?:\.\d{1,3}){3}$/.test(e)}function ee(o){let e=new URL(o);if(_(e.hostname)){let n=(Number(e.port)||3e3)-3e3;if(n>=0&&n<=1e3)return e.port=String(5173+n),e.origin}return e.hostname==="sootbean.com"||e.hostname.endsWith(".sootbean.com")?"https://sootsim.com":o}function oe(){try{return Number(E("sysctl -n vm.loadavg").toString().trim().split(/\s+/)[1])||0}catch{return 0}}async function te(o,e,t,n){let i=await fetch(`${o}/api/sootsim/screenshot-decks?org=${encodeURIComponent(t)}&repo=${encodeURIComponent(n)}`,{headers:{authorization:`Bearer ${e}`}});if(!i.ok)return[];let a=await i.json().catch(()=>null),c=[];for(let m of a?.decks??[])Array.isArray(m.config?.frames)&&c.push(...m.config.frames);return c}async function re(o,e,t,n){let i=await fetch(`${o}/api/sootsim/screenshot-capture?ref=${encodeURIComponent(n)}&org=${encodeURIComponent(t)}`,{headers:{authorization:`Bearer ${e}`}});return i.ok?`data:image/png;base64,${Buffer.from(await i.arrayBuffer()).toString("base64")}`:null}async function ne(o,e){let t=Date.now()+e;for(;Date.now()<t;){for(let n of o.frames())if(await n.evaluate(()=>!!globalThis.SootSim?.bridges?.screenshotControl).catch(()=>!1))return n;await o.waitForTimeout(250)}throw new Error("screenshot bridge never appeared \u2014 the build shell did not boot screenshot mode (check --branch/--platform has a ready build, and you are logged in)")}async function D(o){return o.evaluate(async()=>{let t=globalThis.SootSim?.bridges?.screenshotControl;if(!t)throw new Error("screenshotControl missing");return t.getState()})}async function se(o){await o.evaluate(async()=>{let e=globalThis.SootSim?.bridges?.settings,t=Date.now()+3e3;for(;Date.now()<t;){if(e?.get?.()?.screenshotMode)return;await new Promise(n=>setTimeout(n,50))}e&&!e.get().screenshotMode&&(e.set("screenshotMode",!0),e.get().showFrame||e.set("showFrame",!0))})}async function ie(o,e,t,n){await o.evaluate(async([i,a,c])=>{let m=globalThis.SootSim,h=m?.bridges?.screenshotControl;if(!h)throw new Error("screenshotControl missing");let w=b=>new Promise(d=>setTimeout(d,b));if(a){h.focusSlide(i);let b=Date.now()+3e4,d=m?.bridges?.threeMode;for(;Date.now()<b&&(d=m?.bridges?.threeMode,!(d?.setScreenImage&&d?.captureStage&&d?.getState?.()?.ready));)await w(150);await w(1e3);let l=a;d?.configure?.({colorway:l.colorway,background:l.background,...l.customGradient?{customGradient:l.customGradient}:{},room:!!l.room,bokeh:!!l.bokeh,environment:l.environmentActive?{pins:l.environmentPins??{},effects:l.environmentEffects??{}}:!1,pose:{phonePosition:l.phonePosition,phoneRotation:l.phoneRotation,cameraPosition:l.cameraPosition,target:l.target}}),await w(900),c&&d?.setScreenImage&&(d.setScreenImage(c),await w(1200))}await h.capture(i)},[e,t,n])}async function be(o){if(o.includes("--help")||o.includes("-h"))return console.log(Q),0;let e=X(o);if(!e.org||!e.repo)return process.stderr.write(` --org and --repo are required (see --help)
37
+ `),1;let{token:t,origin:n}=Z(),i=(e.apiOrigin??n).replace(/\/$/,""),a=(e.shellOrigin??ee(i)).replace(/\/$/,""),c=await te(i,t,e.org,e.repo);if(!e.dryRun&&!e.force&&c.length>0)return process.stderr.write(` refusing to overwrite the existing ${e.org}/${e.repo} deck (${c.length} slide(s)). re-run with --force to replace it, or --dry-run to preview.
38
+ `),1;let m=oe(),h=Number(E("sysctl -n hw.ncpu").toString().trim())||8;if(m>h)return process.stderr.write(` load average ${m.toFixed(1)} exceeds ${h} cores \u2014 tear down other work first.
39
+ `),1;let w=`${a}/build/${encodeURIComponent(e.org)}/${encodeURIComponent(e.repo)}/${encodeURIComponent(e.branch)}?platform=${encodeURIComponent(e.platform)}&ssMode=1`,b=W(A(H(),"sootsim-capture-")),{browser:d,reapNow:l}=await U(()=>Y.launchPersistentContext(b,{headless:!0,channel:"chrome",viewport:{width:393,height:852},deviceScaleFactor:3,args:["--enable-unsafe-webgpu","--enable-features=Vulkan,WebGPU","--hide-scrollbars"]}));await d.addInitScript(s=>{try{localStorage.setItem("sootsim.session.token",s)}catch{}},t);let y=[],g=d.pages()[0]??await d.newPage();e.dryRun?await g.route(/\/api\/sootsim\/screenshot-(decks|capture)/,s=>s.request().method()==="PUT"?s.abort():s.continue()):g.on("response",s=>{let p=s.url();s.request().method()==="PUT"&&(p.includes("/api/sootsim/screenshot-decks")?y.push({kind:"deck",status:s.status()}):p.includes("/api/sootsim/screenshot-capture")&&y.push({kind:"capture",status:s.status()}))});let R=[];g.on("pageerror",s=>R.push(s.message));let G=g.waitForResponse(s=>s.url().includes("/api/sootsim/screenshot-decks")&&s.request().method()==="GET",{timeout:e.timeoutMs}).catch(()=>null);try{await g.goto(w,{waitUntil:"domcontentloaded",timeout:e.timeoutMs});let s=await ne(g,e.timeoutMs);await se(s),await G,await g.waitForTimeout(800);let p=await D(s);if(p.slides.length===0)return process.stderr.write(` the deck has no slides to capture \u2014 add slides in the composer first.
40
+ `),1;let P=e.slides?p.slides.filter(r=>e.slides.includes(r.index)):p.slides;console.log(` ${p.projectName} on ${p.deviceModel} \u2014 capturing ${P.length}/${p.slides.length} slide(s)${e.dryRun?" (dry-run, no upload)":""}`);for(let r of P)try{let u=c[r.index-1],f=u?.threeScene??null,$=f&&u?.screenRef?await re(i,t,e.org,u.screenRef):null;await ie(s,r.index,f,$),console.log(` \u2713 slide ${r.index} "${r.title.slice(0,40)}"`)}catch(u){console.log(` \u2717 slide ${r.index} "${r.title.slice(0,40)}" \u2014 ${u.message}`)}e.dryRun||await g.waitForTimeout(2500);let S=(await D(s)).slides.filter(r=>P.some(u=>u.id===r.id)),v=[];if(e.out){let r=K(e.out)?e.out:V(process.cwd(),e.out);for(let u of S){if(!u.captureRef)continue;let f=await s.evaluate(async k=>{let T=globalThis.SootSim?.bridges?.screenshotControl;if(!T)throw new Error("screenshotControl missing");return T.exportSlide(k)},u.index),$=f.dataUrl.match(/^data:[^;]+;base64,(.+)$/);if($){let k=A(r,f.name);L(J(k),{recursive:!0}),z(k,Buffer.from($[1],"base64")),v.push(k)}}}let F=S.filter(r=>r.captureRef&&r.cleanRef),O={org:e.org,repo:e.repo,branch:e.branch,dryRun:e.dryRun,slides:S.map(r=>({index:r.index,title:r.title,captureRef:!!r.captureRef,cleanRef:!!r.cleanRef,screenRef:!!r.screenRef,captureMode:r.captureMode})),editableCount:F.length,uploads:e.dryRun?"skipped (dry-run)":y,written:v,pageErrors:R.slice(0,5)};if(e.json)console.log(JSON.stringify(O,null,2));else{console.log(`
41
+ ${F.length}/${S.length} slide(s) now have editable layers (captureRef + cleanRef)`);let r=S.filter(u=>u.captureRef&&!u.cleanRef);if(r.length&&console.log(` \u26A0 ${r.length} slide(s) baked a flat capture only (no cleanRef) \u2014 typically 3d slides whose scene didn't restore for a re-bake.`),!e.dryRun){let u=y.filter(f=>f.status>=200&&f.status<300).length;console.log(` uploads: ${u}/${y.length} PUT(s) succeeded`)}v.length&&console.log(` wrote ${v.length} local PNG(s) to ${e.out}`),R.length&&console.log(` \u26A0 ${R.length} page error(s) during capture`)}return 0}finally{await d.close().catch(()=>{}),l(),q(b,{recursive:!0,force:!0})}}export{be as runScreenshotsCapture};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as oe,c as H,d as ae,e as F,f as ce,h as de,i as C,j as le,k as ue,l as pe,p as me,s as T,t as he,u as fe,v as ge,w as Se}from"./chunk-WUKEI6SL.js";import"./chunk-2DDHS4Z3.js";import{a as se}from"./chunk-MRPFNK2L.js";import"./chunk-27Q45J2N.js";import{f as R}from"./chunk-HIAR3KTT.js";import"./chunk-4TJ2FLZX.js";import"./chunk-ENK2SG5R.js";import"./chunk-L7F7QBGM.js";import"./chunk-AFPKG2L6.js";import"./chunk-6MBEHPFK.js";import{d as re}from"./chunk-MO3L5VGD.js";import{a as Z,b as Q}from"./chunk-YR7WIUVL.js";import"./chunk-SHCQRQJA.js";import{a as te,b as ie}from"./chunk-FZ656TJA.js";import"./chunk-QBYYAPTB.js";import{a as ee}from"./chunk-QWNLVJ4P.js";import{l as ne}from"./chunk-XWG6NJJE.js";import{A as P,B as K,C as V,D,F as G,G as q,H as z,I as X,J as Y,K as U,h as j,i as $,w as N,x as J}from"./chunk-MQWZBKOF.js";import"./chunk-BUCBIG2A.js";import{spawn as Qe}from"child_process";import k from"fs";import{createServer as et}from"http";import y from"path";import{WebSocket as h,WebSocketServer as tt}from"ws";import ye from"node:fs";import _ from"node:path";var O=1;function _e(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_POSTGRES||7432),Number(process.env.VITE_PORT_R2||9500)].filter(o=>Number.isFinite(o)&&o>0)}var x=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;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 T?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 pe()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as oe,c as H,d as ae,e as F,f as ce,h as de,i as C,j as le,k as ue,l as pe,p as me,s as T,t as he,u as fe,v as ge,w as Se}from"./chunk-HC72ILJK.js";import"./chunk-LZEL2RU3.js";import{a as se}from"./chunk-VMYMPL6H.js";import"./chunk-SIB6I72P.js";import{f as R}from"./chunk-G2ZFDIPK.js";import"./chunk-M2TMFGZH.js";import"./chunk-B7BMSU7H.js";import"./chunk-GQAWFQNN.js";import"./chunk-Y6IDAARY.js";import"./chunk-BQOMDL4K.js";import{d as re}from"./chunk-GC4THE6K.js";import{a as Z,b as Q}from"./chunk-IODOTOOP.js";import"./chunk-PV6MBKKE.js";import{a as te,b as ie}from"./chunk-DQZEN256.js";import"./chunk-KUUFY6FC.js";import{a as ee}from"./chunk-3L4NRJ6C.js";import{l as ne}from"./chunk-OGLWXPVG.js";import{A as P,B as K,C as V,D,F as G,G as q,H as z,I as X,J as Y,K as U,h as j,i as $,w as N,x as J}from"./chunk-5KY7TQ42.js";import"./chunk-JDGLBW64.js";import{spawn as Qe}from"child_process";import k from"fs";import{createServer as et}from"http";import y from"path";import{WebSocket as h,WebSocketServer as tt}from"ws";import ye from"node:fs";import _ from"node:path";var O=1;function _e(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_POSTGRES||7432),Number(process.env.VITE_PORT_R2||9500)].filter(o=>Number.isFinite(o)&&o>0)}var x=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;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 T?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 pe()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
3
3
  `)}}close(){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 F();case"agent:upsert-project":return H(i.input??{});case"agent:delete-project":return de(String(i.projectId)),{ok:!0};case"agent:auto-attach-for-url":return this.autoAttachForUrl(i.input??{});case"agent:list-sessions":return le(i.projectId?String(i.projectId):void 0);case"agent:start-session":return this.doStartSession(i.input??{});case"agent:send-prompt":{let n=String(i.sessionId),a=C(n);if(!a)throw new T("NO_SESSION",`no session: ${n}`);let r=this.normalizePromptEnvelope(i);return await fe(n,r),this.notePromptAccepted(n,r,a.status==="working")}case"agent:end-session":this.dropSessionFanout(String(i.sessionId)),await ge(String(i.sessionId));let s=C(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 T("UNKNOWN_AGENT_MSG",`unknown agent message: ${t}`)}}async doStartSession(e){if(!ae(e.projectId))throw new T("NO_PROJECT",`no project: ${e.projectId}`);let i=await he(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?.()??_e(),a=(await R({excludePorts:s})).find(d=>String(d.port)===i);if(!a||!a.cwd)return{project:null};let r=F().find(d=>d.cwd===a.cwd)??null,c=Array.from(new Set([...r?.knownBundleUrls??[],a.bundleUrl,t]));return{project:H({cwd:a.cwd,name:a.projectName??_.basename(a.cwd),preferredProvider:e.provider??r?.preferredProvider,sourceRoots:r?.sourceRoots??[a.cwd],knownBundleUrls:c,framework:r?.framework??Oe(a.framework),bundleId:a.bundleId??r?.bundleId})}}getTranscript(e){let t=me(e);return ye.existsSync(t)?ye.readFileSync(t,"utf8"):{error:"transcript not found",code:"NO_TRANSCRIPT"}}getPaths(){let e=oe();return{userDataDir:e,storeFile:_.join(e,"attached-projects.json"),sessionsDir:_.join(e,"sessions"),transcriptsDir:_.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=Se(t,a=>{let r=this.coalescePromptEcho(t,a);if(r&&(this.applySessionEvent(t,r),this.fanOutEvent(t,r)),a.type==="turn-completed"){let c=C(t);if(c)try{ce(c.projectId,{usd:a.costUsd,ts:a.ts})}catch(l){process.stderr.write(`[sootsim-agent] recordTurnTelemetry failed: ${l instanceof Error?l.message:String(l)}
4
4
  `)}}});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 a=Math.max(this.pendingTurns.get(e)??0,i?1:0)+1;this.pendingTurns.set(e,a);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:a>1,pendingTurns:a,queueDepth:Math.max(0,a-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){ue(e,t);let i=C(e);i&&this.broadcastSessionStatus(i)}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===O)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===O)try{i.send(t)}catch{}}respond(e,t,i){if(e.readyState===O)try{e.send(JSON.stringify({id:t,result:i}))}catch{}}respondError(e,t,i,s){if(e.readyState===O)try{e.send(JSON.stringify({id:t,error:i,...s?{code:s}:{}}))}catch{}}};function Oe(o){return o==="expo"?"expo":o==="one"||o==="vxrn"?"one":"unknown"}import Be from"http";import Me from"https";var W="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 Le(o){let e=o.toLowerCase();for(let t of xe)if(e===t.hostSuffix||e.endsWith(`.${t.hostSuffix}`))return t}function be(o){let e=Le(o.hostname);return{"accept-encoding":"identity",...e?.suppressBrowserUserAgent?{}:{"user-agent":W},...e?.headers}}var Ne=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"]),De={"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"},Ue=new Set(["host","origin","referer","sec-fetch-site","sec-fetch-mode","sec-fetch-dest"]);function E(o){for(let[e,t]of Object.entries(De))o.setHeader(e,t)}function He(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 Fe(o){let t=(Array.isArray(o)?o[0]:o)?.split(";",1)[0]?.trim().toLowerCase();return t?t.startsWith("text/")||t==="application/json"||t.endsWith("+json")||t==="application/x-www-form-urlencoded"||t==="application/xml"||t.endsWith("+xml")||t==="application/javascript"||t==="application/graphql":!1}function We(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(Ne.has(i.toLowerCase())||(t[i]=Array.isArray(s)?s.join(", "):s));return Object.assign(t,e?be(e):{"user-agent":W}),t}function je(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(Ue.has(i.toLowerCase())||(t[i]=s));return t.host=e.host,t.origin=e.origin,t.referer=`${e.origin}/`,t}function ve(o){return o?.startsWith("/__fetch-proxy?")||o?.startsWith("/__proxy?")||!1}function we(o){return o?!!(o.startsWith("/__app-api?")||o.startsWith("/__app-api/")):!1}async function Ae(o,e){if(o.method==="OPTIONS"){E(e),e.writeHead(204),e.end();return}let i=new URLSearchParams((o.url||"").split("?")[1]||"").get("url");if(!i){E(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("missing url param");return}let s;try{s=new URL(i)}catch{E(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("invalid url param");return}let n=We(o.headers,s),a;if(o.method!=="GET"&&o.method!=="HEAD"){let d=[];for await(let u of o)d.push(Buffer.isBuffer(u)?u:Buffer.from(u));if(d.length>0){let u=Buffer.concat(d);a=Fe(o.headers["content-type"])?u.toString("utf8"):u}}let r;try{r=await fetch(s.href,{method:o.method,headers:n,body:a,redirect:"follow"})}catch(d){E(e),e.writeHead(502,{"Content-Type":"text/plain"}),e.end(`fetch proxy error: ${He(s.href,d)}`);return}r.headers.forEach((d,u)=>{let p=u.toLowerCase();p==="content-encoding"||p==="transfer-encoding"||p==="content-length"||p==="set-cookie"||p.startsWith("access-control-")||e.setHeader(u,d)}),E(e);let c=r.headers.getSetCookie?.()??[];c.length>0&&e.setHeader("x-sootsim-set-cookie",c.join(", ")),e.statusCode=r.status;let l=Buffer.from(await r.arrayBuffer());e.end(l)}function ke(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 a=n.protocol==="https:"?Me:Be,r=je(o.headers,n),c=a.request({hostname:n.hostname,port:n.port||(n.protocol==="https:"?443:80),path:n.pathname+n.search,method:o.method,headers:r},l=>{let d=Object.keys(l.headers).filter(u=>{let p=u.toLowerCase();return!p.startsWith("access-control-")&&p!=="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 c.on("error",l=>{e.statusCode=502,e.end(`app proxy error: ${l.message}`)}),o.pipe(c),!0}import{WebSocket as A,WebSocketServer as $e}from"ws";var Je="/__websocket-proxy",Ke=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 w(o,e,t){try{o.write(`HTTP/1.1 ${e} ${t}\r
5
5
  Connection: close\r
@@ -35,6 +35,6 @@ options:
35
35
  examples:
36
36
  sootsim server
37
37
  sootsim server --port 7668 --quiet
38
- `),process.exit(0));let t=o.indexOf("--port"),i=t>=0&&o[t+1]?Number(o[t+1]):e.port??7668;Number.isNaN(i)&&(console.error(` invalid --port value: ${o[t+1]}`),process.exit(1));let s=o.includes("--quiet")||o.includes("-q");if($()){let f=j()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";if(console.error(` refusing to run a standalone sootsim daemon \u2014 ${f}.`),console.error(` the live \`bun dev\` stack already hosts the bridge on :${7668}; a`),console.error(" standalone server would shadow it on a fallback port and serve the stale"),console.error(" published runtime. set SOOTSIM_FORCE_DAEMON_INSTALL=1 to run it anyway."),Ie()){console.error(" uninstalling the persistent agent so it stops respawning here...");try{let{runDaemon:S}=await import("./daemon-5DEUBHYC.js");await S(["uninstall"],{port:i})}catch(S){console.error(` (uninstall failed: ${S instanceof Error?S.message:String(S)})`),console.error(" run `sootsim daemon uninstall` manually to stop it.")}}process.exit(0)}let n=q();n&&z(n)&&(console.error(` a sootsim daemon is already running (pid ${n.pid}, port ${n.bridgePort})`),console.error(" stop it with 'sootsim daemon stop' first"),process.exit(1)),P();let a=await se(),r=new B({port:i,writeLockfile:!0,sootbeanOrigin:a}),c=await r.startAsync({silent:s}),l=Date.now(),d=f=>{s||process.stdout.write(`${f}
38
+ `),process.exit(0));let t=o.indexOf("--port"),i=t>=0&&o[t+1]?Number(o[t+1]):e.port??7668;Number.isNaN(i)&&(console.error(` invalid --port value: ${o[t+1]}`),process.exit(1));let s=o.includes("--quiet")||o.includes("-q");if($()){let f=j()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";if(console.error(` refusing to run a standalone sootsim daemon \u2014 ${f}.`),console.error(` the live \`bun dev\` stack already hosts the bridge on :${7668}; a`),console.error(" standalone server would shadow it on a fallback port and serve the stale"),console.error(" published runtime. set SOOTSIM_FORCE_DAEMON_INSTALL=1 to run it anyway."),Ie()){console.error(" uninstalling the persistent agent so it stops respawning here...");try{let{runDaemon:S}=await import("./daemon-62MZT4G4.js");await S(["uninstall"],{port:i})}catch(S){console.error(` (uninstall failed: ${S instanceof Error?S.message:String(S)})`),console.error(" run `sootsim daemon uninstall` manually to stop it.")}}process.exit(0)}let n=q();n&&z(n)&&(console.error(` a sootsim daemon is already running (pid ${n.pid}, port ${n.bridgePort})`),console.error(" stop it with 'sootsim daemon stop' first"),process.exit(1)),P();let a=await se(),r=new B({port:i,writeLockfile:!0,sootbeanOrigin:a}),c=await r.startAsync({silent:s}),l=Date.now(),d=f=>{s||process.stdout.write(`${f}
39
39
  `)},u=new Set,p=setInterval(()=>{let f=r.listSims(),S=new Set(f.map(g=>g.id));for(let g of f)if(!u.has(g.id)){let b=g.title||g.url||g.origin||"(unknown)";d(` + ${g.id} ${b}`)}for(let g of u)S.has(g)||d(` - ${g}`);u.clear();for(let g of S)u.add(g)},500);Z({event:"daemon_heartbeat",properties:{bridge_port:c,under_daemon:Ie(),platform:process.platform,subsource:"daemon"}}),Q(),d(`sootsim bridge listening on ws://localhost:${c} (runtime http on same port)`),c!==i&&d(` (preferred port ${i} was taken \u2014 fell back to ${c})`),d(" ready for browser, electron, or headless playwright sims to connect"),d(" (ctrl-c to stop)");let m=async f=>{clearInterval(p),d(`
40
40
  ${f} received \u2014 shutting down after ${Math.round((Date.now()-l)/1e3)}s`);try{await r.close()}catch{}process.exit(0)};process.on("SIGINT",()=>m("SIGINT")),process.on("SIGTERM",()=>m("SIGTERM")),process.on("SIGHUP",()=>m("SIGHUP")),process.on("exit",()=>{try{r.removeLockfile()}catch{}}),await new Promise(()=>{})}export{$t as runServer};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-XM66K64H.js";import"./chunk-BIWJE7CB.js";import"./chunk-FHMPJZKM.js";import"./chunk-GQAWFQNN.js";import"./chunk-IODOTOOP.js";import"./chunk-PV6MBKKE.js";import"./chunk-DQZEN256.js";import"./chunk-KUUFY6FC.js";import"./chunk-5KY7TQ42.js";import"./chunk-JDGLBW64.js";export{a as runSetupRepo};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-BUCBIG2A.js";import*as l from"fs";import*as i from"path";import{fileURLToPath as f}from"url";function g(){try{let s=f(import.meta.resolve("sootsim/package.json"));return i.join(i.dirname(s),"skills")}catch{let s=i.dirname(f(import.meta.url));return i.resolve(s,"../../skills")}}var m=g();function d(s){let n=s.match(/^---\n([\s\S]*?)\n---/);if(!n)return null;let e=n[1],o=e.match(/^name:\s*(.+)$/m),r=e.match(/^description:\s*(.+)$/m);return o?{name:o[1].trim(),description:r?.[1]?.trim()||""}:null}function p(){if(!l.existsSync(m))return[];let s=l.readdirSync(m).filter(e=>e.endsWith(".md")),n=[];for(let e of s){let o=l.readFileSync(i.join(m,e),"utf8"),r=d(o);r&&n.push({...r,filename:e})}return n}function u(s,n){let e=i.join(m,s.filename),o=i.join(n,s.filename);l.copyFileSync(e,o),console.log(` copied ${s.name} \u2192 ${o}`)}async function h(s){if(s.includes("--list")||s.includes("-l")||s.length===0){let t=p();if(t.length===0){console.log(" no skills found");return}console.log(`
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-JDGLBW64.js";import*as l from"fs";import*as i from"path";import{fileURLToPath as f}from"url";function g(){try{let s=f(import.meta.resolve("sootsim/package.json"));return i.join(i.dirname(s),"skills")}catch{let s=i.dirname(f(import.meta.url));return i.resolve(s,"../../skills")}}var m=g();function d(s){let n=s.match(/^---\n([\s\S]*?)\n---/);if(!n)return null;let e=n[1],o=e.match(/^name:\s*(.+)$/m),r=e.match(/^description:\s*(.+)$/m);return o?{name:o[1].trim(),description:r?.[1]?.trim()||""}:null}function p(){if(!l.existsSync(m))return[];let s=l.readdirSync(m).filter(e=>e.endsWith(".md")),n=[];for(let e of s){let o=l.readFileSync(i.join(m,e),"utf8"),r=d(o);r&&n.push({...r,filename:e})}return n}function u(s,n){let e=i.join(m,s.filename),o=i.join(n,s.filename);l.copyFileSync(e,o),console.log(` copied ${s.name} \u2192 ${o}`)}async function h(s){if(s.includes("--list")||s.includes("-l")||s.length===0){let t=p();if(t.length===0){console.log(" no skills found");return}console.log(`
3
3
  available skills:
4
4
  `);for(let c of t)console.log(` ${c.name}`),console.log(` ${c.description}
5
5
  `);console.log(" usage: sootsim skills <target-dir> [skill-name...]"),console.log(" example: sootsim skills ./my-project"),console.log(` example: sootsim skills ./my-project debug perf
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as S,e as y,g as v,h as b,i as u}from"./chunk-L7F7QBGM.js";import"./chunk-FZ656TJA.js";import"./chunk-QBYYAPTB.js";import"./chunk-MQWZBKOF.js";import"./chunk-BUCBIG2A.js";import{mkdirSync as $,writeFileSync as x}from"node:fs";import{dirname as k,isAbsolute as B,join as C,resolve as E}from"node:path";var z=`
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as S,e as y,g as v,h as b,i as u}from"./chunk-GQAWFQNN.js";import"./chunk-DQZEN256.js";import"./chunk-KUUFY6FC.js";import"./chunk-5KY7TQ42.js";import"./chunk-JDGLBW64.js";import{mkdirSync as $,writeFileSync as x}from"node:fs";import{dirname as k,isAbsolute as B,join as C,resolve as E}from"node:path";var z=`
3
3
  sootsim slides \u2014 compose App Store screenshots in the live sim
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-L7F7QBGM.js";import{d as _}from"./chunk-MO3L5VGD.js";import"./chunk-FZ656TJA.js";import"./chunk-QBYYAPTB.js";import{A as O,B as x,G as b,H as v,k as D}from"./chunk-MQWZBKOF.js";import"./chunk-BUCBIG2A.js";import{spawn as N}from"child_process";import{existsSync as F}from"fs";import{WebSocket as B}from"ws";var T=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];var A={reset:"\x1B[0m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",cyan:"\x1B[36m",bold:"\x1B[1m"};function k(){return process.stderr.isTTY===!0}function u(t,e){return k()?`${A[t]}${e}${A.reset}`:e}function L(t,e){switch(t){case"pending":return u("dim","\xB7");case"running":return u("cyan",e);case"done":return u("green","\u2713");case"fail":return u("red","\u2717");case"skip":return u("yellow","\u25CB")}}var E=class{constructor(e,s){this.stepper=e;this.data=s}start(e){this.data.state="running",e!==void 0&&(this.data.detail=e),this.stepper.render()}update(e){this.data.detail=e,this.stepper.render()}done(e){this.data.state="done",e!==void 0&&(this.data.detail=e),this.stepper.render()}fail(e){this.data.state="fail",e!==void 0&&(this.data.detail=e),this.stepper.render()}skip(e){this.data.state="skip",e!==void 0&&(this.data.detail=e),this.stepper.render()}},S=class{steps=[];bannerText="";frame=0;timer=null;lastLineCount=0;paused=!1;finished=!1;banner(e){this.bannerText=e}add(e){let s={label:e,state:"pending"};return this.steps.push(s),new E(this,s)}render(){this.paused||this.finished||(this.startSpinner(),this.draw())}pause(){this.paused||(this.paused=!0,this.stopSpinner(),this.eraseRendered(),this.lastLineCount=0)}resume(){this.paused&&(this.paused=!1,this.draw(),this.startSpinner())}finish(){this.finished||(this.finished=!0,this.stopSpinner(),this.draw())}startSpinner(){this.timer||!k()||this.steps.some(e=>e.state==="running")&&(this.timer=setInterval(()=>{this.frame=(this.frame+1)%T.length,this.draw()},80),this.timer?.unref?.())}stopSpinner(){this.timer&&(clearInterval(this.timer),this.timer=null)}draw(){if(!k()){this.drawForwardOnly();return}this.eraseRendered();let e=[];this.bannerText&&(e.push(u("bold",this.bannerText)),e.push(""));let s=T[this.frame],r=Math.max(...this.steps.map(i=>i.label.length),0);for(let i of this.steps){let n=L(i.state,s),c=i.label.padEnd(r),y=i.detail?` ${u("dim",i.detail)}`:"";e.push(` ${n} ${c}${y}`)}process.stderr.write(e.join(`
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-GQAWFQNN.js";import{d as _}from"./chunk-GC4THE6K.js";import"./chunk-DQZEN256.js";import"./chunk-KUUFY6FC.js";import{A as O,B as x,G as b,H as v,k as D}from"./chunk-5KY7TQ42.js";import"./chunk-JDGLBW64.js";import{spawn as N}from"child_process";import{existsSync as F}from"fs";import{WebSocket as B}from"ws";var T=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];var A={reset:"\x1B[0m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",cyan:"\x1B[36m",bold:"\x1B[1m"};function k(){return process.stderr.isTTY===!0}function u(t,e){return k()?`${A[t]}${e}${A.reset}`:e}function L(t,e){switch(t){case"pending":return u("dim","\xB7");case"running":return u("cyan",e);case"done":return u("green","\u2713");case"fail":return u("red","\u2717");case"skip":return u("yellow","\u25CB")}}var E=class{constructor(e,s){this.stepper=e;this.data=s}start(e){this.data.state="running",e!==void 0&&(this.data.detail=e),this.stepper.render()}update(e){this.data.detail=e,this.stepper.render()}done(e){this.data.state="done",e!==void 0&&(this.data.detail=e),this.stepper.render()}fail(e){this.data.state="fail",e!==void 0&&(this.data.detail=e),this.stepper.render()}skip(e){this.data.state="skip",e!==void 0&&(this.data.detail=e),this.stepper.render()}},S=class{steps=[];bannerText="";frame=0;timer=null;lastLineCount=0;paused=!1;finished=!1;banner(e){this.bannerText=e}add(e){let s={label:e,state:"pending"};return this.steps.push(s),new E(this,s)}render(){this.paused||this.finished||(this.startSpinner(),this.draw())}pause(){this.paused||(this.paused=!0,this.stopSpinner(),this.eraseRendered(),this.lastLineCount=0)}resume(){this.paused&&(this.paused=!1,this.draw(),this.startSpinner())}finish(){this.finished||(this.finished=!0,this.stopSpinner(),this.draw())}startSpinner(){this.timer||!k()||this.steps.some(e=>e.state==="running")&&(this.timer=setInterval(()=>{this.frame=(this.frame+1)%T.length,this.draw()},80),this.timer?.unref?.())}stopSpinner(){this.timer&&(clearInterval(this.timer),this.timer=null)}draw(){if(!k()){this.drawForwardOnly();return}this.eraseRendered();let e=[];this.bannerText&&(e.push(u("bold",this.bannerText)),e.push(""));let s=T[this.frame],r=Math.max(...this.steps.map(i=>i.label.length),0);for(let i of this.steps){let n=L(i.state,s),c=i.label.padEnd(r),y=i.detail?` ${u("dim",i.detail)}`:"";e.push(` ${n} ${c}${y}`)}process.stderr.write(e.join(`
3
3
  `)+`
4
4
  `),this.lastLineCount=e.length,this.steps.some(i=>i.state==="running")||this.stopSpinner()}bannerPrinted=!1;lastEmitted=new Map;drawForwardOnly(){this.bannerText&&!this.bannerPrinted&&(process.stderr.write(this.bannerText+`
5
5
 
@@ -18,6 +18,6 @@ usage:
18
18
  options:
19
19
  --port <n> bridge port (default: ${7668})
20
20
  --no-open don't open the browser at the end
21
- `);return}O();let s=t.indexOf("--port"),r=s>=0&&t[s+1]?Number(t[s+1]):e.port??7668;Number.isNaN(r)&&(console.error(` invalid --port value: ${t[s+1]}`),process.exit(1));let i=t.includes("--no-open"),n=new S,{IS_BETA:c,BETA_TAGLINE:y}=await import("./beta-ERD6Z2EE.js");n.banner(c?`sootsim \u2014 ${y}`:"sootsim \u2014 starting up");let m=n.add("runtime"),d=n.add("server"),$=n.add("ready"),f=n.add("open");n.render();let g=null;try{m.start("checking\u2026");let a=x();if(a&&F(D(a))){g=a;let l=await q();m.done(l?`v${a} \u2014 v${l} available, run \`sootsim upgrade\``:`v${a}`)}else{m.start("downloading engine (~6 MB)\u2026");let{runRuntime:l}=await import("./runtime-RQOM2I2S.js");n.pause(),await l(["install"],{}),n.resume(),g=x(),m.done(g?`v${g}`:"installed")}}catch(a){m.fail(h(a)),n.finish(),process.exit(1)}let o=r,p="standalone";try{d.start("checking\u2026");let a=b();if(v(a)&&await P(a.bridgePort,800))o=a.bridgePort,p="daemon-existing",d.done(`already running (port ${o})`);else if(process.platform==="darwin"||process.platform==="linux"){d.start("registering background daemon\u2026");try{let{daemonInstall:l}=await import("./daemon-5DEUBHYC.js");n.pause(),await l({port:r,force:!0}),n.resume();let R=b();o=v(R)?R.bridgePort:r,p="daemon-installed",d.done(`daemon registered (port ${o})`)}catch(l){n.resume(),d.start("daemon unavailable, starting standalone server\u2026"),o=await C(r),p="standalone",d.done(`standalone (port ${o}) \u2014 ${h(l)}`)}}else d.start("starting standalone server\u2026"),o=await C(r),p="standalone",d.done(`standalone (port ${o})`)}catch(a){d.fail(h(a)),n.finish(),process.exit(1)}try{if($.start("waiting for bridge\u2026"),!await V(o,U))throw new Error(`bridge never came online on port ${o}`);$.done(`ws://localhost:${o}`)}catch(a){$.fail(h(a)),n.finish(),process.exit(1)}let w=`http://localhost:${o}/`;if(i){f.skip(w),n.finish();return}try{f.start("launching browser\u2026"),await _(w),f.done(w)}catch(a){f.skip(`${w} (open it manually \u2014 ${h(a)})`)}n.finish(),p==="standalone"?(console.log(`
21
+ `);return}O();let s=t.indexOf("--port"),r=s>=0&&t[s+1]?Number(t[s+1]):e.port??7668;Number.isNaN(r)&&(console.error(` invalid --port value: ${t[s+1]}`),process.exit(1));let i=t.includes("--no-open"),n=new S,{IS_BETA:c,BETA_TAGLINE:y}=await import("./beta-FGSMZWLP.js");n.banner(c?`sootsim \u2014 ${y}`:"sootsim \u2014 starting up");let m=n.add("runtime"),d=n.add("server"),$=n.add("ready"),f=n.add("open");n.render();let g=null;try{m.start("checking\u2026");let a=x();if(a&&F(D(a))){g=a;let l=await q();m.done(l?`v${a} \u2014 v${l} available, run \`sootsim upgrade\``:`v${a}`)}else{m.start("downloading engine (~6 MB)\u2026");let{runRuntime:l}=await import("./runtime-NRMC3U3D.js");n.pause(),await l(["install"],{}),n.resume(),g=x(),m.done(g?`v${g}`:"installed")}}catch(a){m.fail(h(a)),n.finish(),process.exit(1)}let o=r,p="standalone";try{d.start("checking\u2026");let a=b();if(v(a)&&await P(a.bridgePort,800))o=a.bridgePort,p="daemon-existing",d.done(`already running (port ${o})`);else if(process.platform==="darwin"||process.platform==="linux"){d.start("registering background daemon\u2026");try{let{daemonInstall:l}=await import("./daemon-62MZT4G4.js");n.pause(),await l({port:r,force:!0}),n.resume();let R=b();o=v(R)?R.bridgePort:r,p="daemon-installed",d.done(`daemon registered (port ${o})`)}catch(l){n.resume(),d.start("daemon unavailable, starting standalone server\u2026"),o=await C(r),p="standalone",d.done(`standalone (port ${o}) \u2014 ${h(l)}`)}}else d.start("starting standalone server\u2026"),o=await C(r),p="standalone",d.done(`standalone (port ${o})`)}catch(a){d.fail(h(a)),n.finish(),process.exit(1)}try{if($.start("waiting for bridge\u2026"),!await V(o,U))throw new Error(`bridge never came online on port ${o}`);$.done(`ws://localhost:${o}`)}catch(a){$.fail(h(a)),n.finish(),process.exit(1)}let w=`http://localhost:${o}/`;if(i){f.skip(w),n.finish();return}try{f.start("launching browser\u2026"),await _(w),f.done(w)}catch(a){f.skip(`${w} (open it manually \u2014 ${h(a)})`)}n.finish(),p==="standalone"?(console.log(`
22
22
  running in standalone mode. sootsim will exit when this process does.
23
- press ctrl-c to stop.`),await new Promise(()=>{})):p==="daemon-installed"&&console.log("\n installed as a background daemon \u2014 it'll restart on login.\n manage it with `sootsim daemon status / restart / uninstall`.")}function P(t,e){return new Promise(s=>{let r=new B(`ws://127.0.0.1:${t}`,{handshakeTimeout:e}),i=!1,n=c=>{if(!i){i=!0;try{r.close()}catch{}s(c)}};r.once("open",()=>n(!0)),r.once("error",()=>n(!1)),setTimeout(()=>n(!1),e)})}async function V(t,e){let s=Date.now()+e;for(;Date.now()<s;){if(await P(t,500))return!0;await new Promise(r=>setTimeout(r,200))}return!1}async function C(t){let e=W();N(e,["server","--quiet","--port",String(t)],{detached:!0,stdio:"ignore",env:process.env}).unref();let r=Date.now()+I;for(;Date.now()<r;){let i=b();if(v(i))return i.bridgePort;await new Promise(n=>setTimeout(n,150))}if(await P(t,800))return t;throw new Error(`standalone server didn't come online within ${Math.round(I/1e3)}s`)}function W(){let t=process.argv[1];return t&&F(t)?t:"sootsim"}function h(t){return t instanceof Error?t.message:String(t)}async function q(){try{let{checkRuntimeUpToDate:t}=await import("./runtime-delivery-K4LFILF7.js"),e,s=await Promise.race([t(),new Promise(r=>{e=setTimeout(()=>r(null),2500)})]);return e&&clearTimeout(e),s&&s.outdated?s.latest:null}catch{return null}}export{ee as runStart};
23
+ press ctrl-c to stop.`),await new Promise(()=>{})):p==="daemon-installed"&&console.log("\n installed as a background daemon \u2014 it'll restart on login.\n manage it with `sootsim daemon status / restart / uninstall`.")}function P(t,e){return new Promise(s=>{let r=new B(`ws://127.0.0.1:${t}`,{handshakeTimeout:e}),i=!1,n=c=>{if(!i){i=!0;try{r.close()}catch{}s(c)}};r.once("open",()=>n(!0)),r.once("error",()=>n(!1)),setTimeout(()=>n(!1),e)})}async function V(t,e){let s=Date.now()+e;for(;Date.now()<s;){if(await P(t,500))return!0;await new Promise(r=>setTimeout(r,200))}return!1}async function C(t){let e=W();N(e,["server","--quiet","--port",String(t)],{detached:!0,stdio:"ignore",env:process.env}).unref();let r=Date.now()+I;for(;Date.now()<r;){let i=b();if(v(i))return i.bridgePort;await new Promise(n=>setTimeout(n,150))}if(await P(t,800))return t;throw new Error(`standalone server didn't come online within ${Math.round(I/1e3)}s`)}function W(){let t=process.argv[1];return t&&F(t)?t:"sootsim"}function h(t){return t instanceof Error?t.message:String(t)}async function q(){try{let{checkRuntimeUpToDate:t}=await import("./runtime-delivery-RO6CTYPQ.js"),e,s=await Promise.race([t(),new Promise(r=>{e=setTimeout(()=>r(null),2500)})]);return e&&clearTimeout(e),s&&s.outdated?s.latest:null}catch{return null}}export{ee as runStart};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-5Q7IHJ7K.js";import"./chunk-2TYEWVS4.js";import"./chunk-JDGLBW64.js";export{a as settingsStore};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b}from"./chunk-IODOTOOP.js";import"./chunk-PV6MBKKE.js";import"./chunk-5KY7TQ42.js";import"./chunk-JDGLBW64.js";export{b as flushCliTelemetry,a as trackCliEvent};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-BUCBIG2A.js";import{spawn as m}from"child_process";import{existsSync as h,readdirSync as w}from"fs";import{resolve as u,dirname as x}from"path";import{fileURLToPath as y}from"url";var d=x(y(import.meta.resolve("sootsim-engine/package.json")));async function v(t,r){let l=t.includes("--flows"),f=t.includes("--detox"),c=t.includes("--parallel"),i=t.includes("--watch"),a=t.find((e,o)=>t[o-1]==="--reporter")||"console";if((t.includes("--help")||t.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-JDGLBW64.js";import{spawn as m}from"child_process";import{existsSync as h,readdirSync as w}from"fs";import{resolve as u,dirname as x}from"path";import{fileURLToPath as y}from"url";var d=x(y(import.meta.resolve("sootsim-engine/package.json")));async function v(t,r){let l=t.includes("--flows"),f=t.includes("--detox"),c=t.includes("--parallel"),i=t.includes("--watch"),a=t.find((e,o)=>t[o-1]==="--reporter")||"console";if((t.includes("--help")||t.includes("-h"))&&(console.log(`
3
3
  sootsim test \u2014 run tests against sootsim
4
4
 
5
5
  usage:
@@ -26,6 +26,6 @@ examples:
26
26
  notes:
27
27
  playwright is best for smoke and package-local debugging
28
28
  --detox is the preferred parity lane for behavior that should match real RN
29
- `),process.exit(0)),l)await b(t,r,c,a);else if(f){let{runDetox:e}=await import("./detox-IAWL5YVJ.js");await e(t.filter(o=>o!=="--detox"),r)}else await g(t,r)}async function g(t,r){let l=["playwright","test"],f=t.find((e,o)=>t[o-1]==="-t")||t.find((e,o)=>t[o-1]==="--testNamePattern")||t.find((e,o)=>t[o-1]==="--grep");f&&l.push("-g",f),t.includes("--watch")&&l.push("--ui");let c=new Set(["--flows","--detox","--parallel","--watch","--reporter","-t","--testNamePattern","--grep"]);for(let e=0;e<t.length;e++){if(c.has(t[e])){(t[e]==="-t"||t[e]==="--testNamePattern"||t[e]==="--grep"||t[e]==="--reporter")&&e++;continue}l.push(t[e])}console.log(` running: npx ${l.join(" ")}`);let i=m("npx",l,{cwd:d,stdio:"inherit",env:{...process.env}}),a=await new Promise(e=>{i.on("exit",o=>e(o||0))});process.exit(a)}async function b(t,r,l,f){let c=["flows","test/flows","e2e/flows",".maestro","maestro"],i=[];for(let o of c){let s=u(d,o);if(h(s)){let p=w(s).filter(n=>n.endsWith(".yaml")||n.endsWith(".yml"));for(let n of p)i.push(u(s,n))}}for(let o of c){let s=u(process.cwd(),o);if(!s.startsWith(d)&&h(s)){let p=w(s).filter(n=>n.endsWith(".yaml")||n.endsWith(".yml"));for(let n of p)i.push(u(s,n))}}i.length===0&&(console.log(" no flow files found in flows/, test/flows/, or e2e/flows/"),process.exit(0)),console.log(` found ${i.length} flow(s)`);let a=0,e=0;for(let o of i)try{let{runFlowPlayback:s}=await import("./flow-GZZ7OVM3.js"),p=r.port?`http://localhost:${r.port}`:"http://localhost:5173";if(await s([o,"--url",p,"--new"])!==0){e++;continue}a++}catch{e++}console.log(`
29
+ `),process.exit(0)),l)await b(t,r,c,a);else if(f){let{runDetox:e}=await import("./detox-DN57GMMJ.js");await e(t.filter(o=>o!=="--detox"),r)}else await g(t,r)}async function g(t,r){let l=["playwright","test"],f=t.find((e,o)=>t[o-1]==="-t")||t.find((e,o)=>t[o-1]==="--testNamePattern")||t.find((e,o)=>t[o-1]==="--grep");f&&l.push("-g",f),t.includes("--watch")&&l.push("--ui");let c=new Set(["--flows","--detox","--parallel","--watch","--reporter","-t","--testNamePattern","--grep"]);for(let e=0;e<t.length;e++){if(c.has(t[e])){(t[e]==="-t"||t[e]==="--testNamePattern"||t[e]==="--grep"||t[e]==="--reporter")&&e++;continue}l.push(t[e])}console.log(` running: npx ${l.join(" ")}`);let i=m("npx",l,{cwd:d,stdio:"inherit",env:{...process.env}}),a=await new Promise(e=>{i.on("exit",o=>e(o||0))});process.exit(a)}async function b(t,r,l,f){let c=["flows","test/flows","e2e/flows",".maestro","maestro"],i=[];for(let o of c){let s=u(d,o);if(h(s)){let p=w(s).filter(n=>n.endsWith(".yaml")||n.endsWith(".yml"));for(let n of p)i.push(u(s,n))}}for(let o of c){let s=u(process.cwd(),o);if(!s.startsWith(d)&&h(s)){let p=w(s).filter(n=>n.endsWith(".yaml")||n.endsWith(".yml"));for(let n of p)i.push(u(s,n))}}i.length===0&&(console.log(" no flow files found in flows/, test/flows/, or e2e/flows/"),process.exit(0)),console.log(` found ${i.length} flow(s)`);let a=0,e=0;for(let o of i)try{let{runFlowPlayback:s}=await import("./flow-VBM6TU32.js"),p=r.port?`http://localhost:${r.port}`:"http://localhost:5173";if(await s([o,"--url",p,"--new"])!==0){e++;continue}a++}catch{e++}console.log(`
30
30
  results: ${a} passed, ${e} failed (${i.length} total)
31
31
  `),process.exit(e>0?1:0)}export{v as runTest};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as $}from"./chunk-MGB5W5VY.js";import{c as p,e as h,i as R}from"./chunk-L7F7QBGM.js";import"./chunk-FZ656TJA.js";import"./chunk-QBYYAPTB.js";import"./chunk-MQWZBKOF.js";import"./chunk-BUCBIG2A.js";var b=12e3;async function j(e,o){if((e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as $}from"./chunk-4F3BBP7B.js";import{c as p,e as h,i as R}from"./chunk-GQAWFQNN.js";import"./chunk-DQZEN256.js";import"./chunk-KUUFY6FC.js";import"./chunk-5KY7TQ42.js";import"./chunk-JDGLBW64.js";var b=12e3;async function j(e,o){if((e.includes("--help")||e.includes("-h"))&&(console.log(`
3
3
  sootsim three-mode \u2014 toggle the 3d device stage
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as m,e as d,h as s}from"./chunk-L7F7QBGM.js";import"./chunk-FZ656TJA.js";import"./chunk-QBYYAPTB.js";import"./chunk-MQWZBKOF.js";import"./chunk-BUCBIG2A.js";import{writeFileSync as g}from"fs";function u(){console.log(`
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as m,e as d,h as s}from"./chunk-GQAWFQNN.js";import"./chunk-DQZEN256.js";import"./chunk-KUUFY6FC.js";import"./chunk-5KY7TQ42.js";import"./chunk-JDGLBW64.js";import{writeFileSync as g}from"fs";function u(){console.log(`
3
3
  sootsim timeline \u2014 control the semantic event timeline
4
4
 
5
5
  usage:
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as s}from"./chunk-5GGI6NGS.js";import"./chunk-L7F7QBGM.js";import"./chunk-FZ656TJA.js";import"./chunk-QBYYAPTB.js";import{a as e}from"./chunk-QWNLVJ4P.js";import"./chunk-XWG6NJJE.js";import{E as i}from"./chunk-MQWZBKOF.js";import"./chunk-BUCBIG2A.js";import{spawn as r}from"node:child_process";var a="https://registry.npmjs.org/sootsim/latest";async function h(o){let n=o.indexOf("--channel"),t=n>=0&&o[n+1]?o[n+1]:void 0;console.log(`sootsim upgrade
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as s}from"./chunk-SNX3M4XD.js";import"./chunk-GQAWFQNN.js";import"./chunk-DQZEN256.js";import"./chunk-KUUFY6FC.js";import{a as e}from"./chunk-3L4NRJ6C.js";import"./chunk-OGLWXPVG.js";import{E as i}from"./chunk-5KY7TQ42.js";import"./chunk-JDGLBW64.js";import{spawn as r}from"node:child_process";var a="https://registry.npmjs.org/sootsim/latest";async function h(o){let n=o.indexOf("--channel"),t=n>=0&&o[n+1]?o[n+1]:void 0;console.log(`sootsim upgrade
3
3
  `),await c(),console.log(`
4
4
  runtime:`),await s(["install",...t?["--channel",t]:[]],{})}async function c(){let o=e(),n=await u();if(!n){console.log(` cli: v${o} \u2014 couldn't reach the npm registry, skipped`);return}if(i(n,o)<=0){console.log(` cli: v${o} (latest)`);return}console.log(` cli: v${o} \u2192 v${n} \u2014 installing globally\u2026`),await m(n)?console.log(` cli: installed v${n} \u2014 restart any running \`sootsim\` process to pick it up`):(console.log(" cli: automatic install failed \u2014 upgrade it yourself with:"),console.log(" npm install -g sootsim@latest"))}async function u(){try{let o=await fetch(a,{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}}function m(o){return new Promise(n=>{let t=r("npm",["install","-g",`sootsim@${o}`],{stdio:"inherit",shell:!0});t.on("error",()=>n(!1)),t.on("exit",l=>n(l===0))})}export{h as runUpgrade};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c}from"./chunk-VMYMPL6H.js";import"./chunk-SIB6I72P.js";import"./chunk-M2TMFGZH.js";import"./chunk-B7BMSU7H.js";import"./chunk-GQAWFQNN.js";import"./chunk-BQOMDL4K.js";import"./chunk-GC4THE6K.js";import"./chunk-IODOTOOP.js";import"./chunk-PV6MBKKE.js";import"./chunk-DQZEN256.js";import"./chunk-KUUFY6FC.js";import"./chunk-5KY7TQ42.js";import"./chunk-JDGLBW64.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as i}from"./chunk-QWNLVJ4P.js";import{d as s,f as l,m as r}from"./chunk-XWG6NJJE.js";import{B as n}from"./chunk-MQWZBKOF.js";import"./chunk-BUCBIG2A.js";async function p(u){let{IS_BETA:a,BETA_LABEL:c}=await import("./beta-ERD6Z2EE.js"),m=a?` \xB7 ${c}`:"";console.log(`sootsim v${i()}${m}`);let t=n(),e=l();console.log(t?`runtime v${t} \xB7 ${e}`:"runtime not installed \u2014 run `sootsim runtime install`");let o=await r({channel:e});o.outdated&&o.latest&&console.log(`
1
+ /*! sootsim v0.1.169 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as i}from"./chunk-3L4NRJ6C.js";import{d as s,f as l,m as r}from"./chunk-OGLWXPVG.js";import{B as n}from"./chunk-5KY7TQ42.js";import"./chunk-JDGLBW64.js";async function p(u){let{IS_BETA:a,BETA_LABEL:c}=await import("./beta-FGSMZWLP.js"),m=a?` \xB7 ${c}`:"";console.log(`sootsim v${i()}${m}`);let t=n(),e=l();console.log(t?`runtime v${t} \xB7 ${e}`:"runtime not installed \u2014 run `sootsim runtime install`");let o=await r({channel:e});o.outdated&&o.latest&&console.log(`
3
3
  \u2191 runtime v${o.latest} available \u2014 run \`sootsim upgrade\``),console.log(`
4
4
  what's new: ${s}`)}export{p as runVersion};