sootsim 0.1.224 → 0.1.225

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 (141) hide show
  1. package/dist-cli/bin.js +4 -4
  2. package/dist-cli/chunks/{agent-IXTIVO4B.js → agent-2QJNGCGQ.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-37QGL7LZ.js → agent-wrapper-JFTDMNBA.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-CMNA7ZLB.js → app-fonts-ZF73VQCZ.js} +2 -2
  5. package/dist-cli/chunks/{assert-VE7DZN64.js → assert-VOWVK5UT.js} +2 -2
  6. package/dist-cli/chunks/{auth-BEI6S5AK.js → auth-RAUKHPE3.js} +2 -2
  7. package/dist-cli/chunks/beta-7TBS7VDG.js +2 -0
  8. package/dist-cli/chunks/{camera-WGDO6BS4.js → camera-ZMQZISLH.js} +2 -2
  9. package/dist-cli/chunks/{chunk-FR2ZFWG2.js → chunk-347KANFK.js} +1 -1
  10. package/dist-cli/chunks/{chunk-CCW5EYIU.js → chunk-3LZ4N33H.js} +1 -1
  11. package/dist-cli/chunks/{chunk-NLTKRAPS.js → chunk-3QKH7HQL.js} +3 -3
  12. package/dist-cli/chunks/{chunk-SQ2QXZ4N.js → chunk-3W4H7IIQ.js} +2 -2
  13. package/dist-cli/chunks/{chunk-6UJEQVPW.js → chunk-6P4XXLDV.js} +2 -2
  14. package/dist-cli/chunks/{chunk-WZAF6VH6.js → chunk-AHQQF4W6.js} +2 -2
  15. package/dist-cli/chunks/{chunk-RQHZYDRX.js → chunk-AWY3D6YY.js} +2 -2
  16. package/dist-cli/chunks/{chunk-QS4PGGDS.js → chunk-B7IV5YY2.js} +1 -1
  17. package/dist-cli/chunks/{chunk-OYPMYSMY.js → chunk-BI4VCL6Q.js} +2 -2
  18. package/dist-cli/chunks/{chunk-HCA46V4W.js → chunk-CRSULHXN.js} +2 -2
  19. package/dist-cli/chunks/{chunk-X4623KU6.js → chunk-D74MZDQ5.js} +2 -2
  20. package/dist-cli/chunks/{chunk-CE7KFLTO.js → chunk-DOGQUNTS.js} +1 -1
  21. package/dist-cli/chunks/{chunk-2VBAA7XJ.js → chunk-DVK6PIUQ.js} +2 -2
  22. package/dist-cli/chunks/{chunk-FB4YNNHB.js → chunk-EH5ATUDN.js} +2 -2
  23. package/dist-cli/chunks/{chunk-MF4YHHL4.js → chunk-EWQMANOX.js} +1 -1
  24. package/dist-cli/chunks/{chunk-ZTYPCXG2.js → chunk-FCWI4FXZ.js} +2 -2
  25. package/dist-cli/chunks/{chunk-GVK4Q3BA.js → chunk-FHHD7KFS.js} +1 -1
  26. package/dist-cli/chunks/{chunk-2QIGZP7G.js → chunk-HS2NYELS.js} +1 -1
  27. package/dist-cli/chunks/{chunk-24QLCYJG.js → chunk-IP4QVK56.js} +2 -2
  28. package/dist-cli/chunks/chunk-JHAL2K27.js +1 -0
  29. package/dist-cli/chunks/{chunk-4CO7SKSJ.js → chunk-JI2BFZCM.js} +2 -2
  30. package/dist-cli/chunks/{chunk-NWLTJUCZ.js → chunk-KW72IOGD.js} +1 -1
  31. package/dist-cli/chunks/{chunk-K7FLRWXM.js → chunk-LHI6SSKZ.js} +1 -1
  32. package/dist-cli/chunks/{chunk-CEBMTKID.js → chunk-MOFL2C72.js} +2 -2
  33. package/dist-cli/chunks/{chunk-VR5W6I6B.js → chunk-NCJ6UORF.js} +2 -2
  34. package/dist-cli/chunks/{chunk-HYSKRSBW.js → chunk-NCJQISNJ.js} +1 -1
  35. package/dist-cli/chunks/{chunk-FVZQMYUJ.js → chunk-NT7DIPF6.js} +1 -1
  36. package/dist-cli/chunks/{chunk-ZVNBKS5H.js → chunk-OHEMKK3X.js} +2 -2
  37. package/dist-cli/chunks/{chunk-ZTCF4L5T.js → chunk-P73P4LEJ.js} +3 -3
  38. package/dist-cli/chunks/{chunk-S6LVSOND.js → chunk-PUXJ6MG3.js} +1 -1
  39. package/dist-cli/chunks/chunk-Q6HBPMI4.js +1 -0
  40. package/dist-cli/chunks/{chunk-KRZ5WWPA.js → chunk-QH5AHGSL.js} +2 -2
  41. package/dist-cli/chunks/{chunk-OPI6PLWA.js → chunk-TFNMU5WV.js} +1 -1
  42. package/dist-cli/chunks/{chunk-5FPSA6T3.js → chunk-TGRJ7ZJD.js} +2 -2
  43. package/dist-cli/chunks/{chunk-NWN2GQ36.js → chunk-UQKFXZT7.js} +1 -1
  44. package/dist-cli/chunks/{chunk-PFYMU6QF.js → chunk-UZM7EU4D.js} +3 -3
  45. package/dist-cli/chunks/{chunk-7KD7SO3A.js → chunk-UZWRZ3ND.js} +1 -1
  46. package/dist-cli/chunks/{chunk-HFTFALJY.js → chunk-V4M52O5I.js} +2 -2
  47. package/dist-cli/chunks/{chunk-KIZV52CA.js → chunk-VIHFW4WT.js} +3 -3
  48. package/dist-cli/chunks/{chunk-4WQ36IZO.js → chunk-W67AEQ3C.js} +3 -3
  49. package/dist-cli/chunks/{chunk-OOJ5OXYG.js → chunk-WDDOFF3W.js} +2 -2
  50. package/dist-cli/chunks/{chunk-AHA4PLGQ.js → chunk-XXDT7Q4C.js} +20 -31
  51. package/dist-cli/chunks/chunk-YWDWZW74.js +3 -0
  52. package/dist-cli/chunks/{chunk-QJ2UUEBC.js → chunk-ZPXGQH3V.js} +2 -2
  53. package/dist-cli/chunks/cli-version-I6MGYDFK.js +2 -0
  54. package/dist-cli/chunks/{compat-6R6UR3NV.js → compat-WQGSKB6D.js} +3 -3
  55. package/dist-cli/chunks/{config-IWITGWOX.js → config-24NABZH5.js} +2 -2
  56. package/dist-cli/chunks/{control-NN6KYHZ7.js → control-QN3OMNZB.js} +2 -2
  57. package/dist-cli/chunks/daemon-SCUUHMKS.js +2 -0
  58. package/dist-cli/chunks/{debug-AVD27HN2.js → debug-3AWVNHV2.js} +3 -3
  59. package/dist-cli/chunks/{desktop-ARRS4W7G.js → desktop-2Y7TM6YZ.js} +3 -3
  60. package/dist-cli/chunks/{detox-7ZVE4SEU.js → detox-I5LLQ7PW.js} +2 -2
  61. package/dist-cli/chunks/{device-KCAXPE2J.js → device-4OJVHSRG.js} +2 -2
  62. package/dist-cli/chunks/{diagnose-NN2P4YHG.js → diagnose-HUXZBMVI.js} +2 -2
  63. package/dist-cli/chunks/drivers-SQFPFW7V.js +2 -0
  64. package/dist-cli/chunks/{film-YYDHQCIK.js → film-MXZ444WR.js} +3 -3
  65. package/dist-cli/chunks/flow-P3IJ4VHB.js +2 -0
  66. package/dist-cli/chunks/help-GQY5VDRA.js +2 -0
  67. package/dist-cli/chunks/{home-paths-P5BF26CV.js → home-paths-RTMWY5WD.js} +2 -2
  68. package/dist-cli/chunks/inspect-DETXTJUP.js +2 -0
  69. package/dist-cli/chunks/install-desktop-CHYTPRFO.js +2 -0
  70. package/dist-cli/chunks/{login-3C6WS5WJ.js → login-YBPCBEPD.js} +4 -4
  71. package/dist-cli/chunks/{logout-N7NHSAJ6.js → logout-JR5ZSYLS.js} +2 -2
  72. package/dist-cli/chunks/{maestro-72YHMDN3.js → maestro-HHF4ISZI.js} +3 -3
  73. package/dist-cli/chunks/{maestro-generate-N6WRP4JB.js → maestro-generate-HFAYZHUF.js} +3 -3
  74. package/dist-cli/chunks/{mode-HTGZVPBB.js → mode-KI5E5FWJ.js} +2 -2
  75. package/dist-cli/chunks/optional-demo-registry-6VYITRX4.js +2 -0
  76. package/dist-cli/chunks/{perf-G3LOBGFB.js → perf-XJXFKHQ3.js} +2 -2
  77. package/dist-cli/chunks/{record-UCC52HPB.js → record-T7IKWLEV.js} +3 -3
  78. package/dist-cli/chunks/runtime-LXVX24LC.js +2 -0
  79. package/dist-cli/chunks/{screenshot-command-UERRRDTX.js → screenshot-command-VN42XKYN.js} +10 -10
  80. package/dist-cli/chunks/screenshots-capture-IJM5ZESL.js +40 -0
  81. package/dist-cli/chunks/{serve-YYYACL4G.js → serve-C4QC2HID.js} +2 -2
  82. package/dist-cli/chunks/{setup-DOQ3CNWU.js → setup-7GKAB4SB.js} +3 -3
  83. package/dist-cli/chunks/{skills-TY7JP5HL.js → skills-FHH2POMV.js} +2 -2
  84. package/dist-cli/chunks/{storage-5G6MYKIR.js → storage-ZJMSMGT4.js} +2 -2
  85. package/dist-cli/chunks/store-DU76KFTF.js +2 -0
  86. package/dist-cli/chunks/telemetry-PZGM7U27.js +2 -0
  87. package/dist-cli/chunks/{timeline-TEZJY6OI.js → timeline-NAMSRGWR.js} +2 -2
  88. package/dist-cli/chunks/{upgrade-2VHEHNNM.js → upgrade-E7WMFJYM.js} +2 -2
  89. package/dist-cli/chunks/upload-L2ZKQQMJ.js +2 -0
  90. package/dist-cli/chunks/{version-LPLQL5Y2.js → version-H54YADEJ.js} +2 -2
  91. package/dist-cli/chunks/{web-3O74TBQP.js → web-U5F5O7TY.js} +2 -2
  92. package/dist-cli/chunks/{what-happened-SHAO2WXX.js → what-happened-A42ORDPY.js} +2 -2
  93. package/dist-lib/agent-daemon-client.cjs +1 -1
  94. package/dist-lib/agent-events.cjs +1 -1
  95. package/dist-lib/agent-identity.cjs +1 -1
  96. package/dist-lib/agent-sessions.cjs +1 -1
  97. package/dist-lib/attached-projects.cjs +1 -1
  98. package/dist-lib/auth/shared-session.cjs +1 -1
  99. package/dist-lib/backend-origin.cjs +1 -1
  100. package/dist-lib/beta.cjs +1 -1
  101. package/dist-lib/beta.mjs +1 -1
  102. package/dist-lib/bridge-constants.cjs +1 -1
  103. package/dist-lib/cli-constants.cjs +1 -1
  104. package/dist-lib/config.cjs +1 -1
  105. package/dist-lib/detox/index.cjs +8 -4
  106. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  107. package/dist-lib/home-paths.cjs +1 -1
  108. package/dist-lib/host/bridge-host.cjs +1 -1
  109. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  110. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  111. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  112. package/dist-lib/host/websocket-proxy.cjs +1 -1
  113. package/dist-lib/index.cjs +1 -1
  114. package/dist-lib/jump-to-source-babel.cjs +1 -1
  115. package/dist-lib/menu.cjs +1 -1
  116. package/dist-lib/menu.mjs +1 -1
  117. package/dist-lib/metro.cjs +1 -1
  118. package/dist-lib/profiles.cjs +1 -1
  119. package/dist-lib/render-mode.cjs +1 -1
  120. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  121. package/dist-lib/sdk.cjs +1 -1
  122. package/dist-lib/sdk.mjs +1 -1
  123. package/dist-lib/skills.cjs +11 -7
  124. package/dist-lib/vite.cjs +1 -1
  125. package/package.json +1 -1
  126. package/dist-cli/chunks/beta-ZAFAH443.js +0 -2
  127. package/dist-cli/chunks/chunk-EVRV7ZEQ.js +0 -1
  128. package/dist-cli/chunks/chunk-FKMYICRL.js +0 -1
  129. package/dist-cli/chunks/cli-version-EEQU4RHG.js +0 -2
  130. package/dist-cli/chunks/daemon-OOS5GYH3.js +0 -2
  131. package/dist-cli/chunks/drivers-WKXM4KAQ.js +0 -2
  132. package/dist-cli/chunks/flow-RLO6T7NN.js +0 -2
  133. package/dist-cli/chunks/help-QGPISENF.js +0 -2
  134. package/dist-cli/chunks/inspect-CCH3ID2P.js +0 -2
  135. package/dist-cli/chunks/install-desktop-SD2XL3QE.js +0 -2
  136. package/dist-cli/chunks/optional-demo-registry-CUXZZ2PW.js +0 -2
  137. package/dist-cli/chunks/runtime-RCOICIJ4.js +0 -2
  138. package/dist-cli/chunks/screenshots-capture-RBBJE7EF.js +0 -41
  139. package/dist-cli/chunks/store-SVH7YFQP.js +0 -2
  140. package/dist-cli/chunks/telemetry-Z6SP2WSB.js +0 -2
  141. package/dist-cli/chunks/upload-WXQKH3QR.js +0 -2
