sootsim 0.1.62 → 0.1.63
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-VKARDTF5.js → agent-Z7M6NMR6.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-6QDQ77TJ.js → agent-wrapper-C7OMZWTX.js} +2 -2
- package/dist-cli/chunks/{assert-PYSEWHJK.js → assert-OB4RMGU6.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-JF7VEKGP.js +2 -0
- package/dist-cli/chunks/beta-SZGXUHPX.js +2 -0
- package/dist-cli/chunks/{chunk-UEF3ZIEI.js → chunk-2TVSYU32.js} +2 -2
- package/dist-cli/chunks/{chunk-ND2UZFA4.js → chunk-4232ZQOX.js} +1 -1
- package/dist-cli/chunks/{chunk-DV4MSLJL.js → chunk-4H3UC4KB.js} +2 -2
- package/dist-cli/chunks/{chunk-C6LE22VK.js → chunk-4OW4EPBS.js} +2 -2
- package/dist-cli/chunks/{chunk-BIZ4APXE.js → chunk-5OZ7M24R.js} +2 -2
- package/dist-cli/chunks/{chunk-TIUEUINU.js → chunk-76MTBJ24.js} +1 -1
- package/dist-cli/chunks/{chunk-DNAVJIEL.js → chunk-7RZWW5VK.js} +2 -2
- package/dist-cli/chunks/{chunk-YRKWTQ66.js → chunk-A3UFHDMY.js} +1 -1
- package/dist-cli/chunks/{chunk-3N6CKIJG.js → chunk-AMZB6WUA.js} +2 -2
- package/dist-cli/chunks/{chunk-CEOCVI4R.js → chunk-AUMMYIP5.js} +2 -2
- package/dist-cli/chunks/{chunk-TALVQX2P.js → chunk-AYJGGZA4.js} +1 -1
- package/dist-cli/chunks/{chunk-6TJONB3X.js → chunk-B3644N6L.js} +1 -1
- package/dist-cli/chunks/{chunk-NXFXTJSP.js → chunk-C6UT7L2J.js} +2 -2
- package/dist-cli/chunks/chunk-CAFGDFEU.js +1 -0
- package/dist-cli/chunks/chunk-DAO2KA4O.js +1 -0
- package/dist-cli/chunks/{chunk-3WZ7ZTIA.js → chunk-DFRQMFUV.js} +1 -1
- package/dist-cli/chunks/{chunk-JIEJ2O4W.js → chunk-DYUOXUBI.js} +1 -1
- package/dist-cli/chunks/{chunk-66KS2T62.js → chunk-E2EPTSHO.js} +2 -2
- package/dist-cli/chunks/{chunk-35UHLN73.js → chunk-EIKREDI4.js} +2 -2
- package/dist-cli/chunks/{chunk-VBA6DIBD.js → chunk-ENACZPKI.js} +2 -2
- package/dist-cli/chunks/{chunk-YAKDXQA7.js → chunk-FEZCATWN.js} +2 -2
- package/dist-cli/chunks/{chunk-3BWDOYAV.js → chunk-FSSJVHNV.js} +3 -3
- package/dist-cli/chunks/{chunk-EIXXQDAI.js → chunk-GICJIXEH.js} +2 -2
- package/dist-cli/chunks/{chunk-WN2ATVFO.js → chunk-GW77VHPI.js} +2 -2
- package/dist-cli/chunks/{chunk-H2QWYBE2.js → chunk-HPVO7FJA.js} +2 -2
- package/dist-cli/chunks/{chunk-4MZLNYBR.js → chunk-IKFKEII6.js} +1 -1
- package/dist-cli/chunks/{chunk-6XLG7CQG.js → chunk-INXMOS35.js} +1 -1
- package/dist-cli/chunks/{chunk-RIYRSTXD.js → chunk-KRRNCL56.js} +2 -2
- package/dist-cli/chunks/{chunk-3VE2XCQM.js → chunk-KX3FO4N4.js} +3 -3
- package/dist-cli/chunks/{chunk-Q5EKBSA2.js → chunk-LJ7SH2KY.js} +2 -2
- package/dist-cli/chunks/{chunk-2JSZSUTN.js → chunk-MTTIJQ64.js} +2 -2
- package/dist-cli/chunks/{chunk-J5RNZMJJ.js → chunk-NWHQG4PG.js} +2 -2
- package/dist-cli/chunks/{chunk-V3TU7DR4.js → chunk-PDMITY2P.js} +1 -1
- package/dist-cli/chunks/{chunk-DN47N6UL.js → chunk-PX7QNGSM.js} +3 -3
- package/dist-cli/chunks/{chunk-6RJRJRAW.js → chunk-PY25FDGX.js} +1 -1
- package/dist-cli/chunks/{chunk-6EUVCG33.js → chunk-QW6P2JE2.js} +1 -1
- package/dist-cli/chunks/chunk-SOKY5FGT.js +1 -0
- package/dist-cli/chunks/{chunk-4JXE3ZUG.js → chunk-SSTMIACF.js} +1 -1
- package/dist-cli/chunks/{chunk-63NGN7QH.js → chunk-T7H7BKA7.js} +2 -2
- package/dist-cli/chunks/chunk-U42HSSAI.js +2 -0
- package/dist-cli/chunks/{chunk-5POON745.js → chunk-VV265FEE.js} +2 -2
- package/dist-cli/chunks/chunk-WCMYVXHS.js +2 -0
- package/dist-cli/chunks/{chunk-OMSSLTQC.js → chunk-XILD5NPV.js} +1 -1
- package/dist-cli/chunks/cli-version-BB3PGPZA.js +2 -0
- package/dist-cli/chunks/{compat-GO5ZKWUL.js → compat-2AFC4MFV.js} +3 -3
- package/dist-cli/chunks/{config-GWDGFFIB.js → config-KEEXBCOM.js} +2 -2
- package/dist-cli/chunks/control-PI6FRLTV.js +2 -0
- package/dist-cli/chunks/{cpu-profile-TQRN7NFF.js → cpu-profile-RPSEEWCO.js} +2 -2
- package/dist-cli/chunks/{daemon-XLTCNIET.js → daemon-FCQLYFNH.js} +2 -2
- package/dist-cli/chunks/{debug-324KIABR.js → debug-QSYUF4WZ.js} +3 -3
- package/dist-cli/chunks/demo-app-registry-SDP4RWXB.js +2 -0
- package/dist-cli/chunks/{detox-QGITZG47.js → detox-6PJOIC7Z.js} +2 -2
- package/dist-cli/chunks/{device-6WFYBS5R.js → device-H7GVARBE.js} +2 -2
- package/dist-cli/chunks/{diagnose-HBDMYEKJ.js → diagnose-H47FC64H.js} +2 -2
- package/dist-cli/chunks/drivers-BFET7Y5U.js +2 -0
- package/dist-cli/chunks/{electron-5DX3DITH.js → electron-54ZCOKJE.js} +3 -3
- package/dist-cli/chunks/flow-JC7BTILV.js +2 -0
- package/dist-cli/chunks/{hints-CJ3ETNUR.js → hints-V4VBWK3W.js} +2 -2
- package/dist-cli/chunks/{home-paths-OCOWHSRV.js → home-paths-GUUGF76T.js} +2 -2
- package/dist-cli/chunks/{inspect-QPZXN3IK.js → inspect-NDLLEBJK.js} +63 -30
- package/dist-cli/chunks/install-AXZ4MKSG.js +2 -0
- package/dist-cli/chunks/{install-desktop-RB3JNYHC.js → install-desktop-FBK4PRA3.js} +3 -3
- package/dist-cli/chunks/{keys-HFOS3J5A.js → keys-IWDHA2GT.js} +2 -2
- package/dist-cli/chunks/{launch-XQGAPI6Q.js → launch-MQEJM5XD.js} +3 -3
- package/dist-cli/chunks/{login-U6ZPN4IL.js → login-FFLXNWYQ.js} +4 -4
- package/dist-cli/chunks/{logout-VY2F5T4J.js → logout-X4NH4PZG.js} +2 -2
- package/dist-cli/chunks/{maestro-32UN2FHS.js → maestro-V3GTFFX6.js} +2 -2
- package/dist-cli/chunks/{preview-AJWIS25K.js → preview-YHY7IHFE.js} +2 -2
- package/dist-cli/chunks/{profile-4XPDQIQY.js → profile-CFYRAH3J.js} +2 -2
- package/dist-cli/chunks/{react-VSZ2RQEC.js → react-L7NP2D6J.js} +2 -2
- package/dist-cli/chunks/{record-W6ZTLQTB.js → record-36R7J2BU.js} +7 -7
- package/dist-cli/chunks/runtime-L2E4XOOB.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-O7G4Y6GE.js → runtime-delivery-CWSGC6RY.js} +2 -2
- package/dist-cli/chunks/{screenshot-ALDT4B77.js → screenshot-FAPUEO63.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-5VYUB7G6.js → screenshot-mode-QB7FVHYI.js} +2 -2
- package/dist-cli/chunks/{screenshots-TYQ4EVJR.js → screenshots-XAB5UKQB.js} +2 -2
- package/dist-cli/chunks/{server-X2GDTWC6.js → server-NLNCGLAT.js} +2 -2
- package/dist-cli/chunks/setup-repo-XGSB77UN.js +2 -0
- package/dist-cli/chunks/{skills-C6RSSO4R.js → skills-WBR5NZHN.js} +2 -2
- package/dist-cli/chunks/{start-Y2S3LSL5.js → start-3I5VJI3S.js} +4 -4
- package/dist-cli/chunks/store-3LACO57B.js +2 -0
- package/dist-cli/chunks/telemetry-6QW73WDZ.js +2 -0
- package/dist-cli/chunks/{test-IAHTJWBS.js → test-LD2RIFI2.js} +3 -3
- package/dist-cli/chunks/{three-mode-ZCZXY47S.js → three-mode-5GPHB6BR.js} +2 -2
- package/dist-cli/chunks/{timeline-KZHGTPDV.js → timeline-AOVC2P3F.js} +2 -2
- package/dist-cli/chunks/{upgrade-47JCBCFB.js → upgrade-CU3DMD2C.js} +2 -2
- package/dist-cli/chunks/upload-32RTWBK5.js +2 -0
- package/dist-cli/chunks/web-RNUV6WCK.js +2 -0
- package/dist-cli/chunks/{what-happened-FULTHMRQ.js → what-happened-BSRVVJPQ.js} +2 -2
- package/dist-cli/chunks/{whoami-3KUBLDUA.js → whoami-ZAVHKQPY.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/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.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/index.cjs +1 -1
- 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/vite-base.cjs +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/auto-bootstrap-SUDPJ45T.js +0 -2
- package/dist-cli/chunks/beta-3HRWHUIR.js +0 -2
- package/dist-cli/chunks/chunk-DYYNEGJV.js +0 -2
- package/dist-cli/chunks/chunk-S2RNIQCY.js +0 -1
- package/dist-cli/chunks/chunk-T6IRZEOS.js +0 -1
- package/dist-cli/chunks/chunk-TSGJJFFO.js +0 -1
- package/dist-cli/chunks/chunk-XTR4CILB.js +0 -2
- package/dist-cli/chunks/cli-version-INI6PYTD.js +0 -2
- package/dist-cli/chunks/control-GMAG2HKS.js +0 -2
- package/dist-cli/chunks/demo-app-registry-OEAV2G5S.js +0 -2
- package/dist-cli/chunks/drivers-TJSMGOQQ.js +0 -2
- package/dist-cli/chunks/flow-HNHYMZO6.js +0 -2
- package/dist-cli/chunks/install-OVCWRSPD.js +0 -2
- package/dist-cli/chunks/runtime-6UMHX7N7.js +0 -2
- package/dist-cli/chunks/setup-repo-Q7SMPBCH.js +0 -2
- package/dist-cli/chunks/store-ABVWLB26.js +0 -2
- package/dist-cli/chunks/telemetry-2LWDURQ5.js +0 -2
- package/dist-cli/chunks/upload-PNZ3UEOL.js +0 -2
- package/dist-cli/chunks/web-N6G3E6EE.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-INXMOS35.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.63 | (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-EIKREDI4.js";import"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.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.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as w,e as b,h as m,i as f}from"./chunk-4OW4EPBS.js";import"./chunk-SSTMIACF.js";import"./chunk-U42HSSAI.js";import"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.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,12 +1,12 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as C}from"./chunk-MTTIJQ64.js";import"./chunk-7RZWW5VK.js";import{d as K}from"./chunk-NWHQG4PG.js";import"./chunk-CAFGDFEU.js";import{d as q}from"./chunk-A3UFHDMY.js";import"./chunk-VV265FEE.js";import"./chunk-GW77VHPI.js";import{c as g,e as w}from"./chunk-4OW4EPBS.js";import{b as H}from"./chunk-SSTMIACF.js";import"./chunk-U42HSSAI.js";import"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.js";import{existsSync as ue,mkdirSync as k,readdirSync as me,readFileSync as fe,rmSync as W,writeFileSync as U}from"fs";import{homedir as pe,tmpdir as ge}from"os";import{dirname as P,extname as Q,join as I,resolve as we}from"path";var X=6e4,he=3e4;async function N(e,r,o,i){let t=Math.max(2e4,i+he);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 be=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin"]),ve=new Set(["start","stop","cancel","status","prelude-start"]);function ye(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){be.has(o)&&r++;continue}return ve.has(o)?{name:o,index:r}:null}return null}async function De(e,r){let o=ye(e);if(o){let a=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await ke(a,r);return}if(o.name==="prelude-start"){await Oe(a,r);return}if(o.name==="stop"){await Ue(a,r);return}if(o.name==="cancel"){await Me(a,r);return}await Be(a,r);return}let i=g(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin"]}),t=ee(u(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=u(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let c=u(e,"--output"),d=Number(u(e,"--duration")??"10");(!Number.isFinite(d)||d<=0)&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let l=1800;d>l&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 exceeds the ${l}s (30m) maximum`),process.exit(1));let h=Number(u(e,"--fps")??"30"),b=u(e,"--frames");if(b!==void 0){let a=Number(b);(!Number.isInteger(a)||a<=0)&&(console.error(` invalid --frames "${b}" \u2014 expected a positive integer count`),process.exit(1))}let
|
|
7
|
+
\`sootsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var be=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin"]),ve=new Set(["start","stop","cancel","status","prelude-start"]);function ye(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){be.has(o)&&r++;continue}return ve.has(o)?{name:o,index:r}:null}return null}async function De(e,r){let o=ye(e);if(o){let a=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await ke(a,r);return}if(o.name==="prelude-start"){await Oe(a,r);return}if(o.name==="stop"){await Ue(a,r);return}if(o.name==="cancel"){await Me(a,r);return}await Be(a,r);return}let i=g(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin"]}),t=ee(u(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=u(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let c=u(e,"--output"),d=Number(u(e,"--duration")??"10");(!Number.isFinite(d)||d<=0)&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let l=1800;d>l&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 exceeds the ${l}s (30m) maximum`),process.exit(1));let h=Number(u(e,"--fps")??"30"),b=u(e,"--frames");if(b!==void 0){let a=Number(b);(!Number.isInteger(a)||a<=0)&&(console.error(` invalid --frames "${b}" \u2014 expected a positive integer count`),process.exit(1))}let V=e.includes("--open"),j=u(e,"--max-width")?Number(u(e,"--max-width")):void 0,f=Math.max(100,Math.round(d*1e3)),de=u(e,"--origin");if(t==="live"||t==="combined"){c&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await C("record",{originOverride:de,allowGitHubAuth:!0});let a=w({...i,commandTimeoutMs:6e4});try{await G(a),await re(a,t),await te(a),await ne(a,t,t==="combined"?n:void 0)||(console.error(` start failed: recording store refused to start (${t})`),process.exit(1)),console.log(` recording ${t} for ${d}s`),await new Promise(R=>setTimeout(R,f)),await ie(a);let x=await se(a);ae(x,V,t)}finally{a.close()}return}let E=b?Number(b):null,$=Re(s,c,E);V&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let v=w({...i,commandTimeoutMs:6e4});try{if(await Y(v),$==="png"){let S=E??10,p=M(c,`sootsim-frames-${B()}`);c&&Q(c)&&console.log(` note: --frames writes multiple pngs, so --output "${c}" is a directory \u2014 frame-NNN.png files land inside it`),k(p,{recursive:!0});for(let m of me(p))/^frame-\d+\.png$/.test(m)&&W(I(p,m),{force:!0});console.log(` sampling ${S} frames over ${d}s \u2192 ${p}`);let y=await v.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${S}, durationMs: ${f}${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(m=>setTimeout(m,f));let ce=Date.now()+Math.max(5e3,f),F=null;for(;;){let m=await v.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${y.requestId})`});if(m||(console.error(" frame capture result missing"),process.exit(1)),m.done){m.ok||(console.error(` frame capture failed: ${m.error??"unknown error"}`),process.exit(1)),F=m.frames??[];break}Date.now()>=ce&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(T=>setTimeout(T,100))}F.forEach((m,T)=>{let le=`${p}/frame-${String(T+1).padStart(3,"0")}.png`;U(le,Buffer.from(m.data,"base64"))}),console.log(` saved ${F.length} frames`);return}if($==="gif"){let S=E??Math.max(10,Math.round(d*h/3)),p=M(c,`sootsim-${B()}.gif`);k(P(p),{recursive:!0}),console.log(` encoding gif: ${S} frames over ${d}s \u2192 ${p}`);let y=await N(v,`window.__sootsimRecorder.captureGif({ frames: ${S}, durationMs: ${f}${j?`, maxWidth: ${j}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",f);y||(console.error(" gif capture returned no frames"),process.exit(1)),U(p,Buffer.from(y.data,"base64")),console.log(` saved: ${p} (${D(y.size)})`);return}let a=M(c,`sootsim-${B()}.${$}`);k(P(a),{recursive:!0});let A={format:$,fps:h,durationMs:f};n&&(A.layers=n);let x=await N(v,`window.__sootsimRecorder.start(${JSON.stringify(A)})`,`${$} start`,f);x.ok||(console.error(` start failed: ${x.error??"unknown error"}`),/render host not available|already streaming|already recording/i.test(x.error??"")&&console.error(" a prior recording was abandoned and its capture is still\n releasing. retry in ~20s, or recover now with\n `sootsim close --sim <id>` then reopen the sim."),process.exit(1)),console.log(` recording ${$} for ${d}s \u2192 ${a}`),await new Promise(S=>setTimeout(S,f));let R=await N(v,"window.__sootsimRecorder.stop()",`${$} encode/flush`,f);R.ok||(console.error(` stop failed: ${R.error??"unknown error"}`),process.exit(1)),R.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await Z(v,a),console.log(` saved: ${a} (${D(R.size)})`)}finally{v.close()}}var $e=6e3;async function z(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:$e})}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 Y(e){await z(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function Z(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}U(r,Buffer.concat(o))}function u(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function Se(e){if(!e)return;let r=Q(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function Re(e,r,o){return e||(o!=null?"png":Se(r)??"webm")}function B(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function xe(){let e=I(pe(),".sootsim","recordings");return k(e,{recursive:!0}),e}function M(e,r){return e?we(process.cwd(),e):I(xe(),r)}function D(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function ee(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 L(){return I(ge(),`sootsim-recording-${H()}.json`)}function O(){let e=L();if(!ue(e))return null;try{return{mode:"video",...JSON.parse(fe(e,"utf8"))}}catch{return W(e,{force:!0}),null}}function _e(e){U(L(),JSON.stringify(e,null,2))}function _(){W(L(),{force:!0})}function J(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
|
|
8
8
|
requested sim ${e}. record state is global (not per-sim);
|
|
9
|
-
this command acts on that session regardless of --sim.`)}async function ke(e,r){let o=O();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=g(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only"],stripValueFlags:["--mode","--fps","--format","--max-width","--origin"]}),t=ee(u(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=u(e,"--format"),c=s==="mp4"?"mp4":"webm";s&&c!==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 d=Number(u(e,"--fps")??"30"),l=w({...i,commandTimeoutMs: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
|
|
9
|
+
this command acts on that session regardless of --sim.`)}async function ke(e,r){let o=O();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=g(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only"],stripValueFlags:["--mode","--fps","--format","--max-width","--origin"]}),t=ee(u(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=u(e,"--format"),c=s==="mp4"?"mp4":"webm";s&&c!==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 d=Number(u(e,"--fps")??"30"),l=w({...i,commandTimeoutMs: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 C("record",{originOverride:u(e,"--origin"),allowGitHubAuth:!0}),await G(l),await re(l,t),await te(l),await ne(l,t,t==="combined"?n:void 0)||(console.error(` start failed: recording store refused to start (${t})`),process.exit(1));else{await Y(l);let h={format:c,fps:d};n&&(h.layers=n);let b=await l.send({type:"evaluate",code:`window.__sootsimRecorder.start(${JSON.stringify(h)})`});b.ok||(console.error(` start failed: ${b.error??"unknown error"}`),process.exit(1))}_e({simId:i.simId??null,mode:t,format:c,fps:d,layers:n,startedAt:new Date().toISOString()}),console.log(t==="video"?` recording ${c} @ ${d}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{l.close()}}async function Oe(e,r){let o=O();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=g(e,{port:r.port,stripBooleanFlags:[],stripValueFlags:["--origin"]}),t=w({...i,commandTimeoutMs:15e3});try{await G(t),await t.send({type:"evaluate",code:`(() => {
|
|
10
10
|
const start = window.SootSim?.bridges?.startRecordingPrelude
|
|
11
11
|
if (typeof start !== 'function') return false
|
|
12
12
|
return Promise.resolve(start()).then((value) => value === true)
|
|
@@ -26,7 +26,7 @@ import{a as A}from"./chunk-2JSZSUTN.js";import"./chunk-DNAVJIEL.js";import{d as
|
|
|
26
26
|
const r = window.__sootsimRecorder;
|
|
27
27
|
if (r && typeof r.forceRelease === 'function') return await r.forceRelease();
|
|
28
28
|
return false;
|
|
29
|
-
})()`}).catch(()=>!1);console.log(l?" 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.":" 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{c.close()}return}let i=g(e,{port:r.port});J(i.simId,o);let t=o.simId??i.simId??void 0,n=w({...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{_(),n.close()}console.log(" recording cancelled")}async function Ue(e,r){let o=O();o||(console.error(" no recording in progress. start one with `sootsim record start`."),process.exit(1));let i=g(e,{port:r.port,stripBooleanFlags:["--open"],stripValueFlags:["--output"]});J(i.simId,o);let t=o.simId??i.simId??void 0,n=e.includes("--open"),s=w({...i,simId:t,commandTimeoutMs:6e4});try{if(o.mode==="live"||o.mode==="combined"){await ie(s);let h=await se(s);_(),ae(h,n,o.mode);return}let c=u(e,"--output"),d=M(c,`sootsim-${B()}.${o.format}`);k(P(d),{recursive:!0});let l=await s.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"});l.ok||(console.error(` stop failed: ${l.error??"unknown error"}`),_(),process.exit(1)),l.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),_(),process.exit(1)),await Z(s,d),_(),console.log(` saved: ${d} (${D(l.size)})`)}finally{s.close()}}async function
|
|
29
|
+
})()`}).catch(()=>!1);console.log(l?" 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.":" 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{c.close()}return}let i=g(e,{port:r.port});J(i.simId,o);let t=o.simId??i.simId??void 0,n=w({...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{_(),n.close()}console.log(" recording cancelled")}async function Ue(e,r){let o=O();o||(console.error(" no recording in progress. start one with `sootsim record start`."),process.exit(1));let i=g(e,{port:r.port,stripBooleanFlags:["--open"],stripValueFlags:["--output"]});J(i.simId,o);let t=o.simId??i.simId??void 0,n=e.includes("--open"),s=w({...i,simId:t,commandTimeoutMs:6e4});try{if(o.mode==="live"||o.mode==="combined"){await ie(s);let h=await se(s);_(),ae(h,n,o.mode);return}let c=u(e,"--output"),d=M(c,`sootsim-${B()}.${o.format}`);k(P(d),{recursive:!0});let l=await s.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"});l.ok||(console.error(` stop failed: ${l.error??"unknown error"}`),_(),process.exit(1)),l.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),_(),process.exit(1)),await Z(s,d),_(),console.log(` saved: ${d} (${D(l.size)})`)}finally{s.close()}}async function G(e){await z(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 re(e,r){await z(e,`(() => {
|
|
30
30
|
const fn = window.__sootsimCaptureBundle
|
|
31
31
|
if (typeof fn !== 'function') return false
|
|
32
32
|
const snap = fn()
|
|
@@ -34,12 +34,12 @@ import{a as A}from"./chunk-2JSZSUTN.js";import"./chunk-DNAVJIEL.js";import{d as
|
|
|
34
34
|
})()`)||(console.error(` --mode ${r} needs a guest app bundle to upload to /preview/<id>,
|
|
35
35
|
but this sim has no bundle loaded (a built-in shell screen like
|
|
36
36
|
photos/settings/home has none). open a metro/guest app first, or
|
|
37
|
-
use \`--mode video\` for a local screen recording with no upload.`),process.exit(1))}async function te(e){let r=
|
|
37
|
+
use \`--mode video\` for a local screen recording with no upload.`),process.exit(1))}async function te(e){let r=K();if(!r)return;let o=r.kind==="api-key"?r.secret:r.token;await e.send({type:"evaluate",code:`(() => {
|
|
38
38
|
const set = window.SootSim && window.SootSim.bridges && window.SootSim.bridges.setSession
|
|
39
39
|
if (typeof set !== 'function') return false
|
|
40
40
|
set({ token: ${JSON.stringify(o)}, user: null })
|
|
41
41
|
return true
|
|
42
|
-
})()`})||(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 ne(e,r,o){return await e.send({type:"evaluate",code:`window.SootSim.bridges.startRecording(${JSON.stringify(r)}${o?`, ${JSON.stringify(o)}`:""})`})===!0}async function ie(e){await e.send({type:"evaluate",code:"void window.SootSim.bridges.stopRecording()"})}async function se(e){let r=Date.now()+
|
|
42
|
+
})()`})||(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 ne(e,r,o){return await e.send({type:"evaluate",code:`window.SootSim.bridges.startRecording(${JSON.stringify(r)}${o?`, ${JSON.stringify(o)}`:""})`})===!0}async function ie(e){await e.send({type:"evaluate",code:"void window.SootSim.bridges.stopRecording()"})}async function se(e){let r=Date.now()+X;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 ${X/1e3}s`}}function ae(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
|
|
43
43
|
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
|
|
44
44
|
nothing to replay, and the Video tab may stall with no events to drive it.`:` note: this live recording captured no events \u2014 the preview has nothing
|
|
45
45
|
to replay and will boot a fresh interactive session instead.`),r&&q(e.previewUrl)}export{Se as extToFormat,Re as resolveFormat,De as runRecord,u as valueOf};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a}from"./chunk-PX7QNGSM.js";import"./chunk-4OW4EPBS.js";import"./chunk-SSTMIACF.js";import"./chunk-U42HSSAI.js";import"./chunk-LJ7SH2KY.js";import"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.js";export{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}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-LJ7SH2KY.js";import"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.js";export{a as DEFAULT_RUNTIME_CDN_ORIGIN,b as RUNTIME_CDN_ORIGIN_ENV,c as RUNTIME_CHANNEL_ENV,l as checkRuntimeUpToDate,h as fetchRuntimeManifest,j as installRuntime,d as resolveRuntimeCdnOrigin,e as resolveRuntimeChannel,i as resolveRuntimeVersion,f as runtimeManifestUrl,g as runtimeTarballUrl,k as updateRuntimeToLatest};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as S}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as S}from"./chunk-FEZCATWN.js";import"./chunk-SOKY5FGT.js";import{a as x}from"./chunk-DFRQMFUV.js";import"./chunk-ENACZPKI.js";import"./chunk-KRRNCL56.js";import{f as m}from"./chunk-AYJGGZA4.js";import{c as h,d as g,e as w,h as y}from"./chunk-4OW4EPBS.js";import"./chunk-SSTMIACF.js";import"./chunk-U42HSSAI.js";import"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.js";import{mkdirSync as R,writeFileSync as v}from"fs";import{dirname as _,resolve as $}from"path";async function W(e,o){(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.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as o}from"./chunk-T7H7BKA7.js";import"./chunk-4OW4EPBS.js";import"./chunk-SSTMIACF.js";import"./chunk-U42HSSAI.js";import"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.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 Y}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as Y}from"./chunk-KX3FO4N4.js";import{b as j}from"./chunk-FEZCATWN.js";import"./chunk-SOKY5FGT.js";import"./chunk-MTTIJQ64.js";import"./chunk-7RZWW5VK.js";import"./chunk-NWHQG4PG.js";import{b as O}from"./chunk-5OZ7M24R.js";import"./chunk-GICJIXEH.js";import"./chunk-C6UT7L2J.js";import"./chunk-PY25FDGX.js";import"./chunk-B3644N6L.js";import"./chunk-AMZB6WUA.js";import"./chunk-AUMMYIP5.js";import"./chunk-IKFKEII6.js";import"./chunk-CAFGDFEU.js";import"./chunk-EIKREDI4.js";import"./chunk-A3UFHDMY.js";import"./chunk-ENACZPKI.js";import"./chunk-WCMYVXHS.js";import"./chunk-VV265FEE.js";import"./chunk-GW77VHPI.js";import"./chunk-KRRNCL56.js";import{a as w,b as D,c as k,d as z,e as x,f as T}from"./chunk-AYJGGZA4.js";import"./chunk-4OW4EPBS.js";import"./chunk-SSTMIACF.js";import"./chunk-U42HSSAI.js";import"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.js";import{mkdirSync as B,readFileSync as pe,writeFileSync as G}from"fs";import{tmpdir as je}from"os";import C from"path";import{mkdirSync as I,readFileSync as Q,writeFileSync as H}from"fs";import F from"path";function _(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 v(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function ee(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 M(e,t){let o=ee(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),u=Number.parseInt(s.slice(4,6),16);return`rgba(${r}, ${a}, ${u}, ${i})`}return o.startsWith("rgb(")?o.replace(/^rgb\((.+)\)$/i,`rgba($1, ${i})`):o}function te(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 re(e){let t=e.glow;return t?`radial-gradient(circle at 50% 24%, ${M(t,.46)} 0%, ${M(t,.2)} 24%, rgba(0,0,0,0) 62%)`:"none"}function A(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)";default:return"none"}}function L(...e){let t=e.map(o=>o.trim()).filter(o=>o.length>0&&o!=="none");return t.length>0?t.join(" "):"none"}function E(e){let t=M(e.color,e.opacity),o=M(e.color,e.opacity*.52);return`drop-shadow(0 34px ${e.spread}px ${o}) drop-shadow(0 0 ${e.blur}px ${t})`}function R(e,t){return!t.glow||e.color&&e.color!==w.color?e:{...e,color:t.glow}}function oe(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,u)=>{let p=Math.round(t.width*.68*(a.scale??r.scale)),l=Math.round(t.height*(.03+r.offsetY+(a.offsetY??0))),c=a.pose||r.pose||"tilted-right",m=R(r.shadow,u);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:${A(c)}`,`filter:${E(m)}`,"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,u)=>{let p=Math.round(t.width*.84*(a.scale??r.scale)),l=Math.round(t.height*(r.offsetY+(a.offsetY??0))),c=a.pose||r.pose,m=R(r.shadow,u);return["position:absolute",`top:${Math.round(t.height*.075)+l}px`,"left:50%",`width:${p}px`,"transform-origin:center center",`transform:${L("translateX(-50%)",A(c))}`,`filter:${E(m)}`,"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,u=Math.round(t.width*a*(s.scale??n.scale)),p=Math.round(t.height*(n.offsetY+(s.offsetY??0))),l=s.pose||n.pose,c=R(n.shadow,r);return["position:absolute",`top:${Math.round(t.height*(t.name==="ipad-13"?.25:.28))+p}px`,"left:50%",`width:${u}px`,"transform-origin:center top",`transform:${L("translateX(-50%)",A(l))}`,`filter:${E(c)}`,"z-index:2"].join(";")}}}function ne({canvas:e,compose:t,slide:o,imageDataUrl:i}){let n=o.background??t.background,s=oe(t.text.preset,e),r=t.text.preset!=="none"&&!!(o.eyebrow||o.headline||o.subheadline),a=s.deviceStyle(t.frame,o,n),u=o.headline?`<div style="font-weight:780;white-space:pre-line;text-wrap:balance;${s.titleStyle}">${v(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}">${v(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};">${v(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 ee,c as D,d as te,e as H,f as ie,h as re,i as A,j as ne,k as se,l as oe,p as ae,s as k,t as ce,u as de,v as le,w as ue}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as ee,c as D,d as te,e as H,f as ie,h as re,i as A,j as ne,k as se,l as oe,p as ae,s as k,t as ce,u as de,v as le,w as ue}from"./chunk-E2EPTSHO.js";import"./chunk-76MTBJ24.js";import{a as Q}from"./chunk-7RZWW5VK.js";import"./chunk-NWHQG4PG.js";import{e as E}from"./chunk-C6UT7L2J.js";import"./chunk-AMZB6WUA.js";import"./chunk-CAFGDFEU.js";import{d as Y}from"./chunk-A3UFHDMY.js";import{a as F}from"./chunk-DYUOXUBI.js";import{a as z,b as X}from"./chunk-VV265FEE.js";import"./chunk-GW77VHPI.js";import"./chunk-4OW4EPBS.js";import"./chunk-SSTMIACF.js";import{a as U}from"./chunk-U42HSSAI.js";import{k as Z}from"./chunk-LJ7SH2KY.js";import{A as $,B,D as J,E as K,F as G,G as V,H as q,I as N,u as L,v as W,y as T,z as j}from"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.js";import{spawn as Le}from"child_process";import w from"fs";import{createServer as Be}from"http";import S from"path";import{WebSocket as h,WebSocketServer as Ne}from"ws";import pe from"node:fs";import I from"node:path";var P=1;function Ae(){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(a=>Number.isFinite(a)&&a>0)}var R=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 k?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await oe()}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 H();case"agent:upsert-project":return D(i.input??{});case"agent:delete-project":return re(String(i.projectId)),{ok:!0};case"agent:auto-attach-for-url":return this.autoAttachForUrl(i.input??{});case"agent:list-sessions":return ne(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),o=A(n);if(!o)throw new k("NO_SESSION",`no session: ${n}`);let r=this.normalizePromptEnvelope(i);return await de(n,r),this.notePromptAccepted(n,r,o.status==="working")}case"agent:end-session":this.dropSessionFanout(String(i.sessionId)),await le(String(i.sessionId));let s=A(String(i.sessionId));return s&&this.broadcastSessionStatus(s),{ok:!0};case"agent:get-transcript":return this.getTranscript(String(i.sessionId));case"agent:get-paths":return this.getPaths();case"agent:subscribe-events":return this.subscribeSocket(e,String(i.sessionId));case"agent:unsubscribe-events":return this.unsubscribeSocket(e,String(i.sessionId));default:throw new k("UNKNOWN_AGENT_MSG",`unknown agent message: ${t}`)}}async doStartSession(e){if(!te(e.projectId))throw new k("NO_PROJECT",`no project: ${e.projectId}`);let i=await ce(e);return this.broadcastSessionStatus(i.session),i}async autoAttachForUrl(e){let t=e.bundleUrl??"",i=(()=>{try{return new URL(t).port||null}catch{return null}})();if(!i)return{project:null};let s=this.opts.getExcludePorts?.()??Ae(),o=(await E({excludePorts:s})).find(d=>String(d.port)===i);if(!o||!o.cwd)return{project:null};let r=H().find(d=>d.cwd===o.cwd)??null,c=Array.from(new Set([...r?.knownBundleUrls??[],o.bundleUrl,t]));return{project:D({cwd:o.cwd,name:o.projectName??I.basename(o.cwd),preferredProvider:e.provider??r?.preferredProvider,sourceRoots:r?.sourceRoots??[o.cwd],knownBundleUrls:c,framework:r?.framework??ke(o.framework),bundleId:o.bundleId??r?.bundleId})}}getTranscript(e){let t=ae(e);return pe.existsSync(t)?pe.readFileSync(t,"utf8"):{error:"transcript not found",code:"NO_TRANSCRIPT"}}getPaths(){let e=ee();return{userDataDir:e,storeFile:I.join(e,"attached-projects.json"),sessionsDir:I.join(e,"sessions"),transcriptsDir:I.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=ue(t,o=>{let r=this.coalescePromptEcho(t,o);if(r&&(this.applySessionEvent(t,r),this.fanOutEvent(t,r)),o.type==="turn-completed"){let c=A(t);if(c)try{ie(c.projectId,{usd:o.costUsd,ts:o.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 o=Math.max(this.pendingTurns.get(e)??0,i?1:0)+1;this.pendingTurns.set(e,o);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:o>1,pendingTurns:o,queueDepth:Math.max(0,o-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){se(e,t);let i=A(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===P)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===P)try{i.send(t)}catch{}}respond(e,t,i){if(e.readyState===P)try{e.send(JSON.stringify({id:t,result:i}))}catch{}}respondError(e,t,i,s){if(e.readyState===P)try{e.send(JSON.stringify({id:t,error:i,...s?{code:s}:{}}))}catch{}}};function ke(a){return a==="expo"?"expo":a==="one"||a==="vxrn"?"one":"unknown"}import Ee from"http";import Ie from"https";var M="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",Ce=[{hostSuffix:"uniswap.org",headers:{origin:"https://app.uniswap.org",referer:"https://app.uniswap.org/"}}];function Te(a){let e=a.toLowerCase();for(let t of Ce)if(e===t.hostSuffix||e.endsWith(`.${t.hostSuffix}`))return t.headers;return{}}function me(a){return{"accept-encoding":"identity","user-agent":M,...Te(a.hostname)}}var Pe=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"]),Re={"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"};function C(a){for(let[e,t]of Object.entries(Re))a.setHeader(e,t)}function Oe(a,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 a.includes("stored-in-.env.local")?`${n} | upstream url still contains placeholder env values`:n}function _e(a,e){let t={};for(let[i,s]of Object.entries(a))s&&(Pe.has(i.toLowerCase())||(t[i]=Array.isArray(s)?s.join(", "):s));return Object.assign(t,e?me(e):{"user-agent":M}),t}function he(a){return a?.startsWith("/__fetch-proxy?")||a?.startsWith("/__proxy?")||!1}function fe(a){return a?!!(a.startsWith("/__app-api?")||a.startsWith("/__app-api/")):!1}async function ge(a,e){if(a.method==="OPTIONS"){C(e),e.writeHead(204),e.end();return}let i=new URLSearchParams((a.url||"").split("?")[1]||"").get("url");if(!i){C(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("missing url param");return}let s;try{s=new URL(i)}catch{C(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("invalid url param");return}let n=_e(a.headers,s),o;if(a.method!=="GET"&&a.method!=="HEAD"){let d=[];for await(let u of a)d.push(Buffer.isBuffer(u)?u:Buffer.from(u));d.length>0&&(o=Buffer.concat(d))}let r;try{r=await fetch(s.href,{method:a.method,headers:n,body:o,redirect:"follow"})}catch(d){C(e),e.writeHead(502,{"Content-Type":"text/plain"}),e.end(`fetch proxy error: ${Oe(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)}),C(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 Se(a,e){let t=a.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(a.method==="OPTIONS")return e.writeHead(204,{"Access-Control-Allow-Origin":a.headers.origin||"*","Access-Control-Allow-Methods":"GET,POST,PUT,PATCH,DELETE,OPTIONS","Access-Control-Allow-Headers":a.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 o=n.protocol==="https:"?Ie:Ee,r={...a.headers};delete r.host,r.host=n.host;let c=o.request({hostname:n.hostname,port:n.port||(n.protocol==="https:"?443:80),path:n.pathname+n.search,method:a.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":a.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}`)}),a.pipe(c),!0}var De=new Set(["tap","keyboard"]),He=2e3,Me=1e3;function Ue(a){return!a||typeof a.type!="string"?!1:a.acquireLock===!0?!0:a.readOnly===!0?!1:De.has(a.type)}var Fe=5e3,We=3600*1e3,je="SOOTSIM_RUNTIME_UPDATE_INTERVAL_MS",$e={".html":"text/html; charset=utf-8",".js":"application/javascript",".cjs":"application/javascript",".mjs":"application/javascript",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".webp":"image/webp",".avif":"image/avif",".ico":"image/x-icon",".wasm":"application/wasm",".ttf":"font/ttf",".otf":"font/otf",".woff":"font/woff",".woff2":"font/woff2",".map":"application/json",".txt":"text/plain; charset=utf-8"};function ye(a,e,t){let i;try{let c=L();i=JSON.stringify(c)}catch{i="{}"}let s=e>0?`window.__sootsimBridgePort=${e};`:"",n=t?`window.__sootsimSootbeanOrigin=${JSON.stringify(t)};`:"",o=`<script>window.__sootsimSharedConfig=${i};`+s+n+`window.__sootsimCliVersion=${JSON.stringify(F())};</script>`,r=a.toString("utf8");return r.includes("</head>")?r.replace("</head>",o+"</head>"):r.includes("</body>")?r.replace("</body>",o+"</body>"):o+r}function ve(a){typeof a=="object"&&a!==null&&"unref"in a&&a.unref()}var O=class a{port;openUrlHandler;httpServer=null;wss=null;nextCommandId=1;nextSimNumber=161;sims=new Map;primarySimId=null;pendingCommands=new Map;cliBySentId=new Map;cliSimBySocket=new Map;cliLastCommandAt=new Map;cliIdentityKeyBySocket=new Map;cliLabelBySocket=new Map;restorableSims=new Map;nextCliFallbackId=1;cliIdleTimer=null;agentHost;static CLI_IDLE_TIMEOUT_MS=6e4;static CLI_LEASE_TTL_MS=6e5;static USER_ACTIVE_LEASE_TTL_MS=8e3;static USER_BOOT_LEASE_TTL_MS=6e4;static SIM_RECONNECT_TTL_MS=3e4;static SIM_IDLE_REAP_TTL_MS=30*6e4;preferredPort;portFallbackCount;simIdleReapTtlMs;shouldWriteLockfile;sootbeanOrigin=null;effectivePort=0;startedAt=0;heartbeatTimer=null;wsHeartbeatTimer=null;wsIsAlive=new WeakMap;static WS_HEARTBEAT_INTERVAL_MS=3e4;runtimeUpdateTimer=null;runtimeUpdateInFlight=null;activeRuntimeVersion=null;activeRuntimeDirPath=null;scanCache=null;scanCacheAt=0;inflightScan=null;static SCAN_FRESH_MS=2e3;constructor(e={}){this.preferredPort=e.port||7668,this.port=this.preferredPort,this.shouldWriteLockfile=e.writeLockfile===!0,this.portFallbackCount=Math.max(1,e.portFallbackCount??10),this.openUrlHandler=e.openUrl,this.agentHost=new R({getExcludePorts:e.agentScanExcludes}),this.sootbeanOrigin=e.sootbeanOrigin?.replace(/\/$/,"")||null,this.simIdleReapTtlMs=e.simIdleReapTtlMs??a.SIM_IDLE_REAP_TTL_MS}getAgentHost(){return this.agentHost}reapIdleSimsForTest(e=Date.now()){this.reapIdleSims(e)}start(e){this.startAsync(e)}async startAsync(e){if(this.httpServer||this.wss)return this.effectivePort;this.refreshActiveRuntime();for(let t=0;t<this.portFallbackCount;t++){let i=this.preferredPort+t;try{return await this.bindOnce(i,e?.silent===!0),this.effectivePort=i,this.port=i,this.startedAt=Date.now(),t>0&&!e?.silent&&process.stderr.write(`ws bridge bound to port ${i} (preferred ${this.preferredPort} was taken)
|
|
5
5
|
`),this.afterBind(),i}catch(s){if(s?.code!=="EADDRINUSE")throw s;e?.silent||process.stderr.write(`ws bridge port ${i} already in use, trying ${i+1}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a}from"./chunk-HPVO7FJA.js";import"./chunk-PDMITY2P.js";import"./chunk-FSSJVHNV.js";import"./chunk-VV265FEE.js";import"./chunk-GW77VHPI.js";import"./chunk-4OW4EPBS.js";import"./chunk-SSTMIACF.js";import"./chunk-U42HSSAI.js";import"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.js";export{a as runSetupRepo};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-INXMOS35.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{d as _}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as _}from"./chunk-A3UFHDMY.js";import"./chunk-4OW4EPBS.js";import"./chunk-SSTMIACF.js";import"./chunk-U42HSSAI.js";import{E as b,F as v,i as D,y as O,z as x}from"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.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-SZGXUHPX.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-L2E4XOOB.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-FCQLYFNH.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-CWSGC6RY.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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-INXMOS35.js";import{spawn as m}from"child_process";import{existsSync as h,readdirSync as w}from"fs";import{resolve as u,dirname as x}from"path";import{fileURLToPath as y}from"url";var d=x(y(import.meta.resolve("sootsim-engine/package.json")));async function v(t,r){let l=t.includes("--flows"),f=t.includes("--detox"),c=t.includes("--parallel"),i=t.includes("--watch"),a=t.find((e,o)=>t[o-1]==="--reporter")||"console";if((t.includes("--help")||t.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim test \u2014 run tests against sootsim
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -26,6 +26,6 @@ examples:
|
|
|
26
26
|
notes:
|
|
27
27
|
playwright is best for smoke and package-local debugging
|
|
28
28
|
--detox is the preferred parity lane for behavior that should match real RN
|
|
29
|
-
`),process.exit(0)),l)await b(t,r,c,a);else if(f){let{runDetox:e}=await import("./detox-
|
|
29
|
+
`),process.exit(0)),l)await b(t,r,c,a);else if(f){let{runDetox:e}=await import("./detox-6PJOIC7Z.js");await e(t.filter(o=>o!=="--detox"),r)}else await g(t,r)}async function g(t,r){let l=["playwright","test"],f=t.find((e,o)=>t[o-1]==="-t")||t.find((e,o)=>t[o-1]==="--testNamePattern")||t.find((e,o)=>t[o-1]==="--grep");f&&l.push("-g",f),t.includes("--watch")&&l.push("--ui");let c=new Set(["--flows","--detox","--parallel","--watch","--reporter","-t","--testNamePattern","--grep"]);for(let e=0;e<t.length;e++){if(c.has(t[e])){(t[e]==="-t"||t[e]==="--testNamePattern"||t[e]==="--grep"||t[e]==="--reporter")&&e++;continue}l.push(t[e])}console.log(` running: npx ${l.join(" ")}`);let i=m("npx",l,{cwd:d,stdio:"inherit",env:{...process.env}}),a=await new Promise(e=>{i.on("exit",o=>e(o||0))});process.exit(a)}async function b(t,r,l,f){let c=["flows","test/flows","e2e/flows",".maestro","maestro"],i=[];for(let o of c){let s=u(d,o);if(h(s)){let p=w(s).filter(n=>n.endsWith(".yaml")||n.endsWith(".yml"));for(let n of p)i.push(u(s,n))}}for(let o of c){let s=u(process.cwd(),o);if(!s.startsWith(d)&&h(s)){let p=w(s).filter(n=>n.endsWith(".yaml")||n.endsWith(".yml"));for(let n of p)i.push(u(s,n))}}i.length===0&&(console.log(" no flow files found in flows/, test/flows/, or e2e/flows/"),process.exit(0)),console.log(` found ${i.length} flow(s)`);let a=0,e=0;for(let o of i)try{let{runFlowPlayback:s}=await import("./flow-JC7BTILV.js"),p=r.port?`http://localhost:${r.port}`:"http://localhost:5173";if(await s([o,"--url",p,"--new"])!==0){e++;continue}a++}catch{e++}console.log(`
|
|
30
30
|
results: ${a} passed, ${e} failed (${i.length} total)
|
|
31
31
|
`),process.exit(e>0?1:0)}export{v as runTest};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as k}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as k}from"./chunk-T7H7BKA7.js";import{c as u,e as g,i as y}from"./chunk-4OW4EPBS.js";import"./chunk-SSTMIACF.js";import"./chunk-U42HSSAI.js";import"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.js";var m=12e3;async function C(e,o){if((e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim three-mode \u2014 toggle the 3d device stage
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{c as m,e as d,h as s}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as m,e as d,h as s}from"./chunk-4OW4EPBS.js";import"./chunk-SSTMIACF.js";import"./chunk-U42HSSAI.js";import"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.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.
|
|
2
|
-
import{a as i}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as i}from"./chunk-DYUOXUBI.js";import{a as s}from"./chunk-PX7QNGSM.js";import"./chunk-4OW4EPBS.js";import"./chunk-SSTMIACF.js";import"./chunk-U42HSSAI.js";import"./chunk-LJ7SH2KY.js";import{C as e}from"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.js";import{spawn as r}from"node:child_process";var a="https://registry.npmjs.org/sootsim/latest";async function h(o){let n=o.indexOf("--channel"),t=n>=0&&o[n+1]?o[n+1]:void 0;console.log(`sootsim upgrade
|
|
3
3
|
`),await c(),console.log(`
|
|
4
4
|
runtime:`),await s(["install",...t?["--channel",t]:[]],{})}async function c(){let o=i(),n=await u();if(!n){console.log(` cli: v${o} \u2014 couldn't reach the npm registry, skipped`);return}if(e(n,o)<=0){console.log(` cli: v${o} (latest)`);return}console.log(` cli: v${o} \u2192 v${n} \u2014 installing globally\u2026`),await m(n)?console.log(` cli: installed v${n} \u2014 restart any running \`sootsim\` process to pick it up`):(console.log(" cli: automatic install failed \u2014 upgrade it yourself with:"),console.log(" npm install -g sootsim@latest"))}async function u(){try{let o=await fetch(a,{headers:{accept:"application/json"},signal:AbortSignal.timeout(8e3)});if(!o.ok)return null;let n=await o.json();return typeof n.version=="string"&&n.version?n.version:null}catch{return null}}function m(o){return new Promise(n=>{let t=r("npm",["install","-g",`sootsim@${o}`],{stdio:"inherit",shell:!0});t.on("error",()=>n(!1)),t.on("exit",l=>n(l===0))})}export{h as runUpgrade};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.63 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c}from"./chunk-7RZWW5VK.js";import"./chunk-NWHQG4PG.js";import"./chunk-CAFGDFEU.js";import"./chunk-A3UFHDMY.js";import"./chunk-VV265FEE.js";import"./chunk-GW77VHPI.js";import"./chunk-4OW4EPBS.js";import"./chunk-SSTMIACF.js";import"./chunk-U42HSSAI.js";import"./chunk-QW6P2JE2.js";import"./chunk-INXMOS35.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};
|