sootsim 0.1.154 → 0.1.156
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.
- package/dist-cli/bin.js +3 -3
- package/dist-cli/chunks/{agent-YZ3N3YJJ.js → agent-6SII2ADM.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-CMPQ23XZ.js → agent-wrapper-KCFNAXBX.js} +2 -2
- package/dist-cli/chunks/{app-fonts-RNCU3SYT.js → app-fonts-HA6TURSC.js} +2 -2
- package/dist-cli/chunks/{assert-K753THTP.js → assert-NFD4XONC.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-DAU4P4W3.js +2 -0
- package/dist-cli/chunks/beta-EWOOAHUB.js +2 -0
- package/dist-cli/chunks/{camera-O5GTOOKJ.js → camera-EIXCV6T7.js} +2 -2
- package/dist-cli/chunks/{chunk-KF2HTRT7.js → chunk-2IFYJBKM.js} +1 -1
- package/dist-cli/chunks/{chunk-WWAODHWG.js → chunk-3KS5W6VS.js} +2 -2
- package/dist-cli/chunks/{chunk-OYRHRMGS.js → chunk-5FLC7DTX.js} +2 -2
- package/dist-cli/chunks/{chunk-EBUTVJVS.js → chunk-5JOGV2HQ.js} +2 -2
- package/dist-cli/chunks/chunk-5KJC63UI.js +1 -0
- package/dist-cli/chunks/{chunk-VUT2Q6HH.js → chunk-6DN4FY5V.js} +1 -1
- package/dist-cli/chunks/{chunk-6CNF2TAZ.js → chunk-734YKCKK.js} +1 -1
- package/dist-cli/chunks/{chunk-ZH7IFFWD.js → chunk-7CFLQ5RQ.js} +1 -1
- package/dist-cli/chunks/{chunk-EIZ3VJB4.js → chunk-AF3ZSUJT.js} +2 -2
- package/dist-cli/chunks/{chunk-LLJVOK67.js → chunk-AG4VJEME.js} +1 -1
- package/dist-cli/chunks/chunk-B6A7ZJMT.js +1 -0
- package/dist-cli/chunks/{chunk-Q6RU7N3T.js → chunk-BUPUMQEH.js} +1 -1
- package/dist-cli/chunks/{chunk-KFPDSWRL.js → chunk-C6XY53D4.js} +2 -2
- package/dist-cli/chunks/chunk-CAHWX2CJ.js +2 -0
- package/dist-cli/chunks/{chunk-MAZKCKLQ.js → chunk-CGRV5ZGV.js} +1 -1
- package/dist-cli/chunks/{chunk-KKWBHGX4.js → chunk-DSPYCLAV.js} +3 -3
- package/dist-cli/chunks/{chunk-Q4HIQJLD.js → chunk-EUW6WLU3.js} +1 -1
- package/dist-cli/chunks/{chunk-E7MAIECK.js → chunk-FOLKDVFM.js} +2 -2
- package/dist-cli/chunks/{chunk-2CEEGWFN.js → chunk-FZSEG2L4.js} +1 -1
- package/dist-cli/chunks/{chunk-3JFFSOYP.js → chunk-FZWSY6PU.js} +1 -1
- package/dist-cli/chunks/{chunk-JGQOVPYM.js → chunk-GTKPFFNK.js} +2 -2
- package/dist-cli/chunks/{chunk-DOWB4AVO.js → chunk-IDVRZVWW.js} +2 -2
- package/dist-cli/chunks/{chunk-FDNBPACW.js → chunk-IDXOP3UM.js} +1 -1
- package/dist-cli/chunks/{chunk-H26B2F6V.js → chunk-J53MOMRD.js} +2 -2
- package/dist-cli/chunks/{chunk-XVO4EA3M.js → chunk-JQGIMV75.js} +2 -2
- package/dist-cli/chunks/{chunk-PWIYNKOL.js → chunk-JT47D7AS.js} +2 -2
- package/dist-cli/chunks/{chunk-J5AU4VEY.js → chunk-LEPF5QPE.js} +2 -2
- package/dist-cli/chunks/{chunk-AJWXRYS4.js → chunk-MAZZU3SS.js} +1 -1
- package/dist-cli/chunks/{chunk-HJUMEN5Y.js → chunk-MK4D3LRG.js} +1 -1
- package/dist-cli/chunks/{chunk-WEB4WAR5.js → chunk-MY7FJWXJ.js} +3 -3
- package/dist-cli/chunks/{chunk-4ACXKKEJ.js → chunk-NL5LGUY6.js} +1 -1
- package/dist-cli/chunks/{chunk-SYEEQW7G.js → chunk-OQ4PEGZM.js} +2 -2
- package/dist-cli/chunks/{chunk-SSZ3QI26.js → chunk-PIVH54LG.js} +2 -2
- package/dist-cli/chunks/chunk-QH3FJHUA.js +1 -0
- package/dist-cli/chunks/{chunk-MRL7GB3I.js → chunk-R3K7I6OA.js} +2 -2
- package/dist-cli/chunks/{chunk-CUEP4LEK.js → chunk-TCWXT3TN.js} +2 -2
- package/dist-cli/chunks/{chunk-O6IT53ZW.js → chunk-TJIHZA53.js} +2 -2
- package/dist-cli/chunks/{chunk-BZX7M7PH.js → chunk-TNN276C7.js} +3 -3
- package/dist-cli/chunks/{chunk-3FJVQDOV.js → chunk-UJ4B2V2Y.js} +1 -1
- package/dist-cli/chunks/{chunk-N3S34V2C.js → chunk-UUUBY2MO.js} +2 -2
- package/dist-cli/chunks/{chunk-S4632WPL.js → chunk-VNPT6T3W.js} +2 -2
- package/dist-cli/chunks/{chunk-H7JH2VZG.js → chunk-WTYDDLVC.js} +2 -2
- package/dist-cli/chunks/{chunk-WE7FZSES.js → chunk-XNK3USYL.js} +1 -1
- package/dist-cli/chunks/{chunk-WBRVGBR3.js → chunk-XTTBLKSO.js} +1 -1
- package/dist-cli/chunks/{chunk-ST37ZL42.js → chunk-ZFPDGGM2.js} +2 -2
- package/dist-cli/chunks/cli-version-26ALCPQY.js +2 -0
- package/dist-cli/chunks/{compat-CHPPBI6B.js → compat-GMFJB2QI.js} +3 -3
- package/dist-cli/chunks/{config-MBTESWDI.js → config-VN63ZIQQ.js} +2 -2
- package/dist-cli/chunks/{control-PT7FI7T2.js → control-26SFJCEB.js} +2 -2
- package/dist-cli/chunks/{cpu-profile-BUEJUMK7.js → cpu-profile-TPSUYM3P.js} +2 -2
- package/dist-cli/chunks/{daemon-J3UKADSZ.js → daemon-XLZOQISP.js} +2 -2
- package/dist-cli/chunks/{debug-RFDSFWY7.js → debug-J3SO6XXZ.js} +3 -3
- package/dist-cli/chunks/{detox-4RUCAUGQ.js → detox-OUXMHQ66.js} +2 -2
- package/dist-cli/chunks/{device-ZASI5KEM.js → device-MRE7PGNT.js} +2 -2
- package/dist-cli/chunks/{diagnose-D2GBOZJT.js → diagnose-IBGOIBXB.js} +2 -2
- package/dist-cli/chunks/drivers-UDWSV2BD.js +2 -0
- package/dist-cli/chunks/{electron-F6U2DVFR.js → electron-GM7P45K6.js} +3 -3
- package/dist-cli/chunks/flow-2627URQN.js +2 -0
- package/dist-cli/chunks/help-V2AWDI3R.js +2 -0
- package/dist-cli/chunks/{hints-S3GLUH55.js → hints-ZXJEZ7VA.js} +2 -2
- package/dist-cli/chunks/{home-paths-UTBAAKUV.js → home-paths-R2BX3P5C.js} +2 -2
- package/dist-cli/chunks/{inspect-G2JVRONS.js → inspect-Q5DVSR33.js} +3 -3
- package/dist-cli/chunks/install-T7X3R2JD.js +2 -0
- package/dist-cli/chunks/{install-desktop-LJXYOO2A.js → install-desktop-P33GKIJF.js} +3 -3
- package/dist-cli/chunks/{keys-OHQRWZXF.js → keys-DWT4BLAF.js} +2 -2
- package/dist-cli/chunks/{launch-HNNRKSLY.js → launch-ARXODF7Y.js} +3 -3
- package/dist-cli/chunks/{login-KWBKKXMQ.js → login-IOYQ6NED.js} +4 -4
- package/dist-cli/chunks/{logout-JPJ44VQY.js → logout-PX2G2SXA.js} +2 -2
- package/dist-cli/chunks/{maestro-NZCUMSV5.js → maestro-GGSUWKYF.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-EUADUL22.js +2 -0
- package/dist-cli/chunks/{preview-J4GSU6XR.js → preview-BQUWNLPH.js} +2 -2
- package/dist-cli/chunks/{profile-AWFOXW2R.js → profile-XVN2QFUN.js} +2 -2
- package/dist-cli/chunks/{react-KRWTLQSA.js → react-IARLUSNE.js} +2 -2
- package/dist-cli/chunks/{record-M76PRRB6.js → record-HFSXL4SG.js} +10 -10
- package/dist-cli/chunks/runtime-DKE54MC6.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-EWQNUCQS.js → runtime-delivery-DELLWFH7.js} +2 -2
- package/dist-cli/chunks/{screenshot-ORY2KU4C.js → screenshot-V5F65B2V.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-PCMZC73C.js → screenshot-mode-JS2NQ6VV.js} +2 -2
- package/dist-cli/chunks/{screenshots-MC32I2K6.js → screenshots-PFVIDRRE.js} +2 -2
- package/dist-cli/chunks/{server-ZQ6VUGB5.js → server-YBXIAWME.js} +3 -3
- package/dist-cli/chunks/setup-repo-E7MPL5GG.js +2 -0
- package/dist-cli/chunks/{skills-O2P5IASE.js → skills-2N75NKCV.js} +2 -2
- package/dist-cli/chunks/{slides-5V365XZG.js → slides-ECMGLFWX.js} +2 -2
- package/dist-cli/chunks/{start-HP5IW2V2.js → start-5CZXOX5G.js} +4 -4
- package/dist-cli/chunks/store-E6OLJAZN.js +2 -0
- package/dist-cli/chunks/telemetry-ANL2YCIC.js +2 -0
- package/dist-cli/chunks/{test-EL2B3TVN.js → test-W4ZCCSHY.js} +3 -3
- package/dist-cli/chunks/{three-mode-XBR6DHIQ.js → three-mode-KG3C4Q23.js} +2 -2
- package/dist-cli/chunks/{timeline-D3U6AW2H.js → timeline-WK62L3NA.js} +2 -2
- package/dist-cli/chunks/{upgrade-Q3NLQB4N.js → upgrade-7UVLOEVQ.js} +2 -2
- package/dist-cli/chunks/upload-NPVSF5B7.js +2 -0
- package/dist-cli/chunks/{version-7HW2OI7T.js → version-EVZ4PR3Y.js} +2 -2
- package/dist-cli/chunks/{web-2N3UKXZF.js → web-DDAK4ZLY.js} +2 -2
- package/dist-cli/chunks/{what-happened-QC355I37.js → what-happened-RSHNHEZ3.js} +2 -2
- package/dist-cli/chunks/{whoami-YL6OPCRZ.js → whoami-LPQ5MGZQ.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/menu.cjs +468 -0
- package/dist-lib/menu.mjs +434 -0
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/package.json +7 -1
- package/src/menu.ts +578 -0
- package/dist-cli/chunks/auto-bootstrap-YLTKWTZX.js +0 -2
- package/dist-cli/chunks/beta-VKIPKOLB.js +0 -2
- package/dist-cli/chunks/chunk-A46SK2PQ.js +0 -1
- package/dist-cli/chunks/chunk-BIWI3V47.js +0 -2
- package/dist-cli/chunks/chunk-CGH6JMFB.js +0 -1
- package/dist-cli/chunks/chunk-SZMDKZYL.js +0 -1
- package/dist-cli/chunks/cli-version-ES2WEE5A.js +0 -2
- package/dist-cli/chunks/drivers-LQSB4JTL.js +0 -2
- package/dist-cli/chunks/flow-IDSU4MLV.js +0 -2
- package/dist-cli/chunks/help-2MGPQJCL.js +0 -2
- package/dist-cli/chunks/install-CDJAF2XK.js +0 -2
- package/dist-cli/chunks/optional-demo-registry-C4CGGJVD.js +0 -2
- package/dist-cli/chunks/runtime-ORANRGJV.js +0 -2
- package/dist-cli/chunks/setup-repo-ER6REBKB.js +0 -2
- package/dist-cli/chunks/store-AW7RMWCL.js +0 -2
- package/dist-cli/chunks/telemetry-MM6JBCD6.js +0 -2
- package/dist-cli/chunks/upload-S2IBROET.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as k}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as k}from"./chunk-AG4VJEME.js";import{a as x}from"./chunk-NL5LGUY6.js";import"./chunk-CGRV5ZGV.js";import{spawn as v,spawnSync as u}from"child_process";import{chmodSync as S,copyFileSync as T,createWriteStream as E,existsSync as w,mkdirSync as y,rmSync as g,statSync as P,unlinkSync as D}from"fs";import{tmpdir as M}from"os";import{dirname as A,join as f,resolve as b}from"path";var h="https://sootbean.com/api/electron-release";function O(){let n=process.arch;if(process.platform==="darwin"){let o=n==="arm64"?"mac-arm64":"mac-x64",e=`sootsim-latest-${o}.dmg`;return{platform:o,filename:e,url:`${h}/${e}`,install:L}}if(process.platform==="linux"){let o=n==="arm64"?"linux-arm64":"linux-x64",e=`sootsim-latest-${o}.AppImage`;return{platform:o,filename:e,url:`${h}/${e}`,install:C}}if(process.platform==="win32"){let o="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:o,url:`${h}/${o}`,install:B}}return null}async function I({url:n,dest:o,onProgress:e}){let s=await fetch(n,{redirect:"follow"});if(!s.ok)throw new Error(`${s.status} ${s.statusText} (${n})`);let t=s.headers.get("content-length"),a=t?Number(t):null;if(!s.body)throw new Error(`empty response body (${n})`);y(A(o),{recursive:!0});let i=E(o),d=s.body.getReader(),c=0;try{for(;;){let{done:l,value:p}=await d.read();if(l)break;i.write(Buffer.from(p)),c+=p.byteLength,e?.(c,a)}}finally{await new Promise((l,p)=>{i.end(r=>r?p(r):l())})}}function _(n,o){let e=(n/1048576).toFixed(1);if(!o)return` ${e} MB`;let s=Math.min(100,Math.round(n/o*100)),t=(o/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${e} / ${t} MB`}async function L(n){let o=u("hdiutil",["attach","-nobrowse","-readonly",n],{encoding:"utf8"});if(o.status!==0)throw new Error(`hdiutil attach failed: ${o.stderr||o.stdout}`.trim());let e=o.stdout.trim().split(`
|
|
3
3
|
`),t=e[e.length-1].split(" ").pop()?.trim();if(!t||!w(t))throw new Error(`could not determine dmg mount point (output: ${o.stdout})`);let a=f(t,"sootsim.app");if(!w(a))throw u("hdiutil",["detach","-force",t]),new Error(`sootsim.app not found inside ${t}`);let i="/Applications",d=b(process.env.HOME||"","Applications"),c=i;try{let m=f(i,`.sootsim-write-probe-${process.pid}`);u("touch",[m]),w(m)?g(m,{force:!0}):c=d}catch{c=d}c===d&&y(c,{recursive:!0});let l=f(c,"sootsim.app");w(l)&&g(l,{recursive:!0,force:!0});let p=u("cp",["-R",a,l]),r=u("hdiutil",["detach","-force",t]);if(p.status!==0)throw new Error(`copy to ${l} failed: ${p.stderr?.toString()||""}`.trim());return r.status!==0&&console.warn(` warning: failed to unmount ${t} (${r.stderr?.toString().trim()||"unknown error"})`),u("xattr",["-dr","com.apple.quarantine",l]),l}async function C(n){let o=b(process.env.HOME||"","Applications");y(o,{recursive:!0});let e=f(o,"sootsim.AppImage");return w(e)&&g(e,{force:!0}),T(n,e),D(n),S(e,493),e}async function B(n){return await new Promise((o,e)=>{let s=v("cmd",["/c","start",'""',"/wait",n],{stdio:"inherit"});s.once("error",e),s.once("exit",t=>{t===0?o():e(new Error(`installer exited with code ${t}`))})}),n}async function q(n){(n.includes("--help")||n.includes("-h"))&&(console.log(`
|
|
4
4
|
sootsim install-desktop \u2014 download and install the optional desktop GUI
|
|
5
5
|
|
|
@@ -20,4 +20,4 @@ examples:
|
|
|
20
20
|
`),process.exit(0));let o=n.includes("--yes")||n.includes("-y")||process.env.SOOTSIM_NO_PROMPT==="1"||process.env.CI==="1"||!process.stdin.isTTY,e=n.includes("--force"),s=x();if(s&&!e){console.log(` sootsim desktop already installed at: ${s.path}`),console.log(" pass --force to reinstall.");return}let t=O();if(t||(console.error(` no desktop build available for ${process.platform}/${process.arch}.`),console.error(" supported: darwin-arm64, darwin-x64, linux-x64, win32-x64"),process.exit(1)),console.log(` platform: ${t.platform}`),console.log(` download: ${t.url}`),console.log(),!o){if(!await k("download and install now?",!0)){console.log(" cancelled.");return}console.log()}let a=f(M(),`sootsim-install-${Date.now()}`),i=f(a,t.filename),d=0;process.stdout.write(` downloading ${t.filename}...
|
|
21
21
|
`);try{await I({url:t.url,dest:i,onProgress:(r,m)=>{let $=Date.now();$-d<100&&r<(m??1/0)||(d=$,process.stdout.isTTY&&process.stdout.write(`\r\x1B[2K${_(r,m)}`))}})}catch(r){g(a,{recursive:!0,force:!0});let m=r instanceof Error?r.message:String(r);console.error(`
|
|
22
22
|
download failed: ${m}`),console.error(` the ${t.platform} desktop build may not be published yet, or your`),console.error(" network blocked the request. check your connection and try again later;"),console.error(" the CLI + daemon work without the desktop app (run: sootsim --help)."),process.exit(1)}process.stdout.isTTY&&process.stdout.write(`
|
|
23
|
-
`);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-
|
|
23
|
+
`);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-ANL2YCIC.js");try{let r=await t.install(i);l({event:"cli_install_desktop_succeeded",properties:{platform:t.platform,size_bytes:c}}),console.log(` installed: ${r}`)}catch(r){l({event:"cli_install_desktop_failed",properties:{platform:t.platform,error:r instanceof Error?r.message:String(r)}}),await p(),console.error(` install failed: ${r instanceof Error?r.message:String(r)}`),console.error(` keeping download at ${i} for manual install.`),process.exit(1)}finally{g(a,{recursive:!0,force:!0})}console.log(),console.log(" next steps:"),console.log(" sootsim electron launch the desktop app"),console.log(" sootsim open <target> open a demo or bundle in it")}export{q as runInstallDesktop};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as l,b as d,c as k,d as y,e as g}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as l,b as d,c as k,d as y,e as g}from"./chunk-OQ4PEGZM.js";import{d as c}from"./chunk-JT47D7AS.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";async function a(){let s=await c();return s?.token||(process.stderr.write(" sootsim keys ... needs you to be signed in.\n run `sootsim login` first.\n"),process.exit(1)),{origin:s.origin,token:s.token}}function f(s){if(!s)return"never";try{return new Date(s).toLocaleString()}catch{return s}}async function h(s){let i=s[0];if(!i||i==="--help"||i==="-h"){u();return}if(i==="list"){let{origin:o,token:e}=await a(),n=await fetch(`${o.replace(/\/$/,"")}/api/sootsim/billing/keys`,{headers:{authorization:`Bearer ${e}`}});n.ok||(console.error(` keys list failed (${n.status})`),process.exit(1));let{keys:r}=await n.json();if(r.length===0){console.log(" no keys. create one with `sootsim keys create <label>`.");return}for(let t of r)console.log(` ${t.keyPrefix}\u2026 ${t.label.padEnd(24)} scopes=${t.scopes.join(",")} last=${f(t.lastUsedAt)} id=${t.id}`);return}if(i==="create"){let o=s[1]?.trim();o||(console.error(" usage: sootsim keys create <label>"),process.exit(1));let{origin:e,token:n}=await a(),r=await fetch(`${e.replace(/\/$/,"")}/api/sootsim/billing/keys`,{method:"POST",headers:{authorization:`Bearer ${n}`,"content-type":"application/json"},body:JSON.stringify({label:o})});r.ok||(console.error(` keys create failed (${r.status}): ${await r.text()}`),process.exit(1));let t=await r.json();console.log(`
|
|
3
3
|
created: ${t.record.label} (${t.record.keyPrefix}\u2026)`),console.log(` scopes: ${t.record.scopes.join(",")}`),console.log(`
|
|
4
4
|
secret: ${t.secret}
|
|
5
5
|
`),console.log(` copy this now \u2014 we can't show it again.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-5KJC63UI.js";import{b as h}from"./chunk-FOLKDVFM.js";import{a as d}from"./chunk-NL5LGUY6.js";import"./chunk-AF3ZSUJT.js";import"./chunk-QH3FJHUA.js";import"./chunk-UJ4B2V2Y.js";import"./chunk-MAZZU3SS.js";import{A as t,B as u,F as m,G as r,H as a,h as l,i as c}from"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";import{spawn as v}from"child_process";import{existsSync as w}from"fs";async function O(n){if(n.includes("--help")||n.includes("-h")){console.log(`
|
|
3
3
|
sootsim launch \u2014 one-shot: install runtime if needed, start daemon, open app
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -13,4 +13,4 @@ options:
|
|
|
13
13
|
examples:
|
|
14
14
|
sootsim launch
|
|
15
15
|
sootsim launch --version 1.2.3
|
|
16
|
-
`);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),s=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;t(),await x({skipAutoInstall:e,channel:s,explicitVersion:f}),await p(),await k()}async function x(n){let e=u(),i=m();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:s}=await import("./runtime-
|
|
16
|
+
`);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),s=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;t(),await x({skipAutoInstall:e,channel:s,explicitVersion:f}),await p(),await k()}async function x(n){let e=u(),i=m();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:s}=await import("./runtime-DKE54MC6.js"),o=[];n.explicitVersion&&o.push(n.explicitVersion),n.channel!=="stable"&&o.push("--channel",n.channel),await s(["install",...o],{channel:n.channel})}async function p(){let n=r();if(a(n))return;if(c()){let o=l()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";console.error(` not spawning a standalone sootsim daemon \u2014 ${o}.`),console.error(" the live `bun dev` stack hosts the bridge in-process (run it, or its electron);"),console.error(" set SOOTSIM_FORCE_DAEMON_INSTALL=1 to spawn one here on purpose."),process.exit(1)}console.log("sootsim: starting daemon");let e=g();v(e,["server","--quiet"],{detached:!0,stdio:"ignore",env:process.env}).unref();let s=Date.now()+8e3;for(;Date.now()<s;){let o=r();if(a(o))return;await D(150)}console.error(" daemon didn't become ready within 8s \u2014 check ~/.sootsim/ or run `sootsim server` in a terminal to see errors"),process.exit(1)}async function k(){d()||(console.error(" no sootsim desktop companion installed. run `sootsim install-desktop` to download electron + the shell."),process.exit(1));let e=await h.launch({});e.launched||(console.error(` ${e.message}`),process.exit(1)),console.log(` ${e.message}`)}function g(){let n=process.argv[1];return n&&w(n)?n:"sootsim"}function D(n){return new Promise(e=>setTimeout(e,n))}async function R(){t(),await p()}export{R as ensureDaemonRunning,O as runLaunch};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as g,d as m}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as g,d as m}from"./chunk-JT47D7AS.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";import{exec as O}from"node:child_process";import{randomBytes as S}from"node:crypto";import _ from"node:http";var I=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",h="http://localhost:3000";async function x(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${h}/api/auth/me`)).ok)return h}catch{}return I}function L(){console.log(`
|
|
3
3
|
sootsim login \u2014 sign in so desktop uploads can attach to your account
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -21,6 +21,6 @@ options:
|
|
|
21
21
|
<p style="color:#ccc">${r}</p>
|
|
22
22
|
</div>
|
|
23
23
|
</body>
|
|
24
|
-
</html>`}async function P(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!e.ok){let c=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${c}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function A(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function G(r){(r.includes("--help")||r.includes("-h"))&&(L(),process.exit(0));let e=[...r],t=await x(R(e,"--origin"));if(A(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await P(t);if(o.ok){g({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let s=await m(t),l=s?.user?.email||o.email||s?.user?.id||o.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-
|
|
24
|
+
</html>`}async function P(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!e.ok){let c=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${c}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function A(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function G(r){(r.includes("--help")||r.includes("-h"))&&(L(),process.exit(0));let e=[...r],t=await x(R(e,"--origin"));if(A(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await P(t);if(o.ok){g({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let s=await m(t),l=s?.user?.email||o.email||s?.user?.id||o.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-ANL2YCIC.js");n({event:"cli_login_succeeded",identity:{userId:o.userId??s?.user?.id??null},properties:{origin:t,mode:"dev"}}),await a(),console.log(` signed in${l?` as ${l}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let c=S(16).toString("hex"),i=await new Promise(o=>{let s=_.createServer((l,n)=>{try{let a=new URL(l.url||"/","http://127.0.0.1"),w=a.searchParams.get("state"),k=a.searchParams.get("token"),b=a.searchParams.get("email")||void 0,$=a.searchParams.get("userId")||void 0,f=a.searchParams.get("error");if(n.setHeader("content-type","text/html; charset=utf-8"),f){n.end(u(`sign-in failed: ${f}`)),o({ok:!1,error:f}),s.close();return}if(w!==c){n.end(u("state mismatch. close this tab and retry `sootsim login`.")),o({ok:!1,error:"state mismatch"}),s.close();return}if(!k){n.end(u("missing token. close this tab and retry `sootsim login`.")),o({ok:!1,error:"missing token"}),s.close();return}n.end(u("sign-in complete. you can return to the terminal.")),o({ok:!0,token:k,email:b,userId:$}),s.close()}catch(a){n.statusCode=500,n.end(u("sign-in callback failed. retry `sootsim login`.")),o({ok:!1,error:a instanceof Error?a.message:"callback failed"}),s.close()}});s.listen(0,"127.0.0.1",()=>{let l=s.address();if(!l||typeof l=="string"){o({ok:!1,error:"failed to bind callback server"}),s.close();return}let n=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",c),n.searchParams.set("port",String(l.port)),n.searchParams.set("sootbean",t),console.log(" opening browser for sootsim login..."),console.log(` waiting for callback on 127.0.0.1:${l.port}`),console.log(` if nothing opens, visit:
|
|
25
25
|
${n.toString()}
|
|
26
|
-
`),T(n.toString())})});if(!i.ok){let{trackCliEvent:o,flushCliTelemetry:s}=await import("./telemetry-
|
|
26
|
+
`),T(n.toString())})});if(!i.ok){let{trackCliEvent:o,flushCliTelemetry:s}=await import("./telemetry-ANL2YCIC.js");o({event:"cli_login_failed",properties:{origin:t,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}g({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:t,source:"cli"});let d=await m(t),p=d?.user?.email||i.email||d?.user?.id||i.userId,{trackCliEvent:y,flushCliTelemetry:v}=await import("./telemetry-ANL2YCIC.js");y({event:"cli_login_succeeded",identity:{userId:i.userId??d?.user?.id??null},properties:{origin:t}}),await v(),console.log(` signed in${p?` as ${p}`:""}`)}export{G as runLogin};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as r,b as i}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as r,b as i}from"./chunk-LEPF5QPE.js";import{a as t,c as o}from"./chunk-JT47D7AS.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as y,c as v}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as y,c as v}from"./chunk-TNN276C7.js";import"./chunk-TJIHZA53.js";import"./chunk-B6A7ZJMT.js";import"./chunk-ZFPDGGM2.js";import"./chunk-J53MOMRD.js";import"./chunk-OQ4PEGZM.js";import{b as h,c as w}from"./chunk-R3K7I6OA.js";import"./chunk-VNPT6T3W.js";import"./chunk-UUUBY2MO.js";import"./chunk-PIVH54LG.js";import"./chunk-IDXOP3UM.js";import"./chunk-2IFYJBKM.js";import"./chunk-5JOGV2HQ.js";import"./chunk-EUW6WLU3.js";import"./chunk-FOLKDVFM.js";import"./chunk-NL5LGUY6.js";import"./chunk-AF3ZSUJT.js";import"./chunk-QH3FJHUA.js";import"./chunk-UJ4B2V2Y.js";import"./chunk-MAZZU3SS.js";import"./chunk-LEPF5QPE.js";import"./chunk-JT47D7AS.js";import"./chunk-5FLC7DTX.js";import"./chunk-CAHWX2CJ.js";import"./chunk-XNK3USYL.js";import"./chunk-C6XY53D4.js";import"./chunk-BUPUMQEH.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";import*as n from"fs";import*as a from"path";var S=[".maestro","maestro"];function k(){console.log(`
|
|
3
3
|
sootsim maestro \u2014 run maestro YAML flows against sootsim (drop-in)
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-CGRV5ZGV.js";import{resolve as c,dirname as m}from"path";import{fileURLToPath as a}from"url";var t=m(a(import.meta.resolve("sootsim-engine/package.json")));async function g(o,r){(o.includes("--help")||o.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim preview \u2014 production-like preview
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as s,c as i,d as t,e as n,f as c}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as s,c as i,d as t,e as n,f as c}from"./chunk-AF3ZSUJT.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";function f(){console.log(`
|
|
3
3
|
sootsim profile \u2014 manage isolated storage profiles
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{c as w,e as b,h as m,i as f}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as w,e as b,h as m,i as f}from"./chunk-5JOGV2HQ.js";import"./chunk-MAZZU3SS.js";import"./chunk-XNK3USYL.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";function h(){console.log(`
|
|
3
3
|
sootsim react \u2014 inspect React component render cost in the tenant worker
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as P}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as P}from"./chunk-ZFPDGGM2.js";import"./chunk-J53MOMRD.js";import{d as Z,f as ee}from"./chunk-OQ4PEGZM.js";import"./chunk-2IFYJBKM.js";import{c as b,e as v,f as Y}from"./chunk-5JOGV2HQ.js";import"./chunk-QH3FJHUA.js";import{d as X}from"./chunk-UJ4B2V2Y.js";import{b as Q}from"./chunk-MAZZU3SS.js";import"./chunk-LEPF5QPE.js";import"./chunk-JT47D7AS.js";import"./chunk-XNK3USYL.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";import{existsSync as we,mkdirSync as E,readdirSync as he,readFileSync as be,rmSync as J,writeFileSync as I}from"fs";import{homedir as ve,tmpdir as ye}from"os";import{dirname as W,extname as oe,join as N,resolve as Se}from"path";var z=24e4,Re=9e4,$e=3e4;async function D(e,r,o,i){let t=Math.max(2e4,i+$e);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
|
|
3
3
|
the capture lock auto-releases, so simply retry the recording.
|
|
4
4
|
if it persists, recover the sim with \`sootsim close --sim <id>\`.`),process.exit(1)),/render host not available|already streaming|already recording/i.test(s)&&(console.error(` ${o} failed: ${s}
|
|
5
5
|
a prior recording was abandoned and its capture is still
|
|
6
6
|
releasing. the lock self-heals in ~${Math.round((i+2e4)/1e3)}s \u2014 retry then, or recover now with
|
|
7
|
-
\`sootsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var
|
|
7
|
+
\`sootsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var _e=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),xe=new Set(["start","stop","cancel","status","prelude-start"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){_e.has(o)&&r++;continue}return xe.has(o)?{name:o,index:r}:null}return null}function ke(){let e=process.env,r=(e.SOOT_BRANCH||e.GITHUB_HEAD_REF||e.GITHUB_REF_NAME||"").trim(),o=(e.SOOT_SHA||e.GITHUB_SHA||"").trim(),i=(e.SOOT_PR_NUMBER||"").trim(),t=i?Number.parseInt(i,10):Number.NaN,n=(e.SOOT_PR_TITLE||"").trim();return{branch:r||void 0,commitSha:o||void 0,pullRequestNumber:Number.isFinite(t)&&t>0?t:void 0,pullRequestTitle:n||void 0}}function re(e){let r=l(e,"--owner")?.trim(),o=l(e,"--repo")?.trim();return(r&&!o||!r&&o)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),r&&o?{owner:r,repo:o}:null}async function qe(e,r){let o=Oe(e);if(o){let c=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Ie(c,r);return}if(o.name==="prelude-start"){await Ne(c,r);return}if(o.name==="stop"){await Pe(c,r);return}if(o.name==="cancel"){await Fe(c,r);return}await Ae(c,r);return}let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=ie(l(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=l(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let d=l(e,"--output"),a=Number(l(e,"--duration")??"10");(!Number.isFinite(a)||a<=0)&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let m=600;a>m&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 exceeds the ${m}s (10m) maximum`),process.exit(1));let u=Number(l(e,"--fps")??"30"),p=l(e,"--frames");if(p!==void 0){let c=Number(p);(!Number.isInteger(c)||c<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let x=e.includes("--open"),j=l(e,"--max-width")?Number(l(e,"--max-width")):void 0,g=Math.max(100,Math.round(a*1e3)),K=l(e,"--origin"),pe=re(e);if(t==="live"||t==="combined"){d&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await P("record",{originOverride:K,allowGitHubAuth:!0});let c=v({...i,commandTimeoutMs:6e4});try{await q(c),await ae(c,t),t==="combined"&&await B(c),await de(c,K,pe);let $=await ce(c,t,t==="combined"?n:void 0);$.ok||(console.error(` start failed: recording store refused to start (${t})`+($.error?`: ${$.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(_=>setTimeout(_,g)),await le(c);let O=await ue(c);me(O,x,t)}finally{c.close()}return}let C=p?Number(p):null,S=Te(s,d,C);x&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let h=v({...i,commandTimeoutMs:6e4});try{if(await te(h),await B(h),S==="png"){let R=C??10,w=U(d,`sootsim-frames-${M()}`);d&&oe(d)&&console.log(` note: --frames writes multiple pngs, so --output "${d}" is a directory \u2014 frame-NNN.png files land inside it`),E(w,{recursive:!0});for(let f of he(w))/^frame-\d+\.png$/.test(f)&&J(N(w,f),{force:!0});console.log(` sampling ${R} frames over ${a}s \u2192 ${w}`);let y=await h.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${R}, durationMs: ${g}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!y.ok||!y.requestId)&&(console.error(` frame capture start failed: ${y.error??"unknown error"}`),process.exit(1)),await new Promise(f=>setTimeout(f,g));let fe=Date.now()+Math.max(5e3,g),A=null;for(;;){let f=await h.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${y.requestId})`});if(f||(console.error(" frame capture result missing"),process.exit(1)),f.done){f.ok||(console.error(` frame capture failed: ${f.error??"unknown error"}`),process.exit(1)),A=f.frames??[];break}Date.now()>=fe&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(F=>setTimeout(F,100))}A.forEach((f,F)=>{let ge=`${w}/frame-${String(F+1).padStart(3,"0")}.png`;I(ge,Buffer.from(f.data,"base64"))}),console.log(` saved ${A.length} frames`);return}if(S==="gif"){let R=C??Math.max(10,Math.round(a*u/3)),w=U(d,`sootsim-${M()}.gif`);E(W(w),{recursive:!0}),console.log(` encoding gif: ${R} frames over ${a}s \u2192 ${w}`);let y=await D(h,`window.__sootsimRecorder.captureGif({ frames: ${R}, durationMs: ${g}${j?`, maxWidth: ${j}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",g);y||(console.error(" gif capture returned no frames"),process.exit(1)),I(w,Buffer.from(y.data,"base64")),console.log(` saved: ${w} (${G(y.size)})`);return}let c=U(d,`sootsim-${M()}.${S}`);E(W(c),{recursive:!0});let $={format:S,fps:u,durationMs:g};n&&($.layers=n);let O=await D(h,`window.__sootsimRecorder.start(${JSON.stringify($)})`,`${S} start`,g);O.ok||(console.error(` start failed: ${O.error??"unknown error"}`),/render host not available|already streaming|already recording/i.test(O.error??"")&&console.error(" a prior recording was abandoned and its capture is still\n releasing. retry in ~20s, or recover now with\n `sootsim close --sim <id>` then reopen the sim."),process.exit(1)),console.log(` recording ${S} for ${a}s \u2192 ${c}`),await new Promise(R=>setTimeout(R,g));let _=await D(h,"window.__sootsimRecorder.stop()",`${S} encode/flush`,g);_.ok||(console.error(` stop failed: ${_.error??"unknown error"}`),process.exit(1)),_.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await ne(h,c),console.log(` saved: ${c} (${G(_.size)})`)}finally{h.close()}}var Ee=6e3;async function L(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:Ee})}catch(o){let i=o instanceof Error?o.message:String(o);throw/^command timed out after \d+s$/.test(i)&&(console.error(" sim did not respond \u2014 it is connected to the bridge but has not\n loaded an app (or its page is unresponsive). run `sootsim list`\n and target a sim with a loaded app via --sim <id>."),process.exit(1)),o}}async function te(e){await L(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function B(e){let{hidden:r}=await Y(e);r&&(console.error(` refusing to record: the sootsim tab is hidden, so frame capture
|
|
8
8
|
would be throttled to ~1fps and produce a frozen-looking file.
|
|
9
9
|
bring the chrome window to the foreground (un-minimize / switch to
|
|
10
|
-
its tab) or run the recording in headless playwright, then retry.`),process.exit(1))}async function ne(e,r){let o=[],i=0;for(;;){let t=await e.send({type:"evaluate",code:`window.__sootsimRecorder.getBlobBase64({ offset: ${i}, chunk: 2097152 })`});if(!t)throw new Error("no blob available on recorder");if(o.push(Buffer.from(t.data,"base64")),i=t.offset,t.done)break}I(r,Buffer.concat(o))}function l(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function Be(e){if(!e)return;let r=oe(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function
|
|
10
|
+
its tab) or run the recording in headless playwright, then retry.`),process.exit(1))}async function ne(e,r){let o=[],i=0;for(;;){let t=await e.send({type:"evaluate",code:`window.__sootsimRecorder.getBlobBase64({ offset: ${i}, chunk: 2097152 })`});if(!t)throw new Error("no blob available on recorder");if(o.push(Buffer.from(t.data,"base64")),i=t.offset,t.done)break}I(r,Buffer.concat(o))}function l(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function Be(e){if(!e)return;let r=oe(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function Te(e,r,o){return e||(o!=null?"png":Be(r)??"webm")}function M(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function Me(){let e=N(ve(),".sootsim","recordings");return E(e,{recursive:!0}),e}function U(e,r){return e?Se(process.cwd(),e):N(Me(),r)}function G(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function ie(e){if(!e)return"video";if(e==="video"||e==="live"||e==="combined")return e;console.error(` invalid --mode "${e}" \u2014 expected video | live | combined`),process.exit(1)}function H(){return N(ye(),`sootsim-recording-${Q()}.json`)}function T(){let e=H();if(!we(e))return null;try{return{mode:"video",...JSON.parse(be(e,"utf8"))}}catch{return J(e,{force:!0}),null}}function Ue(e){I(H(),JSON.stringify(e,null,2))}function k(){J(H(),{force:!0})}function V(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
|
|
11
11
|
requested sim ${e}. record state is global (not per-sim);
|
|
12
|
-
this command acts on that session regardless of --sim.`)}async function
|
|
12
|
+
this command acts on that session regardless of --sim.`)}async function Ie(e,r){let o=T();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`sootsim record stop\` first, or \`sootsim record cancel\` to discard.`),process.exit(1));let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only"],stripValueFlags:["--mode","--fps","--format","--max-width","--origin","--owner","--repo"]}),t=ie(l(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=l(e,"--format"),d=s==="mp4"?"mp4":"webm";s&&d!==s&&(console.error(` record start only supports webm or mp4 (got: ${s}). for gif/png use atomic mode: sootsim record --format ${s} --duration <s>`),process.exit(1));let a=Number(l(e,"--fps")??"30"),m=re(e),u=v({...i,commandTimeoutMs:t==="live"||t==="combined"?Re:15e3});try{if(t==="live"||t==="combined"){n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await P("record",{originOverride:l(e,"--origin"),allowGitHubAuth:!0}),await q(u),await ae(u,t),t==="combined"&&await B(u),await de(u,l(e,"--origin"),m);let p=await ce(u,t,t==="combined"?n:void 0);p.ok||(console.error(` start failed: recording store refused to start (${t})`+(p.error?`: ${p.error}`:"")),process.exit(1))}else{await te(u),await B(u);let p={format:d,fps:a};n&&(p.layers=n);let x=await u.send({type:"evaluate",code:`window.__sootsimRecorder.start(${JSON.stringify(p)})`});x.ok||(console.error(` start failed: ${x.error??"unknown error"}`),process.exit(1))}Ue({simId:i.simId??null,mode:t,format:d,fps:a,layers:n,startedAt:new Date().toISOString()}),console.log(t==="video"?` recording ${d} @ ${a}fps${n?` (${n})`:""} \u2014 run \`sootsim record stop --output <path>\` when done`:` recording ${t} \u2014 run \`sootsim record stop\` when done (add --open to launch the preview URL)`)}finally{u.close()}}async function Ne(e,r){let o=T();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`sootsim record stop\` first, or \`sootsim record cancel\` to discard.`),process.exit(1));let i=b(e,{port:r.port,stripBooleanFlags:[],stripValueFlags:["--origin"]}),t=v({...i,commandTimeoutMs:15e3});try{if(await q(t),await B(t),!await t.send({type:"evaluate",code:`(() => {
|
|
13
13
|
const start = window.SootSim?.bridges?.startRecordingPrelude
|
|
14
14
|
if (typeof start !== 'function') return false
|
|
15
15
|
return Promise.resolve(start()).then((value) => value === true)
|
|
@@ -25,7 +25,7 @@ import{a as P}from"./chunk-ST37ZL42.js";import"./chunk-H26B2F6V.js";import{d as
|
|
|
25
25
|
? eventRecorder.isRecording() === true
|
|
26
26
|
: false;
|
|
27
27
|
return { store: store ? store.state : undefined, headless, eventRecording };
|
|
28
|
-
})()`});return r?r.store==="recording"||r.headless==="recording"?"recording":r.store==="processing"?"processing":r.eventRecording?"prelude":r.store==="idle"||r.headless==="idle"?"idle":null:null}catch{return null}}async function
|
|
28
|
+
})()`});return r?r.store==="recording"||r.headless==="recording"?"recording":r.store==="processing"?"processing":r.eventRecording?"prelude":r.store==="idle"||r.headless==="idle"?"idle":null:null}catch{return null}}async function Ce(e){let r=await e.send({type:"evaluate",code:`(() => {
|
|
29
29
|
const store = window.SootSim?.bridges?.getRecordingState?.();
|
|
30
30
|
const eventRecorder = window.SootSim?.bridges?.eventRecorder ?? window.__sootsimEventRecorder;
|
|
31
31
|
const hadStoreRecording = store && store.state !== 'idle';
|
|
@@ -40,7 +40,7 @@ import{a as P}from"./chunk-ST37ZL42.js";import"./chunk-H26B2F6V.js";import{d as
|
|
|
40
40
|
const r = window.__sootsimRecorder;
|
|
41
41
|
if (r && typeof r.forceRelease === 'function') return await r.forceRelease();
|
|
42
42
|
return false;
|
|
43
|
-
})()`}).catch(()=>!1);return{store:r,headless:o}}async function
|
|
43
|
+
})()`}).catch(()=>!1);return{store:r,headless:o}}async function Ae(e,r){let o=T();if(o){V(b(e,{port:r.port}).simId,o),o.mode==="video"?console.log(` recording ${o.mode} (${o.format} @ ${o.fps}fps) on sim ${o.simId??"?"} since ${o.startedAt}`):console.log(` recording ${o.mode} on sim ${o.simId??"?"} since ${o.startedAt}`);return}let i=b(e,{port:r.port}),t=v({...i,commandTimeoutMs:8e3});try{let n=await se(t);if(n==="recording"||n==="processing"||n==="prelude"){if(n==="prelude"){console.log(" a recording preview prelude is active. hidden setup is being\n captured for the next live/combined preview recording. finish\n it with `sootsim record start --mode combined`, or discard it\n with `sootsim record cancel`.");return}console.log(` a recording is in progress (engine state: ${n}), but not via
|
|
44
44
|
\`record start\` \u2014 it was started by an atomic \`record --duration\`
|
|
45
45
|
run or the in-browser record button, which own their own lifecycle.
|
|
46
46
|
if that controlling run is still alive it will finish on its own
|
|
@@ -48,7 +48,7 @@ import{a as P}from"./chunk-ST37ZL42.js";import"./chunk-H26B2F6V.js";import{d as
|
|
|
48
48
|
process; live/combined upload to /preview/<id>). if the run was
|
|
49
49
|
killed, the recording is abandoned and will NOT finish \u2014 reclaim
|
|
50
50
|
it now with \`sootsim record cancel\`, or it auto-reclaims when the
|
|
51
|
-
abandoned capture's deadline lapses.`)}else console.log(" no recording in progress")}finally{t.close()}}async function
|
|
51
|
+
abandoned capture's deadline lapses.`)}else console.log(" no recording in progress")}finally{t.close()}}async function Fe(e,r){let o=T();if(!o){let s=b(e,{port:r.port}),d=v({...s,commandTimeoutMs:8e3});try{let a=await se(d);if(a==="recording"||a==="processing"||a==="prelude"){let m=await Ce(d);m.store&&a==="prelude"?console.log(" recording preview prelude cancelled"):m.store||m.headless?console.log(" reclaimed an abandoned recording (started by an atomic\n `record --duration` run or the record button whose owner is\n gone). the recorder is idle again \u2014 live/combined can start."):console.log(" a recording is in progress and still owned by a live atomic\n `record --duration` run or the in-browser record button \u2014 it\n will finish on its own and nothing was reclaimed.")}else console.log(" no recording in progress")}finally{d.close()}return}let i=b(e,{port:r.port});V(i.simId,o);let t=o.simId??i.simId??void 0,n=v({...i,simId:t,commandTimeoutMs:15e3});try{o.mode==="live"||o.mode==="combined"?await n.send({type:"evaluate",code:"void window.SootSim?.bridges?.cancelRecording?.()"}):await n.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"})}catch{}finally{k(),n.close()}console.log(" recording cancelled")}async function Pe(e,r){let o=T();o||(console.error(" no recording in progress. start one with `sootsim record start`."),process.exit(1));let i=b(e,{port:r.port,stripBooleanFlags:["--open"],stripValueFlags:["--output"]});V(i.simId,o);let t=o.simId??i.simId??void 0,n=e.includes("--open"),s=v({...i,simId:t,commandTimeoutMs:o.mode==="live"||o.mode==="combined"?z:6e4});try{if(o.mode==="live"||o.mode==="combined"){await le(s);let u=await ue(s);k(),me(u,n,o.mode);return}let d=l(e,"--output"),a=U(d,`sootsim-${M()}.${o.format}`);E(W(a),{recursive:!0});let m=await s.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"});m.ok||(console.error(` stop failed: ${m.error??"unknown error"}`),k(),process.exit(1)),m.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),k(),process.exit(1)),await ne(s,a),k(),console.log(` saved: ${a} (${G(m.size)})`)}finally{s.close()}}async function q(e){await L(e,'typeof window.SootSim?.bridges?.startRecording === "function" && typeof window.SootSim?.bridges?.stopRecording === "function"')||(console.error(" SootSim.bridges.startRecording missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function ae(e,r){await L(e,`(() => {
|
|
52
52
|
const fn = window.__sootsimCaptureBundle
|
|
53
53
|
if (typeof fn !== 'function') return false
|
|
54
54
|
const snap = fn()
|
|
@@ -56,7 +56,7 @@ import{a as P}from"./chunk-ST37ZL42.js";import"./chunk-H26B2F6V.js";import{d as
|
|
|
56
56
|
})()`)||(console.error(` --mode ${r} needs a guest app bundle to upload to /preview/<id>,
|
|
57
57
|
but this sim has no bundle loaded (a built-in shell screen like
|
|
58
58
|
photos/settings/home has none). open a metro/guest app first, or
|
|
59
|
-
use \`--mode video\` for a local screen recording with no upload.`),process.exit(1))}async function de(e,r,o){let i=Z();if(!i)return;let t=i.kind==="api-key"?i.secret:i.token,n=
|
|
59
|
+
use \`--mode video\` for a local screen recording with no upload.`),process.exit(1))}async function de(e,r,o){let i=Z();if(!i)return;let t=i.kind==="api-key"?i.secret:i.token,n=ke(),s=i.kind==="github"?{...ee(i),owner:o?.owner,repo:o?.repo,...n}:o?{owner:o.owner,repo:o.repo,...n}:null,d=r?r.replace(/\/$/,""):null;await e.send({type:"evaluate",code:`(() => {
|
|
60
60
|
const set = window.SootSim && window.SootSim.bridges && window.SootSim.bridges.setSession
|
|
61
61
|
if (typeof set !== 'function') return false
|
|
62
62
|
set({ token: ${JSON.stringify(t)}, user: null })
|
|
@@ -67,4 +67,4 @@ import{a as P}from"./chunk-ST37ZL42.js";import"./chunk-H26B2F6V.js";import{d as
|
|
|
67
67
|
})()`})||(console.error(" SootSim.bridges.setSession missing \u2014 this sim is running an engine\n build without CLI-injected preview auth. reload the sim or open a\n fresh one (`sootsim open --new`); if it persists, update sootsim."),process.exit(1))}async function ce(e,r,o){let i=o?JSON.stringify(o):"undefined";return await e.send({type:"evaluate",code:`window.SootSim.bridges.startRecording(${JSON.stringify(r)}, ${i}, { skipEntitlement: true })`})===!0?{ok:!0,error:null}:{ok:!1,error:await e.send({type:"evaluate",code:"(window.SootSim?.bridges?.getRecordingStartError?.() ?? null)"}).catch(()=>null)??null}}async function le(e){await e.send({type:"evaluate",code:"void window.SootSim.bridges.stopRecording()"})}async function ue(e){let r=Date.now()+z;for(;Date.now()<r;){let o=await e.send({type:"evaluate",code:"(() => { const s = window.SootSim?.bridges?.getRecordingState?.(); return s ? { state: s.state, lastUpload: s.lastUpload, uploadError: s.uploadError } : null })()"});if(o&&o.state==="idle"){if(o.uploadError)return{uploadError:o.uploadError};if(o.lastUpload?.previewUrl)return{previewUrl:o.lastUpload.previewUrl,eventCount:o.lastUpload.eventCount}}await new Promise(i=>setTimeout(i,300))}return{uploadError:`upload did not settle within ${z/1e3}s`}}function me(e,r,o){e.uploadError&&(console.error(` upload failed: ${e.uploadError}`),process.exit(1)),e.previewUrl||(console.error(" upload returned no preview URL"),process.exit(1)),console.log(` preview: ${e.previewUrl}`),console.log(` note: this URL is content-addressed \u2014 re-recording the same bundle
|
|
68
68
|
replaces this capture at the same /preview/<id>.`),(o==="live"||o==="combined")&&typeof e.eventCount=="number"&&console.log(` captured ${e.eventCount} event${e.eventCount===1?"":"s"}`),(o==="live"||o==="combined")&&e.eventCount===0&&console.log(o==="combined"?` note: this combined recording captured no events \u2014 the Live tab has
|
|
69
69
|
nothing to replay. Video will play the captured screen recording.`:` note: this live recording captured no events \u2014 the preview has nothing
|
|
70
|
-
to replay and will boot a fresh interactive session instead.`),r&&X(e.previewUrl)}export{Be as extToFormat,
|
|
70
|
+
to replay and will boot a fresh interactive session instead.`),r&&X(e.previewUrl)}export{Be as extToFormat,Te as resolveFormat,qe as runRecord,l as valueOf};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b}from"./chunk-MY7FJWXJ.js";import"./chunk-5JOGV2HQ.js";import"./chunk-MAZZU3SS.js";import"./chunk-XNK3USYL.js";import"./chunk-IDVRZVWW.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";export{b as formatReleaseEntry,a as runRuntime};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-IDVRZVWW.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";export{a as DEFAULT_RUNTIME_CDN_ORIGIN,b as RUNTIME_CDN_ORIGIN_ENV,c as RUNTIME_CHANNEL_ENV,n as checkRuntimeUpToDate,h as fetchRuntimeManifest,j as fetchRuntimeReleases,l as installRuntime,d as resolveRuntimeCdnOrigin,e as resolveRuntimeChannel,k as resolveRuntimeVersion,f as runtimeManifestUrl,i as runtimeReleasesUrl,g as runtimeTarballUrl,m as updateRuntimeToLatest};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as S}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as S}from"./chunk-TJIHZA53.js";import"./chunk-B6A7ZJMT.js";import{a as b}from"./chunk-FZWSY6PU.js";import{c as g,d as w,e as y,f as v,h as x}from"./chunk-5JOGV2HQ.js";import"./chunk-MAZZU3SS.js";import"./chunk-5FLC7DTX.js";import"./chunk-XNK3USYL.js";import"./chunk-C6XY53D4.js";import{g as m}from"./chunk-BUPUMQEH.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";import{mkdirSync as A,writeFileSync as R}from"fs";import{dirname as E,resolve as F}from"path";async function J(t,o){let e=U(t);(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim screenshot \u2014 capture the canvas as a PNG
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as o}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as o}from"./chunk-TCWXT3TN.js";import"./chunk-5JOGV2HQ.js";import"./chunk-MAZZU3SS.js";import"./chunk-XNK3USYL.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";async function n(e,s){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim screenshot-mode \u2014 toggle the screenshot-mode chrome overlay
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as q}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as q}from"./chunk-TNN276C7.js";import{b as L}from"./chunk-TJIHZA53.js";import"./chunk-B6A7ZJMT.js";import"./chunk-ZFPDGGM2.js";import"./chunk-J53MOMRD.js";import{d as U,e as K}from"./chunk-OQ4PEGZM.js";import{b as H}from"./chunk-R3K7I6OA.js";import"./chunk-VNPT6T3W.js";import"./chunk-UUUBY2MO.js";import"./chunk-PIVH54LG.js";import"./chunk-IDXOP3UM.js";import"./chunk-2IFYJBKM.js";import"./chunk-5JOGV2HQ.js";import"./chunk-EUW6WLU3.js";import"./chunk-FOLKDVFM.js";import"./chunk-NL5LGUY6.js";import"./chunk-AF3ZSUJT.js";import"./chunk-QH3FJHUA.js";import"./chunk-UJ4B2V2Y.js";import"./chunk-MAZZU3SS.js";import"./chunk-LEPF5QPE.js";import"./chunk-JT47D7AS.js";import"./chunk-5FLC7DTX.js";import"./chunk-CAHWX2CJ.js";import"./chunk-XNK3USYL.js";import"./chunk-C6XY53D4.js";import{a as y,b as A,c as E,d as O,e as v,f as C,g as _}from"./chunk-BUPUMQEH.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";import{mkdirSync as I,readFileSync as ye,writeFileSync as se}from"fs";import{tmpdir as We}from"os";import F from"path";import{mkdirSync as W,readFileSync as ae,writeFileSync as X}from"fs";import B from"path";function V(e){return e.replace(/\\/g,"/").replace(/\.png$/i,"").trim().split("/").filter(Boolean).join("--").replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"slide"}function T(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function ce(e){let t=e.trim();return/^#[0-9a-f]{3}$/i.test(t)?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t}function D(e,t){let o=ce(e),i=Math.max(0,Math.min(1,t)),n=o.match(/^#([0-9a-f]{6})$/i);if(n){let s=n[1],r=Number.parseInt(s.slice(0,2),16),a=Number.parseInt(s.slice(2,4),16),c=Number.parseInt(s.slice(4,6),16);return`rgba(${r}, ${a}, ${c}, ${i})`}return o.startsWith("rgb(")?o.replace(/^rgb\((.+)\)$/i,`rgba($1, ${i})`):o}function le(e){if(e.type==="solid")return e.color||"#000000";let t=e.direction??180,o=e.stops?.map(i=>`${i.color} ${i.offset}%`).join(", ")||"#000000 0%, #111111 100%";return`linear-gradient(${t}deg, ${o})`}function pe(e){let t=e.glow;return t?`radial-gradient(circle at 50% 24%, ${D(t,.46)} 0%, ${D(t,.2)} 24%, rgba(0,0,0,0) 62%)`:"none"}function R(e){switch(e){case"tilted-left":return"perspective(2400px) rotateY(10deg) rotateZ(-2deg)";case"tilted-right":return"perspective(2400px) rotateY(-10deg) rotateZ(2deg)";case"cut-bottom":return"translateY(10%) scale(1.08)";case"cut-top":return"translateY(-16%) scale(1.08)";case"straight":default:return"none"}}function G(...e){let t=e.map(o=>o.trim()).filter(o=>o.length>0&&o!=="none");return t.length>0?t.join(" "):"none"}function j(e){let t=D(e.color,e.opacity),o=D(e.color,e.opacity*.52);return`drop-shadow(0 34px ${e.spread}px ${o}) drop-shadow(0 0 ${e.blur}px ${t})`}function Y(e,t){return!t.glow||e.color&&e.color!==y.color?e:{...e,color:t.glow}}function ue(e,t){if(e==="editorial-left"){let n=Math.round(t.height*.056),s=Math.round(t.height*.022);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.12)}px`,`left:${Math.round(t.width*.085)}px`,`width:${Math.round(t.width*.42)}px`,"text-align:left","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.92;`,subStyle:`font-size:${s}px;line-height:1.36;max-width:${Math.round(t.width*.36)}px;`,eyebrowStyle:"align-items:flex-start;",deviceStyle:(r,a,c)=>{let p=Math.round(t.width*.68*(a.scale??r.scale)),l=Math.round(t.height*(.03+r.offsetY+(a.offsetY??0))),d=a.pose||r.pose||"tilted-right",h=Y(r.shadow,c);return["position:absolute",`top:${Math.round(t.height*.18)+l}px`,`left:${Math.round(t.width*.56)}px`,`width:${p}px`,"transform-origin:center center",`transform:${R(d)}`,`filter:${j(h)}`,"z-index:2"].join(";")}}}if(e==="minimal-bottom"){let n=Math.round(t.height*.041),s=Math.round(t.height*.019);return{copyStyle:["position:absolute",`left:${Math.round(t.width*.12)}px`,`right:${Math.round(t.width*.12)}px`,`bottom:${Math.round(t.height*.085)}px`,"text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.96;`,subStyle:`font-size:${s}px;line-height:1.34;max-width:${Math.round(t.width*.56)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(r,a,c)=>{let p=Math.round(t.width*.84*(a.scale??r.scale)),l=Math.round(t.height*(r.offsetY+(a.offsetY??0))),d=a.pose||r.pose,h=Y(r.shadow,c);return["position:absolute",`top:${Math.round(t.height*.075)+l}px`,"left:50%",`width:${p}px`,"transform-origin:center center",`transform:${G("translateX(-50%)",R(d))}`,`filter:${j(h)}`,"z-index:2"].join(";")}}}let o=Math.round(t.height*.04),i=Math.round(t.height*.019);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.084)}px`,"left:50%",`width:${Math.round(t.width*.88)}px`,"transform:translateX(-50%)","text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${o}px;line-height:0.92;`,subStyle:`font-size:${i}px;line-height:1.34;max-width:${Math.round(t.width*.6)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(n,s,r)=>{let a=t.name==="ipad-13"?.54:.64,c=Math.round(t.width*a*(s.scale??n.scale)),p=Math.round(t.height*(n.offsetY+(s.offsetY??0))),l=s.pose||n.pose,d=Y(n.shadow,r);return["position:absolute",`top:${Math.round(t.height*(t.name==="ipad-13"?.25:.28))+p}px`,"left:50%",`width:${c}px`,"transform-origin:center top",`transform:${G("translateX(-50%)",R(l))}`,`filter:${j(d)}`,"z-index:2"].join(";")}}}function de({canvas:e,compose:t,slide:o,imageDataUrl:i}){let n=o.background??t.background,s=ue(t.text.preset,e),r=t.text.preset!=="none"&&!!(o.eyebrow||o.headline||o.subheadline),a=s.deviceStyle(t.frame,o,n),c=o.headline?`<div style="font-weight:780;white-space:pre-line;text-wrap:balance;${s.titleStyle}">${T(o.headline)}</div>`:"",p=o.subheadline?`<div style="margin-top:${Math.round(e.height*.018)}px;color:${t.text.subColor};white-space:pre-line;text-wrap:balance;${s.subStyle}">${T(o.subheadline)}</div>`:"",l=o.eyebrow?`<div style="display:flex;${s.eyebrowStyle}margin-bottom:${Math.round(e.height*.016)}px;"><div style="font-size:${Math.round(e.height*.014)}px;font-weight:700;letter-spacing:0.18em;text-transform:uppercase;color:${t.text.eyebrowColor};">${T(o.eyebrow)}</div></div>`:"";return`<!doctype html>
|
|
3
3
|
<html>
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8" />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as oe,c as H,d as ae,e as F,f as ce,h as de,i as C,j as le,k as ue,l as pe,p as me,s as T,t as he,u as fe,v as ge,w as Se}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as oe,c as H,d as ae,e as F,f as ce,h as de,i as C,j as le,k as ue,l as pe,p as me,s as T,t as he,u as fe,v as ge,w as Se}from"./chunk-JQGIMV75.js";import"./chunk-FZSEG2L4.js";import{a as se}from"./chunk-J53MOMRD.js";import"./chunk-OQ4PEGZM.js";import{e as R}from"./chunk-UUUBY2MO.js";import"./chunk-2IFYJBKM.js";import"./chunk-5JOGV2HQ.js";import"./chunk-EUW6WLU3.js";import"./chunk-QH3FJHUA.js";import{d as re}from"./chunk-UJ4B2V2Y.js";import"./chunk-MAZZU3SS.js";import{a as Z,b as Q}from"./chunk-LEPF5QPE.js";import"./chunk-JT47D7AS.js";import{a as te,b as ie}from"./chunk-XNK3USYL.js";import{a as ee}from"./chunk-MK4D3LRG.js";import{m as ne}from"./chunk-IDVRZVWW.js";import{A as P,B as K,C as V,D,F as G,G as q,H as z,I as X,J as Y,K as U,h as j,i as $,w as N,x as J}from"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";import{spawn as Qe}from"child_process";import k from"fs";import{createServer as et}from"http";import y from"path";import{WebSocket as h,WebSocketServer as tt}from"ws";import ye from"node:fs";import _ from"node:path";var O=1;function _e(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_POSTGRES||7432),Number(process.env.VITE_PORT_R2||9500)].filter(o=>Number.isFinite(o)&&o>0)}var x=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;opts;constructor(e={}){this.opts=e}registerSocket(e){this.allSockets.add(e)}unregisterSocket(e){let t=this.sessionsBySocket.get(e);if(t){for(let i of t)this.decrementSubscription(i);this.sessionsBySocket.delete(e)}this.allSockets.delete(e)}async handleMessage(e,t){let i=t?.type;if(typeof i!="string"||!i.startsWith("agent:"))return!1;let s=t.id;try{let n=await this.dispatch(e,i,t);this.respond(e,s,n)}catch(n){n instanceof T?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await pe()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
|
|
3
3
|
`)}}close(){for(let e of this.subscriptions.values())try{e.unsubscribe()}catch{}this.subscriptions.clear(),this.sessionsBySocket.clear(),this.allSockets.clear()}async dispatch(e,t,i){switch(t){case"agent:list-projects":return F();case"agent:upsert-project":return H(i.input??{});case"agent:delete-project":return de(String(i.projectId)),{ok:!0};case"agent:auto-attach-for-url":return this.autoAttachForUrl(i.input??{});case"agent:list-sessions":return le(i.projectId?String(i.projectId):void 0);case"agent:start-session":return this.doStartSession(i.input??{});case"agent:send-prompt":{let n=String(i.sessionId),a=C(n);if(!a)throw new T("NO_SESSION",`no session: ${n}`);let r=this.normalizePromptEnvelope(i);return await fe(n,r),this.notePromptAccepted(n,r,a.status==="working")}case"agent:end-session":this.dropSessionFanout(String(i.sessionId)),await ge(String(i.sessionId));let s=C(String(i.sessionId));return s&&this.broadcastSessionStatus(s),{ok:!0};case"agent:get-transcript":return this.getTranscript(String(i.sessionId));case"agent:get-paths":return this.getPaths();case"agent:subscribe-events":return this.subscribeSocket(e,String(i.sessionId));case"agent:unsubscribe-events":return this.unsubscribeSocket(e,String(i.sessionId));default:throw new T("UNKNOWN_AGENT_MSG",`unknown agent message: ${t}`)}}async doStartSession(e){if(!ae(e.projectId))throw new T("NO_PROJECT",`no project: ${e.projectId}`);let i=await he(e);return this.broadcastSessionStatus(i.session),i}async autoAttachForUrl(e){let t=e.bundleUrl??"",i=(()=>{try{return new URL(t).port||null}catch{return null}})();if(!i)return{project:null};let s=this.opts.getExcludePorts?.()??_e(),a=(await R({excludePorts:s})).find(d=>String(d.port)===i);if(!a||!a.cwd)return{project:null};let r=F().find(d=>d.cwd===a.cwd)??null,c=Array.from(new Set([...r?.knownBundleUrls??[],a.bundleUrl,t]));return{project:H({cwd:a.cwd,name:a.projectName??_.basename(a.cwd),preferredProvider:e.provider??r?.preferredProvider,sourceRoots:r?.sourceRoots??[a.cwd],knownBundleUrls:c,framework:r?.framework??Oe(a.framework),bundleId:a.bundleId??r?.bundleId})}}getTranscript(e){let t=me(e);return ye.existsSync(t)?ye.readFileSync(t,"utf8"):{error:"transcript not found",code:"NO_TRANSCRIPT"}}getPaths(){let e=oe();return{userDataDir:e,storeFile:_.join(e,"attached-projects.json"),sessionsDir:_.join(e,"sessions"),transcriptsDir:_.join(e,"transcripts")}}subscribeSocket(e,t){let i=this.sessionsBySocket.get(e);if(i||(i=new Set,this.sessionsBySocket.set(e,i)),i.has(t))return{ok:!0,refCount:this.subscriptions.get(t)?.refCount??1};i.add(t);let s=this.subscriptions.get(t);if(s)return s.refCount++,{ok:!0,refCount:s.refCount};let n=Se(t,a=>{let r=this.coalescePromptEcho(t,a);if(r&&(this.applySessionEvent(t,r),this.fanOutEvent(t,r)),a.type==="turn-completed"){let c=C(t);if(c)try{ce(c.projectId,{usd:a.costUsd,ts:a.ts})}catch(l){process.stderr.write(`[sootsim-agent] recordTurnTelemetry failed: ${l instanceof Error?l.message:String(l)}
|
|
4
4
|
`)}}});return this.subscriptions.set(t,{unsubscribe:n,refCount:1}),{ok:!0,refCount:1}}unsubscribeSocket(e,t){let i=this.sessionsBySocket.get(e);return!i||!i.has(t)?{ok:!0,refCount:0}:(i.delete(t),this.decrementSubscription(t))}decrementSubscription(e){let t=this.subscriptions.get(e);if(!t)return{ok:!0,refCount:0};if(t.refCount--,t.refCount<=0){try{t.unsubscribe()}catch{}return this.subscriptions.delete(e),{ok:!0,refCount:0}}return{ok:!0,refCount:t.refCount}}dropSessionFanout(e){let t=this.subscriptions.get(e);if(t){try{t.unsubscribe()}catch{}this.subscriptions.delete(e)}for(let i of this.sessionsBySocket.values())i.delete(e);this.clearPromptTracking(e)}normalizePromptEnvelope(e){if(e?.prompt&&typeof e.prompt=="object"){let t=e.prompt;return{text:String(t.text??""),...typeof t.displayText=="string"?{displayText:t.displayText}:{},...typeof t.inspectSummary=="string"?{inspectSummary:t.inspectSummary}:{},...typeof t.inspectTrace=="string"?{inspectTrace:t.inspectTrace}:{}}}return{text:String(e?.text??""),...typeof e?.displayText=="string"?{displayText:e.displayText}:{},...typeof e?.inspectSummary=="string"?{inspectSummary:e.inspectSummary}:{},...typeof e?.inspectTrace=="string"?{inspectTrace:e.inspectTrace}:{}}}notePromptAccepted(e,t,i){let s=Date.now(),n=this.pendingPromptEchoes.get(e)??[];n.push({sentAt:s}),this.pendingPromptEchoes.set(e,n);let a=Math.max(this.pendingTurns.get(e)??0,i?1:0)+1;this.pendingTurns.set(e,a);let r=t.displayText??t.text;return this.patchSession(e,{lastPrompt:r,status:"working",needsAttention:!1}),this.fanOutEvent(e,{type:"prompt-received",text:r,...t.inspectSummary?{inspectSummary:t.inspectSummary}:{},...t.inspectTrace?{inspectTrace:t.inspectTrace}:{},ts:s}),{ok:!0,queued:a>1,pendingTurns:a,queueDepth:Math.max(0,a-1)}}applySessionEvent(e,t){switch(t.type){case"prompt-received":case"turn-started":this.patchSession(e,{status:"working",needsAttention:!1});return;case"turn-completed":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"idle",needsAttention:!1,lastTurnFiles:t.filesTouched,currentlyEditing:void 0});return}case"approval-needed":this.patchSession(e,{status:"needs-attention",needsAttention:!0});return;case"error":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"needs-attention",needsAttention:i<=0,currentlyEditing:void 0});return}case"exited":this.clearPromptTracking(e),this.patchSession(e,{status:"ended",needsAttention:!1,wrapperPid:void 0,currentlyEditing:void 0});return;case"ready":case"turn-reasoning":case"turn-message":case"turn-plan":case"tool-call":case"file-edited":case"file-diff-delta":return}}patchSession(e,t){ue(e,t);let i=C(e);i&&this.broadcastSessionStatus(i)}coalescePromptEcho(e,t){if(t.type!=="prompt-received")return t;let i=this.pendingPromptEchoes.get(e);if(!i||i.length===0)return t;for(;i.length>0&&Date.now()-i[0].sentAt>15e3;)i.shift();return i.length===0?(this.pendingPromptEchoes.delete(e),t):(i.shift(),i.length===0?this.pendingPromptEchoes.delete(e):this.pendingPromptEchoes.set(e,i),null)}consumeSettledTurn(e){let t=Math.max(0,(this.pendingTurns.get(e)??1)-1);return t>0?this.pendingTurns.set(e,t):this.pendingTurns.delete(e),t}clearPromptTracking(e){this.pendingPromptEchoes.delete(e),this.pendingTurns.delete(e)}fanOutEvent(e,t){let i=JSON.stringify({type:"agent:event",sessionId:e,event:t});for(let[s,n]of this.sessionsBySocket)if(n.has(e)&&s.readyState===O)try{s.send(i)}catch{}}broadcastSessionStatus(e){let t=JSON.stringify({type:"agent:session-status",session:e});for(let i of this.allSockets)if(i.readyState===O)try{i.send(t)}catch{}}respond(e,t,i){if(e.readyState===O)try{e.send(JSON.stringify({id:t,result:i}))}catch{}}respondError(e,t,i,s){if(e.readyState===O)try{e.send(JSON.stringify({id:t,error:i,...s?{code:s}:{}}))}catch{}}};function Oe(o){return o==="expo"?"expo":o==="one"||o==="vxrn"?"one":"unknown"}import Be from"http";import Me from"https";var W="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36",xe=[{hostSuffix:"uniswap.org",headers:{origin:"https://app.uniswap.org",referer:"https://app.uniswap.org/"},suppressBrowserUserAgent:!0}];function Le(o){let e=o.toLowerCase();for(let t of xe)if(e===t.hostSuffix||e.endsWith(`.${t.hostSuffix}`))return t}function be(o){let e=Le(o.hostname);return{"accept-encoding":"identity",...e?.suppressBrowserUserAgent?{}:{"user-agent":W},...e?.headers}}var Ne=new Set(["host","origin","referer","user-agent","accept-encoding","cookie","connection","keep-alive","transfer-encoding","upgrade","content-length","sec-fetch-site","sec-fetch-mode","sec-fetch-dest","sec-ch-ua","sec-ch-ua-mobile","sec-ch-ua-platform"]),De={"access-control-allow-origin":"*","access-control-allow-methods":"GET,POST,PUT,DELETE,PATCH,OPTIONS","access-control-allow-headers":"*","access-control-expose-headers":"*","access-control-max-age":"3600"},Ue=new Set(["host","origin","referer","sec-fetch-site","sec-fetch-mode","sec-fetch-dest"]);function E(o){for(let[e,t]of Object.entries(De))o.setHeader(e,t)}function He(o,e){let t=[],i=e;i?.code&&t.push(i.code),i?.message&&t.push(i.message),i?.cause?.code&&t.push(i.cause.code),i?.cause?.message&&t.push(i.cause.message);let n=[...new Set(t.filter(Boolean))].join(" | ")||String(e);return o.includes("stored-in-.env.local")?`${n} | upstream url still contains placeholder env values`:n}function Fe(o){let t=(Array.isArray(o)?o[0]:o)?.split(";",1)[0]?.trim().toLowerCase();return t?t.startsWith("text/")||t==="application/json"||t.endsWith("+json")||t==="application/x-www-form-urlencoded"||t==="application/xml"||t.endsWith("+xml")||t==="application/javascript"||t==="application/graphql":!1}function We(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(Ne.has(i.toLowerCase())||(t[i]=Array.isArray(s)?s.join(", "):s));return Object.assign(t,e?be(e):{"user-agent":W}),t}function je(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(Ue.has(i.toLowerCase())||(t[i]=s));return t.host=e.host,t.origin=e.origin,t.referer=`${e.origin}/`,t}function ve(o){return o?.startsWith("/__fetch-proxy?")||o?.startsWith("/__proxy?")||!1}function we(o){return o?!!(o.startsWith("/__app-api?")||o.startsWith("/__app-api/")):!1}async function Ae(o,e){if(o.method==="OPTIONS"){E(e),e.writeHead(204),e.end();return}let i=new URLSearchParams((o.url||"").split("?")[1]||"").get("url");if(!i){E(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("missing url param");return}let s;try{s=new URL(i)}catch{E(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("invalid url param");return}let n=We(o.headers,s),a;if(o.method!=="GET"&&o.method!=="HEAD"){let d=[];for await(let u of o)d.push(Buffer.isBuffer(u)?u:Buffer.from(u));if(d.length>0){let u=Buffer.concat(d);a=Fe(o.headers["content-type"])?u.toString("utf8"):u}}let r;try{r=await fetch(s.href,{method:o.method,headers:n,body:a,redirect:"follow"})}catch(d){E(e),e.writeHead(502,{"Content-Type":"text/plain"}),e.end(`fetch proxy error: ${He(s.href,d)}`);return}r.headers.forEach((d,u)=>{let p=u.toLowerCase();p==="content-encoding"||p==="transfer-encoding"||p==="content-length"||p==="set-cookie"||p.startsWith("access-control-")||e.setHeader(u,d)}),E(e);let c=r.headers.getSetCookie?.()??[];c.length>0&&e.setHeader("x-sootsim-set-cookie",c.join(", ")),e.statusCode=r.status;let l=Buffer.from(await r.arrayBuffer());e.end(l)}function ke(o,e){let t=o.url||"",i="",s="";if(t.startsWith("/__app-api?")){let l=new URL(t,"http://sootsim.local");i=l.searchParams.get("path")||"",s=l.searchParams.get("origin")?.trim()||""}else if(t.startsWith("/__app-api/"))i=t.slice(10);else return!1;if(!s)return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: missing origin query param"),!0;if(o.method==="OPTIONS")return e.writeHead(204,{"Access-Control-Allow-Origin":o.headers.origin||"*","Access-Control-Allow-Methods":"GET,POST,PUT,PATCH,DELETE,OPTIONS","Access-Control-Allow-Headers":o.headers["access-control-request-headers"]||"*","Access-Control-Allow-Credentials":"true","Access-Control-Max-Age":"86400"}),e.end(),!0;let n;try{n=new URL(i,s)}catch{return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: invalid origin or path"),!0}let a=n.protocol==="https:"?Me:Be,r=je(o.headers,n),c=a.request({hostname:n.hostname,port:n.port||(n.protocol==="https:"?443:80),path:n.pathname+n.search,method:o.method,headers:r},l=>{let d=Object.keys(l.headers).filter(u=>{let p=u.toLowerCase();return!p.startsWith("access-control-")&&p!=="set-cookie"}).join(", ");e.writeHead(l.statusCode??502,{...l.headers,"access-control-allow-origin":o.headers.origin||"*","access-control-allow-credentials":"true","access-control-expose-headers":d}),l.pipe(e)});return c.on("error",l=>{e.statusCode=502,e.end(`app proxy error: ${l.message}`)}),o.pipe(c),!0}import{WebSocket as A,WebSocketServer as $e}from"ws";var Je="/__websocket-proxy",Ke=new Set(["host","connection","upgrade","transfer-encoding","content-length","sec-websocket-accept","sec-websocket-extensions","sec-websocket-key","sec-websocket-protocol","sec-websocket-version"]);function w(o,e,t){try{o.write(`HTTP/1.1 ${e} ${t}\r
|
|
5
5
|
Connection: close\r
|
|
@@ -35,6 +35,6 @@ options:
|
|
|
35
35
|
examples:
|
|
36
36
|
sootsim server
|
|
37
37
|
sootsim server --port 7668 --quiet
|
|
38
|
-
`),process.exit(0));let t=o.indexOf("--port"),i=t>=0&&o[t+1]?Number(o[t+1]):e.port??7668;Number.isNaN(i)&&(console.error(` invalid --port value: ${o[t+1]}`),process.exit(1));let s=o.includes("--quiet")||o.includes("-q");if($()){let f=j()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";if(console.error(` refusing to run a standalone sootsim daemon \u2014 ${f}.`),console.error(` the live \`bun dev\` stack already hosts the bridge on :${7668}; a`),console.error(" standalone server would shadow it on a fallback port and serve the stale"),console.error(" published runtime. set SOOTSIM_FORCE_DAEMON_INSTALL=1 to run it anyway."),Ie()){console.error(" uninstalling the persistent agent so it stops respawning here...");try{let{runDaemon:S}=await import("./daemon-
|
|
38
|
+
`),process.exit(0));let t=o.indexOf("--port"),i=t>=0&&o[t+1]?Number(o[t+1]):e.port??7668;Number.isNaN(i)&&(console.error(` invalid --port value: ${o[t+1]}`),process.exit(1));let s=o.includes("--quiet")||o.includes("-q");if($()){let f=j()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";if(console.error(` refusing to run a standalone sootsim daemon \u2014 ${f}.`),console.error(` the live \`bun dev\` stack already hosts the bridge on :${7668}; a`),console.error(" standalone server would shadow it on a fallback port and serve the stale"),console.error(" published runtime. set SOOTSIM_FORCE_DAEMON_INSTALL=1 to run it anyway."),Ie()){console.error(" uninstalling the persistent agent so it stops respawning here...");try{let{runDaemon:S}=await import("./daemon-XLZOQISP.js");await S(["uninstall"],{port:i})}catch(S){console.error(` (uninstall failed: ${S instanceof Error?S.message:String(S)})`),console.error(" run `sootsim daemon uninstall` manually to stop it.")}}process.exit(0)}let n=q();n&&z(n)&&(console.error(` a sootsim daemon is already running (pid ${n.pid}, port ${n.bridgePort})`),console.error(" stop it with 'sootsim daemon stop' first"),process.exit(1)),P();let a=await se(),r=new B({port:i,writeLockfile:!0,sootbeanOrigin:a}),c=await r.startAsync({silent:s}),l=Date.now(),d=f=>{s||process.stdout.write(`${f}
|
|
39
39
|
`)},u=new Set,p=setInterval(()=>{let f=r.listSims(),S=new Set(f.map(g=>g.id));for(let g of f)if(!u.has(g.id)){let b=g.title||g.url||g.origin||"(unknown)";d(` + ${g.id} ${b}`)}for(let g of u)S.has(g)||d(` - ${g}`);u.clear();for(let g of S)u.add(g)},500);Z({event:"daemon_heartbeat",properties:{bridge_port:c,under_daemon:Ie(),platform:process.platform,subsource:"daemon"}}),Q(),d(`sootsim bridge listening on ws://localhost:${c} (runtime http on same port)`),c!==i&&d(` (preferred port ${i} was taken \u2014 fell back to ${c})`),d(" ready for browser, electron, or headless playwright sims to connect"),d(" (ctrl-c to stop)");let m=async f=>{clearInterval(p),d(`
|
|
40
40
|
${f} received \u2014 shutting down after ${Math.round((Date.now()-l)/1e3)}s`);try{await r.close()}catch{}process.exit(0)};process.on("SIGINT",()=>m("SIGINT")),process.on("SIGTERM",()=>m("SIGTERM")),process.on("SIGHUP",()=>m("SIGHUP")),process.on("exit",()=>{try{r.removeLockfile()}catch{}}),await new Promise(()=>{})}export{$t as runServer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a}from"./chunk-3KS5W6VS.js";import"./chunk-AG4VJEME.js";import"./chunk-DSPYCLAV.js";import"./chunk-5JOGV2HQ.js";import"./chunk-MAZZU3SS.js";import"./chunk-LEPF5QPE.js";import"./chunk-JT47D7AS.js";import"./chunk-XNK3USYL.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";export{a as runSetupRepo};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-CGRV5ZGV.js";import*as l from"fs";import*as i from"path";import{fileURLToPath as f}from"url";function g(){try{let s=f(import.meta.resolve("sootsim/package.json"));return i.join(i.dirname(s),"skills")}catch{let s=i.dirname(f(import.meta.url));return i.resolve(s,"../../skills")}}var m=g();function d(s){let n=s.match(/^---\n([\s\S]*?)\n---/);if(!n)return null;let e=n[1],o=e.match(/^name:\s*(.+)$/m),r=e.match(/^description:\s*(.+)$/m);return o?{name:o[1].trim(),description:r?.[1]?.trim()||""}:null}function p(){if(!l.existsSync(m))return[];let s=l.readdirSync(m).filter(e=>e.endsWith(".md")),n=[];for(let e of s){let o=l.readFileSync(i.join(m,e),"utf8"),r=d(o);r&&n.push({...r,filename:e})}return n}function u(s,n){let e=i.join(m,s.filename),o=i.join(n,s.filename);l.copyFileSync(e,o),console.log(` copied ${s.name} \u2192 ${o}`)}async function h(s){if(s.includes("--list")||s.includes("-l")||s.length===0){let t=p();if(t.length===0){console.log(" no skills found");return}console.log(`
|
|
3
3
|
available skills:
|
|
4
4
|
`);for(let c of t)console.log(` ${c.name}`),console.log(` ${c.description}
|
|
5
5
|
`);console.log(" usage: sootsim skills <target-dir> [skill-name...]"),console.log(" example: sootsim skills ./my-project"),console.log(` example: sootsim skills ./my-project debug perf
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{c as S,e as y,g as v,h as b,i as u}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as S,e as y,g as v,h as b,i as u}from"./chunk-5JOGV2HQ.js";import"./chunk-MAZZU3SS.js";import"./chunk-XNK3USYL.js";import"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";import{mkdirSync as $,writeFileSync as x}from"node:fs";import{dirname as k,isAbsolute as B,join as C,resolve as E}from"node:path";var z=`
|
|
3
3
|
sootsim slides \u2014 compose App Store screenshots in the live sim
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.156 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-5JOGV2HQ.js";import{d as _}from"./chunk-UJ4B2V2Y.js";import"./chunk-MAZZU3SS.js";import"./chunk-XNK3USYL.js";import{A as O,B as x,G as b,H as v,k as D}from"./chunk-734YKCKK.js";import"./chunk-CGRV5ZGV.js";import{spawn as N}from"child_process";import{existsSync as F}from"fs";import{WebSocket as B}from"ws";var T=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];var A={reset:"\x1B[0m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",cyan:"\x1B[36m",bold:"\x1B[1m"};function k(){return process.stderr.isTTY===!0}function u(t,e){return k()?`${A[t]}${e}${A.reset}`:e}function L(t,e){switch(t){case"pending":return u("dim","\xB7");case"running":return u("cyan",e);case"done":return u("green","\u2713");case"fail":return u("red","\u2717");case"skip":return u("yellow","\u25CB")}}var E=class{constructor(e,s){this.stepper=e;this.data=s}start(e){this.data.state="running",e!==void 0&&(this.data.detail=e),this.stepper.render()}update(e){this.data.detail=e,this.stepper.render()}done(e){this.data.state="done",e!==void 0&&(this.data.detail=e),this.stepper.render()}fail(e){this.data.state="fail",e!==void 0&&(this.data.detail=e),this.stepper.render()}skip(e){this.data.state="skip",e!==void 0&&(this.data.detail=e),this.stepper.render()}},S=class{steps=[];bannerText="";frame=0;timer=null;lastLineCount=0;paused=!1;finished=!1;banner(e){this.bannerText=e}add(e){let s={label:e,state:"pending"};return this.steps.push(s),new E(this,s)}render(){this.paused||this.finished||(this.startSpinner(),this.draw())}pause(){this.paused||(this.paused=!0,this.stopSpinner(),this.eraseRendered(),this.lastLineCount=0)}resume(){this.paused&&(this.paused=!1,this.draw(),this.startSpinner())}finish(){this.finished||(this.finished=!0,this.stopSpinner(),this.draw())}startSpinner(){this.timer||!k()||this.steps.some(e=>e.state==="running")&&(this.timer=setInterval(()=>{this.frame=(this.frame+1)%T.length,this.draw()},80),this.timer?.unref?.())}stopSpinner(){this.timer&&(clearInterval(this.timer),this.timer=null)}draw(){if(!k()){this.drawForwardOnly();return}this.eraseRendered();let e=[];this.bannerText&&(e.push(u("bold",this.bannerText)),e.push(""));let s=T[this.frame],r=Math.max(...this.steps.map(i=>i.label.length),0);for(let i of this.steps){let n=L(i.state,s),c=i.label.padEnd(r),y=i.detail?` ${u("dim",i.detail)}`:"";e.push(` ${n} ${c}${y}`)}process.stderr.write(e.join(`
|
|
3
3
|
`)+`
|
|
4
4
|
`),this.lastLineCount=e.length,this.steps.some(i=>i.state==="running")||this.stopSpinner()}bannerPrinted=!1;lastEmitted=new Map;drawForwardOnly(){this.bannerText&&!this.bannerPrinted&&(process.stderr.write(this.bannerText+`
|
|
5
5
|
|
|
@@ -18,6 +18,6 @@ usage:
|
|
|
18
18
|
options:
|
|
19
19
|
--port <n> bridge port (default: ${7668})
|
|
20
20
|
--no-open don't open the browser at the end
|
|
21
|
-
`);return}O();let s=t.indexOf("--port"),r=s>=0&&t[s+1]?Number(t[s+1]):e.port??7668;Number.isNaN(r)&&(console.error(` invalid --port value: ${t[s+1]}`),process.exit(1));let i=t.includes("--no-open"),n=new S,{IS_BETA:c,BETA_TAGLINE:y}=await import("./beta-
|
|
21
|
+
`);return}O();let s=t.indexOf("--port"),r=s>=0&&t[s+1]?Number(t[s+1]):e.port??7668;Number.isNaN(r)&&(console.error(` invalid --port value: ${t[s+1]}`),process.exit(1));let i=t.includes("--no-open"),n=new S,{IS_BETA:c,BETA_TAGLINE:y}=await import("./beta-EWOOAHUB.js");n.banner(c?`sootsim \u2014 ${y}`:"sootsim \u2014 starting up");let m=n.add("runtime"),d=n.add("server"),$=n.add("ready"),f=n.add("open");n.render();let g=null;try{m.start("checking\u2026");let a=x();if(a&&F(D(a))){g=a;let l=await q();m.done(l?`v${a} \u2014 v${l} available, run \`sootsim upgrade\``:`v${a}`)}else{m.start("downloading engine (~6 MB)\u2026");let{runRuntime:l}=await import("./runtime-DKE54MC6.js");n.pause(),await l(["install"],{}),n.resume(),g=x(),m.done(g?`v${g}`:"installed")}}catch(a){m.fail(h(a)),n.finish(),process.exit(1)}let o=r,p="standalone";try{d.start("checking\u2026");let a=b();if(v(a)&&await P(a.bridgePort,800))o=a.bridgePort,p="daemon-existing",d.done(`already running (port ${o})`);else if(process.platform==="darwin"||process.platform==="linux"){d.start("registering background daemon\u2026");try{let{daemonInstall:l}=await import("./daemon-XLZOQISP.js");n.pause(),await l({port:r,force:!0}),n.resume();let R=b();o=v(R)?R.bridgePort:r,p="daemon-installed",d.done(`daemon registered (port ${o})`)}catch(l){n.resume(),d.start("daemon unavailable, starting standalone server\u2026"),o=await C(r),p="standalone",d.done(`standalone (port ${o}) \u2014 ${h(l)}`)}}else d.start("starting standalone server\u2026"),o=await C(r),p="standalone",d.done(`standalone (port ${o})`)}catch(a){d.fail(h(a)),n.finish(),process.exit(1)}try{if($.start("waiting for bridge\u2026"),!await V(o,U))throw new Error(`bridge never came online on port ${o}`);$.done(`ws://localhost:${o}`)}catch(a){$.fail(h(a)),n.finish(),process.exit(1)}let w=`http://localhost:${o}/`;if(i){f.skip(w),n.finish();return}try{f.start("launching browser\u2026"),await _(w),f.done(w)}catch(a){f.skip(`${w} (open it manually \u2014 ${h(a)})`)}n.finish(),p==="standalone"?(console.log(`
|
|
22
22
|
running in standalone mode. sootsim will exit when this process does.
|
|
23
|
-
press ctrl-c to stop.`),await new Promise(()=>{})):p==="daemon-installed"&&console.log("\n installed as a background daemon \u2014 it'll restart on login.\n manage it with `sootsim daemon status / restart / uninstall`.")}function P(t,e){return new Promise(s=>{let r=new B(`ws://127.0.0.1:${t}`,{handshakeTimeout:e}),i=!1,n=c=>{if(!i){i=!0;try{r.close()}catch{}s(c)}};r.once("open",()=>n(!0)),r.once("error",()=>n(!1)),setTimeout(()=>n(!1),e)})}async function V(t,e){let s=Date.now()+e;for(;Date.now()<s;){if(await P(t,500))return!0;await new Promise(r=>setTimeout(r,200))}return!1}async function C(t){let e=W();N(e,["server","--quiet","--port",String(t)],{detached:!0,stdio:"ignore",env:process.env}).unref();let r=Date.now()+I;for(;Date.now()<r;){let i=b();if(v(i))return i.bridgePort;await new Promise(n=>setTimeout(n,150))}if(await P(t,800))return t;throw new Error(`standalone server didn't come online within ${Math.round(I/1e3)}s`)}function W(){let t=process.argv[1];return t&&F(t)?t:"sootsim"}function h(t){return t instanceof Error?t.message:String(t)}async function q(){try{let{checkRuntimeUpToDate:t}=await import("./runtime-delivery-
|
|
23
|
+
press ctrl-c to stop.`),await new Promise(()=>{})):p==="daemon-installed"&&console.log("\n installed as a background daemon \u2014 it'll restart on login.\n manage it with `sootsim daemon status / restart / uninstall`.")}function P(t,e){return new Promise(s=>{let r=new B(`ws://127.0.0.1:${t}`,{handshakeTimeout:e}),i=!1,n=c=>{if(!i){i=!0;try{r.close()}catch{}s(c)}};r.once("open",()=>n(!0)),r.once("error",()=>n(!1)),setTimeout(()=>n(!1),e)})}async function V(t,e){let s=Date.now()+e;for(;Date.now()<s;){if(await P(t,500))return!0;await new Promise(r=>setTimeout(r,200))}return!1}async function C(t){let e=W();N(e,["server","--quiet","--port",String(t)],{detached:!0,stdio:"ignore",env:process.env}).unref();let r=Date.now()+I;for(;Date.now()<r;){let i=b();if(v(i))return i.bridgePort;await new Promise(n=>setTimeout(n,150))}if(await P(t,800))return t;throw new Error(`standalone server didn't come online within ${Math.round(I/1e3)}s`)}function W(){let t=process.argv[1];return t&&F(t)?t:"sootsim"}function h(t){return t instanceof Error?t.message:String(t)}async function q(){try{let{checkRuntimeUpToDate:t}=await import("./runtime-delivery-DELLWFH7.js"),e,s=await Promise.race([t(),new Promise(r=>{e=setTimeout(()=>r(null),2500)})]);return e&&clearTimeout(e),s&&s.outdated?s.latest:null}catch{return null}}export{ee as runStart};
|