@@ -0,0 +1,40 @@
1
+ /*! sootsim v0.1.225 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as M}from"./chunk-YWDWZW74.js";import{a as x}from"./chunk-OHEMKK3X.js";import"./chunk-D74MZDQ5.js";import"./chunk-LHI6SSKZ.js";import"./chunk-NT7DIPF6.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=`
3
+ sootsim screenshot appstore capture \u2014 headlessly capture + upload App Store slides
4
+
5
+ usage:
6
+ sootsim screenshot appstore capture --org <org> --repo <repo> [options]
7
+
8
+ what it does:
9
+ boots the org-mode build shell in headless GPU Chrome (authed via your
10
+ \`sootsim login\` session), captures each slide through the live screenshot
11
+ composer so every slide gets editable layers (captureRef + cleanRef +
12
+ screenRef), and lets the shell auto-upload them to your org deck.
13
+
14
+ options:
15
+ --org <org> github org slug (required)
16
+ --repo <repo> repo name (required)
17
+ --branch <branch> build branch to boot (default: main)
18
+ --platform <p> ios | android (default: ios)
19
+ --slides <list> 1-based indices to capture, e.g. 1,3,5 (default: all)
20
+ --dry-run capture + report refs, do NOT upload (PUTs aborted)
21
+ --force allow overwriting a NON-EMPTY existing deck
22
+ --out <dir> also write composed App-Store PNGs locally
23
+ --shell-origin <url> origin serving /build (default: your session origin)
24
+ --api-origin <url> origin for deck/capture APIs (default: session origin)
25
+ --timeout <ms> per-step bridge timeout (default: 45000)
26
+ --json machine-readable summary
27
+
28
+ examples:
29
+ sootsim screenshot appstore capture --org acme --repo my-app --dry-run
30
+ sootsim screenshot appstore capture --org acme --repo my-app --branch main --force
31
+ `;function H(t){let e=a=>{let d=t.indexOf(a);return d>=0?t[d+1]:void 0},n=a=>t.includes(a),s=e("--slides"),i=s?s.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:n("--dry-run"),force:n("--force"),out:e("--out")??null,shellOrigin:e("--shell-origin")??null,apiOrigin:e("--api-origin")??null,timeoutMs:Number(e("--timeout")??"45000")||45e3,json:n("--json")}}function J(){let t=x();if(t&&t.kind==="session")return{token:t.token,origin:t.origin};process.stderr.write(`
32
+ sootsim screenshot appstore capture needs a logged-in session.
33
+ run \`sootsim login\` first (the captured slides upload to that account).
34
+
35
+ `),process.exit(1)}function V(t){let e=t.replace(/^\[|\]$/g,"").toLowerCase();return e==="localhost"||e.endsWith(".localhost")||e==="::1"||/^127(?:\.\d{1,3}){3}$/.test(e)}function Y(t){let e=new URL(t);if(V(e.hostname)){let s=(Number(e.port)||3e3)-3e3;if(s>=0&&s<=1e3)return e.port=String(5173+s),e.origin}return e.hostname==="sootbean.com"||e.hostname.endsWith(".sootbean.com")?"https://sootsim.com":t}function K(){try{return Number(T("sysctl -n vm.loadavg").toString().trim().split(/\s+/)[1])||0}catch{return 0}}async function Q(t,e,n,s){let i=await fetch(`${t}/api/sootsim/screenshot-decks?org=${encodeURIComponent(n)}&repo=${encodeURIComponent(s)}`,{headers:{authorization:`Bearer ${e}`}});if(!i.ok)return[];let a=await i.json().catch(()=>null),d=[];for(let g of a?.decks??[])Array.isArray(g.config?.frames)&&d.push(...g.config.frames);return d}async function X(t,e,n,s){let i=await fetch(`${t}/api/sootsim/screenshot-capture?ref=${encodeURIComponent(s)}&org=${encodeURIComponent(n)}`,{headers:{authorization:`Bearer ${e}`}});return i.ok?`data:image/png;base64,${Buffer.from(await i.arrayBuffer()).toString("base64")}`:null}async function Z(t,e){let n=Date.now()+e;for(;Date.now()<n;){for(let s of t.frames())if(await s.evaluate(()=>!!globalThis.SootSim?.bridges?.screenshotControl).catch(()=>!1))return s;await t.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 I(t){return t.evaluate(async()=>{let n=globalThis.SootSim?.bridges?.screenshotControl;if(!n)throw new Error("screenshotControl missing");return n.getState()})}async function _(t){await t.evaluate(async()=>{let e=globalThis.SootSim?.bridges?.settings,n=Date.now()+3e3;for(;Date.now()<n;){if(e?.get?.()?.screenshotMode)return;await new Promise(s=>setTimeout(s,50))}e&&!e.get().screenshotMode&&(e.set("screenshotMode",!0),e.get().showFrame||e.set("showFrame",!0))})}async function ee(t,e,n,s){await t.evaluate(async([i,a,d])=>{let g=globalThis.SootSim,h=g?.bridges?.screenshotControl;if(!h)throw new Error("screenshotControl missing");let w=b=>new Promise(u=>setTimeout(u,b));if(a){h.focusSlide(i);let b=Date.now()+3e4,u=g?.bridges?.threeMode;for(;Date.now()<b&&(u=g?.bridges?.threeMode,!(u?.setScreenImage&&u?.captureStage&&u?.getState?.()?.ready));)await w(150);await w(1e3);let c=a;u?.configure?.({colorway:c.colorway,background:c.background,...c.customGradient?{customGradient:c.customGradient}:{},setting:c.setting,focus:c.focus,environment:c.environmentActive?{pins:c.environmentPins??{},effects:c.environmentEffects??{}}:!1,pose:{phonePosition:c.phonePosition,phoneRotation:c.phoneRotation,cameraPosition:c.cameraPosition,target:c.target}}),await w(900),d&&u?.setScreenImage&&(u.setScreenImage(d),await w(1200))}await h.capture(i)},[e,n,s])}async function ue(t){if(t.includes("--help")||t.includes("-h"))return console.log(z),0;let e=H(t);if(!e.org||!e.repo)return process.stderr.write(` --org and --repo are required (see --help)
36
+ `),1;let{token:n,origin:s}=J(),i=(e.apiOrigin??s).replace(/\/$/,""),a=(e.shellOrigin??Y(i)).replace(/\/$/,""),d=await Q(i,n,e.org,e.repo);if(!e.dryRun&&!e.force&&d.length>0)return process.stderr.write(` refusing to overwrite the existing ${e.org}/${e.repo} deck (${d.length} slide(s)). re-run with --force to replace it, or --dry-run to preview.
37
+ `),1;let g=K(),h=Number(T("sysctl -n hw.ncpu").toString().trim())||8;if(g>h)return process.stderr.write(` load average ${g.toFixed(1)} exceeds ${h} cores \u2014 tear down other work first.
38
+ `),1;let w=`${a}/build/${encodeURIComponent(e.org)}/${encodeURIComponent(e.repo)}/${encodeURIComponent(e.branch)}?platform=${encodeURIComponent(e.platform)}&ssMode=1`,b=O(U(G(),"sootsim-capture-")),{browser:u,reapNow:c}=await M(r=>W.launchPersistentContext(b,r),{headless:!0,viewport:{width:393,height:852},deviceScaleFactor:3,args:["--enable-unsafe-webgpu","--enable-features=Vulkan,WebGPU","--hide-scrollbars"]});await u.addInitScript(r=>{try{localStorage.setItem("sootsim.session.token",r)}catch{}},n);let y=[],p=u.pages()[0]??await u.newPage();e.dryRun?await p.route(/\/api\/sootsim\/screenshot-(decks|capture)/,r=>r.request().method()==="PUT"?r.abort():r.continue()):p.on("response",r=>{let m=r.url();r.request().method()==="PUT"&&(m.includes("/api/sootsim/screenshot-decks")?y.push({kind:"deck",status:r.status()}):m.includes("/api/sootsim/screenshot-capture")&&y.push({kind:"capture",status:r.status()}))});let R=[];p.on("pageerror",r=>R.push(r.message));let N=p.waitForResponse(r=>r.url().includes("/api/sootsim/screenshot-decks")&&r.request().method()==="GET",{timeout:e.timeoutMs}).catch(()=>null);try{await p.goto(w,{waitUntil:"domcontentloaded",timeout:e.timeoutMs});let r=await Z(p,e.timeoutMs);await _(r),await N,await p.waitForTimeout(800);let m=await I(r);if(m.slides.length===0)return process.stderr.write(` the deck has no slides to capture \u2014 add slides in the composer first.
39
+ `),1;let $=e.slides?m.slides.filter(o=>e.slides.includes(o.index)):m.slides;console.log(` ${m.projectName} on ${m.deviceModel} \u2014 capturing ${$.length}/${m.slides.length} slide(s)${e.dryRun?" (dry-run, no upload)":""}`);for(let o of $)try{let l=d[o.index-1],f=l?.threeScene??null,C=f&&l?.screenRef?await X(i,n,e.org,l.screenRef):null;await ee(r,o.index,f,C),console.log(` \u2713 slide ${o.index} "${o.title.slice(0,40)}"`)}catch(l){console.log(` \u2717 slide ${o.index} "${o.title.slice(0,40)}" \u2014 ${l.message}`)}e.dryRun||await p.waitForTimeout(2500);let S=(await I(r)).slides.filter(o=>$.some(l=>l.id===o.id)),v=[];if(e.out){let o=B(e.out)?e.out:L(process.cwd(),e.out);for(let l of S){if(!l.captureRef)continue;let f=await r.evaluate(async k=>{let F=globalThis.SootSim?.bridges?.screenshotControl;if(!F)throw new Error("screenshotControl missing");return F.exportSlide(k)},l.index),C=f.dataUrl.match(/^data:[^;]+;base64,(.+)$/);if(C){let k=U(o,f.name);D(q(k),{recursive:!0}),j(k,Buffer.from(C[1],"base64")),v.push(k)}}}let P=S.filter(o=>o.captureRef&&o.cleanRef),A={org:e.org,repo:e.repo,branch:e.branch,dryRun:e.dryRun,slides:S.map(o=>({index:o.index,title:o.title,captureRef:!!o.captureRef,cleanRef:!!o.cleanRef,screenRef:!!o.screenRef,captureMode:o.captureMode})),editableCount:P.length,uploads:e.dryRun?"skipped (dry-run)":y,written:v,pageErrors:R.slice(0,5)};if(e.json)console.log(JSON.stringify(A,null,2));else{console.log(`
40
+ ${P.length}/${S.length} slide(s) now have editable layers (captureRef + cleanRef)`);let o=S.filter(l=>l.captureRef&&!l.cleanRef);if(o.length&&console.log(` \u26A0 ${o.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 l=y.filter(f=>f.status>=200&&f.status<300).length;console.log(` uploads: ${l}/${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 u.close().catch(()=>{}),c(),E(b,{recursive:!0,force:!0})}}export{ue as runScreenshotsCapture};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.224 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as le,c as H,d as de,e as F,f as ue,h as pe,i as C,j as me,k as he,l as fe,p as ge,s as v,t as Se,u as ye,v as ve,w as be}from"./chunk-24QLCYJG.js";import"./chunk-MF4YHHL4.js";import{a as ce}from"./chunk-ZTYPCXG2.js";import"./chunk-ZVNBKS5H.js";import{h as ae}from"./chunk-KRZ5WWPA.js";import{f as P,g as se}from"./chunk-SQ2QXZ4N.js";import"./chunk-HYSKRSBW.js";import"./chunk-CCW5EYIU.js";import"./chunk-QS4PGGDS.js";import"./chunk-RQHZYDRX.js";import{d as oe}from"./chunk-NWN2GQ36.js";import{a as ee,b as te}from"./chunk-VR5W6I6B.js";import"./chunk-X4623KU6.js";import{a as re,b as ne}from"./chunk-FR2ZFWG2.js";import"./chunk-ZTCF4L5T.js";import{E as J,G as E,H as K,I as V,J as D,L as G,M as q,O as z,Q as X,R as Y,S as Z,T as U,U as Q,y as M,z as j}from"./chunk-K7FLRWXM.js";import{a as ie}from"./chunk-2QIGZP7G.js";import"./chunk-FVZQMYUJ.js";import{spawn as ut}from"child_process";import I from"fs";import{createServer as pt}from"http";import S from"path";import{WebSocket as h,WebSocketServer as mt}from"ws";import Ie from"node:fs";import R from"node:path";import{spawn as Me}from"node:child_process";import De from"node:fs";import Ue from"node:os";import He from"node:path";var we=/^[A-Za-z0-9._:-]{1,160}$/;function W(o){if(!o?.startsWith("AGENTBUS_SESSION:"))return null;let e=o.slice(17).trim();return we.test(e)?e:null}function Ae(o){return we.test(o)}function Fe(o){return typeof o.text=="string"?o.text.trim():""}function We(o){let e=o?.trim();if(e)return e;let t=process.env.AGENTBUS_COMMAND?.trim();if(t)return t;let i=He.join(Ue.homedir(),".local","bin","agentbus");return De.existsSync(i)?i:"agentbus"}async function ke(o){let e=o.sessionId.trim();if(!Ae(e))throw new Error(`invalid agentbus session id: ${e||"<empty>"}`);let t=Fe(o.prompt);if(!t)throw new Error("prompt text is empty");let i=We(o.command),s=o.timeoutMs??15e3;await new Promise((n,a)=>{let r=Me(i,["send",e,t],{stdio:["ignore","ignore","pipe"],env:process.env}),c="",d=setTimeout(()=>{try{r.kill("SIGTERM")}catch{}a(new Error(`agentbus send timed out after ${Math.round(s/1e3)}s`))},s);r.stderr?.setEncoding("utf8"),r.stderr?.on("data",l=>{c.length<4e3&&(c+=String(l))}),r.on("error",l=>{clearTimeout(d),a(l)}),r.on("exit",(l,u)=>{if(clearTimeout(d),l===0){n();return}let p=c.trim();a(new Error(p||`agentbus send exited with ${u?`signal ${u}`:`code ${l??"unknown"}`}`))})})}var _=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 v?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 fe()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
1
+ /*! sootsim v0.1.225 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as le,c as H,d as de,e as F,f as ue,h as pe,i as C,j as me,k as he,l as fe,p as ge,s as v,t as Se,u as ye,v as ve,w as be}from"./chunk-IP4QVK56.js";import"./chunk-EWQMANOX.js";import{a as ce}from"./chunk-FCWI4FXZ.js";import"./chunk-OHEMKK3X.js";import{h as ae}from"./chunk-QH5AHGSL.js";import{f as P,g as se}from"./chunk-3W4H7IIQ.js";import"./chunk-NCJQISNJ.js";import"./chunk-3LZ4N33H.js";import"./chunk-B7IV5YY2.js";import"./chunk-AWY3D6YY.js";import{d as oe}from"./chunk-UQKFXZT7.js";import{a as ee,b as te}from"./chunk-NCJ6UORF.js";import"./chunk-D74MZDQ5.js";import{a as re,b as ne}from"./chunk-347KANFK.js";import"./chunk-P73P4LEJ.js";import{E as J,G as E,H as K,I as V,J as D,L as G,M as q,O as z,Q as X,R as Y,S as Z,T as U,U as Q,y as M,z as j}from"./chunk-LHI6SSKZ.js";import{a as ie}from"./chunk-HS2NYELS.js";import"./chunk-NT7DIPF6.js";import{spawn as ut}from"child_process";import I from"fs";import{createServer as pt}from"http";import S from"path";import{WebSocket as h,WebSocketServer as mt}from"ws";import Ie from"node:fs";import R from"node:path";import{spawn as Me}from"node:child_process";import De from"node:fs";import Ue from"node:os";import He from"node:path";var we=/^[A-Za-z0-9._:-]{1,160}$/;function W(o){if(!o?.startsWith("AGENTBUS_SESSION:"))return null;let e=o.slice(17).trim();return we.test(e)?e:null}function Ae(o){return we.test(o)}function Fe(o){return typeof o.text=="string"?o.text.trim():""}function We(o){let e=o?.trim();if(e)return e;let t=process.env.AGENTBUS_COMMAND?.trim();if(t)return t;let i=He.join(Ue.homedir(),".local","bin","agentbus");return De.existsSync(i)?i:"agentbus"}async function ke(o){let e=o.sessionId.trim();if(!Ae(e))throw new Error(`invalid agentbus session id: ${e||"<empty>"}`);let t=Fe(o.prompt);if(!t)throw new Error("prompt text is empty");let i=We(o.command),s=o.timeoutMs??15e3;await new Promise((n,a)=>{let r=Me(i,["send",e,t],{stdio:["ignore","ignore","pipe"],env:process.env}),c="",d=setTimeout(()=>{try{r.kill("SIGTERM")}catch{}a(new Error(`agentbus send timed out after ${Math.round(s/1e3)}s`))},s);r.stderr?.setEncoding("utf8"),r.stderr?.on("data",l=>{c.length<4e3&&(c+=String(l))}),r.on("error",l=>{clearTimeout(d),a(l)}),r.on("exit",(l,u)=>{if(clearTimeout(d),l===0){n();return}let p=c.trim();a(new Error(p||`agentbus send exited with ${u?`signal ${u}`:`code ${l??"unknown"}`}`))})})}var _=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 v?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 fe()}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 pe(String(i.projectId)),{ok:!0};case"agent:auto-attach-for-url":return this.autoAttachForUrl(i.input??{});case"agent:list-sessions":return me(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),a=C(n);if(!a)throw new v("NO_SESSION",`no session: ${n}`);let r=this.normalizePromptEnvelope(i);return await ye(n,r),this.notePromptAccepted(n,r,a.status==="working")}case"agent:end-session":this.dropSessionFanout(String(i.sessionId)),await ve(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 v("UNKNOWN_AGENT_MSG",`unknown agent message: ${t}`)}}async sendClaimedPrompt(e){let t=typeof e.simId=="string"?e.simId.trim():"";if(!t)throw new v("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 v("NO_CLAIM",`sim ${t} has no active CLI claim`);let s=W(i.cliIdentityKey);if(!s)throw new v("UNSUPPORTED_CLAIM",`sim ${t} is claimed by a CLI identity that is not promptable`);return await ke({sessionId:s,prompt:this.normalizePromptEnvelope(e)}),{ok:!0,routed:"agentbus",sessionId:s}}async doStartSession(e){if(!de(e.projectId))throw new v("NO_PROJECT",`no project: ${e.projectId}`);let i=await Se(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 P({excludePorts:s})).find(l=>String(l.port)===i);if(!a||!a.cwd)return{project:null};let r=F().find(l=>l.cwd===a.cwd)??null,c=Array.from(new Set([...r?.knownBundleUrls??[],a.bundleUrl,t]));return{project:H({cwd:a.cwd,name:a.projectName??R.basename(a.cwd),preferredProvider:e.provider??r?.preferredProvider,sourceRoots:r?.sourceRoots??[a.cwd],knownBundleUrls:c,framework:r?.framework??je(a.framework),bundleId:a.bundleId??r?.bundleId})}}getTranscript(e){let t=ge(e);return Ie.existsSync(t)?Ie.readFileSync(t,"utf8"):{error:"transcript not found",code:"NO_TRANSCRIPT"}}getPaths(){let e=le();return{userDataDir:e,storeFile:R.join(e,"attached-projects.json"),sessionsDir:R.join(e,"sessions"),transcriptsDir:R.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=be(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{ue(c.projectId,{usd:a.costUsd,ts:a.ts})}catch(d){process.stderr.write(`[sootsim-agent] recordTurnTelemetry failed: ${d instanceof Error?d.message:String(d)}
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){he(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===_)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===_)try{i.send(t)}catch{}}respond(e,t,i){if(e.readyState===_)try{e.send(JSON.stringify({id:t,result:i}))}catch{}}respondError(e,t,i,s){if(e.readyState===_)try{e.send(JSON.stringify({id:t,error:i,...s?{code:s}:{}}))}catch{}}};function je(o){return o==="expo"?"expo":o==="one"||o==="vxrn"?"one":"unknown"}import Ve from"http";import Ge from"https";var $="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",Je=[{hostSuffix:"uniswap.org",headers:{origin:"https://app.uniswap.org",referer:"https://app.uniswap.org/"},suppressBrowserUserAgent:!0}];function Ke(o){let e=o.toLowerCase();for(let t of Je)if(e===t.hostSuffix||e.endsWith(`.${t.hostSuffix}`))return t}function Ce(o){let e=Ke(o.hostname);return{"accept-encoding":"identity",...e?.suppressBrowserUserAgent?{}:{"user-agent":$},...e?.headers}}var qe=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"]),ze={"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"},Xe=new Set(["host","origin","referer","sec-fetch-site","sec-fetch-mode","sec-fetch-dest"]);function T(o){for(let[e,t]of Object.entries(ze))o.setHeader(e,t)}function Ye(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 Ze(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 Qe(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(qe.has(i.toLowerCase())||(t[i]=Array.isArray(s)?s.join(", "):s));return Object.assign(t,e?Ce(e):{"user-agent":$}),t}function et(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(Xe.has(i.toLowerCase())||(t[i]=s));return t.host=e.host,t.origin=e.origin,t.referer=`${e.origin}/`,t}function Te(o){return o?.startsWith("/__fetch-proxy?")||o?.startsWith("/__proxy?")||!1}function Ee(o){return o?!!(o.startsWith("/__app-api?")||o.startsWith("/__app-api/")):!1}async function Pe(o,e){if(o.method==="OPTIONS"){T(e),e.writeHead(204),e.end();return}let i=new URLSearchParams((o.url||"").split("?")[1]||"").get("url");if(!i){T(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("missing url param");return}let s;try{s=new URL(i)}catch{T(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("invalid url param");return}let n=Qe(o.headers,s),a;if(o.method!=="GET"&&o.method!=="HEAD"){let l=[];for await(let u of o)l.push(Buffer.isBuffer(u)?u:Buffer.from(u));if(l.length>0){let u=Buffer.concat(l);a=Ze(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(l){T(e),e.writeHead(502,{"Content-Type":"text/plain"}),e.end(`fetch proxy error: ${Ye(s.href,l)}`);return}r.headers.forEach((l,u)=>{let p=u.toLowerCase();p==="content-encoding"||p==="transfer-encoding"||p==="content-length"||p==="set-cookie"||p.startsWith("access-control-")||e.setHeader(u,l)}),T(e);let c=r.headers.getSetCookie?.()??[];c.length>0&&e.setHeader("x-sootsim-set-cookie",c.join(", ")),e.statusCode=r.status;let d=Buffer.from(await r.arrayBuffer());e.end(d)}function Re(o,e){let t=o.url||"",i="",s="";if(t.startsWith("/__app-api?")){let d=new URL(t,"http://sootsim.local");i=d.searchParams.get("path")||"",s=d.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:"?Ge:Ve,r=et(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},d=>{let l=Object.keys(d.headers).filter(u=>{let p=u.toLowerCase();return!p.startsWith("access-control-")&&p!=="set-cookie"}).join(", ");e.writeHead(d.statusCode??502,{...d.headers,"access-control-allow-origin":o.headers.origin||"*","access-control-allow-credentials":"true","access-control-expose-headers":l}),d.pipe(e)});return c.on("error",d=>{e.statusCode=502,e.end(`app proxy error: ${d.message}`)}),o.pipe(c),!0}import{WebSocket as k,WebSocketServer as tt}from"ws";var it="/__websocket-proxy",rt=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 A(o,e,t){try{o.write(`HTTP/1.1 ${e} ${t}\r
5
5
  Connection: close\r
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.224 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as g,b as k}from"./chunk-OPI6PLWA.js";import{b as S,c as x}from"./chunk-2VBAA7XJ.js";import{a as w}from"./chunk-VR5W6I6B.js";import"./chunk-X4623KU6.js";import"./chunk-WZAF6VH6.js";import"./chunk-6UJEQVPW.js";import"./chunk-CEBMTKID.js";import"./chunk-QJ2UUEBC.js";import"./chunk-FR2ZFWG2.js";import"./chunk-ZTCF4L5T.js";import{H as v,M as f,O as m,l as b}from"./chunk-K7FLRWXM.js";import"./chunk-2QIGZP7G.js";import"./chunk-S6LVSOND.js";import"./chunk-NWLTJUCZ.js";import"./chunk-FVZQMYUJ.js";import{existsSync as r,mkdirSync as j,readFileSync as d,readdirSync as I,writeFileSync as D}from"fs";import{basename as p,dirname as y,join as i,relative as c,resolve as h}from"path";var T=["bun","pnpm","npm"];async function pe(n){(n.includes("--help")||n.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.225 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as g,b as k}from"./chunk-TFNMU5WV.js";import{b as S,c as x}from"./chunk-DVK6PIUQ.js";import{a as w}from"./chunk-NCJ6UORF.js";import"./chunk-D74MZDQ5.js";import"./chunk-AHQQF4W6.js";import"./chunk-6P4XXLDV.js";import"./chunk-MOFL2C72.js";import"./chunk-ZPXGQH3V.js";import"./chunk-347KANFK.js";import"./chunk-P73P4LEJ.js";import{H as v,M as f,O as m,l as b}from"./chunk-LHI6SSKZ.js";import"./chunk-HS2NYELS.js";import"./chunk-PUXJ6MG3.js";import"./chunk-KW72IOGD.js";import"./chunk-NT7DIPF6.js";import{existsSync as r,mkdirSync as j,readFileSync as d,readdirSync as I,writeFileSync as D}from"fs";import{basename as p,dirname as y,join as i,relative as c,resolve as h}from"path";var T=["bun","pnpm","npm"];async function pe(n){(n.includes("--help")||n.includes("-h"))&&(console.log(`
3
3
  sootsim setup \u2014 set up this machine for SootSim
4
4
 
5
5
  usage:
@@ -94,4 +94,4 @@ module.exports = {
94
94
  4. inspect and drive it:
95
95
  sootsim describe
96
96
  sootsim do tap-text "Sign in"
97
- `)}function N(n,e){switch(n){case"bun":return`bunx ${e}`;case"pnpm":return`pnpm exec ${e}`;case"npm":return`npx ${e}`}}function ne(n,e){switch(n){case"bun":return`bun run ${e}`;case"pnpm":return`pnpm run ${e}`;case"npm":return`npm run ${e}`}}function oe(n){switch(n){case"bun":return"bun add -g sootsim";case"pnpm":return"pnpm add -g sootsim";case"npm":return"npm i -g sootsim"}}async function te(n,e){if(!e||n.dryRun)return;if(console.log(" last step:"),!process.stdin.isTTY){console.log(" run `sootsim open` after your Metro/Expo/One server is up");return}if(!await g("I'll run `sootsim open` for you now?",!0)){console.log(" later: sootsim open");return}let{runOpenCommand:o}=await import("./control-NN6KYHZ7.js");await o([],{port:7668})}async function R(n,e,o){return o.yes?!0:process.stdin.isTTY?g(n,e):(console.log(` ${n} ${e?"[Y/n]":"[y/N]"} n (non-interactive; pass --yes to accept)`),!1)}export{J as detectConfigScaffoldExt,M as detectNodeVersionPins,W as detectPreferredPackageManager,E as readMachineSetupStatus,pe as runSetup,de as shouldRunSetupForBareCommand};
97
+ `)}function N(n,e){switch(n){case"bun":return`bunx ${e}`;case"pnpm":return`pnpm exec ${e}`;case"npm":return`npx ${e}`}}function ne(n,e){switch(n){case"bun":return`bun run ${e}`;case"pnpm":return`pnpm run ${e}`;case"npm":return`npm run ${e}`}}function oe(n){switch(n){case"bun":return"bun add -g sootsim";case"pnpm":return"pnpm add -g sootsim";case"npm":return"npm i -g sootsim"}}async function te(n,e){if(!e||n.dryRun)return;if(console.log(" last step:"),!process.stdin.isTTY){console.log(" run `sootsim open` after your Metro/Expo/One server is up");return}if(!await g("I'll run `sootsim open` for you now?",!0)){console.log(" later: sootsim open");return}let{runOpenCommand:o}=await import("./control-QN3OMNZB.js");await o([],{port:7668})}async function R(n,e,o){return o.yes?!0:process.stdin.isTTY?g(n,e):(console.log(` ${n} ${e?"[Y/n]":"[y/N]"} n (non-interactive; pass --yes to accept)`),!1)}export{J as detectConfigScaffoldExt,M as detectNodeVersionPins,W as detectPreferredPackageManager,E as readMachineSetupStatus,pe as runSetup,de as shouldRunSetupForBareCommand};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.224 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-FVZQMYUJ.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
1
+ /*! sootsim v0.1.225 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-NT7DIPF6.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
3
3
 
4
4
  install and inspect bundled SootSim agent skills.
5
5
 
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.224 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{k as f}from"./chunk-KIZV52CA.js";import"./chunk-FB4YNNHB.js";import"./chunk-OYPMYSMY.js";import"./chunk-SQ2QXZ4N.js";import"./chunk-FKMYICRL.js";import"./chunk-HYSKRSBW.js";import"./chunk-CCW5EYIU.js";import"./chunk-QS4PGGDS.js";import"./chunk-OOJ5OXYG.js";import"./chunk-7KD7SO3A.js";import"./chunk-RQHZYDRX.js";import{a as t,b as n,c as l,d as c,e as a}from"./chunk-AHA4PLGQ.js";import"./chunk-GVK4Q3BA.js";import"./chunk-NWN2GQ36.js";import"./chunk-CE7KFLTO.js";import"./chunk-5FPSA6T3.js";import"./chunk-CEBMTKID.js";import"./chunk-QJ2UUEBC.js";import"./chunk-FR2ZFWG2.js";import"./chunk-ZTCF4L5T.js";import"./chunk-K7FLRWXM.js";import"./chunk-NWLTJUCZ.js";import"./chunk-FVZQMYUJ.js";function p(){console.log(`
1
+ /*! sootsim v0.1.225 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{k as f}from"./chunk-VIHFW4WT.js";import"./chunk-EH5ATUDN.js";import"./chunk-BI4VCL6Q.js";import"./chunk-3W4H7IIQ.js";import"./chunk-JHAL2K27.js";import"./chunk-NCJQISNJ.js";import"./chunk-3LZ4N33H.js";import"./chunk-B7IV5YY2.js";import"./chunk-WDDOFF3W.js";import"./chunk-UZWRZ3ND.js";import"./chunk-AWY3D6YY.js";import{a as t,b as n,c as l,d as c,e as a}from"./chunk-XXDT7Q4C.js";import"./chunk-FHHD7KFS.js";import"./chunk-UQKFXZT7.js";import"./chunk-DOGQUNTS.js";import"./chunk-TGRJ7ZJD.js";import"./chunk-MOFL2C72.js";import"./chunk-ZPXGQH3V.js";import"./chunk-347KANFK.js";import"./chunk-P73P4LEJ.js";import"./chunk-LHI6SSKZ.js";import"./chunk-KW72IOGD.js";import"./chunk-NT7DIPF6.js";function p(){console.log(`
3
3
  sootsim storage profile \u2014 manage isolated storage profiles
4
4
 
5
5
  usage:
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.225 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-TGRJ7ZJD.js";import"./chunk-KW72IOGD.js";import"./chunk-NT7DIPF6.js";export{a as settingsStore};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.225 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b}from"./chunk-NCJ6UORF.js";import"./chunk-D74MZDQ5.js";import"./chunk-LHI6SSKZ.js";import"./chunk-NT7DIPF6.js";export{b as flushCliTelemetry,a as trackCliEvent};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.224 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{g as m,i as d,l as s}from"./chunk-RQHZYDRX.js";import"./chunk-FR2ZFWG2.js";import"./chunk-ZTCF4L5T.js";import"./chunk-K7FLRWXM.js";import"./chunk-FVZQMYUJ.js";import{writeFileSync as g}from"fs";function u(){console.log(`
1
+ /*! sootsim v0.1.225 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{g as m,i as d,l as s}from"./chunk-AWY3D6YY.js";import"./chunk-347KANFK.js";import"./chunk-P73P4LEJ.js";import"./chunk-LHI6SSKZ.js";import"./chunk-NT7DIPF6.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.224 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as d}from"./chunk-PFYMU6QF.js";import{e as m}from"./chunk-KRZ5WWPA.js";import"./chunk-RQHZYDRX.js";import"./chunk-FR2ZFWG2.js";import"./chunk-ZTCF4L5T.js";import{K as a,g as r,h as l}from"./chunk-K7FLRWXM.js";import{a as c}from"./chunk-2QIGZP7G.js";import"./chunk-FVZQMYUJ.js";import{spawn as g}from"node:child_process";import u from"node:fs";import p from"node:os";import e from"node:path";var f="https://registry.npmjs.org/sootsim/latest";async function j(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.225 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as d}from"./chunk-UZM7EU4D.js";import{e as m}from"./chunk-QH5AHGSL.js";import"./chunk-AWY3D6YY.js";import"./chunk-347KANFK.js";import"./chunk-P73P4LEJ.js";import{K as a,g as r,h as l}from"./chunk-LHI6SSKZ.js";import{a as c}from"./chunk-HS2NYELS.js";import"./chunk-NT7DIPF6.js";import{spawn as g}from"node:child_process";import u from"node:fs";import p from"node:os";import e from"node:path";var f="https://registry.npmjs.org/sootsim/latest";async function j(o){let n=o.indexOf("--channel"),t=n>=0&&o[n+1]?o[n+1]:void 0;console.log(`sootsim upgrade
3
3
  `),console.log("runtime:");let i=m();i&&(console.log(` pinned to ${i} \u2014 installing the pin, not channel latest`),console.log(" (run `sootsim runtime unpin` to follow latest again)")),await d(["install",...t?["--channel",t]:[]],{}),console.log(`
4
4
  cli:`),await $()}function h(){if(l())return{kind:"dev"};let o=process.argv[1]??"";try{o=u.realpathSync(o)}catch{}let n=e.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=e.join(r(),"cli");if(o.startsWith(`${t}${n}`))return{kind:"global",command:"npm",args:["i","-g","--prefix",t,"sootsim@latest"]};let i=e.resolve(process.env.SOOTSIM_CLI_PREFIX||e.join(p.homedir(),".local"));return o.startsWith(`${i}${n}`)?{kind:"global",command:"npm",args:["i","-g","--prefix",i,"sootsim@latest"]}:{kind:"global",command:"npm",args:["i","-g","sootsim@latest"]}}async function $(){let o=c(),n=await k();if(!n){console.log(` v${o} \u2014 couldn't reach the npm registry, skipped`);return}if(a(n,o)<=0){console.log(` v${o} (latest)`);return}let t=h();if(console.log(` v${o} \u2192 v${n}`),t.kind==="dev"){console.log(" running from the soot 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 i=`${t.command} ${t.args.join(" ")}`;console.log(` updating global install (${i})\u2026`),await v(t.command,t.args)?console.log(` updated to v${n}`):(console.log(" update failed \u2014 run it yourself:"),console.log(` ${i}`))}function v(o,n){return new Promise(t=>{let i=g(o,n,{stdio:"inherit"});i.on("error",()=>t(!1)),i.on("exit",s=>t(s===0))})}async function k(){try{let o=await fetch(f,{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{j as runUpgrade};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.225 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c}from"./chunk-FCWI4FXZ.js";import"./chunk-OHEMKK3X.js";import"./chunk-NCJQISNJ.js";import"./chunk-3LZ4N33H.js";import"./chunk-AWY3D6YY.js";import"./chunk-UQKFXZT7.js";import"./chunk-NCJ6UORF.js";import"./chunk-D74MZDQ5.js";import"./chunk-347KANFK.js";import"./chunk-P73P4LEJ.js";import"./chunk-LHI6SSKZ.js";import"./chunk-NT7DIPF6.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.224 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as s,d as l,i as r}from"./chunk-KRZ5WWPA.js";import{a as i}from"./chunk-6UJEQVPW.js";import"./chunk-K7FLRWXM.js";import{a as t}from"./chunk-2QIGZP7G.js";import"./chunk-FVZQMYUJ.js";async function f(c){let{IS_BETA:m,BETA_LABEL:a}=await import("./beta-ZAFAH443.js"),u=m?` \xB7 ${a}`:"";console.log(`sootsim v${t()}${u}`);let o=i(),e=l();o.isDevBridge?(console.log(o.primary),o.installedRuntime&&console.log(`${o.installedRuntime} \xB7 ${e}`)):o.primary==="runtime not installed"?console.log("runtime not installed \u2014 run `sootsim runtime install`"):console.log(`${o.primary} \xB7 ${e}`);let n=await r({channel:e});n.pinned&&console.log(` runtime pinned to v${n.pinned} (\`sootsim runtime unpin\` to follow latest)`),n.outdated&&n.latest&&console.log(`
1
+ /*! sootsim v0.1.225 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as s,d as l,i as r}from"./chunk-QH5AHGSL.js";import{a as i}from"./chunk-6P4XXLDV.js";import"./chunk-LHI6SSKZ.js";import{a as t}from"./chunk-HS2NYELS.js";import"./chunk-NT7DIPF6.js";async function f(c){let{IS_BETA:m,BETA_LABEL:a}=await import("./beta-7TBS7VDG.js"),u=m?` \xB7 ${a}`:"";console.log(`sootsim v${t()}${u}`);let o=i(),e=l();o.isDevBridge?(console.log(o.primary),o.installedRuntime&&console.log(`${o.installedRuntime} \xB7 ${e}`)):o.primary==="runtime not installed"?console.log("runtime not installed \u2014 run `sootsim runtime install`"):console.log(`${o.primary} \xB7 ${e}`);let n=await r({channel:e});n.pinned&&console.log(` runtime pinned to v${n.pinned} (\`sootsim runtime unpin\` to follow latest)`),n.outdated&&n.latest&&console.log(`
3
3
  \u2191 runtime v${n.latest} available \u2014 run \`sootsim upgrade\``),console.log(`
4
4
  what's new: ${s}`)}export{f as runVersion};