sootsim 0.1.211 → 0.1.212
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 +4 -4
- package/dist-cli/chunks/{agent-YMWIMQSZ.js → agent-SEHSNZX6.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-6MN4L5WR.js → agent-wrapper-YMUSFYO4.js} +2 -2
- package/dist-cli/chunks/{app-fonts-C7OF7H5G.js → app-fonts-P7IHVY46.js} +2 -2
- package/dist-cli/chunks/{assert-JVVKDGJZ.js → assert-AZZHFMFN.js} +2 -2
- package/dist-cli/chunks/{auth-K5PLXC65.js → auth-QWPDQK3C.js} +2 -2
- package/dist-cli/chunks/beta-G6PO4MUG.js +2 -0
- package/dist-cli/chunks/{camera-LN5T6FHN.js → camera-LQTWHUE6.js} +2 -2
- package/dist-cli/chunks/chunk-2ZF3OFCV.js +1 -0
- package/dist-cli/chunks/{chunk-FLQJ4E4B.js → chunk-3L6FBCSH.js} +2 -2
- package/dist-cli/chunks/{chunk-CA53GTDU.js → chunk-44LPHPGF.js} +1 -1
- package/dist-cli/chunks/{chunk-FUUQJQ6D.js → chunk-4AEJLWKA.js} +1 -1
- package/dist-cli/chunks/{chunk-VDLNYLQ3.js → chunk-4IBUPIN6.js} +1 -1
- package/dist-cli/chunks/{chunk-HYCIJ46S.js → chunk-4RU6YTEP.js} +1 -1
- package/dist-cli/chunks/{chunk-OYKIZT5Q.js → chunk-5FQMI3PB.js} +1 -1
- package/dist-cli/chunks/{chunk-OEVW6X6O.js → chunk-6DPNSUZZ.js} +1 -1
- package/dist-cli/chunks/{chunk-GIPNU35K.js → chunk-7BH3S3L3.js} +2 -2
- package/dist-cli/chunks/{chunk-CDMWW44J.js → chunk-7SYXBGM2.js} +2 -2
- package/dist-cli/chunks/{chunk-4L4WXCMZ.js → chunk-7T4AAWY2.js} +2 -2
- package/dist-cli/chunks/{chunk-CNMIJNUJ.js → chunk-ACGAAVPX.js} +2 -2
- package/dist-cli/chunks/{chunk-TYJ7RKBZ.js → chunk-AOUNFYEN.js} +1 -1
- package/dist-cli/chunks/{chunk-E2HECQS5.js → chunk-ATFY2JZZ.js} +28 -28
- package/dist-cli/chunks/{chunk-T3L3I3XN.js → chunk-DOCQ4YBT.js} +2 -2
- package/dist-cli/chunks/{chunk-E2TCQ5AD.js → chunk-DWL4WFZ2.js} +1 -1
- package/dist-cli/chunks/{chunk-3AMN64TG.js → chunk-ERG3QCK4.js} +1 -1
- package/dist-cli/chunks/{chunk-MRVFOA46.js → chunk-ETXSEPTH.js} +2 -2
- package/dist-cli/chunks/{chunk-CZJWXULV.js → chunk-FMITPB4T.js} +2 -2
- package/dist-cli/chunks/{chunk-XNJNWR34.js → chunk-FSJQB6FI.js} +2 -2
- package/dist-cli/chunks/{chunk-ADHPC2X3.js → chunk-HTX3YVCJ.js} +2 -2
- package/dist-cli/chunks/{chunk-AQXWKFSQ.js → chunk-KOARSZSJ.js} +1 -1
- package/dist-cli/chunks/{chunk-OJXQDTQP.js → chunk-KRJRWLOW.js} +1 -1
- package/dist-cli/chunks/chunk-MTIPOS45.js +1 -0
- package/dist-cli/chunks/{chunk-SSYQZ5IN.js → chunk-O7K44ZT6.js} +2 -2
- package/dist-cli/chunks/{chunk-NLHBFC44.js → chunk-OHRSRPEB.js} +9 -9
- package/dist-cli/chunks/{chunk-LN2YBE53.js → chunk-QG3N3XNK.js} +3 -3
- package/dist-cli/chunks/{chunk-RNCB3OP2.js → chunk-QXDO6QT5.js} +2 -2
- package/dist-cli/chunks/{chunk-KDCFEKQG.js → chunk-SC67TYH6.js} +1 -1
- package/dist-cli/chunks/{chunk-75ZI44EE.js → chunk-SPEEWUAK.js} +3 -3
- package/dist-cli/chunks/{chunk-2OE3UXXF.js → chunk-SX5MJUQC.js} +2 -2
- package/dist-cli/chunks/{chunk-RCNPJNHG.js → chunk-TBLMSWZ6.js} +1 -1
- package/dist-cli/chunks/{chunk-AVJOEZLW.js → chunk-TKGMBU6V.js} +2 -2
- package/dist-cli/chunks/{chunk-GDIUF4LO.js → chunk-TPD4GIHM.js} +2 -2
- package/dist-cli/chunks/{chunk-TBBKY5QW.js → chunk-TUMOXM4E.js} +2 -2
- package/dist-cli/chunks/{chunk-UXJC5TWI.js → chunk-TWNBIOWX.js} +1 -1
- package/dist-cli/chunks/{chunk-KKOQCQ7C.js → chunk-TWNZ24EL.js} +1 -1
- package/dist-cli/chunks/{chunk-U74PRAD5.js → chunk-W7RH3GDB.js} +2 -2
- package/dist-cli/chunks/{chunk-UMBVQZ22.js → chunk-WLFIL6JU.js} +2 -2
- package/dist-cli/chunks/{chunk-33FTN3AV.js → chunk-WSI6YFMI.js} +3 -3
- package/dist-cli/chunks/{chunk-PC3RU3SN.js → chunk-YFXU4HRJ.js} +1 -1
- package/dist-cli/chunks/{chunk-IHQXMMQA.js → chunk-YNEFNAKF.js} +2 -2
- package/dist-cli/chunks/cli-version-YGN377WG.js +2 -0
- package/dist-cli/chunks/{compat-FHMWPGR4.js → compat-GLOXSMDS.js} +3 -3
- package/dist-cli/chunks/{config-OKQY5P52.js → config-QLSJASDG.js} +2 -2
- package/dist-cli/chunks/{control-7WL54I6D.js → control-HW7J3XVA.js} +2 -2
- package/dist-cli/chunks/daemon-66EHUQG5.js +2 -0
- package/dist-cli/chunks/{debug-QWZHZQPU.js → debug-Q2STL45F.js} +3 -3
- package/dist-cli/chunks/{desktop-FXGRW74A.js → desktop-LJJVJIU3.js} +3 -3
- package/dist-cli/chunks/{detox-3EDUFJTL.js → detox-WBTVTSHD.js} +2 -2
- package/dist-cli/chunks/{device-QCRIH4UL.js → device-E3JPFQZM.js} +2 -2
- package/dist-cli/chunks/{diagnose-URCT4GRE.js → diagnose-VECVKV6Z.js} +2 -2
- package/dist-cli/chunks/drivers-SOBHAYVL.js +2 -0
- package/dist-cli/chunks/flow-P3QRESKR.js +2 -0
- package/dist-cli/chunks/help-NHIRWWJQ.js +2 -0
- package/dist-cli/chunks/{home-paths-EO6LWXWX.js → home-paths-CRN2V4ZP.js} +2 -2
- package/dist-cli/chunks/inspect-DAGGHG65.js +2 -0
- package/dist-cli/chunks/install-desktop-HLFM6Q6M.js +2 -0
- package/dist-cli/chunks/{login-7NUQAWXS.js → login-FZTKNUQU.js} +4 -4
- package/dist-cli/chunks/{logout-BH53ZI7B.js → logout-FBH74CJM.js} +2 -2
- package/dist-cli/chunks/{maestro-C3RK43L7.js → maestro-NRDQGJYE.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-NJBAT2VF.js → maestro-generate-RFAXAENX.js} +3 -3
- package/dist-cli/chunks/{mode-2LMGYLFI.js → mode-IXMJSPUT.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-ZDULKK6R.js +2 -0
- package/dist-cli/chunks/{perf-LA7ZSQ7P.js → perf-K2IHHZXM.js} +2 -2
- package/dist-cli/chunks/{record-3RNPPFI5.js → record-RE6KIPXY.js} +3 -3
- package/dist-cli/chunks/runtime-BFBAWZDT.js +2 -0
- package/dist-cli/chunks/{screenshot-command-KIWXTT6Q.js → screenshot-command-S47YKHRV.js} +3 -3
- package/dist-cli/chunks/{screenshots-capture-ZADO3BSL.js → screenshots-capture-ZTG4V52X.js} +2 -2
- package/dist-cli/chunks/{serve-64IOEG4C.js → serve-3AWTKYDJ.js} +2 -2
- package/dist-cli/chunks/{setup-GANEERC5.js → setup-66M64ZEI.js} +3 -3
- package/dist-cli/chunks/{skills-DYN4EKIN.js → skills-2UDI5RNU.js} +2 -2
- package/dist-cli/chunks/{storage-773UY5XZ.js → storage-XNTIUIYR.js} +2 -2
- package/dist-cli/chunks/store-YOG762Q4.js +2 -0
- package/dist-cli/chunks/telemetry-ZANU3YOO.js +2 -0
- package/dist-cli/chunks/{timeline-HLF3CJNH.js → timeline-VMPCXPKA.js} +2 -2
- package/dist-cli/chunks/{upgrade-RDAUF53R.js → upgrade-UYXVI3XZ.js} +2 -2
- package/dist-cli/chunks/upload-RNDBU5AE.js +2 -0
- package/dist-cli/chunks/{version-63PZYMY6.js → version-I62N7JTP.js} +2 -2
- package/dist-cli/chunks/{web-XN5ZVSZR.js → web-42YNSI2X.js} +2 -2
- package/dist-cli/chunks/{what-happened-T3WJ7LTW.js → what-happened-3TVVRSN4.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 +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/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 +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +2 -2
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/beta-FFPVM735.js +0 -2
- package/dist-cli/chunks/chunk-BVOMJLZJ.js +0 -1
- package/dist-cli/chunks/chunk-X5F2XRCT.js +0 -1
- package/dist-cli/chunks/cli-version-6ZGU3OMS.js +0 -2
- package/dist-cli/chunks/daemon-MJAW7WLB.js +0 -2
- package/dist-cli/chunks/drivers-K6AYJ4K4.js +0 -2
- package/dist-cli/chunks/flow-FJK6CFCI.js +0 -2
- package/dist-cli/chunks/help-GCSPMIWH.js +0 -2
- package/dist-cli/chunks/inspect-DLPOHI65.js +0 -2
- package/dist-cli/chunks/install-desktop-LKSETTBL.js +0 -2
- package/dist-cli/chunks/optional-demo-registry-A27PORZB.js +0 -2
- package/dist-cli/chunks/runtime-7VEUKPNE.js +0 -2
- package/dist-cli/chunks/store-LSC33DBI.js +0 -2
- package/dist-cli/chunks/telemetry-4DVRYGKH.js +0 -2
- package/dist-cli/chunks/upload-KI23CKE4.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as E,b as D}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.212 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as E,b as D}from"./chunk-KOARSZSJ.js";import{H as T}from"./chunk-ERG3QCK4.js";var N="sootsimConfig";function p(e){return!!e&&Object.keys(e).length>0}function $(e){return e?p(e.modules)||p(e.turboModules)||p(e.nativeModules)||p(e.env)||p(e.network?.remap)||p(e.settings)||p(e.initialState):!1}function j(e,t){let n=new URL(e);return $(t)?n.searchParams.set(N,JSON.stringify(t)):n.searchParams.delete(N),n.toString()}var me="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function A(e){return/^https?:\/\//i.test(e)}function O(e){return e.endsWith(".bundle")}function H(e){process.env.SOOTSIM_PREVIEW_PROD_BUNDLE&&(e.searchParams.set("dev","false"),e.searchParams.set("minify","true"),e.searchParams.has("hot")&&e.searchParams.set("hot","false"))}function I(e){try{let t=A(e),n=new URL(e,"http://soot.local");return n.pathname=n.pathname.replace(/\.\.bundle$/,".bundle"),O(n.pathname)?(n.searchParams.delete("transform.bytecode"),n.searchParams.get("lazy")==="true"&&n.searchParams.set("lazy","false"),H(n),t?n.toString():`${n.pathname}${n.search}${n.hash}`):e}catch{return e}}function pe(e,t){try{let n=A(e),o=new URL(e,"http://soot.local");return O(o.pathname)?(o.searchParams.set("hot",t?"true":"false"),n?o.toString():`${o.pathname}${o.search}${o.hash}`):e}catch{return e}}import{exec as W}from"child_process";import B from"http";import F from"net";import{promisify as G}from"util";var _=G(W);E();var z=250,J=1500,K=120;function V(e,t=K){return new Promise(n=>{let o=new F.Socket,s=!1,i=a=>{s||(s=!0,o.destroy(),n(a))};o.setTimeout(t),o.once("connect",()=>i(!0)),o.once("timeout",()=>i(!1)),o.once("error",()=>i(!1)),o.connect(e,"localhost")})}function h(e,t,n="GET",o=z,s={}){return new Promise(i=>{let a=B.request({hostname:"localhost",port:e,path:t,method:n,timeout:o,headers:s},r=>{let c="";r.on("data",l=>c+=l.toString());let u=(()=>{let l=r.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();r.on("end",()=>i({statusCode:r.statusCode||0,body:c,contentType:u}))});a.on("error",()=>i(null)),a.setTimeout(o,()=>{a.destroy(),i(null)}),a.end()})}var q=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function C(e,t){return!(e<=0||e>=2e4||t.has(e)||e>=5170&&e<=5200)}async function Y(e=[]){let t=new Set(e);try{let{stdout:n}=await _("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(n.trim()){let o=new Map;for(let s of n.trim().split(`
|
|
3
3
|
`)){let i=s.trim().split(/\s+/);if(i.length<9)continue;let a=Number(i[1]),c=i[8].match(/:(\d+)$/);if(!c)continue;let u=Number(c[1]);C(u,t)&&(o.has(u)||o.set(u,a))}if(o.size>0)return[...o.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}try{let{stdout:n}=await _(`ss -tlnp 2>/dev/null | grep -E '"(node|bun)"'`,{encoding:"utf8",timeout:2e3});if(n.trim()){let o=new Map;for(let s of n.trim().split(`
|
|
4
4
|
`)){let i=s.match(/:(\d+)\s/),a=s.match(/pid=(\d+)/);if(!i)continue;let r=Number(i[1]),c=a?Number(a[1]):0;C(r,t)&&(o.has(r)||o.set(r,c))}if(o.size>0)return[...o.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}return q.filter(n=>C(n.port,t))}var x=new Map;async function Q(e){if(e<=0)return null;let t=x.get(e);if(t)return t;try{let{stdout:n}=await _(`lsof -p ${e} -a -d cwd -Fn 2>/dev/null`,{encoding:"utf8",timeout:1500});for(let o of n.split(`
|
|
5
5
|
`))if(o.startsWith("n")&&o.length>1){let s=o.slice(1).trim();if(s)return x.set(e,s),s}}catch{}return null}function X(e,t){return{port:e,framework:t,bundleUrl:S(e,`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()}}function S(e,t){let n=D().find(s=>s.preferredPort===e),o=n?.runtimeConfig?j(t,n.runtimeConfig):t;return I(o)}function Z(e){return e.includes("/node_modules/one/metro-entry.bundle")}function ee(e){try{let t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}function w(e,t,n){if(!t)return e;try{let o=JSON.parse(t.body),s=o?.extra?.expoClient||o?.extra||{};s.name&&(e.projectName=s.name),s.ios?.bundleIdentifier&&(e.bundleId=s.ios.bundleIdentifier),e.framework==="metro"&&s.sdkVersion&&(e.framework="expo");let i=o?.launchAsset?.url;i&&!e.patched&&!Z(e.bundleUrl)&&(e.bundleUrl=S(e.port,i));let a=s.iconUrl||s.ios?.iconUrl||s.icon||s.ios?.icon;if(a)if(e.iconPath=a,n)if(a.startsWith("http"))e.iconUrl=n(a);else{let r=a.replace(/^\.\//,"");e.iconUrl=n(`http://localhost:${e.port}/assets/${r}`)}else e.iconUrl=a.startsWith("http")?a:`http://localhost:${e.port}/assets/${a.replace(/^\.\//,"")}`}catch{}return e}var ne=2e4,v=new Map,k=new Set;function M(e,t){if(e.projectName)return e;let n=v.get(e.port);if(n)return n.projectName&&(e.projectName=n.projectName),n.iconUrl&&!e.iconUrl&&(e.iconUrl=n.iconUrl,e.iconPath=n.iconPath),n.bundleId&&!e.bundleId&&(e.bundleId=n.bundleId),e;if(!k.has(e.port)){k.add(e.port);let o=e.port;te(o,t).finally(()=>k.delete(o))}return e}async function te(e,t){let n=await h(e,"/","GET",ne,{"expo-platform":"ios"});if(!n||n.statusCode!==200)return;let o=w({port:e,framework:"one",bundleUrl:"",lastSeen:0},n,t);!o.projectName&&!o.iconUrl||(v.set(e,{projectName:o.projectName,iconUrl:o.iconUrl,iconPath:o.iconPath,bundleId:o.bundleId}),b.delete(e))}var d=new Set,g=new Set,y=new Set;async function oe(e,t){if(!await V(e))return null;let n="/node_modules/one/metro-entry.bundle?platform=ios&dev=true",[o,s,i,a]=await Promise.all([d.has(e)?Promise.resolve(null):h(e,"/__soot/"),h(e,"/status"),y.has(e)?Promise.resolve(null):h(e,"/","GET",J,{"expo-platform":"ios"}),g.has(e)?Promise.resolve(null):h(e,"/_expo/status")]);a&&a.statusCode===200?g.delete(e):g.has(e)||g.add(e);let r=i?ee(i.body):null,c=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:null,u=r?.extra?.expoClient||r?.extra||{};if(r&&(c||typeof u.name=="string")){d.add(e);let U=c||`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`,L=U.includes("/one/metro-entry.bundle")?"one":"expo";return w({port:e,framework:L,bundleUrl:S(e,U),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,t)}if(s&&s.body.includes("packager-status:running"))return d.add(e),M(w(X(e,a&&a.statusCode===200?"expo":"metro"),i,t),t);if(o&&o.statusCode===200&&o.body.includes("sootsim-patched"))return d.delete(e),M(w({port:e,framework:"one",bundleUrl:S(e,`http://localhost:${e}/__soot/bundle.js`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now(),patched:!0},i,t),t);if(s&&s.statusCode===200||a&&a.statusCode===200||i&&i.statusCode===200&&r!=null)return null;let m=await h(e,n,"HEAD");return m&&m.statusCode>0&&m.statusCode<400&&/application\/javascript/i.test(m.contentType||"")?(d.add(e),y.add(e),M(w({port:e,framework:"one",bundleUrl:S(e,`http://localhost:${e}${n}&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,t),t)):(d.add(e),null)}function re(e){return!!e.bundleId?.trim().toLowerCase()?.startsWith("dev.sootsim.")}var b=new Map,se=3e4,ie=1500;function ae(e){return!e||e.framework==="metro"||e.framework==="unknown"}function ce(e){return e?S(e.port,e.bundleUrl)===e.bundleUrl:!0}function ue(e,t,n=Date.now()){if(t===0||e.pid!==t||!ce(e.result))return!1;let o=n-e.cachedAt;return!(e.result===null&&o>=se||ae(e.result)&&o>=ie)}async function xe(e={}){let t=await Y(e.excludePorts),n=new Set(t.map(r=>r.port));for(let r of[...b.keys()])n.has(r)||b.delete(r);for(let r of[...d])n.has(r)||d.delete(r);for(let r of[...g])n.has(r)||g.delete(r);for(let r of[...y])n.has(r)||y.delete(r);for(let r of[...v.keys()])n.has(r)||v.delete(r);let o=[],s=[];for(let{port:r,pid:c}of t){let u=b.get(r);if(u&&ue(u,c)){u.result&&o.push(u.result);continue}u&&u.pid!==c&&(d.delete(r),g.delete(r),y.delete(r),v.delete(r)),s.push({port:r,pid:c})}s.length>0&&(await Promise.all(s.map(c=>oe(c.port,e.buildIconProxyUrl)))).forEach((c,u)=>{let{port:l,pid:m}=s[u];m!==0&&b.set(l,{pid:m,result:c,cachedAt:Date.now()}),c&&o.push(c)});let i=new Map;for(let{port:r,pid:c}of t)c>0&&i.set(r,c);await Promise.all(o.map(async r=>{let c=i.get(r.port);if(!c)return;r.pid=c;let u=await Q(c);u&&(r.cwd=u)}));let a=new Set(i.values());for(let r of[...x.keys()])a.has(r)||x.delete(r);return o.filter(r=>!re(r))}import R from"fs";import f from"path";import{fileURLToPath as le}from"url";var P;function de(){if(P!==void 0)return P;let e=f.dirname(le(import.meta.url));for(let t=0;t<12&&e!==f.dirname(e);t++){if(R.existsSync(f.join(e,"packages/sootsim-engine/package.json"))&&R.existsSync(f.join(e,"public/sootsim")))return P=e,e;e=f.dirname(e)}return P=null,null}function Te(){if(process.env.SOOTSIM_HOME&&T())return null;let e=de();if(!e)return null;let t=f.join(e,"public/sootsim");return R.existsSync(f.join(t,"index.html"))&&R.existsSync(f.join(t,"engine/index.html"))&&R.existsSync(f.join(t,"engine-tenant/worker.js"))?t:null}export{j as a,me as b,I as c,pe as d,oe as e,xe as f,Te as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.212 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var t="./demo-app-registry.ts",o=null;async function n(){if(o)return o;try{let r=await import(t);o=Array.isArray(r.APPS)?r.APPS:[]}catch{o=[]}return o}function e(){return o??[]}export{n as a,e as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.212 | (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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.212 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{o as d}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.212 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{o as d}from"./chunk-ERG3QCK4.js";import{chmodSync as S,existsSync as f,mkdirSync as k,readFileSync as A,rmSync as i,writeFileSync as y}from"node:fs";import{dirname as c,join as D,resolve as m}from"node:path";var s=1,p="SOOTSIM_SHARED_AUTH_FILE",u="https://sootbean.com";function w(){let t=process.env[p];return t?.trim()?c(m(t)):d()}function a(){let t=process.env[p];return t?.trim()?m(t):D(w(),"desktop-auth.json")}function g(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.id!="string"||!e.id.trim()?null:{id:e.id.trim(),name:typeof e.name=="string"?e.name:void 0,email:typeof e.email=="string"?e.email:void 0,image:typeof e.image=="string"?e.image:void 0,githubUsername:typeof e.githubUsername=="string"?e.githubUsername:void 0,teams:Array.isArray(e.teams)?e.teams.map(r=>{if(!r||typeof r!="object")return null;let n=r;return typeof n.id!="string"||typeof n.name!="string"?null:{id:n.id,name:n.name,role:n.role==="owner"?"owner":"member",githubOrg:typeof n.githubOrg=="string"?n.githubOrg:null}}).filter(r=>!!r):void 0}}function v(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==s||typeof e.token!="string"||!e.token.trim())return null;let r=typeof e.origin=="string"&&e.origin.trim()?e.origin.trim():u,n=e.source==="cli"||e.source==="electron"||e.source==="browser"||e.source==="unknown"?e.source:"unknown",o=typeof e.updatedAt=="string"&&e.updatedAt?e.updatedAt:new Date().toISOString(),h=typeof e.validatedAt=="string"&&e.validatedAt?e.validatedAt:void 0;return{version:s,token:e.token.trim(),user:g(e.user),origin:r,source:n,updatedAt:o,validatedAt:h}}function b(){let t=a();if(!f(t))return null;try{let e=JSON.parse(A(t,"utf8")),r=v(e);return r||(i(t,{force:!0}),null)}catch{return i(t,{force:!0}),null}}function O(t){let e=a();k(c(e),{recursive:!0});let r={version:s,token:t.token.trim(),user:t.user?g(t.user):null,origin:t.origin?.trim()||u,source:t.source,updatedAt:t.updatedAt||new Date().toISOString(),validatedAt:t.validatedAt};y(e,JSON.stringify(r,null,2)+`
|
|
3
3
|
`);try{S(e,384)}catch{}return r}function l(){i(a(),{force:!0})}async function E(t){let e=b();if(!e?.token)return null;let r=t||e.origin||u;try{let n=await fetch(`${r.replace(/\/$/,"")}/api/auth/me`,{headers:{authorization:`Bearer ${e.token}`}});if(n.status===401)return l(),null;if(!n.ok)return e;let o=await n.json();return o.user?.id?O({token:e.token,user:o.user,origin:r,source:e.source,validatedAt:new Date().toISOString()}):(l(),null)}catch{return e}}export{b as a,O as b,l as c,E as d};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as Ie,b as Ae,c as Ue}from"./chunk-
|
|
3
|
-
`)){let i=o.trim();if(i)try{let a=JSON.parse(i);t(a)&&r.push(a)}catch{}}return r}function $e(e){return
|
|
1
|
+
/*! sootsim v0.1.212 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as Ie,b as Ae,c as Ue}from"./chunk-YNEFNAKF.js";import{c as ke}from"./chunk-TWNZ24EL.js";import{d as xe}from"./chunk-KRJRWLOW.js";import{g as Be,i as Ee,k as B}from"./chunk-TUMOXM4E.js";import{d as Re}from"./chunk-TBLMSWZ6.js";import{a as ve,b as k}from"./chunk-7SYXBGM2.js";import{a as Se}from"./chunk-O7K44ZT6.js";import{createHash as ft}from"crypto";import{readFileSync as U}from"fs";import Oe from"path";import{gzipSync as ae,gunzipSync as gt}from"zlib";function _e(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}import{brotliCompressSync as rt,constants as st}from"node:zlib";var ot=9;function Pe(e){return rt(e,{params:{[st.BROTLI_PARAM_QUALITY]:ot}})}function oe(e,t){let r=new AbortController,o=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(o)}}async function it(e){let t=oe(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let o=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${o.slice(0,200)}`)}}async function at(e,t=8,r){let o=0,i=0,a=e.length;await Promise.all(Array.from({length:Math.min(t,a)},async()=>{for(;o<a;){let u=e[o++];await it(u),i++,r?.(i,a)}}))}function lt(e,t,r,o){let i=[];i.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let a of e.files){let u=r.get(a.urlhash);u&&i.push({url:a.putUrl,contentType:a.contentType,bytes:u})}e.events&&o?.eventsBytes&&i.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:o.eventsBytes}),e.timeline&&o?.timelineBytes&&i.push({url:e.timeline.putUrl,contentType:e.timeline.contentType,bytes:o.timelineBytes}),e.flowVideo&&o?.videoBytes&&i.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:o.videoBytes}),e.storage&&o?.storageBytes&&i.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:o.storageBytes}),e.failureBundle&&o?.failureBundleBytes&&i.push({url:e.failureBundle.putUrl,contentType:e.failureBundle.contentType,bytes:o.failureBundleBytes});for(let a of e.snapshots??[]){let u=o?.snapshotBytes?.get(a.id);u&&i.push({url:a.putUrl,contentType:a.contentType,bytes:u})}return i}function ut(e){return e.replace(/\/+$/,"")}var J=class extends Error{constructor(r,o,i,a=""){super(r);this.status=o;this.phase=i;this.responseText=a;this.name="PresignedUploadError"}};async function Le(e){let t=ut(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-soot-admin-upload-bypass"]=e.adminBypassToken);let o=oe(3e4,"init"),i;try{i=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:o.signal})}finally{o.cancel()}if(!i.ok){let g=await i.text().catch(()=>"");throw new J(`init failed: ${i.status} ${g.slice(0,200)}`,i.status,"init",g)}let a=await i.json(),u=lt(a,e.bundleBytes,e.filesByHash,e.extras);await at(u,e.concurrency??8,e.onPutProgress);let b=oe(3e4,"finalize"),f;try{f=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:b.signal})}finally{b.cancel()}if(!f.ok){let g=await f.text().catch(()=>"");throw new J(`finalize failed: ${f.status} ${g.slice(0,200)}`,f.status,"finalize",g)}let C=await f.json();return{init:a,finalize:C}}function ct(e){return e!==null&&typeof e=="object"?e:null}function Fe(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function ie(e){let t=ct(e);return t?t.schemaVersion===1&&Fe(t.t)!==void 0&&Fe(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function dt(e,t){let r=[];for(let o of e.split(`
|
|
3
|
+
`)){let i=o.trim();if(i)try{let a=JSON.parse(i);t(a)&&r.push(a)}catch{}}return r}function $e(e){return dt(e,ie)}function ht(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}var je=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",He=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",ue="http://localhost:3000",yt=2e3;async function bt(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${ue}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(yt)});if(t.ok||t.status===204||t.status===405)return ue}catch{}return je}function F(e){return e.replace(/\/$/,"")}function Mt(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 wt(e){try{let t=new URL(e).hostname.toLowerCase();return t==="sootbean.com"||t.endsWith(".sootbean.com")}catch{return!1}}function Tt(e,t){return t?F(t):process.env.SOOTSIM_PREVIEW_ORIGIN?F(process.env.SOOTSIM_PREVIEW_ORIGIN):Mt(e)?F(e):wt(e)?F(He):F(e)}function St(){console.log(`
|
|
4
4
|
sootsim record upload \u2014 publish the current recorded bundle as a /preview/<id> link
|
|
5
5
|
|
|
6
6
|
usage:
|
|
@@ -51,7 +51,7 @@ examples:
|
|
|
51
51
|
sootsim record upload --events ./my-session.jsonl.gz
|
|
52
52
|
sootsim record upload --origin http://localhost:3000 --events ./my-session.jsonl.gz --open
|
|
53
53
|
sootsim record upload --video /tmp/soot-flow.mp4 --video-duration-ms 12000
|
|
54
|
-
`)}function d(e,t){let r=e.findIndex(i=>i===t);if(r<0)return;let o=e[r+1];return e.splice(r,2),o}function Ce(e,t){let r=e.findIndex(o=>o===t);return r<0?!1:(e.splice(r,1),!0)}function Ne(e,t){if(!e)return;let r=Number(e);return(!Number.isFinite(r)||r<=0)&&(console.error(` invalid ${t}: ${e}`),process.exit(1)),Math.round(r)}function ze(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!!(t.startsWith("image/")||t.startsWith("font/")||t.startsWith("video/")||t.startsWith("audio/")||t.startsWith("model/")||t==="text/css"||t==="application/javascript"||t==="text/javascript"||t==="application/wasm"||t==="application/font-woff"||t==="application/font-woff2"||t==="application/octet-stream"):!1}async function De(e){let t=await fetch(e);if(!t.ok)throw new Error(`fetch ${e} -> ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())}function
|
|
54
|
+
`)}function d(e,t){let r=e.findIndex(i=>i===t);if(r<0)return;let o=e[r+1];return e.splice(r,2),o}function Ce(e,t){let r=e.findIndex(o=>o===t);return r<0?!1:(e.splice(r,1),!0)}function Ne(e,t){if(!e)return;let r=Number(e);return(!Number.isFinite(r)||r<=0)&&(console.error(` invalid ${t}: ${e}`),process.exit(1)),Math.round(r)}function ze(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!!(t.startsWith("image/")||t.startsWith("font/")||t.startsWith("video/")||t.startsWith("audio/")||t.startsWith("model/")||t==="text/css"||t==="application/javascript"||t==="text/javascript"||t==="application/wasm"||t==="application/font-woff"||t==="application/font-woff2"||t==="application/octet-stream"):!1}async function De(e){let t=await fetch(e);if(!t.ok)throw new Error(`fetch ${e} -> ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())}function vt(e){return/\.bundle($|\?)/.test(e)||/\.js($|\?)/.test(e)?"application/javascript":/\.zip($|\?)/.test(e)?"application/zip":"application/javascript"}function xt(e){try{return new URL(e).searchParams.get("appFonts")||""}catch{return""}}function kt(e){try{return new URL(e).searchParams.get("appSplash")||""}catch{return""}}function Bt(e){try{let t=new URL(e);return t.searchParams.get("lazy")==="true"?(t.searchParams.set("lazy","false"),t.toString()):e}catch{return e}}async function Et(e,t){let o=[];for(let i=0;i<t;i+=15e5){let a=Math.min(i+15e5,t),u=await B(e,`(window.__sootsimLastTransformedBundle?.text || "").slice(${i}, ${a})`);if(typeof u!="string")return null;o.push(u)}return o.join("")}function Rt(e){return e.recordedDurationMs&&e.recordingStartedAtMs?{since:e.recordingStartedAtMs-1e4,until:e.recordingStartedAtMs+e.recordedDurationMs+5e3,limit:2e3}:{limit:2e3}}function It(e){let t=U(e),o=(t[0]===31&&t[1]===139?gt(t):t).toString("utf8");return $e(o)}function At(e){return JSON.parse(U(e,"utf8"))}function Ut(e){if(e===null||typeof e!="object")return[];let t=e,r=typeof t.startedAtEpochMs=="number"&&t.startedAtEpochMs>0?t.startedAtEpochMs:null;if(r===null||!Array.isArray(t.samples))return[];let o=[];for(let i of t.samples){if(!Array.isArray(i)||typeof i[0]!="number")continue;let a=u=>typeof u=="number"&&Number.isFinite(u)?Math.round(u*100)/100:0;o.push({schemaVersion:1,t:r+Math.round(i[0]),seq:o.length+1,context:"tenant",kind:"frame",data:{totalMs:a(i[1]),layoutMs:a(i[2]),renderMs:a(i[3]),copyMs:a(i[4])}})}return o}function _t(e){if(e===null||typeof e!="object")return e;let{samples:t,...r}=e;return r}function le(e){let t=new Map;for(let r of e)t.set(r.urlhash||r.url,r);return Array.from(t.values())}async function en(e,t){(e.includes("--help")||e.includes("-h"))&&(St(),process.exit(0));let r=[...e],o=await bt(d(r,"--origin")),i=Tt(o,d(r,"--public-origin")),a=d(r,"--events"),u=d(r,"--screenshot"),b=d(r,"--video"),f=d(r,"--timeline-events"),C=d(r,"--trace-frame-stats"),g=d(r,"--failure-bundle"),K=d(r,"--video-duration-ms"),ce=Ne(d(r,"--recorded-duration-ms"),"--recorded-duration-ms"),de=Ne(d(r,"--recording-started-at-ms"),"--recording-started-at-ms"),q=d(r,"--owner"),V=d(r,"--repo"),N=d(r,"--billing-kind"),Je=d(r,"--run-scope"),Ke=Ce(r,"--open");(q&&!V||!q&&V)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),N&&N!=="test_run"&&(console.error(` invalid --billing-kind: ${N}`),process.exit(1)),!a&&!b&&(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 maestro test --preview` instead of uploading a bundle-only snapshot."),process.exit(1));let pe=Ce(r,"--assets-only"),qe=Be(r,{stripBooleanFlags:[],stripValueFlags:[]}),M=Ee(qe),c,me=[],w=[],T=f?It(f):[],fe=C?At(C):null;T.push(...Ut(fe));let ge=T.length,W=null;try{if(c=await B(M,'(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'),c?.bundleUrl){let l=new URL(c.bundleUrl).origin,[p,A]=await Promise.all([B(M,`(window.__sootsimPreviewRecorder?.list?.(${JSON.stringify(l)}) || [])`),B(M,`(async () => {
|
|
55
55
|
const list = window.__sootsimListWorkerFetchRecorder
|
|
56
56
|
return typeof list === 'function'
|
|
57
57
|
? await list(${JSON.stringify(l)})
|
|
@@ -86,12 +86,12 @@ examples:
|
|
|
86
86
|
? (await workerDump()).filter(keep)
|
|
87
87
|
: [],
|
|
88
88
|
}
|
|
89
|
-
})()`);if(w=le([...m.main,...m.worker]),pe){let re=w.length;w=w.filter(se=>ze(se.contentType));let
|
|
89
|
+
})()`);if(w=le([...m.main,...m.worker]),pe){let re=w.length;w=w.filter(se=>ze(se.contentType));let tt=x.totalBytes-w.reduce((se,nt)=>se+(nt.size||0),0);console.log(` --assets-only: kept ${w.length}/${re} records (dropped ${(tt/1024).toFixed(1)} KiB of API responses)`)}}}c?.transformedBundle&&(W=await Et(M,c.transformedBundle.byteLength));let n=await B(M,`(() => {
|
|
90
90
|
const bridge = window.SootSim?.bridges?.timeline ?? window.__sootsimTimeline
|
|
91
91
|
if (!bridge || typeof bridge.recent !== 'function') return null
|
|
92
|
-
return bridge.recent(${JSON.stringify(
|
|
92
|
+
return bridge.recent(${JSON.stringify(Rt({recordedDurationMs:ce,recordingStartedAtMs:de}))})
|
|
93
93
|
})()`).catch(l=>(console.warn(` warning: failed to capture trace timeline: ${l instanceof Error?l.message:String(l)}`),null)),s=Array.isArray(n?.events)?n.events:[];T=[...T,...s.filter(ie)].sort((l,p)=>l.t-p.t||l.seq-p.seq)}finally{M.close()}c||(console.error(" could not read bundle snapshot \u2014 is sootsim running and is the bundle loaded?"),process.exit(2)),c.bundleUrl||(console.error(` no ?bundle= URL on the current sootsim tab.
|
|
94
|
-
open the app you want to share first (e.g. sootsim open 8082), then run upload.`),process.exit(2));let h,G=!1;if(W!==null)h=new TextEncoder().encode(W),G=!0,console.log(` using post-transform bundle: ${(h.byteLength/1024).toFixed(1)} KiB`);else{let n=
|
|
94
|
+
open the app you want to share first (e.g. sootsim open 8082), then run upload.`),process.exit(2));let h,G=!1;if(W!==null)h=new TextEncoder().encode(W),G=!0,console.log(` using post-transform bundle: ${(h.byteLength/1024).toFixed(1)} KiB`);else{let n=Bt(c.bundleUrl);n!==c.bundleUrl&&console.log(" forcing lazy=false for self-contained bundle"),console.log(` capturing: ${n}`),h=await De(n),console.log(` main bundle: ${(h.byteLength/1024).toFixed(1)} KiB`)}let z=me.filter(n=>n.url!==c.bundleUrl);pe&&(z=z.filter(n=>ze(n.contentType))),console.log(` fetching ${z.length} extra files\u2026`);let D=(await Promise.all(z.map(async n=>{try{let s=await De(n.url);return{...n,bytes:s}}catch(s){return console.error(` warning: failed to re-fetch ${n.url}: ${s instanceof Error?s.message:s}`),null}}))).filter(n=>!!n),Ve=D.reduce((n,s)=>n+s.bytes.byteLength,0);console.log(` ${D.length} extra files: ${(Ve/1024).toFixed(1)} KiB`);let E;a&&(E=U(a)),T.sort((n,s)=>n.t-s.t||n.seq-s.seq);let he=T.map(n=>JSON.stringify(n)).join(`
|
|
95
95
|
`),Y=ae(he?`${he}
|
|
96
|
-
`:"");console.log(` trace timeline: ${T.length} events${ge?` (${ge} from runner sidecars)`:""}`);let y;u&&(y=U(u),console.log(` attaching screenshot: ${(y.byteLength/1024).toFixed(1)} KiB`));let R,I;if(g){let n=p=>{try{return U(Oe.join(g,p),"utf8")}catch{return null}},s=p=>{let A=n(p);if(A===null)return null;try{return JSON.parse(A)}catch{return A}},l={error:s("error.json"),describe:s("describe.json"),console:s("console.json"),a11y:n("a11y.txt"),tree:n("tree.txt")};Object.values(l).some(p=>p!==null)&&(R=ae(JSON.stringify(l)),console.log(` attaching failure bundle: ${(R.byteLength/1024).toFixed(1)} KiB gz`));try{I=U(Oe.join(g,"screenshot.png"))}catch{}}let S,$,ye;if(b){if(S=U(b),$=b.endsWith(".mp4")?"video/mp4":b.endsWith(".gif")?"image/gif":void 0,$||(console.error(" preview flow videos must be mp4 or gif"),await k(),process.exit(1)),K){let n=Number(K);(!Number.isFinite(n)||n<=0)&&(console.error(` invalid --video-duration-ms: ${K}`),await k(),process.exit(1)),ye=Math.round(n)}console.log(` attaching flow video: ${(S.byteLength/1024).toFixed(1)} KiB (${$})`)}let _=Ie(),P=Ue(_),
|
|
97
|
-
stored ${H.filesStored??0} extra files`),console.log(` preview: ${ne}`),
|
|
96
|
+
`:"");console.log(` trace timeline: ${T.length} events${ge?` (${ge} from runner sidecars)`:""}`);let y;u&&(y=U(u),console.log(` attaching screenshot: ${(y.byteLength/1024).toFixed(1)} KiB`));let R,I;if(g){let n=p=>{try{return U(Oe.join(g,p),"utf8")}catch{return null}},s=p=>{let A=n(p);if(A===null)return null;try{return JSON.parse(A)}catch{return A}},l={error:s("error.json"),describe:s("describe.json"),console:s("console.json"),a11y:n("a11y.txt"),tree:n("tree.txt")};Object.values(l).some(p=>p!==null)&&(R=ae(JSON.stringify(l)),console.log(` attaching failure bundle: ${(R.byteLength/1024).toFixed(1)} KiB gz`));try{I=U(Oe.join(g,"screenshot.png"))}catch{}}let S,$,ye;if(b){if(S=U(b),$=b.endsWith(".mp4")?"video/mp4":b.endsWith(".gif")?"image/gif":void 0,$||(console.error(" preview flow videos must be mp4 or gif"),await k(),process.exit(1)),K){let n=Number(K);(!Number.isFinite(n)||n<=0)&&(console.error(` invalid --video-duration-ms: ${K}`),await k(),process.exit(1)),ye=Math.round(n)}console.log(` attaching flow video: ${(S.byteLength/1024).toFixed(1)} KiB (${$})`)}let _=Ie(),P=Ue(_),We=Se();ve({event:"preview_upload_started",identity:{userId:_?.kind==="session"?We?.user?.id??null:null,repoId:P?.repoId??null,installationId:P?.installationId??null},properties:{origin:o,hasAuth:!!_,authMode:_?.kind??"none",bundleBytes:h.byteLength,isTransformed:G,extraFiles:D.length,recordedFetches:w.length,hasEvents:!!E,traceTimelineEvents:T.length,hasScreenshot:!!y,hasVideo:!!S}}),_||(console.error(" preview uploads need auth."),console.error(" set SOOTSIM_API_KEY=sk_sootsim_..., run `sootsim login`, or use the soot github runner."),await k(),process.exit(1));let Ge=Ae(_),Ye=(()=>{try{return new URL(c.bundleUrl).origin}catch{return null}})(),j=(n,s,l,p,A,L,Te,O)=>{let x=_e(L),m=x?ae(n):n;return{url:s,urlhash:l,method:p,bodyHash:A,requestVaryHash:O,contentType:L,responseHeaders:Te,bytes:m,encoding:x?"gzip":void 0}},be=[],Q=xt(c.pageHref)||"";if(Q){let n=await xe(Q,{onStaged:({url:s,byteLength:l})=>console.log(` staged app font: ${s} (${(l/1024).toFixed(1)} KiB)`),onError:(s,l)=>console.error(` warning: failed to fetch app font ${s}: ${l instanceof Error?l.message:l}`)});for(let s of n)be.push(j(Buffer.from(s.bytes),s.url,s.urlhash,"GET","-",s.contentType))}let Me=[],X=kt(c.pageHref)||"";if(X){let n=await ke(X,{onStaged:({url:s,byteLength:l})=>console.log(` staged splash image: ${s} (${(l/1024).toFixed(1)} KiB)`),onError:(s,l)=>console.error(` warning: failed to fetch splash image ${s}: ${l instanceof Error?l.message:l}`)});for(let s of n)Me.push(j(Buffer.from(s.bytes),s.url,s.urlhash,"GET","-",s.contentType))}let Z=[...D.map(n=>j(n.bytes,n.url,n.urlhash,"GET","-",n.contentType,n.responseHeaders,n.requestVaryHash)),...w.map(n=>j(Buffer.from(n.bodyBase64,"base64"),n.url,n.urlhash,n.method||"GET",n.bodyHash||"-",n.contentType,n.responseHeaders,n.requestVaryHash)),...be,...Me],ee=Pe(h),Qe=ft("sha256").update(h).digest("hex");console.log(` bundle raw=${(h.byteLength/1024).toFixed(1)} KiB br=${(ee.byteLength/1024).toFixed(1)} KiB`);let Xe={contentHash:Qe,bundleSizeBytes:h.byteLength,bundleContentType:vt(c.bundleUrl),bundleEncoding:"br",bundleOrigin:Ye,runtimeVersion:c.runtimeVersion??void 0,appFonts:Q||void 0,appSplash:X||void 0,entry:c.entry,isTransformed:G,deviceSpec:c.deviceSpec,installationId:P?.installationId??void 0,repoId:P?.repoId,owner:q??P?.owner,repo:V??P?.repo,billingKind:N==="test_run"?"test_run":void 0,runScope:Je||void 0,files:Z.map(n=>({url:n.url,urlhash:n.urlhash,method:n.method,bodyHash:n.bodyHash,contentType:n.contentType,responseHeaders:n.responseHeaders,requestVaryHash:n.requestVaryHash,encoding:n.encoding,sizeBytes:n.bytes.byteLength})),events:E?{sizeBytes:E.byteLength}:void 0,timeline:{sizeBytes:Y.byteLength,encoding:"gzip"},traceFrameStats:_t(fe),recordedDurationMs:ce,recordingStartedAtMs:de,failureBundle:R?{sizeBytes:R.byteLength,encoding:"gzip"}:void 0,snapshots:(()=>{let n=[];return y&&n.push({id:"landing",label:"Landing",kind:"landing",t:0,contentType:"image/png",sizeBytes:y.byteLength}),I&&n.push({id:"failure",label:"Failure",kind:"failure",contentType:"image/png",sizeBytes:I.byteLength}),n.length>0?n:void 0})(),flowVideo:S&&$?{sizeBytes:S.byteLength,contentType:$,durationMs:ye}:void 0},we=new Map;for(let n of Z)we.set(n.urlhash,n.bytes);let te=new Map;y&&te.set("landing",y),I&&te.set("failure",I);let Ze=Date.now(),v=ee.byteLength;for(let n of Z)v+=n.bytes.byteLength;E&&(v+=E.byteLength),v+=Y.byteLength,y&&(v+=y.byteLength),I&&(v+=I.byteLength),R&&(v+=R.byteLength),S&&(v+=S.byteLength);let et=`${F(o)}/api/preview/upload/init`;console.log(` init: ${et}`);let H;try{let n=await Le({originBase:o,initBody:Xe,bundleBytes:ee,filesByHash:we,extras:{eventsBytes:E,timelineBytes:Y,videoBytes:S,failureBundleBytes:R,snapshotBytes:te},authHeader:Ge,concurrency:16});H=n.finalize;let s=1+n.init.files.length+(n.init.events?1:0)+(n.init.timeline?1:0)+n.init.snapshots.length+(n.init.flowVideo?1:0)+(n.init.failureBundle?1:0);console.log(` PUT ${s} objects in ${Date.now()-Ze}ms (${(v/1024).toFixed(1)} KiB)`)}catch(n){let s=n;s.phase==="init"&&s.status===401&&(console.error(" preview upload requires a valid login."),console.error(" run `sootsim login` and retry."),await k(),process.exit(1)),s.status===402&&(console.error(` ${ht(s.responseText)??"preview uploads require Personal, Team, or an active trial \u2014 upgrade from the billing dialog."}`),await k(),process.exit(1)),console.error(` ${s.message??`${s.phase??"upload"} failed: ${String(n)}`}`),await k(),process.exit(1)}let ne=`${i}${H.url}`;return console.log(`
|
|
97
|
+
stored ${H.filesStored??0} extra files`),console.log(` preview: ${ne}`),Ke&&await Re(ne),await k(),{previewUrl:ne,shareId:H.id}}export{bt as a,Tt as b,en as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as k,b as O,c as x,e as m,f as I,g as h}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.212 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as k,b as O,c as x,e as m,f as I,g as h}from"./chunk-ACGAAVPX.js";import{d as R}from"./chunk-TUMOXM4E.js";import{G as v,H as a,I as y,J as u,K as b,l as w,z as d}from"./chunk-ERG3QCK4.js";import S from"fs";import{WebSocket as N}from"ws";async function J(t,e={}){let[s,...n]=t;if(!s||s==="--help"||s==="-h"){A();return}switch(s){case"install":return T(n,e);case"list":case"ls":return _(n);case"use":return C(n);case"remove":case"rm":return U(n);case"which":case"active":return E();case"pin":return F(n);case"unpin":return P();case"notes":case"changelog":return G(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,4 +26,4 @@ examples:
|
|
|
26
26
|
sootsim runtime install --channel beta
|
|
27
27
|
sootsim runtime use 1.2.3
|
|
28
28
|
sootsim runtime notes
|
|
29
|
-
`)}async function T(t,e){let{version:s,flags:n}=M(t),o=n.channel??e.channel??"stable",l=n.force===!0,r=n.setActive!==!1;v(),console.log("sootsim runtime install"),console.log(` cdn: ${x()}`);try{let i=await h({version:s,channel:o,force:l,setActive:r});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),r&&await f(i.version)}catch(i){console.error(` ${p(i)}`),process.exit(1)}}async function f(t){y(t),console.log(` active: ${t}`),await L(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function L(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:s}=await import("./home-paths-
|
|
29
|
+
`)}async function T(t,e){let{version:s,flags:n}=M(t),o=n.channel??e.channel??"stable",l=n.force===!0,r=n.setActive!==!1;v(),console.log("sootsim runtime install"),console.log(` cdn: ${x()}`);try{let i=await h({version:s,channel:o,force:l,setActive:r});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),r&&await f(i.version)}catch(i){console.error(` ${p(i)}`),process.exit(1)}}async function f(t){y(t),console.log(` active: ${t}`),await L(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function L(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:s}=await import("./home-paths-CRN2V4ZP.js"),n=s();if(!e(n))return!1;let o=R();return new Promise(l=>{let r=!1,i=!1,g=D=>{r||(r=!0,l(D))},c=new N(`ws://127.0.0.1:${o}`,{handshakeTimeout:800}),$=setTimeout(()=>{try{c.close()}catch{}g(i)},1500);c.on("open",()=>{try{c.send(JSON.stringify({type:"runtime:use",version:t,id:0})),i=!0}catch{}setTimeout(()=>{try{c.close()}catch{}},100)}),c.on("close",()=>{clearTimeout($),g(i)}),c.on("error",()=>{clearTimeout($),g(!1)})})}async function _(t){v();let e=u(),s=a(),n=m();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let o of e)console.log(` ${o===s?"*":" "} ${o}${o===n?" (pinned)":""}`);n&&!e.includes(n)&&console.log(`pinned: ${n} (not installed \u2014 run \`sootsim runtime install\`)`);try{let o=await I();console.log("available (latest per channel):");for(let[r,i]of Object.entries(o.channels))console.log(` ${r.padEnd(8)} ${i.latest}`);let l=Object.keys(o.versions).sort(b).reverse();if(l.length>1){console.log("hosted versions:");for(let r of l)console.log(` ${r}`)}}catch(o){console.log(`available: (could not fetch manifest: ${p(o)})`)}}async function C(t){let e=t[0];e||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let s=u();s.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${s.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${e}\` first`),process.exit(1)),await f(e)}async function U(t){let e=t[0];e||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),a()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `sootsim runtime use <other>` first, or install another version"),process.exit(1));let n=w(e);if(!S.existsSync(n)){console.error(` ${e} is not installed`);return}S.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function E(){let t=a();if(!t){console.log(" no active runtime");return}console.log(t)}async function F(t){let e=t[0];if(!e){let n=m();n?console.log(` runtime pinned to ${n}`):(console.log(" no pin \u2014 runtime follows channel latest"),console.log(" usage: sootsim runtime pin <version>"));return}if(d({runtimeVersion:e}),console.log(` pinned runtime to ${e}`),u().includes(e)){a()!==e&&await f(e);return}try{let n=await h({version:e,setActive:!1});console.log(n.installed?` installed ${n.version}`:` already installed at ${n.runtimeDir}`),await f(e)}catch(n){console.error(` ${p(n)}`),console.error(` pin saved, but ${e} could not be installed \u2014 check \`sootsim runtime list\` for hosted versions`),process.exit(1)}}async function P(){let t=m();if(!t){console.log(" no pin set");return}d({runtimeVersion:void 0}),console.log(` unpinned (was ${t}) \u2014 runtime follows channel latest again`),console.log(" run `sootsim upgrade` to move to the latest now")}async function G(t){t.length>0&&(console.error(" usage: sootsim runtime notes"),process.exit(1));let e=a();e&&console.log(` active runtime: v${e}`),console.log(` release notes: ${O}`)}function M(t){let e={},s=[];for(let n=0;n<t.length;n++){let o=t[n];if(o==="--channel"&&n+1<t.length){e.channel=t[n+1],n++;continue}if(o.startsWith("--channel=")){e.channel=o.slice(10);continue}if(o==="--force"){e.force=!0;continue}if(o==="--set-active=false"||o==="--no-set-active"){e.setActive=!1;continue}s.push(o)}return{version:s[0]??null,flags:e}}function p(t){return t instanceof Error?t.message:String(t)}export{J as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as m,b as I}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.212 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as m,b as I}from"./chunk-4RU6YTEP.js";import{a as w,b as _,c as T}from"./chunk-TBLMSWZ6.js";import{c as k}from"./chunk-DWL4WFZ2.js";import{G as O,o as D,q as f}from"./chunk-ERG3QCK4.js";import h from"fs";import v from"path";var c="default",F="profiles.json",a=1;function s(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 g(){return v.join(f(),F)}function G(e){return`sootsim-profile-${s(e)}`}function B(e){return v.join(D(),"Partitions",G(e))}function y(e){return v.join(f(),"playwright",s(e))}function b(){try{let e=JSON.parse(h.readFileSync(g(),"utf8"));if(!e||e.version!==a)return{version:a,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:s(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:a,profiles:r}}catch{return{version:a,profiles:[]}}}function A(e){return[...e].sort((r,t)=>r.id===c?-1:t.id===c?1:r.id.localeCompare(t.id))}function P(e){if(e.profiles.some(t=>t.id===c))return{...e,profiles:A(e.profiles)};let r=new Date().toISOString();return{version:a,profiles:A([{id:c,createdAt:r,updatedAt:r},...e.profiles])}}function S(e){O();let r=P(e),t=`${g()}.tmp`;return h.writeFileSync(t,`${JSON.stringify(r,null,2)}
|
|
3
3
|
`,"utf8"),h.renameSync(t,g()),r}function H(){return S(b()).profiles}function j(e){let r=s(e);return H().find(t=>t.id===r)??null}function E(e=c){let r=s(e),t=j(r);return t||q(r)}function q(e){let r=s(e),t=P(b());if(t.profiles.some(n=>n.id===r))throw new Error(`profile already exists: ${r}`);let o=new Date().toISOString(),i={id:r,createdAt:o,updatedAt:o};return S({version:a,profiles:[...t.profiles,i]}),i}function pe(e){let r=s(e);if(r===c)throw new Error("the default profile cannot be deleted; clear it instead");let t=P(b()),o=t.profiles.find(i=>i.id===r);if(!o)throw new Error(`profile not found: ${r}`);return S({version:a,profiles:t.profiles.filter(i=>i.id!==r)}),z(r),o}function z(e){let r=s(e);for(let t of[B(r),y(r)])try{h.rmSync(t,{recursive:!0,force:!0})}catch{}}function Y(){let e=w();return e?{available:!0,reason:null,detail:e}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function K(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=w();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 T(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 M={id:"chromium",name:"chromium",description:"system chrome / chromium / edge \u2014 visible window (headless: use playwright)",kind:"browser",availability:Y,launch:K};function V(){let e=m();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"sootsim desktop app not installed (run `sootsim desktop install`)"}}async function J(e){let r=m();if(!r)return{launched:!1,message:"sootsim desktop app not installed"};try{let t=await I(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 C={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:V,launch:J};import{spawn as X}from"child_process";import{closeSync as Z,mkdtempSync as Q,openSync as ee,readFileSync as re}from"fs";import{createRequire as te}from"module";import{tmpdir as L}from"os";import{join as W}from"path";var oe=`
|
|
4
4
|
const modulePath = process.env.SOOTSIM_PW_MODULE;
|
|
5
5
|
const url = process.env.SOOTSIM_PW_URL;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.212 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var o=!0,e="public beta",t=e,n="we send anonymous error and dependency data while you use it";export{o as a,e as b,t as c,n as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as ce}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.212 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as ce}from"./chunk-W7RH3GDB.js";import{b as Rt,c as Et,k as Pt}from"./chunk-FMITPB4T.js";import{a as oe,b as P,c as D,d as Ie,e as ie,f as V,g as de,h as ge,i as Mt,j as Ft,k as Te,l as Ot}from"./chunk-TPD4GIHM.js";import{A as wt,B as xt,E as $t,G as St,I as ue,J as vt,P as We,a as ve,b as nt,c as rt,d as it,e as at,f as lt,g as ct,h as ut,i as dt,j as pt,k as Be,l as Ce,q as je,r as mt,s as ft,t as fe,u as gt,v as ke,w as Le,x as yt,y as ht,z as bt}from"./chunk-4IBUPIN6.js";import{e as kt,g as _t,i as It,j as Tt,k as Nt,l as _e}from"./chunk-TUMOXM4E.js";import{a as tt}from"./chunk-44LPHPGF.js";import{a as Ae,c as De,d as Q}from"./chunk-SX5MJUQC.js";import{c as ot}from"./chunk-5FQMI3PB.js";import{b as st}from"./chunk-DWL4WFZ2.js";function qe(e){return`(async () => {
|
|
3
3
|
const bridge = globalThis.SootSim && globalThis.SootSim.bridges && globalThis.SootSim.bridges.hotRemount
|
|
4
4
|
if (!bridge || typeof bridge.reloadExternalApp !== 'function') return false
|
|
5
5
|
await bridge.reloadExternalApp({ resetStorage: ${e?"true":"false"} })
|
|
@@ -519,7 +519,7 @@ import{a as ce}from"./chunk-U74PRAD5.js";import{b as Rt,c as Et,k as Pt}from"./c
|
|
|
519
519
|
`);console.log(`${t??""}
|
|
520
520
|
|
|
521
521
|
${n}
|
|
522
|
-
`),process.exit(0)}let F=c.wsPort,N=c.simId,L=c.simIdSource,M=c.commandTimeoutMs;if(f==="get"&&p==="diagnosis"){let x=a.indexOf("diagnosis"),t=x>=0?[...a.slice(0,x),...a.slice(x+1)]:a,{runDiagnose:n}=await import("./diagnose-
|
|
522
|
+
`),process.exit(0)}let F=c.wsPort,N=c.simId,L=c.simIdSource,M=c.commandTimeoutMs;if(f==="get"&&p==="diagnosis"){let x=a.indexOf("diagnosis"),t=x>=0?[...a.slice(0,x),...a.slice(x+1)]:a,{runDiagnose:n}=await import("./diagnose-VECVKV6Z.js"),r=await n(["recent",...t],o);process.exitCode=r;return}if(f==="do"&&p==="scan"){let{runCamera:x}=await import("./camera-LQTWHUE6.js");await x(a,{port:o.port});return}if(p==="list"&&a.some(x=>x==="--drivers"||x==="-D")){let{buildDriverListRows:x}=await import("./drivers-SOBHAYVL.js"),t=x();console.log(` available drivers (${t.length}):
|
|
523
523
|
`);let n=Math.max(...t.map(i=>i.id.length),6),r=Math.max(...t.map(i=>i.kind.length),4);for(let i of t){let d=i.available?"\u2713":"\u2717",m=i.id.padEnd(n),g=i.kind.padEnd(r);console.log(` ${d} ${m} ${g} ${i.description}`),i.available&&i.detail?console.log(` ${i.detail}`):!i.available&&i.reason&&console.log(` unavailable: ${i.reason}`)}return}let u=It(c),j=N||"default",A=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","storage-clear","list","wait","sleep"]),E=200;function H(x){let t=x.replace(/\s+/g," ").trim();if(!t)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(t)){let r=/<title[^>]*>([^<]+)<\/title>/i.exec(x)?.[1]?.trim(),i=/<body[^>]*>([\s\S]*?)<\//i.exec(x)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),d=r||i||"html error page";return`<html ${x.length}B> "${d}" (body elided \u2014 add --json for the full payload)`}return t.length<=E?t:`${t.slice(0,E)}\u2026 (+${t.length-E} more bytes)`}function U(x){let t=x.displayUrl||x.url;return x.status!=null?`${x.method} ${t} -> ${x.status}${x.statusText?` ${x.statusText}`:""}`:x.error?`${x.method} ${t} -> ${x.error}`:`${x.method} ${t}`}async function S(x){let t=me()?400:200;try{let{settled:n,elapsed:r}=await se({bridge:x,maxMs:t,pollMs:32,stablePolls:2});n||process.stderr.write(` \u26A0 auto-wait timed out after ${r??t}ms \u2014 next command may see mid-animation state. use \`sootsim do settle\` for a longer wait.
|
|
524
524
|
`)}catch{}}function O(x,t){console.error(` tap failed: ${x} stayed visible but did not receive a hittable press after ${t.attempts} attempt${t.attempts===1?"":"s"}`),t.result&&console.error(` last result: ${JSON.stringify(t.result)}`)}async function J(){try{return await u.send({type:"evaluate",code:`(() => ({
|
|
525
525
|
console: ${ke},
|