sootsim 0.1.213 → 0.1.215

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 (140) hide show
  1. package/dist-cli/bin.js +4 -4
  2. package/dist-cli/chunks/{agent-PXBOBQCI.js → agent-63EE3N4N.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-PJWCDUES.js → agent-wrapper-GIXQ4UC3.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-5BFK3BPJ.js → app-fonts-T24PVENP.js} +2 -2
  5. package/dist-cli/chunks/{assert-ZQBH2FHK.js → assert-C2EJWQW3.js} +2 -2
  6. package/dist-cli/chunks/{auth-6VN3LBWW.js → auth-HYWSF7FV.js} +2 -2
  7. package/dist-cli/chunks/beta-YMHG327W.js +2 -0
  8. package/dist-cli/chunks/{camera-3EVST4X2.js → camera-TUULMDLJ.js} +2 -2
  9. package/dist-cli/chunks/{chunk-KWPTKVOD.js → chunk-2FEGONIZ.js} +1 -1
  10. package/dist-cli/chunks/{chunk-YIRGMOQC.js → chunk-5GU7LW64.js} +1 -1
  11. package/dist-cli/chunks/{chunk-MBTZ72OK.js → chunk-5MUXEXEW.js} +6 -6
  12. package/dist-cli/chunks/{chunk-R3Z6QS26.js → chunk-6NQYBCWC.js} +1 -1
  13. package/dist-cli/chunks/{chunk-GGNU6KXJ.js → chunk-6USQVYW2.js} +2 -2
  14. package/dist-cli/chunks/{chunk-34ZLNSTB.js → chunk-7COBEK2I.js} +2 -2
  15. package/dist-cli/chunks/chunk-A3LHGXZW.js +1 -0
  16. package/dist-cli/chunks/{chunk-A5PGH6GU.js → chunk-AHG7WAP6.js} +2 -2
  17. package/dist-cli/chunks/chunk-AHWQZXFB.js +119 -0
  18. package/dist-cli/chunks/{chunk-DL5UW643.js → chunk-AKNZ6QBL.js} +1 -1
  19. package/dist-cli/chunks/{chunk-BBHSIDL7.js → chunk-BU7V5UGD.js} +2 -2
  20. package/dist-cli/chunks/{chunk-L6CUBNOP.js → chunk-CKCDJCPZ.js} +1 -1
  21. package/dist-cli/chunks/{chunk-E3UTRL4K.js → chunk-CSJUJIRP.js} +2 -2
  22. package/dist-cli/chunks/{chunk-W77R37C6.js → chunk-DVJZUBQB.js} +1 -1
  23. package/dist-cli/chunks/{chunk-SNDRRWLJ.js → chunk-E6YKEDDM.js} +1 -1
  24. package/dist-cli/chunks/{chunk-A5W26KZ2.js → chunk-EB4FLAAE.js} +2 -2
  25. package/dist-cli/chunks/{chunk-6GF7AYWF.js → chunk-EGCQXWLS.js} +2 -2
  26. package/dist-cli/chunks/{chunk-VCU23PAS.js → chunk-EWYTZ7FV.js} +4 -4
  27. package/dist-cli/chunks/{chunk-PMZU2MXQ.js → chunk-FEFLFVIU.js} +1 -1
  28. package/dist-cli/chunks/{chunk-SAJDH6T4.js → chunk-FWUGH36K.js} +2 -2
  29. package/dist-cli/chunks/{chunk-CK5W32IL.js → chunk-HKEH2UOD.js} +1 -1
  30. package/dist-cli/chunks/chunk-K7OZYJKD.js +2 -0
  31. package/dist-cli/chunks/{chunk-345SCUPN.js → chunk-KG6V4NCI.js} +2 -2
  32. package/dist-cli/chunks/{chunk-M6QAVNUD.js → chunk-KGSLGXWW.js} +1 -1
  33. package/dist-cli/chunks/{chunk-7ETH4QC5.js → chunk-LIFR6X36.js} +2 -2
  34. package/dist-cli/chunks/chunk-NJPDAYWO.js +1 -0
  35. package/dist-cli/chunks/{chunk-PQRTN7R3.js → chunk-OHQOMV2J.js} +2 -2
  36. package/dist-cli/chunks/{chunk-XKYWN32Q.js → chunk-OUB7WT7Q.js} +1 -1
  37. package/dist-cli/chunks/{chunk-B4ZHF6HX.js → chunk-QGFTJYVC.js} +1 -1
  38. package/dist-cli/chunks/{chunk-XRTETVLA.js → chunk-QXJPLKP7.js} +1 -1
  39. package/dist-cli/chunks/{chunk-W7XLNK6M.js → chunk-RFJMDMLK.js} +2 -2
  40. package/dist-cli/chunks/{chunk-DCNE55YI.js → chunk-RIAS4TMS.js} +3 -3
  41. package/dist-cli/chunks/{chunk-MHZUULXC.js → chunk-SADP73NH.js} +2 -2
  42. package/dist-cli/chunks/{chunk-6A64BUDU.js → chunk-T4EGFOSE.js} +4 -4
  43. package/dist-cli/chunks/{chunk-34R2XUUH.js → chunk-UJZFS2JM.js} +2 -2
  44. package/dist-cli/chunks/{chunk-MF7JDUE4.js → chunk-VD2SYCCY.js} +2 -2
  45. package/dist-cli/chunks/{chunk-QYAABDHA.js → chunk-VIXY7DGW.js} +2 -2
  46. package/dist-cli/chunks/{chunk-IV5EGT4L.js → chunk-VMYBUPRT.js} +4 -4
  47. package/dist-cli/chunks/{chunk-URSWUWMB.js → chunk-X7VZ7D6Y.js} +3 -3
  48. package/dist-cli/chunks/{chunk-ZMCH7LNI.js → chunk-XVYCMZMB.js} +2 -2
  49. package/dist-cli/chunks/{chunk-WWCLVFFT.js → chunk-YTQ5RCVB.js} +1 -1
  50. package/dist-cli/chunks/{chunk-RRMXW3OZ.js → chunk-ZT7M27FX.js} +2 -2
  51. package/dist-cli/chunks/cli-version-DPI32W6E.js +2 -0
  52. package/dist-cli/chunks/{compat-2EYTY3H2.js → compat-EL7PRWER.js} +3 -3
  53. package/dist-cli/chunks/{config-RE5F2ANP.js → config-IZZQIOI5.js} +2 -2
  54. package/dist-cli/chunks/{control-XATEDZ5J.js → control-FHQBCUP6.js} +2 -2
  55. package/dist-cli/chunks/daemon-GF5QBYWN.js +2 -0
  56. package/dist-cli/chunks/{debug-YBWZ46PB.js → debug-6CB5QEGF.js} +3 -3
  57. package/dist-cli/chunks/{desktop-Q7I2G5LT.js → desktop-DLU2VTNC.js} +3 -3
  58. package/dist-cli/chunks/{detox-RIAPIQLU.js → detox-N2D2AY7S.js} +2 -2
  59. package/dist-cli/chunks/{device-PPHHQL47.js → device-FGZWPD26.js} +2 -2
  60. package/dist-cli/chunks/{diagnose-FAMYDGKH.js → diagnose-ICQE2EWG.js} +2 -2
  61. package/dist-cli/chunks/drivers-J4BHBZXD.js +2 -0
  62. package/dist-cli/chunks/flow-LTUM776G.js +2 -0
  63. package/dist-cli/chunks/help-LBG75ITV.js +2 -0
  64. package/dist-cli/chunks/{home-paths-H34FDUJS.js → home-paths-VWN4PHJ3.js} +2 -2
  65. package/dist-cli/chunks/inspect-XAEZTCMI.js +2 -0
  66. package/dist-cli/chunks/install-desktop-2CSEI2MD.js +2 -0
  67. package/dist-cli/chunks/{login-DVCETH23.js → login-FO2R5CSL.js} +4 -4
  68. package/dist-cli/chunks/{logout-MJ5323X4.js → logout-L5R3GRIG.js} +2 -2
  69. package/dist-cli/chunks/{maestro-Y6GUYLSM.js → maestro-K57OH6RI.js} +3 -3
  70. package/dist-cli/chunks/{maestro-generate-22RWS4QX.js → maestro-generate-7VVSWXKH.js} +3 -3
  71. package/dist-cli/chunks/mode-VPVEZ652.js +111 -0
  72. package/dist-cli/chunks/optional-demo-registry-D47EWM4J.js +2 -0
  73. package/dist-cli/chunks/{perf-UXEZYT3O.js → perf-AA66N7ML.js} +2 -2
  74. package/dist-cli/chunks/{record-VS4A3B4Y.js → record-HVK5TWAF.js} +3 -3
  75. package/dist-cli/chunks/runtime-EV7TFPWL.js +2 -0
  76. package/dist-cli/chunks/{screenshot-command-4X3ERV33.js → screenshot-command-TPVAQ6FC.js} +3 -3
  77. package/dist-cli/chunks/{screenshots-capture-NJTPWWPZ.js → screenshots-capture-OT5KMPQQ.js} +9 -9
  78. package/dist-cli/chunks/{serve-Q3AHVMOA.js → serve-3CTBVM5S.js} +2 -2
  79. package/dist-cli/chunks/{setup-4I2YQGRE.js → setup-JCJJQJKU.js} +3 -3
  80. package/dist-cli/chunks/{skills-HR56BS2S.js → skills-HTH527W2.js} +2 -2
  81. package/dist-cli/chunks/{storage-2CG4U25V.js → storage-O6RNOFWM.js} +2 -2
  82. package/dist-cli/chunks/store-ANJJMDLX.js +2 -0
  83. package/dist-cli/chunks/telemetry-GZK77NUU.js +2 -0
  84. package/dist-cli/chunks/{timeline-YCT2GPZU.js → timeline-RQHPAEK6.js} +2 -2
  85. package/dist-cli/chunks/{upgrade-WBNIAFCB.js → upgrade-OKNBSSBF.js} +2 -2
  86. package/dist-cli/chunks/upload-KAY6K5ML.js +2 -0
  87. package/dist-cli/chunks/{version-PDUFTOM7.js → version-EY4PANXP.js} +2 -2
  88. package/dist-cli/chunks/{web-DQQDPOON.js → web-PI2BL42A.js} +2 -2
  89. package/dist-cli/chunks/{what-happened-CGNTKFOU.js → what-happened-MC5PTHCG.js} +2 -2
  90. package/dist-lib/agent-daemon-client.cjs +1 -1
  91. package/dist-lib/agent-events.cjs +1 -1
  92. package/dist-lib/agent-identity.cjs +1 -1
  93. package/dist-lib/agent-sessions.cjs +1 -1
  94. package/dist-lib/attached-projects.cjs +1 -1
  95. package/dist-lib/auth/shared-session.cjs +1 -1
  96. package/dist-lib/backend-origin.cjs +1 -1
  97. package/dist-lib/beta.cjs +1 -1
  98. package/dist-lib/beta.mjs +1 -1
  99. package/dist-lib/bridge-constants.cjs +1 -1
  100. package/dist-lib/cli-constants.cjs +1 -1
  101. package/dist-lib/config.cjs +1 -1
  102. package/dist-lib/detox/index.cjs +1 -1
  103. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  104. package/dist-lib/home-paths.cjs +1 -1
  105. package/dist-lib/host/bridge-host.cjs +1 -1
  106. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  107. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  108. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  109. package/dist-lib/host/websocket-proxy.cjs +1 -1
  110. package/dist-lib/index.cjs +1 -1
  111. package/dist-lib/jump-to-source-babel.cjs +1 -1
  112. package/dist-lib/menu.cjs +1 -1
  113. package/dist-lib/menu.mjs +1 -1
  114. package/dist-lib/metro.cjs +1 -1
  115. package/dist-lib/profiles.cjs +1 -1
  116. package/dist-lib/render-mode.cjs +1 -1
  117. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  118. package/dist-lib/sdk.cjs +11 -3
  119. package/dist-lib/sdk.mjs +11 -3
  120. package/dist-lib/skills.cjs +20 -2
  121. package/dist-lib/vite.cjs +1 -1
  122. package/package.json +1 -1
  123. package/dist-cli/chunks/beta-ICE6G2X3.js +0 -2
  124. package/dist-cli/chunks/chunk-NYBRCPXY.js +0 -119
  125. package/dist-cli/chunks/chunk-YBSLFZF2.js +0 -1
  126. package/dist-cli/chunks/chunk-YKTGO7GR.js +0 -1
  127. package/dist-cli/chunks/chunk-ZCIJF6TG.js +0 -2
  128. package/dist-cli/chunks/cli-version-X6SBWYZR.js +0 -2
  129. package/dist-cli/chunks/daemon-JLQHIAJB.js +0 -2
  130. package/dist-cli/chunks/drivers-DUQEV3GT.js +0 -2
  131. package/dist-cli/chunks/flow-BKVP4VKL.js +0 -2
  132. package/dist-cli/chunks/help-KDPPO3QK.js +0 -2
  133. package/dist-cli/chunks/inspect-BASDWZYD.js +0 -2
  134. package/dist-cli/chunks/install-desktop-RMAWV6JZ.js +0 -2
  135. package/dist-cli/chunks/mode-OLGFFUSY.js +0 -95
  136. package/dist-cli/chunks/optional-demo-registry-OYI5WQN4.js +0 -2
  137. package/dist-cli/chunks/runtime-IYN3SKFL.js +0 -2
  138. package/dist-cli/chunks/store-YITXNLYN.js +0 -2
  139. package/dist-cli/chunks/telemetry-XQHZBPJE.js +0 -2
  140. package/dist-cli/chunks/upload-QG3WB6P6.js +0 -2
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.213 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as te,b as oe,f as re}from"./chunk-VCU23PAS.js";import{b as J}from"./chunk-IV5EGT4L.js";import{a as Z}from"./chunk-345SCUPN.js";import"./chunk-PQRTN7R3.js";import"./chunk-QYAABDHA.js";import{a as Q,b as ee}from"./chunk-34ZLNSTB.js";import"./chunk-A5PGH6GU.js";import"./chunk-GGNU6KXJ.js";import"./chunk-YKTGO7GR.js";import"./chunk-YIRGMOQC.js";import"./chunk-CK5W32IL.js";import"./chunk-XRTETVLA.js";import"./chunk-SAJDH6T4.js";import{r as q}from"./chunk-6A64BUDU.js";import{g as F,h as V,i as E,j as K,k as X,l as v,m as P}from"./chunk-MBTZ72OK.js";import"./chunk-A5W26KZ2.js";import"./chunk-W77R37C6.js";import"./chunk-KWPTKVOD.js";import"./chunk-M6QAVNUD.js";import"./chunk-6GF7AYWF.js";import"./chunk-7ETH4QC5.js";import"./chunk-BBHSIDL7.js";import"./chunk-NYBRCPXY.js";import"./chunk-ZMCH7LNI.js";import"./chunk-XKYWN32Q.js";import"./chunk-WWCLVFFT.js";import"./chunk-PMZU2MXQ.js";import{a as x,b as z,c as _,d as j,e as I,f as D,g as N}from"./chunk-ZCIJF6TG.js";import"./chunk-DL5UW643.js";import{mkdirSync as ie,writeFileSync as ne}from"fs";import{dirname as ae,resolve as ce}from"path";async function le(e,t){let o=je(e);(o.includes("--help")||o.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.215 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as te,b as oe,f as re}from"./chunk-EWYTZ7FV.js";import{b as J}from"./chunk-VMYBUPRT.js";import{a as Z}from"./chunk-KG6V4NCI.js";import"./chunk-OHQOMV2J.js";import"./chunk-VIXY7DGW.js";import{a as Q,b as ee}from"./chunk-7COBEK2I.js";import"./chunk-AHG7WAP6.js";import"./chunk-6USQVYW2.js";import"./chunk-A3LHGXZW.js";import"./chunk-5GU7LW64.js";import"./chunk-HKEH2UOD.js";import"./chunk-QXJPLKP7.js";import"./chunk-FWUGH36K.js";import{r as q}from"./chunk-T4EGFOSE.js";import{g as F,h as V,i as E,j as K,k as X,l as v,m as P}from"./chunk-5MUXEXEW.js";import"./chunk-EB4FLAAE.js";import"./chunk-DVJZUBQB.js";import"./chunk-2FEGONIZ.js";import"./chunk-KGSLGXWW.js";import"./chunk-EGCQXWLS.js";import"./chunk-LIFR6X36.js";import"./chunk-BU7V5UGD.js";import"./chunk-AHWQZXFB.js";import"./chunk-XVYCMZMB.js";import"./chunk-OUB7WT7Q.js";import"./chunk-YTQ5RCVB.js";import"./chunk-FEFLFVIU.js";import{a as x,b as z,c as _,d as j,e as I,f as D,g as N}from"./chunk-K7OZYJKD.js";import"./chunk-AKNZ6QBL.js";import{mkdirSync as ie,writeFileSync as ne}from"fs";import{dirname as ae,resolve as ce}from"path";async function le(e,t){let o=je(e);(o.includes("--help")||o.includes("-h"))&&(console.log(`
3
3
  sootsim screenshot \u2014 capture the canvas as a PNG
4
4
 
5
5
  usage:
@@ -148,4 +148,4 @@ examples:
148
148
  await new Promise((r) => setTimeout(r, 40))
149
149
  }
150
150
  return false
151
- })()`,{acquireLock:!0}))throw new Error("could not enable screenshot mode \u2014 is this a browser sim with the screenshot plugin? (electron has no screenshot mode)")}function gt(e){console.log(` ${e.projectName} \u2014 canvas ${e.canvas} (${e.exportSize.width}\xD7${e.exportSize.height}), device ${e.deviceModel}`);for(let t of e.slides){let o=[t.focused?"focused":t.active?"active":null,t.captured?`captured${t.captureMode==="3d"?" 3d":""}`:"no capture"].filter(Boolean).join(", "),i=t.title?`"${t.title}"`:"(no title)",r=[`bg ${t.bgTop}\u2192${t.bgBottom}`,t.titleColor?`color ${t.titleColor}`:null,t.titleSize?`size ${t.titleSize}`:null,t.titleUnderlay?`underlay ${t.titleUnderlay}`:null,t.titleShadow?`shadow ${t.titleShadow}`:null].filter(Boolean).join(", ");console.log(` ${t.index}. ${i} \u2014 ${r} [${o}]`),t.subtitle&&console.log(` ${t.subtitle}`)}}function wt(e){let t=e.match(/^data:[^;]+;base64,(.+)$/);if(!t)throw new Error("export returned an unexpected payload");return Buffer.from(t[1],"base64")}async function De(e,t){if(e.includes("--help")||e.includes("-h")){console.log(dt);return}let{rest:o,values:i,json:r}=mt(e),s=F(o,{port:t.port,commandTimeoutMs:45e3}),n=s.positional[0]??"list",a=ht(s.positional[1]),c=E(s),l=u=>{r?console.log(JSON.stringify(u,null,2)):gt(u)};try{switch(await ft(c),n){case"list":{l(await v(c,"SootSim.bridges.screenshotControl.getState"));break}case"set":{if(a==null)throw new Error("usage: sootsim screenshot slides set <n> --title \u2026 (see --help)");let u={};for(let d of["title","subtitle","bgTop","bgBottom","titleColor","titleSize","titleUnderlay","titleShadow"])i[d]!=null&&(u[d]=i[d]);if(Object.keys(u).length===0)throw new Error("nothing to set \u2014 pass at least one field (see --help)");l(await P(c,"SootSim.bridges.screenshotControl.setSlide",a,u));break}case"add":{l(await P(c,"SootSim.bridges.screenshotControl.addSlide"));break}case"remove":{if(a==null)throw new Error("usage: sootsim screenshot slides remove <n>");l(await P(c,"SootSim.bridges.screenshotControl.removeSlide",a));break}case"focus":{if(a==null)throw new Error("usage: sootsim screenshot slides focus <n>");l(await P(c,"SootSim.bridges.screenshotControl.focusSlide",a));break}case"overview":{l(await P(c,"SootSim.bridges.screenshotControl.overview"));break}case"capture":{let u=await P(c,"SootSim.bridges.screenshotControl.capture",...a!=null?[a]:[]);l(u);break}case"export":{let u=i.out?lt(i.out)?i.out:ut(process.cwd(),i.out):Me(process.cwd(),"screenshots"),d=await v(c,"SootSim.bridges.screenshotControl.getState"),p=a!=null?d.slides.filter(f=>f.index===a||f.id===a):d.slides.filter(f=>f.captured);if(p.length===0)throw new Error(a!=null?`no slide ${a}`:"no captured slides to export \u2014 capture first");let g=[];for(let f of p){let m=await v(c,"SootSim.bridges.screenshotControl.exportSlide",f.index),y=Me(u,m.name);it(ct(y),{recursive:!0}),at(y,wt(m.dataUrl)),g.push(y),console.log(` saved: ${y} (${m.width}\xD7${m.height})`)}r&&console.log(JSON.stringify({written:g},null,2));break}default:throw new Error(`unknown subcommand "${n}" \u2014 see sootsim screenshot slides --help`)}}finally{c.close()}}var yt=new Set(["--sim","--port","-p","--output","-o","--out","--plan","--app","--device","--org","--repo","--api-origin","--branch","--platform","--slides","--shell-origin","--timeout"]),St=new Set(["capture","slides","appstore"]);function Ne(e){for(let t=0;t<e.length;t++){let o=e[t];if(o.startsWith("-")){yt.has(o)&&t++;continue}return St.has(o)?{name:o,index:t}:null}return null}function T(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function bt(e){let t=[];for(let o=0;o<e.length;o++){if(e[o]==="--sim"){o++;continue}t.push(e[o])}return t}async function wo(e,t){let o=Ne(e);if(!o||o.name==="capture"){await le(o?T(e,o.index):e,t);return}if(o.name==="slides"){await De(T(e,o.index),t);return}let i=T(e,o.index),r=Ne(i);if(r?.name==="capture")try{let{runScreenshotsCapture:s}=await import("./screenshots-capture-NJTPWWPZ.js");return await s(bt(T(i,r.index)))}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ERR_MODULE_NOT_FOUND")return console.error("screenshot appstore capture is repo-only tooling \u2014 it needs the sootsim workspace (playwright is not shipped with the published CLI)."),1;throw s}return Ce(i,t)}export{wo as runScreenshotCommand};
151
+ })()`,{acquireLock:!0}))throw new Error("could not enable screenshot mode \u2014 is this a browser sim with the screenshot plugin? (electron has no screenshot mode)")}function gt(e){console.log(` ${e.projectName} \u2014 canvas ${e.canvas} (${e.exportSize.width}\xD7${e.exportSize.height}), device ${e.deviceModel}`);for(let t of e.slides){let o=[t.focused?"focused":t.active?"active":null,t.captured?`captured${t.captureMode==="3d"?" 3d":""}`:"no capture"].filter(Boolean).join(", "),i=t.title?`"${t.title}"`:"(no title)",r=[`bg ${t.bgTop}\u2192${t.bgBottom}`,t.titleColor?`color ${t.titleColor}`:null,t.titleSize?`size ${t.titleSize}`:null,t.titleUnderlay?`underlay ${t.titleUnderlay}`:null,t.titleShadow?`shadow ${t.titleShadow}`:null].filter(Boolean).join(", ");console.log(` ${t.index}. ${i} \u2014 ${r} [${o}]`),t.subtitle&&console.log(` ${t.subtitle}`)}}function wt(e){let t=e.match(/^data:[^;]+;base64,(.+)$/);if(!t)throw new Error("export returned an unexpected payload");return Buffer.from(t[1],"base64")}async function De(e,t){if(e.includes("--help")||e.includes("-h")){console.log(dt);return}let{rest:o,values:i,json:r}=mt(e),s=F(o,{port:t.port,commandTimeoutMs:45e3}),n=s.positional[0]??"list",a=ht(s.positional[1]),c=E(s),l=u=>{r?console.log(JSON.stringify(u,null,2)):gt(u)};try{switch(await ft(c),n){case"list":{l(await v(c,"SootSim.bridges.screenshotControl.getState"));break}case"set":{if(a==null)throw new Error("usage: sootsim screenshot slides set <n> --title \u2026 (see --help)");let u={};for(let d of["title","subtitle","bgTop","bgBottom","titleColor","titleSize","titleUnderlay","titleShadow"])i[d]!=null&&(u[d]=i[d]);if(Object.keys(u).length===0)throw new Error("nothing to set \u2014 pass at least one field (see --help)");l(await P(c,"SootSim.bridges.screenshotControl.setSlide",a,u));break}case"add":{l(await P(c,"SootSim.bridges.screenshotControl.addSlide"));break}case"remove":{if(a==null)throw new Error("usage: sootsim screenshot slides remove <n>");l(await P(c,"SootSim.bridges.screenshotControl.removeSlide",a));break}case"focus":{if(a==null)throw new Error("usage: sootsim screenshot slides focus <n>");l(await P(c,"SootSim.bridges.screenshotControl.focusSlide",a));break}case"overview":{l(await P(c,"SootSim.bridges.screenshotControl.overview"));break}case"capture":{let u=await P(c,"SootSim.bridges.screenshotControl.capture",...a!=null?[a]:[]);l(u);break}case"export":{let u=i.out?lt(i.out)?i.out:ut(process.cwd(),i.out):Me(process.cwd(),"screenshots"),d=await v(c,"SootSim.bridges.screenshotControl.getState"),p=a!=null?d.slides.filter(f=>f.index===a||f.id===a):d.slides.filter(f=>f.captured);if(p.length===0)throw new Error(a!=null?`no slide ${a}`:"no captured slides to export \u2014 capture first");let g=[];for(let f of p){let m=await v(c,"SootSim.bridges.screenshotControl.exportSlide",f.index),y=Me(u,m.name);it(ct(y),{recursive:!0}),at(y,wt(m.dataUrl)),g.push(y),console.log(` saved: ${y} (${m.width}\xD7${m.height})`)}r&&console.log(JSON.stringify({written:g},null,2));break}default:throw new Error(`unknown subcommand "${n}" \u2014 see sootsim screenshot slides --help`)}}finally{c.close()}}var yt=new Set(["--sim","--port","-p","--output","-o","--out","--plan","--app","--device","--org","--repo","--api-origin","--branch","--platform","--slides","--shell-origin","--timeout"]),St=new Set(["capture","slides","appstore"]);function Ne(e){for(let t=0;t<e.length;t++){let o=e[t];if(o.startsWith("-")){yt.has(o)&&t++;continue}return St.has(o)?{name:o,index:t}:null}return null}function T(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function bt(e){let t=[];for(let o=0;o<e.length;o++){if(e[o]==="--sim"){o++;continue}t.push(e[o])}return t}async function wo(e,t){let o=Ne(e);if(!o||o.name==="capture"){await le(o?T(e,o.index):e,t);return}if(o.name==="slides"){await De(T(e,o.index),t);return}let i=T(e,o.index),r=Ne(i);if(r?.name==="capture")try{let{runScreenshotsCapture:s}=await import("./screenshots-capture-OT5KMPQQ.js");return await s(bt(T(i,r.index)))}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ERR_MODULE_NOT_FOUND")return console.error("screenshot appstore capture is repo-only tooling \u2014 it needs the sootsim workspace (playwright is not shipped with the published CLI)."),1;throw s}return Ce(i,t)}export{wo as runScreenshotCommand};
@@ -1,6 +1,6 @@
1
- /*! sootsim v0.1.213 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as A}from"./chunk-34ZLNSTB.js";import"./chunk-BBHSIDL7.js";import"./chunk-PMZU2MXQ.js";import"./chunk-DL5UW643.js";import{execSync as B}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 U,resolve as V}from"node:path";import{chromium as Y}from"playwright-core";import{execSync as O}from"node:child_process";function N(o){let e=o;if(e&&typeof e.process=="function")try{let r=e.process();if(r&&typeof r.pid=="number"&&r.pid>0)return r.pid}catch{}if(e&&typeof e.browser=="function")try{let r=e.browser();if(r)return N(r)}catch{}return null}function x(o){let e=[];try{e=O(`pgrep -P ${o} || true`).toString().split(`
3
- `).filter(Boolean)}catch{}for(let r of e)x(Number(r));try{process.kill(o,"SIGKILL")}catch{}}var C=new Set,I=!1;function j(){if(I)return;I=!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 M(o){let e=await o(),r=N(e),n=new Set;r!=null&&(n.add(r),C.add(r),j());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=`
1
+ /*! sootsim v0.1.215 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as A}from"./chunk-7COBEK2I.js";import"./chunk-BU7V5UGD.js";import"./chunk-FEFLFVIU.js";import"./chunk-AKNZ6QBL.js";import{execSync as B}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 U,resolve as V}from"node:path";import{chromium as Y}from"playwright-core";import{execSync as O}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=O(`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,I=!1;function j(){if(I)return;I=!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 M(o){let e=await o(),t=N(e),n=new Set;t!=null&&(n.add(t),C.add(t),j());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
4
  sootsim screenshot appstore capture \u2014 headlessly capture + upload App Store slides
5
5
 
6
6
  usage:
@@ -29,13 +29,13 @@ options:
29
29
  examples:
30
30
  sootsim screenshot appstore capture --org acme --repo my-app --dry-run
31
31
  sootsim screenshot appstore 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},r=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:r("--dry-run"),force:r("--force"),out:e("--out")??null,shellOrigin:e("--shell-origin")??null,apiOrigin:e("--api-origin")??null,timeoutMs:Number(e("--timeout")??"45000")||45e3,json:r("--json")}}function Z(){let o=A();if(o&&o.kind==="session")return{token:o.token,origin:o.origin};process.stderr.write(`
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=A();if(o&&o.kind==="session")return{token:o.token,origin:o.origin};process.stderr.write(`
33
33
  sootsim screenshot appstore capture needs a logged-in session.
34
34
  run \`sootsim login\` first (the captured slides upload to that account).
35
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(B("sysctl -n vm.loadavg").toString().trim().split(/\s+/)[1])||0}catch{return 0}}async function re(o,e,r,n){let i=await fetch(`${o}/api/sootsim/screenshot-decks?org=${encodeURIComponent(r)}&repo=${encodeURIComponent(n)}`,{headers:{authorization:`Bearer ${e}`}});if(!i.ok)return[];let a=await i.json().catch(()=>null),c=[];for(let p of a?.decks??[])Array.isArray(p.config?.frames)&&c.push(...p.config.frames);return c}async function te(o,e,r,n){let i=await fetch(`${o}/api/sootsim/screenshot-capture?ref=${encodeURIComponent(n)}&org=${encodeURIComponent(r)}`,{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 r=Date.now()+e;for(;Date.now()<r;){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 r=globalThis.SootSim?.bridges?.screenshotControl;if(!r)throw new Error("screenshotControl missing");return r.getState()})}async function se(o){await o.evaluate(async()=>{let e=globalThis.SootSim?.bridges?.settings,r=Date.now()+3e3;for(;Date.now()<r;){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,r,n){await o.evaluate(async([i,a,c])=>{let p=globalThis.SootSim,h=p?.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=p?.bridges?.threeMode;for(;Date.now()<b&&(d=p?.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,focus:l.focus,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,r,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:r,origin:n}=Z(),i=(e.apiOrigin??n).replace(/\/$/,""),a=(e.shellOrigin??ee(i)).replace(/\/$/,""),c=await re(i,r,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.
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(B("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 p of a?.decks??[])Array.isArray(p.config?.frames)&&c.push(...p.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 p=globalThis.SootSim,h=p?.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=p?.bridges?.threeMode;for(;Date.now()<b&&(d=p?.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}:{},setting:l.setting,focus:l.focus,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
38
  `),1;let p=oe(),h=Number(B("sysctl -n hw.ncpu").toString().trim())||8;if(p>h)return process.stderr.write(` load average ${p.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(U(H(),"sootsim-capture-")),{browser:d,reapNow:l}=await M(()=>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{}},r);let y=[],m=d.pages()[0]??await d.newPage();e.dryRun?await m.route(/\/api\/sootsim\/screenshot-(decks|capture)/,s=>s.request().method()==="PUT"?s.abort():s.continue()):m.on("response",s=>{let g=s.url();s.request().method()==="PUT"&&(g.includes("/api/sootsim/screenshot-decks")?y.push({kind:"deck",status:s.status()}):g.includes("/api/sootsim/screenshot-capture")&&y.push({kind:"capture",status:s.status()}))});let R=[];m.on("pageerror",s=>R.push(s.message));let E=m.waitForResponse(s=>s.url().includes("/api/sootsim/screenshot-decks")&&s.request().method()==="GET",{timeout:e.timeoutMs}).catch(()=>null);try{await m.goto(w,{waitUntil:"domcontentloaded",timeout:e.timeoutMs});let s=await ne(m,e.timeoutMs);await se(s),await E,await m.waitForTimeout(800);let g=await D(s);if(g.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?g.slides.filter(t=>e.slides.includes(t.index)):g.slides;console.log(` ${g.projectName} on ${g.deviceModel} \u2014 capturing ${P.length}/${g.slides.length} slide(s)${e.dryRun?" (dry-run, no upload)":""}`);for(let t of P)try{let u=c[t.index-1],f=u?.threeScene??null,$=f&&u?.screenRef?await te(i,r,e.org,u.screenRef):null;await ie(s,t.index,f,$),console.log(` \u2713 slide ${t.index} "${t.title.slice(0,40)}"`)}catch(u){console.log(` \u2717 slide ${t.index} "${t.title.slice(0,40)}" \u2014 ${u.message}`)}e.dryRun||await m.waitForTimeout(2500);let S=(await D(s)).slides.filter(t=>P.some(u=>u.id===t.id)),v=[];if(e.out){let t=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=U(t,f.name);L(J(k),{recursive:!0}),z(k,Buffer.from($[1],"base64")),v.push(k)}}}let F=S.filter(t=>t.captureRef&&t.cleanRef),G={org:e.org,repo:e.repo,branch:e.branch,dryRun:e.dryRun,slides:S.map(t=>({index:t.index,title:t.title,captureRef:!!t.captureRef,cleanRef:!!t.cleanRef,screenRef:!!t.screenRef,captureMode:t.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(G,null,2));else{console.log(`
41
- ${F.length}/${S.length} slide(s) now have editable layers (captureRef + cleanRef)`);let t=S.filter(u=>u.captureRef&&!u.cleanRef);if(t.length&&console.log(` \u26A0 ${t.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};
39
+ `),1;let w=`${a}/build/${encodeURIComponent(e.org)}/${encodeURIComponent(e.repo)}/${encodeURIComponent(e.branch)}?platform=${encodeURIComponent(e.platform)}&ssMode=1`,b=W(U(H(),"sootsim-capture-")),{browser:d,reapNow:l}=await M(()=>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=[],m=d.pages()[0]??await d.newPage();e.dryRun?await m.route(/\/api\/sootsim\/screenshot-(decks|capture)/,s=>s.request().method()==="PUT"?s.abort():s.continue()):m.on("response",s=>{let g=s.url();s.request().method()==="PUT"&&(g.includes("/api/sootsim/screenshot-decks")?y.push({kind:"deck",status:s.status()}):g.includes("/api/sootsim/screenshot-capture")&&y.push({kind:"capture",status:s.status()}))});let R=[];m.on("pageerror",s=>R.push(s.message));let E=m.waitForResponse(s=>s.url().includes("/api/sootsim/screenshot-decks")&&s.request().method()==="GET",{timeout:e.timeoutMs}).catch(()=>null);try{await m.goto(w,{waitUntil:"domcontentloaded",timeout:e.timeoutMs});let s=await ne(m,e.timeoutMs);await se(s),await E,await m.waitForTimeout(800);let g=await D(s);if(g.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?g.slides.filter(r=>e.slides.includes(r.index)):g.slides;console.log(` ${g.projectName} on ${g.deviceModel} \u2014 capturing ${P.length}/${g.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 m.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=U(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),G={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(G,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.213 | (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-RRMXW3OZ.js";import"./chunk-L6CUBNOP.js";import{a as ce}from"./chunk-QYAABDHA.js";import"./chunk-34ZLNSTB.js";import{h as ae}from"./chunk-34R2XUUH.js";import{f as P,g as se}from"./chunk-GGNU6KXJ.js";import"./chunk-YIRGMOQC.js";import"./chunk-CK5W32IL.js";import"./chunk-XRTETVLA.js";import"./chunk-MBTZ72OK.js";import{d as oe}from"./chunk-KWPTKVOD.js";import{a as ee,b as te}from"./chunk-7ETH4QC5.js";import"./chunk-BBHSIDL7.js";import{a as re,b as ne}from"./chunk-XKYWN32Q.js";import"./chunk-WWCLVFFT.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-PMZU2MXQ.js";import{a as ie}from"./chunk-B4ZHF6HX.js";import"./chunk-DL5UW643.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.215 | (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-ZT7M27FX.js";import"./chunk-CKCDJCPZ.js";import{a as ce}from"./chunk-VIXY7DGW.js";import"./chunk-7COBEK2I.js";import{h as ae}from"./chunk-UJZFS2JM.js";import{f as P,g as se}from"./chunk-6USQVYW2.js";import"./chunk-5GU7LW64.js";import"./chunk-HKEH2UOD.js";import"./chunk-QXJPLKP7.js";import"./chunk-5MUXEXEW.js";import{d as oe}from"./chunk-2FEGONIZ.js";import{a as ee,b as te}from"./chunk-LIFR6X36.js";import"./chunk-BU7V5UGD.js";import{a as re,b as ne}from"./chunk-OUB7WT7Q.js";import"./chunk-YTQ5RCVB.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-FEFLFVIU.js";import{a as ie}from"./chunk-QGFTJYVC.js";import"./chunk-AKNZ6QBL.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.213 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as g,b as k}from"./chunk-SNDRRWLJ.js";import{b as S,c as x}from"./chunk-W7XLNK6M.js";import{a as w}from"./chunk-7ETH4QC5.js";import"./chunk-BBHSIDL7.js";import"./chunk-MF7JDUE4.js";import"./chunk-E3UTRL4K.js";import"./chunk-NYBRCPXY.js";import"./chunk-ZMCH7LNI.js";import"./chunk-XKYWN32Q.js";import"./chunk-WWCLVFFT.js";import{H as v,M as f,O as m,l as b}from"./chunk-PMZU2MXQ.js";import"./chunk-B4ZHF6HX.js";import"./chunk-R3Z6QS26.js";import"./chunk-ZCIJF6TG.js";import"./chunk-DL5UW643.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.215 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as g,b as k}from"./chunk-E6YKEDDM.js";import{b as S,c as x}from"./chunk-RFJMDMLK.js";import{a as w}from"./chunk-LIFR6X36.js";import"./chunk-BU7V5UGD.js";import"./chunk-VD2SYCCY.js";import"./chunk-CSJUJIRP.js";import"./chunk-AHWQZXFB.js";import"./chunk-XVYCMZMB.js";import"./chunk-OUB7WT7Q.js";import"./chunk-YTQ5RCVB.js";import{H as v,M as f,O as m,l as b}from"./chunk-FEFLFVIU.js";import"./chunk-QGFTJYVC.js";import"./chunk-6NQYBCWC.js";import"./chunk-K7OZYJKD.js";import"./chunk-AKNZ6QBL.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-XATEDZ5J.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-FHQBCUP6.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.213 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-DL5UW643.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.215 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-AKNZ6QBL.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.213 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{k as f}from"./chunk-IV5EGT4L.js";import"./chunk-345SCUPN.js";import"./chunk-A5PGH6GU.js";import"./chunk-GGNU6KXJ.js";import"./chunk-YKTGO7GR.js";import"./chunk-YIRGMOQC.js";import"./chunk-CK5W32IL.js";import"./chunk-XRTETVLA.js";import"./chunk-SAJDH6T4.js";import"./chunk-6A64BUDU.js";import"./chunk-MBTZ72OK.js";import{a as t,b as n,c as l,d as c,e as a}from"./chunk-A5W26KZ2.js";import"./chunk-W77R37C6.js";import"./chunk-KWPTKVOD.js";import"./chunk-M6QAVNUD.js";import"./chunk-6GF7AYWF.js";import"./chunk-NYBRCPXY.js";import"./chunk-ZMCH7LNI.js";import"./chunk-XKYWN32Q.js";import"./chunk-WWCLVFFT.js";import"./chunk-PMZU2MXQ.js";import"./chunk-ZCIJF6TG.js";import"./chunk-DL5UW643.js";function p(){console.log(`
1
+ /*! sootsim v0.1.215 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{k as f}from"./chunk-VMYBUPRT.js";import"./chunk-KG6V4NCI.js";import"./chunk-AHG7WAP6.js";import"./chunk-6USQVYW2.js";import"./chunk-A3LHGXZW.js";import"./chunk-5GU7LW64.js";import"./chunk-HKEH2UOD.js";import"./chunk-QXJPLKP7.js";import"./chunk-FWUGH36K.js";import"./chunk-T4EGFOSE.js";import"./chunk-5MUXEXEW.js";import{a as t,b as n,c as l,d as c,e as a}from"./chunk-EB4FLAAE.js";import"./chunk-DVJZUBQB.js";import"./chunk-2FEGONIZ.js";import"./chunk-KGSLGXWW.js";import"./chunk-EGCQXWLS.js";import"./chunk-AHWQZXFB.js";import"./chunk-XVYCMZMB.js";import"./chunk-OUB7WT7Q.js";import"./chunk-YTQ5RCVB.js";import"./chunk-FEFLFVIU.js";import"./chunk-K7OZYJKD.js";import"./chunk-AKNZ6QBL.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.215 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-EGCQXWLS.js";import"./chunk-K7OZYJKD.js";import"./chunk-AKNZ6QBL.js";export{a as settingsStore};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.215 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b}from"./chunk-LIFR6X36.js";import"./chunk-BU7V5UGD.js";import"./chunk-FEFLFVIU.js";import"./chunk-AKNZ6QBL.js";export{b as flushCliTelemetry,a as trackCliEvent};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.213 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{g as m,i as d,l as s}from"./chunk-MBTZ72OK.js";import"./chunk-XKYWN32Q.js";import"./chunk-WWCLVFFT.js";import"./chunk-PMZU2MXQ.js";import"./chunk-DL5UW643.js";import{writeFileSync as g}from"fs";function u(){console.log(`
1
+ /*! sootsim v0.1.215 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{g as m,i as d,l as s}from"./chunk-5MUXEXEW.js";import"./chunk-OUB7WT7Q.js";import"./chunk-YTQ5RCVB.js";import"./chunk-FEFLFVIU.js";import"./chunk-AKNZ6QBL.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.213 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as m}from"./chunk-DCNE55YI.js";import{e as c}from"./chunk-34R2XUUH.js";import"./chunk-MBTZ72OK.js";import"./chunk-XKYWN32Q.js";import"./chunk-WWCLVFFT.js";import{K as l,g as s,h as r}from"./chunk-PMZU2MXQ.js";import{a}from"./chunk-B4ZHF6HX.js";import"./chunk-DL5UW643.js";import{spawn as d}from"node:child_process";import g from"node:fs";import u from"node:path";var p="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.215 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as m}from"./chunk-RIAS4TMS.js";import{e as c}from"./chunk-UJZFS2JM.js";import"./chunk-5MUXEXEW.js";import"./chunk-OUB7WT7Q.js";import"./chunk-YTQ5RCVB.js";import{K as l,g as s,h as r}from"./chunk-FEFLFVIU.js";import{a}from"./chunk-QGFTJYVC.js";import"./chunk-AKNZ6QBL.js";import{spawn as d}from"node:child_process";import g from"node:fs";import u from"node:path";var p="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=c();i&&(console.log(` pinned to ${i} \u2014 installing the pin, not channel latest`),console.log(" (run `sootsim runtime unpin` to follow latest again)")),await m(["install",...t?["--channel",t]:[]],{}),console.log(`
4
4
  cli:`),await h()}function f(){if(r())return{kind:"dev"};let o=process.argv[1]??"";try{o=g.realpathSync(o)}catch{}let n=u.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=u.join(s(),"cli");return o.startsWith(`${t}${n}`)?{kind:"global",command:"npm",args:["i","-g","--prefix",t,"sootsim@latest"]}:{kind:"global",command:"npm",args:["i","-g","sootsim@latest"]}}async function h(){let o=a(),n=await k();if(!n){console.log(` v${o} \u2014 couldn't reach the npm registry, skipped`);return}if(l(n,o)<=0){console.log(` v${o} (latest)`);return}let t=f();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 $(t.command,t.args)?console.log(` updated to v${n}`):(console.log(" update failed \u2014 run it yourself:"),console.log(` ${i}`))}function $(o,n){return new Promise(t=>{let i=d(o,n,{stdio:"inherit"});i.on("error",()=>t(!1)),i.on("exit",e=>t(e===0))})}async function k(){try{let o=await fetch(p,{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.215 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c}from"./chunk-VIXY7DGW.js";import"./chunk-7COBEK2I.js";import"./chunk-5GU7LW64.js";import"./chunk-HKEH2UOD.js";import"./chunk-5MUXEXEW.js";import"./chunk-2FEGONIZ.js";import"./chunk-LIFR6X36.js";import"./chunk-BU7V5UGD.js";import"./chunk-OUB7WT7Q.js";import"./chunk-YTQ5RCVB.js";import"./chunk-FEFLFVIU.js";import"./chunk-AKNZ6QBL.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.213 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as s,d as l,i as r}from"./chunk-34R2XUUH.js";import{a as i}from"./chunk-E3UTRL4K.js";import"./chunk-PMZU2MXQ.js";import{a as t}from"./chunk-B4ZHF6HX.js";import"./chunk-DL5UW643.js";async function f(c){let{IS_BETA:m,BETA_LABEL:a}=await import("./beta-ICE6G2X3.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.215 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as s,d as l,i as r}from"./chunk-UJZFS2JM.js";import{a as i}from"./chunk-CSJUJIRP.js";import"./chunk-FEFLFVIU.js";import{a as t}from"./chunk-QGFTJYVC.js";import"./chunk-AKNZ6QBL.js";async function f(c){let{IS_BETA:m,BETA_LABEL:a}=await import("./beta-YMHG327W.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};