sootsim 0.1.155 → 0.1.157
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-C3BYGNOR.js → agent-GKCKPDQL.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-DR75UMEL.js → agent-wrapper-H2U7JFCS.js} +2 -2
- package/dist-cli/chunks/{app-fonts-TC5QZXEN.js → app-fonts-QUD2SV6L.js} +2 -2
- package/dist-cli/chunks/{assert-YICVET3K.js → assert-NH2HHMN4.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-CT7E764X.js +2 -0
- package/dist-cli/chunks/beta-WWL6ZI74.js +2 -0
- package/dist-cli/chunks/{camera-4F5RQCBC.js → camera-BBIMVYXH.js} +2 -2
- package/dist-cli/chunks/{chunk-UNE2CDA5.js → chunk-2MWM7JD6.js} +2 -2
- package/dist-cli/chunks/{chunk-AYRY5U2Y.js → chunk-2SQVUKGN.js} +1 -1
- package/dist-cli/chunks/{chunk-IAE4IW7O.js → chunk-2V4FB2RT.js} +2 -2
- package/dist-cli/chunks/chunk-4HETKHPX.js +13 -0
- package/dist-cli/chunks/{chunk-DQCTDCDF.js → chunk-4POIDYSQ.js} +1 -1
- package/dist-cli/chunks/{chunk-DXBJHAQE.js → chunk-6CBI57IL.js} +2 -2
- package/dist-cli/chunks/{chunk-7R5V5AIL.js → chunk-7P2QJUZB.js} +1 -1
- package/dist-cli/chunks/{chunk-ZHBF3X54.js → chunk-7WZEEFD3.js} +2 -2
- package/dist-cli/chunks/{chunk-VYUW5QK4.js → chunk-AES7K6P5.js} +1 -1
- package/dist-cli/chunks/chunk-AYTLC7QV.js +1 -0
- package/dist-cli/chunks/{chunk-EXF6FEAH.js → chunk-BJFLKJZI.js} +2 -2
- package/dist-cli/chunks/{chunk-LTAFJDXF.js → chunk-BRIWO44I.js} +1 -1
- package/dist-cli/chunks/{chunk-QQUWPJAN.js → chunk-C5BXRLHS.js} +1 -1
- package/dist-cli/chunks/{chunk-JD3CVFGB.js → chunk-CQKIN4UH.js} +2 -2
- package/dist-cli/chunks/{chunk-SEG4UA6N.js → chunk-DHULHNVZ.js} +1 -1
- package/dist-cli/chunks/{chunk-2A4RF2GA.js → chunk-ESZY26WY.js} +2 -2
- package/dist-cli/chunks/{chunk-M5LTONRB.js → chunk-FCICI3EX.js} +1 -1
- package/dist-cli/chunks/{chunk-4BCGD37Q.js → chunk-FTCNYGT4.js} +1 -1
- package/dist-cli/chunks/{chunk-BLTW2X3S.js → chunk-G4EHF2XU.js} +2 -2
- package/dist-cli/chunks/{chunk-KJZD6GOC.js → chunk-GAXCW6BZ.js} +57 -32
- package/dist-cli/chunks/{chunk-UQTGLV4M.js → chunk-GH25H5QD.js} +1 -1
- package/dist-cli/chunks/{chunk-VIDSBYBM.js → chunk-GPV6OYQI.js} +2 -2
- package/dist-cli/chunks/{chunk-EQ4VACQH.js → chunk-ISGEH5I6.js} +2 -2
- package/dist-cli/chunks/{chunk-ANM2NBPM.js → chunk-J72RL5TX.js} +1 -1
- package/dist-cli/chunks/{chunk-UZZA6QOG.js → chunk-JMXKC7DE.js} +2 -2
- package/dist-cli/chunks/{chunk-LQUJ5CK6.js → chunk-K4LDVZYP.js} +3 -3
- package/dist-cli/chunks/{chunk-BSY42HG5.js → chunk-KIMSPMBC.js} +3 -3
- package/dist-cli/chunks/{chunk-DOQDF7TJ.js → chunk-LV3DINZS.js} +1 -1
- package/dist-cli/chunks/{chunk-FUCVU7VO.js → chunk-NT6JVAUN.js} +1 -1
- package/dist-cli/chunks/chunk-O5HTYUHB.js +2 -0
- package/dist-cli/chunks/{chunk-6QWKWASG.js → chunk-OZ3UZ2VO.js} +2 -2
- package/dist-cli/chunks/{chunk-XQTW3Z46.js → chunk-P53GI4GU.js} +2 -2
- package/dist-cli/chunks/{chunk-SYECZJG3.js → chunk-PCW7AAPN.js} +2 -2
- package/dist-cli/chunks/chunk-PPH7UKZN.js +1 -0
- package/dist-cli/chunks/{chunk-D43GSIWC.js → chunk-QA7DWZXG.js} +2 -2
- package/dist-cli/chunks/{chunk-J4F5YPVG.js → chunk-QIFVD5D2.js} +2 -2
- package/dist-cli/chunks/{chunk-JDYTNXVQ.js → chunk-QSFSGKVF.js} +1 -1
- package/dist-cli/chunks/{chunk-MDTM3GKQ.js → chunk-QTFL2HSS.js} +1 -1
- package/dist-cli/chunks/chunk-RI6LUHT6.js +2 -0
- package/dist-cli/chunks/chunk-RJTJ67H3.js +1 -0
- package/dist-cli/chunks/chunk-S56YDDA7.js +79 -0
- package/dist-cli/chunks/{chunk-IFV2H2PN.js → chunk-SKDLBR7B.js} +2 -2
- package/dist-cli/chunks/{chunk-WGMRS45V.js → chunk-SMYZKDMS.js} +1 -1
- package/dist-cli/chunks/{chunk-FY42AEQT.js → chunk-XIG5BFQB.js} +2 -2
- package/dist-cli/chunks/{chunk-U5DVNBRT.js → chunk-ZJUIBQPS.js} +1 -1
- package/dist-cli/chunks/{chunk-QURX7PNL.js → chunk-ZVELB7QY.js} +3 -3
- package/dist-cli/chunks/cli-version-BXPUDDCJ.js +2 -0
- package/dist-cli/chunks/{compat-5ZDXKMVB.js → compat-AUXJQIHL.js} +3 -3
- package/dist-cli/chunks/{config-SALDFPNQ.js → config-BXXIT3N3.js} +2 -2
- package/dist-cli/chunks/control-FSL5WY5D.js +2 -0
- package/dist-cli/chunks/{cpu-profile-DWVQYLU2.js → cpu-profile-YUS3WKAK.js} +2 -2
- package/dist-cli/chunks/{daemon-ZOLT5A64.js → daemon-22L65BF7.js} +2 -2
- package/dist-cli/chunks/{debug-T2TZRZLM.js → debug-XJN62JVM.js} +3 -3
- package/dist-cli/chunks/{detox-ELF424V7.js → detox-XTQMXYKU.js} +2 -2
- package/dist-cli/chunks/{device-VS6S2VBJ.js → device-MAE44TQB.js} +2 -2
- package/dist-cli/chunks/{diagnose-C6S6GF6P.js → diagnose-HF3DUNXT.js} +2 -2
- package/dist-cli/chunks/drivers-6ZRVNWCU.js +2 -0
- package/dist-cli/chunks/{electron-364UUDHO.js → electron-FM7ABQ55.js} +3 -3
- package/dist-cli/chunks/flow-4PJHUWIA.js +2 -0
- package/dist-cli/chunks/help-C4MKKA5E.js +2 -0
- package/dist-cli/chunks/{hints-CQHHEBUY.js → hints-5FKUHYYV.js} +2 -2
- package/dist-cli/chunks/{home-paths-3S52MOTF.js → home-paths-2UT3LZCV.js} +2 -2
- package/dist-cli/chunks/{inspect-TFHVPSB4.js → inspect-EDWNKILW.js} +3 -3
- package/dist-cli/chunks/install-JJ2I2L3B.js +2 -0
- package/dist-cli/chunks/{install-desktop-N2DYSBOT.js → install-desktop-MQV7A7LW.js} +3 -3
- package/dist-cli/chunks/{keys-5DJVHPJW.js → keys-5R3GN66Z.js} +2 -2
- package/dist-cli/chunks/{launch-PZY7TD5A.js → launch-3XQXJHU6.js} +3 -3
- package/dist-cli/chunks/{login-TYJBJLHC.js → login-RR3LSQ3A.js} +4 -4
- package/dist-cli/chunks/{logout-SG4UGABE.js → logout-3GIZQ27A.js} +2 -2
- package/dist-cli/chunks/{maestro-H4CCHNKL.js → maestro-CS6JBEG4.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-BGV6FY2J.js +2 -0
- package/dist-cli/chunks/{preview-C6X3ITFK.js → preview-ZMOUSC43.js} +2 -2
- package/dist-cli/chunks/{profile-PTUACNTX.js → profile-HGF54OC4.js} +2 -2
- package/dist-cli/chunks/{react-3D7WSSLI.js → react-N6HTHJNA.js} +2 -2
- package/dist-cli/chunks/{record-MEMW545L.js → record-Z36PVVU7.js} +10 -10
- package/dist-cli/chunks/runtime-I64WAQIR.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-UYRGLL35.js → runtime-delivery-PJMSW4HO.js} +2 -2
- package/dist-cli/chunks/{screenshot-OWF4HNV6.js → screenshot-4YKF4UBD.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-KM65465J.js → screenshot-mode-BGXJPIBS.js} +2 -2
- package/dist-cli/chunks/{screenshots-MJXEOC2O.js → screenshots-TRGYSPW5.js} +2 -2
- package/dist-cli/chunks/{server-Q5ZYFO5O.js → server-CV7RETHK.js} +3 -3
- package/dist-cli/chunks/setup-repo-IZ44DI2U.js +2 -0
- package/dist-cli/chunks/{skills-G2MSPKGR.js → skills-MTXAUNIT.js} +2 -2
- package/dist-cli/chunks/{slides-TZTHVGWV.js → slides-LDMZ3ZKO.js} +2 -2
- package/dist-cli/chunks/{start-CJ35MCB6.js → start-LTZH7NX6.js} +4 -4
- package/dist-cli/chunks/store-HTK26UWW.js +2 -0
- package/dist-cli/chunks/telemetry-YKO6WSAB.js +2 -0
- package/dist-cli/chunks/{test-MUGRVEBG.js → test-MAGRP4B6.js} +3 -3
- package/dist-cli/chunks/{three-mode-CQ6XZZU3.js → three-mode-QYIRSQBC.js} +2 -2
- package/dist-cli/chunks/{timeline-MM43OOX2.js → timeline-X5HZN2L5.js} +2 -2
- package/dist-cli/chunks/{upgrade-A4CBZ3A5.js → upgrade-JZPXC2WH.js} +2 -2
- package/dist-cli/chunks/upload-7DBFEXRG.js +2 -0
- package/dist-cli/chunks/{version-ONYEMBRD.js → version-YZNR4TYU.js} +2 -2
- package/dist-cli/chunks/web-CHLW4MAH.js +2 -0
- package/dist-cli/chunks/{what-happened-H4ZLTNBG.js → what-happened-P6YJADRY.js} +2 -2
- package/dist-cli/chunks/{whoami-U63F2I7B.js → whoami-MK25C7TJ.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/menu.cjs +3 -2
- package/dist-lib/menu.mjs +3 -2
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +30 -5
- package/dist-lib/sdk.mjs +30 -5
- package/dist-lib/skills.cjs +51 -13
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/menu.ts +2 -1
- package/dist-cli/chunks/auto-bootstrap-LIMVUYCU.js +0 -2
- package/dist-cli/chunks/beta-GGCQHRJW.js +0 -2
- package/dist-cli/chunks/chunk-4BFAO5OU.js +0 -2
- package/dist-cli/chunks/chunk-BQ3UFSIG.js +0 -1
- package/dist-cli/chunks/chunk-INMKIIZH.js +0 -79
- package/dist-cli/chunks/chunk-TJEKTG6V.js +0 -1
- package/dist-cli/chunks/chunk-U4JYYYUW.js +0 -1
- package/dist-cli/chunks/chunk-YXCVIAAU.js +0 -13
- package/dist-cli/chunks/cli-version-O7QJ4BZ2.js +0 -2
- package/dist-cli/chunks/control-CNRPHEU4.js +0 -2
- package/dist-cli/chunks/drivers-36GE2TDC.js +0 -2
- package/dist-cli/chunks/flow-5D5SRQT6.js +0 -2
- package/dist-cli/chunks/help-F4BRZV6Y.js +0 -2
- package/dist-cli/chunks/install-WYCI7SLJ.js +0 -2
- package/dist-cli/chunks/optional-demo-registry-G43O66KE.js +0 -2
- package/dist-cli/chunks/runtime-ZLDHSWAR.js +0 -2
- package/dist-cli/chunks/setup-repo-MANQTJRC.js +0 -2
- package/dist-cli/chunks/store-LZD4WSTY.js +0 -2
- package/dist-cli/chunks/telemetry-MR3X56AA.js +0 -2
- package/dist-cli/chunks/upload-3UDJ4OHD.js +0 -2
- package/dist-cli/chunks/web-EYRW3MVM.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as $}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as $}from"./chunk-PCW7AAPN.js";import{a as w,d as y,h as R,j as b,l as k}from"./chunk-ISGEH5I6.js";import{A as h,B as u,C as p,D as g,k as d}from"./chunk-GH25H5QD.js";import x from"fs";import{WebSocket as D}from"ws";async function G(e,t={}){let[s,...n]=e;if(!s||s==="--help"||s==="-h"){A();return}switch(s){case"install":return O(n,t);case"list":case"ls":return N(n);case"use":return S(n);case"remove":case"rm":return T(n);case"which":case"active":return F();case"notes":case"changelog":return _(n);default:console.error(` unknown runtime subcommand: ${s}`),A(),process.exit(1)}}function A(){console.log(`
|
|
3
3
|
sootsim runtime \u2014 manage engine runtimes under ~/.sootsim/runtimes/
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -26,7 +26,7 @@ examples:
|
|
|
26
26
|
sootsim runtime notes
|
|
27
27
|
sootsim runtime notes 1.2.3
|
|
28
28
|
sootsim runtime notes --all
|
|
29
|
-
`)}async function O(e,t){let{version:s,flags:n}=C(e),i=n.channel??t.channel??"stable",l=n.force===!0,r=n.setActive!==!1;h(),console.log("sootsim runtime install"),console.log(` cdn: ${y()}`);try{let o=await k({version:s,channel:i,force:l,setActive:r});console.log(` version: ${o.version} (channel: ${o.channel})`),o.installed?console.log(` installed ${o.version}`):console.log(` already installed at ${o.runtimeDir}`),r&&await I(o.version)}catch(o){console.error(` ${v(o)}`),process.exit(1)}}async function I(e){p(e),console.log(` active: ${e}`),await E(e)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${e})`)}async function E(e){let{isDaemonLockfileFresh:t,readDaemonLockfile:s}=await import("./home-paths-
|
|
29
|
+
`)}async function O(e,t){let{version:s,flags:n}=C(e),i=n.channel??t.channel??"stable",l=n.force===!0,r=n.setActive!==!1;h(),console.log("sootsim runtime install"),console.log(` cdn: ${y()}`);try{let o=await k({version:s,channel:i,force:l,setActive:r});console.log(` version: ${o.version} (channel: ${o.channel})`),o.installed?console.log(` installed ${o.version}`):console.log(` already installed at ${o.runtimeDir}`),r&&await I(o.version)}catch(o){console.error(` ${v(o)}`),process.exit(1)}}async function I(e){p(e),console.log(` active: ${e}`),await E(e)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${e})`)}async function E(e){let{isDaemonLockfileFresh:t,readDaemonLockfile:s}=await import("./home-paths-2UT3LZCV.js"),n=s();if(!t(n))return!1;let i=$();return new Promise(l=>{let r=!1,o=!1,a=f=>{r||(r=!0,l(f))},c=new D(`ws://127.0.0.1:${i}`,{handshakeTimeout:800}),m=setTimeout(()=>{try{c.close()}catch{}a(o)},1500);c.on("open",()=>{try{c.send(JSON.stringify({type:"runtime:use",version:e,id:0})),o=!0}catch{}setTimeout(()=>{try{c.close()}catch{}},100)}),c.on("close",()=>{clearTimeout(m),a(o)}),c.on("error",()=>{clearTimeout(m),a(!1)})})}async function N(e){h();let t=g(),s=u();if(console.log("installed:"),t.length===0)console.log(" (none)");else for(let n of t)console.log(` ${n===s?"*":" "} ${n}`);try{let n=await R();console.log("available (latest per channel):");for(let[i,l]of Object.entries(n.channels))console.log(` ${i.padEnd(8)} ${l.latest}`)}catch(n){console.log(`available: (could not fetch manifest: ${v(n)})`)}}async function S(e){let t=e[0];t||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let s=g();s.includes(t)||(console.error(` version ${t} is not installed`),console.error(` installed: ${s.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${t}\` first`),process.exit(1)),await I(t)}async function T(e){let t=e[0];t||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),u()===t&&(console.error(` cannot remove active runtime ${t}`),console.error(" switch with `sootsim runtime use <other>` first, or install another version"),process.exit(1));let n=d(t);if(!x.existsSync(n)){console.error(` ${t} is not installed`);return}x.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${t}`)}async function F(){let e=u();if(!e){console.log(" no active runtime");return}console.log(e)}async function _(e){let t=e.includes("--all"),s=e.find(o=>!o.startsWith("-"))||null,n;try{n=await b()}catch(o){console.error(` could not fetch release notes: ${v(o)}`),process.exit(1)}if(n.length===0){console.log(" no release notes published yet");return}if(t){console.log(`sootsim runtime releases:
|
|
30
30
|
`);for(let o of n){let a=o.date.slice(0,10),c=o.sections.reduce((m,f)=>m+f.items.length,0);console.log(` v${o.version} ${a} (${o.channel}, ${c} change${c===1?"":"s"})`)}console.log(`
|
|
31
31
|
see one release: sootsim runtime notes <version>`);return}let i=u(),l=s||i||n[0]?.version,r=n.find(o=>o.version===l);r||(console.error(` no release notes for ${l}`),console.error(` published: ${n.map(o=>o.version).slice(0,10).join(", ")}`),console.error(" list all: sootsim runtime notes --all"),process.exit(1)),console.log(j(r,{active:i}))}function j(e,t={}){let s=[],n=e.date.slice(0,10),i=t.active===e.version?" (active)":"";if(s.push(`sootsim runtime v${e.version} \xB7 ${e.channel} \xB7 ${n}${i}`),e.sections.length===0)return s.push(" no notable changes"),s.join(`
|
|
32
32
|
`);for(let l of e.sections){s.push(""),s.push(` ${l.title}`);for(let r of l.items){let o=r.scope?`(${r.scope}) `:"",a=r.breaking?"\u26A0 ":"";s.push(` \u2022 ${a}${o}${r.summary} ${r.hash}`)}}return s.join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var t=4001,n="sootsim close";export{t as a,n as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{execFileSync as h,spawn as g}from"child_process";import{existsSync as s,readdirSync as k}from"fs";import{dirname as m,join as l,resolve as a}from"path";import{fileURLToPath as v}from"url";var c;function p(){if(c!==void 0)return c;try{c=m(v(import.meta.resolve("sootsim-engine/package.json")))}catch{c=null}return c}var I="dev.sootsim.simulator";function x(){let n=p();if(!n)return null;let e=l(n,"dist-electron/main.cjs");if(!s(e))return null;let i=D(n);return i?{path:i,platform:process.platform,kind:"dev-electron",engineDir:n}:null}function b(){let n=p();return n?s(l(n,"src-electron/main.ts")):!1}function D(n){let e=n;for(let i=0;i<6;i++){let t=l(e,"node_modules/.bin/electron");if(s(t))return t;let r=m(e);if(r===e)break;e=r}return null}function C(){let n=p(),i=["/Applications/sootsim.app",a(process.env.HOME||"","Applications/sootsim.app"),...n?[a(n,"app/sootsim.app")]:[]].find(t=>s(t));if(i)return{path:i,platform:"darwin",kind:"mac-app"};try{let t=h("mdfind",[`kMDItemCFBundleIdentifier == "${I}"`],{encoding:"utf8",timeout:3e3}).trim();if(t)return{path:t.split(`
|
|
3
3
|
`)[0],platform:"darwin",kind:"mac-app"}}catch{}return null}function f(n){if(!s(n))return null;let e=k(n).filter(i=>i.startsWith("sootsim")&&i.endsWith(".AppImage")).sort().reverse()[0];return e?l(n,e):null}function w(){let n=p(),i=[a(process.env.HOME||"","Applications/sootsim.AppImage"),a(process.env.HOME||"",".local/bin/sootsim.AppImage"),"/opt/sootsim/sootsim.AppImage","/opt/sootsim/sootsim",...n?[a(n,"app/sootsim.AppImage"),a(n,"release/linux-unpacked/sootsim")]:[]].find(r=>s(r));if(i)return{path:i,platform:"linux",kind:i.endsWith(".AppImage")?"linux-appimage":"linux-binary"};let t=n?f(a(n,"app"))||f(a(n,"release")):null;return t?{path:t,platform:"linux",kind:"linux-appimage"}:null}function A(){let n=x();if(n)return n;if(b()){let e=p(),i=l(e,"dist-electron/main.cjs");return s(i)?console.error(` no node_modules/.bin/electron found near ${e}. run \`bun install\`.`):console.error(` dist-electron/main.cjs missing in ${e}.
|
|
4
4
|
run: bun run --cwd packages/sootsim-engine build:electron-main
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{createHash as _}from"node:crypto";import k from"node:fs";import{createRequire as D}from"node:module";import d from"node:path";var x=/(^|\/)expo-splash-screen$/,A=/(^|\/)react-native-bootsplash$/;function f(n,e){let r=e.replace(/\/+$/,""),t=n.replace(/^\.\//,"").replace(/^\/+/,"");if(t)return`${r}/assets/${t}`}function y(n){if(n==="cover")return"cover";if(n==="contain"||n==="native")return"contain"}function p(n){return typeof n=="string"&&n.length>0?n:void 0}function S(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function R(n,e){if(!n||typeof n!="object")return null;let r=n,o={backgroundColor:p(r.backgroundColor)??"#ffffff"},s=p(r.image);s&&(o.imageUrl=f(s,e));let i=S(r.imageWidth);i!=null&&(o.imageWidthPx=i);let c=y(r.resizeMode);c&&(o.resizeMode=c);let a=r.dark;if(a&&typeof a=="object"){let l=a,u=p(l.backgroundColor),g=p(l.image);(u||g)&&(o.dark={},u&&(o.dark.backgroundColor=u),g&&(o.dark.imageUrl=f(g,e)))}return o}function U(n,e,r){let t=n[e],o=t&&typeof t=="object"?t.splash:void 0,s=n.splash,i=o&&typeof o=="object"?o:s;if(!i||typeof i!="object")return null;let a={backgroundColor:p(i.backgroundColor)??"#ffffff",imageWidthPx:S(i.imageWidth)??200,resizeMode:y(i.resizeMode)??"contain"},l=p(i.image);l&&(a.imageUrl=f(l,r));let u=i.dark;if(u&&typeof u=="object"){let g=u,h=p(g.backgroundColor),m=p(g.image);(h||m)&&(a.dark={},h&&(a.dark.backgroundColor=h),m&&(a.dark.imageUrl=f(m,r)))}return a}function j(n,e){if(!n||typeof n!="object")return null;let r=n,t=p(r.logo);if(!t)return null;let o={backgroundColor:p(r.background)??"#fff",imageUrl:f(t,e),imageWidthPx:S(r.logoWidth)??100,resizeMode:"contain"},s=p(r.darkBackground),i=p(r.darkLogo);return(s||i)&&(o.dark={},s&&(o.dark.backgroundColor=s),i&&(o.dark.imageUrl=f(i,e))),o}function b(n,e,r){if(!n||typeof n!="object")return null;let t=n,o=t.plugins,s=null,i=null;if(Array.isArray(o))for(let a of o){let l=Array.isArray(a)?a[0]:a;if(typeof l!="string")continue;let u=Array.isArray(a)?a[1]??{}:{};!s&&x.test(l)?s=R(u,r):!i&&A.test(l)&&(i=j(u,r))}if(s)return s;let c=U(t,e,r);return c||i}var C=D(import.meta.url);function v(n){try{let e=new URL(n),r=e.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r))return e.origin}catch{}return null}var I=["app.config.js","app.config.ts","app.config.cjs","app.config.mjs","app.json"];function P(n){for(let e of I)try{if(k.statSync(d.join(n,e)).isFile())return!0}catch{}return!1}var E=new Set(["node_modules","artifacts","dist","build","out","coverage","tmp","public","ios","android","macos","windows","__fixtures__","__tests__","examples","example"]);function w(n,e){P(n)&&e.push(n);let r;try{r=k.readdirSync(n,{withFileTypes:!0})}catch{return}for(let t of r)t.isDirectory()&&(t.name.startsWith(".")||E.has(t.name)||w(d.join(n,t.name),e))}function L(n){try{return k.statSync(d.join(n,"package.json")).isFile()}catch{return!1}}function G(n){let e=v(n.bundleUrl);if(!e)return null;let r=n.repoDir||process.env.SOOT_REPO_DIR,t=r?d.resolve(r):process.cwd();if(!r&&!L(t))return null;let o=[];if(r)w(t,o),o.includes(t)||o.push(t);else{if(!P(t))return null;o.push(t)}if(o.length===0)return null;let s=(n.platform||process.env.SOOT_PLATFORM||"ios").toLowerCase(),i=null;try{let a=C.resolve("@expo/config",{paths:[...o,t]}),l=C(a);typeof l.getConfig=="function"&&(i=l.getConfig)}catch{}if(!i)return null;let c;for(let a of o)try{let l=i(a,{skipSDKVersionRequirement:!0});if(l?.exp&&typeof l.exp=="object"){c=l.exp;break}}catch{}return!c||typeof c!="object"?null:b(c,s==="android"?"android":"ios",e)}function q(n){return encodeURIComponent(JSON.stringify(n))}function F(n){if(!n)return null;try{let e=JSON.parse(decodeURIComponent(n));return!e||typeof e!="object"||typeof e.backgroundColor!="string"?null:e}catch{return null}}function M(n){let e=new Set;return n.imageUrl&&e.add(n.imageUrl),n.dark?.imageUrl&&e.add(n.dark.imageUrl),[...e]}function z(n){let e=(n.split("?")[0].split(".").pop()||"").toLowerCase();return e==="png"?"image/png":e==="jpg"||e==="jpeg"?"image/jpeg":e==="webp"?"image/webp":e==="gif"?"image/gif":e==="svg"?"image/svg+xml":"application/octet-stream"}async function H(n,e){let r=F(n);if(!r)return[];let t=[],o=new Set;for(let s of M(r)){let i=_("sha256").update(s).digest("hex");if(!o.has(i)){o.add(i);try{let c=await fetch(s);if(!c.ok){e?.onError?.(s,new Error(`${c.status} ${c.statusText}`));continue}let a=new Uint8Array(await c.arrayBuffer());t.push({url:s,urlhash:i,contentType:z(s),bytes:a}),e?.onStaged?.({url:s,byteLength:a.byteLength})}catch(c){e?.onError?.(s,c)}}}return t}export{G as a,q as b,H as c};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A as m,n as P,p as a}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as m,n as P,p as a}from"./chunk-GH25H5QD.js";import l from"fs";import c from"path";var s="default",S="profiles.json",i=1;function o(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function d(){return c.join(a(),S)}function I(e){return`sootsim-profile-${o(e)}`}function h(e){return c.join(P(),"Partitions",I(e))}function A(e){return c.join(a(),"playwright",o(e))}function u(){try{let e=JSON.parse(l.readFileSync(d(),"utf8"));if(!e||e.version!==i)return{version:i,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:o(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:i,profiles:r}}catch{return{version:i,profiles:[]}}}function x(e){return[...e].sort((r,t)=>r.id===s?-1:t.id===s?1:r.id.localeCompare(t.id))}function p(e){if(e.profiles.some(t=>t.id===s))return{...e,profiles:x(e.profiles)};let r=new Date().toISOString();return{version:i,profiles:x([{id:s,createdAt:r,updatedAt:r},...e.profiles])}}function g(e){m();let r=p(e),t=`${d()}.tmp`;return l.writeFileSync(t,`${JSON.stringify(r,null,2)}
|
|
3
3
|
`,"utf8"),l.renameSync(t,d()),r}function y(){return g(u()).profiles}function E(e){let r=o(e);return y().find(t=>t.id===r)??null}function _(e=s){let r=o(e),t=E(r);return t||D(r)}function D(e){let r=o(e),t=p(u());if(t.profiles.some(w=>w.id===r))throw new Error(`profile already exists: ${r}`);let f=new Date().toISOString(),n={id:r,createdAt:f,updatedAt:f};return g({version:i,profiles:[...t.profiles,n]}),n}function F(e){let r=o(e);if(r===s)throw new Error("the default profile cannot be deleted; clear it instead");let t=p(u()),f=t.profiles.find(n=>n.id===r);if(!f)throw new Error(`profile not found: ${r}`);return g({version:i,profiles:t.profiles.filter(n=>n.id!==r)}),v(r),f}function v(e){let r=o(e);for(let t of[h(r),A(r)])try{l.rmSync(t,{recursive:!0,force:!0})}catch{}}export{A as a,y as b,_ as c,D as d,F as e,v as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as d,b as g}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as d,b as g}from"./chunk-NT6JVAUN.js";import{a as f,c as w}from"./chunk-OZ3UZ2VO.js";import{a as u,b as h,c as m}from"./chunk-QSFSGKVF.js";import{c as p}from"./chunk-ZJUIBQPS.js";function I(){let e=u();return e?{available:!0,reason:null,detail:e}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function M(e){if(e.headless)return{launched:!1,message:"the chromium driver launches a visible browser window and cannot run headless \u2014 a headless `chrome --headless=new` process exits immediately and the sim never connects. for headless automation use `--driver playwright`."};let r=u();if(!r)return{launched:!1,message:"chromium not found \u2014 install chrome or run `sootsim list --drivers`"};if(!e.url)return{launched:!1,message:"chromium driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current Chrome profile"};try{let t=await m(e.url,{detached:e.detached??!0});return{launched:!0,message:`chromium launched \u2192 ${e.url}`,pid:t.pid,target:t.target??r,attachUrl:e.url}}catch(t){return{launched:!1,message:`chromium spawn failed: ${t instanceof Error?t.message:String(t)}`}}}var v={id:"chromium",name:"chromium",description:"system chrome / chromium / edge \u2014 visible window (headless: use playwright)",kind:"browser",availability:I,launch:M};function _(){let e=d();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"sootsim desktop app not installed (run `sootsim install-desktop`)"}}async function x(e){let r=d();if(!r)return{launched:!1,message:"sootsim desktop app not installed"};try{let t=await g(e.url,r,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile});return t.launched?{launched:!0,message:e.url?`electron launched via ${t.via} \u2192 ${e.url}`:`electron launched via ${t.via}`,target:t.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(t){return{launched:!1,message:`electron launch failed: ${t instanceof Error?t.message:String(t)}`}}}var y={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:_,launch:x};import{spawn as C}from"child_process";import{closeSync as E,mkdtempSync as A,openSync as L,readFileSync as R}from"fs";import{createRequire as W}from"module";import{tmpdir as b}from"os";import{join as S}from"path";var N=`
|
|
3
3
|
const modulePath = process.env.SOOTSIM_PW_MODULE;
|
|
4
4
|
const url = process.env.SOOTSIM_PW_URL;
|
|
5
5
|
const headless = process.env.SOOTSIM_PW_HEADLESS === '1';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as P,d as T,f as C}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as P,d as T,f as C}from"./chunk-ZJUIBQPS.js";import{G as k,H as v}from"./chunk-GH25H5QD.js";import{WebSocket as I}from"ws";function x(){let e=k();return e&&v(e)?e.bridgePort:7668}var w=class extends Error{lock;constructor(r,i){super(r),this.name="BridgeSimLockedError",this.lock=i}};function $(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function N(e,r={}){let i=new Set,a=r.port??x(),l=r.commandTimeoutMs??15e3,t,m="none",h=new Set(r.stripBooleanFlags??[]),b=new Set(r.stripValueFlags??[]);for(let n=0;n<e.length;n++){let d=e[n];if(d==="--port"||d==="-p"){i.add(n),n+1<e.length&&(i.add(n+1),a=Number(e[n+1])),n++;continue}if(d.startsWith("--port=")){i.add(n),a=Number(d.slice(7));continue}if(d==="--timeout"){i.add(n),n+1<e.length&&(i.add(n+1),l=Number(e[n+1])),n++;continue}if(d==="--sim"||d==="--session"||d==="--tab"){i.add(n),n+1<e.length&&(i.add(n+1),t=e[n+1]?.trim()||void 0,m="flag"),n++;continue}let s=d.startsWith("--sim=")?d.slice(6):d.startsWith("--session=")?d.slice(10):d.startsWith("--tab=")?d.slice(6):void 0;if(s!==void 0){i.add(n),t=s.trim()||void 0,m="flag";continue}if(h.has(d)){i.add(n);continue}b.has(d)&&(i.add(n),n+1<e.length&&i.add(n+1),n++)}if(!t){let n=T();n&&(t=n.trim()||void 0,m="saved")}return{positional:e.filter((n,d)=>!i.has(d)),wsPort:a,simId:t,simIdSource:m,commandTimeoutMs:l}}function E(e,r={}){let i=1,a=r.commandTimeoutMs??15e3,l=new Map,t=new I(`ws://localhost:${e}`),m=P(),h=new Promise((s,o)=>{t.on("open",()=>{try{t.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:m.key,cliIdentitySource:m.source,cliLabel:r.cliLabel}))}catch{}s()}),t.on("error",c=>{let g=c.message?`: ${c.message}`:"";o(new Error(`could not connect to ws://localhost:${e}${g}`))})}),b=!1,n=!1;function d(s,o){if(n||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;n=!0;let c=o??"primary",g=$(o?r.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${g})
|
|
3
3
|
`)}return t.on("message",s=>{let o;try{o=JSON.parse(s.toString())}catch{return}if(o.id===0)return;let c=l.get(o.id);c&&(l.delete(o.id),o._otherCliCount>0&&!b&&(b=!0,process.stderr.write(`
|
|
4
4
|
\u26A0 ${o._otherCliCount} other CLI identity/identities are driving this sim
|
|
5
5
|
taps, scrolls, and keyboard input from multiple agents will collide on
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{G as P,m as v,n as A,o as h,t as I,v as N}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{G as P,m as v,n as A,o as h,t as I,v as N}from"./chunk-4POIDYSQ.js";import{d as y,h as B,i as E}from"./chunk-PCW7AAPN.js";var q={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function U(e){return e.includes("--json")}function Y(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
|
|
3
3
|
`)}function V(e){process.stderr.write(`${e}
|
|
4
4
|
`)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function D(e,t,...r){return B(e,`__sootsimTest.${t}`,...r)}async function k(e,t,...r){return E(e,`SootSim.bridges.mainShell.${t}`,...r)}async function z(e,t={}){try{let r=await D(e,"waitForScreenTransitions",q);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 K(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await k(e,t,...n)}catch(o){if(!P(o)||Date.now()>=s)throw o;await w(50)}}async function Q(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let a=0;a<s;a++){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>l)return{bridge:u,count:c}}catch{}u.close(),await w(o)}return null}async function X(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let a=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await a.send({type:"evaluate",code:"1"}),a}catch{a.close()}await w(o)}return null}async function Z(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,a=-1,u=o,c=null,d=!1,m={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let i=await e.send({type:"evaluate",code:v}),g=Date.now()-o,f=Number(i?.nodes)||0,$=Number(i?.targets)||0,x=Number(i?.errors)||0,C=i?.flag===!0,p=i?.externalReady,T=typeof i?.loadingText=="string"?i.loadingText.trim():"",W=typeof i?.externalStatus=="string"?i.externalStatus.trim():"",M=typeof i?.externalError=="string"?i.externalError.trim():"",R=typeof i?.externalError=="string"&&M.length>0;if(c=p,d=R,f!==a&&(a=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,flag:i?.flag,loadingText:T,externalReady:typeof p=="boolean"?p:null,externalStatus:W,externalError:M,errors:x},C&&p!==!1&&!R&&!T&&h({nodes:f,targets:$})&&g-u>=A)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!C)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&h(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function O(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function F(e,t={}){let r=await e.send({type:"evaluate",code:N});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
|
|
5
5
|
console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await I(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as R}from"./chunk-VYUW5QK4.js";import{n as D}from"./chunk-UQTGLV4M.js";import{a as T}from"./chunk-MDTM3GKQ.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import m from"node:fs";import h from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||D()}function y(){return _()}function U(){return h.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=m.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{m.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=U();m.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=m.openSync(r,"w",384);try{m.writeFileSync(n,JSON.stringify(e,null,2)),m.fsyncSync(n)}finally{m.closeSync(n)}m.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function B(e){return q("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ge(e){let t=h.resolve(e.cwd),r=B(t),n;return w(o=>{let s=o.attachedProjects.find(c=>c.id===r);if(s){let c={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=c,n=c;return}let a=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:a,updatedAt:a};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function he(){return S().attachedProjects}var Q=336*60*60*1e3;function ye(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],a=o-Q,d=s.filter(c=>c.ts>=a);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Se(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function we(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let a=r.agentSessions.find(d=>d.id===e.id);if(a){let d={...a,...e,lastSeenAt:Date.now()},c=r.agentSessions.indexOf(a);r.agentSessions[c]=d,t=d;return}}let n=r.attachedProjects.find(a=>a.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function v(e,t){w(r=>{let n=r.agentSessions.find(s=>s.id===e);if(!n)return;let o=r.agentSessions.indexOf(n);r.agentSessions[o]={...n,...t,id:n.id,projectId:n.projectId,createdAt:n.createdAt,lastSeenAt:Date.now()}})}async function ve(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-G43O66KE.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!m.existsSync(o.dir))continue;let s=h.resolve(o.dir),a=B(s);if(n.attachedProjects.some(c=>c.id===a))continue;let d=Date.now();n.attachedProjects.push({id:a,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as V,spawnSync as z}from"node:child_process";import{randomUUID as Z}from"node:crypto";import i,{constants as f}from"node:fs";import u from"node:path";import ee from"node:readline";function j(e){return u.join(y(),"sessions",e)}function W(e){return u.join(j(e),"prompt.in")}function J(e){return u.join(j(e),"events.out")}function te(e){return u.join(y(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(j(t)))}function re(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ne();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ne(){try{let e=se();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli` (watch:cli:binary builds dist-bin/ instead).")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function se(){try{let r=T.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=oe();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function oe(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ie(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,a=null;for(;a===null;)try{a=i.openSync(o,f.O_WRONLY|f.O_CREAT|f.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let c=Number(i.readFileSync(o,"utf8").trim());if(c&&!ce(c)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(c=>setTimeout(c,50))}try{return i.writeFileSync(a,String(process.pid)),await r()}finally{try{i.closeSync(a)}catch{}try{i.unlinkSync(o)}catch{}}}function ce(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=z("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Te(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ie(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?Z():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),a=W(s.id),d=J(s.id),c=te(s.id);L(a),L(d);let g=u.dirname(c);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=re(),x=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",a,"--events-out",d,"--transcript",c];e.codexBin&&x.push("--codex-bin",e.codexBin),e.claudeBin&&x.push("--claude-bin",e.claudeBin),e.freshThread&&x.push("--fresh-thread"),o&&x.push("--claude-session-uuid",o);let P=V(A,x,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});P.unref();let E=e.readyTimeoutMs??6e3,b=await ae(d,p=>p.type==="ready"||p.type==="error",E);if(!b||b.type==="error"){if(P.pid)try{process.kill(P.pid,"SIGTERM")}catch{}try{i.rmSync(j(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=b&&b.type==="error"?b.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:P.pid,status:"idle"}),{session:k(s.id),wrapperPid:P.pid}})}async function De(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,f.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as R}from"./chunk-AES7K6P5.js";import{n as D}from"./chunk-GH25H5QD.js";import{a as T}from"./chunk-QTFL2HSS.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import m from"node:fs";import h from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||D()}function y(){return _()}function U(){return h.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=m.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{m.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=U();m.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=m.openSync(r,"w",384);try{m.writeFileSync(n,JSON.stringify(e,null,2)),m.fsyncSync(n)}finally{m.closeSync(n)}m.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function B(e){return q("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ge(e){let t=h.resolve(e.cwd),r=B(t),n;return w(o=>{let s=o.attachedProjects.find(c=>c.id===r);if(s){let c={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=c,n=c;return}let a=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:a,updatedAt:a};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function he(){return S().attachedProjects}var Q=336*60*60*1e3;function ye(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],a=o-Q,d=s.filter(c=>c.ts>=a);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Se(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function we(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let a=r.agentSessions.find(d=>d.id===e.id);if(a){let d={...a,...e,lastSeenAt:Date.now()},c=r.agentSessions.indexOf(a);r.agentSessions[c]=d,t=d;return}}let n=r.attachedProjects.find(a=>a.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function v(e,t){w(r=>{let n=r.agentSessions.find(s=>s.id===e);if(!n)return;let o=r.agentSessions.indexOf(n);r.agentSessions[o]={...n,...t,id:n.id,projectId:n.projectId,createdAt:n.createdAt,lastSeenAt:Date.now()}})}async function ve(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-BGV6FY2J.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!m.existsSync(o.dir))continue;let s=h.resolve(o.dir),a=B(s);if(n.attachedProjects.some(c=>c.id===a))continue;let d=Date.now();n.attachedProjects.push({id:a,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as V,spawnSync as z}from"node:child_process";import{randomUUID as Z}from"node:crypto";import i,{constants as f}from"node:fs";import u from"node:path";import ee from"node:readline";function j(e){return u.join(y(),"sessions",e)}function W(e){return u.join(j(e),"prompt.in")}function J(e){return u.join(j(e),"events.out")}function te(e){return u.join(y(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(j(t)))}function re(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ne();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ne(){try{let e=se();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli` (watch:cli:binary builds dist-bin/ instead).")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function se(){try{let r=T.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=oe();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function oe(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ie(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,a=null;for(;a===null;)try{a=i.openSync(o,f.O_WRONLY|f.O_CREAT|f.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let c=Number(i.readFileSync(o,"utf8").trim());if(c&&!ce(c)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(c=>setTimeout(c,50))}try{return i.writeFileSync(a,String(process.pid)),await r()}finally{try{i.closeSync(a)}catch{}try{i.unlinkSync(o)}catch{}}}function ce(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=z("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Te(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ie(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?Z():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),a=W(s.id),d=J(s.id),c=te(s.id);L(a),L(d);let g=u.dirname(c);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=re(),x=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",a,"--events-out",d,"--transcript",c];e.codexBin&&x.push("--codex-bin",e.codexBin),e.claudeBin&&x.push("--claude-bin",e.claudeBin),e.freshThread&&x.push("--fresh-thread"),o&&x.push("--claude-session-uuid",o);let P=V(A,x,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});P.unref();let E=e.readyTimeoutMs??6e3,b=await ae(d,p=>p.type==="ready"||p.type==="error",E);if(!b||b.type==="error"){if(P.pid)try{process.kill(P.pid,"SIGTERM")}catch{}try{i.rmSync(j(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=b&&b.type==="error"?b.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:P.pid,status:"idle"}),{session:k(s.id),wrapperPid:P.pid}})}async function De(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,f.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
|
|
3
3
|
`)}finally{i.closeSync(o)}v(e,{lastPrompt:t.displayText??t.text,status:"working"})}async function Re(e){let t=k(e);if(!t)throw new l("NO_SESSION",`no session with id=${e}`);if(O(t.wrapperPid,e))try{process.kill(t.wrapperPid,"SIGTERM")}catch{}let r=j(e),n=y();if(r.startsWith(n))try{i.rmSync(r,{recursive:!0,force:!0})}catch{}v(e,{status:"ended",wrapperPid:void 0})}function Ne(e,t){let r=J(e);if(!i.existsSync(r))throw new l("NO_FIFO",`events FIFO missing: ${r}`);let n=i.openSync(r,f.O_RDWR),o=i.createReadStream("",{fd:n,autoClose:!0}),s=ee.createInterface({input:o,crlfDelay:1/0});s.on("line",d=>{let c=I(d);c&&t(c)});let a=!1;return()=>{if(!a){a=!0;try{s.close()}catch{}try{o.destroy()}catch{}}}}async function ae(e,t,r){let n=i.openSync(e,f.O_RDWR|f.O_NONBLOCK),o=Buffer.alloc(8192),s="",a=Date.now()+r;try{for(;Date.now()<a;){let d=0;try{d=i.readSync(n,o,0,o.length,null)}catch(c){if(c.code!=="EAGAIN")throw c;d=0}if(d>0){s+=o.subarray(0,d).toString("utf8");let c;for(;(c=s.indexOf(`
|
|
4
4
|
`))>=0;){let g=s.slice(0,c);s=s.slice(c+1);let A=I(g);if(A&&t(A))return A}}else await new Promise(c=>setTimeout(c,30))}return null}finally{i.closeSync(n)}}export{I as a,y as b,ge as c,F as d,he as e,ye as f,Se as g,we as h,k as i,C as j,v as k,ve as l,j as m,W as n,J as o,te as p,O as q,re as r,l as s,Te as t,De as u,Re as v,Ne as w};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{execFileSync as p,spawn as l}from"child_process";import{existsSync as s}from"fs";import{homedir as u}from"os";import{join as d}from"path";var g=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","~/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","~/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","~/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","~/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Arc.app/Contents/MacOS/Arc","~/Applications/Arc.app/Contents/MacOS/Arc"],f=["/usr/bin/google-chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/microsoft-edge","/usr/bin/brave-browser","/snap/bin/chromium"],h=["C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe","C:\\Program Files (x86)\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"],C=["google-chrome","chromium","chromium-browser","microsoft-edge","brave-browser"],O=["chrome","msedge","brave"];function w(r){return r.startsWith("~/")?d(u(),r.slice(2)):r}function a(r){for(let n of r){let o=w(n);if(s(o))return o}return null}function U(r,n){try{let e=p(n==="win32"?"where":"which",[r],{encoding:"utf8",timeout:1500,stdio:["ignore","pipe","ignore"]}).trim();return e?e.split(/\r?\n/)[0]:null}catch{return null}}function M(r=process.platform){let n=process.env.CHROME_PATH||process.env.CHROMIUM_PATH;if(n&&s(n))return n;let o=a(r==="darwin"?g:r==="win32"?h:f);if(o)return o;let e=r==="win32"?O:C;for(let t of e){let i=U(t,r);if(i)return i}return null}function A(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform;return n.newWindow?c(r,{...n,platform:o,newWindow:!0}):o==="darwin"?{command:"open",args:n.background===!1?[r]:["-g",r],via:"system"}:o==="win32"?{command:"cmd",args:["/c","start","",r],via:"system"}:{command:"xdg-open",args:[r],via:"system"}}function c(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform,e="chromiumBinary"in n?n.chromiumBinary:M(o);if(!e)throw new Error("browser launch requires Chrome, Chromium, Edge, Brave, or Arc");let t=[];return n.newWindow!==!1&&t.push("--new-window"),t.push(r),{command:e,args:t,via:"chromium",target:e}}async function m(r,n,o){return new Promise((e,t)=>{let i=l(r,n,{detached:o,stdio:"ignore"});i.once("error",t),i.once("spawn",()=>{o&&i.unref(),e(i.pid)})})}async function x(r,n={}){let o=A(r,n),e=await m(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function y(r,n={}){let o=c(r,n),e=await m(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function E(r,n={}){await x(r,n)}export{M as a,x as b,y as c,E as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var d=Object.defineProperty;var e=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var f=(a,b)=>{for(var c in b)d(a,c,{get:b[c],enumerable:!0})};export{e as a,f as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as fe,e as ge,f as he}from"./chunk-7WZEEFD3.js";import{c as pe}from"./chunk-O5HTYUHB.js";import{d as de}from"./chunk-FCICI3EX.js";import{c as ce,e as ue,g as P}from"./chunk-PCW7AAPN.js";import{d as le}from"./chunk-QSFSGKVF.js";import{a as ae,b}from"./chunk-JMXKC7DE.js";import{a as ie}from"./chunk-2V4FB2RT.js";import{createHash as We}from"crypto";import{readFileSync as j}from"fs";import{gzipSync as Ve}from"zlib";function ye(e){let n=(e||"").toLowerCase().split(";")[0].trim();return n?!(n.startsWith("image/")||n.startsWith("video/")||n.startsWith("audio/")||n==="font/woff2"||n==="application/font-woff2"||n==="application/zip"||n==="application/gzip"):!0}import{brotliCompressSync as ke,constants as Ae}from"node:zlib";var ze=9;function me(e){return ke(e,{params:{[Ae.BROTLI_PARAM_QUALITY]:ze}})}function K(e,n){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${n} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function He(e){let n=K(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:n.signal})}finally{n.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${s.slice(0,200)}`)}}async function Me(e,n=8,r){let s=0,i=0,a=e.length;await Promise.all(Array.from({length:Math.min(n,a)},async()=>{for(;s<a;){let c=e[s++];await He(c),i++,r?.(i,a)}}))}function Ce(e,n,r,s){let i=[];i.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:n});for(let a of e.files){let c=r.get(a.urlhash);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}e.events&&s?.eventsBytes&&i.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.flowVideo&&s?.videoBytes&&i.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&i.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes});for(let a of e.snapshots??[]){let c=s?.snapshotBytes?.get(a.id);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}return i}function Ne(e){return e.replace(/\/+$/,"")}var z=class extends Error{constructor(r,s,i,a=""){super(r);this.status=s;this.phase=i;this.responseText=a;this.name="PresignedUploadError"}};async function we(e){let n=Ne(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=K(3e4,"init"),i;try{i=await fetch(`${n}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!i.ok){let f=await i.text().catch(()=>"");throw new z(`init failed: ${i.status} ${f.slice(0,200)}`,i.status,"init",f)}let a=await i.json(),c=Ce(a,e.bundleBytes,e.filesByHash,e.extras);await Me(c,e.concurrency??8,e.onPutProgress);let y=K(3e4,"finalize"),d;try{d=await fetch(`${n}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:y.signal})}finally{y.cancel()}if(!d.ok){let f=await d.text().catch(()=>"");throw new z(`finalize failed: ${d.status} ${f.slice(0,200)}`,d.status,"finalize",f)}let $=await d.json();return{init:a,finalize:$}}function qe(e){if(!e)return null;try{let n=JSON.parse(e);return typeof n.message=="string"&&n.message?n.message:null}catch{return null}}var Be=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",Te=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootbean.com",Y="http://localhost:3000",De=2e3;async function Ge(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let n=await fetch(`${Y}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(De)});if(n.ok||n.status===204||n.status===405)return Y}catch{}return Be}function x(e){return e.replace(/\/$/,"")}function Ke(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 je(e){try{let n=new URL(e).hostname.toLowerCase();return n==="sootbean.com"||n.endsWith(".sootbean.com")}catch{return!1}}function Je(e,n){return n?x(n):process.env.SOOTSIM_PREVIEW_ORIGIN?x(process.env.SOOTSIM_PREVIEW_ORIGIN):Ke(e)?x(e):je(e)?x(Te):x(e)}function Ye(){console.log(`
|
|
3
|
+
sootsim upload \u2014 publish the current recorded bundle as a /preview/<id> link
|
|
4
|
+
|
|
5
|
+
usage:
|
|
6
|
+
sootsim upload [--origin <url>] [--public-origin <url>] (--events <path> | --video <path>) [--screenshot <path>] [--owner <org> --repo <repo>] [--sim <sim>] [--open] [--assets-only]
|
|
7
|
+
|
|
8
|
+
options:
|
|
9
|
+
--origin <url> upload target (default: auto)
|
|
10
|
+
prefers ${Y} when available, otherwise
|
|
11
|
+
falls back to ${Be}
|
|
12
|
+
override with SOOTSIM_UPLOAD_ORIGIN env var
|
|
13
|
+
--public-origin <url>
|
|
14
|
+
public /preview link origin (default: ${Te}
|
|
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
|
+
required unless --video is present; previews must
|
|
19
|
+
have replay or recording playback data
|
|
20
|
+
--screenshot <path>
|
|
21
|
+
path to a PNG thumbnail to attach to the share
|
|
22
|
+
--video <path> path to a mp4/gif flow recording. embedded inline
|
|
23
|
+
in the pr sticky comment served at
|
|
24
|
+
/api/preview/flow-video?id=<share-id>
|
|
25
|
+
--video-duration-ms <ms>
|
|
26
|
+
duration hint for attached flow video
|
|
27
|
+
--owner <org> associate a session upload with a linked org repo
|
|
28
|
+
--repo <repo> repo name for --owner; the signed-in user must belong
|
|
29
|
+
to the local/org team that owns the link
|
|
30
|
+
--sim <sim> target a specific sim (see: sootsim list)
|
|
31
|
+
--open open the resulting /preview/<id> url in the browser
|
|
32
|
+
--assets-only drop API/JSON/HTML records before upload; keep images,
|
|
33
|
+
fonts, css, js, and binary blobs. live-data demos hit
|
|
34
|
+
the real network at replay time instead of serving
|
|
35
|
+
recorded API snapshots
|
|
36
|
+
-h, --help
|
|
37
|
+
|
|
38
|
+
examples:
|
|
39
|
+
sootsim upload --events ./my-session.jsonl.gz
|
|
40
|
+
sootsim upload --origin http://localhost:3000 --events ./my-session.jsonl.gz --open
|
|
41
|
+
sootsim upload --video /tmp/soot-flow.mp4 --video-duration-ms 12000
|
|
42
|
+
`)}function v(e,n){let r=e.findIndex(i=>i===n);if(r<0)return;let s=e[r+1];return e.splice(r,2),s}function be(e,n){let r=e.findIndex(s=>s===n);return r<0?!1:(e.splice(r,1),!0)}function ve(e){let n=(e||"").toLowerCase().split(";")[0].trim();return n?!!(n.startsWith("image/")||n.startsWith("font/")||n.startsWith("video/")||n.startsWith("audio/")||n.startsWith("model/")||n==="text/css"||n==="application/javascript"||n==="text/javascript"||n==="application/wasm"||n==="application/font-woff"||n==="application/font-woff2"||n==="application/octet-stream"):!1}async function Ue(e){let n=await fetch(e);if(!n.ok)throw new Error(`fetch ${e} -> ${n.status} ${n.statusText}`);return new Uint8Array(await n.arrayBuffer())}function Qe(e){return/\.bundle($|\?)/.test(e)||/\.js($|\?)/.test(e)?"application/javascript":/\.zip($|\?)/.test(e)?"application/zip":"application/javascript"}function Xe(e){try{return new URL(e).searchParams.get("appFonts")||""}catch{return""}}function Ze(e){try{return new URL(e).searchParams.get("appSplash")||""}catch{return""}}function et(e){try{let n=new URL(e);return n.searchParams.get("lazy")==="true"?(n.searchParams.set("lazy","false"),n.toString()):e}catch{return e}}async function tt(e,n){let s=[];for(let i=0;i<n;i+=15e5){let a=Math.min(i+15e5,n),c=await P(e,`(window.__sootsimLastTransformedBundle?.text || "").slice(${i}, ${a})`);if(typeof c!="string")return null;s.push(c)}return s.join("")}function J(e){let n=new Map;for(let r of e)n.set(r.urlhash||r.url,r);return Array.from(n.values())}async function vt(e,n){(e.includes("--help")||e.includes("-h"))&&(Ye(),process.exit(0));let r=[...e],s=await Ge(v(r,"--origin")),i=Je(s,v(r,"--public-origin")),a=v(r,"--events"),c=v(r,"--screenshot"),y=v(r,"--video"),d=v(r,"--video-duration-ms"),$=v(r,"--owner"),f=v(r,"--repo"),Pe=be(r,"--open");($&&!f||!$&&f)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),!a&&!y&&(console.error(" preview uploads require playback data: pass --events or --video.\n for a normal local preview, use `sootsim record --mode combined --open`\n or `sootsim flow --preview` instead of uploading a bundle-only snapshot."),process.exit(1));let Q=be(r,"--assets-only"),Ie=ce(r,{stripBooleanFlags:[],stripValueFlags:[]}),U=ue(Ie),l,X=[],m=[],H=null;try{if(l=await P(U,'(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'),l?.bundleUrl){let t=new URL(l.bundleUrl).origin,[o,u]=await Promise.all([P(U,`(window.__sootsimPreviewRecorder?.list?.(${JSON.stringify(t)}) || [])`),P(U,`(async () => {
|
|
43
|
+
const list = window.__sootsimListWorkerFetchRecorder
|
|
44
|
+
return typeof list === 'function'
|
|
45
|
+
? await list(${JSON.stringify(t)})
|
|
46
|
+
: []
|
|
47
|
+
})()`)]);X=J([...o,...u]).filter(p=>{try{return!new URL(p.url).pathname.startsWith("/api/")}catch{return!0}});let L=await P(U,`(async () => {
|
|
48
|
+
const rec = window.__sootsimPreviewRecorder
|
|
49
|
+
const workerList = window.__sootsimListWorkerFetchRecorder
|
|
50
|
+
return {
|
|
51
|
+
main: rec?.list ? rec.list() : [],
|
|
52
|
+
worker: typeof workerList === 'function' ? await workerList() : [],
|
|
53
|
+
}
|
|
54
|
+
})()`),S=(L?J([...L.main,...L.worker]):[]).filter(p=>{try{return new URL(p.url).origin!==t}catch{return!1}}),T=S.length>0?{count:S.length,totalBytes:S.reduce((p,_)=>p+(_.size||0),0)}:null;if(T&&T.count>0){console.log(` ${T.count} recorded cross-origin responses (${(T.totalBytes/1024).toFixed(1)} KiB)`);let p=await P(U,`(async () => {
|
|
55
|
+
const rec = window.__sootsimPreviewRecorder
|
|
56
|
+
const workerDump = window.__sootsimDumpWorkerFetchRecorder
|
|
57
|
+
const bundleUrl = ${JSON.stringify(l.bundleUrl)}
|
|
58
|
+
const keep = (r) => {
|
|
59
|
+
try {
|
|
60
|
+
const u = new URL(r.url)
|
|
61
|
+
if (u.origin !== ${JSON.stringify(t)}) return true
|
|
62
|
+
// bundle-origin api responses came from the rewritten
|
|
63
|
+
// /__app-api proxy at record time (re-keyed by the
|
|
64
|
+
// recorder's unwrap step). they need bodies attached the
|
|
65
|
+
// same way as cross-origin records \u2014 direct re-fetch from
|
|
66
|
+
// the dev server lacks the bundle's session cookies.
|
|
67
|
+
if (r.url !== bundleUrl && u.pathname.startsWith('/api/')) return true
|
|
68
|
+
return false
|
|
69
|
+
} catch { return false }
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
main: rec?.dump ? rec.dump().filter(keep) : [],
|
|
73
|
+
worker: typeof workerDump === 'function'
|
|
74
|
+
? (await workerDump()).filter(keep)
|
|
75
|
+
: [],
|
|
76
|
+
}
|
|
77
|
+
})()`);if(m=J([...p.main,...p.worker]),Q){let _=m.length;m=m.filter(G=>ve(G.contentType));let D=T.totalBytes-m.reduce((G,Fe)=>G+(Fe.size||0),0);console.log(` --assets-only: kept ${m.length}/${_} records (dropped ${(D/1024).toFixed(1)} KiB of API responses)`)}}}l?.transformedBundle&&(H=await tt(U,l.transformedBundle.byteLength))}finally{U.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.
|
|
78
|
+
open the app you want to share first (e.g. sootsim open 8082), then run upload.`),process.exit(2));let g,M=!1;if(H!==null)g=new TextEncoder().encode(H),M=!0,console.log(` using post-transform bundle: ${(g.byteLength/1024).toFixed(1)} KiB`);else{let t=et(l.bundleUrl);t!==l.bundleUrl&&console.log(" forcing lazy=false for self-contained bundle"),console.log(` capturing: ${t}`),g=await Ue(t),console.log(` main bundle: ${(g.byteLength/1024).toFixed(1)} KiB`)}let F=X.filter(t=>t.url!==l.bundleUrl);Q&&(F=F.filter(t=>ve(t.contentType))),console.log(` fetching ${F.length} extra files\u2026`);let k=(await Promise.all(F.map(async t=>{try{let o=await Ue(t.url);return{...t,bytes:o}}catch(o){return console.error(` warning: failed to re-fetch ${t.url}: ${o instanceof Error?o.message:o}`),null}}))).filter(t=>!!t),Re=k.reduce((t,o)=>t+o.bytes.byteLength,0);console.log(` ${k.length} extra files: ${(Re/1024).toFixed(1)} KiB`);let B;a&&(B=j(a));let h;c&&(h=j(c),console.log(` attaching screenshot: ${(h.byteLength/1024).toFixed(1)} KiB`));let w,O,Z;if(y){if(w=j(y),O=y.endsWith(".mp4")?"video/mp4":y.endsWith(".gif")?"image/gif":void 0,O||(console.error(" preview flow videos must be mp4 or gif"),await b(),process.exit(1)),d){let t=Number(d);(!Number.isFinite(t)||t<=0)&&(console.error(` invalid --video-duration-ms: ${d}`),await b(),process.exit(1)),Z=Math.round(t)}console.log(` attaching flow video: ${(w.byteLength/1024).toFixed(1)} KiB (${O})`)}let I=fe(),R=he(I),Se=ie();ae({event:"preview_upload_started",identity:{userId:I?.kind==="session"?Se?.user?.id??null:null,repoId:R?.repoId??null,installationId:R?.installationId??null},properties:{origin:s,hasAuth:!!I,authMode:I?.kind??"none",bundleBytes:g.byteLength,isTransformed:M,extraFiles:k.length,recordedFetches:m.length,hasEvents:!!B,hasScreenshot:!!h,hasVideo:!!w}}),I||(console.error(" preview uploads need auth."),console.error(" set SOOTSIM_API_KEY=sk_sootsim_..., run `sootsim login`, or use the soot github runner."),await b(),process.exit(1));let _e=ge(I),xe=(()=>{try{return new URL(l.bundleUrl).origin}catch{return null}})(),A=(t,o,u,L,se,S,T,p)=>{let _=ye(S),D=_?Ve(t):t;return{url:o,urlhash:u,method:L,bodyHash:se,requestVaryHash:p,contentType:S,responseHeaders:T,bytes:D,encoding:_?"gzip":void 0}},ee=[],C=Xe(l.pageHref)||"";if(C){let t=await de(C,{onStaged:({url:o,byteLength:u})=>console.log(` staged app font: ${o} (${(u/1024).toFixed(1)} KiB)`),onError:(o,u)=>console.error(` warning: failed to fetch app font ${o}: ${u instanceof Error?u.message:u}`)});for(let o of t)ee.push(A(Buffer.from(o.bytes),o.url,o.urlhash,"GET","-",o.contentType))}let te=[],N=Ze(l.pageHref)||"";if(N){let t=await pe(N,{onStaged:({url:o,byteLength:u})=>console.log(` staged splash image: ${o} (${(u/1024).toFixed(1)} KiB)`),onError:(o,u)=>console.error(` warning: failed to fetch splash image ${o}: ${u instanceof Error?u.message:u}`)});for(let o of t)te.push(A(Buffer.from(o.bytes),o.url,o.urlhash,"GET","-",o.contentType))}let W=[...k.map(t=>A(t.bytes,t.url,t.urlhash,"GET","-",t.contentType,t.responseHeaders,t.requestVaryHash)),...m.map(t=>A(Buffer.from(t.bodyBase64,"base64"),t.url,t.urlhash,t.method||"GET",t.bodyHash||"-",t.contentType,t.responseHeaders,t.requestVaryHash)),...ee,...te],V=me(g),$e=We("sha256").update(g).digest("hex");console.log(` bundle raw=${(g.byteLength/1024).toFixed(1)} KiB br=${(V.byteLength/1024).toFixed(1)} KiB`);let Oe={contentHash:$e,bundleSizeBytes:g.byteLength,bundleContentType:Qe(l.bundleUrl),bundleEncoding:"br",bundleOrigin:xe,runtimeVersion:l.runtimeVersion??void 0,appFonts:C||void 0,appSplash:N||void 0,entry:l.entry,isTransformed:M,deviceSpec:l.deviceSpec,installationId:R?.installationId??void 0,repoId:R?.repoId,owner:$??R?.owner,repo:f??R?.repo,files:W.map(t=>({url:t.url,urlhash:t.urlhash,method:t.method,bodyHash:t.bodyHash,contentType:t.contentType,responseHeaders:t.responseHeaders,requestVaryHash:t.requestVaryHash,encoding:t.encoding,sizeBytes:t.bytes.byteLength})),events:B?{sizeBytes:B.byteLength}:void 0,snapshots:h?[{id:"landing",label:"Landing",kind:"landing",t:0,contentType:"image/png",sizeBytes:h.byteLength}]:void 0,flowVideo:w&&O?{sizeBytes:w.byteLength,contentType:O,durationMs:Z}:void 0},ne=new Map;for(let t of W)ne.set(t.urlhash,t.bytes);let re=new Map;h&&re.set("landing",h);let Ee=Date.now(),E=V.byteLength;for(let t of W)E+=t.bytes.byteLength;B&&(E+=B.byteLength),h&&(E+=h.byteLength),w&&(E+=w.byteLength);let Le=`${x(s)}/api/preview/upload/init`;console.log(` init: ${Le}`);let q;try{let t=await we({originBase:s,initBody:Oe,bundleBytes:V,filesByHash:ne,extras:{eventsBytes:B,videoBytes:w,snapshotBytes:re},authHeader:_e,concurrency:16});q=t.finalize;let o=1+t.init.files.length+(t.init.events?1:0)+t.init.snapshots.length+(t.init.flowVideo?1:0);console.log(` PUT ${o} objects in ${Date.now()-Ee}ms (${(E/1024).toFixed(1)} KiB)`)}catch(t){let o=t;o.phase==="init"&&o.status===401&&(console.error(" preview upload requires a valid login."),console.error(" run `sootsim login` and retry."),await b(),process.exit(1)),o.status===402&&(console.error(` ${qe(o.responseText)??"preview uploads require Personal, Team, or an active trial \u2014 upgrade from the billing dialog."}`),await b(),process.exit(1)),console.error(` ${o.message??`${o.phase??"upload"} failed: ${String(t)}`}`),await b(),process.exit(1)}let oe=`${i}${q.url}`;console.log(`
|
|
79
|
+
stored ${q.filesStored??0} extra files`),console.log(` preview: ${oe}`),Pe&&await le(oe),await b()}export{Ge as a,Je as b,vt as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{h as u}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{h as u}from"./chunk-C5BXRLHS.js";var S=52,l=18,h=42,x=96,g=54,E=1.5,$="inset 0 0 0 0.5px #000, inset 0 0 0 2px #757575, inset 0 0 0 5px #212121",w=1;function y(e){let t=u(e),r=t.scale,o=!t.dynamicIsland&&t.homeIndicatorHeight===0&&t.cornerRadius===0,n=t.width,i=t.height,a=o?t.width+l*2:t.width+28,d=o?t.height+h+x:t.height+28,c=9.5,b=w,p=a+c*2,m=d+w*2,f=c+(o?l:14),B=o?h:14,H=o?S:t.cornerRadius+14,v=[{side:"right",top:t.hardwareButtons.lock.top,height:t.hardwareButtons.lock.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.ringToggle.top,height:t.hardwareButtons.ringToggle.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.volumeUp.top,height:t.hardwareButtons.volumeUp.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.volumeDown.top,height:t.hardwareButtons.volumeDown.height,width:t.hardwareButtons.width}];return{model:e,renderScale:r,outerWidth:Math.round(p*r),outerHeight:Math.round(m*r),logicalOuterWidth:p,logicalOuterHeight:m,logicalFrameWidth:a,logicalFrameHeight:d,logicalFrameLeft:c,logicalFrameTop:b,logicalScreenWidth:n,logicalScreenHeight:i,logicalScreenLeft:f,logicalScreenTop:B,logicalScreenRadius:o?0:t.cornerRadius,logicalFrameRadius:H,frameBackground:o?"linear-gradient(180deg, #1b1c20 0%, #0f1012 42%, #050608 100%)":"#000000",frameOutline:o?"0 0 0 1px #1f2125":"0 0 0 1px #333",metallicRingShadow:o?null:$,buttons:v,legacyHomeButton:o?{top:h+t.height+(x-g)/2,left:t.width/2-g/2+l,size:g,ring:E}:null,showHomeIndicator:t.homeIndicatorHeight>0,logicalHomeIndicatorStripHeight:t.homeIndicatorHeight}}function L(e){let t=e.side==="right",r=t?"inset(-3px -3px -3px 0)":"inset(-3px 0 -3px -3px)";return`
|
|
3
3
|
<div
|
|
4
4
|
aria-hidden="true"
|
|
5
5
|
style="
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var m={"--help":{type:"boolean",short:"-h"},"--version":{type:"boolean",short:"-V"},"--verbose":{type:"boolean",short:"-v"},"--port":{type:"number",short:"-p"},"--device":{type:"string",short:"-d"},"--theme":{type:"string",short:"-t"},"--headless":{type:"boolean"},"--driver":{type:"string"},"--sim":{type:"string"},"--session":{type:"string"},"--tab":{type:"string"}},c=new Set(["list","describe","find","get","do","wait","network","logs","shell"]),p=new Set(["do","get","wait","shell","debug"]),b={tap:"sootsim do tap","double-tap":"sootsim do double-tap","tap-text":"sootsim do tap-text","tap-id":"sootsim do tap-id",type:"sootsim do type","type-into":"sootsim do type-into",key:"sootsim do key",dispatch:"sootsim do dispatch",dismiss:"sootsim do dismiss",scroll:"sootsim do scroll",drag:"sootsim do drag",swipe:"sootsim do swipe",pinch:"sootsim do pinch",reload:"sootsim do reload",sleep:"sootsim do sleep",settle:"sootsim do settle",tree:"sootsim get tree",a11y:"sootsim get a11y",count:"sootsim get count",layout:"sootsim get layout",url:"sootsim get url",globals:"sootsim get globals",errors:"sootsim get errors",warnings:"sootsim get warnings",requests:"sootsim get requests",node:"sootsim get node",state:"sootsim debug state",js:"sootsim debug js",eval:"sootsim debug eval",perf:"sootsim debug perf","sample-color":"sootsim debug sample-color","find-id":"sootsim find --testid",query:"sootsim find --text|--role|--type|--pressable|--visible",capture:"sootsim screenshot"},u=new Set(["preview","test","detox","maestro","flow","record","profile","cpu-profile","react","screenshot","screenshots","screenshot-mode","slides","three-mode","3d-mode","inspect","debug","camera","timeline","what-happened","diagnose","shell","assert","device","open","list","use","focus","claim","close","config","compat","scan","electron","login","logout","whoami","install","setup-repo","install-desktop","server","daemon","runtime","upgrade","version","launch","start","skills","upload","app-fonts","keys","hints","agent-wrapper","agent",...c,...Object.keys(b)]);function h(g){let i=g.slice(2),e={command:null,commandArgs:[],globalFlags:{},help:!1,version:!1,verbose:!1},s=0;for(;s<i.length;){let o=i[s];if(o==="--"){e.commandArgs.push(...i.slice(s+1));break}let a=Object.entries(m).find(([n,t])=>n===o||t.short===o);if(a){let[n,t]=a,l=n.replace(/^--/,"");if(t.type==="boolean")e.globalFlags[l]=!0,s++;else{let r=i[s+1];if(r===void 0||r.startsWith("-")){console.error(` warning: ${o} requires a value`),s++;continue}if(t.type==="number"){let d=Number(r);if(Number.isNaN(d)){console.error(` warning: ${o} requires a number, got "${r}"`),s+=2;continue}e.globalFlags[l]=d}else e.globalFlags[l]=r;s+=2}continue}if(!e.command&&!o.startsWith("-")){let n=o.indexOf("-");if(n>0){let t=o.slice(0,n),l=o.slice(n+1);if(p.has(t)&&l.length>0){e.command=t;let r=i.slice(s+1);e.commandArgs=[l,...r[0]==="--"?r.slice(1):r];break}}if(u.has(o)){e.command=o;let t=i.slice(s+1);e.commandArgs=t[0]==="--"?t.slice(1):t;break}e.commandArgs=i.slice(s);break}e.commandArgs.push(o),s++}return e.help=!!e.globalFlags.help,e.version=!!e.globalFlags.version,e.verbose=!!e.globalFlags.verbose,e}export{c as a,b,h as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as p}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as p}from"./chunk-S56YDDA7.js";import{d as c,e as l}from"./chunk-7WZEEFD3.js";import{a}from"./chunk-2V4FB2RT.js";async function g(e,t){if(t)return t.replace(/\/$/,"");if(e.kind==="session"&&e.origin)return e.origin.replace(/\/$/,"");let i=a();return i?.origin?i.origin.replace(/\/$/,""):(await p()).replace(/\/$/,"")}async function m(e,t={}){let i=c();if(i||(process.stderr.write(`
|
|
3
3
|
sootsim ${e} needs auth before it can check recording access.
|
|
4
4
|
|
|
5
5
|
pick one:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{existsSync as D,mkdirSync as O,readFileSync as g,rmSync as s,writeFileSync as P}from"fs";import{tmpdir as R}from"os";import{dirname as x,join as A,resolve as v}from"path";import{execFileSync as I}from"child_process";import{readFileSync as S}from"fs";import{createRequire as _}from"module";var o=null;function u(r){o||(o=b());try{return o(r)}catch{return null}}function b(){let r=Number(process.env.PPID);if(Number.isFinite(r)&&r>1&&r!==process.ppid)return()=>r;if(process.platform==="linux")return y();if(process.platform==="darwin"){let n=T();return n||C()}return()=>null}function y(){return r=>{try{let n=S(`/proc/${r}/stat`,"utf8"),t=n.lastIndexOf(")");if(t<0)return null;let i=n.slice(t+1).trim().split(/\s+/),e=Number(i[1]);return Number.isFinite(e)&&e>0?e:null}catch{return null}}}var N=3,d=216,E=16;function T(){if(!process.versions?.bun)return null;try{let r=_(import.meta.url),{dlopen:n,FFIType:t}=r("bun:ffi"),i=n("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[t.i32,t.i32,t.u64,t.ptr,t.i32],returns:t.i32}}),e=Buffer.alloc(d);return a=>{if(Number(i.symbols.proc_pidinfo(a,N,0n,e,d))<=0)return null;let p=e.readUInt32LE(E);return p>0?p:null}}catch{return null}}function C(){return r=>{try{let t=I("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
|
|
3
3
|
`)[1];if(!t)return null;let i=t.trim().split(/\s+/),e=Number(i[2]);return Number.isFinite(e)&&e>1?e:null}catch{return null}}}var c=1,f="SOOTSIM_CLI_CURRENT_SIM_PATH",F=["SOOTSIM_CLI_IDENTITY","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"];function m(r,n=20){let t=u(r);if(!t||t<=1)return null;for(let i=0;i<n;i++){let e=u(t);if(!e||e<=1)return t;t=e}return t}function k(){for(let n of F){let t=process.env[n];if(t&&t.trim())return{key:`${n}:${t.trim()}`,source:n,stable:!0}}let r=m(process.ppid);return r&&r>1?{key:`gppid-${r}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}function L(){return k().key}function J(){return m(process.ppid)}function l(){if(process.env[f])return v(process.env[f]);let r=L();return A(R(),`sootsim-current-sim-${r}.json`)}function h(){let r=l();if(!D(r))return null;try{let n=JSON.parse(g(r,"utf8"));return n.version!==c||typeof n.simId!="string"||!n.simId.trim()||typeof n.updatedAt!="string"?(s(r,{force:!0}),null):{version:c,simId:n.simId.trim(),updatedAt:n.updatedAt}}catch{return s(r,{force:!0}),null}}function j(){return h()?.simId||null}function K(r){let n=r.trim();if(!n)return;let t=l();O(x(t),{recursive:!0}),P(t,JSON.stringify({version:c,simId:n,updatedAt:new Date().toISOString()},null,2)+`
|
|
4
4
|
`)}function X(){s(l(),{force:!0})}export{k as a,L as b,J as c,j as d,K as e,X as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as Be}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as Be}from"./chunk-SKDLBR7B.js";import{a as Le}from"./chunk-XIG5BFQB.js";import{a as je}from"./chunk-S56YDDA7.js";import{a as Se,b as Ee,c as ne,d as re,e as Ie,f as ie,h as oe,i as Pe,j as Me}from"./chunk-GAXCW6BZ.js";import{g as Re,n as Ne,p as Ce,t as De}from"./chunk-4HETKHPX.js";import{e as Oe}from"./chunk-BJFLKJZI.js";import{m as ke}from"./chunk-QA7DWZXG.js";import{m as xe,n as Te,o as $e,p as Fe}from"./chunk-4POIDYSQ.js";import{c as ee,d as te,e as ve}from"./chunk-PCW7AAPN.js";import{a as Ae}from"./chunk-FTCNYGT4.js";import{a as _e}from"./chunk-NT6JVAUN.js";import{d as Q,e as be}from"./chunk-ZJUIBQPS.js";import{a as ge,b as Z}from"./chunk-JMXKC7DE.js";import{g as ye}from"./chunk-C5BXRLHS.js";import*as _ from"fs";import{tmpdir as He}from"os";import*as b from"path";import*as v from"fs";import*as g from"path";import{spawnSync as nt}from"child_process";import*as A from"vm";var rt=3e5,it=`
|
|
3
3
|
let input = '';
|
|
4
4
|
process.stdin.on('data', (c) => { input += c });
|
|
5
5
|
process.stdin.on('end', async () => {
|
|
@@ -455,7 +455,7 @@ flow extension:
|
|
|
455
455
|
+ completed (${E.length} steps)`),u>0&&console.log(` screenshots: ${u} \u2192 ${a}`),I&&We(I),T&&console.log(` video: ${T}`),console.log()}catch(m){if(n&&!I)try{I=await d.stopProfile()}catch{}if($&&!T)try{T=await d.stopRecording(),C=d.getLastRecordingDurationMs()}catch(u){console.warn(` recording stop failed: ${u?.message||String(u)}`)}console.error(`
|
|
456
456
|
x failed: ${m.message}
|
|
457
457
|
`),I&&(console.log(" partial profile:"),We(I)),T&&console.log(` partial video: ${T}`);try{let u=d.lastFailedStep,y=u?`step-${String(u.index+1).padStart(2,"0")}-${u.kind}`:"unstaged",V=b.join(a,y);await d.captureFailureBundle(V,{error:m,stepIndex:u?.index,stepKind:u?.kind,stepTarget:u?.target}),console.log(` failure bundle: ${V}`),console.log(" (contents: screenshot.png, describe.json, a11y.txt, tree.txt, console.json, error.json)")}catch(u){try{let y=b.join(a,"error.png");await d.captureFailureScreenshot(y),console.log(` error screenshot: ${y}`)}catch{}console.log(` (failure bundle capture failed: ${u instanceof Error?u.message:String(u)})`)}await ke(k,{errorsCommand:`sootsim get errors 5${d.simId?` --sim ${d.simId}`:""}`,warningsCommand:`sootsim get warnings 5${d.simId?` --sim ${d.simId}`:""}`,requestsCommand:`sootsim get requests 5${d.simId?` --sim ${d.simId}`:""}`}),L=1}finally{k.close()}if(L===0&&w)try{let m=await wt(X??[]),u=["--origin",R,"--events",m];ae&&u.push("--public-origin",ae),T&&u.push("--video",T),T&&C&&Number.isFinite(C)&&u.push("--video-duration-ms",String(Math.round(C))),d.simId&&u.push("--sim",d.simId),qe&&u.push("--open"),le&&u.push("--owner",le),ce&&u.push("--repo",ce),console.log(`
|
|
458
|
-
preparing preview upload\u2026`);let{runUpload:y}=await import("./upload-
|
|
458
|
+
preparing preview upload\u2026`);let{runUpload:y}=await import("./upload-7DBFEXRG.js");await y(u,{})}catch(m){console.error(` preview upload failed: ${m?.message||m}`),L=1}return z?(d.simId&&Y.add(d.simId),await ht(S.wsPort,S.commandTimeoutMs,[...Y])):d.simId&&d.simId!==j&&be(d.simId),await Z(),L}async function ht(i,e,t){let n=[...new Set(t.filter(Boolean))];if(n.length===0)return;let r=te(i,{commandTimeoutMs:e});try{let o=await r.listSims(),s=n.filter(l=>o.some(f=>f.id===l&&f.readyState==="open"));if(s.length===0)return;let a=await De(r,i,e,s);await Ne(o,s),a.closed.length>0&&console.log(` closed flow sim(s): ${a.closed.join(", ")}`),a.remaining.length>0&&console.warn(` warn: flow sim(s) still connected after close: ${a.remaining.join(", ")}`)}catch(o){console.warn(` warn: failed to close flow sim(s): ${o instanceof Error?o.message:String(o)}`)}finally{r.close()}}async function wt(i){let{gzipSync:e}=await import("zlib"),t=i.map(o=>JSON.stringify(o)).join(`
|
|
459
459
|
`)+(i.length?`
|
|
460
460
|
`:""),n=e(Buffer.from(t,"utf8")),r=b.join(He(),`sootsim-events-${Date.now()}.jsonl.gz`);return _.writeFileSync(r,n),console.log(` events: ${i.length} written to ${r} (${n.length} bytes gz)`),r}async function gt(i){let e=i[0],t=n=>i.find((r,o)=>i[o-1]===n);switch(e){case"start":{let{path:n,state:r}=Ie();console.log(" flow draft started"),console.log(` session: ${n}`),console.log(` steps: ${r.steps.length}`);return}case"keep":case"good":{let n=oe();if(n.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),!n.kept){console.log(" no pending action to keep");return}console.log(` kept: ${n.candidate.summary}`),console.log(` steps: ${n.stepCount}`);return}case"end":{let n=t("--output")||(i[1]&&!i[1].startsWith("-")?i[1]:void 0),r=i.includes("--validate")||i.includes("--video"),o=i.includes("--video"),s=oe();s.active&&s.kept&&console.log(` auto-kept trailing action: ${s.candidate.summary}`);let a=Pe(n||(r?bt():void 0));if(a.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),!a.valid){console.error(" flow draft is not valid:");for(let l of a.issues)console.error(` - ${l}`);console.error(" draft preserved \u2014 keep at least one real interaction or run `sootsim flow start` to reset"),process.exit(1)}if(r){let l=vt(i,a.outputPath),f=await Ke(l);if(f!==0){console.error(`
|
|
461
461
|
validation failed \u2014 draft preserved so you can keep iterating`),process.exitCode=f;return}ie(),console.log(` flow draft validated (${a.stepCount} step${a.stepCount===1?"":"s"})`),a.outputPath&&console.log(` saved: ${a.outputPath}`),o&&console.log(" video: recorded during validation run");return}if(ie(),console.log(` flow draft ended (${a.stepCount} step${a.stepCount===1?"":"s"})`),a.outputPath){console.log(` saved: ${a.outputPath}`),console.log(` next: sootsim flow ${a.outputPath} --record`);return}console.log(""),process.stdout.write(a.yaml);return}case"validate":{let n=i[1];(!n||n.startsWith("-"))&&(console.error(" usage: sootsim flow validate <path>"),process.exit(1));let r=re(n);if(r.length>0){console.error(` x ${n} failed validation:`);for(let o of r)console.error(` - ${o}`);process.exit(1)}console.log(` + ${n} looks valid`);return}}}function yt(i){return i[0]==="--sim"&&i.length>=2?[...i.slice(2),"--sim",i[1]]:i}async function Ht(i){let e=yt(i),t=e[0];if(t==="start"||t==="keep"||t==="good"||t==="end"||t==="validate")return await gt(e),0;let n=await Ke(e);return n!==0&&(process.exitCode=n),n}function We(i){let e=i.avgMs>0?(1e3/i.avgMs).toFixed(1):"?",t=i.sampleCount>0?(i.jankFrames/i.sampleCount*100).toFixed(1):"0";console.log(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-QTFL2HSS.js";import{existsSync as x,readFileSync as j}from"fs";import{resolve as g}from"path";async function P(s){(s.includes("--help")||s.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim compat \u2014 check package compatibility
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -20,7 +20,7 @@ examples:
|
|
|
20
20
|
sootsim compat react-native-reanimated
|
|
21
21
|
sootsim compat --json
|
|
22
22
|
sootsim compat --brief
|
|
23
|
-
`),process.exit(0));let c=s.includes("--json"),e=s.includes("--brief"),l=s.indexOf("--app"),n=l!==-1&&s[l+1]?g(s[l+1]):process.cwd(),k=s.filter((o,a)=>!o.startsWith("-")&&(l===-1||a!==l+1))[0];if(c||e){let{scanDeps:o}=await import("./web-
|
|
23
|
+
`),process.exit(0));let c=s.includes("--json"),e=s.includes("--brief"),l=s.indexOf("--app"),n=l!==-1&&s[l+1]?g(s[l+1]):process.cwd(),k=s.filter((o,a)=>!o.startsWith("-")&&(l===-1||a!==l+1))[0];if(c||e){let{scanDeps:o}=await import("./web-CHLW4MAH.js"),a=g(n,"package.json");x(a)||(console.error(" no package.json found in",n),process.exit(1));let u=JSON.parse(j(a,"utf8")),r=o(u);if(c){console.log(JSON.stringify(r,null,2));return}if(r.packages.length===0){console.log(" no RN ecosystem packages detected");return}let T=Math.round(r.overallScore*100),v=r.packages.filter(i=>i.status==="full").length,$=r.packages.filter(i=>i.status==="partial"||i.status==="auto-stub").length,w=r.packages.filter(i=>i.status==="unsupported").length,p=[];v&&p.push(`${v} fully supported`),$&&p.push(`${$} partial`),w&&p.push(`${w} unsupported`),console.log(` ${p.join(", ")} \u2014 ${T}% compatible`);return}let{POLYFILL_REGISTRY:d}=await import("./web-CHLW4MAH.js");if(k){W(k,d);return}let b=g(n,"package.json");x(b)||(console.error(" no package.json found in",n),process.exit(1));let m=JSON.parse(j(b,"utf8")),S={...m.dependencies,...m.devDependencies},t={full:[],partial:[],autoStub:[],unsupported:[],justWorks:[],unknown:[]};for(let o of Object.keys(S)){let a=d[o];if(a){let u=a.stubType==="native"?"full":a.stubType==="works"?"not-relevant":a.stubType;if(a.stubType!=="native"&&a.versions?.length){let r=Math.max(...a.versions.map(y=>y.coverage||0));u=r>=.8?"full":r>=.3?"partial":"auto-stub"}switch(u){case"full":t.full.push(o);break;case"partial":t.partial.push(o);break;case"auto-stub":t.autoStub.push(o);break;case"unsupported":t.unsupported.push(o);break;case"not-relevant":t.justWorks.push(o);break;default:f(o)&&t.unknown.push(o)}}else f(o)&&t.unknown.push(o)}console.log(`
|
|
24
24
|
sootsim compatibility report
|
|
25
25
|
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
26
26
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-QTFL2HSS.js";import{existsSync as i,writeFileSync as n,readFileSync as c}from"fs";import{resolve as t}from"path";async function a(s){let e=s[0];switch((!e||s.includes("--help")||s.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim config \u2014 manage sootsim configuration
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r,v as s}from"./chunk-4HETKHPX.js";import"./chunk-BJFLKJZI.js";import"./chunk-QA7DWZXG.js";import"./chunk-4POIDYSQ.js";import"./chunk-O5HTYUHB.js";import"./chunk-FCICI3EX.js";import"./chunk-PCW7AAPN.js";import"./chunk-FTCNYGT4.js";import"./chunk-P53GI4GU.js";import"./chunk-NT6JVAUN.js";import"./chunk-OZ3UZ2VO.js";import"./chunk-PPH7UKZN.js";import"./chunk-QSFSGKVF.js";import"./chunk-ZJUIBQPS.js";import"./chunk-RI6LUHT6.js";import"./chunk-LV3DINZS.js";import"./chunk-GH25H5QD.js";import"./chunk-QTFL2HSS.js";export{e as buildOpenUrl,d as buildShellUrl,q as closeSimsBulk,r as planBulkCloseTargets,i as playwrightHostPidForSim,g as printConnectedSims,b as resolveBundleTarget,c as resolveDefaultShellBaseUrl,a as resolveDriverConnectWaitOptions,p as runClaimCommand,s as runCloseCommand,o as runFocusCommand,l as runListCommand,m as runOpenCommand,n as runUseCommand,j as signalDriverLaunchConnected,f as summarizeSimUrl,k as terminatePlaywrightHostsForSims,h as waitForSimMatch};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-QTFL2HSS.js";import{mkdirSync as $,writeFileSync as P}from"fs";import{dirname as S,resolve as O}from"path";import{WebSocket as C}from"ws";var v=e=>new Promise(i=>setTimeout(i,e)),w=class{ws;nextId=1;pending=new Map;listeners=new Set;ready;constructor(i){this.ws=new C(i,{maxPayload:1<<28}),this.ready=new Promise((t,r)=>{this.ws.once("open",()=>t()),this.ws.once("error",r)}),this.ws.on("message",t=>{let r=JSON.parse(t.toString());if(r.id&&this.pending.has(r.id)){let{res:o,rej:s}=this.pending.get(r.id);this.pending.delete(r.id),r.error?s(new Error(JSON.stringify(r.error))):o(r.result)}else if(r.method)for(let o of this.listeners)o(r.method,r.params)})}waitOpen(){return this.ready}on(i){this.listeners.add(i)}send(i,t={},r){let o=this.nextId++;return new Promise((s,p)=>{this.pending.set(o,{res:s,rej:p}),this.ws.send(JSON.stringify({id:o,method:i,params:t,...r?{sessionId:r}:{}}))})}close(){try{this.ws.close()}catch{}}};async function D(e,i){let t=Number(d(e,"--duration")??"5");if(!Number.isFinite(t)||t<=0)return console.error(" --duration must be a positive number (seconds)"),1;let r=Number(d(e,"--sample-interval")??"0.1"),o=Number(d(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=d(e,"--match")??"/rn/",p=d(e,"--output")??d(e,"-o"),u=O(process.cwd(),p??"/tmp/sootsim.cpuprofile"),g=[];try{g=await(await fetch(`http://localhost:${o}/json/list`)).json()}catch{return T(o),1}let y=g.find(a=>a.type==="page"&&a.url.includes(s));if(!y)return console.error(` no page target matching "${s}" on CDP :${o}`),console.error(` open targets: ${g.map(a=>a.url).join(", ")||"(none)"}`),1;let c=new w(y.webSocketDebuggerUrl);await c.waitOpen();try{let a=new Map;if(c.on((n,l)=>{n==="Target.attachedToTarget"&&l.targetInfo?.type==="worker"&&a.set(l.sessionId,l.targetInfo.url),n==="Target.detachedFromTarget"&&a.delete(l.sessionId)}),await c.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),await v(500),a.size===0)return console.error(" no worker targets attached \u2014 is the app loaded in this tab?"),1;for(let n of a.keys())await c.send("Profiler.enable",{},n),await c.send("Profiler.setSamplingInterval",{interval:r*1e3},n),await c.send("Profiler.start",{},n);console.log(` recording ${t}s across ${a.size} worker(s) \u2014 interact now\u2026`),await v(t*1e3);let m=[];for(let[n,l]of a){let{profile:f}=await c.send("Profiler.stop",{},n);m.push({url:l,profile:f})}return m.sort((n,l)=>l.profile.samples.length-n.profile.samples.length),$(S(u),{recursive:!0}),m.forEach((n,l)=>{let f=l===0?u:u.replace(/(\.[^.]+)?$/,`.worker${l}$1`);if(P(f,JSON.stringify(n.profile)),console.log(` ${b(n.url)}: ${n.profile.samples.length} samples \u2192 ${f}`),i.verbose&&n.profile.samples.length>0)for(let h of k(n.profile,12))console.log(` ${h.pct.toFixed(1).padStart(5)}% ${h.name} ${h.url}`)}),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}finally{c.close()}}function T(e){console.error(` cpu-profile needs a CDP-enabled browser on :${e}.`),console.error(" the tenant worker can't be profiled via the JS Self-Profiler API (F28),"),console.error(" so the sim must expose Chrome remote debugging. easiest path \u2014"),console.error(" open the sim with a CDP port (it stays driveable over the bridge,"),console.error(" so you can scroll/navigate while profiling):"),console.error(""),console.error(` sootsim open <metro-port> --new --driver playwright --cdp-port ${e}`),console.error(` sootsim cpu-profile --cdp-port ${e} --match <metro-port>`),console.error(""),console.error(" or launch a standalone CDP Chrome (not bridge-driveable):"),console.error(""),console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\'),console.error(` --remote-debugging-port=${e} --user-data-dir=/tmp/sootsim-cdp \\`),console.error(" --no-sandbox --disable-gpu-sandbox --in-process-gpu \\"),console.error(" --use-gl=angle --use-angle=swiftshader --enable-unsafe-swiftshader \\"),console.error(' "http://localhost:5173/rn/<metro-port>" &'),console.error(""),console.error(" override the port with --cdp-port or $SOOTSIM_CDP_PORT.")}function b(e){return e?e.replace(/^https?:\/\/[^/]+/,"").replace(/\?.*$/,"").slice(-50):"(native)"}function k(e,i){let t=e.samples.length||1,r=new Map;for(let o of e.nodes){let s=o.callFrame,p=`${s.functionName||"(anonymous)"}@${b(s.url)}:${s.lineNumber}`,u=r.get(p)??{self:0,name:s.functionName||"(anonymous)",url:`${b(s.url)}:${s.lineNumber}`};u.self+=o.hitCount??0,r.set(p,u)}return[...r.values()].map(o=>({...o,pct:o.self/t*100})).sort((o,s)=>s.self-o.self).slice(0,i)}function d(e,i){let t=e.indexOf(i);if(!(t<0||t===e.length-1))return e[t+1]}export{D as runCpuProfile};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as N,b as B}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as N,b as B}from"./chunk-JMXKC7DE.js";import"./chunk-2V4FB2RT.js";import{c as O}from"./chunk-2MWM7JD6.js";import"./chunk-ESZY26WY.js";import"./chunk-DHULHNVZ.js";import"./chunk-RI6LUHT6.js";import"./chunk-LV3DINZS.js";import"./chunk-BRIWO44I.js";import"./chunk-2SQVUKGN.js";import"./chunk-C5BXRLHS.js";import{h as I,i as _,q as T,r as k,s as C}from"./chunk-GH25H5QD.js";import{a as H}from"./chunk-QTFL2HSS.js";import{execFileSync as rt,spawnSync as s}from"child_process";import{existsSync as d,mkdirSync as v,readFileSync as ot,rmSync as S,writeFileSync as M}from"fs";import{homedir as $}from"os";import{dirname as j,resolve as m}from"path";import{execFileSync as K}from"child_process";import{chmodSync as X,mkdirSync as E,rmSync as Q,writeFileSync as D}from"fs";import{dirname as L}from"path";var z="dev.sootsim.daemon",R="SootSim Daemon",U="0.1.36";function F(t,o,r){let e=k(),n=C(),a=L(L(n)),c=L(n),l=`${a}/Resources`;Q(e,{recursive:!0,force:!0}),E(T(),{recursive:!0}),E(c,{recursive:!0}),E(l,{recursive:!0}),D(`${a}/Info.plist`,J()),D(`${a}/PkgInfo`,"APPL????"),D(n,Z(t,o,r)),X(n,493);try{K("codesign",["--force","--sign","-","--deep",e],{stdio:"pipe"})}catch(i){let u=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${e} failed: ${u}
|
|
3
3
|
the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:e,launcherPath:n}}function J(){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
4
4
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
5
5
|
<plist version="1.0">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{f,m as T}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{f,m as T}from"./chunk-QA7DWZXG.js";import{J as A,K as D,L as O,M as x,N as v}from"./chunk-4POIDYSQ.js";import{c as S,e as $,g as N}from"./chunk-PCW7AAPN.js";import"./chunk-ZJUIBQPS.js";import"./chunk-LV3DINZS.js";import"./chunk-GH25H5QD.js";import"./chunk-QTFL2HSS.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
|
|
3
3
|
sootsim debug \u2014 drive __sootsimDebug from the terminal
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -167,7 +167,7 @@ examples:
|
|
|
167
167
|
} : null,
|
|
168
168
|
samples,
|
|
169
169
|
}
|
|
170
|
-
})()`}async function c(i,l){return N(i,l)}async function Y(i,l){let g=S(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-
|
|
170
|
+
})()`}async function c(i,l){return N(i,l)}async function Y(i,l){let g=S(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-EDWNKILW.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=$(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
|
|
171
171
|
known: ${H.join(", ")}`),process.exit(1));let o=await v(t,"enable",e);console.log(a({active:o},n));break}case"disable":{let e=B(r[0]),o=await v(t,"disable",e);console.log(a({active:o},n));break}case"toggle":{let e=r[0];e||(console.error(" usage: sootsim debug toggle <channel>"),process.exit(1));let o=await c(t,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(a({[e]:o},n));break}case"status":{let e=await A(t);console.log(a(e,n));break}case"channels":{let e=await c(t,"window.__sootsimDebug.channels()");console.log(a(e,n));break}case"flags":{let e=await D(t);console.log(a(e,n));break}case"snapshot":{let e=r[0],o=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",s=await c(t,`(() => { const s = ${o}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(a(s,n));break}case"snapshots":{let e=await c(t,"window.__sootsimDebug.snapshots()");console.log(a(e,n));break}case"diff":{let e=r[0],o=r[1];(!e||!o)&&(console.error(" usage: sootsim debug diff <labelA> <labelB>"),process.exit(1));let s=`(() => {
|
|
172
172
|
const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(o)});
|
|
173
173
|
if (!d) return null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as S}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as S}from"./chunk-ZVELB7QY.js";import"./chunk-SKDLBR7B.js";import"./chunk-RJTJ67H3.js";import"./chunk-XIG5BFQB.js";import"./chunk-S56YDDA7.js";import"./chunk-7WZEEFD3.js";import"./chunk-GAXCW6BZ.js";import"./chunk-4HETKHPX.js";import"./chunk-BJFLKJZI.js";import"./chunk-QA7DWZXG.js";import"./chunk-4POIDYSQ.js";import"./chunk-O5HTYUHB.js";import"./chunk-FCICI3EX.js";import"./chunk-PCW7AAPN.js";import"./chunk-FTCNYGT4.js";import"./chunk-P53GI4GU.js";import"./chunk-NT6JVAUN.js";import"./chunk-OZ3UZ2VO.js";import"./chunk-PPH7UKZN.js";import"./chunk-QSFSGKVF.js";import"./chunk-ZJUIBQPS.js";import"./chunk-JMXKC7DE.js";import"./chunk-2V4FB2RT.js";import"./chunk-ESZY26WY.js";import"./chunk-RI6LUHT6.js";import"./chunk-LV3DINZS.js";import"./chunk-CQKIN4UH.js";import"./chunk-C5BXRLHS.js";import"./chunk-GH25H5QD.js";import"./chunk-QTFL2HSS.js";import{spawn as D}from"child_process";import{existsSync as u,mkdirSync as _,writeFileSync as f,unlinkSync as I}from"fs";import{tmpdir as P}from"os";import{dirname as $,resolve as n,join as M}from"path";function E(){try{let e=import.meta.resolve("sootsim/detox");return $(e.startsWith("file://")?e.slice(7):e)}catch{return n(import.meta.dirname,"..","..","detox")}}var F=`
|
|
3
3
|
sootsim detox \u2014 run detox-style tests against a sootsim shell
|
|
4
4
|
|
|
5
5
|
usage:
|