sootsim 0.1.66 → 0.1.68
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 +7 -28
- package/dist-cli/chunks/agent-RWWC5VLR.js +46 -0
- package/dist-cli/chunks/{agent-wrapper-5DJBERZP.js → agent-wrapper-AZ2TWUZV.js} +2 -2
- package/dist-cli/chunks/{assert-RHILK3WR.js → assert-YVADDYYY.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-E62IXD2G.js +2 -0
- package/dist-cli/chunks/beta-7MI67AHK.js +2 -0
- package/dist-cli/chunks/{chunk-XZ5SQJM2.js → chunk-2HVRBEOU.js} +128 -36
- package/dist-cli/chunks/chunk-2NFRZQ3K.js +73 -0
- package/dist-cli/chunks/{chunk-22CO2ZE3.js → chunk-3HF6BNSA.js} +2 -2
- package/dist-cli/chunks/{chunk-GDCMTHEU.js → chunk-3NNUNABL.js} +1 -1
- package/dist-cli/chunks/{chunk-BD76YSRN.js → chunk-3QA6YYSG.js} +2 -2
- package/dist-cli/chunks/{chunk-T4YLDM5C.js → chunk-52QFCYGQ.js} +3 -3
- package/dist-cli/chunks/chunk-5LDGAVAV.js +23 -0
- package/dist-cli/chunks/{chunk-LRBMW2WC.js → chunk-5QUYJKLU.js} +2 -2
- package/dist-cli/chunks/chunk-5SGAFI2M.js +23 -0
- package/dist-cli/chunks/{chunk-VRV2X4X2.js → chunk-6453CCSA.js} +1 -1
- package/dist-cli/chunks/{chunk-FXF2FHPI.js → chunk-6JGI2JVM.js} +2 -2
- package/dist-cli/chunks/chunk-6TQ2IBH6.js +2 -0
- package/dist-cli/chunks/chunk-72Y42WVX.js +186 -0
- package/dist-cli/chunks/{chunk-4LYNJPUM.js → chunk-BQLKO6NP.js} +2 -2
- package/dist-cli/chunks/{chunk-AYBGSHQK.js → chunk-C3R25CWY.js} +2 -2
- package/dist-cli/chunks/{chunk-TJEP4DBA.js → chunk-CFR6W2AH.js} +2 -2
- package/dist-cli/chunks/chunk-CMEWLMED.js +1 -0
- package/dist-cli/chunks/chunk-CZWZG7GL.js +2 -0
- package/dist-cli/chunks/chunk-D5LXWWGN.js +12 -0
- package/dist-cli/chunks/{chunk-EIQLQDKX.js → chunk-E7FCGYB5.js} +2 -2
- package/dist-cli/chunks/{chunk-DEQ7RED3.js → chunk-FBO7YRJM.js} +2 -2
- package/dist-cli/chunks/chunk-FITG7BVA.js +1 -0
- package/dist-cli/chunks/{chunk-BEQD2DSK.js → chunk-G3WXMB3Z.js} +1 -1
- package/dist-cli/chunks/chunk-GFXFPPNR.js +35 -0
- package/dist-cli/chunks/chunk-H6YUT7HX.js +372 -0
- package/dist-cli/chunks/{chunk-D4VEI6MI.js → chunk-HC43PTFD.js} +1 -1
- package/dist-cli/chunks/chunk-HPFXTPOD.js +1 -0
- package/dist-cli/chunks/{chunk-V4SZERWD.js → chunk-J7XCQWQI.js} +14 -14
- package/dist-cli/chunks/{chunk-HIN5TAAL.js → chunk-K6N6DEL5.js} +1 -1
- package/dist-cli/chunks/{chunk-6AP6LXVV.js → chunk-KKK4RTBP.js} +1 -1
- package/dist-cli/chunks/{chunk-NCSGLZRV.js → chunk-OFTI3N27.js} +2 -2
- package/dist-cli/chunks/{chunk-BTHB3PMG.js → chunk-QHAZOOK2.js} +3 -3
- package/dist-cli/chunks/{chunk-4NT6VRUU.js → chunk-QYFPV5YO.js} +1 -1
- package/dist-cli/chunks/chunk-TBVBPZRF.js +3 -0
- package/dist-cli/chunks/{chunk-LVFWALS4.js → chunk-TKDMCYGS.js} +2 -2
- package/dist-cli/chunks/{chunk-LCKLQSZX.js → chunk-TY5CBM3C.js} +2 -2
- package/dist-cli/chunks/{chunk-WAOLC7WV.js → chunk-TZYXNQHA.js} +1 -1
- package/dist-cli/chunks/chunk-U7KUAZJB.js +119 -0
- package/dist-cli/chunks/{chunk-M2Q4FXRE.js → chunk-WHJFB6AK.js} +1 -1
- package/dist-cli/chunks/{chunk-HWCZYW6M.js → chunk-WIW3G6HS.js} +2 -2
- package/dist-cli/chunks/chunk-WXISHMXL.js +2 -0
- package/dist-cli/chunks/{chunk-UMXVWFST.js → chunk-YSDIOWNN.js} +1 -1
- package/dist-cli/chunks/{chunk-EEMGSSWY.js → chunk-Z6BCORBY.js} +2 -2
- package/dist-cli/chunks/{chunk-UNSLXX7V.js → chunk-ZP7YYRHI.js} +2 -2
- package/dist-cli/chunks/cli-version-LM6OBGUK.js +2 -0
- package/dist-cli/chunks/{compat-I7JXYUJN.js → compat-Z3IFUQ73.js} +3 -3
- package/dist-cli/chunks/{config-3HR5RKVH.js → config-XBERIMLW.js} +2 -2
- package/dist-cli/chunks/control-SWOP3KB7.js +2 -0
- package/dist-cli/chunks/{cpu-profile-ZVHMTVAU.js → cpu-profile-SNX23Q5V.js} +2 -2
- package/dist-cli/chunks/daemon-QQPC4GOV.js +65 -0
- package/dist-cli/chunks/{debug-CQ6Y7GJ2.js → debug-WENYS45R.js} +5 -5
- package/dist-cli/chunks/demo-app-registry-QWOGX5C2.js +2 -0
- package/dist-cli/chunks/{detox-7ZKTGLDR.js → detox-P4N47V6P.js} +2 -2
- package/dist-cli/chunks/{device-4M6Z7E2N.js → device-5WWFV22H.js} +2 -2
- package/dist-cli/chunks/{diagnose-SMQLYGNX.js → diagnose-HJ4F3ER7.js} +2 -2
- package/dist-cli/chunks/drivers-GAEMIY75.js +2 -0
- package/dist-cli/chunks/{electron-6N2MIN5W.js → electron-JHFA2OGV.js} +3 -3
- package/dist-cli/chunks/flow-J67STV2Q.js +2 -0
- package/dist-cli/chunks/{hints-RJCZS2E3.js → hints-UHQ2T2RX.js} +2 -2
- package/dist-cli/chunks/{home-paths-DCUNA3CD.js → home-paths-NWDFFIX4.js} +2 -2
- package/dist-cli/chunks/inspect-O34RH4AE.js +970 -0
- package/dist-cli/chunks/install-ZB2AGO44.js +2 -0
- package/dist-cli/chunks/{install-desktop-C7424OSW.js → install-desktop-RYP35PHA.js} +3 -3
- package/dist-cli/chunks/{keys-TXUQOAZ3.js → keys-U5YI77TK.js} +2 -2
- package/dist-cli/chunks/{launch-MVA44QTC.js → launch-UFOGCQWO.js} +3 -3
- package/dist-cli/chunks/{login-NHO2WTHC.js → login-SPX6IK6Q.js} +4 -4
- package/dist-cli/chunks/{logout-SRRWADCE.js → logout-I6UE3XYL.js} +2 -2
- package/dist-cli/chunks/{maestro-UHNXEZAN.js → maestro-IPEULAUZ.js} +2 -2
- package/dist-cli/chunks/{preview-ETIUP7KC.js → preview-CE27FPGG.js} +2 -2
- package/dist-cli/chunks/{profile-MY5JFVIF.js → profile-JZSFMO2Y.js} +2 -2
- package/dist-cli/chunks/{react-KCMC4GL3.js → react-6IJQG4V3.js} +2 -2
- package/dist-cli/chunks/record-6WDKEBXL.js +70 -0
- package/dist-cli/chunks/runtime-P54OGI57.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-LQZIWQU6.js → runtime-delivery-C4KG6ISS.js} +2 -2
- package/dist-cli/chunks/screenshot-VQTI6G32.js +33 -0
- package/dist-cli/chunks/{screenshot-mode-USPWASI3.js → screenshot-mode-JBDCHRSS.js} +2 -2
- package/dist-cli/chunks/{screenshots-EPEDNA6H.js → screenshots-HLMGN2OX.js} +2 -2
- package/dist-cli/chunks/{server-222QT33M.js → server-U3QLKQDX.js} +6 -6
- package/dist-cli/chunks/setup-repo-TZULA5RK.js +2 -0
- package/dist-cli/chunks/{skills-6XRREE2M.js → skills-SMML5DJP.js} +2 -2
- package/dist-cli/chunks/{start-YCAZBZEX.js → start-7SCU4I64.js} +4 -4
- package/dist-cli/chunks/store-WEIVIM3L.js +2 -0
- package/dist-cli/chunks/telemetry-U3BBVPLJ.js +2 -0
- package/dist-cli/chunks/{test-6TNRHSWC.js → test-UWFHFDN7.js} +3 -3
- package/dist-cli/chunks/{three-mode-MDOLHGXW.js → three-mode-CJUNGCIF.js} +2 -2
- package/dist-cli/chunks/{timeline-72MWE44G.js → timeline-DIRXVM6R.js} +3 -3
- package/dist-cli/chunks/{upgrade-IHZ4DFAE.js → upgrade-LQQU4GSZ.js} +2 -2
- package/dist-cli/chunks/upload-SSAFKJGF.js +2 -0
- package/dist-cli/chunks/web-AJU6QA43.js +2 -0
- package/dist-cli/chunks/what-happened-QFXDQ6VU.js +22 -0
- package/dist-cli/chunks/{whoami-2EYGCRDQ.js → whoami-HWXPDZEF.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 +9 -2
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +23 -7
- 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 +23 -7
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/agent-IW7CCSSI.js +0 -61
- package/dist-cli/chunks/auto-bootstrap-PS2UDBP7.js +0 -2
- package/dist-cli/chunks/beta-XLYWSKEA.js +0 -2
- package/dist-cli/chunks/chunk-5MVFADNH.js +0 -3
- package/dist-cli/chunks/chunk-7NYW73Q6.js +0 -2
- package/dist-cli/chunks/chunk-EMMX6RF7.js +0 -73
- package/dist-cli/chunks/chunk-FIIBCY5I.js +0 -3
- package/dist-cli/chunks/chunk-G4VWDOWB.js +0 -17
- package/dist-cli/chunks/chunk-GMKGJHVG.js +0 -1
- package/dist-cli/chunks/chunk-M3ZEZHOB.js +0 -34
- package/dist-cli/chunks/chunk-MWTMLNGM.js +0 -348
- package/dist-cli/chunks/chunk-NQKBIKUZ.js +0 -1
- package/dist-cli/chunks/chunk-QMRXLBPN.js +0 -11
- package/dist-cli/chunks/chunk-X4HQLK4V.js +0 -119
- package/dist-cli/chunks/chunk-XOTJSR4T.js +0 -2
- package/dist-cli/chunks/chunk-YSQV4D7P.js +0 -1
- package/dist-cli/chunks/chunk-Z6HSVZIO.js +0 -100
- package/dist-cli/chunks/cli-version-ESQ2S6N5.js +0 -2
- package/dist-cli/chunks/control-TDZXFNVT.js +0 -2
- package/dist-cli/chunks/daemon-VYRTYH55.js +0 -83
- package/dist-cli/chunks/demo-app-registry-JAYU7BBM.js +0 -2
- package/dist-cli/chunks/drivers-SIY6JBEM.js +0 -2
- package/dist-cli/chunks/flow-BZEWL7UQ.js +0 -2
- package/dist-cli/chunks/inspect-T5NC7HHB.js +0 -1025
- package/dist-cli/chunks/install-YTJI5RS7.js +0 -2
- package/dist-cli/chunks/record-DHDSXC2Y.js +0 -51
- package/dist-cli/chunks/runtime-AJP6V5LM.js +0 -2
- package/dist-cli/chunks/screenshot-4KPEEI6I.js +0 -28
- package/dist-cli/chunks/setup-repo-D56L3CEB.js +0 -2
- package/dist-cli/chunks/store-Z32KZ34K.js +0 -2
- package/dist-cli/chunks/telemetry-RFTX2BZK.js +0 -2
- package/dist-cli/chunks/upload-G5C7LJWG.js +0 -2
- package/dist-cli/chunks/web-JLJSJUS2.js +0 -2
- package/dist-cli/chunks/what-happened-BUXSJ3QS.js +0 -15
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as y,L as x,y as F,z as T}from"./chunk-J7XCQWQI.js";import{c as S,e as N}from"./chunk-5LDGAVAV.js";import{b as k}from"./chunk-6453CCSA.js";import"./chunk-CZWZG7GL.js";import"./chunk-G3WXMB3Z.js";import"./chunk-HC43PTFD.js";function _(n){let e=[];for(let t=0;t<n.length;t++)if(n[t]==="--since"&&t+1<n.length){e.push(t,t+1);let s=n[t+1].trim(),l=/^(\d+(?:\.\d+)?)(ms|s|m)?$/.exec(s);if(l){let a=Number(l[1]),m=l[2]??"ms",$=m==="s"?a*1e3:m==="m"?a*6e4:a;return{since:Date.now()-$,consumed:e}}let o=Number(s);if(Number.isFinite(o)&&o>1e12)return{since:o,consumed:e}}return{consumed:e}}function K(n){let e=[];for(let t=0;t<n.length;t++)if(n[t]==="--kinds"&&t+1<n.length)return e.push(t,t+1),{kinds:n[t+1].split(",").map(s=>s.trim()).filter(Boolean),consumed:e};return{consumed:e}}function O(n){let e=[];for(let t=0;t<n.length;t++)if(n[t]==="--limit"&&t+1<n.length){e.push(t,t+1);let s=Number(n[t+1]);if(Number.isFinite(s)&&s>0)return{limit:s,consumed:e}}return{consumed:e}}function j(n,e){if(e===null)return new Date(n).toLocaleTimeString();let t=(n-e)/1e3;return`${t>=0?"+":""}${t.toFixed(2)}s`}function B(n,e){switch(n){case"app-launch":return e.phase==="launch"?`launch ${e.appName??e.toAppId??""}`:`dismiss ${e.appName??e.fromAppId??""} \u2192 ${e.toAppId??""}`;case"toast":return`"${e.text??""}"${e.durationMs?` (${e.durationMs}ms)`:""}`;case"keyboard":return`${e.phase??"?"}${e.heightPx?` h=${e.heightPx}`:""}${e.mode?` ${e.mode}`:""}`;case"screen":return`${e.phase??"?"} ${e.name??e.activeName??""}`;case"route":return`${e.phase??"?"} ${e.path??e.pathname??""}`;case"alert":case"actionsheet":case"picker":return`${e.phase??"?"} ${e.title??e.message??""}`;case"notification":return`${e.title??""}${e.body?` \u2014 ${e.body}`:""}`;case"fetch":return`${e.method??"GET"} ${e.url??""}${e.status?` -> ${e.status}`:""}`;case"console":return`${e.level??"log"}: ${(e.message??"").toString().slice(0,120)}`;case"shell":return`${e.event??e.type??e.phase??""}`;case"scroll":return`${e.phase??"?"} ${e.target??""}`;case"gesture":return`${e.phase??"?"} ${e.type??""}`;case"text-input":return`${e.phase??"?"}${e.value!==void 0?` "${String(e.value).slice(0,40)}"`:""}`;case"layout":return`${e.kind??"?"} ${e.testID??e.type??""}${e.skipped?` skipped:${e.reason??"unknown"}`:""}`;case"react-commit":{let t=e.slowest;return`${e.fiberCount??"?"} fibers ${e.durationMs??"?"}ms${t?.displayName?` \xB7 ${t.displayName} ${t.durationMs??"?"}ms`:""}`}case"reanimated":case"animation":return`${e.kind??""} ${e.target??""}${e.durationMs?` ${e.durationMs}ms`:""}`}}function A(n,e){let t=j(n.t,e).padStart(8),s=n.context.padEnd(6),l=`[${n.kind}]`.padEnd(15),o="",a=n.data;return a&&typeof a=="object"&&(o=B(n.kind,a)),` ${t} ${s} ${l} ${o}`}function M(n){let e=[],t={label:"initial state",events:[],startedAt:n[0]?.t??null};e.push(t);for(let s of n)if(t.events.push(s),s.kind==="screen"||s.kind==="route"){let l=s.data,o=l?.phase;if(!o||o==="enter"||o==="appear"||o==="active"){let a=l?.name||l?.activeName||l?.path||l?.pathname||s.kind;e.length===1&&t.events.length===1?t.label=`${s.kind}: ${a}`:(t={label:`${s.kind}: ${a}`,events:[],startedAt:s.t},e.push(t))}}return e}async function J(n,e){let t=S(n,{port:e.port,stripBooleanFlags:["--summary","--all","--json","--no-advance","--help","-h","--flow","--noisy"],stripValueFlags:["--since","--kinds","--limit"]});(n.includes("--help")||n.includes("-h"))&&(console.log(`
|
|
3
|
+
sootsim what-happened \u2014 show recent events from the semantic timeline
|
|
4
|
+
|
|
5
|
+
usage:
|
|
6
|
+
sootsim what-happened # since last CLI call
|
|
7
|
+
sootsim what-happened --summary # one-line counts
|
|
8
|
+
sootsim what-happened --all # full ring (ignore cursor)
|
|
9
|
+
sootsim what-happened --since 5s # absolute window
|
|
10
|
+
sootsim what-happened --kinds toast,fetch
|
|
11
|
+
sootsim what-happened --noisy # include react-commit/layout/scroll
|
|
12
|
+
sootsim what-happened --limit 50
|
|
13
|
+
sootsim what-happened --json
|
|
14
|
+
sootsim what-happened --no-advance # don't advance cursor after read
|
|
15
|
+
|
|
16
|
+
note: by default react-commit, layout, and scroll events are hidden as
|
|
17
|
+
noise \u2014 pass --noisy or include them in --kinds to see them.
|
|
18
|
+
`),process.exit(0));let s=n.includes("--summary"),l=n.includes("--flow"),o=n.includes("--all"),a=n.includes("--json"),m=n.includes("--no-advance"),$=n.includes("--noisy"),{since:c}=_(n),{kinds:p}=K(n),{limit:E}=O(n),g=k(),w={limit:E??200,...p&&p.length?{kinds:p}:{},...c!==void 0?{since:c}:o?{}:{sinceCursor:g}},d=N(t);try{if(s){let r=await F(d,w);if(a)console.log(JSON.stringify(r));else{let u=o?"all time":c!==void 0?`last ${((Date.now()-c)/1e3).toFixed(1)}s`:"since last call";console.log(` ${u}: ${x(r)}`)}!m&&!o&&r.lastAt&&await y(d,g,r.lastAt);return}let i=await T(d,w),b=new Set(["react-commit","layout","scroll"]),I=Array.isArray(p)&&p.some(r=>b.has(r)),C=!$&&!I,h=0;if(C){let r=i.events.filter(u=>b.has(u.kind)?(h+=1,!1):!0);i.events=r}if(a)console.log(JSON.stringify(l?M(i.events):i,null,2));else{if(i.events.length===0)h>0?console.log(` no non-noise events (${h} react-commit/layout/scroll hidden)`):console.log(o?" no events recorded":c!==void 0?" no events in window":" no new events since last call");else if(l){let r=i.events[0]?.t??null,u=M(i.events),v=o?`\u2500\u2500\u2500 ${i.events.length} event(s) total \u2014 flow view \u2500\u2500\u2500`:c!==void 0?`\u2500\u2500\u2500 ${i.events.length} event(s) in last ${((Date.now()-c)/1e3).toFixed(1)}s \u2014 flow view \u2500\u2500\u2500`:`\u2500\u2500\u2500 ${i.events.length} event(s) since last call \u2014 flow view \u2500\u2500\u2500`;console.log(` ${v}`);for(let f of u){console.log(`
|
|
19
|
+
\u2500\u2500 ${f.label} (${f.events.length} event${f.events.length===1?"":"s"}) \u2500\u2500`);for(let D of f.events)console.log(A(D,r))}}else{let r=i.events[0]?.t??null,u=o?`\u2500\u2500\u2500 ${i.events.length} event(s) total \u2500\u2500\u2500`:c!==void 0?`\u2500\u2500\u2500 ${i.events.length} event(s) in last ${((Date.now()-c)/1e3).toFixed(1)}s \u2500\u2500\u2500`:`\u2500\u2500\u2500 ${i.events.length} event(s) since last call \u2500\u2500\u2500`;console.log(` ${u}`);for(let v of i.events)console.log(A(v,r))}h>0&&i.events.length>0&&process.stderr.write(`
|
|
20
|
+
${h} high-frequency event(s) hidden (react-commit/layout/scroll)
|
|
21
|
+
rerun with --noisy or --kinds react-commit,layout,scroll to include them
|
|
22
|
+
`)}!m&&!o&&i.watermark>0&&await y(d,g,i.watermark)}finally{d.close()}}export{J as runWhatHappened};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{d as i}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as i}from"./chunk-Z6BCORBY.js";import{d as n}from"./chunk-E7FCGYB5.js";import"./chunk-G3WXMB3Z.js";import"./chunk-HC43PTFD.js";async function u(){let o=i();if(o||(console.log(" not signed in"),console.log(" set SOOTSIM_API_KEY=sk_sootsim_\u2026 or run `sootsim login`"),process.exit(1)),o.kind==="api-key"){let r=`${o.secret.slice(0,14)}\u2026`,t=o.source==="env"?"SOOTSIM_API_KEY env var":"saved key (~/.config/sootsim/credentials.json)";console.log(` api key ${r}`),console.log(` source: ${t}`);return}if(o.kind==="github"){console.log(` github token (${o.source})`),console.log(` repo: ${o.repoId}`);return}let e=await n(),s=e?.user;console.log(` ${s?.email||s?.name||s?.id||"signed in"}`),console.log(` origin: ${e?.origin??o.origin}`),e?.updatedAt&&console.log(` updated: ${e.updatedAt}`)}export{u as runWhoami};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/config.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -156,7 +156,14 @@ async function resolveConnectionInput(input) {
|
|
|
156
156
|
const port2 = parseInt(trimmed, 10);
|
|
157
157
|
const resolved = await probePortBundle(port2);
|
|
158
158
|
if (resolved) return resolved;
|
|
159
|
-
|
|
159
|
+
const SHIFT_WINDOW = 3;
|
|
160
|
+
for (let offset = 1; offset <= SHIFT_WINDOW; offset++) {
|
|
161
|
+
const shifted = await probePortBundle(port2 + offset);
|
|
162
|
+
if (shifted) return shifted;
|
|
163
|
+
}
|
|
164
|
+
throw buildUnresolvedTargetError(
|
|
165
|
+
`localhost:${port2} (also scanned +1..+${SHIFT_WINDOW})`
|
|
166
|
+
);
|
|
160
167
|
}
|
|
161
168
|
const bundleUrl = trimmed.startsWith("http") ? trimmed : `http://${trimmed}`;
|
|
162
169
|
let parsed;
|
package/dist-lib/home-paths.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -3572,7 +3572,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
3572
3572
|
}
|
|
3573
3573
|
if (msg.type === "bridge:user-focus-state" && sim) {
|
|
3574
3574
|
const focusState = msg;
|
|
3575
|
-
this.updateUserFocusLease(sim, focusState
|
|
3575
|
+
this.updateUserFocusLease(sim, focusState);
|
|
3576
3576
|
return;
|
|
3577
3577
|
}
|
|
3578
3578
|
if (msg.type === "bridge:user-interact" && sim) {
|
|
@@ -4188,6 +4188,8 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4188
4188
|
let rel = url.pathname;
|
|
4189
4189
|
if (rel === "/runtime" || rel === "/runtime/") rel = "/";
|
|
4190
4190
|
else if (rel.startsWith("/runtime/")) rel = rel.slice("/runtime".length);
|
|
4191
|
+
else if (rel === "/sootsim" || rel === "/sootsim/") rel = "/";
|
|
4192
|
+
else if (rel.startsWith("/sootsim/")) rel = rel.slice("/sootsim".length);
|
|
4191
4193
|
if (rel === "" || rel === "/") rel = "/index.html";
|
|
4192
4194
|
if (rel.includes("\0")) {
|
|
4193
4195
|
res.writeHead(400);
|
|
@@ -4557,6 +4559,9 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4557
4559
|
lockedByKind: lease ? lease.kind : void 0,
|
|
4558
4560
|
lockExpiresAt: lease ? lease.expiresAt : void 0,
|
|
4559
4561
|
userFocused: sim.userFocused || void 0,
|
|
4562
|
+
userVisible: sim.userVisible,
|
|
4563
|
+
visibilityState: sim.visibilityState,
|
|
4564
|
+
documentFocused: sim.documentFocused,
|
|
4560
4565
|
kind: sim.kind,
|
|
4561
4566
|
meta: sim.meta
|
|
4562
4567
|
};
|
|
@@ -4621,10 +4626,18 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4621
4626
|
// locked out agent inspect calls for 15s — the opposite of what you want
|
|
4622
4627
|
// when debugging something the user is actively looking at. use
|
|
4623
4628
|
// updateUserActivity() to lock on real interaction instead.
|
|
4624
|
-
updateUserFocusLease(sim,
|
|
4625
|
-
const
|
|
4626
|
-
|
|
4627
|
-
|
|
4629
|
+
updateUserFocusLease(sim, focusState) {
|
|
4630
|
+
const nextFocused = focusState.focused === true;
|
|
4631
|
+
const nextVisible = typeof focusState.visible === "boolean" ? focusState.visible : void 0;
|
|
4632
|
+
const nextVisibilityState = typeof focusState.visibilityState === "string" ? focusState.visibilityState : void 0;
|
|
4633
|
+
const nextDocumentFocused = typeof focusState.documentFocused === "boolean" ? focusState.documentFocused : void 0;
|
|
4634
|
+
if (sim.userFocused === nextFocused && sim.userVisible === nextVisible && sim.visibilityState === nextVisibilityState && sim.documentFocused === nextDocumentFocused) {
|
|
4635
|
+
return;
|
|
4636
|
+
}
|
|
4637
|
+
sim.userFocused = nextFocused;
|
|
4638
|
+
sim.userVisible = nextVisible;
|
|
4639
|
+
sim.visibilityState = nextVisibilityState;
|
|
4640
|
+
sim.documentFocused = nextDocumentFocused;
|
|
4628
4641
|
this.broadcastSimClientStates();
|
|
4629
4642
|
}
|
|
4630
4643
|
// called when the sim reports a real user interaction (pointerdown,
|
|
@@ -4714,7 +4727,10 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4714
4727
|
lockedBy: lease ? lease.cliLabel || lease.cliIdentityKey : void 0,
|
|
4715
4728
|
lockedByKind: lease ? lease.kind : void 0,
|
|
4716
4729
|
lockExpiresAt: lease ? lease.expiresAt : void 0,
|
|
4717
|
-
userFocused: sim.userFocused || void 0
|
|
4730
|
+
userFocused: sim.userFocused || void 0,
|
|
4731
|
+
userVisible: sim.userVisible,
|
|
4732
|
+
visibilityState: sim.visibilityState,
|
|
4733
|
+
documentFocused: sim.documentFocused
|
|
4718
4734
|
};
|
|
4719
4735
|
sim.ws.send(JSON.stringify(message));
|
|
4720
4736
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/dist-lib/metro.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/dist-lib/profiles.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/dist-lib/render-mode.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/vite-base.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -3682,7 +3682,7 @@ var init_bridge_host = __esm({
|
|
|
3682
3682
|
}
|
|
3683
3683
|
if (msg.type === "bridge:user-focus-state" && sim) {
|
|
3684
3684
|
const focusState = msg;
|
|
3685
|
-
this.updateUserFocusLease(sim, focusState
|
|
3685
|
+
this.updateUserFocusLease(sim, focusState);
|
|
3686
3686
|
return;
|
|
3687
3687
|
}
|
|
3688
3688
|
if (msg.type === "bridge:user-interact" && sim) {
|
|
@@ -4298,6 +4298,8 @@ var init_bridge_host = __esm({
|
|
|
4298
4298
|
let rel = url.pathname;
|
|
4299
4299
|
if (rel === "/runtime" || rel === "/runtime/") rel = "/";
|
|
4300
4300
|
else if (rel.startsWith("/runtime/")) rel = rel.slice("/runtime".length);
|
|
4301
|
+
else if (rel === "/sootsim" || rel === "/sootsim/") rel = "/";
|
|
4302
|
+
else if (rel.startsWith("/sootsim/")) rel = rel.slice("/sootsim".length);
|
|
4301
4303
|
if (rel === "" || rel === "/") rel = "/index.html";
|
|
4302
4304
|
if (rel.includes("\0")) {
|
|
4303
4305
|
res.writeHead(400);
|
|
@@ -4667,6 +4669,9 @@ var init_bridge_host = __esm({
|
|
|
4667
4669
|
lockedByKind: lease ? lease.kind : void 0,
|
|
4668
4670
|
lockExpiresAt: lease ? lease.expiresAt : void 0,
|
|
4669
4671
|
userFocused: sim.userFocused || void 0,
|
|
4672
|
+
userVisible: sim.userVisible,
|
|
4673
|
+
visibilityState: sim.visibilityState,
|
|
4674
|
+
documentFocused: sim.documentFocused,
|
|
4670
4675
|
kind: sim.kind,
|
|
4671
4676
|
meta: sim.meta
|
|
4672
4677
|
};
|
|
@@ -4731,10 +4736,18 @@ var init_bridge_host = __esm({
|
|
|
4731
4736
|
// locked out agent inspect calls for 15s — the opposite of what you want
|
|
4732
4737
|
// when debugging something the user is actively looking at. use
|
|
4733
4738
|
// updateUserActivity() to lock on real interaction instead.
|
|
4734
|
-
updateUserFocusLease(sim,
|
|
4735
|
-
const
|
|
4736
|
-
|
|
4737
|
-
|
|
4739
|
+
updateUserFocusLease(sim, focusState) {
|
|
4740
|
+
const nextFocused = focusState.focused === true;
|
|
4741
|
+
const nextVisible = typeof focusState.visible === "boolean" ? focusState.visible : void 0;
|
|
4742
|
+
const nextVisibilityState = typeof focusState.visibilityState === "string" ? focusState.visibilityState : void 0;
|
|
4743
|
+
const nextDocumentFocused = typeof focusState.documentFocused === "boolean" ? focusState.documentFocused : void 0;
|
|
4744
|
+
if (sim.userFocused === nextFocused && sim.userVisible === nextVisible && sim.visibilityState === nextVisibilityState && sim.documentFocused === nextDocumentFocused) {
|
|
4745
|
+
return;
|
|
4746
|
+
}
|
|
4747
|
+
sim.userFocused = nextFocused;
|
|
4748
|
+
sim.userVisible = nextVisible;
|
|
4749
|
+
sim.visibilityState = nextVisibilityState;
|
|
4750
|
+
sim.documentFocused = nextDocumentFocused;
|
|
4738
4751
|
this.broadcastSimClientStates();
|
|
4739
4752
|
}
|
|
4740
4753
|
// called when the sim reports a real user interaction (pointerdown,
|
|
@@ -4824,7 +4837,10 @@ var init_bridge_host = __esm({
|
|
|
4824
4837
|
lockedBy: lease ? lease.cliLabel || lease.cliIdentityKey : void 0,
|
|
4825
4838
|
lockedByKind: lease ? lease.kind : void 0,
|
|
4826
4839
|
lockExpiresAt: lease ? lease.expiresAt : void 0,
|
|
4827
|
-
userFocused: sim.userFocused || void 0
|
|
4840
|
+
userFocused: sim.userFocused || void 0,
|
|
4841
|
+
userVisible: sim.userVisible,
|
|
4842
|
+
visibilityState: sim.visibilityState,
|
|
4843
|
+
documentFocused: sim.documentFocused
|
|
4828
4844
|
};
|
|
4829
4845
|
sim.ws.send(JSON.stringify(message));
|
|
4830
4846
|
}
|
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.68 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/package.json
CHANGED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a as y,b as $,c as b,d as l,e as E,g as A,h as j,j as S,m as I,n as T,o as x,p as g,q as k,r as D}from"./chunk-BD76YSRN.js";import"./chunk-M2Q4FXRE.js";import"./chunk-7NYW73Q6.js";import"./chunk-BEQD2DSK.js";import"./chunk-D4VEI6MI.js";import w from"node:fs";import d from"node:path";import{spawn as N}from"node:child_process";import U from"node:net";import{WebSocket as O}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new O(`ws://localhost:${this.port}`),this.ready=new Promise((t,s)=>{let r=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",r),s(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",r),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==O.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let s=this.nextId++;return new Promise((r,o)=>{let i=setTimeout(()=>{this.pending.delete(s),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(s,{resolve:r,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:s,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(s),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let r of this.eventListeners)try{r({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let r of this.statusListeners)try{r(t.session)}catch{}return}if(typeof t.id!="number")return;let s=this.pending.get(t.id);s&&(this.pending.delete(t.id),clearTimeout(s.timer),t.error?s.reject(new c(t.error,t.code)):s.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function R(n=7668,e=400){return new Promise(t=>{let s=new U.Socket,r=!1,o=i=>{r||(r=!0,s.destroy(),t(i))};s.setTimeout(e),s.once("connect",()=>o(!0)),s.once("timeout",()=>o(!1)),s.once("error",()=>o(!1)),s.connect(n,"127.0.0.1")})}async function _(n={}){let e=n.port??7668;if(await R(e))return{alreadyRunning:!0};let{cmd:t,prefixArgs:s}=D(),r=[...s,"server","--quiet"];e!==7668&&r.push("--port",String(e));let o=N(t,r,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(n.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await R(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned sootsim daemon on port ${e} but it did not come up in time. run \`sootsim server\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await _({port:n.port,startupTimeoutMs:n.startupTimeoutMs});let e=new f(n);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function ue(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return C(),0;case"attach":return await F(t);case"projects":return await B();case"project":return await W(t);case"sessions":return await J(t);case"start":return await V(t);case"prompt":return await q(t);case"watch":return await G(t);case"transcript":return await H(t);case"end":return await K(t);case"paths":return await z();default:return process.stderr.write(`unknown agent subcommand: ${e}
|
|
3
|
-
`),C(),2}}catch(s){if(s instanceof c)return process.stderr.write(`${s.message}
|
|
4
|
-
`),1;throw s}}async function v(n){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await n(e)}finally{e.close()}}function C(){process.stdout.write(`sootsim agent \u2014 attached projects + local agent sessions
|
|
5
|
-
|
|
6
|
-
attach <dir> [--name X] [--provider codex|claude]
|
|
7
|
-
projects list attached projects
|
|
8
|
-
project show <id> print full detail for one project
|
|
9
|
-
project remove <id> delete a project + its sessions
|
|
10
|
-
sessions [--project <id>] [--all]
|
|
11
|
-
list agent sessions (default: active only)
|
|
12
|
-
start <projectId> [--provider codex|claude]
|
|
13
|
-
spawn a wrapper session (detached)
|
|
14
|
-
prompt <sessionId> "<text>" enqueue a prompt on the session
|
|
15
|
-
watch <sessionId> stream events.out pretty-printed
|
|
16
|
-
transcript <sessionId> cat the raw transcript file
|
|
17
|
-
end <sessionId> stop the wrapper + mark session ended
|
|
18
|
-
paths print userData + state file locations
|
|
19
|
-
`)}function P(n,e){let t={},s=[];for(let r=0;r<n.length;r++){let o=n[r],i=e[o];i==="value"?(t[o]=n[r+1]??"",r++):i==="bool"?t[o]=!0:s.push(o)}return{flags:t,positional:s}}function L(n,e="codex"){return n==="codex"||n==="claude"?n:e}async function F(n){let{flags:e,positional:t}=P(n,{"--name":"value","--provider":"value"}),s=t[0];if(!s)return process.stderr.write(`usage: sootsim agent attach <dir> [--name X] [--provider codex|claude]
|
|
20
|
-
`),2;let r=d.resolve(s);if(!w.existsSync(r))return process.stderr.write(`directory does not exist: ${r}
|
|
21
|
-
`),1;let o=b({cwd:r,name:e["--name"]||d.basename(r),preferredProvider:L(e["--provider"]),sourceRoots:[r]});return process.stdout.write(`\u2713 attached "${o.name}" (id: ${o.id})
|
|
22
|
-
cwd: ${o.cwd}
|
|
23
|
-
framework: ${o.framework}
|
|
24
|
-
preferred provider: ${o.preferredProvider}
|
|
25
|
-
`),0}async function B(){let n=[...E()].sort((t,s)=>s.updatedAt-t.updatedAt);if(n.length===0)return process.stdout.write("no attached projects yet. try `sootsim agent attach <dir>`.\n"),0;let e=`${"ID".padEnd(18)} ${"NAME".padEnd(20)} ${"FRAMEWORK".padEnd(10)} ${"PROVIDER".padEnd(8)} ${"7D COST".padEnd(10)} CWD
|
|
26
|
-
`;process.stdout.write(e);for(let t of n){let s=A(t),r=s>0?`$${s.toFixed(2)}`:"\u2014";process.stdout.write(`${t.id.padEnd(18)} ${p(t.name,20).padEnd(20)} ${t.framework.padEnd(10)} ${t.preferredProvider.padEnd(8)} ${r.padEnd(10)} ${t.cwd}
|
|
27
|
-
`)}return 0}async function W(n){let[e,t]=n;if(e==="show"){if(!t)return process.stderr.write(`usage: sootsim agent project show <id>
|
|
28
|
-
`),2;let s=l(t);return s?(process.stdout.write(JSON.stringify(s,null,2)+`
|
|
29
|
-
`),0):(process.stderr.write(`no project with id=${t}
|
|
30
|
-
`),1)}return e==="remove"?t?(j(t),process.stdout.write(`\u2713 removed project ${t}
|
|
31
|
-
`),0):(process.stderr.write(`usage: sootsim agent project remove <id>
|
|
32
|
-
`),2):(process.stderr.write(`usage: sootsim agent project [show|remove] <id>
|
|
33
|
-
`),2)}async function J(n){let{flags:e}=P(n,{"--project":"value","--all":"bool"}),t=e["--project"]||void 0,s=e["--all"]===!0,r=S(t);if(s||(r=r.filter(i=>i.status!=="ended")),r=r.sort((i,a)=>a.lastSeenAt-i.lastSeenAt),r.length===0)return process.stdout.write(s?`no sessions.
|
|
34
|
-
`:`no active sessions. pass --all to include ended.
|
|
35
|
-
`),0;let o=`${"SESSION".padEnd(26)} ${"PROJECT".padEnd(18)} ${"PROVIDER".padEnd(8)} ${"STATUS".padEnd(16)} ${"ALIVE".padEnd(5)} LAST PROMPT
|
|
36
|
-
`;process.stdout.write(o);for(let i of r){let a=k(i.wrapperPid,i.id)?"yes":"no",m=i.lastPrompt?p(i.lastPrompt,40):"";process.stdout.write(`${M(i.id).padEnd(26)} ${M(i.projectId).padEnd(18)} ${i.provider.padEnd(8)} ${i.status.padEnd(16)} ${a.padEnd(5)} ${m}
|
|
37
|
-
`)}return 0}async function V(n){let{flags:e,positional:t}=P(n,{"--provider":"value","--codex-bin":"value","--claude-bin":"value","--fresh-thread":"bool"}),s=t[0];if(!s)return process.stderr.write(`usage: sootsim agent start <projectId> [--provider codex|claude] [--fresh-thread]
|
|
38
|
-
`),2;let r=await v(i=>i.startSession({projectId:s,provider:L(e["--provider"],void 0)||void 0,codexBin:e["--codex-bin"]||void 0,claudeBin:e["--claude-bin"]||void 0,freshThread:e["--fresh-thread"]===!0})),o=l(r.session.projectId);return process.stdout.write(`\u2713 session ${r.session.id} started
|
|
39
|
-
project: ${o.name} (${o.id})
|
|
40
|
-
provider: ${r.session.provider}
|
|
41
|
-
pid: ${r.wrapperPid}
|
|
42
|
-
prompt with: sootsim agent prompt ${r.session.id} "<text>"
|
|
43
|
-
watch events: sootsim agent watch ${r.session.id}
|
|
44
|
-
`),0}async function q(n){let[e,...t]=n,s=t.join(" ");return!e||!s?(process.stderr.write(`usage: sootsim agent prompt <sessionId> "<text>"
|
|
45
|
-
`),2):(await v(r=>r.sendPrompt(e,{text:s})),process.stdout.write(`\u2713 prompt sent to ${e}
|
|
46
|
-
`),0)}async function G(n){let e=n[0];if(!e)return process.stderr.write(`usage: sootsim agent watch <sessionId>
|
|
47
|
-
`),2;process.stdout.write(`watching ${e}
|
|
48
|
-
---
|
|
49
|
-
`);let t=await h({clientLabel:"sootsim-agent-watch"}),s,r=new Promise(a=>{s=a}),o=t.onAgentEvent(({sessionId:a,event:m})=>{a===e&&process.stdout.write(X(m)+`
|
|
50
|
-
`)}),i=t.onDisconnect(()=>{process.stderr.write(`
|
|
51
|
-
[sootsim] daemon disconnected; exiting watch.
|
|
52
|
-
`),s(1)});try{await t.subscribeEvents(e)}catch(a){throw o(),i(),t.close(),a}return process.on("SIGINT",()=>{o(),i(),t.unsubscribeEvents(e).catch(()=>{}),t.close(),s(130)}),r}function X(n){let e=Q(n.ts);switch(n.type){case"ready":return`[${e}] ready ${n.provider} @ ${n.cwd}`;case"prompt-received":return`[${e}] prompt "${p(n.text,120)}"`;case"turn-started":return`[${e}] turn-started ${n.turnId??""}`;case"turn-message":return`[${e}] turn-message ${n.delta.replace(/\s+$/,"")}`;case"turn-reasoning":return`[${e}] turn-reasoning ${p(n.delta,200)}`;case"tool-call":return`[${e}] tool-call ${n.name}`;case"file-edited":return`[${e}] file-edited ${n.kind.padEnd(6)} ${n.path}`;case"turn-completed":return`[${e}] turn-completed ${n.durationMs}ms files=${n.filesTouched.length}`;case"approval-needed":return`[${e}] approval ${n.kind}`;case"error":return`[${e}] error ${n.message}`;case"exited":return`[${e}] exited code=${n.code}`;case"file-diff-delta":return`[${e}] file-diff-delta ${n.path}`;case"turn-plan":return`[${e}] turn-plan steps=${n.steps.length}`;default:return`[${e}] ${n.type}`}}async function H(n){let e=n[0];if(!e)return process.stderr.write(`usage: sootsim agent transcript <sessionId>
|
|
53
|
-
`),2;let t=g(e);return w.existsSync(t)?(process.stdout.write(w.readFileSync(t,"utf8")),0):(process.stderr.write(`transcript not found: ${t}
|
|
54
|
-
`),1)}async function K(n){let e=n[0];return e?(await v(t=>t.endSession(e)),process.stdout.write(`\u2713 ended session ${e}
|
|
55
|
-
`),0):(process.stderr.write(`usage: sootsim agent end <sessionId>
|
|
56
|
-
`),2)}async function z(){let n=$();return process.stdout.write(`userData: ${n}
|
|
57
|
-
state: ${d.join(n,"attached-projects.json")}
|
|
58
|
-
sessions: ${d.join(n,"sessions")}
|
|
59
|
-
transcripts: ${d.join(n,"transcripts")}
|
|
60
|
-
locks: ${d.join(n,"locks")}
|
|
61
|
-
`),0}function p(n,e){return n.length<=e?n:n.slice(0,e-1)+"\u2026"}function M(n){return n.length>14?`${n.slice(0,14)}\u2026`:n}function Q(n){return new Date(n).toISOString().replace("T"," ").slice(0,19)}var pe={sessionDir:I,promptFifoPath:T,eventsFifoPath:x,transcriptPath:g,parseAgentEventLine:y};export{pe as __internals,ue as runAgentCommand};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a,b,c,d}from"./chunk-BTHB3PMG.js";import"./chunk-G4VWDOWB.js";import"./chunk-VRV2X4X2.js";import"./chunk-7NYW73Q6.js";import"./chunk-BEQD2DSK.js";import"./chunk-D4VEI6MI.js";export{c as ensureDaemonRunning,a as ensureRuntimeInstalled,d as ensureSootsimReady,b as resolveBootstrapPort};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{B as E,j as B,k as b,l as I,m as S}from"./chunk-V4SZERWD.js";import{d as y,h as T,i as v}from"./chunk-G4VWDOWB.js";var C={timeoutMs:1800,settleMs:48,startWindowMs:64};function p(e){return new Promise(t=>setTimeout(t,e))}function A(e){return e.includes("--json")}function k(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
|
|
3
|
-
`)}async function P(e,t,...r){return T(e,`__sootsimTest.${t}`,...r)}async function W(e,t,...r){return v(e,`SootSim.bridges.mainShell.${t}`,...r)}async function F(e,t={}){try{let r=await P(e,"waitForScreenTransitions",C);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function O(e,t,r,...n){let a=Date.now()+Math.max(0,r);for(;;)try{return await W(e,t,...n)}catch(o){if(!E(o)||Date.now()>=a)throw o;await p(50)}}async function $(e,t,r,n={}){let a=n.attempts??30,o=n.intervalMs??500,m=n.minNodeCount??10;for(let s=0;s<a;s++){let u=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>m)return{bridge:u,count:c}}catch{}u.close(),await p(o)}return null}async function G(e,t,r,n={}){let a=n.timeoutMs??8e3,o=n.intervalMs??250,m=Date.now()+a;for(;Date.now()<m;){let s=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await s.send({type:"evaluate",code:"1"}),s}catch{s.close()}await p(o)}return null}async function H(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,a=t.pollIntervalMs??200,o=Date.now(),m=o+r,s=-1,u=o,c=null,M=!1,w={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,errors:0};for(;Date.now()<m;){try{let i=await e.send({type:"evaluate",code:B}),d=Date.now()-o,l=Number(i?.nodes)||0,g=Number(i?.targets)||0,f=Number(i?.errors)||0,R=i?.flag===!0,h=i?.externalReady,x=typeof i?.externalError=="string"&&i.externalError.trim().length>0;if(c=h,M=x,l!==s&&(s=l,u=d),w={ready:!1,source:"timeout",elapsedMs:d,nodes:l,targets:g,errors:f},R&&h!==!1&&!x&&l>=b&&S({nodes:l,targets:g})&&d-u>=I)return{ready:!0,source:"flag",elapsedMs:d,nodes:l,targets:g,errors:f};if(d>=n&&f>0&&!R)return{ready:!1,source:"error-bail",elapsedMs:d,nodes:l,targets:g,errors:f}}catch{}await p(a)}return c!==!1&&!M&&w.nodes>=b&&S(w)?{...w,ready:!0,source:"nodes-fallback"}:{...w,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}export{p as a,A as b,k as c,P as d,F as e,O as f,$ as g,G as h,H as i};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{d as te,e as ne}from"./chunk-EEMGSSWY.js";import{d as X}from"./chunk-HIN5TAAL.js";import{a as Q,b as v}from"./chunk-DEQ7RED3.js";import{a as Y}from"./chunk-EIQLQDKX.js";import{c as Z,e as ee,g as T}from"./chunk-G4VWDOWB.js";import{createHash as Re}from"crypto";import{readFileSync as oe}from"fs";import{gzipSync as ie}from"zlib";function re(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}function N(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function Be(e){let t=N(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${r.status}: ${s.slice(0,200)}`)}}async function Ie(e,t=8,r){let s=0,o=0,a=e.length;await Promise.all(Array.from({length:Math.min(t,a)},async()=>{for(;s<a;){let u=e[s++];await Be(u),o++,r?.(o,a)}}))}function Ue(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let a of e.files){let u=r.get(a.urlhash);u&&o.push({url:a.putUrl,contentType:a.contentType,bytes:u})}return e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),o}function Pe(e){return e.replace(/\/+$/,"")}var E=class extends Error{constructor(r,s,o,a=""){super(r);this.status=s;this.phase=o;this.responseText=a;this.name="PresignedUploadError"}};async function se(e){let t=Pe(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-soot-admin-upload-bypass"]=e.adminBypassToken);let s=N(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let y=await o.text().catch(()=>"");throw new E(`init failed: ${o.status} ${y.slice(0,200)}`,o.status,"init",y)}let a=await o.json(),u=Ue(a,e.bundleBytes,e.filesByHash,e.extras);await Ie(u,e.concurrency??8,e.onPutProgress);let B=N(3e4,"finalize"),g;try{g=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:B.signal})}finally{B.cancel()}if(!g.ok){let y=await g.text().catch(()=>"");throw new E(`finalize failed: ${g.status} ${y.slice(0,200)}`,g.status,"finalize",y)}let S=await g.json();return{init:a,finalize:S}}function xe(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}var ce=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",de=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",D="http://localhost:3000";async function Se(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${D}/api/preview/upload/init`,{method:"OPTIONS"});if(t.ok||t.status===204||t.status===405)return D}catch{}return ce}function U(e){return e.replace(/\/$/,"")}function Oe(e){try{let r=new URL(e).hostname.replace(/^\[|\]$/g,"").toLowerCase();return r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r)}catch{return!1}}function _e(e){try{let t=new URL(e).hostname.toLowerCase();return t==="sootbean.com"||t.endsWith(".sootbean.com")}catch{return!1}}function $e(e,t){return t?U(t):process.env.SOOTSIM_PREVIEW_ORIGIN?U(process.env.SOOTSIM_PREVIEW_ORIGIN):Oe(e)?U(e):_e(e)?U(de):U(e)}function ke(){console.log(`
|
|
3
|
-
sootsim upload \u2014 publish the current bundle as a /preview/<id> link
|
|
4
|
-
|
|
5
|
-
usage:
|
|
6
|
-
sootsim upload [--origin <url>] [--public-origin <url>] [--events <path>] [--sim <sim>] [--open] [--assets-only]
|
|
7
|
-
|
|
8
|
-
options:
|
|
9
|
-
--origin <url> upload target (default: auto)
|
|
10
|
-
prefers ${D} when available, otherwise
|
|
11
|
-
falls back to ${ce}
|
|
12
|
-
override with SOOTSIM_UPLOAD_ORIGIN env var
|
|
13
|
-
--public-origin <url>
|
|
14
|
-
public /preview link origin (default: ${de}
|
|
15
|
-
for prod uploads, upload origin for localhost/custom origins).
|
|
16
|
-
override with SOOTSIM_PREVIEW_ORIGIN env var
|
|
17
|
-
--events <path> path to a gzipped events .jsonl.gz file to attach
|
|
18
|
-
--video <path> path to a webm/mp4/gif flow recording. embedded inline
|
|
19
|
-
in the pr sticky comment served at
|
|
20
|
-
/api/preview/flow-video?id=<share-id>
|
|
21
|
-
--video-duration-ms <ms>
|
|
22
|
-
duration hint for attached flow video
|
|
23
|
-
--sim <sim> target a specific sim (see: sootsim list)
|
|
24
|
-
--open open the resulting /preview/<id> url in the browser
|
|
25
|
-
--assets-only drop API/JSON/HTML records before upload; keep images,
|
|
26
|
-
fonts, css, js, and binary blobs. live-data demos hit
|
|
27
|
-
the real network at replay time instead of serving
|
|
28
|
-
recorded API snapshots
|
|
29
|
-
-h, --help
|
|
30
|
-
|
|
31
|
-
examples:
|
|
32
|
-
sootsim upload
|
|
33
|
-
sootsim upload --origin http://localhost:3000 --open
|
|
34
|
-
sootsim upload --events ./my-session.jsonl.gz
|
|
35
|
-
sootsim upload --video /tmp/soot-flow.webm
|
|
36
|
-
`)}function x(e,t){let r=e.findIndex(o=>o===t);if(r<0)return;let s=e[r+1];return e.splice(r,2),s}function ae(e,t){let r=e.findIndex(s=>s===t);return r<0?!1:(e.splice(r,1),!0)}function le(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!!(t.startsWith("image/")||t.startsWith("font/")||t.startsWith("video/")||t.startsWith("audio/")||t.startsWith("model/")||t==="text/css"||t==="application/javascript"||t==="text/javascript"||t==="application/wasm"||t==="application/font-woff"||t==="application/font-woff2"||t==="application/octet-stream"):!1}async function ue(e){let t=await fetch(e);if(!t.ok)throw new Error(`fetch ${e} -> ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())}function Ee(e){return/\.bundle($|\?)/.test(e)||/\.js($|\?)/.test(e)?"application/javascript":/\.zip($|\?)/.test(e)?"application/zip":"application/javascript"}function ze(e){try{let t=new URL(e);return t.searchParams.get("lazy")==="true"?(t.searchParams.set("lazy","false"),t.toString()):e}catch{return e}}async function Ae(e,t){let s=[];for(let o=0;o<t;o+=15e5){let a=Math.min(o+15e5,t),u=await T(e,`(window.__sootsimLastTransformedBundle?.text || "").slice(${o}, ${a})`);if(typeof u!="string")return null;s.push(u)}return s.join("")}function W(e){let t=new Map;for(let r of e)t.set(r.urlhash||r.url,r);return Array.from(t.values())}async function qe(e,t){(e.includes("--help")||e.includes("-h"))&&(ke(),process.exit(0));let r=[...e],s=await Se(x(r,"--origin")),o=$e(s,x(r,"--public-origin")),a=x(r,"--events"),u=x(r,"--video"),B=x(r,"--video-duration-ms"),g=ae(r,"--open"),S=ae(r,"--assets-only"),y=Z(r,{stripBooleanFlags:[],stripValueFlags:[]}),m=ee(y),l,j=[],f=[],z=null;try{if(l=await T(m,'(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'),l?.bundleUrl){let n=new URL(l.bundleUrl).origin,[i,H]=await Promise.all([T(m,`(window.__sootsimPreviewRecorder?.list?.(${JSON.stringify(n)}) || [])`),T(m,`(async () => {
|
|
37
|
-
const list = window.__sootsimListWorkerFetchRecorder
|
|
38
|
-
return typeof list === 'function'
|
|
39
|
-
? await list(${JSON.stringify(n)})
|
|
40
|
-
: []
|
|
41
|
-
})()`)]);j=W([...i,...H]).filter(d=>{try{return!new URL(d.url).pathname.startsWith("/api/")}catch{return!0}});let P=await T(m,`(async () => {
|
|
42
|
-
const rec = window.__sootsimPreviewRecorder
|
|
43
|
-
const workerList = window.__sootsimListWorkerFetchRecorder
|
|
44
|
-
return {
|
|
45
|
-
main: rec?.list ? rec.list() : [],
|
|
46
|
-
worker: typeof workerList === 'function' ? await workerList() : [],
|
|
47
|
-
}
|
|
48
|
-
})()`),I=(P?W([...P.main,...P.worker]):[]).filter(d=>{try{return new URL(d.url).origin!==n}catch{return!1}}),w=I.length>0?{count:I.length,totalBytes:I.reduce((d,R)=>d+(R.size||0),0)}:null;if(w&&w.count>0){console.log(` ${w.count} recorded cross-origin responses (${(w.totalBytes/1024).toFixed(1)} KiB)`);let d=await T(m,`(async () => {
|
|
49
|
-
const rec = window.__sootsimPreviewRecorder
|
|
50
|
-
const workerDump = window.__sootsimDumpWorkerFetchRecorder
|
|
51
|
-
const bundleUrl = ${JSON.stringify(l.bundleUrl)}
|
|
52
|
-
const keep = (r) => {
|
|
53
|
-
try {
|
|
54
|
-
const u = new URL(r.url)
|
|
55
|
-
if (u.origin !== ${JSON.stringify(n)}) return true
|
|
56
|
-
// bundle-origin api responses came from the rewritten
|
|
57
|
-
// /__app-api proxy at record time (re-keyed by the
|
|
58
|
-
// recorder's unwrap step). they need bodies attached the
|
|
59
|
-
// same way as cross-origin records \u2014 direct re-fetch from
|
|
60
|
-
// the dev server lacks the bundle's session cookies.
|
|
61
|
-
if (r.url !== bundleUrl && u.pathname.startsWith('/api/')) return true
|
|
62
|
-
return false
|
|
63
|
-
} catch { return false }
|
|
64
|
-
}
|
|
65
|
-
return {
|
|
66
|
-
main: rec?.dump ? rec.dump().filter(keep) : [],
|
|
67
|
-
worker: typeof workerDump === 'function'
|
|
68
|
-
? (await workerDump()).filter(keep)
|
|
69
|
-
: [],
|
|
70
|
-
}
|
|
71
|
-
})()`);if(f=W([...d.main,...d.worker]),S){let R=f.length;f=f.filter(C=>le(C.contentType));let ve=w.totalBytes-f.reduce((C,Te)=>C+(Te.size||0),0);console.log(` --assets-only: kept ${f.length}/${R} records (dropped ${(ve/1024).toFixed(1)} KiB of API responses)`)}}}l?.transformedBundle&&(z=await Ae(m,l.transformedBundle.byteLength))}finally{m.close()}l||(console.error(" could not read bundle snapshot \u2014 is sootsim running and is the bundle loaded?"),process.exit(2)),l.bundleUrl||(console.error(` no ?bundle= URL on the current sootsim tab.
|
|
72
|
-
open the app you want to share first (e.g. sootsim open 8082), then run upload.`),process.exit(2));let p,A=!1;if(z!==null)p=new TextEncoder().encode(z),A=!0,console.log(` using post-transform bundle: ${(p.byteLength/1024).toFixed(1)} KiB`);else{let n=ze(l.bundleUrl);n!==l.bundleUrl&&console.log(" forcing lazy=false for self-contained bundle"),console.log(` capturing: ${n}`),p=await ue(n),console.log(` main bundle: ${(p.byteLength/1024).toFixed(1)} KiB`)}let O=j.filter(n=>n.url!==l.bundleUrl);S&&(O=O.filter(n=>le(n.contentType))),console.log(` fetching ${O.length} extra files\u2026`);let _=(await Promise.all(O.map(async n=>{try{let i=await ue(n.url);return{...n,bytes:i}}catch(i){return console.error(` warning: failed to re-fetch ${n.url}: ${i instanceof Error?i.message:i}`),null}}))).filter(n=>!!n),pe=_.reduce((n,i)=>n+i.bytes.byteLength,0);console.log(` ${_.length} extra files: ${(pe/1024).toFixed(1)} KiB`);let b;a&&(b=oe(a));let h,$,G;if(u){if(h=oe(u),$=u.endsWith(".mp4")?"video/mp4":u.endsWith(".gif")?"image/gif":"video/webm",B){let n=Number(B);(!Number.isFinite(n)||n<=0)&&(console.error(` invalid --video-duration-ms: ${B}`),await v(),process.exit(1)),G=Math.round(n)}console.log(` attaching flow video: ${(h.byteLength/1024).toFixed(1)} KiB (${$})`)}let c=te(),ge=Y();Q({event:"preview_upload_started",identity:{userId:c?.kind==="session"?ge?.user?.id??null:null,repoId:c?.kind==="github"?c.repoId:null,installationId:c?.kind==="github"?c.installationId??null:null},properties:{origin:s,hasAuth:!!c,authMode:c?.kind??"none",bundleBytes:p.byteLength,isTransformed:A,extraFiles:_.length,recordedFetches:f.length,hasEvents:!!b,hasVideo:!!h}}),c||(console.error(" preview uploads need auth."),console.error(" set SOOTSIM_API_KEY=sk_sootsim_..., run `sootsim login`, or use the soot github runner."),await v(),process.exit(1));let fe=ne(c),he=(()=>{try{return new URL(l.bundleUrl).origin}catch{return null}})(),V=(n,i,H,P,q,I,w)=>{let d=re(I),R=d?ie(n):n;return{url:i,urlhash:H,method:P,bodyHash:q,contentType:I,responseHeaders:w,bytes:R,encoding:d?"gzip":void 0}},L=[..._.map(n=>V(n.bytes,n.url,n.urlhash,"GET","-",n.contentType,n.responseHeaders)),...f.map(n=>V(Buffer.from(n.bodyBase64,"base64"),n.url,n.urlhash,n.method||"GET",n.bodyHash||"-",n.contentType,n.responseHeaders))],F=ie(p),ye=Re("sha256").update(p).digest("hex");console.log(` bundle raw=${(p.byteLength/1024).toFixed(1)} KiB gz=${(F.byteLength/1024).toFixed(1)} KiB`);let me={contentHash:ye,bundleSizeBytes:p.byteLength,bundleContentType:Ee(l.bundleUrl),bundleEncoding:"gzip",bundleOrigin:he,entry:l.entry,isTransformed:A,deviceSpec:l.deviceSpec,installationId:c.kind==="github"?c.installationId??void 0:void 0,repoId:c.kind==="github"?c.repoId:void 0,files:L.map(n=>({url:n.url,urlhash:n.urlhash,method:n.method,bodyHash:n.bodyHash,contentType:n.contentType,responseHeaders:n.responseHeaders,encoding:n.encoding,sizeBytes:n.bytes.byteLength})),events:b?{sizeBytes:b.byteLength}:void 0,flowVideo:h&&$?{sizeBytes:h.byteLength,contentType:$,durationMs:G}:void 0},J=new Map;for(let n of L)J.set(n.urlhash,n.bytes);let be=Date.now(),k=F.byteLength;for(let n of L)k+=n.bytes.byteLength;b&&(k+=b.byteLength),h&&(k+=h.byteLength);let we=`${U(s)}/api/preview/upload/init`;console.log(` init: ${we}`);let M;try{let n=await se({originBase:s,initBody:me,bundleBytes:F,filesByHash:J,extras:{eventsBytes:b,videoBytes:h},authHeader:fe,concurrency:16});M=n.finalize;let i=1+n.init.files.length+(n.init.events?1:0)+(n.init.flowVideo?1:0);console.log(` PUT ${i} objects in ${Date.now()-be}ms (${(k/1024).toFixed(1)} KiB)`)}catch(n){let i=n;i.phase==="init"&&i.status===401&&(console.error(" preview upload requires a valid login."),console.error(" run `sootsim login` and retry."),await v(),process.exit(1)),i.status===402&&(console.error(` ${xe(i.responseText)??"preview uploads require Personal, Team, or an active trial \u2014 upgrade from the billing dialog."}`),await v(),process.exit(1)),console.error(` ${i.message??`${i.phase??"upload"} failed: ${String(n)}`}`),await v(),process.exit(1)}let K=`${o}${M.url}`;console.log(`
|
|
73
|
-
stored ${M.filesStored??0} extra files`),console.log(` preview: ${K}`),g&&await X(K),await v()}export{Se as a,$e as b,qe as c};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{b as d}from"./chunk-VRV2X4X2.js";import{existsSync as S,mkdirSync as h,readFileSync as b,writeFileSync as H,rmSync as m}from"fs";import{tmpdir as w}from"os";import{dirname as v,join as p}from"path";var y=new Map;function i(e,r){y.set(e,r)}var a=1;function s(){return p(w(),`sootsim-cli-hints-${d()}.json`)}function l(){return p(w(),"sootsim-cli-hints-global.json")}function u(e){if(!S(e))return{version:a,shown:{}};try{let r=JSON.parse(b(e,"utf8"));return r?.version!==a||!r?.shown?{version:a,shown:{}}:r}catch{return{version:a,shown:{}}}}function f(e,r){try{h(v(e),{recursive:!0}),H(e,JSON.stringify(r)+`
|
|
3
|
-
`)}catch{}}function F(){let e=(process.env.SOOTSIM_HINTS||"").toLowerCase();return e==="off"||e==="0"||e==="false"?"off":e==="always"||e==="verbose"?"always":"normal"}function x(e,r){let o=F();if(o==="off")return!1;if(o==="always"||r==="always")return!0;let n=Date.now();if(r==="once-per-identity"){let t=u(s());return t.shown[e]?!1:(t.shown[e]=n,f(s(),t),!0)}if(r==="once-ever"){let t=u(l());return t.shown[e]?!1:(t.shown[e]=n,f(l(),t),!0)}if(typeof r=="object"&&"cooldownMs"in r){let t=u(s()),c=t.shown[e]??0;return n-c<r.cooldownMs?!1:(t.shown[e]=n,f(s(),t),!0)}return!0}function M(e,...r){let o=y.get(e);if(!o)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!x(e,o.frequency))return!1;let n=o.render(...r);if(n==null)return!1;let t=Array.isArray(n)?n:[n],c=o.stream==="error"?console.error:console.log;for(let g of t)c(` hint: ${g}`);return!0}function O(){m(s(),{force:!0})}function k(){m(l(),{force:!0})}function T(){return Array.from(y.entries()).map(([e,r])=>({id:e,frequency:r.frequency}))}i("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`sootsim wait ready\` first.`});i("wait-selector-for-missing-testid",{frequency:"once-per-identity",render:e=>`sootsim wait selector ${e}`,stream:"error"});i("prefer-cli-over-eval",{frequency:"once-per-identity",render:e=>e.length?["try the CLI shortcut instead:",...e.map(r=>` ${r}`)]:null,stream:"error"});i("describe-use-filters",{frequency:"once-per-identity",render:()=>["describe output is long. narrow it with:"," sootsim describe --only '*Bottom Sheet*'"," sootsim describe --testid-like 'swap-*'"," sootsim describe --subtree <testID>"]});i("subtree-root-not-found",{frequency:"always",render:e=>`no node with testID/id "${e}" \u2014 try \`sootsim find --testid ${e}\` to discover available ids.`,stream:"error"});export{M as a,O as b,k as c,T as d};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a as P,c as v,e as A}from"./chunk-VRV2X4X2.js";import{E as k,F as T}from"./chunk-BEQD2DSK.js";import{WebSocket as w}from"ws";function M(){let e=k();return e&&T(e)?e.bridgePort:7668}var h=class extends Error{lock;constructor(t,s){super(t),this.name="BridgeSimLockedError",this.lock=s}};function O(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function N(e,t={}){let s=new Set,l=t.port??M(),c=t.commandTimeoutMs??15e3,o,g="none",b=new Set(t.stripBooleanFlags??[]),p=new Set(t.stripValueFlags??[]);for(let i=0;i<e.length;i++){let a=e[i];if(a==="--port"||a==="-p"){s.add(i),i+1<e.length&&(s.add(i+1),l=Number(e[i+1])),i++;continue}if(a.startsWith("--port=")){s.add(i),l=Number(a.slice(7));continue}if(a==="--timeout"){s.add(i),i+1<e.length&&(s.add(i+1),c=Number(e[i+1])),i++;continue}if(a==="--sim"){s.add(i),i+1<e.length&&(s.add(i+1),o=e[i+1]?.trim()||void 0,g="flag"),i++;continue}if(b.has(a)){s.add(i);continue}p.has(a)&&(s.add(i),i+1<e.length&&s.add(i+1),i++)}if(!o){let i=v();i&&(o=i.trim()||void 0,g="saved")}return{positional:e.filter((i,a)=>!s.has(a)),wsPort:l,simId:o,simIdSource:g,commandTimeoutMs:c}}function W(e,t={}){let s=1,l=t.commandTimeoutMs??15e3,c=new Map,o=new w(`ws://localhost:${e}`),g=t.simId?{key:`sim:${t.simId}`,source:"explicit-sim-id",stable:!0}:P(),b=new Promise((n,r)=>{o.on("open",()=>{try{o.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:g.key,cliIdentitySource:g.source,cliLabel:t.cliLabel}))}catch{}n()}),o.on("error",d=>{let u=d.message?`: ${d.message}`:"";r(new Error(`could not connect to ws://localhost:${e}${u}`))})}),p=!1,i=!1;function a(n,r){if(i||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||n.startsWith("bridge:")||n==="focus"||n==="close")return;i=!0;let d=r??"primary",u=O(r?t.simIdSource:"none");process.stderr.write(` \u2192 ${d} (${u})
|
|
3
|
-
`)}return o.on("message",n=>{let r;try{r=JSON.parse(n.toString())}catch{return}if(r.id===0)return;let d=c.get(r.id);d&&(c.delete(r.id),r.i>0&&!p&&(p=!0,process.stderr.write(`
|
|
4
|
-
\u26A0 ${r.i} other CLI identity/identities are driving this sim
|
|
5
|
-
taps, scrolls, and keyboard input from multiple agents will collide on
|
|
6
|
-
the same screen state (this is not a bridge throughput limit).
|
|
7
|
-
use \`sootsim open --new\` for an isolated sim per agent.
|
|
8
|
-
|
|
9
|
-
`)),r.error?r.o?d.reject(new h(r.error,r.o)):d.reject(new Error(r.error)):d.resolve(r.result))}),o.on("close",(n,r)=>{let d=r?.toString()||"connection closed";for(let[u,m]of c)c.delete(u),m.reject(new Error(`sim disconnected: ${d} (code ${n})`))}),{async send(n,r){let d=r?.timeoutMs??l,u=async m=>{await b;let f=s++;return new Promise((C,S)=>{let B=setTimeout(()=>{c.delete(f),S(new Error(`command timed out after ${Math.round(d/1e3)}s`))},d);c.set(f,{resolve:I=>{clearTimeout(B),C(I)},reject:I=>{clearTimeout(B),S(I)}});let y={...n,id:f};y.simId===void 0&&m&&(y.simId=m),a(n.type??"",y.simId),o.send(JSON.stringify(y))})};try{return await u(t.simId)}catch(m){let f=m instanceof Error?m.message:String(m);if(t.fallbackOnMissingSimId&&t.simId&&n.simId===void 0&&f===`no sim connected with id ${t.simId}`)return A(),process.stderr.write(` \u26A0 saved sim ${t.simId} is gone \u2014 falling back to primary
|
|
10
|
-
pin a sim with: sootsim use <sim>
|
|
11
|
-
`),i=!1,u(void 0);throw m}},async listSims(){let n=await this.send({type:"bridge:list-sims"});return Array.isArray(n)?n:[]},async openUrl(n,r={}){return this.send({type:"bridge:open",url:n,newWindow:r.newWindow===!0})},async focusSim(n){return this.send({type:"focus",simId:n})},async closeSim(n){return this.send({type:"close",simId:n})},async claim(n,r={}){return await this.send({type:"bridge:claim",simId:n,force:r.force===!0})},close(){try{o.readyState===w.OPEN&&o.send(JSON.stringify({type:"bridge:bye",id:0}))}catch{}o.close();let n=setTimeout(()=>{o.readyState!==w.CLOSED&&o.terminate()},250)}}}function R(e){return W(e.wsPort,{commandTimeoutMs:e.commandTimeoutMs,simId:e.simId,fallbackOnMissingSimId:e.simIdSource==="saved",simIdSource:e.simIdSource})}async function _(e){try{return await e.send({type:"evaluate",code:"document.hidden"})===!0?(process.stderr.write(`
|
|
12
|
-
\u26A0 target sim is hidden (document.hidden = true)
|
|
13
|
-
animations and rAF callbacks are throttled \u2014 coordinates may be wrong
|
|
14
|
-
and launch/transition animations will not complete.
|
|
15
|
-
bring the sim to the foreground or use: sootsim debug eval "window.focus()"
|
|
16
|
-
|
|
17
|
-
`),{hidden:!0,warned:!0}):{hidden:!1,warned:!1}}catch{return{hidden:!1,warned:!1}}}async function D(e,t,s={}){let l={type:"evaluate",code:t};return s.acquireLock&&(l.acquireLock=!0),e.send(l)}async function j(e,t,...s){return e.send({type:"call",path:t,args:s})}async function q(e,t,...s){return e.send({type:"call",path:t,args:s,acquireLock:!0})}export{M as a,h as b,N as c,W as d,R as e,_ as f,D as g,j as h,q as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|