sootsim 0.1.115 → 0.1.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cli/bin.js +3 -3
- package/dist-cli/chunks/{agent-R3CYHNIF.js → agent-ARMTUNVS.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-TRRE2GH5.js → agent-wrapper-3CCSC2UJ.js} +2 -2
- package/dist-cli/chunks/app-fonts-6WEOH5OT.js +2 -0
- package/dist-cli/chunks/{assert-MRSNTOEC.js → assert-PPQKN6H2.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-W2MOSS56.js +2 -0
- package/dist-cli/chunks/beta-X5X2P5OW.js +2 -0
- package/dist-cli/chunks/chunk-3GO4EP3V.js +2 -0
- package/dist-cli/chunks/{chunk-D6PRIVLD.js → chunk-42HXBO3D.js} +2 -2
- package/dist-cli/chunks/{chunk-77VIOTR7.js → chunk-55WE67F7.js} +2 -2
- package/dist-cli/chunks/{chunk-PEP5GKW7.js → chunk-5VPYJR6P.js} +2 -2
- package/dist-cli/chunks/{chunk-GW5TVVRV.js → chunk-62NWWBSE.js} +2 -2
- package/dist-cli/chunks/{chunk-HYR63F7Z.js → chunk-6AFMCXLK.js} +1 -1
- package/dist-cli/chunks/{chunk-NXAESORG.js → chunk-DCUMVDKC.js} +2 -2
- package/dist-cli/chunks/{chunk-W646EQFP.js → chunk-DZOFIX63.js} +2 -2
- package/dist-cli/chunks/chunk-E7OCWSNR.js +2 -0
- package/dist-cli/chunks/{chunk-UNRBTUAA.js → chunk-EXURTU7U.js} +1 -1
- package/dist-cli/chunks/{chunk-ICZSY2XS.js → chunk-F2FRN4BS.js} +2 -2
- package/dist-cli/chunks/{chunk-HAFZOF63.js → chunk-FPPN5R3O.js} +3 -3
- package/dist-cli/chunks/{chunk-F46PTRLM.js → chunk-GBRLJ3NG.js} +2 -2
- package/dist-cli/chunks/{chunk-XMVEHJSM.js → chunk-GEERKMXM.js} +2 -2
- package/dist-cli/chunks/chunk-GXJPQFGG.js +1 -0
- package/dist-cli/chunks/{chunk-AJYQJMAY.js → chunk-JB5RCBEY.js} +2 -2
- package/dist-cli/chunks/{chunk-TMR6MW5W.js → chunk-JMY3WQVI.js} +1 -1
- package/dist-cli/chunks/{chunk-Q3BVLSSD.js → chunk-K4XXN32E.js} +2 -2
- package/dist-cli/chunks/{chunk-CUHTXNJW.js → chunk-LNZKXZNK.js} +1 -1
- package/dist-cli/chunks/{chunk-UDQHDFZW.js → chunk-LV2K3MAD.js} +2 -2
- package/dist-cli/chunks/{chunk-GUDD5CIA.js → chunk-MRWKKUOV.js} +2 -2
- package/dist-cli/chunks/{chunk-YTJONQGT.js → chunk-MULRUHMB.js} +3 -3
- package/dist-cli/chunks/{chunk-SPVHYFZ3.js → chunk-NIZ7ULGN.js} +1 -1
- package/dist-cli/chunks/{chunk-ZPJDADTZ.js → chunk-OGV2WB2A.js} +2 -2
- package/dist-cli/chunks/{chunk-ML5LV4WM.js → chunk-OHUVIQCL.js} +1 -1
- package/dist-cli/chunks/chunk-PN4SUDA4.js +1 -0
- package/dist-cli/chunks/{chunk-GG5MTRXC.js → chunk-POAO7C3D.js} +1 -1
- package/dist-cli/chunks/{chunk-OK2FCYQN.js → chunk-R4FZZJCE.js} +2 -2
- package/dist-cli/chunks/{chunk-HU2K2HVE.js → chunk-R56NPO3Q.js} +2 -2
- package/dist-cli/chunks/{chunk-5SL6CP7Y.js → chunk-TSAEJ7KF.js} +1 -1
- package/dist-cli/chunks/chunk-TUDCTEEP.js +1 -0
- package/dist-cli/chunks/{chunk-XRBI3TG2.js → chunk-UKOGGUHF.js} +2 -2
- package/dist-cli/chunks/{chunk-WNIVVJR7.js → chunk-V5QLLAJ5.js} +2 -2
- package/dist-cli/chunks/{chunk-E53Y4O7H.js → chunk-V6KDO6VC.js} +1 -1
- package/dist-cli/chunks/{chunk-XO3XTPFR.js → chunk-WS5ROBOK.js} +1 -1
- package/dist-cli/chunks/{chunk-YBAX43B5.js → chunk-WX7WHTYX.js} +1 -1
- package/dist-cli/chunks/{chunk-IWC4SYEG.js → chunk-WZEK65V5.js} +1 -1
- package/dist-cli/chunks/{chunk-X35ALXTD.js → chunk-XIGBM3CU.js} +2 -2
- package/dist-cli/chunks/{chunk-3PUOG2KU.js → chunk-XXG34ZL6.js} +2 -2
- package/dist-cli/chunks/{chunk-SLSNMSD7.js → chunk-Y2HPGJ4G.js} +1 -1
- package/dist-cli/chunks/chunk-Y5X2JAQW.js +13 -0
- package/dist-cli/chunks/{chunk-47VNJGW7.js → chunk-YFJI33N4.js} +3 -3
- package/dist-cli/chunks/{chunk-DACZHUK2.js → chunk-YMUC7AAA.js} +1 -1
- package/dist-cli/chunks/chunk-YMWMVHV7.js +79 -0
- package/dist-cli/chunks/cli-version-CSGUXHQI.js +2 -0
- package/dist-cli/chunks/{compat-4ZDISC6K.js → compat-UCCI7A3R.js} +3 -3
- package/dist-cli/chunks/{config-IWM4VJ6H.js → config-BAM6U324.js} +2 -2
- package/dist-cli/chunks/control-GQ36WAT3.js +2 -0
- package/dist-cli/chunks/{cpu-profile-RPY4UFNI.js → cpu-profile-WBB4KS43.js} +2 -2
- package/dist-cli/chunks/{daemon-SL3D6Q4P.js → daemon-NV27EDGP.js} +2 -2
- package/dist-cli/chunks/{debug-WYNMZ7CT.js → debug-SPST3AK2.js} +3 -3
- package/dist-cli/chunks/{detox-RMLUYFYI.js → detox-FBPDTDB5.js} +2 -2
- package/dist-cli/chunks/{device-TYY7VA57.js → device-XFPPEIBJ.js} +2 -2
- package/dist-cli/chunks/{diagnose-7CXKCUT4.js → diagnose-Y4IGUGNS.js} +2 -2
- package/dist-cli/chunks/drivers-H4UEDBRW.js +2 -0
- package/dist-cli/chunks/{electron-IKCSDHAV.js → electron-TPHN4LSG.js} +3 -3
- package/dist-cli/chunks/flow-6THW77BC.js +2 -0
- package/dist-cli/chunks/help-ZNLHDEA4.js +2 -0
- package/dist-cli/chunks/{hints-YHYKK5HQ.js → hints-G2KF2MXW.js} +2 -2
- package/dist-cli/chunks/{home-paths-OLHYRKN5.js → home-paths-HQW5PGW5.js} +2 -2
- package/dist-cli/chunks/{inspect-INJGRQD3.js → inspect-G7NIE5BP.js} +3 -3
- package/dist-cli/chunks/install-TOXLYRZQ.js +2 -0
- package/dist-cli/chunks/{install-desktop-FQS3WZ6W.js → install-desktop-7RAKOAYK.js} +3 -3
- package/dist-cli/chunks/{keys-JUYFKZD7.js → keys-2C2TLQ5U.js} +2 -2
- package/dist-cli/chunks/{launch-XW5OSSNC.js → launch-GLJKNUG2.js} +3 -3
- package/dist-cli/chunks/{login-QSZQPSEA.js → login-2UHE6KJC.js} +4 -4
- package/dist-cli/chunks/{logout-2YSS6D65.js → logout-2P3HUT7B.js} +2 -2
- package/dist-cli/chunks/{maestro-UG6C6KQ6.js → maestro-CGKKSYOW.js} +2 -2
- package/dist-cli/chunks/{preview-4TH2YLNR.js → preview-GL3JNC7N.js} +2 -2
- package/dist-cli/chunks/{profile-63R3YOCR.js → profile-GQGCTRPL.js} +2 -2
- package/dist-cli/chunks/{react-FMPGSG3A.js → react-GRLN34XH.js} +2 -2
- package/dist-cli/chunks/{record-F64J66JH.js → record-AXQBMXTM.js} +2 -2
- package/dist-cli/chunks/runtime-U3KKUZAL.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-HJPB7EEU.js → runtime-delivery-PJKINZBE.js} +2 -2
- package/dist-cli/chunks/{screenshot-OF6QEH6B.js → screenshot-6S56FXEN.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-BIZP42HF.js → screenshot-mode-FSBHKSNW.js} +2 -2
- package/dist-cli/chunks/{screenshots-DKAYDLK5.js → screenshots-KHZ2ZHZZ.js} +2 -2
- package/dist-cli/chunks/{server-ETFFUJ5R.js → server-XUIYS326.js} +2 -2
- package/dist-cli/chunks/setup-repo-S74GCXIK.js +2 -0
- package/dist-cli/chunks/{skills-H2OPZZLC.js → skills-ELD3O7AQ.js} +2 -2
- package/dist-cli/chunks/{start-OI245IG4.js → start-5RNFBM52.js} +4 -4
- package/dist-cli/chunks/store-JKCXOYDM.js +2 -0
- package/dist-cli/chunks/telemetry-BAX2S7VV.js +2 -0
- package/dist-cli/chunks/{test-HE6RK2ZX.js → test-4QGK73WQ.js} +3 -3
- package/dist-cli/chunks/{three-mode-K2NTAVQP.js → three-mode-XPFDZSVN.js} +2 -2
- package/dist-cli/chunks/{timeline-3DBCJWKF.js → timeline-KGPIXJCV.js} +2 -2
- package/dist-cli/chunks/{upgrade-7YLEP6ED.js → upgrade-KA4F2CC6.js} +2 -2
- package/dist-cli/chunks/upload-MTRVKPSM.js +2 -0
- package/dist-cli/chunks/{web-BWUYH3SK.js → web-4EYCEJ56.js} +2 -2
- package/dist-cli/chunks/{what-happened-VDTCMZNP.js → what-happened-WRUGJXIQ.js} +2 -2
- package/dist-cli/chunks/{whoami-2ZOUZSB3.js → whoami-42N7MAML.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/demo-app-registry.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 +3 -2
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/auto-bootstrap-7ABTFLLR.js +0 -2
- package/dist-cli/chunks/beta-ZJYYZEFR.js +0 -2
- package/dist-cli/chunks/chunk-BZTJFTU2.js +0 -1
- package/dist-cli/chunks/chunk-F4LJC2WB.js +0 -1
- package/dist-cli/chunks/chunk-Q4SUC2SN.js +0 -79
- package/dist-cli/chunks/chunk-SRXOV4BJ.js +0 -13
- package/dist-cli/chunks/chunk-TF5LTELW.js +0 -2
- package/dist-cli/chunks/chunk-V2SPOLQA.js +0 -1
- package/dist-cli/chunks/chunk-VSKAOUZ5.js +0 -2
- package/dist-cli/chunks/cli-version-RIP4ZUNM.js +0 -2
- package/dist-cli/chunks/control-FSKX3J4O.js +0 -2
- package/dist-cli/chunks/drivers-OIAGQOCX.js +0 -2
- package/dist-cli/chunks/flow-ZIV2ISC2.js +0 -2
- package/dist-cli/chunks/help-RUILKRB4.js +0 -2
- package/dist-cli/chunks/install-BRAHILXG.js +0 -2
- package/dist-cli/chunks/runtime-NE4NMW4R.js +0 -2
- package/dist-cli/chunks/setup-repo-JE25CERB.js +0 -2
- package/dist-cli/chunks/store-2H5T4NFZ.js +0 -2
- package/dist-cli/chunks/telemetry-USTW2NVP.js +0 -2
- package/dist-cli/chunks/upload-T3AYMH27.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{execFileSync as p,spawn as l}from"child_process";import{existsSync as s}from"fs";import{homedir as u}from"os";import{join as d}from"path";var g=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","~/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","~/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","~/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","~/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Arc.app/Contents/MacOS/Arc","~/Applications/Arc.app/Contents/MacOS/Arc"],f=["/usr/bin/google-chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/microsoft-edge","/usr/bin/brave-browser","/snap/bin/chromium"],h=["C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe","C:\\Program Files (x86)\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"],C=["google-chrome","chromium","chromium-browser","microsoft-edge","brave-browser"],O=["chrome","msedge","brave"];function w(r){return r.startsWith("~/")?d(u(),r.slice(2)):r}function a(r){for(let n of r){let o=w(n);if(s(o))return o}return null}function U(r,n){try{let e=p(n==="win32"?"where":"which",[r],{encoding:"utf8",timeout:1500,stdio:["ignore","pipe","ignore"]}).trim();return e?e.split(/\r?\n/)[0]:null}catch{return null}}function M(r=process.platform){let n=process.env.CHROME_PATH||process.env.CHROMIUM_PATH;if(n&&s(n))return n;let o=a(r==="darwin"?g:r==="win32"?h:f);if(o)return o;let e=r==="win32"?O:C;for(let t of e){let i=U(t,r);if(i)return i}return null}function A(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform;return n.newWindow?c(r,{...n,platform:o,newWindow:!0}):o==="darwin"?{command:"open",args:n.background===!1?[r]:["-g",r],via:"system"}:o==="win32"?{command:"cmd",args:["/c","start","",r],via:"system"}:{command:"xdg-open",args:[r],via:"system"}}function c(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform,e="chromiumBinary"in n?n.chromiumBinary:M(o);if(!e)throw new Error("browser launch requires Chrome, Chromium, Edge, Brave, or Arc");let t=[];return n.newWindow!==!1&&t.push("--new-window"),t.push(r),{command:e,args:t,via:"chromium",target:e}}async function m(r,n,o){return new Promise((e,t)=>{let i=l(r,n,{detached:o,stdio:"ignore"});i.once("error",t),i.once("spawn",()=>{o&&i.unref(),e(i.pid)})})}async function x(r,n={}){let o=A(r,n),e=await m(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function y(r,n={}){let o=c(r,n),e=await m(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function E(r,n={}){await x(r,n)}export{M as a,x as b,y as c,E as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as x}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as x}from"./chunk-V6KDO6VC.js";var J="sootsimConfig";function h(e){return!!e&&Object.keys(e).length>0}function de(e){return e?h(e.modules)||h(e.turboModules)||h(e.nativeModules)||h(e.env)||h(e.settings)||h(e.initialState):!1}function V(e,t){let n=new URL(e);return de(t)?n.searchParams.set(J,JSON.stringify(t)):n.searchParams.delete(J),n.toString()}import{existsSync as d,readFileSync as R,writeFileSync as g}from"node:fs";import{homedir as le}from"node:os";import{dirname as fe,join as c,resolve as y}from"node:path";var _=le();function me(e){let t=e;for(;;){if(d(c(t,"pnpm-workspace.yaml"))||d(c(t,"turbo.json"))||d(c(t,"nx.json"))||d(c(t,"lerna.json")))return t;let n=c(t,"package.json");if(d(n))try{if(JSON.parse(R(n,"utf8")).workspaces)return t}catch{}let r=fe(t);if(r===t)return null;t=r}}function O(e,t){let n=me(process.cwd()),r=[n?y(n,e):null,y(process.cwd(),e),y(process.cwd(),t)].filter(o=>!!o);for(let o of r)if(d(o))return o;return r[0]??y(process.cwd(),e)}var pe=()=>O("packages/sootsim-engine/scripts/expensify-web-proxy.ts","scripts/expensify-web-proxy.ts"),_e=()=>O("packages/sootsim-engine/scripts/rainbow-metadata-proxy.ts","scripts/rainbow-metadata-proxy.ts"),ge=()=>O("packages/compat/src/stubs/mattermost-rnutils-native.ts","../compat/src/stubs/mattermost-rnutils-native.ts"),Re=()=>O("packages/compat/src/stubs/native-seams/react-native-keychain-manager.ts","../compat/src/stubs/native-seams/react-native-keychain-manager.ts"),W=()=>O("packages/compat/src/stubs/mattermost-network-client-native.ts","../compat/src/stubs/mattermost-network-client-native.ts"),Ee=()=>O("packages/sootsim-engine/scripts/mattermost-preview-server.ts","scripts/mattermost-preview-server.ts"),B={USE_NGROK:"true",NGROK_URL:"http://localhost:9000/",SECURE_NGROK_URL:"http://localhost:9000/"},Se=c(_,"github/mattermost-mobile"),N=c(_,"github/uniswap-interface"),Ae=c(N,"apps/mobile"),C=c(N,".env.defaults.local"),he="stored-in-.env.local",q="# sootsim demo env overrides",Pe=c(N,"packages/uniswap/src/features/forceUpgrade/hooks/useForceUpgradeStatus.ts"),Oe=c(N,"apps/mobile/src/notification-service/data-sources/createForceUpgradeNotificationDataSource.ts"),Q="SOOTSIM_DEMO_DISABLE_FORCE_UPGRADE";function X(e){if(!d(e))return{};let t={},n=R(e,"utf8");for(let r of n.split(/\r?\n/)){let o=r.trim();if(!o||o.startsWith("#"))continue;let a=o.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/);if(!a)continue;let i=a[2].trim();(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1)),t[a[1]]=i}return t}function $(e){if(!e)return!1;let t=e.trim();return!(!t||t.includes(he)||t==="TRADING_API_KEY"||t==="UNISWAP_API_KEY")}function z(e,t){for(let n of e)for(let r of t){let o=n[r];if($(o))return o.trim()}}function oe(){let e=X(C),t=X(c(N,"apps/web/.env")),n=[process.env,e,t],r={},o=[["AMPLITUDE_PROXY_URL_OVERRIDE",["REACT_APP_AMPLITUDE_PROXY_URL"]],["QUICKNODE_ENDPOINT_NAME",["REACT_APP_QUICKNODE_ENDPOINT_NAME"]],["QUICKNODE_ENDPOINT_TOKEN",["REACT_APP_QUICKNODE_ENDPOINT_TOKEN"]],["INFURA_KEY",["REACT_APP_INFURA_KEY"]],["STATSIG_API_KEY",["REACT_APP_STATSIG_API_KEY"]],["STATSIG_PROXY_URL_OVERRIDE",["REACT_APP_STATSIG_PROXY_URL"]],["WALLETCONNECT_PROJECT_ID",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["WALLETCONNECT_PROJECT_ID_BETA",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["WALLETCONNECT_PROJECT_ID_DEV",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["TRADING_API_KEY",["REACT_APP_TRADING_API_KEY"]],["UNISWAP_API_KEY",[]]];for(let[i,s]of o){let u=z(n,[i,...s]);if(u){r[i]=u;for(let l of s)r[l]=u}}if(!($(r.TRADING_API_KEY)&&$(r.UNISWAP_API_KEY))){let i=z(n,["GRAPHQL_URL_OVERRIDE","REACT_APP_AWS_API_ENDPOINT"])||"https://interface.gateway.uniswap.org/v1/graphql";r.API_BASE_URL_OVERRIDE="https://interface.gateway.uniswap.org",r.API_BASE_URL_V2_OVERRIDE="https://interface.gateway.uniswap.org/v2",r.GRAPHQL_URL_OVERRIDE=i,r.TRADING_API_URL_OVERRIDE="https://trading-api-labs.interface.gateway.uniswap.org",r.FOR_API_URL_OVERRIDE="https://for.interface.gateway.uniswap.org/v2/FOR.v1.FORService"}return r}function Te(){let e=d(C)?R(C,"utf8"):"";if(e&&!e.includes(q))return;let t=oe(),n=[q];for(let[r,o]of Object.entries(t).sort(([a],[i])=>a.localeCompare(i)))n.push(`${r}=${JSON.stringify(o)}`);n.push(""),g(C,`${n.join(`
|
|
3
3
|
`)}
|
|
4
4
|
`)}function ve(){let e=`export function useForceUpgradeStatus(): ForceUpgradeStatus {
|
|
5
5
|
`,t=` // sootsim demo: bypass the force-upgrade gate during local engine demos.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as Ns}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as Ns}from"./chunk-V6KDO6VC.js";var ui=`(async () => {
|
|
3
3
|
try { localStorage.clear() } catch {}
|
|
4
4
|
try { sessionStorage.clear() } catch {}
|
|
5
5
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function A(e,t){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n){let s=e.indexOf(r);if(s>=0&&e[s+1]){let a=Number(e[s+1]);if(Number.isFinite(a))return Math.max(100,a)}}return t}var m=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function f(e){return typeof e=="string"&&m.has(e)}async function w(e){return await e.send({type:"evaluate",code:"window.__sootsimEngineState?.inspectActive === true"})===!0}async function E(e,t){if(!f(t))return!1;try{return await w(e)}catch{return!1}}async function L(e){let t=await e.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof t=="number"?t:0}}async function D(e,t=5){let n=await e.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${t}))()`});return{depth:t,tree:n}}async function N(e){let t=await e.send({type:"evaluate",code:"window.location.href"});return{url:typeof t=="string"?t:""}}async function H(e,t){let n=`(async () => {
|
|
3
3
|
const t = window.__sootsimTest
|
|
4
4
|
const mainShell = window.SootSim?.bridges?.mainShell
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as D,b as q,c as de,e as me}from"./chunk-XIGBM3CU.js";import{m as B}from"./chunk-F2FRN4BS.js";import{k as le,m as ce}from"./chunk-Y2HPGJ4G.js";import{a as pe,b as fe,c as ge}from"./chunk-3GO4EP3V.js";import{b as ae,c as I,d as v,e as x}from"./chunk-K4XXN32E.js";import{c as k,d as w,e as T}from"./chunk-NIZ7ULGN.js";import{g as G}from"./chunk-R4FZZJCE.js";import{a as M,b as V}from"./chunk-WS5ROBOK.js";import{c as ue}from"./chunk-MRWKKUOV.js";import{d as j}from"./chunk-WZEK65V5.js";import{a as ie}from"./chunk-E7OCWSNR.js";import{E as re,F as se}from"./chunk-EXURTU7U.js";import Y from"node:fs";import Ae from"node:os";import P from"node:path";function Re(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function J(e){let o=Re(e);return o==="localhost"||o.endsWith(".localhost")||o==="0.0.0.0"||o==="::1"||/^127(?:\.\d{1,3}){3}$/.test(o)}function he(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function Oe(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function ye(e,o,t){return`${e}//${o}:${t}`}function Ue(e){if(typeof window>"u")return!1;try{let o=new URL(e);return J(o.hostname)&&J(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function we(e,o){let t={...o,cache:o?.cache??"no-store"};return Ue(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function Be(e){return e==="https:"?443:80}function De(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function ve(e,o){let t=e.replace(/\/+$/,"");try{let n=await we(`${t}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},a=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(a||s.name)return{bundleUrl:de(a||`${t}${q}`),port:o,framework:Oe(a,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await we(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${q}`,port:o,framework:"metro"}}catch{}return null}async function be(e){return ve(ye("http:","localhost",e),e)}async function Se(e){let o=e.trim();if(/^\d+$/.test(o)){let i=parseInt(o,10),l=await be(i);if(l)return l;let c=3;for(let d=1;d<=c;d++){let m=await be(i+d);if(m)return m}throw he(`localhost:${i} (also scanned +1..+${c})`)}let t=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(t)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let r=n.protocol||"http:",s=n.port?parseInt(n.port,10):Be(r),a=ye(r,n.hostname,s);if(De(n)){let i=await ve(a,s);if(i)return i;throw he(a)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function vt(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim install-desktop"),console.error(""),console.error(" or wire sootsim into your own project so your dev server hosts the bridge:"),console.error(" sootsim setup-repo"),console.error("")}function $e(e){let o=M();if(console.log(` note: no sootsim bridge detected on port ${e}`),o){console.log(" launch the installed companion with:"),console.log(" sootsim electron");return}console.log(""),console.log(" to get a bridge running, either:"),console.log(" sootsim install-desktop # download the electron app"),console.log(" sootsim setup-repo # wire sootsim into your own project")}function Le(e){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${e}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function St(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){Le(o);return}console.error(` no sim with id "${t}" is connected to the bridge on port ${o}.`),console.error(""),console.error(" connected sims:");for(let r of n){let s=[r.isPrimary?"primary":null,r.readyState,r.userVisible===!1?"hidden":r.userVisible===!0?"visible":null,r.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${r.id} (${s})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}var Ne=12e4,Ie=500,Fe=5e3,He={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function S(e){return new Promise(o=>setTimeout(o,e))}function xe(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function Ke(){let e=xe("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??xe("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Ne;return{timeoutMs:e,hostTimeoutMs:e+Fe,intervalMs:Ie,attempts:Math.max(1,Math.ceil(e/Ie))}}function We(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function N(e){return e.trim()}function X(e){try{let o=new URL(e),t=o.pathname.replace(/\/+$/,"")||"/";return o.searchParams.has("open")||o.searchParams.has("port")||o.searchParams.has("bundle")||o.searchParams.has("demo")||o.pathname.includes("/sootsim/index.html")||t==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function ze(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function Ht(e){let o=N(e);return(await Te(o)).bundleUrl}function je(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||o.search||o.hash||!/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(o.hostname))return null;let n=o.port?Number(o.port):o.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function Te(e){let o=N(e),t=/^\d+$/.test(o)?Number(o):je(o);if(t&&t>0){let n=await me(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return Se(o)}function Z(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function qe(e,o){let t=N(e),n=new URL(o),r=Z(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),/^\d+$/.test(t)?n.pathname=`${r}/rn/${t}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",t)),n.toString()}function Ve(e){let o=N(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function Ge(e,o){let t=await Te(e),n=new URL(o),r=Z(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.set("bundle",t.bundleUrl),n.toString()}function Je(e){return e.startsWith("~/")?P.join(Ae.homedir(),e.slice(2)):P.isAbsolute(e)?e:P.resolve(process.cwd(),e)}function Qe(e){let o={};for(let t=0;t<e.length;t++){if(e[t]!=="--replace")continue;let n=e[t+1];n||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let r=n.indexOf("=");(r<=0||r===n.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let s=n.slice(0,r).trim(),a=Je(n.slice(r+1).trim());Y.existsSync(a)||(console.error(` sootsim open: replacement file not found: ${a}`),process.exit(1)),o[s]={file:a},t++}return Object.keys(o).length>0?{modules:o}:void 0}function Me(){let e=re();return se(e)&&e.runtimePort>0?`http://localhost:${e.runtimePort}/`:ie}async function Xe(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.SOOT_REPO_DIR||await fe(t)||void 0,r=pe({bundleUrl:t,repoDir:n});if(r.length===0)return e;let s=await Ye(r);return s.length===0?e:(o.searchParams.set("appFonts",ge(s)),o.toString())}catch{return e}}async function Ye(e){let o=await Promise.all(e.map(async n=>{let r=new AbortController,s=setTimeout(()=>r.abort(),1500);try{let a=await fetch(n.url,{method:"HEAD",signal:r.signal});return a.status>=200&&a.status<400?n:null}catch{return null}finally{clearTimeout(s)}})),t=[];for(let n of o)n!==null&&t.push(n);return t}async function Ze(e,o){if(!e)return new URL(o).toString();if(X(e))return new URL(e).toString();let t=He[e.toLowerCase()];if(t){let n=new URL(o),r=Z(n.pathname);return n.pathname=`${r}${t}`,n.toString()}return Ve(e)?Ge(e,o):qe(e,o)}async function A(e,o=Me()){let t=await Ze(e,o);return Xe(t)}function Pe(e,o){let t=e?.url||e?.origin||o;try{let n=new URL(t);return n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("inspectOpen"),n.searchParams.delete("appFonts"),n.toString()}catch{return o}}async function et(e,o,t){let n=new URL(await A(e,o));return n.searchParams.set("inspectOpen",t),n.toString()}async function tt(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500,a=n.minNodeCount??10;for(let i=0;i<r;i++){let l=v(e,{commandTimeoutMs:o,simId:t,simIdSource:"flag"});try{let c=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>a)return{bridge:l,count:c}}catch{}l.close(),await S(s)}return null}function ot(e){if(!e)return null;try{let o=new URL(e);if(o.searchParams.has("bundle")){let t=o.searchParams.get("bundle")||"";try{let n=new URL(t),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return o.searchParams.has("port")?`connect :${o.searchParams.get("port")||""}`:o.searchParams.has("open")?`connect ${o.searchParams.get("open")||""}`:o.searchParams.has("demo")?`demo ${o.searchParams.get("demo")||"default"}`:o.pathname.includes("/sootsim/index.html")||o.pathname==="/sootsim/"||o.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function nt(e){let o=e.indexOf(":");if(o<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,o),n=e.slice(o+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function rt(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
|
|
3
|
+
`);for(let t of e){let n=t.lockedBy&&t.lockExpiresAt?`locked by ${nt(t.lockedBy)} (${Math.max(0,Math.round((t.lockExpiresAt-Date.now())/1e3))}s)`:"",r=[t.isPrimary?"primary":"",t.id===o?"selected":"",t.readyState,t.userVisible===!1?"hidden":t.userVisible===!0?"visible":"",t.attachedCliCount&&t.attachedCliCount>0?"in use":"",t.userFocused?"focused":"",n].filter(Boolean);console.log(` ${t.id}${r.length?` [${r.join(", ")}]`:""}`);let s=ot(t.url);if(s)console.log(` loaded: ${s}`);else if(t.url){let i=t.url.length>96?`${t.url.slice(0,93)}\u2026`:t.url;console.log(` url: ${i}`)}else t.origin&&console.log(` origin: ${t.origin}`);let a=st(t);a&&console.log(` engine: ${a}`),t.title&&console.log(` title: ${t.title}`),t.visibilityState&&t.visibilityState!=="visible"&&console.log(` visibility: ${t.visibilityState}`),console.log(` connected: ${Ce(Date.now()-t.connectedAt)}`),t.lastActiveAt&&t.lastActiveAt>0&&console.log(` last active: ${Ce(Date.now()-t.lastActiveAt)}`)}}function st(e){let o=e.url||e.origin||"";if(!o)return null;try{let t=new URL(o).port;return t==="5173"?"dev \u2014 local source (:5173)":t==="3000"?"soot app embedded (:3000)":`runtime \u2014 published engine (:${t||"?"})`}catch{return null}}function Ce(e){let o=Math.max(0,Math.round(e/1e3));return o<60?`${o}s ago`:o<3600?`${Math.round(o/60)}m ago`:o<86400?`${Math.round(o/3600)}h ago`:`${Math.round(o/86400)}d ago`}async function L(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500;for(let a=0;a<r;a++){let i=v(e,{commandTimeoutMs:o});try{let c=(await i.listSims()).find(t);if(c)return c}catch{}finally{i.close()}await S(s)}return null}async function it(e,o,t,n={}){let r=n.attempts??20,s=n.intervalMs??250;for(let a=0;a<r;a++){let i=v(e,{commandTimeoutMs:o});try{let c=(await i.listSims()).find(d=>d.id===t);if(!c||c.readyState!=="open")return!0}catch{return!0}finally{i.close()}await S(s)}return!1}function at(e){let o=e.meta;if(!o||o.sootsimHostDriver!=="playwright")return null;let t=Number(o.sootsimHostPid);return!Number.isInteger(t)||t<=1||t===process.pid?null:t}function lt(e){if(!e.connectAckFile)return!1;try{return Y.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
|
|
4
|
+
`,{flag:"w"}),!0}catch{return!1}}function ct(e){if(e.diagnosticLogPath)try{let o=Y.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!o){console.error(` ${P.basename(e.diagnosticLogPath)} was empty`);return}let t=o.length>4e3?`\u2026
|
|
5
|
+
${o.slice(-4e3)}`:o;console.error(` ${P.basename(e.diagnosticLogPath)}:`),console.error(t)}catch(o){let t=o instanceof Error?o.message:String(o);console.error(` failed to read ${P.basename(e.diagnosticLogPath)}: ${t}`)}}function ke(e){try{return process.kill(e,0),!0}catch(o){return o?.code==="EPERM"}}async function dt(e,o=2500){let t=Date.now()+o;for(;Date.now()<t;){if(!ke(e))return!0;await S(100)}return!ke(e)}async function Q(e,o){let t=new Set(o),n=new Set;for(let r of e){if(!t.has(r.id))continue;let s=at(r);s&&n.add(s)}for(let r of n){try{process.kill(r,"SIGTERM")}catch{}if(await dt(r)){console.log(` closed playwright host process ${r}`);continue}try{process.kill(r,"SIGKILL"),console.log(` force-closed playwright host process ${r}`)}catch{}}}function F(e,o){if(o){let r=o.trim(),s=e.find(a=>a.id===r);if(!s)throw new Error(`no sim connected with id ${r}`);return s}let t=e.find(r=>r.isPrimary&&r.readyState==="open");if(t)return t;let n=e.find(r=>r.readyState==="open");if(n)return n;throw new Error("no sim connected")}function _(e,o,t){console.log(` ${t==="current sim"?"loaded":"opened"}: ${e} [${t}]`),console.log(` current sim: ${o.id}`),console.log(JSON.stringify({simId:o.id,url:o.url},null,2))}async function E(e,o,t){if(t.includes("--no-describe"))return;let n=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await mt(e,o,{stableMs:150,maxMs:400});let r=v(e,{commandTimeoutMs:3e3,simId:o,cliLabel:"open --describe",simIdSource:"flag"});try{let s=null;try{s=await r.send({type:"evaluate",code:le})}catch{}if(s&&!(s.flag===!0&&!s.loadingText&&ce(s))){let d=s.loadingText?`still showing "${s.loadingText}"`:s.flag!==!0?"guest ready event has not fired":s.targets<=0?"no visible app content is inspectable yet":"app tree is still stabilizing";console.log(` app still loading: ${d} (nodes: ${s.nodes}, targets: ${s.targets})`),console.log(" before interacting, run: sootsim wait ready --max-ms 120000")}let i=`(async () => {
|
|
6
|
+
const t = window.__sootsimTest
|
|
7
|
+
const ms = window.SootSim?.bridges?.mainShell
|
|
8
|
+
if (!t) return null
|
|
9
|
+
let shell = null
|
|
10
|
+
try { shell = ms?.getState ? await ms.getState() : null } catch {}
|
|
11
|
+
const tree = await t.dumpTree(12, ${JSON.stringify({describe:!0,verbose:!1,filter:""})})
|
|
12
|
+
return { tree, shell }
|
|
13
|
+
})()`,l=await r.send({type:"evaluate",code:i});if(!l?.tree)return;if(console.log(""),l.shell?.state){let c=[`state=${l.shell.state}`,l.shell.activeApp?`app=${l.shell.activeApp}`:null].filter(Boolean);console.log(` shell: ${c.join(" ")}`)}console.log(l.tree)}finally{r.close()}}catch{}finally{n===void 0?delete process.env.SOOTSIM_QUIET_TARGET_NOTICE:process.env.SOOTSIM_QUIET_TARGET_NOTICE=n}}async function mt(e,o,t){let n=Date.now()+t.maxMs,r="(async () => (await window.__sootsimTest?.getNodeCount?.()) || 0)()",s=v(e,{commandTimeoutMs:2e3,simId:o,simIdSource:"flag"});try{let a=-1,i=0;for(;Date.now()<n;){let l=-1;try{let c=await s.send({type:"evaluate",code:r});typeof c=="number"&&(l=c)}catch{}if(l>=0&&l===a){if(Date.now()-i>=t.stableMs)return}else a=l,i=Date.now();await S(50)}}finally{s.close()}}async function Kt(e,o={}){let t=I(e,{port:o.port,commandTimeoutMs:o.timeoutMs}),n=x(t);try{let r=await n.listSims();rt(r,t.simId)}finally{n.close()}}async function Wt(e,o={}){let t=I(e,{port:o.port,commandTimeoutMs:o.timeoutMs,stripBooleanFlags:["--new","--headless","--ephemeral"],stripValueFlags:["--base-url","--replace","--driver","--profile","--cdp-port"]}),n=e.find((u,p)=>e[p-1]==="--profile"),r=e.includes("--ephemeral"),s=e.find((u,p)=>e[p-1]==="--cdp-port"),a=s?Number(s):void 0;s&&(!Number.isFinite(a)||a<=0)&&(console.error(` sootsim open: --cdp-port must be a positive port number, got "${s}"`),process.exit(1)),n&&r&&(console.error(" sootsim open: --profile cannot be combined with --ephemeral"),process.exit(1));let i=n?ue(n).id:void 0,l=!!i||r,c=e.includes("--new")||l,d=Qe(e);c&&t.simIdSource==="flag"&&(console.error(" sootsim open: --new, --profile, and --ephemeral cannot be combined with --sim"),process.exit(1));let m=t.positional[0]||"";if(ze(m)){let u=(()=>{try{return/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(new URL(m).hostname)}catch{return!1}})();console.log(" that\u2019s a SootSim preview/build link \u2014 a full player page, not a driveable sim."),console.log(" opening it in your browser for viewing\u2026");try{await j(m,{background:!1})}catch(p){console.error(` could not launch a browser: ${p instanceof Error?p.message:String(p)}`),console.error(` open it yourself: ${m}`),process.exit(1)}console.log(u?" to drive it under the CLI, point `sootsim open` at the app\u2019s dev port instead (e.g. `sootsim open 8081`).":" the CLI can\u2019t drive a remote preview (the engine only attaches to the local bridge from localhost). to drive the app, run it locally and `sootsim open <port>`.");return}let h=e.find((u,p)=>e[p-1]==="--driver")||"",H=e.includes("--headless");a&&h!=="playwright"&&(console.error(" sootsim open: --cdp-port is only honored by the playwright driver \u2014 add `--driver playwright`"),process.exit(1));let C=e.find((u,p)=>e[p-1]==="--base-url")||Me(),ee=e.includes("--base-url"),te=k();if(!h&&!c&&(t.simIdSource==="flag"||t.simIdSource==="saved"&&!!te)){let u=x(t),p=t.simId?` --sim ${t.simId}`:"",f=!1;try{let g=null;try{let y=await u.listSims();if(t.simIdSource==="saved"?(g=y.find($=>$.id===te&&$.readyState==="open")??null,g||T()):g=F(y,t.simId),!g)if(t.simIdSource==="saved")f=!0;else throw new Error("no sim connected");if(!f&&g){let $=ee||X(m)?C:Pe(g,C),U=await A(m,D($,d));u.send({type:"evaluate",simId:g.id,code:`window.location.href = ${JSON.stringify(U)}`}).catch(()=>{})}}catch(y){console.error(` open failed: ${y instanceof Error?y.message:String(y)}`),await B(u,{errorsCommand:`sootsim get errors 5${p}`,warningsCommand:`sootsim get warnings 5${p}`,requestsCommand:`sootsim get requests 5${p}`}),process.exit(1)}if(!f&&g){await S(1500);let y=await tt(t.wsPort,t.commandTimeoutMs,g.id);y||(console.error(" timed out waiting for current sim to load target"),process.exit(1)),y.bridge.close(),w(g.id);let $=ee||X(m)?C:Pe(g,C),U=await A(m,D($,d));_(U,{...g,url:U},"current sim"),await E(t.wsPort,g.id,e);return}}finally{u.close()}}let oe=D(C,d),Ee=await A(m,oe),ne=`cli-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,b=await et(m,oe,ne),K={newWindow:!0},R=u=>u.url?.includes(`inspectOpen=${ne}`)??!1;if(h){We(h)||(console.error(` unknown driver "${h}" \u2014 run \`sootsim list --drivers\``),process.exit(1));let u=G(h);u||(console.error(` unknown driver "${h}" \u2014 run \`sootsim list --drivers\``),process.exit(1));let p=Ke(),f=await u.launch({url:b,headless:H,newWindow:K.newWindow,profileId:i,ephemeralProfile:r,cdpPort:a,connectTimeoutMs:p.hostTimeoutMs});f.launched||(console.error(` ${u.name} driver: ${f.message}`),process.exit(1));let g=await L(t.wsPort,t.commandTimeoutMs,R,{attempts:p.attempts,intervalMs:p.intervalMs});if(!g){if(f.pid)try{process.kill(f.pid,"SIGTERM"),console.error(` closed ${u.name} host process ${f.pid}`)}catch{}ct(f),console.error(` timed out after ${p.timeoutMs}ms waiting for opened sim to connect`),process.exit(1)}w(g.id),lt(f),_(b,g,`${u.name} driver`),await E(t.wsPort,g.id,e);return}if(l){let u=M();u||(console.error(" profiles require electron or playwright; install the desktop companion or use `--driver playwright`"),process.exit(1));try{(await V(b,u,{profileId:i,ephemeralProfile:r})).launched||(console.error(" desktop companion failed to start"),process.exit(1))}catch(f){console.error(` desktop companion failed: ${f instanceof Error?f.message:String(f)}`),process.exit(1)}let p=await L(t.wsPort,t.commandTimeoutMs,R,{attempts:40,intervalMs:500});p||(console.error(" timed out waiting for profiled sim to connect"),process.exit(1)),w(p.id),_(b,p,"desktop companion"),await E(t.wsPort,p.id,e);return}let W=!1,z=!1;try{let u=v(t.wsPort,{commandTimeoutMs:2e3});try{await u.listSims(),W=!0}finally{u.close()}}catch{}if(W)try{let u=v(t.wsPort,{commandTimeoutMs:3e3});try{await u.openUrl(b,K),z=!0}finally{u.close()}}catch{}if(!z){let u=M();if(u)try{if((await V(b,u)).launched){let f=await L(t.wsPort,t.commandTimeoutMs,R,{attempts:20,intervalMs:500});if(f){w(f.id),_(b,f,"desktop companion"),await E(t.wsPort,f.id,e);return}}}catch{}try{await j(b,K)}catch(p){console.error(` open failed: ${p instanceof Error?p.message:String(p)}`),G("playwright")?.availability().available?console.error(" no system browser found \u2014 retry with `sootsim open \u2026 --driver playwright` for a headless sim."):console.error(" run `sootsim list --drivers` to see available drivers."),process.exit(1)}if(!W){console.log(` opened: ${Ee}`),$e(t.wsPort);return}}let O=await L(t.wsPort,t.commandTimeoutMs,R,{attempts:30,intervalMs:500});O||(console.error(" timed out waiting for opened sim to connect"),process.exit(1)),w(O.id),_(b,O,z?"bridge":"direct shell open"),await E(t.wsPort,O.id,e)}async function _e(e,o={}){let t=I(e,{port:o.port,commandTimeoutMs:o.timeoutMs,stripBooleanFlags:["--force"]}),n=e.includes("--force"),r=x(t),s=t.simId?` --sim ${t.simId}`:"";try{try{let a=await r.listSims(),i=F(a,t.positional[0]||t.simId);if(i.lockedBy&&i.lockExpiresAt&&i.lockExpiresAt>Date.now()){let l=Math.max(0,Math.round((i.lockExpiresAt-Date.now())/1e3));i.lockedByKind==="user-active"&&(console.error(` refused: ${i.id} is locked by the active user (${l}s) \u2014 that's a live human tab`),console.error(" run `sootsim open --new` for a fresh investigation sim"),process.exit(1)),n||(console.error(` refused: ${i.id} is leased by ${i.lockedBy} (${l}s)`),console.error(` \`sootsim use ${i.id} --force\` to take it, or \`sootsim open --new\` for a fresh sim`),process.exit(1))}await r.focusSim(i.id),w(i.id),console.log(` using: ${i.id}`)}catch(a){console.error(` use failed: ${a instanceof Error?a.message:String(a)}`),await B(r,{errorsCommand:`sootsim get errors 5${s}`,warningsCommand:`sootsim get warnings 5${s}`,requestsCommand:`sootsim get requests 5${s}`}),process.exit(1)}}finally{r.close()}}async function zt(e,o={}){await _e(e,o)}async function jt(e,o={}){await _e(e,o)}async function qt(e,o={}){let t=I(e,{port:o.port,commandTimeoutMs:o.timeoutMs,stripBooleanFlags:["--force"]}),n=e.includes("--force"),r=x(t);try{try{let s=await r.listSims(),a=F(s,t.positional[0]||t.simId),i=n&&a.lockedBy&&a.lockedByKind!=="user-active"?a.lockedBy:null,l=await r.claim(a.id,{force:n});w(a.id);let c=Math.max(0,Math.round((l.lockExpiresAt-Date.now())/1e3)),d=l.bootedCount>0?` (booted ${l.bootedCount})`:"";console.log(` claimed: ${l.simId} [${c}s]${d}`),i&&console.log(` took over from: ${i}`)}catch(s){if(s instanceof ae){let a=Math.max(0,Math.round(s.lock.expiresInMs/1e3));console.error(` claim failed: locked by ${s.lock.by} for ${a}s more`),console.error(" use --force to take it, or `sootsim open --new` for a fresh sim"),process.exit(1)}console.error(` claim failed: ${s instanceof Error?s.message:String(s)}`),process.exit(1)}}finally{r.close()}}async function ut(e,o,t,n){if(n.length===0)return{closed:[],remaining:[]};await Promise.all(n.map(s=>e.closeSim(s).catch(()=>{})));let r=new Set(n);for(let s=0;s<40;s++){let a=[];try{let i=v(o,{commandTimeoutMs:t});try{a=(await i.listSims()).filter(c=>r.has(c.id)&&c.readyState==="open").map(c=>c.id)}finally{i.close()}}catch{a=[]}if(a.length===0)return{closed:[...r],remaining:[]};if(s===39)return{closed:[...r].filter(i=>!a.includes(i)),remaining:a};await S(250)}return{closed:[...r],remaining:[]}}function pt(e,o){let t=e.filter(m=>m.readyState==="open"),n=t.map(m=>m.id),r=o.explicitKeepId?.trim()||"",s=o.savedKeepId?.trim()||"",a=s?t.some(m=>m.id===s):!1,i=s&&!a?s:null,l=null,c=null,d=null;if(o.closeOthers)if(r){let m=t.find(h=>h.id===r);m?l=m.id:c=r}else if(s&&a)l=s;else{let m=t.find(h=>h.isPrimary)??t[0]??null;m&&(l=m.id,s&&!a&&(d=m.id))}return{openIds:n,keepId:l,targets:c?[]:n.filter(m=>m!==l),staleSavedId:i,missingExplicitKeepId:c,fallbackKeepId:d}}async function Vt(e,o={}){let t=I(e,{port:o.port,commandTimeoutMs:o.timeoutMs,stripBooleanFlags:["--all","--others"]}),n=x(t),r=t.simId?` --sim ${t.simId}`:"",s=e.includes("--all"),a=e.includes("--others");if(s||a){try{let i=await n.listSims(),l=k(),c=t.positional[0]||(t.simIdSource==="flag"?t.simId:void 0),d=pt(i,{closeOthers:a,explicitKeepId:c,savedKeepId:l});if(d.staleSavedId&&T(),d.fallbackKeepId&&(w(d.fallbackKeepId),console.log(` saved sim ${d.staleSavedId} is gone \u2014 keeping primary ${d.fallbackKeepId}`)),d.missingExplicitKeepId&&(console.error(` close failed: keep sim ${d.missingExplicitKeepId} is not connected; not closing other sims`),process.exit(1)),d.targets.length===0){console.log(d.keepId?` nothing to close \u2014 only the kept sim ${d.keepId} is connected`:d.staleSavedId?` nothing to close \u2014 no sims connected (cleared stale current sim ${d.staleSavedId})`:" nothing to close \u2014 no sims connected");return}let m=await ut(n,t.wsPort,t.commandTimeoutMs,d.targets);await Q(i,d.targets);let h=k();h&&m.closed.includes(h)&&(d.keepId?w(d.keepId):T());let H=` closed ${m.closed.length} sim(s)${d.keepId?` (kept ${d.keepId})`:""}`;console.log(H),m.remaining.length>0&&(console.error(` close failed: still connected: ${m.remaining.join(", ")}`),process.exit(1))}catch(i){console.error(` close failed: ${i instanceof Error?i.message:String(i)}`),process.exit(1)}finally{n.close()}return}try{try{let i=await n.listSims(),l=F(i,t.positional[0]||t.simId),c=i.find(m=>m.id!==l.id&&m.readyState==="open");await n.closeSim(l.id),await it(t.wsPort,t.commandTimeoutMs,l.id)||(await Q(i,[l.id]),console.error(` close failed: ${l.id} is still connected`),process.exit(1)),await Q(i,[l.id]),k()===l.id&&(c?w(c.id):T()),console.log(` closed: ${l.id}`)}catch(i){console.error(` close failed: ${i instanceof Error?i.message:String(i)}`),await B(n,{errorsCommand:`sootsim get errors 5${r}`,warningsCommand:`sootsim get warnings 5${r}`,requestsCommand:`sootsim get requests 5${r}`}),process.exit(1)}}finally{n.close()}}export{vt as a,Le as b,St as c,Ke as d,Ht as e,Me as f,A as g,et as h,ot as i,rt as j,L as k,at as l,lt as m,Q as n,Kt as o,Wt as p,zt as q,jt as r,qt as s,ut as t,pt as u,Vt as v};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as l}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as l}from"./chunk-K4XXN32E.js";import{E as c,F as m,g as p,i as h,z as w}from"./chunk-EXURTU7U.js";import{closeSync as v,existsSync as f,openSync as P,readSync as S,statSync as g}from"fs";import{homedir as k}from"os";import{resolve as T}from"path";import{WebSocket as D}from"ws";var E=6e4;async function L(){let t=w();if(t&&f(h(t)))return;console.log(" first run \u2014 installing sootsim engine runtime (~6 MB)...");let{runRuntime:e}=await import("./runtime-U3KKUZAL.js");await e(["install"],{})}function I(t,e){return x(t)??e??l()}async function $(t=l(),e=E){if(await u(t,250)||await u(t,1500))return;let n=c();if(n&&m(n)){if(n.bootstrapping===!0&&(await b(e),await u(n.bridgePort,500)))return;throw new Error(`sootsim daemon lockfile is fresh (port ${n.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`)}if(p())throw new Error(`sootsim bridge daemon is not running on port ${t}.
|
|
3
3
|
dev checkouts skip the auto-install of the persistent launchd / systemd
|
|
4
4
|
agent. start the daemon manually in another shell with:
|
|
5
5
|
bun sootsim server
|
|
6
|
-
(set SOOTSIM_FORCE_DAEMON_INSTALL=1 to allow auto-install from this repo.)`);console.log(" registering sootsim bridge daemon...");let{daemonInstall:o}=await import("./daemon-
|
|
6
|
+
(set SOOTSIM_FORCE_DAEMON_INSTALL=1 to allow auto-install from this repo.)`);console.log(" registering sootsim bridge daemon...");let{daemonInstall:o}=await import("./daemon-NV27EDGP.js");try{await o({port:t,force:!0})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`${s}
|
|
7
7
|
if this keeps failing, run \`sootsim daemon uninstall\` and retry, or run \`sootsim server\` in a persistent shell as a workaround.`)}console.log(" waiting for runtime to come online...");let i=process.platform==="darwin"?B():null;try{await b(e);let r=Date.now()+5e3;for(;Date.now()<r;){if(await u(t,500))return;await new Promise(s=>setTimeout(s,200))}throw new Error(`daemon registered but the bridge never bound on port ${t} \u2014 see ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}finally{i?.stop()}}async function C(t=l()){await L(),await $(t)}function x(t){for(let e=0;e<t.length;e++){let n=t[e];if((n==="--port"||n==="-p")&&t[e+1]){let o=Number(t[e+1]);return Number.isFinite(o)?o:void 0}if(n.startsWith("--port=")){let o=Number(n.slice(7));return Number.isFinite(o)?o:void 0}}}function u(t,e){return new Promise(n=>{let o=new D(`ws://127.0.0.1:${t}`,{handshakeTimeout:e}),i=!1,r=s=>{if(!i){i=!0;try{o.close()}catch{}n(s)}};o.once("open",()=>r(!0)),o.once("error",()=>r(!1)),setTimeout(()=>r(!1),e)})}async function b(t){let e=Date.now()+t,n;for(;Date.now()<e;){let o=c();if(o&&m(o)){if(o.bootstrapping!==!0)return;o.bootstrapping!==n&&(n=o.bootstrapping)}await new Promise(i=>setTimeout(i,250))}throw new Error(`daemon did not finish bootstrapping within ${Math.round(t/1e3)}s \u2014 check ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}function d(){return T(k(),"Library/Logs/sootsim/server.err.log")}function B(){let t=d(),e=0;try{f(t)&&(e=g(t).size)}catch{}let n=!1,o=()=>{if(!n){try{if(f(t)){let i=g(t).size;if(i>e){let r=Buffer.alloc(i-e),s=P(t,"r");try{S(s,r,0,r.length,e)}finally{v(s)}e=i;for(let y of r.toString("utf8").split(/\r?\n/)){let a=y.trim();a&&(a.startsWith("sootsim:")||a.startsWith("sootsim "))&&console.log(` ${a}`)}}else i<e&&(e=i)}}catch{}setTimeout(o,250)}};return o(),{stop:()=>{n=!0}}}export{L as a,I as b,$ as c,C as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{createInterface as i}from"readline";var c=()=>i({input:process.stdin,output:process.stdout});function s(o){return new Promise(n=>{let r=c();r.question(o,t=>{r.close(),n(t.trim())})})}async function u(o,n=!0){let r=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${o} ${r} ${n?"y":"n"} (non-interactive)`),n;let t=await s(` ${o} ${r} `);return t===""?n:t.toLowerCase().startsWith("y")}async function a(o,n){console.log(`
|
|
3
3
|
${o}
|
|
4
4
|
`);for(let e=0;e<n.length;e++)console.log(` ${e+1}. ${n[e]}`);if(console.log(),!process.stdin.isTTY)return console.log(` choose [1-${n.length}]: 1 (non-interactive)`),0;let r=await s(` choose [1-${n.length}]: `),t=parseInt(r,10);return t>=1&&t<=n.length?t-1:0}export{u as a,a as b};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as ue,e as de,f as pe}from"./chunk-42HXBO3D.js";import{d as ce}from"./chunk-3GO4EP3V.js";import{c as ae,e as le,g as P}from"./chunk-K4XXN32E.js";import{d as ie}from"./chunk-WZEK65V5.js";import{a as se,b as T}from"./chunk-DCUMVDKC.js";import{a as oe}from"./chunk-OGV2WB2A.js";import{createHash as He}from"crypto";import{readFileSync as K}from"fs";import{gzipSync as Ce}from"zlib";function fe(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 Le,constants as Ee}from"node:zlib";var ke=9;function ge(e){return Le(e,{params:{[Ee.BROTLI_PARAM_QUALITY]:ke}})}function G(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 Ae(e){let t=G(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 Fe(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 c=e[o++];await Ae(c),i++,r?.(i,a)}}))}function ze(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 c=r.get(a.urlhash);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}e.events&&o?.eventsBytes&&i.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:o.eventsBytes}),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});for(let a of e.snapshots??[]){let c=o?.snapshotBytes?.get(a.id);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}return i}function Me(e){return e.replace(/\/+$/,"")}var F=class extends Error{constructor(r,o,i,a=""){super(r);this.status=o;this.phase=i;this.responseText=a;this.name="PresignedUploadError"}};async function he(e){let t=Me(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=G(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 p=await i.text().catch(()=>"");throw new F(`init failed: ${i.status} ${p.slice(0,200)}`,i.status,"init",p)}let a=await i.json(),c=ze(a,e.bundleBytes,e.filesByHash,e.extras);await Fe(c,e.concurrency??8,e.onPutProgress);let y=G(3e4,"finalize"),u;try{u=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:y.signal})}finally{y.cancel()}if(!u.ok){let p=await u.text().catch(()=>"");throw new F(`finalize failed: ${u.status} ${p.slice(0,200)}`,u.status,"finalize",p)}let S=await u.json();return{init:a,finalize:S}}function Ne(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 be=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",ve=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",J="http://localhost:3000",We=2e3;async function qe(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${J}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(We)});if(t.ok||t.status===204||t.status===405)return J}catch{}return be}function x(e){return e.replace(/\/$/,"")}function De(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 Ve(e){try{let t=new URL(e).hostname.toLowerCase();return t==="sootbean.com"||t.endsWith(".sootbean.com")}catch{return!1}}function Ge(e,t){return t?x(t):process.env.SOOTSIM_PREVIEW_ORIGIN?x(process.env.SOOTSIM_PREVIEW_ORIGIN):De(e)?x(e):Ve(e)?x(ve):x(e)}function Ke(){console.log(`
|
|
3
|
+
sootsim upload \u2014 publish the current recorded bundle as a /preview/<id> link
|
|
4
|
+
|
|
5
|
+
usage:
|
|
6
|
+
sootsim upload [--origin <url>] [--public-origin <url>] (--events <path> | --video <path>) [--screenshot <path>] [--owner <org> --repo <repo>] [--sim <sim>] [--open] [--assets-only]
|
|
7
|
+
|
|
8
|
+
options:
|
|
9
|
+
--origin <url> upload target (default: auto)
|
|
10
|
+
prefers ${J} when available, otherwise
|
|
11
|
+
falls back to ${be}
|
|
12
|
+
override with SOOTSIM_UPLOAD_ORIGIN env var
|
|
13
|
+
--public-origin <url>
|
|
14
|
+
public /preview link origin (default: ${ve}
|
|
15
|
+
for prod uploads, upload origin for localhost/custom origins).
|
|
16
|
+
override with SOOTSIM_PREVIEW_ORIGIN env var
|
|
17
|
+
--events <path> path to a gzipped events .jsonl.gz file to attach
|
|
18
|
+
required unless --video is present; previews must
|
|
19
|
+
have replay or recording playback data
|
|
20
|
+
--screenshot <path>
|
|
21
|
+
path to a PNG thumbnail to attach to the share
|
|
22
|
+
--video <path> path to a webm/mp4/gif flow recording. embedded inline
|
|
23
|
+
in the pr sticky comment served at
|
|
24
|
+
/api/preview/flow-video?id=<share-id>
|
|
25
|
+
--video-duration-ms <ms>
|
|
26
|
+
duration hint for attached flow video
|
|
27
|
+
--owner <org> associate a session upload with a linked org repo
|
|
28
|
+
--repo <repo> repo name for --owner; the signed-in user must belong
|
|
29
|
+
to the local/org team that owns the link
|
|
30
|
+
--sim <sim> target a specific sim (see: sootsim list)
|
|
31
|
+
--open open the resulting /preview/<id> url in the browser
|
|
32
|
+
--assets-only drop API/JSON/HTML records before upload; keep images,
|
|
33
|
+
fonts, css, js, and binary blobs. live-data demos hit
|
|
34
|
+
the real network at replay time instead of serving
|
|
35
|
+
recorded API snapshots
|
|
36
|
+
-h, --help
|
|
37
|
+
|
|
38
|
+
examples:
|
|
39
|
+
sootsim upload --events ./my-session.jsonl.gz
|
|
40
|
+
sootsim upload --origin http://localhost:3000 --events ./my-session.jsonl.gz --open
|
|
41
|
+
sootsim upload --video /tmp/soot-flow.webm --video-duration-ms 12000
|
|
42
|
+
`)}function b(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 ye(e,t){let r=e.findIndex(o=>o===t);return r<0?!1:(e.splice(r,1),!0)}function me(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 we(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 je(e){return/\.bundle($|\?)/.test(e)||/\.js($|\?)/.test(e)?"application/javascript":/\.zip($|\?)/.test(e)?"application/zip":"application/javascript"}function Je(e){try{return new URL(e).searchParams.get("appFonts")||""}catch{return""}}function Ye(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 Qe(e,t){let o=[];for(let i=0;i<t;i+=15e5){let a=Math.min(i+15e5,t),c=await P(e,`(window.__sootsimLastTransformedBundle?.text || "").slice(${i}, ${a})`);if(typeof c!="string")return null;o.push(c)}return o.join("")}function j(e){let t=new Map;for(let r of e)t.set(r.urlhash||r.url,r);return Array.from(t.values())}async function ht(e,t){(e.includes("--help")||e.includes("-h"))&&(Ke(),process.exit(0));let r=[...e],o=await qe(b(r,"--origin")),i=Ge(o,b(r,"--public-origin")),a=b(r,"--events"),c=b(r,"--screenshot"),y=b(r,"--video"),u=b(r,"--video-duration-ms"),S=b(r,"--owner"),p=b(r,"--repo"),Ue=ye(r,"--open");(S&&!p||!S&&p)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),!a&&!y&&(console.error(" preview uploads require playback data: pass --events or --video.\n for a normal local preview, use `sootsim record --mode combined --open`\n or `sootsim flow --preview` instead of uploading a bundle-only snapshot."),process.exit(1));let Y=ye(r,"--assets-only"),Be=ae(r,{stripBooleanFlags:[],stripValueFlags:[]}),v=le(Be),l,Q=[],m=[],z=null;try{if(l=await P(v,'(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'),l?.bundleUrl){let n=new URL(l.bundleUrl).origin,[s,h]=await Promise.all([P(v,`(window.__sootsimPreviewRecorder?.list?.(${JSON.stringify(n)}) || [])`),P(v,`(async () => {
|
|
43
|
+
const list = window.__sootsimListWorkerFetchRecorder
|
|
44
|
+
return typeof list === 'function'
|
|
45
|
+
? await list(${JSON.stringify(n)})
|
|
46
|
+
: []
|
|
47
|
+
})()`)]);Q=j([...s,...h]).filter(d=>{try{return!new URL(d.url).pathname.startsWith("/api/")}catch{return!0}});let L=await P(v,`(async () => {
|
|
48
|
+
const rec = window.__sootsimPreviewRecorder
|
|
49
|
+
const workerList = window.__sootsimListWorkerFetchRecorder
|
|
50
|
+
return {
|
|
51
|
+
main: rec?.list ? rec.list() : [],
|
|
52
|
+
worker: typeof workerList === 'function' ? await workerList() : [],
|
|
53
|
+
}
|
|
54
|
+
})()`),_=(L?j([...L.main,...L.worker]):[]).filter(d=>{try{return new URL(d.url).origin!==n}catch{return!1}}),B=_.length>0?{count:_.length,totalBytes:_.reduce((d,O)=>d+(O.size||0),0)}:null;if(B&&B.count>0){console.log(` ${B.count} recorded cross-origin responses (${(B.totalBytes/1024).toFixed(1)} KiB)`);let d=await P(v,`(async () => {
|
|
55
|
+
const rec = window.__sootsimPreviewRecorder
|
|
56
|
+
const workerDump = window.__sootsimDumpWorkerFetchRecorder
|
|
57
|
+
const bundleUrl = ${JSON.stringify(l.bundleUrl)}
|
|
58
|
+
const keep = (r) => {
|
|
59
|
+
try {
|
|
60
|
+
const u = new URL(r.url)
|
|
61
|
+
if (u.origin !== ${JSON.stringify(n)}) return true
|
|
62
|
+
// bundle-origin api responses came from the rewritten
|
|
63
|
+
// /__app-api proxy at record time (re-keyed by the
|
|
64
|
+
// recorder's unwrap step). they need bodies attached the
|
|
65
|
+
// same way as cross-origin records \u2014 direct re-fetch from
|
|
66
|
+
// the dev server lacks the bundle's session cookies.
|
|
67
|
+
if (r.url !== bundleUrl && u.pathname.startsWith('/api/')) return true
|
|
68
|
+
return false
|
|
69
|
+
} catch { return false }
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
main: rec?.dump ? rec.dump().filter(keep) : [],
|
|
73
|
+
worker: typeof workerDump === 'function'
|
|
74
|
+
? (await workerDump()).filter(keep)
|
|
75
|
+
: [],
|
|
76
|
+
}
|
|
77
|
+
})()`);if(m=j([...d.main,...d.worker]),Y){let O=m.length;m=m.filter(V=>me(V.contentType));let D=B.totalBytes-m.reduce((V,$e)=>V+($e.size||0),0);console.log(` --assets-only: kept ${m.length}/${O} records (dropped ${(D/1024).toFixed(1)} KiB of API responses)`)}}}l?.transformedBundle&&(z=await Qe(v,l.transformedBundle.byteLength))}finally{v.close()}l||(console.error(" could not read bundle snapshot \u2014 is sootsim running and is the bundle loaded?"),process.exit(2)),l.bundleUrl||(console.error(` no ?bundle= URL on the current sootsim tab.
|
|
78
|
+
open the app you want to share first (e.g. sootsim open 8082), then run upload.`),process.exit(2));let f,M=!1;if(z!==null)f=new TextEncoder().encode(z),M=!0,console.log(` using post-transform bundle: ${(f.byteLength/1024).toFixed(1)} KiB`);else{let n=Ye(l.bundleUrl);n!==l.bundleUrl&&console.log(" forcing lazy=false for self-contained bundle"),console.log(` capturing: ${n}`),f=await we(n),console.log(` main bundle: ${(f.byteLength/1024).toFixed(1)} KiB`)}let E=Q.filter(n=>n.url!==l.bundleUrl);Y&&(E=E.filter(n=>me(n.contentType))),console.log(` fetching ${E.length} extra files\u2026`);let k=(await Promise.all(E.map(async n=>{try{let s=await we(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),Te=k.reduce((n,s)=>n+s.bytes.byteLength,0);console.log(` ${k.length} extra files: ${(Te/1024).toFixed(1)} KiB`);let U;a&&(U=K(a));let g;c&&(g=K(c),console.log(` attaching screenshot: ${(g.byteLength/1024).toFixed(1)} KiB`));let w,A,X;if(y){if(w=K(y),A=y.endsWith(".mp4")?"video/mp4":y.endsWith(".gif")?"image/gif":"video/webm",u){let n=Number(u);(!Number.isFinite(n)||n<=0)&&(console.error(` invalid --video-duration-ms: ${u}`),await T(),process.exit(1)),X=Math.round(n)}console.log(` attaching flow video: ${(w.byteLength/1024).toFixed(1)} KiB (${A})`)}let I=ue(),R=pe(I),Pe=oe();se({event:"preview_upload_started",identity:{userId:I?.kind==="session"?Pe?.user?.id??null:null,repoId:R?.repoId??null,installationId:R?.installationId??null},properties:{origin:o,hasAuth:!!I,authMode:I?.kind??"none",bundleBytes:f.byteLength,isTransformed:M,extraFiles:k.length,recordedFetches:m.length,hasEvents:!!U,hasScreenshot:!!g,hasVideo:!!w}}),I||(console.error(" preview uploads need auth."),console.error(" set SOOTSIM_API_KEY=sk_sootsim_..., run `sootsim login`, or use the soot github runner."),await T(),process.exit(1));let Ie=de(I),Re=(()=>{try{return new URL(l.bundleUrl).origin}catch{return null}})(),H=(n,s,h,L,re,_,B,d)=>{let O=fe(_),D=O?Ce(n):n;return{url:s,urlhash:h,method:L,bodyHash:re,requestVaryHash:d,contentType:_,responseHeaders:B,bytes:D,encoding:O?"gzip":void 0}},Z=[],C=Je(l.pageHref)||"";if(C){let n=await ce(C,{onStaged:({url:s,byteLength:h})=>console.log(` staged app font: ${s} (${(h/1024).toFixed(1)} KiB)`),onError:(s,h)=>console.error(` warning: failed to fetch app font ${s}: ${h instanceof Error?h.message:h}`)});for(let s of n)Z.push(H(Buffer.from(s.bytes),s.url,s.urlhash,"GET","-",s.contentType))}let N=[...k.map(n=>H(n.bytes,n.url,n.urlhash,"GET","-",n.contentType,n.responseHeaders,n.requestVaryHash)),...m.map(n=>H(Buffer.from(n.bodyBase64,"base64"),n.url,n.urlhash,n.method||"GET",n.bodyHash||"-",n.contentType,n.responseHeaders,n.requestVaryHash)),...Z],W=ge(f),_e=He("sha256").update(f).digest("hex");console.log(` bundle raw=${(f.byteLength/1024).toFixed(1)} KiB br=${(W.byteLength/1024).toFixed(1)} KiB`);let Oe={contentHash:_e,bundleSizeBytes:f.byteLength,bundleContentType:je(l.bundleUrl),bundleEncoding:"br",bundleOrigin:Re,appFonts:C||void 0,entry:l.entry,isTransformed:M,deviceSpec:l.deviceSpec,installationId:R?.installationId??void 0,repoId:R?.repoId,owner:S??R?.owner,repo:p??R?.repo,files:N.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:U?{sizeBytes:U.byteLength}:void 0,snapshots:g?[{id:"landing",label:"Landing",kind:"landing",t:0,contentType:"image/png",sizeBytes:g.byteLength}]:void 0,flowVideo:w&&A?{sizeBytes:w.byteLength,contentType:A,durationMs:X}:void 0},ee=new Map;for(let n of N)ee.set(n.urlhash,n.bytes);let te=new Map;g&&te.set("landing",g);let xe=Date.now(),$=W.byteLength;for(let n of N)$+=n.bytes.byteLength;U&&($+=U.byteLength),g&&($+=g.byteLength),w&&($+=w.byteLength);let Se=`${x(o)}/api/preview/upload/init`;console.log(` init: ${Se}`);let q;try{let n=await he({originBase:o,initBody:Oe,bundleBytes:W,filesByHash:ee,extras:{eventsBytes:U,videoBytes:w,snapshotBytes:te},authHeader:Ie,concurrency:16});q=n.finalize;let s=1+n.init.files.length+(n.init.events?1:0)+n.init.snapshots.length+(n.init.flowVideo?1:0);console.log(` PUT ${s} objects in ${Date.now()-xe}ms (${($/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 T(),process.exit(1)),s.status===402&&(console.error(` ${Ne(s.responseText)??"preview uploads require Personal, Team, or an active trial \u2014 upgrade from the billing dialog."}`),await T(),process.exit(1)),console.error(` ${s.message??`${s.phase??"upload"} failed: ${String(n)}`}`),await T(),process.exit(1)}let ne=`${i}${q.url}`;console.log(`
|
|
79
|
+
stored ${q.filesStored??0} extra files`),console.log(` preview: ${ne}`),Ue&&await ie(ne),await T()}export{qe as a,Ge as b,ht as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-V6KDO6VC.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-4EYCEJ56.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-4EYCEJ56.js");if(k){W(k,d);return}let b=g(n,"package.json");x(b)||(console.error(" no package.json found in",n),process.exit(1));let m=JSON.parse(j(b,"utf8")),S={...m.dependencies,...m.devDependencies},t={full:[],partial:[],autoStub:[],unsupported:[],justWorks:[],unknown:[]};for(let o of Object.keys(S)){let a=d[o];if(a){let u=a.stubType==="native"?"full":a.stubType==="works"?"not-relevant":a.stubType;if(a.stubType!=="native"&&a.versions?.length){let r=Math.max(...a.versions.map(y=>y.coverage||0));u=r>=.8?"full":r>=.3?"partial":"auto-stub"}switch(u){case"full":t.full.push(o);break;case"partial":t.partial.push(o);break;case"auto-stub":t.autoStub.push(o);break;case"unsupported":t.unsupported.push(o);break;case"not-relevant":t.justWorks.push(o);break;default:f(o)&&t.unknown.push(o)}}else f(o)&&t.unknown.push(o)}console.log(`
|
|
24
24
|
sootsim compatibility report
|
|
25
25
|
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
26
26
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-V6KDO6VC.js";import{existsSync as i,writeFileSync as n,readFileSync as c}from"fs";import{resolve as t}from"path";async function a(s){let e=s[0];switch((!e||s.includes("--help")||s.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim config \u2014 manage sootsim configuration
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r,v as s}from"./chunk-Y5X2JAQW.js";import"./chunk-XIGBM3CU.js";import"./chunk-F2FRN4BS.js";import"./chunk-Y2HPGJ4G.js";import"./chunk-3GO4EP3V.js";import"./chunk-K4XXN32E.js";import"./chunk-NIZ7ULGN.js";import"./chunk-R4FZZJCE.js";import"./chunk-WS5ROBOK.js";import"./chunk-TUDCTEEP.js";import"./chunk-MRWKKUOV.js";import"./chunk-WZEK65V5.js";import"./chunk-E7OCWSNR.js";import"./chunk-OHUVIQCL.js";import"./chunk-EXURTU7U.js";import"./chunk-V6KDO6VC.js";export{e as buildOpenUrl,d as buildShellUrl,q as closeSimsBulk,r as planBulkCloseTargets,i as playwrightHostPidForSim,g as printConnectedSims,b as resolveBundleTarget,c as resolveDefaultShellBaseUrl,a as resolveDriverConnectWaitOptions,p as runClaimCommand,s as runCloseCommand,o as runFocusCommand,l as runListCommand,m as runOpenCommand,n as runUseCommand,j as signalDriverLaunchConnected,f as summarizeSimUrl,k as terminatePlaywrightHostsForSims,h as waitForSimMatch};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-V6KDO6VC.js";import{mkdirSync as $,writeFileSync as P}from"fs";import{dirname as S,resolve as O}from"path";import{WebSocket as C}from"ws";var v=e=>new Promise(i=>setTimeout(i,e)),w=class{ws;nextId=1;pending=new Map;listeners=new Set;ready;constructor(i){this.ws=new C(i,{maxPayload:1<<28}),this.ready=new Promise((t,r)=>{this.ws.once("open",()=>t()),this.ws.once("error",r)}),this.ws.on("message",t=>{let r=JSON.parse(t.toString());if(r.id&&this.pending.has(r.id)){let{res:o,rej:s}=this.pending.get(r.id);this.pending.delete(r.id),r.error?s(new Error(JSON.stringify(r.error))):o(r.result)}else if(r.method)for(let o of this.listeners)o(r.method,r.params)})}waitOpen(){return this.ready}on(i){this.listeners.add(i)}send(i,t={},r){let o=this.nextId++;return new Promise((s,p)=>{this.pending.set(o,{res:s,rej:p}),this.ws.send(JSON.stringify({id:o,method:i,params:t,...r?{sessionId:r}:{}}))})}close(){try{this.ws.close()}catch{}}};async function D(e,i){let t=Number(d(e,"--duration")??"5");if(!Number.isFinite(t)||t<=0)return console.error(" --duration must be a positive number (seconds)"),1;let r=Number(d(e,"--sample-interval")??"0.1"),o=Number(d(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=d(e,"--match")??"/rn/",p=d(e,"--output")??d(e,"-o"),u=O(process.cwd(),p??"/tmp/sootsim.cpuprofile"),g=[];try{g=await(await fetch(`http://localhost:${o}/json/list`)).json()}catch{return T(o),1}let y=g.find(a=>a.type==="page"&&a.url.includes(s));if(!y)return console.error(` no page target matching "${s}" on CDP :${o}`),console.error(` open targets: ${g.map(a=>a.url).join(", ")||"(none)"}`),1;let c=new w(y.webSocketDebuggerUrl);await c.waitOpen();try{let a=new Map;if(c.on((n,l)=>{n==="Target.attachedToTarget"&&l.targetInfo?.type==="worker"&&a.set(l.sessionId,l.targetInfo.url),n==="Target.detachedFromTarget"&&a.delete(l.sessionId)}),await c.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),await v(500),a.size===0)return console.error(" no worker targets attached \u2014 is the app loaded in this tab?"),1;for(let n of a.keys())await c.send("Profiler.enable",{},n),await c.send("Profiler.setSamplingInterval",{interval:r*1e3},n),await c.send("Profiler.start",{},n);console.log(` recording ${t}s across ${a.size} worker(s) \u2014 interact now\u2026`),await v(t*1e3);let m=[];for(let[n,l]of a){let{profile:f}=await c.send("Profiler.stop",{},n);m.push({url:l,profile:f})}return m.sort((n,l)=>l.profile.samples.length-n.profile.samples.length),$(S(u),{recursive:!0}),m.forEach((n,l)=>{let f=l===0?u:u.replace(/(\.[^.]+)?$/,`.worker${l}$1`);if(P(f,JSON.stringify(n.profile)),console.log(` ${b(n.url)}: ${n.profile.samples.length} samples \u2192 ${f}`),i.verbose&&n.profile.samples.length>0)for(let h of k(n.profile,12))console.log(` ${h.pct.toFixed(1).padStart(5)}% ${h.name} ${h.url}`)}),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}finally{c.close()}}function T(e){console.error(` cpu-profile needs a CDP-enabled browser on :${e}.`),console.error(" the tenant worker can't be profiled via the JS Self-Profiler API (F28),"),console.error(" so the sim must expose Chrome remote debugging. easiest path \u2014"),console.error(" open the sim with a CDP port (it stays driveable over the bridge,"),console.error(" so you can scroll/navigate while profiling):"),console.error(""),console.error(` sootsim open <metro-port> --new --driver playwright --cdp-port ${e}`),console.error(` sootsim cpu-profile --cdp-port ${e} --match <metro-port>`),console.error(""),console.error(" or launch a standalone CDP Chrome (not bridge-driveable):"),console.error(""),console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\'),console.error(` --remote-debugging-port=${e} --user-data-dir=/tmp/sootsim-cdp \\`),console.error(" --no-sandbox --disable-gpu-sandbox --in-process-gpu \\"),console.error(" --use-gl=angle --use-angle=swiftshader --enable-unsafe-swiftshader \\"),console.error(' "http://localhost:5173/rn/<metro-port>" &'),console.error(""),console.error(" override the port with --cdp-port or $SOOTSIM_CDP_PORT.")}function b(e){return e?e.replace(/^https?:\/\/[^/]+/,"").replace(/\?.*$/,"").slice(-50):"(native)"}function k(e,i){let t=e.samples.length||1,r=new Map;for(let o of e.nodes){let s=o.callFrame,p=`${s.functionName||"(anonymous)"}@${b(s.url)}:${s.lineNumber}`,u=r.get(p)??{self:0,name:s.functionName||"(anonymous)",url:`${b(s.url)}:${s.lineNumber}`};u.self+=o.hitCount??0,r.set(p,u)}return[...r.values()].map(o=>({...o,pct:o.self/t*100})).sort((o,s)=>s.self-o.self).slice(0,i)}function d(e,i){let t=e.indexOf(i);if(!(t<0||t===e.length-1))return e[t+1]}export{D as runCpuProfile};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as T,b as N}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as T,b as N}from"./chunk-DCUMVDKC.js";import"./chunk-OGV2WB2A.js";import{c as O}from"./chunk-62NWWBSE.js";import"./chunk-V5QLLAJ5.js";import"./chunk-JMY3WQVI.js";import"./chunk-E7OCWSNR.js";import"./chunk-OHUVIQCL.js";import"./chunk-TSAEJ7KF.js";import"./chunk-6AFMCXLK.js";import"./chunk-POAO7C3D.js";import{g as I,o as C,p as w,q as B}from"./chunk-EXURTU7U.js";import{a as W}from"./chunk-V6KDO6VC.js";import{execFileSync as et,spawnSync as s}from"child_process";import{existsSync as c,mkdirSync as v,readFileSync as rt,rmSync as S,writeFileSync as U}from"fs";import{homedir as $}from"os";import{dirname as M,resolve as m}from"path";import{execFileSync as Y}from"child_process";import{chmodSync as K,mkdirSync as E,rmSync as X,writeFileSync as L}from"fs";import{dirname as D}from"path";var Q="dev.sootsim.daemon",_="SootSim Daemon",R="0.1.36";function F(t,e,r){let o=w(),n=B(),a=D(D(n)),y=D(n),u=`${a}/Resources`;X(o,{recursive:!0,force:!0}),E(C(),{recursive:!0}),E(y,{recursive:!0}),E(u,{recursive:!0}),L(`${a}/Info.plist`,z()),L(`${a}/PkgInfo`,"APPL????"),L(n,J(t,e,r)),K(n,493);try{Y("codesign",["--force","--sign","-","--deep",o],{stdio:"pipe"})}catch(i){let d=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${o} failed: ${d}
|
|
3
3
|
the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:o,launcherPath:n}}function z(){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
4
4
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
5
5
|
<plist version="1.0">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{f,m as T}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{f,m as T}from"./chunk-F2FRN4BS.js";import{F as A,G as D,H as O,I as x,J as v}from"./chunk-Y2HPGJ4G.js";import{c as S,e as $,g as N}from"./chunk-K4XXN32E.js";import"./chunk-NIZ7ULGN.js";import"./chunk-OHUVIQCL.js";import"./chunk-EXURTU7U.js";import"./chunk-V6KDO6VC.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
|
|
3
3
|
sootsim debug \u2014 drive __sootsimDebug from the terminal
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -167,7 +167,7 @@ examples:
|
|
|
167
167
|
} : null,
|
|
168
168
|
samples,
|
|
169
169
|
}
|
|
170
|
-
})()`}async function c(i,l){return N(i,l)}async function Y(i,l){let g=S(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-
|
|
170
|
+
})()`}async function c(i,l){return N(i,l)}async function Y(i,l){let g=S(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-G7NIE5BP.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=$(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
|
|
171
171
|
known: ${H.join(", ")}`),process.exit(1));let o=await v(t,"enable",e);console.log(a({active:o},n));break}case"disable":{let e=B(r[0]),o=await v(t,"disable",e);console.log(a({active:o},n));break}case"toggle":{let e=r[0];e||(console.error(" usage: sootsim debug toggle <channel>"),process.exit(1));let o=await c(t,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(a({[e]:o},n));break}case"status":{let e=await A(t);console.log(a(e,n));break}case"channels":{let e=await c(t,"window.__sootsimDebug.channels()");console.log(a(e,n));break}case"flags":{let e=await D(t);console.log(a(e,n));break}case"snapshot":{let e=r[0],o=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",s=await c(t,`(() => { const s = ${o}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(a(s,n));break}case"snapshots":{let e=await c(t,"window.__sootsimDebug.snapshots()");console.log(a(e,n));break}case"diff":{let e=r[0],o=r[1];(!e||!o)&&(console.error(" usage: sootsim debug diff <labelA> <labelB>"),process.exit(1));let s=`(() => {
|
|
172
172
|
const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(o)});
|
|
173
173
|
if (!d) return null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as S}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as S}from"./chunk-FPPN5R3O.js";import"./chunk-55WE67F7.js";import"./chunk-PN4SUDA4.js";import"./chunk-DZOFIX63.js";import"./chunk-YMWMVHV7.js";import"./chunk-42HXBO3D.js";import"./chunk-XXG34ZL6.js";import"./chunk-Y5X2JAQW.js";import"./chunk-XIGBM3CU.js";import"./chunk-F2FRN4BS.js";import"./chunk-Y2HPGJ4G.js";import"./chunk-3GO4EP3V.js";import"./chunk-K4XXN32E.js";import"./chunk-NIZ7ULGN.js";import"./chunk-R4FZZJCE.js";import"./chunk-WS5ROBOK.js";import"./chunk-TUDCTEEP.js";import"./chunk-MRWKKUOV.js";import"./chunk-WZEK65V5.js";import"./chunk-DCUMVDKC.js";import"./chunk-OGV2WB2A.js";import"./chunk-V5QLLAJ5.js";import"./chunk-E7OCWSNR.js";import"./chunk-OHUVIQCL.js";import"./chunk-R56NPO3Q.js";import"./chunk-POAO7C3D.js";import"./chunk-EXURTU7U.js";import"./chunk-V6KDO6VC.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.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-PN4SUDA4.js";import{c as d,e as l,h as a}from"./chunk-K4XXN32E.js";import"./chunk-NIZ7ULGN.js";import"./chunk-V5QLLAJ5.js";import"./chunk-OHUVIQCL.js";import"./chunk-R56NPO3Q.js";import{f as c,g as r,h as g}from"./chunk-POAO7C3D.js";import"./chunk-EXURTU7U.js";import"./chunk-V6KDO6VC.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,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{c as E,e as R,h as b}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as E,e as R,h as b}from"./chunk-K4XXN32E.js";import{b as v}from"./chunk-NIZ7ULGN.js";import"./chunk-OHUVIQCL.js";import"./chunk-EXURTU7U.js";import"./chunk-V6KDO6VC.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
3
|
sootsim diagnose \u2014 compact "what just went wrong?" report
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-GXJPQFGG.js";import{a,b,c,d,e,f,g,h,i}from"./chunk-R4FZZJCE.js";import"./chunk-WS5ROBOK.js";import"./chunk-TUDCTEEP.js";import"./chunk-MRWKKUOV.js";import"./chunk-WZEK65V5.js";import"./chunk-EXURTU7U.js";import"./chunk-V6KDO6VC.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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as g}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as g}from"./chunk-YMUC7AAA.js";import"./chunk-GXJPQFGG.js";import{a as v,g as h}from"./chunk-Y5X2JAQW.js";import"./chunk-XIGBM3CU.js";import"./chunk-F2FRN4BS.js";import"./chunk-Y2HPGJ4G.js";import"./chunk-3GO4EP3V.js";import"./chunk-K4XXN32E.js";import"./chunk-NIZ7ULGN.js";import{b as f,g as u}from"./chunk-R4FZZJCE.js";import{a as p}from"./chunk-WS5ROBOK.js";import"./chunk-TUDCTEEP.js";import{c as m}from"./chunk-MRWKKUOV.js";import"./chunk-WZEK65V5.js";import"./chunk-E7OCWSNR.js";import"./chunk-OHUVIQCL.js";import"./chunk-EXURTU7U.js";import"./chunk-V6KDO6VC.js";function b(e){let r=e.indexOf("--port");if(r<0)return;let o=e[r+1],i=o?Number(o):Number.NaN;return(!Number.isInteger(i)||i<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),i}async function O(e,r){let o=b(e)??r.port;return o?h(String(o)):void 0}async function $(e,r){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim electron \u2014 launch the desktop companion
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -15,4 +15,4 @@ examples:
|
|
|
15
15
|
sootsim electron
|
|
16
16
|
sootsim electron --port 5173
|
|
17
17
|
sootsim electron --profile qa
|
|
18
|
-
`),process.exit(0));let o=e.indexOf("--driver"),i=o>=0?e[o+1]:void 0,t=e.find((n,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");t&&d&&(console.error(" sootsim electron: --profile cannot be combined with --ephemeral"),process.exit(1));let x=t?m(t).id:void 0,s=i||r.driver,l=f;if(s){let n=u(s);n||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=n}if(l.id==="electron"){let n=p();if(!n){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await g("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:I}=await import("./install-desktop-
|
|
18
|
+
`),process.exit(0));let o=e.indexOf("--driver"),i=o>=0?e[o+1]:void 0,t=e.find((n,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");t&&d&&(console.error(" sootsim electron: --profile cannot be combined with --ephemeral"),process.exit(1));let x=t?m(t).id:void 0,s=i||r.driver,l=f;if(s){let n=u(s);n||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=n}if(l.id==="electron"){let n=p();if(!n){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await g("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:I}=await import("./install-desktop-7RAKOAYK.js");await I(["--yes"]),n=p()}n||process.exit(1)}console.log(` launching ${n.path}`)}let w=await O(e,r),c=await l.launch({url:w,device:r.device,profileId:x,ephemeralProfile:d});c.launched||(console.error(` ${c.message}`),process.exit(1)),console.log(` ${c.message}`)}export{O as resolveElectronLaunchUrl,$ as runElectron};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as c,b as d,c as e,d as f}from"./chunk-FPPN5R3O.js";import"./chunk-55WE67F7.js";import"./chunk-PN4SUDA4.js";import"./chunk-DZOFIX63.js";import"./chunk-YMWMVHV7.js";import"./chunk-42HXBO3D.js";import{d as a,e as b}from"./chunk-XXG34ZL6.js";import"./chunk-Y5X2JAQW.js";import"./chunk-XIGBM3CU.js";import"./chunk-F2FRN4BS.js";import"./chunk-Y2HPGJ4G.js";import"./chunk-3GO4EP3V.js";import"./chunk-K4XXN32E.js";import"./chunk-NIZ7ULGN.js";import"./chunk-R4FZZJCE.js";import"./chunk-WS5ROBOK.js";import"./chunk-TUDCTEEP.js";import"./chunk-MRWKKUOV.js";import"./chunk-WZEK65V5.js";import"./chunk-DCUMVDKC.js";import"./chunk-OGV2WB2A.js";import"./chunk-V5QLLAJ5.js";import"./chunk-E7OCWSNR.js";import"./chunk-OHUVIQCL.js";import"./chunk-R56NPO3Q.js";import"./chunk-POAO7C3D.js";import"./chunk-EXURTU7U.js";import"./chunk-V6KDO6VC.js";export{c as discoverSootsimUrl,e as hoistLeadingSimFlag,a as parseFlowFile,f as runFlow,d as runFlowPlayback,b as validateFlowFile};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c}from"./chunk-62NWWBSE.js";import"./chunk-V5QLLAJ5.js";import"./chunk-JMY3WQVI.js";import"./chunk-E7OCWSNR.js";import"./chunk-OHUVIQCL.js";import"./chunk-TSAEJ7KF.js";import"./chunk-6AFMCXLK.js";import"./chunk-POAO7C3D.js";import"./chunk-EXURTU7U.js";import"./chunk-V6KDO6VC.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as n,c as r,d as l}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as n,c as r,d as l}from"./chunk-UKOGGUHF.js";import"./chunk-NIZ7ULGN.js";import"./chunk-V6KDO6VC.js";function a(t){let s=t[0]??"list";if(s==="reset"){t[1]==="global"?(r(),console.log(" cleared global hint state")):(n(),console.log(" cleared hint state for this CLI identity"));return}if(s==="list"){let e=l();if(!e.length){console.log(" no hints registered");return}let i=Math.max(...e.map(o=>o.id.length));console.log(" registered hints:");for(let o of e){let c=typeof o.frequency=="string"?o.frequency:`cooldown ${o.frequency.cooldownMs}ms`;console.log(` ${o.id.padEnd(i)} ${c}`)}console.log(""),console.log(" env overrides:"),console.log(" SOOTSIM_HINTS=off suppress all hints"),console.log(" SOOTSIM_HINTS=always show every hint every time");return}console.error(` unknown subcommand: ${s}`),console.error(" usage:"),console.error(" sootsim hints list show registered hints"),console.error(" sootsim hints reset [global] clear shown-state"),process.exit(1)}export{a as runHints};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A,B,C,D,E,F,G,H,I,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.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A,B,C,D,E,F,G,H,I,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-EXURTU7U.js";import"./chunk-V6KDO6VC.js";export{b as ACTIVE_RUNTIME_FILE,d as CONFIG_FILE,e as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,a as SOOTSIM_HOME_ENV,D as activeRuntimeDir,j as activeRuntimeFile,r as cacheDir,H as claimDaemonLockfile,C as compareSemver,t as configFilePath,p as daemonAppBundlePath,o as daemonAppDir,q as daemonAppLauncherPath,s as daemonLockfilePath,k as electronDir,l as electronUserDataDir,m as electronVersionDir,y as ensureSootsimHome,F as isDaemonLockfileFresh,g as isSootsimDevCheckout,B as listInstalledRuntimes,n as profilesDir,z as readActiveRuntime,E as readDaemonLockfile,u as readSharedConfig,w as readTelemetryEnabled,I as removeDaemonLockfile,i as runtimeDir,h as runtimesDir,f as sootsimHomeDir,A as writeActiveRuntime,G as writeDaemonLockfile,v as writeSharedConfig,x as writeTelemetryEnabled};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as G}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as G}from"./chunk-UKOGGUHF.js";import{a as yt,b as ht}from"./chunk-LNZKXZNK.js";import{a as Ke,h as we,k as ee}from"./chunk-XXG34ZL6.js";import{b as bt,c as wt,j as xt}from"./chunk-Y5X2JAQW.js";import"./chunk-XIGBM3CU.js";import{a as Z,b as R,c as E,d as Ae,e as re,f as Y,g as be,h as me,i as pt,j as ft,k as Oe,l as gt}from"./chunk-F2FRN4BS.js";import{B as dt,D as le,E as ut,K as mt,a as he,b as ze,c as Ye,d as Ge,e as Xe,f as Ve,g as Qe,h as Ze,i as Ne,j as Fe,n as _e,o as et,p as tt,q as ot,r as st,s as nt,t as rt,u as it,v as at,w as lt,x as ct}from"./chunk-Y2HPGJ4G.js";import"./chunk-3GO4EP3V.js";import{c as We,e as qe,f as He,g as Ue,h as Ie}from"./chunk-K4XXN32E.js";import{b as Le}from"./chunk-NIZ7ULGN.js";import"./chunk-R4FZZJCE.js";import"./chunk-WS5ROBOK.js";import"./chunk-TUDCTEEP.js";import"./chunk-MRWKKUOV.js";import"./chunk-WZEK65V5.js";import{a as je}from"./chunk-LV2K3MAD.js";import{a as Te,c as Me}from"./chunk-JMY3WQVI.js";import{a as Je}from"./chunk-E7OCWSNR.js";import"./chunk-OHUVIQCL.js";import"./chunk-EXURTU7U.js";import"./chunk-V6KDO6VC.js";import{existsSync as ro,mkdirSync as io,readFileSync as ao,rmSync as $t,writeFileSync as lo}from"fs";import{tmpdir as co}from"os";import{dirname as uo,join as mo,resolve as po}from"path";var pe=1,fo="SOOTSIM_INSPECT_NOTICE_PATH",go=300*1e3,yo=15e3;function St(){return po(process.env[fo]||mo(co(),"sootsim-inspect-notice-state.json"))}function ho(e,c){return Object.fromEntries(Object.entries(e).filter(([,n])=>typeof n?.signature=="string"&&Number.isFinite(n?.updatedAt)&&c-n.updatedAt<=go))}function bo(e){let c=St();if(!ro(c))return{version:pe,entries:{}};try{let n=JSON.parse(ao(c,"utf8"));return n.version!==pe||!n.entries||typeof n.entries!="object"?($t(c,{force:!0}),{version:pe,entries:{}}):{version:pe,entries:ho(n.entries,e)}}catch{return $t(c,{force:!0}),{version:pe,entries:{}}}}function wo(e){let c=St();io(uo(c),{recursive:!0}),lo(c,JSON.stringify(e,null,2)+`
|
|
3
3
|
`)}function xo(e,c){let n=c.trim()||"default";return`${e}:${n}`}function Pe(e,c,n,l={}){let m=l.nowMs??Date.now(),a=l.cooldownMs??yo,g=bo(m),y=xo(e,c),T=g.entries[y];return T&&T.signature===n&&m-T.updatedAt<a?!1:(g.entries[y]={signature:n,updatedAt:m},wo(g),!0)}var $o={initialWaitMs:3e3,deadlineMs:5e3,retryWaitMs:700},So={initialWaitMs:1200,deadlineMs:2500,retryWaitMs:700};function vo(e,c={}){return{...e?$o:So,...c}}function ce(e){return!(!e||e.hit===!1||e.ok===!1||e.pointerTapHandled===!1&&!e.keyboardOpened&&!e.isTextInput)}function ko(e,c){return{id:e.target?.id??e.match?.id??e.node?.id??null,testID:e.target?.testID??e.match?.testID??e.node?.testID??null,text:e.target?.text??e.target?.accessibilityLabel??e.match?.text??e.match?.accessibilityLabel??e.node?.text??c??null,type:e.target?.type??e.match?.type??e.node?.type??null}}async function fe(e,c){let n=vo(!!c.agent,c.timing),l=0,m=null,a=null;try{await ee({bridge:e,maxMs:n.initialWaitMs,pollMs:32,stablePolls:2})}catch{}let g=Date.now()+n.deadlineMs;for(;Date.now()<=g||l===0;){l++;let y=await c.resolve();if(m=y,y?.error==="bridge-not-ready"||y?.ambiguous||y?.nthOutOfRange)return{payload:y,result:null,attempts:l,failure:"special"};if(y&&typeof y.cx=="number"&&typeof y.cy=="number"){let M=await e.send({type:"tap",x:y.cx,y:y.cy,target:ko(y,c.textFallback)});if(a=M,ce(M))return{payload:y,result:M,attempts:l}}let T=g-Date.now();if(T<=0)break;try{await ee({bridge:e,maxMs:Math.min(T,n.retryWaitMs),pollMs:32,stablePolls:2})}catch{await new Promise(M=>setTimeout(M,Math.min(120,T)))}}return{payload:m,result:a,attempts:l,failure:m&&typeof m.cx=="number"?"missed":"not-found"}}async function vt(e,c,n,l){return e.send({type:"tap",x:c,y:n,...l?{target:l}:{}})}async function kt(e,c,n={}){let l=JSON.stringify(c);return fe(e,{agent:n.agent,timing:n.timing,resolve:()=>e.send({type:"evaluate",code:`(async () => {
|
|
4
4
|
const t = window.__sootsimTest
|
|
5
5
|
if (!t) return null
|
|
@@ -314,7 +314,7 @@ import{a as G}from"./chunk-XRBI3TG2.js";import{a as yt,b as ht}from"./chunk-CUHT
|
|
|
314
314
|
`);console.log(`${t??""}
|
|
315
315
|
|
|
316
316
|
${s}
|
|
317
|
-
`),process.exit(0)}let _=m.wsPort,I=m.simId,O=m.simIdSource,j=m.commandTimeoutMs;if(g==="list"&&l.some(o=>o==="--drivers"||o==="-D")){let{buildDriverListRows:o}=await import("./drivers-
|
|
317
|
+
`),process.exit(0)}let _=m.wsPort,I=m.simId,O=m.simIdSource,j=m.commandTimeoutMs;if(g==="list"&&l.some(o=>o==="--drivers"||o==="-D")){let{buildDriverListRows:o}=await import("./drivers-H4UEDBRW.js"),t=o();console.log(` available drivers (${t.length}):
|
|
318
318
|
`);let s=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 u=i.available?"\u2713":"\u2717",p=i.id.padEnd(s),w=i.kind.padEnd(r);console.log(` ${u} ${p} ${w} ${i.description}`),i.available&&i.detail?console.log(` ${i.detail}`):!i.available&&i.reason&&console.log(` unavailable: ${i.reason}`)}return}let d=qe(m),z=I||"default",B=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","list","wait","sleep"]),C=200;function V(o){let t=o.replace(/\s+/g," ").trim();if(!t)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(t)){let r=/<title[^>]*>([^<]+)<\/title>/i.exec(o)?.[1]?.trim(),i=/<body[^>]*>([\s\S]*?)<\//i.exec(o)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),u=r||i||"html error page";return`<html ${o.length}B> "${u}" (body elided \u2014 add --json for the full payload)`}return t.length<=C?t:`${t.slice(0,C)}\u2026 (+${t.length-C} more bytes)`}function te(o){let t=o.displayUrl||o.url;return o.status!=null?`${o.method} ${t} -> ${o.status}${o.statusText?` ${o.statusText}`:""}`:o.error?`${o.method} ${t} -> ${o.error}`:`${o.method} ${t}`}async function S(o){let t=de()?5e3:1500;try{let{settled:s,elapsed:r}=await ee({bridge:o,maxMs:t,pollMs:32,stablePolls:2});s||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.
|
|
319
319
|
`)}catch{}}function N(o,t){console.error(` tap failed: ${o} 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 L(){try{return await d.send({type:"evaluate",code:`(() => ({
|
|
320
320
|
console: window.__sootsimConsole?.count?.() || null,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.117 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as o}from"./chunk-JB5RCBEY.js";import"./chunk-YMUC7AAA.js";import"./chunk-YFJI33N4.js";import"./chunk-K4XXN32E.js";import"./chunk-NIZ7ULGN.js";import"./chunk-DCUMVDKC.js";import"./chunk-OGV2WB2A.js";import"./chunk-OHUVIQCL.js";import"./chunk-EXURTU7U.js";import"./chunk-V6KDO6VC.js";async function t(n){console.error(" note: `sootsim install` is now `sootsim setup-repo`. forwarding\u2026\n"),await o(n)}export{t as runInstall};
|