sootsim 0.1.41 → 0.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cli/bin.js +4 -4
- package/dist-cli/chunks/{agent-7BJ2ZP22.js → agent-4BBZUWD2.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-OXBYRJVT.js → agent-wrapper-TA5GG3MV.js} +2 -2
- package/dist-cli/chunks/{assert-NZTYFTTT.js → assert-7GHUOGLI.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-7BJDOYUU.js +2 -0
- package/dist-cli/chunks/beta-2LIEPFEJ.js +2 -0
- package/dist-cli/chunks/{chunk-ANDSHXLU.js → chunk-2GKZS2ZZ.js} +2 -2
- package/dist-cli/chunks/chunk-2XCCV7J3.js +2 -0
- package/dist-cli/chunks/{chunk-LX6KS6TL.js → chunk-3PN6HIAM.js} +1 -1
- package/dist-cli/chunks/{chunk-OPDPXAYA.js → chunk-4574AJAK.js} +2 -2
- package/dist-cli/chunks/{chunk-AOYBIMKL.js → chunk-543BSGQG.js} +1 -1
- package/dist-cli/chunks/{chunk-GB3G5LVB.js → chunk-5EBERDK7.js} +1 -1
- package/dist-cli/chunks/{chunk-GI7FXE7J.js → chunk-5PZPKGUJ.js} +2 -2
- package/dist-cli/chunks/{chunk-SHHUVGL2.js → chunk-5TRJK5SO.js} +1 -1
- package/dist-cli/chunks/chunk-64AKKWVB.js +1 -0
- package/dist-cli/chunks/{chunk-J3JJRXIP.js → chunk-6MYXKMLG.js} +1 -1
- package/dist-cli/chunks/{chunk-7YZJHZ7X.js → chunk-6R3CVNXC.js} +1 -1
- package/dist-cli/chunks/chunk-76WF7UIG.js +17 -0
- package/dist-cli/chunks/{chunk-IP2MARRU.js → chunk-A2R42ONP.js} +2 -2
- package/dist-cli/chunks/{chunk-Y2YNXUBT.js → chunk-BBRAYGDX.js} +2 -2
- package/dist-cli/chunks/{chunk-IF33CQL4.js → chunk-BVCZIJ2X.js} +2 -2
- package/dist-cli/chunks/{chunk-NZ5O2OEL.js → chunk-BZFKV7CT.js} +2 -2
- package/dist-cli/chunks/{chunk-HAVQS3PI.js → chunk-CZZDYQBA.js} +1 -1
- package/dist-cli/chunks/{chunk-SWHWVYZS.js → chunk-D5TKAFJ3.js} +1 -1
- package/dist-cli/chunks/{chunk-LMNB7NYI.js → chunk-DNSKIJSB.js} +2 -2
- package/dist-cli/chunks/{chunk-C4AMFYK3.js → chunk-DUVJOJTP.js} +1 -1
- package/dist-cli/chunks/{chunk-GOFKXREQ.js → chunk-DXQKMDX2.js} +2 -2
- package/dist-cli/chunks/{chunk-WZDE344I.js → chunk-EDXBJUHH.js} +3 -3
- package/dist-cli/chunks/chunk-EZGUKWD5.js +1 -0
- package/dist-cli/chunks/{chunk-2T6UOHPO.js → chunk-FDB3P2GV.js} +1 -1
- package/dist-cli/chunks/{chunk-FZB4W23Y.js → chunk-I4LBW6ED.js} +2 -2
- package/dist-cli/chunks/chunk-IFY75LQ3.js +1 -0
- package/dist-cli/chunks/{chunk-S3SQITOO.js → chunk-ITQGNQE3.js} +2 -2
- package/dist-cli/chunks/{chunk-TBIGAH3T.js → chunk-J6HT2ZJW.js} +1 -1
- package/dist-cli/chunks/{chunk-Q6DGMQ2V.js → chunk-KQN7OUQ6.js} +2 -2
- package/dist-cli/chunks/{chunk-33R6QMNO.js → chunk-L53QRCQZ.js} +1 -1
- package/dist-cli/chunks/{chunk-MBGNDWGV.js → chunk-LAOTVMTO.js} +2 -2
- package/dist-cli/chunks/chunk-LJLRHMLK.js +1 -0
- package/dist-cli/chunks/{chunk-5JOYGXCS.js → chunk-LXZK2TIS.js} +2 -2
- package/dist-cli/chunks/{chunk-HZVPHAJX.js → chunk-MQOJIYEY.js} +9 -9
- package/dist-cli/chunks/{chunk-UNJTJDZZ.js → chunk-NLYIKZIF.js} +2 -2
- package/dist-cli/chunks/{chunk-4UA6P3T2.js → chunk-Q26NNL4G.js} +1 -1
- package/dist-cli/chunks/{chunk-BR6QRN7U.js → chunk-QLGR4M5H.js} +2 -2
- package/dist-cli/chunks/{chunk-OXTFYLZJ.js → chunk-QWGMNIWG.js} +2 -2
- package/dist-cli/chunks/chunk-R3KU3IBN.js +117 -0
- package/dist-cli/chunks/{chunk-I5Y4IECP.js → chunk-SGBD3EAX.js} +3 -3
- package/dist-cli/chunks/{chunk-N7DDNZTO.js → chunk-UY6HKNEV.js} +1 -1
- package/dist-cli/chunks/{chunk-OJFHAMXD.js → chunk-WSISSPE3.js} +2 -2
- package/dist-cli/chunks/{chunk-G2QUPNHI.js → chunk-WW4G4D4A.js} +2 -2
- package/dist-cli/chunks/{chunk-ECIRRKKE.js → chunk-Y4ENWAOJ.js} +2 -2
- package/dist-cli/chunks/{compat-BA6HDW3Q.js → compat-GWIATWPP.js} +3 -3
- package/dist-cli/chunks/{config-QQ63IS5P.js → config-OXHJXY6N.js} +2 -2
- package/dist-cli/chunks/control-HJ2RPHYO.js +2 -0
- package/dist-cli/chunks/{cpu-profile-3DDV2SYN.js → cpu-profile-MBYPGUJH.js} +2 -2
- package/dist-cli/chunks/{daemon-RYSVONEV.js → daemon-3N3QWMFU.js} +2 -2
- package/dist-cli/chunks/{debug-YXE4XZLP.js → debug-POCRM56I.js} +3 -3
- package/dist-cli/chunks/demo-app-registry-XABEINTD.js +2 -0
- package/dist-cli/chunks/{detox-2UI3EAXA.js → detox-4NXKQ2CS.js} +2 -2
- package/dist-cli/chunks/{device-UGDJBZKD.js → device-DURJHKK5.js} +2 -2
- package/dist-cli/chunks/{diagnose-IRDRYKYZ.js → diagnose-IMXDGRVA.js} +2 -2
- package/dist-cli/chunks/drivers-VXSNI7K2.js +2 -0
- package/dist-cli/chunks/{electron-ZCYWIZAE.js → electron-NGWA52N6.js} +3 -3
- package/dist-cli/chunks/flow-TCG5XPDK.js +2 -0
- package/dist-cli/chunks/{hints-OWOBCWJH.js → hints-5UNZ7BR2.js} +2 -2
- package/dist-cli/chunks/{home-paths-5QMCFTBP.js → home-paths-TENEFM4L.js} +2 -2
- package/dist-cli/chunks/{inspect-K4VXPM5J.js → inspect-IWMH6MUT.js} +3 -3
- package/dist-cli/chunks/install-IKBAY4PQ.js +2 -0
- package/dist-cli/chunks/{install-desktop-U3723T63.js → install-desktop-ABAWCLFJ.js} +3 -3
- package/dist-cli/chunks/{keys-IFVXJ7C2.js → keys-NET26VLH.js} +2 -2
- package/dist-cli/chunks/{launch-NDGFTRZ5.js → launch-TKIA4RC4.js} +3 -3
- package/dist-cli/chunks/{login-KEU6RAV3.js → login-AWT3GU5M.js} +4 -4
- package/dist-cli/chunks/{logout-KNFLP5OQ.js → logout-R2RUNXHO.js} +2 -2
- package/dist-cli/chunks/{maestro-GBUBLS6L.js → maestro-552237HC.js} +2 -2
- package/dist-cli/chunks/{preview-7OKMPPMN.js → preview-GKIGPZUO.js} +2 -2
- package/dist-cli/chunks/{profile-CHKDPGJF.js → profile-U64JPCPD.js} +2 -2
- package/dist-cli/chunks/{react-GYI5VITJ.js → react-FWSV5JH2.js} +2 -2
- package/dist-cli/chunks/record-FLWDPJIP.js +7 -0
- package/dist-cli/chunks/runtime-AGNC2TK6.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-JCAY2QVQ.js → runtime-delivery-22PV7UED.js} +2 -2
- package/dist-cli/chunks/{screenshot-3T6MNPH7.js → screenshot-4P3TL7CN.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-BUGXY7SQ.js → screenshot-mode-GX3Q3IZ6.js} +2 -2
- package/dist-cli/chunks/{screenshots-EMTXGI2Q.js → screenshots-5HSLPDWZ.js} +2 -2
- package/dist-cli/chunks/{server-46H2M4TF.js → server-Q3ZD4BEF.js} +2 -2
- package/dist-cli/chunks/setup-repo-NQVN5PK7.js +2 -0
- package/dist-cli/chunks/{skills-2RP2CFPD.js → skills-M2CWX5ZC.js} +2 -2
- package/dist-cli/chunks/{start-QFREXALP.js → start-24EAF2KS.js} +4 -4
- package/dist-cli/chunks/store-GI3SJOKH.js +2 -0
- package/dist-cli/chunks/telemetry-73Z4FAUH.js +2 -0
- package/dist-cli/chunks/{test-LI4PGGTE.js → test-AJBULIVR.js} +3 -3
- package/dist-cli/chunks/{three-mode-PKINB46T.js → three-mode-JBZSQQIQ.js} +2 -2
- package/dist-cli/chunks/{timeline-5AREJDL5.js → timeline-VVGWQSVU.js} +2 -2
- package/dist-cli/chunks/{upgrade-W2AGIOSC.js → upgrade-IOGHQT7J.js} +2 -2
- package/dist-cli/chunks/upload-Z4PPGOX6.js +2 -0
- package/dist-cli/chunks/{web-JM6WDSZQ.js → web-XIMVN6KZ.js} +2 -2
- package/dist-cli/chunks/{what-happened-SVCASJKT.js → what-happened-STVD3KZ2.js} +2 -2
- package/dist-cli/chunks/{whoami-5NJ6IPLT.js → whoami-L62IGS4U.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +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/index.cjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/vite-base.cjs +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/auto-bootstrap-4KQT4TCR.js +0 -2
- package/dist-cli/chunks/beta-3S56PNSS.js +0 -2
- package/dist-cli/chunks/chunk-334L67M2.js +0 -2
- package/dist-cli/chunks/chunk-6PLNIOJP.js +0 -17
- package/dist-cli/chunks/chunk-ASSV2FFC.js +0 -1
- package/dist-cli/chunks/chunk-WN6YFWS5.js +0 -117
- package/dist-cli/chunks/chunk-YFX2XIR4.js +0 -1
- package/dist-cli/chunks/chunk-YKFRPIVC.js +0 -1
- package/dist-cli/chunks/chunk-ZPURE62G.js +0 -1
- package/dist-cli/chunks/control-GNJNC524.js +0 -2
- package/dist-cli/chunks/demo-app-registry-3VFEW4NV.js +0 -2
- package/dist-cli/chunks/drivers-EAONIWG3.js +0 -2
- package/dist-cli/chunks/flow-ECSMFTKS.js +0 -2
- package/dist-cli/chunks/install-YFE7C2NU.js +0 -2
- package/dist-cli/chunks/record-DQR2TEIF.js +0 -45
- package/dist-cli/chunks/runtime-XXNKSGFE.js +0 -2
- package/dist-cli/chunks/setup-repo-P4LCPAF6.js +0 -2
- package/dist-cli/chunks/store-GH77HGEB.js +0 -2
- package/dist-cli/chunks/telemetry-WC5J4TE5.js +0 -2
- package/dist-cli/chunks/upload-RLS6KTG6.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.42 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var t=!0,e="1.0.0",o="public beta",n=`${o} \xB7 free until ${e}`,r="free for everyone until 1.0 \u2014 we send anonymous error and dependency data while you use it";export{t as a,e as b,o as c,n as d,r as e};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{l as P,n as a,y as m}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.42 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{l as P,n as a,y as m}from"./chunk-6MYXKMLG.js";import l from"fs";import c from"path";var s="default",S="profiles.json",i=1;function o(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function d(){return c.join(a(),S)}function I(e){return`sootsim-profile-${o(e)}`}function h(e){return c.join(P(),"Partitions",I(e))}function A(e){return c.join(a(),"playwright",o(e))}function u(){try{let e=JSON.parse(l.readFileSync(d(),"utf8"));if(!e||e.version!==i)return{version:i,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:o(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:i,profiles:r}}catch{return{version:i,profiles:[]}}}function x(e){return[...e].sort((r,t)=>r.id===s?-1:t.id===s?1:r.id.localeCompare(t.id))}function p(e){if(e.profiles.some(t=>t.id===s))return{...e,profiles:x(e.profiles)};let r=new Date().toISOString();return{version:i,profiles:x([{id:s,createdAt:r,updatedAt:r},...e.profiles])}}function g(e){m();let r=p(e),t=`${d()}.tmp`;return l.writeFileSync(t,`${JSON.stringify(r,null,2)}
|
|
3
3
|
`,"utf8"),l.renameSync(t,d()),r}function y(){return g(u()).profiles}function E(e){let r=o(e);return y().find(t=>t.id===r)??null}function _(e=s){let r=o(e),t=E(r);return t||D(r)}function D(e){let r=o(e),t=p(u());if(t.profiles.some(w=>w.id===r))throw new Error(`profile already exists: ${r}`);let f=new Date().toISOString(),n={id:r,createdAt:f,updatedAt:f};return g({version:i,profiles:[...t.profiles,n]}),n}function F(e){let r=o(e);if(r===s)throw new Error("the default profile cannot be deleted; clear it instead");let t=p(u()),f=t.profiles.find(n=>n.id===r);if(!f)throw new Error(`profile not found: ${r}`);return g({version:i,profiles:t.profiles.filter(n=>n.id!==r)}),v(r),f}function v(e){let r=o(e);for(let t of[h(r),A(r)])try{l.rmSync(t,{recursive:!0,force:!0})}catch{}}export{A as a,y as b,_ as c,D as d,F as e,v as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.42 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var o={width:3,lock:{top:253,height:103},ringToggle:{top:152,height:32},volumeUp:{top:214,height:61},volumeDown:{top:290,height:61}},m={width:2.5,lock:{top:130,height:78},ringToggle:{top:94,height:22},volumeUp:{top:126,height:48},volumeDown:{top:188,height:48}},d={width:3,lock:{top:238,height:78},ringToggle:{top:-1e3,height:0},volumeUp:{top:336,height:62},volumeDown:{top:408,height:62}},c={width:3,lock:{top:248,height:72},ringToggle:{top:-1e3,height:0},volumeUp:{top:144,height:62},volumeDown:{top:216,height:62}},a=48;function t(e){return{...e,platform:"ios",navigationBarHeight:0,navigationBarMode:e.homeIndicatorHeight>0?"gesture":"none",displayCutout:{top:e.dynamicIsland?e.statusBarHeight:0,bottom:0,left:0,right:0},cameraCutout:null,osVersion:e.iosVersion,androidApiLevel:null,systemName:"iOS",manufacturer:"Apple",brand:"Apple",modelName:e.name}}var h={"iphone-se":t({name:"iPhone SE",width:375,height:667,scale:2,statusBarHeight:20,homeIndicatorHeight:0,cornerRadius:0,dynamicIsland:null,safeAreaInsets:{top:20,bottom:0,left:0,right:0},iosVersion:"15.8",physicalPPI:326,hardwareButtons:m}),"iphone-14":t({name:"iPhone 14",width:390,height:844,scale:3,statusBarHeight:47,homeIndicatorHeight:34,cornerRadius:55,dynamicIsland:null,safeAreaInsets:{top:47,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15":t({name:"iPhone 15",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15-plus":t({name:"iPhone 15 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15-pro":t({name:"iPhone 15 Pro",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-15-pro-max":t({name:"iPhone 15 Pro Max",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-16":t({name:"iPhone 16",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-plus":t({name:"iPhone 16 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro":t({name:"iPhone 16 Pro",width:402,height:874,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro-max":t({name:"iPhone 16 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17":t({name:"iPhone 17",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-air":t({name:"iPhone 17 Air",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro":t({name:"iPhone 17 Pro",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro-max":t({name:"iPhone 17 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"ipad-pro-13":t({name:'iPad Pro 13"',width:1032,height:1376,scale:2,statusBarHeight:24,homeIndicatorHeight:20,cornerRadius:18,dynamicIsland:null,safeAreaInsets:{top:24,bottom:20,left:0,right:0},iosVersion:"18.2",physicalPPI:264,hardwareButtons:o}),"pixel-8":{platform:"android",name:"Pixel 8",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:a,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:a,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:d},"pixel-8-three-button":{platform:"android",name:"Pixel 8 (3-button)",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:48,navigationBarMode:"three-button",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:48,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:d},"pixel-9-pro-xl":{platform:"android",name:"Pixel 9 Pro XL",width:448,height:997,scale:3,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:a,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:41,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:a,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 9 Pro XL",physicalPPI:486,hardwareButtons:d},"galaxy-s24":{platform:"android",name:"Galaxy S24",width:360,height:780,scale:3,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:a,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:36,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:a,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S921B",physicalPPI:416,hardwareButtons:c},"galaxy-s24-ultra":{platform:"android",name:"Galaxy S24 Ultra",width:384,height:824,scale:3.75,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:a,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:24,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:a,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S928B",physicalPPI:505,hardwareButtons:c}},u="iphone-17-pro";function b(e){return h[e]}function g(){return Object.keys(h)}var n={"iphone-6-9":{name:"iphone-6-9",label:'iPhone 6.7"',width:1284,height:2778,store:"apple"},"iphone-6-1":{name:"iphone-6-1",label:'iPhone 6.5"',width:1242,height:2688,store:"apple"},"ipad-13":{name:"ipad-13",label:'iPad 13"',width:2064,height:2752,store:"apple"},"android-phone":{name:"android-phone",label:"Google Play phone",width:1080,height:1920,store:"google"},"android-tablet-7":{name:"android-tablet-7",label:'Google Play 7" tablet',width:1200,height:1920,store:"google"},"android-tablet-10":{name:"android-tablet-10",label:'Google Play 10" tablet',width:1600,height:2560,store:"google"}},s={dark:{type:"gradient",direction:180,glow:"#4caeff",stops:[{offset:0,color:"#111827"},{offset:40,color:"#101725"},{offset:100,color:"#06080d"}]},cyan:{type:"gradient",direction:180,glow:"#25c3ec",stops:[{offset:0,color:"#1b465c"},{offset:32,color:"#122336"},{offset:100,color:"#05070b"}]},gold:{type:"gradient",direction:180,glow:"#ffc25a",stops:[{offset:0,color:"#3b2f1a"},{offset:34,color:"#18140d"},{offset:100,color:"#050505"}]},red:{type:"gradient",direction:180,glow:"#ff6178",stops:[{offset:0,color:"#3e1018"},{offset:35,color:"#17080c"},{offset:100,color:"#050405"}]}},P={color:"#25c3ec",blur:120,spread:52,opacity:.34},S="iphone-17-pro";function v(e){return Object.prototype.hasOwnProperty.call(n,e)?n[e]:null}function f(e){return{type:e.type,color:e.color,direction:e.direction,glow:e.glow,stops:e.stops?.map(r=>({...r}))}}function B(e){return Object.prototype.hasOwnProperty.call(s,e)?f(s[e]):null}var p={deviceModel:{type:"enum",default:u,description:"device model to simulate",cliFlag:"device",cliFlagShort:"d",options:g(),group:"device"},orientation:{type:"enum",default:"portrait",description:"screen orientation",cliFlag:"orientation",options:["portrait","landscape"],group:"device"},colorScheme:{type:"enum",default:"auto",description:"color scheme (auto follows system preference)",cliFlag:"theme",cliFlagShort:"t",options:["light","dark","auto"],group:"appearance"},reduceMotion:{type:"boolean",default:!1,description:"reduce motion",group:"appearance"},boldText:{type:"boolean",default:!1,description:"bold text",group:"appearance"},fontSize:{type:"number",default:1,description:"font size multiplier (1.0 = default)",group:"appearance",validate:e=>e>=.5&&e<=2},networkCondition:{type:"enum",default:"wifi",description:"simulated network condition",cliFlag:"network",options:["wifi","lte","fast-3g","slow-3g","offline"],group:"network"},language:{type:"string",default:"en",description:"language code (ISO 639-1)",cliFlag:"language",group:"locale"},region:{type:"string",default:"US",description:"region code (ISO 3166-1)",cliFlag:"region",group:"locale"},showTouches:{type:"boolean",default:!1,description:"show touch indicators",group:"simulator"},showFrame:{type:"boolean",default:!0,description:"show device frame",cliFlag:"frame",group:"simulator"},showTopBar:{type:"boolean",default:!0,description:"show simulator top bar",group:"simulator"},screenshotMode:{type:"boolean",default:!1,description:"show screenshot composition mode in the browser shell",group:"simulator"},threeMode:{type:"boolean",default:!1,description:"show the experimental 3d device stage in the browser shell",group:"simulator"},screenshotCanvas:{type:"enum",default:"iphone-6-9",description:"target app-store canvas preset for screenshot mode",options:Object.keys(n),group:"simulator"},screenshotBackground:{type:"enum",default:"dark",description:"background preset rendered inside the screenshot canvas",options:Object.keys(s),group:"simulator"},screenshotText:{type:"enum",default:"bold-top",description:"text layout preset for the screenshot canvas",options:["bold-top","editorial-left","minimal-bottom","none"],group:"simulator"},screenshotPose:{type:"enum",default:"straight",description:"device pose preset inside the screenshot canvas",options:["straight","tilted-left","tilted-right","cut-bottom","cut-top"],group:"simulator"},screenshotDynamicSize:{type:"boolean",default:!1,description:"let the screenshot canvas rect fit available space (off = pin to exact preset pixels)",group:"simulator"},showStatusBar:{type:"boolean",default:!0,description:"show status bar",group:"simulator"},showHomeIndicator:{type:"boolean",default:!0,description:"show home indicator",group:"simulator"},a11yMode:{type:"enum",default:"delayed",description:"accessibility tree sync mode (off, delayed=100ms, active=30ms)",options:["off","delayed","active"],group:"simulator"},a11yDepth:{type:"enum",default:"deep",description:"accessibility tree structure depth (shallow or deep)",options:["shallow","deep"],group:"simulator"},inspectMode:{type:"boolean",default:!1,description:"inspect mode",group:"simulator"},errorReporting:{type:"boolean",default:!1,description:"send anonymous crash reports",group:"privacy"},agentProvider:{type:"enum",default:"codex",description:"ai agent used by the sootsim agent prompt bar",options:["codex","claude"],group:"agent"},onboardingComplete:{type:"boolean",default:!1,description:"first-run onboarding completed",group:"beta"},betaConsentVersion:{type:"number",default:0,description:"last accepted beta telemetry policy version",group:"beta"},detailedTelemetry:{type:"boolean",default:!0,description:"send detailed usage telemetry (sessions, perf samples)",group:"beta"}};function y(){if(typeof window>"u")return{};let e={};try{let r=new URLSearchParams(window.location.search),i=r.get("device");i&&p.deviceModel.options?.includes(i)&&(e.deviceModel=i);let l=r.get("colorScheme")??r.get("theme");l&&p.colorScheme.options?.includes(l)&&(e.colorScheme=l)}catch{}return e}function H(){let e={};for(let[r,i]of Object.entries(p))e[r]=i.default;return Object.assign(e,y()),e}export{P as a,S as b,v as c,f as d,B as e,h as f,b as g,g as h,p as i,y as j,H as k};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{v as p}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.42 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{v as p}from"./chunk-5EBERDK7.js";import{d as u,h as m,i as w}from"./chunk-76WF7UIG.js";var y={timeoutMs:1800,settleMs:48,startWindowMs:64};function c(e){return new Promise(t=>setTimeout(t,e))}function h(e){return e.includes("--json")}function S(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
|
|
3
3
|
`)}async function g(e,t,...r){return m(e,`__sootsimTest.${t}`,...r)}async function f(e,t,...r){return w(e,`SootSim.bridges.mainShell.${t}`,...r)}async function T(e,t={}){try{let r=await g(e,"waitForScreenTransitions",y);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function v(e,t,r,...n){let o=Date.now()+Math.max(0,r);for(;;)try{return await f(e,t,...n)}catch(s){if(!p(s)||Date.now()>=o)throw s;await c(50)}}async function x(e,t,r,n={}){let o=n.attempts??30,s=n.intervalMs??500,i=n.minNodeCount??10;for(let a=0;a<o;a++){let l=u(e,{commandTimeoutMs:t,simId:r});try{let d=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof d=="number"&&d>i)return{bridge:l,count:d}}catch{}l.close(),await c(s)}return null}async function _(e,t,r,n={}){let o=n.timeoutMs??8e3,s=n.intervalMs??250,i=Date.now()+o;for(;Date.now()<i;){let a=u(e,{commandTimeoutMs:t,simId:r});try{return await a.send({type:"evaluate",code:"1"}),a}catch{a.close()}await c(s)}return null}async function W(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,o=t.pollIntervalMs??200;return await e.send({type:"evaluate",code:`(async () => {
|
|
4
4
|
const start = Date.now()
|
|
5
5
|
const deadline = start + ${r}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.42 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{i as n}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.42 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{i as n}from"./chunk-L53QRCQZ.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
|
|
3
3
|
`)}export{g as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as ye}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.42 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as ye}from"./chunk-WSISSPE3.js";import{a as be}from"./chunk-DXQKMDX2.js";import{a as Se}from"./chunk-A2R42ONP.js";import{a as V,b as M,c as me,d as Y,f as pe,g as fe}from"./chunk-5PZPKGUJ.js";import{f as he,l as ge}from"./chunk-QLGR4M5H.js";import{b as ue}from"./chunk-5TRJK5SO.js";import{a as we}from"./chunk-6R3CVNXC.js";import{a as ve}from"./chunk-BBRAYGDX.js";import{f as ne}from"./chunk-L53QRCQZ.js";import{c as q,d as ce,e as de}from"./chunk-76WF7UIG.js";import{c as le}from"./chunk-D5TKAFJ3.js";import{a as ae,b as z}from"./chunk-4574AJAK.js";import*as $ from"fs";import{tmpdir as $e}from"os";import*as g from"path";import*as w from"fs";import*as f from"path";var U=1e4,B=393,C=852,xe="__sootsimCliPerf",Ne="maestroCopiedText",X=new Map;function m(o){return new Promise(e=>setTimeout(e,o))}function De(o){return o?f.basename(o)===".maestro"?f.dirname(o):o:process.cwd()}function Re(o,e,t){let r=e.endsWith(".png")?e:`${e}.png`;if(f.isAbsolute(r))return r;if(t.mode==="flow"&&/[\\/]/.test(r)){let i=r.startsWith("./")||r.startsWith("../")?t.flowDir??process.cwd():De(t.flowDir);return f.resolve(i,r)}return f.join(o,r)}function Ve(o){if(typeof o=="string")return{path:o,withFrame:!1};let e=o.path?.trim()||o.name?.trim();if(!e)throw new Error("takeScreenshot object form requires path or name");return{path:e,withFrame:o.withFrame===!0}}function G(o){let[e,t]=o.split(",").map(i=>i.trim()),r=(i,n)=>i.endsWith("%")?Number.parseFloat(i)/100*n:Number.parseFloat(i);return{x:r(e,B),y:r(t,C)}}function Z(o){return typeof o=="string"?o.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,(e,t)=>{if(X.has(t))return X.get(t);let r=process.env[t];if(r===void 0)throw new Error(`missing environment variable for flow placeholder: ${t}`);return r}):Array.isArray(o)?o.map(e=>Z(e)):o&&typeof o=="object"?Object.fromEntries(Object.entries(o).map(([e,t])=>[e,Z(t)])):o}function Ue(o){let e=o.split(/^---$/m),t=e.length>1?e[e.length-1]:o,r=Z(M.parse(t));return Array.isArray(r)?r:[]}var W=class{constructor(e,t){this.bridge=e;this.opts=t}stepDelay=0;firstLaunchDone=!1;profilingEnabled=!1;recordingEnabled=!1;recordingAccessChecked=!1;recordingStartedAtMs=null;lastRecordingDurationMs=null;simRouteHint=null;lastFailedStep=null;get simId(){return this.opts.simId}setSimRouteHint(e){this.simRouteHint=this.normalizeSimRoute(e)}normalizeSimRoute(e){if(!e)return null;try{let t=new URL(e);t.searchParams.delete("inspectOpen");let r=t.searchParams.toString();return`${t.origin}${t.pathname}${r?`?${r}`:""}`}catch{return e}}async refreshSimId(){if(this.opts.simId)try{let e=await this.bridge.listSims(),t=e.find(a=>a.id===this.opts.simId);if(t&&(this.simRouteHint=this.normalizeSimRoute(t.url||t.origin)),e.find(a=>a.id===this.opts.simId&&a.readyState==="open")||!this.simRouteHint)return;let i=this.simRouteHint&&e.find(a=>a.readyState==="open"&&this.normalizeSimRoute(a.url||a.origin)===this.simRouteHint);if(!i)return;let n=e.find(a=>a.isPrimary&&a.readyState==="open"),s=e.find(a=>a.readyState==="open"),l=i??n??s;l&&(this.opts.simId=l.id,console.log(` [flow] sim rotated to ${l.id}`))}catch{}}async evaluate(e){return this.bridge.send({type:"evaluate",simId:this.opts.simId,code:e})}async callTest(e,...t){return this.bridge.send({type:"call",simId:this.opts.simId,path:`__sootsimTest.${e}`,args:t})}async waitForTree(e=U){let t=Date.now()+e,r=null;for(;Date.now()<t;){try{let i=await this.evaluate(`(async () => {
|
|
3
3
|
const test = window.__sootsimTest
|
|
4
4
|
if (!test) return { count: 0, loading: true }
|
|
5
5
|
const count = (await test.getNodeCount?.()) || 0
|
|
@@ -324,23 +324,23 @@ flow extension:
|
|
|
324
324
|
takeScreenshot:
|
|
325
325
|
path: marketing/hero
|
|
326
326
|
withFrame: true
|
|
327
|
-
`),process.exit(0));let e=o[0];$.existsSync(e)||(console.error(` error: ${e} not found`),process.exit(1));let t=d=>o.find((c,v)=>o[v-1]===d),r=o.includes("--profile"),i=o.includes("--new"),n=t("--out")||"/tmp/sootsim-recordings",s=t("--screenshots")||"/tmp/sootsim-flow",l=t("--screenshot-paths")==="flow"?"flow":"dir",a=t("--device")?.trim()||"",p=o.includes("--slow")?+(t("--slow")||"500"):0,h=o.includes("--electron"),y=o.includes("--preview"),j=await ve(t("--preview-origin")),Q=t("--preview-public-origin"),Me=o.includes("--preview-open"),Ee=o.flatMap((d,c)=>o[c-1]==="--replace"?["--replace",d]:[]),
|
|
327
|
+
`),process.exit(0));let e=o[0];$.existsSync(e)||(console.error(` error: ${e} not found`),process.exit(1));let t=d=>o.find((c,v)=>o[v-1]===d),r=o.includes("--profile"),i=o.includes("--new"),n=t("--out")||"/tmp/sootsim-recordings",s=t("--screenshots")||"/tmp/sootsim-flow",l=t("--screenshot-paths")==="flow"?"flow":"dir",a=t("--device")?.trim()||"",p=o.includes("--slow")?+(t("--slow")||"500"):0,h=o.includes("--electron"),y=o.includes("--preview"),j=await ve(t("--preview-origin")),Q=t("--preview-public-origin"),Me=o.includes("--preview-open"),Ee=o.flatMap((d,c)=>o[c-1]==="--replace"?["--replace",d]:[]),S=o.includes("--record")||y,ee=o.includes("--tail-wait")?Math.max(0,+(t("--tail-wait")||"2000")):S?2e3:0,Pe=$.readFileSync(e,"utf8"),{frontmatter:k,steps:E}=ke(Pe);E.length===0&&(console.error(" error: flow file must contain a YAML array of steps"),process.exit(1));let I=a||k.device||"",O=h||k.electron===!0,L=k.app===void 0||k.app===null?"":typeof k.app=="number"?String(k.app):k.app,te={stripBooleanFlags:["--record","--profile","--electron","--new","--preview","--preview-open","--headless"],stripValueFlags:["--out","--device","--slow","--tail-wait","--url","--replace","--screenshots","--screenshot-paths","--preview-origin","--preview-public-origin","--driver"]},x=q(o,te),Ie=t("--url")||"";O&&!we()&&(console.error(" error: desktop companion not found. install or build it first with `bun run build:electron`"),process.exit(1));let re=O?"desktop companion":"bridge",_e=L?` | target: ${L}`:"";console.log(`
|
|
328
328
|
sootsim flow \u2014 ${g.basename(e)}
|
|
329
|
-
${E.length} steps | ${re}${_e}${
|
|
330
|
-
`),y&&ae({event:"preview_flow_started",properties:{flowName:g.basename(e),stepCount:E.length,mode:re,electron:O,record:
|
|
329
|
+
${E.length} steps | ${re}${_e}${S?" | recording":""}${r?" | profiling":""}${p?` | ${p}ms delay`:""}
|
|
330
|
+
`),y&&ae({event:"preview_flow_started",properties:{flowName:g.basename(e),stepCount:E.length,mode:re,electron:O,record:S,profile:r,previewOrigin:j}});let F=Ie||L||"",K=i||O&&x.simIdSource!=="flag",ie=!1;if(!F&&!K&&x.simIdSource==="none"){let d=de(x);try{let c=await d.listSims(),v=c.find(R=>R.isPrimary&&R.readyState==="open"),D=c.find(R=>R.readyState==="open"),se=v??D;se&&(ie=!0,console.log(` reusing active sim: ${se.id}`))}catch{}finally{d.close()}}if(!F&&!ie&&(K||x.simIdSource==="none")){let d=await Be();d||(console.error(" error: no current sim and no sootsim target found"),await z(),process.exit(1)),F=d}if(F&&I){let d=new URL(await he(F));d.searchParams.set("device",I),F=d.toString()}if(F){let d=[F];d.push(...Ee),K&&d.push("--new"),x.simIdSource==="flag"&&x.simId&&d.push("--sim",x.simId);let c=t("--driver");c&&d.push("--driver",c),o.includes("--headless")&&d.push("--headless"),await ge(d,{port:x.wsPort,timeoutMs:x.commandTimeoutMs})}let P=q(o,te),J=P.simIdSource==="flag"?P.simId:le()||P.simId,Ce=P.simIdSource==="flag"?"flag":J?"saved":"none",T=ce(P.wsPort,{commandTimeoutMs:P.commandTimeoutMs,simId:J,simIdSource:Ce,fallbackOnMissingSimId:!1}),u,oe=async()=>{if(!I)return!1;let d=await T.send({type:"evaluate",simId:u.simId,code:"window.location.href"});if(typeof d=="string"&&d.length>0){let c=new URL(d);c.searchParams.set("device",I),u.setSimRouteHint(c.toString())}return!!await T.send({type:"call",simId:u.simId,path:"SootSim.bridges.settings.set",args:["deviceModel",I]})};u=new W(T,{screenshotDir:s,flowDir:g.dirname(g.resolve(e)),screenshotPathMode:l,simId:J,recordingOutputDir:S?n:void 0,billingOriginOverride:y?j:void 0,allowGitHubRecording:S,onAfterLaunch:async()=>{await oe()&&await u.waitForTree(12e4),y&&await T.send({type:"evaluate",simId:u.simId,code:`(() => {
|
|
331
331
|
const r = window.SootSim?.bridges?.eventRecorder ?? window.__sootsimEventRecorder
|
|
332
332
|
return r?.start?.() ?? false
|
|
333
|
-
})()`})}}),p&&(u.stepDelay=p);let A=null,b=null,_=null,H=null,N=0,Oe=!!E[0]?.launchApp;try{await u.waitForTree(12e4),await oe()&&await u.waitForTree(12e4),
|
|
333
|
+
})()`})}}),p&&(u.stepDelay=p);let A=null,b=null,_=null,H=null,N=0,Oe=!!E[0]?.launchApp;try{await u.waitForTree(12e4),await oe()&&await u.waitForTree(12e4),S&&(Oe?u.prepareRecording():await u.startRecording()),r&&await u.startProfile(),y&&(await T.send({type:"evaluate",simId:u.simId,code:`(() => {
|
|
334
334
|
const r = window.SootSim?.bridges?.eventRecorder ?? window.__sootsimEventRecorder
|
|
335
335
|
return r?.start?.() ?? false
|
|
336
|
-
})()`})||console.warn(" warn: eventRecorder.start() returned false \u2014 preview will upload bundle without replay events")),await u.runFlow(E),r&&(A=await u.stopProfile()),
|
|
336
|
+
})()`})||console.warn(" warn: eventRecorder.start() returned false \u2014 preview will upload bundle without replay events")),await u.runFlow(E),r&&(A=await u.stopProfile()),S&&ee>0&&await new Promise(c=>setTimeout(c,ee)),S&&(b=await u.stopRecording(),_=u.getLastRecordingDurationMs()),y&&(H=await T.send({type:"evaluate",simId:u.simId,code:`(() => {
|
|
337
337
|
const r = window.SootSim?.bridges?.eventRecorder ?? window.__sootsimEventRecorder
|
|
338
338
|
return r?.stop?.() ?? []
|
|
339
339
|
})()`}),console.log(` captured ${H.length} replay events`)),console.log(`
|
|
340
|
-
+ completed (${E.length} steps)`),A&&Te(A),b&&console.log(` video: ${b}`),console.log()}catch(d){if(r&&!A)try{A=await u.stopProfile()}catch{}if(
|
|
340
|
+
+ completed (${E.length} steps)`),A&&Te(A),b&&console.log(` video: ${b}`),console.log()}catch(d){if(r&&!A)try{A=await u.stopProfile()}catch{}if(S&&!b)try{b=await u.stopRecording(),_=u.getLastRecordingDurationMs()}catch(c){console.warn(` recording stop failed: ${c?.message||String(c)}`)}console.error(`
|
|
341
341
|
x failed: ${d.message}
|
|
342
342
|
`),A&&(console.log(" partial profile:"),Te(A)),b&&console.log(` partial video: ${b}`);try{let c=u.lastFailedStep,v=c?`step-${String(c.index+1).padStart(2,"0")}-${c.kind}`:"unstaged",D=g.join(s,v);await u.captureFailureBundle(D,{error:d,stepIndex:c?.index,stepKind:c?.kind,stepTarget:c?.target}),console.log(` failure bundle: ${D}`),console.log(" (contents: screenshot.png, describe.json, a11y.txt, tree.txt, console.json, error.json)")}catch(c){try{let v=g.join(s,"error.png");await u.captureFailureScreenshot(v),console.log(` error screenshot: ${v}`)}catch{}console.log(` (failure bundle capture failed: ${c instanceof Error?c.message:String(c)})`)}await ue(T,{errorsCommand:`sootsim get errors 5${u.simId?` --sim ${u.simId}`:""}`,warningsCommand:`sootsim get warnings 5${u.simId?` --sim ${u.simId}`:""}`,requestsCommand:`sootsim get requests 5${u.simId?` --sim ${u.simId}`:""}`}),N=1}finally{T.close()}if(N===0&&y)try{let d=await We(H??[]),c=["--origin",j,"--events",d];Q&&c.push("--public-origin",Q),b&&c.push("--video",b),b&&_&&Number.isFinite(_)&&c.push("--video-duration-ms",String(Math.round(_))),u.simId&&c.push("--sim",u.simId),Me&&c.push("--open"),console.log(`
|
|
343
|
-
preparing preview upload\u2026`);let{runUpload:v}=await import("./upload-
|
|
343
|
+
preparing preview upload\u2026`);let{runUpload:v}=await import("./upload-Z4PPGOX6.js");await v(c,{})}catch(d){console.error(` preview upload failed: ${d?.message||d}`),N=1}return await z(),N}async function We(o){let{gzipSync:e}=await import("zlib"),t=o.map(n=>JSON.stringify(n)).join(`
|
|
344
344
|
`)+(o.length?`
|
|
345
345
|
`:""),r=e(Buffer.from(t,"utf8")),i=g.join($e(),`sootsim-events-${Date.now()}.jsonl.gz`);return $.writeFileSync(i,r),console.log(` events: ${o.length} written to ${i} (${r.length} bytes gz)`),i}async function je(o){let e=o[0],t=r=>o.find((i,n)=>o[n-1]===r);switch(e){case"start":{let{path:r,state:i}=me();console.log(" flow draft started"),console.log(` session: ${r}`),console.log(` steps: ${i.steps.length}`);return}case"keep":case"good":{let r=pe();if(r.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),!r.kept){console.log(" no pending action to keep");return}console.log(` kept: ${r.candidate.summary}`),console.log(` steps: ${r.stepCount}`);return}case"end":{let r=t("--output")||(o[1]&&!o[1].startsWith("-")?o[1]:void 0),i=o.includes("--validate")||o.includes("--video"),n=o.includes("--video"),s=fe(r||(i?Ke():void 0));if(s.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),i){let l=Je(o,s.outputPath),a=await Ae(l);if(a!==0){console.error(`
|
|
346
346
|
validation failed \u2014 draft preserved so you can keep iterating`),process.exitCode=a;return}Y(),console.log(` flow draft validated (${s.stepCount} step${s.stepCount===1?"":"s"})`),s.outputPath&&console.log(` saved: ${s.outputPath}`),n&&console.log(" video: recorded during validation run");return}if(Y(),console.log(` flow draft ended (${s.stepCount} step${s.stepCount===1?"":"s"})`),s.outputPath){console.log(` saved: ${s.outputPath}`),console.log(` next: sootsim flow ${s.outputPath} --record`);return}console.log(""),process.stdout.write(s.yaml);return}case"validate":{let r=o[1];(!r||r.startsWith("-"))&&(console.error(" usage: sootsim flow validate <path>"),process.exit(1));let i=Le(r);if(i.length>0){console.error(` x ${r} failed validation:`);for(let n of i)console.error(` - ${n}`);process.exit(1)}console.log(` + ${r} looks valid`);return}}}var Fe=new Set(["tapOn","inputText","pressKey","dispatchKey","hideKeyboard","swipe","pinch","scroll","scrollUntilVisible"]);function Le(o){let e=[];if(!$.existsSync(o))return[`file not found: ${o}`];let t;try{t=$.readFileSync(o,"utf8")}catch(n){return[`cannot read file: ${n.message}`]}if(t.trim().length===0)return["file is empty"];let r;try{r=ke(t)}catch(n){return[`yaml parse error: ${n.message}`]}if(!Array.isArray(r.steps)||r.steps.length===0)return e.push("flow body must be a non-empty YAML array of steps"),e;let i=0;for(let n=0;n<r.steps.length;n++){let s=r.steps[n];s&&typeof s=="object"?Object.keys(s).some(a=>Fe.has(a))&&(i+=1):typeof s=="string"&&Fe.has(s)&&(i+=1)}return i===0&&e.push("no interaction steps found (expected at least one tapOn / inputText / pressKey / swipe / scroll)"),e}async function dt(o){let e=o[0];if(e==="start"||e==="keep"||e==="good"||e==="end"||e==="validate")return await je(o),0;let t=await Ae(o);return t!==0&&(process.exitCode=t),t}function Te(o){let e=o.avgMs>0?(1e3/o.avgMs).toFixed(1):"?",t=o.sampleCount>0?(o.jankFrames/o.sampleCount*100).toFixed(1):"0";console.log(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as P,b as v}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.42 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as P,b as v}from"./chunk-543BSGQG.js";import{d as j}from"./chunk-EDXBJUHH.js";import{a as b}from"./chunk-4574AJAK.js";import{execSync as A}from"child_process";import{existsSync as w,readFileSync as _,writeFileSync as x}from"fs";import{relative as B,resolve as d}from"path";import{existsSync as p,readFileSync as k,readdirSync as O,statSync as R}from"fs";import{basename as L,dirname as T,join as a}from"path";function D(e){let o=e;for(;;){if(p(a(o,"turbo.json"))||p(a(o,"nx.json"))||p(a(o,"lerna.json"))||p(a(o,"pnpm-workspace.yaml")))return o;let i=a(o,"package.json");if(p(i))try{if(JSON.parse(k(i,"utf8")).workspaces)return o}catch{}let r=T(o);if(r===o)break;o=r}return e}function W(e){return p(a(e,"bun.lock"))||p(a(e,"bun.lockb"))?"bun":p(a(e,"pnpm-lock.yaml"))?"pnpm":p(a(e,"yarn.lock"))?"yarn":"npm"}function J(e){if(p(a(e,"turbo.json")))return"turbo";if(p(a(e,"nx.json")))return"nx";if(p(a(e,"pnpm-workspace.yaml")))return"pnpm";let o=a(e,"package.json");if(p(o))try{if(JSON.parse(k(o,"utf8")).workspaces)return"npm-workspaces"}catch{}return"single"}function N(e){return e.one?"one":e.expo?"expo":e["react-native"]?"bare":"unknown"}function y(e){let o=a(e,"package.json");if(!p(o))return null;let i;try{i=JSON.parse(k(o,"utf8"))}catch{return null}let r={...i.dependencies,...i.devDependencies},s=N(r);return s==="unknown"?null:{dir:e,name:i.name||L(e),framework:s,hasViteConfig:p(a(e,"vite.config.ts"))||p(a(e,"vite.config.js")),hasMetroConfig:p(a(e,"metro.config.js"))||p(a(e,"metro.config.ts")),hasSootsimDependency:!!r.sootsim,devCommand:i.scripts?.dev||null}}function V(e){let o=[],i=a(e,"pnpm-workspace.yaml");if(p(i)){let t=k(i,"utf8").match(/packages:\s*\n((?:\s+-\s+.+\n?)+)/);if(t){let c=t[1].split(`
|
|
3
3
|
`).filter(Boolean);for(let n of c){let g=n.replace(/^\s*-\s*['"]?/,"").replace(/['"]?\s*$/,"");g&&o.push(...S(e,g))}}return o}let r=a(e,"package.json");if(p(r))try{let s=JSON.parse(k(r,"utf8")),t=Array.isArray(s.workspaces)?s.workspaces:s.workspaces?.packages||[];for(let c of t)o.push(...S(e,c))}catch{}return o}function S(e,o){let i=o.replace(/\/\*\*?$/,"").replace(/\*$/,""),r=a(e,i);if(!p(r))return[];try{return O(r).map(t=>a(r,t)).filter(t=>{try{return R(t).isDirectory()&&p(a(t,"package.json"))}catch{return!1}})}catch{return[]}}function M(e){let o=J(e),i=W(e);if(o==="single"){let c=y(e);return{root:e,type:o,packageManager:i,apps:c?[c]:[]}}let r=V(e),s=[],t=y(e);t&&s.push(t);for(let c of r){if(c===e)continue;let n=y(c);n&&s.push(n)}return{root:e,type:o,packageManager:i,apps:s}}function $(e){switch(e){case"bun":return"bun add -d sootsim";case"pnpm":return"pnpm add -D sootsim";case"yarn":return"yarn add -D sootsim";case"npm":return"npm install -D sootsim"}}async function ce(e){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
4
4
|
sootsim setup-repo \u2014 set up sootsim in your project
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.42 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function t(_){return`(async () => {
|
|
3
3
|
const __t = window.__sootsimTest
|
|
4
4
|
if (!__t) throw new Error('__sootsimTest not available')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as B,b as H,c as ne}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.42 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as B,b as H,c as ne}from"./chunk-3PN6HIAM.js";import{b as T}from"./chunk-5TRJK5SO.js";import{g as se}from"./chunk-BZFKV7CT.js";import{a as x,b as z}from"./chunk-6R3CVNXC.js";import{c as re}from"./chunk-KQN7OUQ6.js";import{d as oe}from"./chunk-DUVJOJTP.js";import{a as Y}from"./chunk-2XCCV7J3.js";import{b as te,c as S,d as w,e as $}from"./chunk-76WF7UIG.js";import{c as N,d as g,e as F}from"./chunk-D5TKAFJ3.js";import{E as Z,F as ee}from"./chunk-6MYXKMLG.js";import xe from"node:fs";import Ce from"node:os";import j from"node:path";function ge(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function _(e){let t=ge(e);return t==="localhost"||t.endsWith(".localhost")||t==="0.0.0.0"||t==="::1"||/^127(?:\.\d{1,3}){3}$/.test(t)}function ie(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 we(e,t){return e?.includes("/one/metro-entry.bundle")?"one":typeof t=="string"&&t?"expo":"unknown"}function ce(e,t,o){return`${e}//${t}:${o}`}function be(e){if(typeof window>"u")return!1;try{let t=new URL(e);return _(t.hostname)&&_(window.location.hostname)&&t.origin!==window.location.origin}catch{return!1}}async function ae(e,t){let o={...t,cache:t?.cache??"no-store"};return be(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,o):fetch(e,o)}function ye(e){return e==="https:"?443:80}function Se(e){let t=e.pathname||"/";return(t==="/"||t==="")&&!e.search&&!e.hash}async function le(e,t){let o=e.replace(/\/+$/,"");try{let n=await ae(`${o}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},i=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(i||s.name)return{bundleUrl:ne(i||`${o}${H}`),port:t,framework:we(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await ae(`${o}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${o}${H}`,port:t,framework:"metro"}}catch{}return null}async function $e(e){return le(ce("http:","localhost",e),e)}async function q(e){let t=e.trim();if(/^\d+$/.test(t)){let a=parseInt(t,10),l=await $e(a);if(l)return l;throw ie(`localhost:${a}`)}let o=t.startsWith("http")?t:`http://${t}`,n;try{n=new URL(o)}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):ye(r),i=ce(r,n.hostname,s);if(_(n.hostname)&&Se(n)){let a=await le(i,s);if(a)return a;throw ie(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function je(){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 me(e){let t=x();if(console.log(` note: no sootsim bridge detected on port ${e}`),t){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 ve(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 We(e,t,o){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){ve(t);return}console.error(` no sim with id "${o}" is connected to the bridge on port ${t}.`),console.error(""),console.error(" connected sims:");for(let r of n){let s=[r.isPrimary?"primary":null,r.readyState].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 Pe={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 I(e){return new Promise(t=>setTimeout(t,e))}function G(e){return e.trim()}function W(e){try{let t=new URL(e),o=t.pathname.replace(/\/+$/,"")||"/";return t.searchParams.has("open")||t.searchParams.has("port")||t.searchParams.has("bundle")||t.searchParams.has("demo")||t.pathname.includes("/sootsim/index.html")||o==="/sootsim"||t.pathname==="/__soot"||t.pathname==="/__soot/"||o==="/rn"||/^\/rn\/[^/]+$/i.test(o)||/^\/app\/[^/]+$/i.test(o)||o==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(o)||/^\/__soot\/app\/[^/]+$/i.test(o)}catch{return!1}}async function co(e){let t=G(e);return(await q(t)).bundleUrl}function Q(e){let t=e.replace(/\/+$/,"")||"/";return t==="/__soot"||t.startsWith("/__soot/")?"/__soot":""}function Ie(e,t){let o=G(e),n=new URL(t),r=Q(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(o)?n.pathname=`${r}/rn/${o}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",o)),n.toString()}function Ue(e){let t=G(e);return/^\d+$/.test(t)||/^https?:\/\//i.test(t)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(t)}async function ke(e,t){let o=await q(e),n=new URL(t),r=Q(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",o.bundleUrl),n.toString()}function Me(e){return e.startsWith("~/")?j.join(Ce.homedir(),e.slice(2)):j.isAbsolute(e)?e:j.resolve(process.cwd(),e)}function Te(e){let t={};for(let o=0;o<e.length;o++){if(e[o]!=="--replace")continue;let n=e[o+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(),i=Me(n.slice(r+1).trim());xe.existsSync(i)||(console.error(` sootsim open: replacement file not found: ${i}`),process.exit(1)),t[s]={file:i},o++}return Object.keys(t).length>0?{modules:t}:void 0}function ue(){let e=Z();return ee(e)&&e.runtimePort>0?`http://localhost:${e.runtimePort}/`:Y}async function R(e,t=ue()){if(!e)return new URL(t).toString();if(W(e))return new URL(e).toString();let o=Pe[e.toLowerCase()];if(o){let n=new URL(t),r=Q(n.pathname);return n.pathname=`${r}${o}`,n.toString()}return Ue(e)?ke(e,t):Ie(e,t)}function de(e,t){let o=e?.url||e?.origin||t;try{let n=new URL(o);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.toString()}catch{return t}}async function Be(e,t,o){let n=new URL(await R(e,t));return n.searchParams.set("inspectOpen",o),n.toString()}async function _e(e,t,o,n={}){let r=n.attempts??30,s=n.intervalMs??500,i=n.minNodeCount??10;for(let a=0;a<r;a++){let l=w(e,{commandTimeoutMs:t,simId:o,simIdSource:"flag"});try{let m=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof m=="number"&&m>i)return{bridge:l,count:m}}catch{}l.close(),await I(s)}return null}function Oe(e){if(!e)return null;try{let t=new URL(e);if(t.searchParams.has("bundle")){let o=t.searchParams.get("bundle")||"";try{let n=new URL(o),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return t.searchParams.has("port")?`connect :${t.searchParams.get("port")||""}`:t.searchParams.has("open")?`connect ${t.searchParams.get("open")||""}`:t.searchParams.has("demo")?`demo ${t.searchParams.get("demo")||"default"}`:t.pathname.includes("/sootsim/index.html")||t.pathname==="/sootsim/"||t.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function Re(e,t){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
|
|
3
3
|
`);for(let o of e){let n=o.lockedBy&&o.lockExpiresAt?`locked by ${o.lockedBy} (${Math.max(0,Math.round((o.lockExpiresAt-Date.now())/1e3))}s)`:"",r=[o.isPrimary?"primary":"",o.id===t?"selected":"",o.readyState,o.attachedCliCount&&o.attachedCliCount>0?"in use":"",o.userFocused?"focused":"",n].filter(Boolean);console.log(` ${o.id}${r.length?` [${r.join(", ")}]`:""}`);let s=Oe(o.url);if(s&&console.log(` loaded: ${s}`),o.url?console.log(` url: ${o.url}`):o.origin&&console.log(` origin: ${o.origin}`),o.title&&console.log(` title: ${o.title}`),console.log(` connected: ${new Date(o.connectedAt).toISOString()}`),o.lastActiveAt&&o.lastActiveAt>0){let i=Math.round((Date.now()-o.lastActiveAt)/1e3),a=i<60?`${i}s ago`:i<3600?`${Math.round(i/60)}m ago`:`${Math.round(i/3600)}h ago`;console.log(` last active: ${a}`)}}}async function O(e,t,o,n={}){let r=n.attempts??30,s=n.intervalMs??500;for(let i=0;i<r;i++){let a=w(e,{commandTimeoutMs:t});try{let m=(await a.listSims()).find(o);if(m)return m}catch{}finally{a.close()}await I(s)}return null}async function Le(e,t,o,n={}){let r=n.attempts??20,s=n.intervalMs??250;for(let i=0;i<r;i++){let a=w(e,{commandTimeoutMs:t});try{let m=(await a.listSims()).find(b=>b.id===o);if(!m||m.readyState!=="open")return!0}catch{return!0}finally{a.close()}await I(s)}return!1}function L(e,t){if(t){let r=t.trim(),s=e.find(i=>i.id===r);if(!s)throw new Error(`no sim connected with id ${r}`);return s}let o=e.find(r=>r.isPrimary&&r.readyState==="open");if(o)return o;let n=e.find(r=>r.readyState==="open");if(n)return n;throw new Error("no sim connected")}function C(e,t,o){console.log(` ${o==="current sim"?"loaded":"opened"}: ${e} [${o}]`),console.log(` current sim: ${t.id}`),console.log(JSON.stringify({simId:t.id,url:t.url},null,2))}async function P(e,t,o){if(o.includes("--no-describe"))return;let n=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await Ee(e,t,{stableMs:150,maxMs:400});let r=w(e,{commandTimeoutMs:3e3,simId:t,cliLabel:"open --describe",simIdSource:"flag"});try{let i=`(async () => {
|
|
4
4
|
const t = window.__sootsimTest
|
|
5
5
|
const ms = window.SootSim?.bridges?.mainShell
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A as R,C as w,i as p,r as S,t as O,y as v,z as f}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.42 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as R,C as w,i as p,r as S,t as O,y as v,z as f}from"./chunk-6MYXKMLG.js";import{spawn as I}from"child_process";import C from"crypto";import s from"fs";import l from"path";import{Readable as k}from"stream";import{pipeline as M}from"stream/promises";var N="https://sootbean.com",D="SOOTSIM_CDN_ORIGIN",E="SOOTSIM_RUNTIME_CHANNEL";function $(){try{let e=JSON.parse(s.readFileSync(O(),"utf8"));return e&&typeof e=="object"?e:{}}catch{return{}}}function d(e){let t=$();return(e||process.env[D]||t.cdnOrigin||N).replace(/\/+$/,"")}function x(e){let t=$();return e||process.env[E]||t.runtimeChannel||"stable"}function T(e){let t=new URL(`${d(e)}/runtimes/manifest.json`);return t.searchParams.set("t",String(Date.now())),t.toString()}function P(e,t){return`${d(t)}/runtimes/sootsim-runtime-${e}.tar.gz`}async function y(e){let t=T(e),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function U(e,t={}){let r=x(t.channel),n=t.version||e.channels[r]?.latest;if(!n)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let i=e.versions[n];if(!i)throw new Error(`version ${n} not found in manifest; available: ${Object.keys(e.versions).slice(-10).join(", ")||"(none)"}`);return{version:n,channel:r,entry:i}}async function V(e={}){v();let t=d(e.cdnOrigin),r=await y(t),{version:n,channel:i,entry:o}=U(r,e),a=p(n),c=e.setActive!==!1;if(!e.force&&s.existsSync(l.join(a,"index.html")))return c&&R(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!1,activated:c,manifest:r};let g=o.tarball||P(n,t),m=l.join(S(),`sootsim-runtime-${n}.tar.gz`);process.stderr.write(`sootsim: downloading runtime ${n}\u2026
|
|
3
3
|
`),await _(g,m),process.stderr.write(`sootsim: extracting runtime ${n}\u2026
|
|
4
4
|
`);let h=await j(m);if(h!==o.sha256)throw s.rmSync(m,{force:!0}),new Error(`sha256 mismatch for runtime ${n}: expected ${o.sha256}, actual ${h}`);let u=l.join(l.dirname(a),`.installing-${n}-${process.pid}`);s.rmSync(u,{recursive:!0,force:!0}),s.mkdirSync(u,{recursive:!0});try{if(await A(m,u),!s.existsSync(l.join(u,"index.html")))throw new Error(`extracted tarball for runtime ${n} is missing index.html`);s.rmSync(a,{recursive:!0,force:!0}),s.renameSync(u,a)}catch(b){throw s.rmSync(u,{recursive:!0,force:!0}),b}return c&&R(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!0,activated:c,manifest:r}}async function q(e={}){v();let t=d(e.cdnOrigin),r=x(e.channel),n=await y(t),i=n.channels[r]?.latest;if(!i)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:f()};if(!n.versions[i])return{checked:!0,updated:!1,reason:`manifest is missing version ${i}`,activeVersion:f(),latestVersion:i};let a=f(),c=a?p(a):null,g=c?s.existsSync(l.join(c,"index.html")):!1;if(!(!a||!g||w(i,a)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:a,latestVersion:i};let h=await V({version:i,channel:r,cdnOrigin:t,setActive:!1});return{checked:!0,updated:!0,activeVersion:i,latestVersion:i,install:h}}async function B(e={}){let t=f();try{let r=await y(d(e.cdnOrigin)),n=x(e.channel),i=r.channels[n]?.latest??null,o=!!(i&&(!t||w(i,t)>0));return{active:t,latest:i,outdated:o}}catch{return{active:t,latest:null,outdated:!1}}}async function _(e,t){let r=await fetch(e);if(!r.ok||!r.body)throw new Error(`download failed: ${r.status} ${r.statusText} (${e})`);s.mkdirSync(l.dirname(t),{recursive:!0});let n=`${t}.partial`;try{await M(k.fromWeb(r.body),s.createWriteStream(n)),s.renameSync(n,t)}catch(i){try{s.unlinkSync(n)}catch{}throw i}}function j(e){return new Promise((t,r)=>{let n=C.createHash("sha256"),i=s.createReadStream(e);i.on("data",o=>n.update(o)),i.on("error",r),i.on("end",()=>t(n.digest("hex")))})}function A(e,t){return new Promise((r,n)=>{let i=I("tar",["-xzf",e,"-C",t],{stdio:["ignore","inherit","inherit"]});i.on("error",n),i.on("exit",o=>{o===0?r():n(new Error(`tar exited with code ${o}`))})})}export{N as a,D as b,E as c,d,x as e,T as f,P as g,y as h,U as i,V as j,q as k,B as l};
|