sootsim 0.1.188 → 0.1.190
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/README.md +9 -9
- package/dist-cli/bin.js +7 -7
- package/dist-cli/chunks/{agent-BRLC23GZ.js → agent-XZWMKC4F.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-HDWSAABN.js → agent-wrapper-CFJYDDAY.js} +2 -2
- package/dist-cli/chunks/{app-fonts-KQHDDWAH.js → app-fonts-64UN5GRY.js} +2 -2
- package/dist-cli/chunks/{assert-BA3G3DLH.js → assert-A3MQH7ZB.js} +2 -2
- package/dist-cli/chunks/auth-CNKNHD6U.js +10 -0
- package/dist-cli/chunks/beta-CDL7U2RE.js +2 -0
- package/dist-cli/chunks/camera-YQPIDOEN.js +20 -0
- package/dist-cli/chunks/{chunk-I52NHG4X.js → chunk-24OZOK2K.js} +1 -1
- package/dist-cli/chunks/{chunk-OXB6RPMX.js → chunk-3JVMBXLH.js} +2 -2
- package/dist-cli/chunks/{chunk-GAP76GG5.js → chunk-5IM3DYTZ.js} +1 -1
- package/dist-cli/chunks/{chunk-DBOVJCG5.js → chunk-6EFMFMJB.js} +2 -2
- package/dist-cli/chunks/{chunk-DKOKNFWR.js → chunk-6UQKBGI7.js} +2 -3
- package/dist-cli/chunks/{chunk-ERHMPVNZ.js → chunk-7TSFDDU7.js} +2 -2
- package/dist-cli/chunks/chunk-AAQ6AYYW.js +2 -0
- package/dist-cli/chunks/chunk-CD3ARXZW.js +1 -0
- package/dist-cli/chunks/chunk-CTP3U4WV.js +13 -0
- package/dist-cli/chunks/{chunk-QDUHROO5.js → chunk-CVUAT6TO.js} +1 -1
- package/dist-cli/chunks/chunk-DHDV2I2T.js +1 -0
- package/dist-cli/chunks/{chunk-TAXDBR5N.js → chunk-EBBYYBYM.js} +3 -3
- package/dist-cli/chunks/chunk-F6GCSGBJ.js +8 -0
- package/dist-cli/chunks/{chunk-HIS4TFND.js → chunk-INRO26KS.js} +2 -2
- package/dist-cli/chunks/{install-desktop-F43JZSJO.js → chunk-IOJDFCGV.js} +7 -7
- package/dist-cli/chunks/{chunk-D6GYUATH.js → chunk-ITQV76PX.js} +1 -1
- package/dist-cli/chunks/chunk-IUVDM73R.js +140 -0
- package/dist-cli/chunks/{chunk-2MRFRROI.js → chunk-K5GLQDTG.js} +2 -2
- package/dist-cli/chunks/{chunk-FUZNRCAR.js → chunk-K7OCH4WY.js} +2 -2
- package/dist-cli/chunks/{chunk-NCENLBIL.js → chunk-KLGX6B46.js} +2 -2
- package/dist-cli/chunks/{chunk-AUQ7FZIX.js → chunk-LRJVY7SN.js} +2 -2
- package/dist-cli/chunks/{chunk-2T6Z4WCN.js → chunk-MH6BMKK5.js} +1 -1
- package/dist-cli/chunks/{chunk-Y3I43AUV.js → chunk-MJU4XNZ3.js} +1 -1
- package/dist-cli/chunks/{chunk-ZZ7FODQE.js → chunk-NAI6N6SN.js} +8 -7
- package/dist-cli/chunks/chunk-P7MW7S62.js +87 -0
- package/dist-cli/chunks/chunk-PGQHNKRL.js +119 -0
- package/dist-cli/chunks/chunk-PR3IKD6A.js +2 -0
- package/dist-cli/chunks/chunk-PSETHPMH.js +565 -0
- package/dist-cli/chunks/{chunk-BZNPGYJQ.js → chunk-QJVITDKU.js} +1 -1
- package/dist-cli/chunks/{chunk-SVSZFGNA.js → chunk-QNVY6BLP.js} +1 -1
- package/dist-cli/chunks/{chunk-YNY3WSH4.js → chunk-R3VO3MDO.js} +1 -1
- package/dist-cli/chunks/{chunk-5U22ZNDP.js → chunk-SJHC6HZH.js} +1 -1
- package/dist-cli/chunks/{chunk-ZZTGVTE3.js → chunk-SMDCNCVZ.js} +1 -1
- package/dist-cli/chunks/{chunk-TPHYWQB2.js → chunk-SPYRMNAJ.js} +5 -5
- package/dist-cli/chunks/{chunk-B272R3FA.js → chunk-TBFBGSRV.js} +1 -1
- package/dist-cli/chunks/chunk-UPN7Z5XZ.js +916 -0
- package/dist-cli/chunks/{chunk-KOEBHC3D.js → chunk-WHYPFQIZ.js} +2 -2
- package/dist-cli/chunks/{chunk-NDAGMI4C.js → chunk-WR5IDCCN.js} +1 -1
- package/dist-cli/chunks/{chunk-BJMQRL7V.js → chunk-WT74ZUKN.js} +1 -1
- package/dist-cli/chunks/{chunk-5XZN2C22.js → chunk-Y6CZ5N26.js} +2 -2
- package/dist-cli/chunks/{chunk-IULK4TUU.js → chunk-YWQH2KQJ.js} +1 -1
- package/dist-cli/chunks/cli-version-PVRNMRL7.js +2 -0
- package/dist-cli/chunks/{compat-6QHB5UPF.js → compat-AU7EW2AY.js} +3 -3
- package/dist-cli/chunks/config-TNZV6ASD.js +11 -0
- package/dist-cli/chunks/control-TKDPQACC.js +2 -0
- package/dist-cli/chunks/daemon-L57B7HBL.js +2 -0
- package/dist-cli/chunks/{debug-OTEVKM5L.js → debug-H5UHUDC4.js} +3 -3
- package/dist-cli/chunks/desktop-WYPCYR3Z.js +32 -0
- package/dist-cli/chunks/{detox-MISIYJRV.js → detox-36VI5PZ3.js} +2 -2
- package/dist-cli/chunks/{device-R3BORN7B.js → device-XPSGGSM5.js} +2 -2
- package/dist-cli/chunks/{diagnose-G7UE2PUJ.js → diagnose-CH3VYGFO.js} +10 -10
- package/dist-cli/chunks/drivers-XDAXVIZF.js +2 -0
- package/dist-cli/chunks/flow-Q24HN25I.js +2 -0
- package/dist-cli/chunks/help-OPVDM7BI.js +2 -0
- package/dist-cli/chunks/{home-paths-EJFFLJZR.js → home-paths-IT2LCG6O.js} +2 -2
- package/dist-cli/chunks/inspect-FEMU6KSY.js +2 -0
- package/dist-cli/chunks/install-desktop-NCMJNSW7.js +2 -0
- package/dist-cli/chunks/{login-3ZNZJ7P4.js → login-O6XRDK26.js} +5 -5
- package/dist-cli/chunks/{logout-34JBFFT4.js → logout-YK7BH4AK.js} +2 -2
- package/dist-cli/chunks/{maestro-JYCD7OQT.js → maestro-T52UBLSK.js} +6 -6
- package/dist-cli/chunks/mode-L4GR563F.js +93 -0
- package/dist-cli/chunks/optional-demo-registry-PDFLBZMQ.js +2 -0
- package/dist-cli/chunks/perf-7DYLYEBO.js +43 -0
- package/dist-cli/chunks/{record-L54OVMQQ.js → record-MNIFB5DJ.js} +7 -7
- package/dist-cli/chunks/runtime-E4KWRPBT.js +2 -0
- package/dist-cli/chunks/screenshot-command-D77AXBND.js +190 -0
- package/dist-cli/chunks/{serve-D6HGTNWI.js → serve-LFPZVOVA.js} +2 -2
- package/dist-cli/chunks/{setup-MR7SX23V.js → setup-6FX2KQP4.js} +3 -3
- package/dist-cli/chunks/skills-36CRDBMN.js +48 -0
- package/dist-cli/chunks/storage-N45XGOMV.js +35 -0
- package/dist-cli/chunks/store-USJP5W6S.js +2 -0
- package/dist-cli/chunks/telemetry-WQ7RK6NE.js +2 -0
- package/dist-cli/chunks/test-GCVW3U2P.js +69 -0
- package/dist-cli/chunks/{timeline-SBCWQHQT.js → timeline-4ALLBESW.js} +2 -2
- package/dist-cli/chunks/{upgrade-RGJVNFZO.js → upgrade-75XAVSMJ.js} +2 -2
- package/dist-cli/chunks/upload-34BCSEFZ.js +2 -0
- package/dist-cli/chunks/{version-23HGJOE3.js → version-MSFDAHVF.js} +2 -2
- package/dist-cli/chunks/{web-YMQPB45M.js → web-IS75NWAC.js} +2 -2
- package/dist-cli/chunks/{what-happened-3AJBD35R.js → what-happened-TW6SN7Z7.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +53 -0
- 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 +15 -7
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro.cjs +13 -5
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +121 -79
- package/dist-lib/vite.cjs +13 -5
- package/package.json +1 -1
- package/skills/{soot.md → soot/SKILL.md} +12 -25
- package/skills/{sootsim-debug.md → sootsim-debug/SKILL.md} +1 -1
- package/skills/sootsim-perf/SKILL.md +169 -0
- package/skills/{sootsim-test.md → sootsim-test/SKILL.md} +10 -7
- package/src/metro-plugin.ts +2 -2
- package/src/runtime-assets.ts +16 -2
- package/src/screenshots/orchestrate.ts +1 -1
- package/src/screenshots/org-deck.ts +1 -1
- package/src/vite-plugin-one.ts +2 -2
- package/dist-cli/chunks/beta-O43XI622.js +0 -2
- package/dist-cli/chunks/camera-22Q4QVTC.js +0 -20
- package/dist-cli/chunks/chunk-3ECPODR2.js +0 -382
- package/dist-cli/chunks/chunk-4JG6GDLB.js +0 -2
- package/dist-cli/chunks/chunk-5D6TXWZQ.js +0 -3
- package/dist-cli/chunks/chunk-6LAPS7RP.js +0 -3
- package/dist-cli/chunks/chunk-FHHOZTPI.js +0 -3
- package/dist-cli/chunks/chunk-FXHED7P5.js +0 -79
- package/dist-cli/chunks/chunk-HGER3AOP.js +0 -69
- package/dist-cli/chunks/chunk-HXEGZCLS.js +0 -118
- package/dist-cli/chunks/chunk-JOE4R2PO.js +0 -1
- package/dist-cli/chunks/chunk-MXYAGDBC.js +0 -24
- package/dist-cli/chunks/chunk-PCKWE63K.js +0 -987
- package/dist-cli/chunks/chunk-QCDWRDUC.js +0 -1
- package/dist-cli/chunks/chunk-SGZP6JCZ.js +0 -16
- package/dist-cli/chunks/chunk-V7V6WDIM.js +0 -13
- package/dist-cli/chunks/chunk-WST3QKHD.js +0 -180
- package/dist-cli/chunks/cli-version-74E3VGPF.js +0 -2
- package/dist-cli/chunks/control-A2KALMZE.js +0 -2
- package/dist-cli/chunks/cpu-profile-A3ST63G2.js +0 -2
- package/dist-cli/chunks/daemon-KBQK2QRU.js +0 -2
- package/dist-cli/chunks/drivers-4URQ5PMT.js +0 -2
- package/dist-cli/chunks/electron-DXMMDHR3.js +0 -19
- package/dist-cli/chunks/flow-OETRQOLM.js +0 -2
- package/dist-cli/chunks/help-FSZ5FRHV.js +0 -2
- package/dist-cli/chunks/hints-QJSWKWC5.js +0 -2
- package/dist-cli/chunks/inspect-EFTHNTN2.js +0 -2
- package/dist-cli/chunks/keys-P2HBCVAX.js +0 -19
- package/dist-cli/chunks/optional-demo-registry-MM6GWJNB.js +0 -2
- package/dist-cli/chunks/preview-PIEAC5MZ.js +0 -17
- package/dist-cli/chunks/profile-BTCKOPAU.js +0 -22
- package/dist-cli/chunks/react-UYKTFQZW.js +0 -30
- package/dist-cli/chunks/runtime-ZB7S4Z3H.js +0 -2
- package/dist-cli/chunks/screenshot-A5WQUFIQ.js +0 -35
- package/dist-cli/chunks/screenshot-mode-GBZSTZTV.js +0 -17
- package/dist-cli/chunks/screenshots-EHE2FKTA.js +0 -74
- package/dist-cli/chunks/screenshots-capture-MOZJ2RQV.js +0 -41
- package/dist-cli/chunks/skills-NHV2ZFOU.js +0 -48
- package/dist-cli/chunks/slides-WDFLQWCZ.js +0 -46
- package/dist-cli/chunks/store-7EYKU7RK.js +0 -2
- package/dist-cli/chunks/telemetry-MU23XMBJ.js +0 -2
- package/dist-cli/chunks/telemetry-NF6KAWA4.js +0 -2
- package/dist-cli/chunks/test-CVQHZHMJ.js +0 -31
- package/dist-cli/chunks/three-mode-UCOVUXVY.js +0 -58
- package/dist-cli/chunks/upload-GHIMBL2Y.js +0 -2
- package/dist-cli/chunks/whoami-ZM3TCPNU.js +0 -2
- /package/skills/{sootsim-setup.md → sootsim-setup/SKILL.md} +0 -0
- /package/skills/{sootsim-visual.md → sootsim-visual/SKILL.md} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{H as I,m as B,n as E,o as y,t as v,v as A}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{H as I,m as B,n as E,o as y,t as v,v as A}from"./chunk-QNVY6BLP.js";import{h,l as N,m as P}from"./chunk-Y6CZ5N26.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 N(e,`__sootsimTest.${t}`,...r)}async function k(e,t,...r){return P(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(!I(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=h(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=h(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:B}),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&&y({nodes:f,targets:$})&&g-u>=E)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&&y(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:A});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 v(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{createHash as b}from"node:crypto";import g from"node:fs";import{createRequire as S}from"node:module";import u from"node:path";var y=/\.(ttf|otf|woff|woff2)$/i;function P(t,n,r){if(!t||typeof t!="object")return;let o=t.fonts;if(Array.isArray(o))for(let i of o)typeof i=="string"&&r.push(i);let e=t[n];if(!e||typeof e!="object")return;let s=e.fonts;if(Array.isArray(s))for(let i of s){if(typeof i=="string"){r.push(i);continue}if(!i||typeof i!="object")continue;let c=i.fontDefinitions;if(Array.isArray(c))for(let a of c){if(!a||typeof a!="object")continue;let p=a.path;typeof p=="string"&&r.push(p)}}}function m(t,n){if(!Array.isArray(t))return[];let r=[];for(let o of t){let e=Array.isArray(o)?o[0]:o;if(typeof e!="string"||!/(^|\/)expo-font$/.test(e))continue;let s=Array.isArray(o)?o[1]??{}:{};P(s,n,r)}return r}function C(t){return t.slice(t.lastIndexOf("/")+1).replace(y,"")}function h(t,n){let r=n.replace(/\/+$/,""),o=new Set,e=[];for(let s of t){let i=s.replace(/^\.\//,"").replace(/^\/+/,"");!i||o.has(i)||(o.add(i),y.test(i)&&e.push({family:C(i),url:`${r}/assets/${i}`}))}return e}var d=S(import.meta.url);function x(t){try{let n=new URL(t),r=n.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 n.origin}catch{}return null}var R=["app.config.js","app.config.ts","app.config.cjs","app.config.mjs","app.json"];function w(t){for(let n of R)try{if(g.statSync(u.join(t,n)).isFile())return!0}catch{}return!1}var j=new Set(["node_modules","artifacts","dist","build","out","coverage","tmp","public","ios","android","macos","windows","__fixtures__","__tests__","examples","example"]);function F(t,n){w(t)&&n.push(t);let r;try{r=g.readdirSync(t,{withFileTypes:!0})}catch{return}for(let o of r)o.isDirectory()&&(o.name.startsWith(".")||j.has(o.name)||F(u.join(t,o.name),n))}function _(t){try{return g.statSync(u.join(t,"package.json")).isFile()}catch{return!1}}function I(t){let n=x(t.bundleUrl);if(!n)return[];let r=t.repoDir||process.env.SOOT_REPO_DIR,o=r?u.resolve(r):process.cwd();if(!r&&!_(o))return[];let e=[];if(r)F(o,e),e.includes(o)||e.push(o);else{if(!w(o))return[];e.push(o)}if(e.length===0)return[];let s=(t.platform||process.env.SOOT_PLATFORM||"ios").toLowerCase(),i=null;try{let l=d.resolve("@expo/config",{paths:[...e,o]}),f=d(l);typeof f.getConfig=="function"&&(i=f.getConfig)}catch{}if(!i)return[];let c;for(let l of e)try{let f=i(l,{skipSDKVersionRequirement:!0});if(f?.exp&&typeof f.exp=="object"){let A=f.exp.plugins;if(Array.isArray(A)){c=f.exp;break}}}catch{}if(!c||typeof c!="object")return[];let a=c.plugins;if(!Array.isArray(a))return[];let p=m(a,s==="android"?"android":"ios");return h(p,n)}async function L(t,n){let r=x(t);if(!r)return null;let o=new AbortController,e=setTimeout(()=>o.abort(),n?.timeoutMs??1500);try{let s=await fetch(`${r}/`,{headers:{"expo-platform":"ios",Accept:"application/json"},signal:o.signal});if(!s.ok)return null;let c=(await s.json())?.extra?.expoClient?._internal?.projectRoot;return typeof c=="string"&&c.length>0?c:null}catch{return null}finally{clearTimeout(e)}}function M(t){return t.map(n=>`${encodeURIComponent(n.url)}::${encodeURIComponent(n.family)}`).join(",")}function k(t){let n=[];for(let r of t.split(",")){let o=r.trim();if(!o)continue;let e=o.indexOf("::"),s=e===-1?o:o.slice(0,e);try{n.push(decodeURIComponent(s))}catch{n.push(s)}}return n.filter(Boolean)}function D(t){let n=(t.split("?")[0].split(".").pop()||"").toLowerCase();return n==="ttf"?"font/ttf":n==="otf"?"font/otf":n==="woff"?"font/woff":n==="woff2"?"font/woff2":"application/octet-stream"}async function G(t,n){let r=[],o=new Set;for(let e of k(t)){let s=b("sha256").update(e).digest("hex");if(!o.has(s)){o.add(s);try{let i=await fetch(e);if(!i.ok){n?.onError?.(e,new Error(`${i.status} ${i.statusText}`));continue}let c=new Uint8Array(await i.arrayBuffer());r.push({url:e,urlhash:s,contentType:D(e),bytes:c}),n?.onStaged?.({url:e,byteLength:c.byteLength})}catch(i){n?.onError?.(e,i)}}}return r}export{I as a,L as b,M as c,G as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{readFileSync as i}from"node:fs";import{fileURLToPath as e}from"node:url";var r=null;function l(){if(r!=null)return r;let o=[()=>e(import.meta.resolve("sootsim/package.json")),()=>e(new URL("../package.json",import.meta.url))];for(let n of o)try{let t=JSON.parse(i(n(),"utf8")).version;if(typeof t=="string"&&t)return r=t,r}catch{}return r="0.0.0",r}export{l as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{c as f}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as f}from"./chunk-CVUAT6TO.js";import{a as C,d as W,f as x}from"./chunk-SJHC6HZH.js";import{I as y,J as w,K as I,L as S}from"./chunk-MH6BMKK5.js";import{WebSocket as v}from"ws";function L(){let i=w();if(i&&S(i))return{source:"dev-bridge",bridgePort:i.bridgePort,shellBaseUrl:i.shellPort?`http://localhost:${i.shellPort}/`:f};let r=y();return r&&I(r)?{source:"daemon",bridgePort:r.bridgePort,shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:f}:{source:"default",bridgePort:7668,shellBaseUrl:f}}function E(i){let r=w();if(r&&S(r)&&r.bridgePort===i)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:f};let e=y();return e&&I(e)&&e.bridgePort===i?{source:"daemon",shellBaseUrl:e.runtimePort>0?`http://localhost:${e.runtimePort}/`:f}:null}function q(i){let r;try{let l=new URL(i);r=l.port?Number(l.port):l.protocol==="https:"?443:80}catch{return null}if(!Number.isFinite(r)||r<=0)return null;let e=w();if(e&&S(e)&&(e.shellPort===r||e.runtimePort===r||e.bridgePort===r))return e.bridgePort;let d=y();return d&&I(d)&&(d.runtimePort===r||d.bridgePort===r)?d.bridgePort:null}function O(){return L().bridgePort}function H(i,r){let e=E(i),d=e?.source==="dev-bridge"?"dev bridge":e?.source==="daemon"?"daemon bridge":"bridge",l=e?`${e.source}.json`:"no lockfile",t=r??e?.shellBaseUrl;process.stderr.write(` \u2192 ${d} :${i} (${t?`shell ${t}, `:""}${l})
|
|
3
3
|
`)}var k=class extends Error{lock;constructor(r,e){super(r),this.name="BridgeSimLockedError",this.lock=e}};function M(i){return i==="flag"?"via --sim":i==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function J(i,r={}){let e=new Set,d=r.port??O(),l=r.commandTimeoutMs??15e3,t,m="none",B=new Set(r.stripBooleanFlags??[]),h=new Set(r.stripValueFlags??[]);for(let n=0;n<i.length;n++){let a=i[n];if(a==="--port"||a==="-p"){e.add(n),n+1<i.length&&(e.add(n+1),d=Number(i[n+1])),n++;continue}if(a.startsWith("--port=")){e.add(n),d=Number(a.slice(7));continue}if(a==="--timeout"){e.add(n),n+1<i.length&&(e.add(n+1),l=Number(i[n+1])),n++;continue}if(a==="--sim"||a==="--session"||a==="--tab"){e.add(n),n+1<i.length&&(e.add(n+1),t=i[n+1]?.trim()||void 0,m="flag"),n++;continue}let s=a.startsWith("--sim=")?a.slice(6):a.startsWith("--session=")?a.slice(10):a.startsWith("--tab=")?a.slice(6):void 0;if(s!==void 0){e.add(n),t=s.trim()||void 0,m="flag";continue}if(B.has(a)){e.add(n);continue}h.has(a)&&(e.add(n),n+1<i.length&&e.add(n+1),n++)}if(!t){let n=W();n&&(t=n.trim()||void 0,m="saved")}return{positional:i.filter((n,a)=>!e.has(a)),wsPort:d,simId:t,simIdSource:m,commandTimeoutMs:l}}function U(i,r={}){let e=1,d=r.commandTimeoutMs??15e3,l=new Map,t=new v(`ws://localhost:${i}`),m=C(),B=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:${i}${g}`))})}),h=!1,n=!1;function a(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=M(o?r.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${g})
|
|
4
4
|
`)}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&&!h&&(h=!0,process.stderr.write(`
|
|
5
5
|
\u26A0 ${o._otherCliCount} other CLI identity/identities are driving this sim
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.190 | (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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-YWQH2KQJ.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-IS75NWAC.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-IS75NWAC.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
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as i,B as s,x as t}from"./chunk-MH6BMKK5.js";import"./chunk-YWQH2KQJ.js";function l(){let e=i();console.log(` telemetry is ${e?"ON":"OFF"}`),console.log(` config: ${t()}`);let o=process.env.DO_NOT_TRACK;(o==="1"||o==="true")&&console.log(` note: DO_NOT_TRACK=${o} is set \u2014 telemetry is off for this run`)}async function r(e){let o=e.find(n=>!n.startsWith("-"))?.toLowerCase();switch(o){case void 0:case"status":l();return;case"on":case"enable":s(!0),console.log(" telemetry ON"),console.log(` config: ${t()}`);return;case"off":case"disable":s(!1),console.log(" telemetry OFF"),console.log(` config: ${t()}`);return;default:console.error(` unknown telemetry action: ${o}`),console.error(" usage: sootsim config telemetry [on|off|status]"),process.exit(1)}}function c(){console.log(`
|
|
3
|
+
sootsim config \u2014 manage local CLI preferences
|
|
4
|
+
|
|
5
|
+
usage:
|
|
6
|
+
sootsim config telemetry [on|off|status]
|
|
7
|
+
|
|
8
|
+
environment:
|
|
9
|
+
SOOTSIM_HINTS=off suppress CLI hints
|
|
10
|
+
SOOTSIM_HINTS=always show every CLI hint every time
|
|
11
|
+
`)}async function m(e){if(e.includes("--help")||e.includes("-h")){c();return}let o=e.find(n=>!n.startsWith("-"));if(o==="telemetry"){let n=e.indexOf(o);await r([...e.slice(0,n),...e.slice(n+1)]);return}console.error(` unknown config command: ${o??"(missing)"}`),c(),process.exit(1)}export{m as runConfig};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.190 | (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,w as t,x as u}from"./chunk-CTP3U4WV.js";import"./chunk-SPYRMNAJ.js";import"./chunk-CD3ARXZW.js";import"./chunk-R3VO3MDO.js";import"./chunk-WR5IDCCN.js";import"./chunk-MJU4XNZ3.js";import"./chunk-WHYPFQIZ.js";import"./chunk-QNVY6BLP.js";import"./chunk-Y6CZ5N26.js";import"./chunk-NAI6N6SN.js";import"./chunk-TBFBGSRV.js";import"./chunk-QJVITDKU.js";import"./chunk-6EFMFMJB.js";import"./chunk-7TSFDDU7.js";import"./chunk-CVUAT6TO.js";import"./chunk-SJHC6HZH.js";import"./chunk-MH6BMKK5.js";import"./chunk-ITQV76PX.js";import"./chunk-YWQH2KQJ.js";export{f as buildOpenUrl,e as buildShellUrl,s as closeSimsBulk,b as normalizeDeepLinkTarget,t as planBulkCloseTargets,k as playwrightHostPidForSim,h as printConnectedSims,c as resolveBundleTarget,d as resolveDefaultShellBaseUrl,a as resolveDriverConnectWaitOptions,r as runClaimCommand,u as runCloseCommand,q as runFocusCommand,n as runLinkCommand,o as runOpenCommand,p as runUseCommand,l as signalDriverLaunchConnected,g as summarizeSimUrl,m as terminatePlaywrightHostsForSims,i as waitForSimMatch,j as waitForSimMatchOrHostExit};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d,e}from"./chunk-INRO26KS.js";import"./chunk-KLGX6B46.js";import"./chunk-K5GLQDTG.js";import"./chunk-F6GCSGBJ.js";import"./chunk-LRJVY7SN.js";import"./chunk-PGQHNKRL.js";import"./chunk-7TSFDDU7.js";import"./chunk-CVUAT6TO.js";import"./chunk-SJHC6HZH.js";import"./chunk-MH6BMKK5.js";import"./chunk-WT74ZUKN.js";import"./chunk-24OZOK2K.js";import"./chunk-ITQV76PX.js";import"./chunk-YWQH2KQJ.js";export{c as daemonInstall,b as getDaemonServiceStatus,a as runDaemon,d as teardownDaemonService,e as teardownSootsimHome};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{f,m as T}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{f,m as T}from"./chunk-WHYPFQIZ.js";import{K as S,L as $,M as N,N as A,O as v}from"./chunk-QNVY6BLP.js";import{g as D,i as O,k as x}from"./chunk-Y6CZ5N26.js";import"./chunk-CVUAT6TO.js";import"./chunk-SJHC6HZH.js";import"./chunk-MH6BMKK5.js";import"./chunk-YWQH2KQJ.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:
|
|
@@ -170,7 +170,7 @@ examples:
|
|
|
170
170
|
} : null,
|
|
171
171
|
samples,
|
|
172
172
|
}
|
|
173
|
-
})()`}async function c(i,l){return x(i,l)}async function Y(i,l){let g=D(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","memory","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-
|
|
173
|
+
})()`}async function c(i,l){return x(i,l)}async function Y(i,l){let g=D(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","memory","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-FEMU6KSY.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=O(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
|
|
174
174
|
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 S(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 $(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=`(() => {
|
|
175
175
|
const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(o)});
|
|
176
176
|
if (!d) return null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as g}from"./chunk-IOJDFCGV.js";import{a as v,h as k}from"./chunk-CTP3U4WV.js";import"./chunk-SPYRMNAJ.js";import"./chunk-CD3ARXZW.js";import"./chunk-R3VO3MDO.js";import"./chunk-WR5IDCCN.js";import"./chunk-MJU4XNZ3.js";import{a as u}from"./chunk-SMDCNCVZ.js";import"./chunk-WHYPFQIZ.js";import"./chunk-QNVY6BLP.js";import"./chunk-Y6CZ5N26.js";import"./chunk-DHDV2I2T.js";import{b as m,g as f,l as h}from"./chunk-NAI6N6SN.js";import{a as c}from"./chunk-TBFBGSRV.js";import"./chunk-QJVITDKU.js";import"./chunk-6EFMFMJB.js";import"./chunk-7TSFDDU7.js";import"./chunk-CVUAT6TO.js";import"./chunk-SJHC6HZH.js";import"./chunk-MH6BMKK5.js";import"./chunk-ITQV76PX.js";import"./chunk-YWQH2KQJ.js";function I(e){let i=e.indexOf("--port");if(i<0)return;let o=e[i+1],t=o?Number(o):Number.NaN;return(!Number.isInteger(t)||t<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),t}async function O(e,i){let o=I(e)??i.port;return o?k(String(o)):void 0}async function w(e,i){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
3
|
+
sootsim desktop \u2014 launch the desktop companion
|
|
4
|
+
|
|
5
|
+
usage:
|
|
6
|
+
sootsim desktop [options]
|
|
7
|
+
|
|
8
|
+
options:
|
|
9
|
+
--port <number> connect to running dev server on this port
|
|
10
|
+
--driver <id> override the launch driver (default: electron)
|
|
11
|
+
--profile <id> launch with an isolated persistent storage profile
|
|
12
|
+
--ephemeral launch with a temporary isolated storage profile
|
|
13
|
+
|
|
14
|
+
examples:
|
|
15
|
+
sootsim desktop
|
|
16
|
+
sootsim desktop --port 5173
|
|
17
|
+
sootsim desktop --profile qa
|
|
18
|
+
sootsim desktop --driver system
|
|
19
|
+
`),process.exit(0));let o=e.indexOf("--driver"),t=o>=0?e[o+1]:void 0,n=e.find((r,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");n&&d&&(console.error(" sootsim desktop: --profile cannot be combined with --ephemeral"),process.exit(1));let x=n?m(n).id:void 0,s=t||i.driver,l=f;if(s){let r=h(s);r||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=r}if(l.id==="electron"){let r=c();if(!r){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await u("run sootsim desktop install now?",!0)){console.log();let{runInstallDesktop:D}=await import("./install-desktop-NCMJNSW7.js");await D(["--yes"]),r=c()}r||process.exit(1)}console.log(` launching ${r.path}`)}let b=await O(e,i),p=await l.launch({url:b,device:i.device,profileId:x,ephemeralProfile:d});p.launched||(console.error(` ${p.message}`),process.exit(1)),console.log(` ${p.message}`)}function y(){console.log(`
|
|
20
|
+
sootsim desktop \u2014 launch or install the desktop companion
|
|
21
|
+
|
|
22
|
+
usage:
|
|
23
|
+
sootsim desktop [options]
|
|
24
|
+
sootsim desktop install [options]
|
|
25
|
+
|
|
26
|
+
options:
|
|
27
|
+
--port <number> connect to a running dev server on this port
|
|
28
|
+
--profile <id> launch with an isolated persistent storage profile
|
|
29
|
+
--ephemeral launch with a temporary isolated storage profile
|
|
30
|
+
--driver <id> override the launch driver
|
|
31
|
+
-y, --yes install without prompting
|
|
32
|
+
`)}async function H(e,i){if(e.includes("--help")||e.includes("-h")){y();return}let o=e.find(t=>!t.startsWith("-"));if(o==="install"){let t=e.indexOf(o);await g([...e.slice(0,t),...e.slice(t+1)]);return}await w(e,i)}export{H as runDesktop};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as S}from"./chunk-PSETHPMH.js";import"./chunk-UPN7Z5XZ.js";import"./chunk-IUVDM73R.js";import"./chunk-6UQKBGI7.js";import"./chunk-P7MW7S62.js";import"./chunk-AAQ6AYYW.js";import"./chunk-CTP3U4WV.js";import"./chunk-SPYRMNAJ.js";import"./chunk-CD3ARXZW.js";import"./chunk-R3VO3MDO.js";import"./chunk-WR5IDCCN.js";import"./chunk-MJU4XNZ3.js";import"./chunk-WHYPFQIZ.js";import"./chunk-QNVY6BLP.js";import"./chunk-Y6CZ5N26.js";import"./chunk-NAI6N6SN.js";import"./chunk-TBFBGSRV.js";import"./chunk-QJVITDKU.js";import"./chunk-PR3IKD6A.js";import"./chunk-6EFMFMJB.js";import"./chunk-KLGX6B46.js";import"./chunk-K5GLQDTG.js";import"./chunk-PGQHNKRL.js";import"./chunk-7TSFDDU7.js";import"./chunk-CVUAT6TO.js";import"./chunk-SJHC6HZH.js";import"./chunk-MH6BMKK5.js";import"./chunk-ITQV76PX.js";import"./chunk-YWQH2KQJ.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:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-CD3ARXZW.js";import{g as d,i as l,l as a}from"./chunk-Y6CZ5N26.js";import"./chunk-6EFMFMJB.js";import"./chunk-7TSFDDU7.js";import"./chunk-CVUAT6TO.js";import"./chunk-SJHC6HZH.js";import"./chunk-MH6BMKK5.js";import{g as c,h as r,i as g}from"./chunk-ITQV76PX.js";import"./chunk-YWQH2KQJ.js";function h(){console.log(`
|
|
3
3
|
sootsim device \u2014 inspect or change the live device preset for a sim
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{g as E,i as R,l as b}from"./chunk-
|
|
3
|
-
sootsim
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{g as E,i as R,l as b}from"./chunk-Y6CZ5N26.js";import"./chunk-CVUAT6TO.js";import{b as v}from"./chunk-SJHC6HZH.js";import"./chunk-MH6BMKK5.js";import"./chunk-YWQH2KQJ.js";function F(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(s=>typeof s=="string"?s:JSON.stringify(s)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
|
|
3
|
+
sootsim get diagnosis \u2014 compact "what just went wrong?" report
|
|
4
4
|
|
|
5
5
|
usage:
|
|
6
|
-
sootsim
|
|
6
|
+
sootsim get diagnosis [--since <duration>] [--include <csv>] [--json]
|
|
7
7
|
|
|
8
8
|
options:
|
|
9
9
|
--since <d> absolute window for timeline + network (e.g. 90s, 2m, 500ms; default 90s)
|
|
@@ -16,12 +16,12 @@ options:
|
|
|
16
16
|
the diagnose report runs every dimension in parallel against the same
|
|
17
17
|
sim and returns a grouped summary. use \`sootsim what-happened\`
|
|
18
18
|
for chronological events, \`sootsim network\` for full request inspection,
|
|
19
|
-
\`sootsim react summary\` for the React tables on their own.
|
|
19
|
+
\`sootsim perf react summary\` for the React tables on their own.
|
|
20
20
|
|
|
21
21
|
examples:
|
|
22
|
-
sootsim
|
|
23
|
-
sootsim
|
|
24
|
-
sootsim
|
|
22
|
+
sootsim get diagnosis
|
|
23
|
+
sootsim get diagnosis --since 30s --include network,react
|
|
24
|
+
sootsim get diagnosis --json > /tmp/diagnosis.json
|
|
25
25
|
`)}function A(e,s){if(!e)return s;let o=/^(\d+(?:\.\d+)?)(ms|s|m)?$/.exec(e.trim());if(!o)return s;let r=Number(o[1]),t=o[2]??"ms";return t==="s"?r*1e3:t==="m"?r*6e4:r}function D(e){if(!e)return B;let s=new Set;for(let o of e.split(",")){let r=o.trim().toLowerCase();r&&s.add(r)}return s}function k(e,s){let o=e.indexOf(s);if(o>=0&&o+1<e.length)return e[o+1];let r=`${s}=`;return e.find(t=>t.startsWith(r))?.slice(r.length)}function T(e,s,o){let r=k(e,s);if(r===void 0)return o;let t=Number(r);return Number.isFinite(t)&&t>0?Math.round(t):o}async function O(e,s){let o={limit:500,since:Date.now()-s},t=(await b(e,"SootSim.bridges.timeline.recent",o)).events??[],i={},c=[],d=[],p=[];for(let u of t){i[u.kind]=(i[u.kind]??0)+1;let l=u.data,m=l&&typeof l=="object"?l.level:void 0;u.kind==="console"&&(m==="error"||m==="warn")&&c.push(u),(u.kind==="alert"||u.kind==="actionsheet"||u.kind==="picker")&&d.push(u),(u.kind==="screen"||u.kind==="route")&&p.push(u)}return{events:t,byKind:i,total:t.length,errors:c,alerts:d,screens:p}}async function L(e,s,o){let r=await e.send({type:"evaluate",code:`(() => {
|
|
26
26
|
const obs = window.__sootsimObservability;
|
|
27
27
|
if (!obs) return { ok: false };
|
|
@@ -31,11 +31,11 @@ examples:
|
|
|
31
31
|
if (!obs) return { ok: false };
|
|
32
32
|
return { ok: true, entries: obs.logs.getSnapshot() };
|
|
33
33
|
})()`});if(!o||!o.ok)return{error:"observability bridge not installed"};let r=Date.now()-s,i=(o.entries??[]).filter(c=>F(c)>=r&&(c.level==="error"||c.level==="warn"));return{entries:i.slice(-20),total:i.length}}function N(e){let s=e.error?"err":e.status!=null?String(e.status):"...",o=(e.method??"GET").padEnd(6),r=e.durationMs!=null?`${e.durationMs.toFixed(0)}ms`:"...",t=e.displayUrl??e.url,i=t.length>96?`${t.slice(0,92)}\u2026`:t;return` ${s.padStart(3)} ${o} ${r.padStart(7)} ${i} (${e.id})`}function M(e,s){let o=((e.t-s)/1e3).toFixed(2),r=e.t>=s?"-":"+",t=e.data,i="";if(t&&typeof t=="object"){let c=(t.message??"").toString().slice(0,120),d=(t.title??t.name??t.path??t.url??"").toString();i=[(t.phase??"").toString(),d,c].filter(Boolean).join(" \xB7 ")}return` -${o.padStart(5)}s [${e.kind}] ${i}`}function j(e,s,o){if(s.length===0)return`${o}(no rows)`;let r=e.map((i,c)=>Math.max(i.length,...s.map(d=>d[c]?.length??0))),t=i=>i.map((c,d)=>c.padEnd(r[d])).join(" ").trimEnd();return[t(e),t(e.map(i=>"-".repeat(i.length))),...s.map(t)].map(i=>`${o}${i}`).join(`
|
|
34
|
-
`)}async function J(e,s){if(e.includes("--help")||e.includes("-h"))return P(),0;let o=E(e,{port:s.port,stripBooleanFlags:["--json","--help","-h"],stripValueFlags:["--since","--include","--limit","--slow-threshold"]}),r=o.positional[0]??"recent";if(r!=="recent")return console.error(` unknown subcommand: ${r}`),console.error(" did you mean: sootsim
|
|
34
|
+
`)}async function J(e,s){if(e.includes("--help")||e.includes("-h"))return P(),0;let o=E(e,{port:s.port,stripBooleanFlags:["--json","--help","-h"],stripValueFlags:["--since","--include","--limit","--slow-threshold"]}),r=o.positional[0]??"recent";if(r!=="recent")return console.error(` unknown subcommand: ${r}`),console.error(" did you mean: sootsim get diagnosis ?"),1;let t=A(k(e,"--since"),9e4),i=D(k(e,"--include")),c=T(e,"--limit",8),d=T(e,"--slow-threshold",1e3),p=e.includes("--json"),u=R(o);try{let l=[],m=[];(i.has("timeline")||i.has("screen")||i.has("alert"))&&(m.push("timeline"),l.push(O(u,t))),(i.has("network")||i.has("fetch"))&&(m.push("network"),l.push(L(u,t,d))),i.has("react")&&(m.push("react"),l.push(C(u,c))),i.has("console")&&(m.push("console"),l.push(_(u,t)));let $=await u.send({type:"evaluate",code:"globalThis.__sootsimEngineBuild ?? null"}).then(n=>typeof n=="string"?n:null).catch(()=>null),x=await Promise.all(l),w={};for(let n=0;n<m.length;n++)w[m[n]]=x[n];if(p)return console.log(JSON.stringify({generatedAt:Date.now(),engineBuild:$,sinceMs:t,include:Array.from(i),slices:w},null,2)),0;let S=Date.now();if(console.log(` diagnose recent (last ${(t/1e3).toFixed(0)}s, include: ${Array.from(i).sort().join(",")}):`),console.log(` engine build: ${$??"unknown (no build stamp \u2014 likely a stale or pre-F20-5 engine)"}`),w.timeline){let n=w.timeline;console.log(`
|
|
35
35
|
timeline \u2014 ${n.total} event(s) in window`);let f=Object.entries(n.byKind).sort((a,g)=>g[1]-a[1]).map(([a,g])=>`${g} ${a}`).join(" \xB7 ");if(f&&console.log(` summary: ${f}`),n.screens.length){let g=n.screens[n.screens.length-1].data,h=g?g.name??g.activeName??g.path??"?":"?";console.log(` last screen: ${String(h)}`)}if(n.alerts.length){console.log(` alerts (${n.alerts.length}):`);for(let a of n.alerts.slice(-5))console.log(M(a,S))}if(n.errors.length){console.log(` console errors/warns from timeline (${n.errors.length}):`);for(let a of n.errors.slice(-5))console.log(M(a,S))}}if(w.network){let n=w.network;if("error"in n)console.log(`
|
|
36
36
|
network \u2014 ${n.error}`);else{if(console.log(`
|
|
37
37
|
network \u2014 ${n.total} request(s), ${n.failed.length} failed, ${n.slow.length} slow (>${n.slowThresholdMs}ms), ${n.inFlight} in-flight`),n.failed.length){console.log(" failed:");for(let f of n.failed.slice(-8))console.log(N(f))}if(n.slow.length){console.log(" slowest:");for(let f of n.slow.slice(0,5))console.log(N(f))}}}if(w.react){let n=w.react;console.log(`
|
|
38
38
|
react \u2014 ${n.commits} commit(s)`),n.error&&console.log(` warning: ${n.error}`),n.durationWarning&&console.log(` warning: ${n.durationWarning}`),n.slow.length>0&&n.slow.every(a=>a.totalMs<=0&&a.slowestMs<=0)&&!n.durationWarning&&console.log(" warning: every commit reports actualDuration=0ms \u2014 bundle has React profiler timer disabled"),n.slow.length&&(console.log(" slowest:"),console.log(j(["component","total","commits","slowest"],n.slow.slice(0,c).map(a=>[a.displayName,`${a.totalMs.toFixed(2)}ms`,String(a.commitCount),`${a.slowestMs.toFixed(2)}ms`])," "))),n.rerenders.length&&(console.log(" most rerenders:"),console.log(j(["component","renders","top causes"],n.rerenders.slice(0,c).map(a=>{let g=Object.entries(a.causes??{}).filter(([,h])=>h>0).sort((h,y)=>y[1]-h[1]).slice(0,3).map(([h,y])=>`${h}:${y}`).join(", ");return[a.displayName,String(a.renders??a.count??0),g||"-"]})," ")))}if(w.console){let n=w.console;if("error"in n)console.log(`
|
|
39
39
|
console \u2014 ${n.error}`);else{console.log(`
|
|
40
40
|
console errors/warns \u2014 ${n.total} in window`);for(let f of n.entries.slice(-8)){let a=((F(f)-S)/1e3).toFixed(2),g=W(f).slice(0,160);console.log(` -${a.padStart(5)}s [${f.level}] ${g}`)}}}return v()&&console.log(`
|
|
41
|
-
next: sootsim what-happened (cursor advances) \xB7 sootsim network get <id> \xB7 sootsim react why <fiber-id>`),0}catch(l){let m=l instanceof Error?l.message:String(l);return/no sim connected/i.test(m)?console.error(" no sim connected \u2014 open one first: sootsim open <metroPort>"):console.error(` diagnose failed: ${m}`),1}finally{u.close()}}export{J as runDiagnose};
|
|
41
|
+
next: sootsim what-happened (cursor advances) \xB7 sootsim network get <id> \xB7 sootsim perf react why <fiber-id>`),0}catch(l){let m=l instanceof Error?l.message:String(l);return/no sim connected/i.test(m)?console.error(" no sim connected \u2014 open one first: sootsim open <metroPort>"):console.error(` diagnose failed: ${m}`),1}finally{u.close()}}export{J as runDiagnose};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-DHDV2I2T.js";import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i}from"./chunk-NAI6N6SN.js";import"./chunk-TBFBGSRV.js";import"./chunk-QJVITDKU.js";import"./chunk-SJHC6HZH.js";import"./chunk-MH6BMKK5.js";import"./chunk-YWQH2KQJ.js";export{e as ALL_DRIVERS,i as buildDriverListRows,a as chromiumDriver,b as electronDriver,f as getAllDrivers,g as getDriver,c as playwrightDriver,h as resolveDriver,d as systemDriver};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c,d,e,f,g}from"./chunk-PSETHPMH.js";import{c as a,d as b}from"./chunk-UPN7Z5XZ.js";import"./chunk-IUVDM73R.js";import"./chunk-6UQKBGI7.js";import"./chunk-P7MW7S62.js";import"./chunk-AAQ6AYYW.js";import"./chunk-CTP3U4WV.js";import"./chunk-SPYRMNAJ.js";import"./chunk-CD3ARXZW.js";import"./chunk-R3VO3MDO.js";import"./chunk-WR5IDCCN.js";import"./chunk-MJU4XNZ3.js";import"./chunk-WHYPFQIZ.js";import"./chunk-QNVY6BLP.js";import"./chunk-Y6CZ5N26.js";import"./chunk-NAI6N6SN.js";import"./chunk-TBFBGSRV.js";import"./chunk-QJVITDKU.js";import"./chunk-PR3IKD6A.js";import"./chunk-6EFMFMJB.js";import"./chunk-KLGX6B46.js";import"./chunk-K5GLQDTG.js";import"./chunk-PGQHNKRL.js";import"./chunk-7TSFDDU7.js";import"./chunk-CVUAT6TO.js";import"./chunk-SJHC6HZH.js";import"./chunk-MH6BMKK5.js";import"./chunk-ITQV76PX.js";import"./chunk-YWQH2KQJ.js";export{d as discoverSootsimUrl,c as getLastFlowPreviewUploadResult,f as hoistLeadingSimFlag,a as parseFlowFile,g as runFlow,e as runFlowPlayback,b as validateFlowFile};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c}from"./chunk-F6GCSGBJ.js";import"./chunk-LRJVY7SN.js";import"./chunk-PGQHNKRL.js";import"./chunk-7TSFDDU7.js";import"./chunk-CVUAT6TO.js";import"./chunk-SJHC6HZH.js";import"./chunk-MH6BMKK5.js";import"./chunk-WT74ZUKN.js";import"./chunk-24OZOK2K.js";import"./chunk-ITQV76PX.js";import"./chunk-YWQH2KQJ.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-MH6BMKK5.js";import"./chunk-YWQH2KQJ.js";export{b as ACTIVE_RUNTIME_FILE,e as CONFIG_FILE,f as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,d as DEV_BRIDGE_LOCKFILE,a as SOOTSIM_HOME_ENV,H as activeRuntimeDir,m as activeRuntimeFile,u as cacheDir,O as claimDaemonLockfile,G as compareSemver,x as configFilePath,s as daemonAppBundlePath,r as daemonAppDir,t as daemonAppLauncherPath,v as daemonLockfilePath,w as devBridgeLockfilePath,n as electronDir,o as electronUserDataDir,p as electronVersionDir,C as ensureSootsimHome,K as isDaemonLockfileFresh,L as isDevBridgeLockfileFresh,i as isDevWorkstation,h as isSootsimDevCheckout,F as listInstalledRuntimes,q as profilesDir,D as readActiveRuntime,I as readDaemonLockfile,J as readDevBridgeLockfile,y as readSharedConfig,A as readTelemetryEnabled,P as removeDaemonLockfile,Q as removeDevBridgeLockfile,l as runtimeDir,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,E as writeActiveRuntime,M as writeDaemonLockfile,N as writeDevBridgeLockfile,z as writeSharedConfig,B as writeTelemetryEnabled};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{j as a,k as b}from"./chunk-UPN7Z5XZ.js";import"./chunk-IUVDM73R.js";import"./chunk-CTP3U4WV.js";import"./chunk-SPYRMNAJ.js";import"./chunk-CD3ARXZW.js";import"./chunk-R3VO3MDO.js";import"./chunk-WR5IDCCN.js";import"./chunk-MJU4XNZ3.js";import"./chunk-WHYPFQIZ.js";import"./chunk-QNVY6BLP.js";import"./chunk-Y6CZ5N26.js";import"./chunk-NAI6N6SN.js";import"./chunk-TBFBGSRV.js";import"./chunk-QJVITDKU.js";import"./chunk-PR3IKD6A.js";import"./chunk-6EFMFMJB.js";import"./chunk-PGQHNKRL.js";import"./chunk-7TSFDDU7.js";import"./chunk-CVUAT6TO.js";import"./chunk-SJHC6HZH.js";import"./chunk-MH6BMKK5.js";import"./chunk-ITQV76PX.js";import"./chunk-YWQH2KQJ.js";export{a as printShellPerfReport,b as runInspect};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as g,d as m}from"./chunk-
|
|
3
|
-
sootsim login \u2014 sign in so
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as g,d as m}from"./chunk-K5GLQDTG.js";import"./chunk-MH6BMKK5.js";import"./chunk-YWQH2KQJ.js";import{exec as O}from"node:child_process";import{randomBytes as S}from"node:crypto";import _ from"node:http";var I=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",h="http://localhost:3000";async function x(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${h}/api/auth/me`)).ok)return h}catch{}return I}function L(){console.log(`
|
|
3
|
+
sootsim login \u2014 sign in so uploads can attach to your account
|
|
4
4
|
|
|
5
5
|
usage:
|
|
6
6
|
sootsim login [--origin <url>]
|
|
@@ -21,6 +21,6 @@ options:
|
|
|
21
21
|
<p style="color:#ccc">${r}</p>
|
|
22
22
|
</div>
|
|
23
23
|
</body>
|
|
24
|
-
</html>`}async function P(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!e.ok){let c=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${c}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function A(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function G(r){(r.includes("--help")||r.includes("-h"))&&(L(),process.exit(0));let e=[...r],t=await x(R(e,"--origin"));if(A(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await P(t);if(o.ok){g({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let s=await m(t),l=s?.user?.email||o.email||s?.user?.id||o.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-
|
|
24
|
+
</html>`}async function P(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!e.ok){let c=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${c}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function A(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function G(r){(r.includes("--help")||r.includes("-h"))&&(L(),process.exit(0));let e=[...r],t=await x(R(e,"--origin"));if(A(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await P(t);if(o.ok){g({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let s=await m(t),l=s?.user?.email||o.email||s?.user?.id||o.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-WQ7RK6NE.js");n({event:"cli_login_succeeded",identity:{userId:o.userId??s?.user?.id??null},properties:{origin:t,mode:"dev"}}),await a(),console.log(` signed in${l?` as ${l}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let c=S(16).toString("hex"),i=await new Promise(o=>{let s=_.createServer((l,n)=>{try{let a=new URL(l.url||"/","http://127.0.0.1"),w=a.searchParams.get("state"),k=a.searchParams.get("token"),b=a.searchParams.get("email")||void 0,$=a.searchParams.get("userId")||void 0,f=a.searchParams.get("error");if(n.setHeader("content-type","text/html; charset=utf-8"),f){n.end(u(`sign-in failed: ${f}`)),o({ok:!1,error:f}),s.close();return}if(w!==c){n.end(u("state mismatch. close this tab and retry `sootsim login`.")),o({ok:!1,error:"state mismatch"}),s.close();return}if(!k){n.end(u("missing token. close this tab and retry `sootsim login`.")),o({ok:!1,error:"missing token"}),s.close();return}n.end(u("sign-in complete. you can return to the terminal.")),o({ok:!0,token:k,email:b,userId:$}),s.close()}catch(a){n.statusCode=500,n.end(u("sign-in callback failed. retry `sootsim login`.")),o({ok:!1,error:a instanceof Error?a.message:"callback failed"}),s.close()}});s.listen(0,"127.0.0.1",()=>{let l=s.address();if(!l||typeof l=="string"){o({ok:!1,error:"failed to bind callback server"}),s.close();return}let n=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",c),n.searchParams.set("port",String(l.port)),n.searchParams.set("sootbean",t),console.log(" opening browser for sootsim login..."),console.log(` waiting for callback on 127.0.0.1:${l.port}`),console.log(` if nothing opens, visit:
|
|
25
25
|
${n.toString()}
|
|
26
|
-
`),T(n.toString())})});if(!i.ok){let{trackCliEvent:o,flushCliTelemetry:s}=await import("./telemetry-
|
|
26
|
+
`),T(n.toString())})});if(!i.ok){let{trackCliEvent:o,flushCliTelemetry:s}=await import("./telemetry-WQ7RK6NE.js");o({event:"cli_login_failed",properties:{origin:t,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}g({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:t,source:"cli"});let d=await m(t),p=d?.user?.email||i.email||d?.user?.id||i.userId,{trackCliEvent:y,flushCliTelemetry:v}=await import("./telemetry-WQ7RK6NE.js");y({event:"cli_login_succeeded",identity:{userId:i.userId??d?.user?.id??null},properties:{origin:t}}),await v(),console.log(` signed in${p?` as ${p}`:""}`)}export{G as runLogin};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as r,b as i}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as r,b as i}from"./chunk-KLGX6B46.js";import{a as t,c as o}from"./chunk-K5GLQDTG.js";import"./chunk-MH6BMKK5.js";import"./chunk-YWQH2KQJ.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{e as w,f as v}from"./chunk-PSETHPMH.js";import{c as y}from"./chunk-UPN7Z5XZ.js";import{a as h}from"./chunk-IUVDM73R.js";import"./chunk-6UQKBGI7.js";import"./chunk-P7MW7S62.js";import"./chunk-AAQ6AYYW.js";import"./chunk-CTP3U4WV.js";import"./chunk-SPYRMNAJ.js";import"./chunk-CD3ARXZW.js";import"./chunk-R3VO3MDO.js";import"./chunk-WR5IDCCN.js";import"./chunk-MJU4XNZ3.js";import"./chunk-WHYPFQIZ.js";import"./chunk-QNVY6BLP.js";import"./chunk-Y6CZ5N26.js";import"./chunk-NAI6N6SN.js";import"./chunk-TBFBGSRV.js";import"./chunk-QJVITDKU.js";import"./chunk-PR3IKD6A.js";import"./chunk-6EFMFMJB.js";import"./chunk-KLGX6B46.js";import"./chunk-K5GLQDTG.js";import"./chunk-PGQHNKRL.js";import"./chunk-7TSFDDU7.js";import"./chunk-CVUAT6TO.js";import"./chunk-SJHC6HZH.js";import"./chunk-MH6BMKK5.js";import"./chunk-ITQV76PX.js";import"./chunk-YWQH2KQJ.js";import*as n from"fs";import*as a from"path";var S=[".maestro","maestro"];function k(){console.log(`
|
|
3
3
|
sootsim maestro \u2014 run maestro YAML flows against sootsim (drop-in)
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -34,7 +34,7 @@ sootsim maestro \u2014 compatibility matrix
|
|
|
34
34
|
|
|
35
35
|
supported verbs:
|
|
36
36
|
launchApp, stopApp, clearState, clearKeychain (warn-only),
|
|
37
|
-
tapOn, tapAtCoords, longPressOn
|
|
37
|
+
tapOn, tapAtCoords, longPressOn,
|
|
38
38
|
inputText, pressKey, dispatchKey, hideKeyboard, eraseText,
|
|
39
39
|
assertVisible, assertNotVisible, assertTreeContains,
|
|
40
40
|
waitFor, extendedWaitUntil, waitForAnimationToEnd,
|
|
@@ -70,7 +70,7 @@ not yet implemented (will throw "unsupported maestro verb"):
|
|
|
70
70
|
travel, setLocation, setAirplaneMode, killApp, faker,
|
|
71
71
|
addMedia, startRecording, stopRecording (use --record flag),
|
|
72
72
|
repeat.while (only repeat.times is supported).
|
|
73
|
-
`)}function b(o){return o.startsWith("-")}function $(o){let i=[];for(let e=0;e<o.length;e++){if(o[e]==="--env"||o[e]==="-e"){let s=o[e+1];if(!s||!s.includes("="))throw new Error(`--env expects KEY=VALUE (got ${JSON.stringify(s??"")})`);let
|
|
73
|
+
`)}function b(o){return o.startsWith("-")}function $(o){let i=[];for(let e=0;e<o.length;e++){if(o[e]==="--env"||o[e]==="-e"){let s=o[e+1];if(!s||!s.includes("="))throw new Error(`--env expects KEY=VALUE (got ${JSON.stringify(s??"")})`);let p=s.indexOf("="),l=s.slice(0,p),f=s.slice(p+1);process.env[l]=f,e+=1;continue}i.push(o[e])}return i}function T(o){let i=[];for(let e=0;e<o.length;e++){let s=o[e];if(s==="--format"||s==="--output"||s==="--device"||s==="-d"){e+=1;continue}if(s==="--continuous"){console.warn(" warn: --continuous is not yet implemented in sootsim \u2014 running once");continue}i.push(s)}return i}function x(o){for(let i of S){let e=a.join(o,i);if(n.existsSync(e)&&n.statSync(e).isDirectory())return e}return null}function F(o){let i=n.statSync(o);if(i.isFile())return[o];if(!i.isDirectory())throw new Error(`not a file or directory: ${o}`);let e={},s=["config.yaml","config.yml"].map(t=>a.join(o,t)).find(t=>n.existsSync(t));if(s){let t=h.parse(n.readFileSync(s,"utf8"));t&&typeof t=="object"&&(e=t)}let p=Array.isArray(e.flows)&&e.flows.length>0?e.flows:["*"],l=t=>{let r=a.basename(t);return!(r.startsWith(".")||!r.endsWith(".yaml")&&!r.endsWith(".yml")||r==="config.yaml"||r==="config.yml")},f=new Set;for(let t of p)for(let r of n.globSync(t,{cwd:o})){if(!l(r))continue;let c=a.join(o,r);n.existsSync(c)&&n.statSync(c).isFile()&&f.add(c)}let m=[...f].sort(),u=Array.isArray(e.includeTags)?e.includeTags:[],d=Array.isArray(e.excludeTags)?e.excludeTags:[];return(u.length>0||d.length>0)&&(m=m.filter(t=>{let{frontmatter:r}=y(n.readFileSync(t,"utf8")),c=Array.isArray(r.tags)?r.tags:[];return!(u.length>0&&!c.some(g=>u.includes(g))||c.some(g=>d.includes(g)))})),m}async function E(o){let i=a.join(o,".maestro");n.mkdirSync(i,{recursive:!0});let e=a.join(i,"login.yaml");return n.existsSync(e)?(console.error(` error: ${e} already exists`),1):(n.writeFileSync(e,`# sootsim maestro starter flow \u2014 drop-in compatible with the maestro cli.
|
|
74
74
|
# run: sootsim maestro test .maestro/login.yaml
|
|
75
75
|
appId: com.example.app
|
|
76
76
|
---
|
|
@@ -83,7 +83,7 @@ appId: com.example.app
|
|
|
83
83
|
- inputText: "secret123"
|
|
84
84
|
- tapOn: "Sign in"
|
|
85
85
|
- assertVisible: "Welcome"
|
|
86
|
-
`,"utf8"),console.log(` + wrote ${e}`),console.log(" next: sootsim maestro test .maestro/login.yaml"),0)}async function R(o,i={}){if(o.includes("--help")||o.includes("-h"))return k(),0;if(o.includes("--list-compat"))return A(),0;let e;try{e=$(o)}catch(t){return console.error(` error: ${t.message}`),1}e=T(e),e=v(e);let s=process.cwd(),
|
|
86
|
+
`,"utf8"),console.log(` + wrote ${e}`),console.log(" next: sootsim maestro test .maestro/login.yaml"),0)}async function R(o,i={}){if(o.includes("--help")||o.includes("-h"))return k(),0;if(o.includes("--list-compat"))return A(),0;let e;try{e=$(o)}catch(t){return console.error(` error: ${t.message}`),1}e=T(e),e=v(e);let s=process.cwd(),p=e[0];if(p==="init")return E(s);let l=null,f;if(p==="test"){let t=e.slice(1).find(r=>!b(r));t?(l=a.resolve(s,t),f=e.slice(1).filter(r=>r!==t)):(l=x(s),f=e.slice(1))}else p&&!b(p)?(l=a.resolve(s,p),f=e.slice(1)):(l=x(s),f=e);if(!l)return console.error(`
|
|
87
87
|
error: no maestro flows found.
|
|
88
88
|
expected one of: ${S.map(t=>`./${t}/`).join(", ")}
|
|
89
89
|
or pass a flow explicitly: sootsim maestro test path/to/flow.yaml
|
|
@@ -92,5 +92,5 @@ appId: com.example.app
|
|
|
92
92
|
sootsim maestro \u2014 ${m.length} flow${m.length===1?"":"s"}
|
|
93
93
|
root: ${a.relative(s,l)||"."}
|
|
94
94
|
`);let u=0,d=[];for(let t of m){console.log(`
|
|
95
|
-
\u25B6 ${a.relative(s,t)}`);let r=[t,...
|
|
95
|
+
\u25B6 ${a.relative(s,t)}`);let r=[t,...f];i.port&&!f.includes("--url")&&r.push("--url",String(i.port));let c=0;try{c=await w(r)}catch(g){console.error(` x ${g.message}`),c=1}d.push({file:t,exit:c}),c!==0&&u===0&&(u=c)}if(m.length>1){console.log(`
|
|
96
96
|
maestro summary:`);for(let r of d){let c=r.exit===0?"pass":"fail";console.log(` ${c} ${a.relative(s,r.file)}`)}let t=d.filter(r=>r.exit===0).length;console.log(` ${t}/${d.length} passed`)}return u}export{F as collectFlowFiles,R as runMaestro};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*! sootsim v0.1.190 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{g,i as m,l as O,m as T}from"./chunk-Y6CZ5N26.js";import"./chunk-CVUAT6TO.js";import"./chunk-SJHC6HZH.js";import"./chunk-MH6BMKK5.js";import"./chunk-YWQH2KQJ.js";function A(e){let o=e[0]?.toLowerCase()??"toggle";return o!=="on"&&o!=="off"&&o!=="toggle"&&(console.error(` unknown argument: "${o}" (expected on | off | toggle)`),process.exit(1)),o}async function b(e,o,n){let t=g(e,{port:o.port}),i=A(t.positional),d=m({...t,commandTimeoutMs:5e3});try{let l=!!(await O(d,"SootSim.bridges.settings.get"))?.[n.modeKey],s=i==="on"?!0:i==="off"?!1:!l;if(l===s)return console.log(` ${n.displayName}: already ${s?"on":"off"}`),{current:l,target:s,changed:!1};if(!await d.send({type:"evaluate",acquireLock:!0,code:`(async () => {
|
|
3
|
+
const modeKey = ${JSON.stringify(n.modeKey)}
|
|
4
|
+
const target = ${JSON.stringify(s)}
|
|
5
|
+
window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
|
|
6
|
+
detail: { type: 'fire-action', id: ${JSON.stringify(n.actionId)} },
|
|
7
|
+
}))
|
|
8
|
+
const deadline = Date.now() + 1200
|
|
9
|
+
while (Date.now() < deadline) {
|
|
10
|
+
if (Boolean(window.SootSim?.bridges?.settings?.get?.()?.[modeKey]) === target) {
|
|
11
|
+
return true
|
|
12
|
+
}
|
|
13
|
+
await new Promise((resolve) => setTimeout(resolve, 40))
|
|
14
|
+
}
|
|
15
|
+
return false
|
|
16
|
+
})()`}))throw new Error(`${n.displayName} did not change to ${s?"on":"off"}; the live shell may not support this mode`);return console.log(` ${n.displayName}: ${l?"on":"off"} -> ${s?"on":"off"}`),{current:l,target:s,changed:!0}}finally{d.close()}}async function N(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
17
|
+
sootsim mode screenshot \u2014 toggle the screenshot-mode chrome overlay
|
|
18
|
+
|
|
19
|
+
usage:
|
|
20
|
+
sootsim mode screenshot [on|off|toggle]
|
|
21
|
+
|
|
22
|
+
arguments:
|
|
23
|
+
on enable screenshot mode (enables showFrame if needed)
|
|
24
|
+
off disable screenshot mode
|
|
25
|
+
toggle flip the current state (default)
|
|
26
|
+
|
|
27
|
+
examples:
|
|
28
|
+
sootsim mode screenshot
|
|
29
|
+
sootsim mode screenshot on
|
|
30
|
+
sootsim mode screenshot off
|
|
31
|
+
`),process.exit(0)),await b(e,o,{modeKey:"screenshotMode",displayName:"screenshot-mode",actionId:"toggle-screenshot-mode"})}var S=12e3;async function R(e,o){if((e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
32
|
+
sootsim mode three \u2014 toggle the 3d device stage
|
|
33
|
+
|
|
34
|
+
usage:
|
|
35
|
+
sootsim mode three [on|off|toggle]
|
|
36
|
+
sootsim mode three configure [options]
|
|
37
|
+
|
|
38
|
+
arguments:
|
|
39
|
+
on enable 3d mode
|
|
40
|
+
off disable 3d mode
|
|
41
|
+
toggle flip the current state (default)
|
|
42
|
+
|
|
43
|
+
configure options:
|
|
44
|
+
--background <id> set the 3d background
|
|
45
|
+
--gradient <stops> custom gradient bg: comma-separated css hex stops,
|
|
46
|
+
e.g. "#0a0e1a,#16243f,#05080f" (overrides --background;
|
|
47
|
+
evenly spaced, or use "color@offset" for explicit %)
|
|
48
|
+
--gradient-angle <deg> custom gradient angle (default 180 = top\u2192bottom)
|
|
49
|
+
--colorway <id> set the phone colorway
|
|
50
|
+
--script <id> apply a camera preset pose
|
|
51
|
+
--progress <0..1> script progress to sample (default: 1)
|
|
52
|
+
--animate run the script instead of sampling one frame
|
|
53
|
+
--slow run the script slowly when --animate is set
|
|
54
|
+
--environment on|off enable or disable environment objects
|
|
55
|
+
--env-shape <id> orb | pill | diamond | pane
|
|
56
|
+
--env-spread <id> tight | medium | wide
|
|
57
|
+
--env-size <id> small | medium | large
|
|
58
|
+
--env-color <id> peach | gold | mint | sky | violet
|
|
59
|
+
--env-glow on|off enable or disable environment glow
|
|
60
|
+
--env-plastic on|off enable or disable environment plastic material
|
|
61
|
+
--room on|off enable or disable the room effect
|
|
62
|
+
--bokeh on|off enable or disable bokeh
|
|
63
|
+
--reset-pose return to the default hero pose before other changes
|
|
64
|
+
|
|
65
|
+
examples:
|
|
66
|
+
sootsim mode three
|
|
67
|
+
sootsim mode three on
|
|
68
|
+
sootsim mode three configure --script hero-arc --background gradient-neon
|
|
69
|
+
sootsim mode three configure --environment on --env-shape pane --room on
|
|
70
|
+
sootsim mode three off
|
|
71
|
+
`),process.exit(0)),D(e)){await I(e,o);return}(await b(e,o,{modeKey:"threeMode",displayName:"three-mode",actionId:"toggle-three-mode"})).target&&await z(e,o)}function D(e){return e[0]==="configure"||e.some(o=>["--background","--gradient","--gradient-angle","--colorway","--script","--progress","--animate","--slow","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--room","--bokeh","--reset-pose"].includes(o))}async function I(e,o){let n=g(e,{port:o.port,stripBooleanFlags:["--animate","--slow","--reset-pose"],stripValueFlags:["--background","--gradient","--gradient-angle","--colorway","--script","--progress","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--room","--bokeh"]}),t=K(e),i=m({...n,commandTimeoutMs:S+1e3});try{await C(i);let d=await T(i,"SootSim.bridges.threeMode.configure",t);console.log(` three-mode: configured (${P(d)})`)}finally{i.close()}}async function z(e,o){let n=g(e,{port:o.port}),t=m({...n,commandTimeoutMs:S+1e3});try{await C(t)}finally{t.close()}}async function C(e){let o=await e.send({type:"evaluate",code:`(async () => {
|
|
72
|
+
const deadline = Date.now() + ${S}
|
|
73
|
+
while (Date.now() < deadline) {
|
|
74
|
+
const settings = window.SootSim?.bridges?.settings?.get?.()
|
|
75
|
+
if (settings && settings.threeMode !== true) {
|
|
76
|
+
return { ready: false, disabled: true }
|
|
77
|
+
}
|
|
78
|
+
const bridge = window.SootSim?.bridges?.threeMode
|
|
79
|
+
const state = typeof bridge?.getState === 'function' ? bridge.getState() : null
|
|
80
|
+
if (state?.ready === true) return state
|
|
81
|
+
await new Promise((resolve) => setTimeout(resolve, 50))
|
|
82
|
+
}
|
|
83
|
+
const bridge = window.SootSim?.bridges?.threeMode
|
|
84
|
+
const state = typeof bridge?.getState === 'function' ? bridge.getState() : null
|
|
85
|
+
return state || { ready: false }
|
|
86
|
+
})()`});if(o?.ready===!0)return o;throw o?.disabled?new Error("3d mode is off; run `sootsim mode three on` before configure"):new Error("3d mode runtime did not become ready")}function K(e){let o=r=>e.find((c,a)=>e[a-1]===r),n={},t=o("--colorway");t&&(n.colorway=t);let i=o("--background");i&&(n.background=i);let d=o("--gradient");if(d){let r=d.split(",").map(v=>v.trim()).filter(Boolean),c=r.map((v,x)=>{let[F,$]=v.split("@"),f=$!==void 0?Number.parseFloat($):r.length>1?x/(r.length-1):0;return f>1&&(f=f/100),Number.isFinite(f)||(f=r.length>1?x/(r.length-1):0),{color:F.trim(),offset:f}}),a=o("--gradient-angle"),y=a===void 0?void 0:Number.parseFloat(a);if(a!==void 0&&!Number.isFinite(y))throw new Error(`--gradient-angle expects a number, got "${a}"`);n.customGradient={stops:c,...y!==void 0?{angleDeg:y}:{}}}let w=u(o("--room"),"--room");w!==void 0&&(n.room=w);let l=u(o("--bokeh"),"--bokeh");l!==void 0&&(n.bokeh=l),e.includes("--reset-pose")&&(n.resetPose=!0);let s=u(o("--environment"),"--environment"),p={},h={};for(let[r,c]of[["--env-shape","shape"],["--env-spread","spread"],["--env-size","size"],["--env-color","color"]]){let a=o(r);a&&(p[c]=a)}let M=u(o("--env-glow"),"--env-glow");M!==void 0&&(h.glow=M);let k=u(o("--env-plastic"),"--env-plastic");k!==void 0&&(h.plastic=k),(s!==void 0||Object.keys(p).length>0||Object.keys(h).length>0)&&(n.environment=s===!1?!1:{pins:p,effects:h});let B=o("--script");if(B){let r=o("--progress"),c=r===void 0?1:Number.parseFloat(r);if(!Number.isFinite(c))throw new Error(`--progress expects a number from 0 to 1, got "${r}"`);n.script={id:B,progress:c,animate:e.includes("--animate"),slow:e.includes("--slow")}}return n}function u(e,o){if(e===void 0)return;let n=e.toLowerCase();if(["on","true","yes","1"].includes(n))return!0;if(["off","false","no","0"].includes(n))return!1;throw new Error(`${o} expects on or off, got "${e}"`)}function P(e){return[`ready=${!!e.ready}`,`background=${String(e.background??"unknown")}`,`colorway=${String(e.colorway??"unknown")}`,`environment=${e.environmentActive?"on":"off"}`,`room=${e.room?"on":"off"}`,`bokeh=${e.bokeh?"on":"off"}`].join(", ")}var _=new Set(["--sim","--port","-p"]),L=new Set(["screenshot","three"]);function j(e){for(let o=0;o<e.length;o++){let n=e[o];if(n.startsWith("-")){_.has(n)&&o++;continue}return L.has(n)?{name:n,index:o}:null}return null}function V(e,o){return[...e.slice(0,o),...e.slice(o+1)]}function E(){console.log(`
|
|
87
|
+
sootsim mode \u2014 toggle live display modes
|
|
88
|
+
|
|
89
|
+
usage:
|
|
90
|
+
sootsim mode screenshot [on|off|toggle]
|
|
91
|
+
sootsim mode three [on|off|toggle]
|
|
92
|
+
sootsim mode three configure [options]
|
|
93
|
+
`)}async function Z(e,o){if(e.includes("--help")||e.includes("-h")){E();return}let n=j(e);n||(E(),process.exit(1));let t=V(e,n.index);if(n.name==="screenshot"){await N(t,o);return}await R(t,o)}export{Z as runMode};
|