sootsim 0.1.64 → 0.1.65
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-SHMN3LWB.js → agent-44BHCTZA.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-ESDQSMYX.js → agent-wrapper-BEP5WHZR.js} +2 -2
- package/dist-cli/chunks/{assert-X3GQJUDI.js → assert-SKDEGGRD.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-SMQMN7WS.js +2 -0
- package/dist-cli/chunks/beta-DEQZ2J7G.js +2 -0
- package/dist-cli/chunks/{chunk-ALDKVFW3.js → chunk-2EBGZC4A.js} +2 -2
- package/dist-cli/chunks/chunk-3HC3F7CO.js +3 -0
- package/dist-cli/chunks/{chunk-RRGCQNVD.js → chunk-46OKLW3Z.js} +1 -1
- package/dist-cli/chunks/{chunk-R6ZTREB6.js → chunk-5MMRIGC3.js} +2 -2
- package/dist-cli/chunks/chunk-5MRRLWSD.js +1 -0
- package/dist-cli/chunks/{chunk-DJIQVKM6.js → chunk-5ZB5ZN5Z.js} +47 -10
- package/dist-cli/chunks/{chunk-DSLBZC6J.js → chunk-6GZS5TCL.js} +2 -2
- package/dist-cli/chunks/chunk-B32KMMQV.js +2 -0
- package/dist-cli/chunks/chunk-CBRKFAOD.js +1 -0
- package/dist-cli/chunks/chunk-DLSOZVYM.js +1 -0
- package/dist-cli/chunks/chunk-E6CRWOWO.js +2 -0
- package/dist-cli/chunks/{chunk-2GAZ3JW7.js → chunk-ELZHT3LB.js} +2 -2
- package/dist-cli/chunks/{chunk-LKJI7RRW.js → chunk-FPOQPEGK.js} +4 -4
- package/dist-cli/chunks/{chunk-OBL6OIK5.js → chunk-FRANP4PR.js} +1 -1
- package/dist-cli/chunks/{chunk-X3QWOTLT.js → chunk-FU33BTPL.js} +1 -1
- package/dist-cli/chunks/{chunk-YXZFG3ZY.js → chunk-GHFA4O5B.js} +1 -1
- package/dist-cli/chunks/{chunk-34PKFCEI.js → chunk-GHTXP5R7.js} +3 -3
- package/dist-cli/chunks/{chunk-PXRELDJJ.js → chunk-GZCZ4GCS.js} +2 -2
- package/dist-cli/chunks/{chunk-VGD57MTN.js → chunk-HNXQ2JP6.js} +2 -2
- package/dist-cli/chunks/{chunk-3R3BQDKC.js → chunk-JC5L5ZJX.js} +2 -2
- package/dist-cli/chunks/{chunk-J6TCNU6W.js → chunk-KKOOZPQP.js} +1 -1
- package/dist-cli/chunks/{chunk-6X3I2LF4.js → chunk-L2SDB6G5.js} +2 -2
- package/dist-cli/chunks/{chunk-ZV2TI6OH.js → chunk-M4HI2THN.js} +2 -2
- package/dist-cli/chunks/{chunk-L3MRXOBW.js → chunk-MLPLYQGK.js} +3 -3
- package/dist-cli/chunks/{chunk-YGMHOMAJ.js → chunk-MSBMGQJE.js} +2 -2
- package/dist-cli/chunks/{chunk-VE4QTDAY.js → chunk-NJ2ACA36.js} +2 -2
- package/dist-cli/chunks/{chunk-HERZHQFG.js → chunk-NTEZEQSB.js} +2 -2
- package/dist-cli/chunks/{chunk-RKUDWRIN.js → chunk-O56DABNK.js} +2 -2
- package/dist-cli/chunks/{chunk-G4GM43A7.js → chunk-OTWUZRFZ.js} +2 -2
- package/dist-cli/chunks/{chunk-XHDHG6YH.js → chunk-P2C3JX3D.js} +1 -1
- package/dist-cli/chunks/{chunk-N63QYSHT.js → chunk-PTUCXL7Y.js} +3 -3
- package/dist-cli/chunks/{chunk-GKUKCZBA.js → chunk-R2QEABGZ.js} +1 -1
- package/dist-cli/chunks/{chunk-SMYSG4VE.js → chunk-S46M5JZP.js} +1 -1
- package/dist-cli/chunks/{chunk-T5TDH2UO.js → chunk-TRHZBTPF.js} +1 -1
- package/dist-cli/chunks/{chunk-WKVIKFMU.js → chunk-TWKWXGN5.js} +1 -1
- package/dist-cli/chunks/{chunk-BT6IVKHN.js → chunk-U5EQ5RWL.js} +2 -2
- package/dist-cli/chunks/{chunk-YJIQYIHM.js → chunk-UH4H5HXN.js} +1 -1
- package/dist-cli/chunks/{chunk-UVDVALC7.js → chunk-UHYZO26V.js} +2 -2
- package/dist-cli/chunks/chunk-UXFF7AEE.js +73 -0
- package/dist-cli/chunks/{chunk-346HJVD6.js → chunk-VGQXIMEX.js} +1 -1
- package/dist-cli/chunks/{chunk-RQHWF2OD.js → chunk-X2IIAIAP.js} +2 -2
- package/dist-cli/chunks/{chunk-FFVJK2R7.js → chunk-X75XFMI4.js} +2 -2
- package/dist-cli/chunks/{chunk-SVT7H2QF.js → chunk-ZW3HKMLQ.js} +2 -2
- package/dist-cli/chunks/cli-version-HH7DAYBK.js +2 -0
- package/dist-cli/chunks/{compat-SOHG4UE5.js → compat-MDZTV64M.js} +3 -3
- package/dist-cli/chunks/{config-JQF6TGCG.js → config-DRGNQOYL.js} +2 -2
- package/dist-cli/chunks/control-NCUWAXPH.js +2 -0
- package/dist-cli/chunks/{cpu-profile-3C7LHLJE.js → cpu-profile-JQAGHLDS.js} +2 -2
- package/dist-cli/chunks/{daemon-SD773LNY.js → daemon-3RT7EABW.js} +2 -2
- package/dist-cli/chunks/{debug-MNWVCAAF.js → debug-CYINYNWV.js} +3 -3
- package/dist-cli/chunks/demo-app-registry-JGIZ7NN7.js +2 -0
- package/dist-cli/chunks/{detox-VOWHHVNU.js → detox-DUABQYC6.js} +2 -2
- package/dist-cli/chunks/{device-TFKPS72A.js → device-KSSSQOQC.js} +2 -2
- package/dist-cli/chunks/{diagnose-J2BTJTGW.js → diagnose-NUDACXIR.js} +2 -2
- package/dist-cli/chunks/drivers-CKGMOVM4.js +2 -0
- package/dist-cli/chunks/{electron-NHJHQAOJ.js → electron-LC3Y74FA.js} +3 -3
- package/dist-cli/chunks/flow-3AHNNHF7.js +2 -0
- package/dist-cli/chunks/{hints-XONGBPNI.js → hints-EOARRVNB.js} +2 -2
- package/dist-cli/chunks/{home-paths-KK7NZVIK.js → home-paths-HOBR3K3B.js} +2 -2
- package/dist-cli/chunks/{inspect-7AINMWI2.js → inspect-QCZVODE6.js} +13 -13
- package/dist-cli/chunks/install-747G2O4S.js +2 -0
- package/dist-cli/chunks/{install-desktop-CRFW4MDL.js → install-desktop-W2OOILJG.js} +3 -3
- package/dist-cli/chunks/{keys-PLJITE2X.js → keys-RR43E2O3.js} +2 -2
- package/dist-cli/chunks/{launch-FHMTFUI3.js → launch-GAPSA5HQ.js} +3 -3
- package/dist-cli/chunks/{login-DCFVFSY3.js → login-IADXSJEW.js} +4 -4
- package/dist-cli/chunks/{logout-55UH67FS.js → logout-AT33MGA7.js} +2 -2
- package/dist-cli/chunks/{maestro-HNNW73KG.js → maestro-G36ATKHQ.js} +2 -2
- package/dist-cli/chunks/{preview-EYIZWAEJ.js → preview-BJUMMDBL.js} +2 -2
- package/dist-cli/chunks/{profile-UOG2ET7W.js → profile-CEQNS53P.js} +2 -2
- package/dist-cli/chunks/{react-MRICF5YD.js → react-BPEDK3TN.js} +2 -2
- package/dist-cli/chunks/{record-33ZECMTQ.js → record-73CGQ3EP.js} +2 -2
- package/dist-cli/chunks/runtime-QR5IHGKJ.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-KYEJ3C24.js → runtime-delivery-IYK2HNPG.js} +2 -2
- package/dist-cli/chunks/{screenshot-B6B3CE2W.js → screenshot-GUM2U2PN.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-QVII6GH6.js → screenshot-mode-VUBCO7T2.js} +2 -2
- package/dist-cli/chunks/{screenshots-GYQ3JHAW.js → screenshots-JENURQSV.js} +2 -2
- package/dist-cli/chunks/{server-G4WPXKFR.js → server-PVAO3OA2.js} +2 -2
- package/dist-cli/chunks/setup-repo-ECVECJZQ.js +2 -0
- package/dist-cli/chunks/{skills-RF27H27Y.js → skills-4JI327YS.js} +2 -2
- package/dist-cli/chunks/{start-EBOUYGAP.js → start-7YB4I5V5.js} +4 -4
- package/dist-cli/chunks/store-2MXXL4QE.js +2 -0
- package/dist-cli/chunks/telemetry-GIA7FIKW.js +2 -0
- package/dist-cli/chunks/{test-SATSKLC6.js → test-5C6NYF62.js} +3 -3
- package/dist-cli/chunks/{three-mode-XLTSGRVJ.js → three-mode-C6TE63VR.js} +2 -2
- package/dist-cli/chunks/{timeline-ELOCAU3S.js → timeline-NFYS6IPO.js} +2 -2
- package/dist-cli/chunks/{upgrade-2OZLYETX.js → upgrade-KROEHYG2.js} +2 -2
- package/dist-cli/chunks/upload-OS3J5ZOS.js +2 -0
- package/dist-cli/chunks/{web-YOKL7JUD.js → web-UTOZ7MRF.js} +2 -2
- package/dist-cli/chunks/{what-happened-YGFJR2TI.js → what-happened-FCP2U43H.js} +2 -2
- package/dist-cli/chunks/{whoami-GKH3GF3H.js → whoami-O6XVOJBF.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/host/fetch-proxy-overrides.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-PH4II3F2.js +0 -2
- package/dist-cli/chunks/beta-YKR6YRXH.js +0 -2
- package/dist-cli/chunks/chunk-CETSCOUK.js +0 -1
- package/dist-cli/chunks/chunk-E5EWHEA5.js +0 -3
- package/dist-cli/chunks/chunk-KY2VMN66.js +0 -1
- package/dist-cli/chunks/chunk-M4CADRP5.js +0 -66
- package/dist-cli/chunks/chunk-OBSMT5TS.js +0 -2
- package/dist-cli/chunks/chunk-WN4XOOK5.js +0 -2
- package/dist-cli/chunks/chunk-XHD3XCT5.js +0 -1
- package/dist-cli/chunks/cli-version-32VNOX3F.js +0 -2
- package/dist-cli/chunks/control-GIAGLNPG.js +0 -2
- package/dist-cli/chunks/demo-app-registry-JUKLYD4R.js +0 -2
- package/dist-cli/chunks/drivers-HVKRY4MB.js +0 -2
- package/dist-cli/chunks/flow-D6MKC5NH.js +0 -2
- package/dist-cli/chunks/install-YPSDICK4.js +0 -2
- package/dist-cli/chunks/runtime-OG4HGCYH.js +0 -2
- package/dist-cli/chunks/setup-repo-2TQURG52.js +0 -2
- package/dist-cli/chunks/store-FRMH2SYG.js +0 -2
- package/dist-cli/chunks/telemetry-EZIRTFFL.js +0 -2
- package/dist-cli/chunks/upload-SJCUW6BT.js +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as G}from"./chunk-
|
|
3
|
-
`)}function ro(s,d){let a=d.trim()||"default";return`${s}:${a}`}function Me(s,d,a,l={}){let g=l.nowMs??Date.now(),i=l.cooldownMs??to,h=so(g),S=ro(s,d),I=h.entries[S];return I&&I.signature===a&&g-I.updatedAt<i?!1:(h.entries[S]={signature:a,updatedAt:g},no(h),!0)}async function gt(s,d={args:[]}){let a=await qe(s);if(C(d.args)){B(a);return}console.log(` nodes: ${a.nodes}`)}function Ie(s,d){let a=s.indexOf(d);return a>=0&&a+1<s.length?s[a+1]:null}async function yt(s){let{bridge:d,args:a,positional:l}=s,g=a.includes("--verbose")||a.includes("-v"),i=C(a),h=g&&!i,S=a.includes("--watch")||a.includes("-w"),I=1e3,k=a.includes("--compact"),b=a.includes("--no-xy"),v=Ie(a,"--testid-like"),
|
|
4
|
-
`).length>=80&&G("describe-use-filters"),
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as G}from"./chunk-X2IIAIAP.js";import{a as Je,b as We}from"./chunk-S46M5JZP.js";import{a as X,b as C,c as B,d as z,e as ue,f as re,g as lt,h as ct,i as Te}from"./chunk-3HC3F7CO.js";import{a as je,h as ce}from"./chunk-MSBMGQJE.js";import{b as dt,c as ut,i as mt}from"./chunk-FPOQPEGK.js";import"./chunk-O56DABNK.js";import{a as Le}from"./chunk-TRHZBTPF.js";import{A as rt,C as se,D as it,J as at,a as de,b as qe,c as He,d as Ue,e as Ke,f as ze,g as Ye,h as ve,i as ke,n as Ge,o as Xe,p as Ve,q as Qe,r as Ze,s as et,t as tt,u as ot,v as st,w as nt}from"./chunk-5ZB5ZN5Z.js";import"./chunk-6GZS5TCL.js";import"./chunk-NTEZEQSB.js";import"./chunk-FU33BTPL.js";import"./chunk-CBRKFAOD.js";import"./chunk-ELZHT3LB.js";import"./chunk-UH4H5HXN.js";import{a as xe,c as $e,d as Pe}from"./chunk-R2QEABGZ.js";import{a as Oe}from"./chunk-B32KMMQV.js";import{c as Ee,e as De,f as Ce,g as Be,h as Se}from"./chunk-ZW3HKMLQ.js";import{b as Re}from"./chunk-VGQXIMEX.js";import"./chunk-E6CRWOWO.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";import{existsSync as Ut,mkdirSync as Kt,readFileSync as zt,rmSync as pt,writeFileSync as Yt}from"fs";import{tmpdir as Gt}from"os";import{dirname as Xt,join as Vt,resolve as Qt}from"path";var ie=1,Zt="SOOTSIM_INSPECT_NOTICE_PATH",eo=300*1e3,to=15e3;function ft(){return Qt(process.env[Zt]||Vt(Gt(),"sootsim-inspect-notice-state.json"))}function oo(s,d){return Object.fromEntries(Object.entries(s).filter(([,a])=>typeof a?.signature=="string"&&Number.isFinite(a?.updatedAt)&&d-a.updatedAt<=eo))}function so(s){let d=ft();if(!Ut(d))return{version:ie,entries:{}};try{let a=JSON.parse(zt(d,"utf8"));return a.version!==ie||!a.entries||typeof a.entries!="object"?(pt(d,{force:!0}),{version:ie,entries:{}}):{version:ie,entries:oo(a.entries,s)}}catch{return pt(d,{force:!0}),{version:ie,entries:{}}}}function no(s){let d=ft();Kt(Xt(d),{recursive:!0}),Yt(d,JSON.stringify(s,null,2)+`
|
|
3
|
+
`)}function ro(s,d){let a=d.trim()||"default";return`${s}:${a}`}function Me(s,d,a,l={}){let g=l.nowMs??Date.now(),i=l.cooldownMs??to,h=so(g),S=ro(s,d),I=h.entries[S];return I&&I.signature===a&&g-I.updatedAt<i?!1:(h.entries[S]={signature:a,updatedAt:g},no(h),!0)}async function gt(s,d={args:[]}){let a=await qe(s);if(C(d.args)){B(a);return}console.log(` nodes: ${a.nodes}`)}function Ie(s,d){let a=s.indexOf(d);return a>=0&&a+1<s.length?s[a+1]:null}async function yt(s){let{bridge:d,args:a,positional:l}=s,g=a.includes("--verbose")||a.includes("-v"),i=C(a),h=g&&!i,S=a.includes("--watch")||a.includes("-w"),I=1e3,k=a.includes("--compact"),b=a.includes("--no-xy"),v=Ie(a,"--testid-like"),N=Ie(a,"--only"),T=Ie(a,"--subtree"),E=l[1],J=E?/[*?]/.test(E):!1,c=!J&&!N?E:void 0,K=N??(J?E:void 0),j=async()=>{await ue(d,{verbose:h});let Y=await Ke(d,{describe:!0,verbose:g,filter:c||"",testIdLike:v||void 0,onlyGlob:K||void 0,subtreeRoot:T||void 0,compact:k,hideXy:b}),W=Y?.tree,x=Y?.shell,F=Y?.keyboard;if(i){B({shell:x,tree:W??"",keyboard:F});return}if(x&&typeof x=="object"){let O=[x.state?`state=${x.state}`:null,x.activeApp?`app=${x.activeApp}`:null,x.showSwitcher?"switcher":null,x.switcherPhase&&x.switcherPhase!=="idle"?`phase=${x.switcherPhase}`:null].filter(Boolean);O.length>0&&console.log(` shell: ${O.join(" ")}`)}if(typeof W=="string"&&W.startsWith("__SUBTREE_NOT_FOUND__:")){let O=W.slice(22);console.log(` subtree root not found: ${O}`),G("subtree-root-not-found",O);return}if(!W){let O=Y?.nodeCount??0;console.log(" no matching nodes found"),!(c||v||K||T)&&O<10&&G("app-still-loading",O);return}if(console.log(W),!(c||v||K||T)&&!S&&W.split(`
|
|
4
|
+
`).length>=80&&G("describe-use-filters"),F&&F.visible){let O=F.spec,V=[O?.keyboardType?`type=${O.keyboardType}`:null,O?.returnKeyType&&O.returnKeyType!=="default"?`return=${O.returnKeyType}`:null,F.mode!=="letters"?`mode=${F.mode}`:null,F.shifted?"shift":null,F.capsLock?"caps":null,O?.autoCapitalize&&O.autoCapitalize!=="sentences"?`autoCap=${O.autoCapitalize}`:null,F.accessoryBarId?`accessory=${F.accessoryBarId}`:null].filter(Boolean);console.log(`
|
|
5
5
|
keyboard: ${V.join(" ")||"visible"}`)}};if(S)for(console.log(` watching... (Ctrl+C to stop)
|
|
6
|
-
`);;)console.clear(),await j(),await X(I);else await j()}var io=["SOOTSIM_AGENT","CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","CURSOR_TRACE_ID","AIDER_MODEL"];function ht(){if(process.env.SOOTSIM_AGENT==="0")return!1;for(let s of io){let d=process.env[s];if(d&&d.trim()&&d!=="0")return!0}return!1}async function bt(s){let{bridge:d,args:a,effectiveArgs:l,positional:g,inspectUsage:i}=s,h=x=>{let
|
|
6
|
+
`);;)console.clear(),await j(),await X(I);else await j()}var io=["SOOTSIM_AGENT","CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","CURSOR_TRACE_ID","AIDER_MODEL"];function ht(){if(process.env.SOOTSIM_AGENT==="0")return!1;for(let s of io){let d=process.env[s];if(d&&d.trim()&&d!=="0")return!0}return!1}async function bt(s){let{bridge:d,args:a,effectiveArgs:l,positional:g,inspectUsage:i}=s,h=x=>{let F=l.indexOf(x);return F>=0&&F+1<l.length?l[F+1]:null},S=x=>l.includes(x),I=h("--testid")||h("--test-id"),k=h("--role"),b=h("--type"),v=h("--text"),N=S("--pressable"),T=S("--visible"),E=S("--interactive-targets")||S("--actions"),J=!I&&!k&&!b&&!v&&!N&&!T&&!E?g[1]:null,c=v??J,K=await Ye(d,{testId:I,role:k,type:b,text:c,pressable:N,visible:T,interactive:E});K||(console.error(i("find","<text> | --text <t> | --testid <id> | --role <r> | --type <t> | --pressable | --visible | --interactive-targets")),process.exit(1));let{mode:j,result:D}=K,Y=C(a),W=a.includes("--verbose")||a.includes("--dump");if(Y)j==="interactive-targets"&&Array.isArray(D)?B(ve(D).map(x=>({...x,tap:ke(x)}))):B(D??null);else if(Array.isArray(D))if(D.length===0){console.log(` no ${j} nodes found`);let x=await d.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount?.()) || 0)()"});typeof x=="number"&&x<10&&G("app-still-loading",x)}else if(j==="interactive-targets"){let x=ve(D);console.log(` found ${x.length} interactive target${x.length===1?"":"s"} (sorted by score):`);for(let F of x.slice(0,20)){let Z=F.absolutePosition?`@(${Math.round(F.absolutePosition.x)},${Math.round(F.absolutePosition.y)})`:"",O=F.layout?`${Math.round(F.layout.width)}x${Math.round(F.layout.height)}`:"?x?",V=F.text?` "${F.text.slice(0,30)}"`:"",oe=F.testID?` #${F.testID}`:"",ee=F.accessibilityLabel?` \u24D8"${String(F.accessibilityLabel).slice(0,24)}"`:"",he=F.accessibilityRole?`[${F.accessibilityRole}]`:F.type,be=ke(F);console.log(` ${he}${V}${ee}${oe} ${O} ${Z}`),console.log(` \u2192 ${be}`),W&&console.log(Ne(JSON.stringify(F,null,2)," "))}x.length>20&&console.log(` ... and ${x.length-20} more`)}else{console.log(` found ${D.length} node${D.length===1?"":"s"} (${j}):`);for(let x of D.slice(0,20)){let F=x.absolutePosition?`@(${Math.round(x.absolutePosition.x)},${Math.round(x.absolutePosition.y)})`:"",Z=x.layout?`${Math.round(x.layout.width)}x${Math.round(x.layout.height)}`:"?x?",O=x.text?` "${x.text.slice(0,30)}"`:"",V=x.testID?` #${x.testID}`:"",oe=x.pressable?" (tap)":"",ee=x.accessibilityRole?`[${x.accessibilityRole}]`:x.type;console.log(` ${ee}${O}${V} ${Z} ${F}${oe}`),W&&console.log(Ne(JSON.stringify(x,null,2)," "))}D.length>20&&console.log(` ... and ${D.length-20} more`)}else if(D==null)console.log(` not found: ${c||I||k||b||""||j}`),I&&G("wait-selector-for-missing-testid",I);else{let x=D;if(x.type&&x.absolutePosition){let F=`@(${Math.round(x.absolutePosition.x)},${Math.round(x.absolutePosition.y)})`,Z=x.layout?`${Math.round(x.layout.width)}x${Math.round(x.layout.height)}`:"?x?",O=x.text?` "${x.text.slice(0,40)}"`:"",V=x.testID?` #${x.testID}`:"",oe=x.pressable?" (tap)":"",ee=x.accessibilityRole?`[${x.accessibilityRole}]`:x.type;console.log(` ${ee}${O}${V} ${Z} ${F}${oe}`),W&&console.log(Ne(JSON.stringify(x,null,2)," "))}else console.log(JSON.stringify(D,null,2))}}function Ne(s,d){return s.split(`
|
|
7
7
|
`).map(a=>d+a).join(`
|
|
8
8
|
`)}async function wt(s,d={}){let a=await rt(s);if("error"in a&&(console.error(a.error),process.exit(1)),d.json){console.log(JSON.stringify(a,null,2));return}let{visible:l,spec:g,mode:i,shifted:h,capsLock:S,accessoryBarId:I}=a,k=[];k.push(`keyboard: ${l?"visible":"hidden"}`),g?(k.push(` type: ${g.keyboardType}`),k.push(` returnKey: ${g.returnKeyType}`),k.push(` autoCap: ${g.autoCapitalize}`),k.push(` autoCorrect: ${g.autoCorrect?"on":"off"}`),k.push(` appearance: ${g.keyboardAppearance}`),g.secureTextEntry&&k.push(" secureTextEntry: true"),g.enablesReturnKeyAutomatically&&k.push(` return: ${g.currentTextIsEmpty?"disabled (empty)":"enabled"}`)):k.push(" spec: <none> (shown via dev-tools with no TextInput)"),k.push(` mode: ${i}${h?" (shifted)":""}${S?" (caps)":""}`),I&&k.push(` accessoryBar: ${I}`),console.log(k.join(`
|
|
9
9
|
`))}async function xt(s){let d=await s.bridge.listSims();if(C(s.args)){B(d.map(a=>({...a,active:a.id===s.simId})));return}mt(d,s.simId)}function te(s){return s<1024?`${s}B`:s<1024*1024?`${(s/1024).toFixed(1)}KB`:`${(s/1024/1024).toFixed(1)}MB`}function me(s,d){return d<=0?"?":`${(s/d*100).toFixed(0)}%`}async function $t(s,d={args:[]}){let a=await at(s);if(C(d.args)){B(a);return}if(console.log(" memory:"),a.imageLoader){let l=a.imageLoader;console.log(" image-loader cache"),console.log(` entries: ${l.cacheEntries} / ${l.cacheMaxEntries} (${me(l.cacheEntries,l.cacheMaxEntries)})`),console.log(` pixel bytes: ${te(l.cachePixelBytes)} / ${te(l.cachePixelBudget)} (${me(l.cachePixelBytes,l.cachePixelBudget)})`),console.log(` pending: ${l.pendingFetches} fetches, ${l.pendingBytes} bytes`),console.log(` failed uris: ${l.failedUris}`),console.log(` snapshots: ${l.snapshots}`),console.log(` camera frames: ${l.cameraFrames}`)}else console.log(" image-loader cache: not available (engine pre-rebuild?)");if(a.workerHeap){let l=a.workerHeap;console.log(" worker heap (chrome only)"),console.log(` used: ${te(l.usedJSHeapSize)} / ${te(l.jsHeapSizeLimit)} (${me(l.usedJSHeapSize,l.jsHeapSizeLimit)})`),console.log(` total: ${te(l.totalJSHeapSize)}`)}if(a.hostHeap){let l=a.hostHeap;console.log(" host heap (chrome only)"),console.log(` used: ${te(l.usedJSHeapSize)} / ${te(l.jsHeapSizeLimit)} (${me(l.usedJSHeapSize,l.jsHeapSizeLimit)})`),console.log(` total: ${te(l.totalJSHeapSize)}`)}}function ae(s){let d=s.indexOf("--testid");if(d>=0&&s[d+1])return{mode:"testid",value:s[d+1]};let a=s.indexOf("--test-id");if(a>=0&&s[a+1])return{mode:"testid",value:s[a+1]};let l=s.indexOf("--text");return l>=0&&s[l+1]?{mode:"text",value:s[l+1]}:null}async function pe(s,d){let a=JSON.stringify(d.value),l=d.mode==="testid"?`(await t.findByTestId(${a})) || (await t.findById(${a}))`:`await t.findByText(${a})`;return await s.send({type:"evaluate",code:`(async () => {
|
|
@@ -114,12 +114,12 @@ import{a as G}from"./chunk-RQHWF2OD.js";import{a as Je,b as We}from"./chunk-SMYS
|
|
|
114
114
|
await sleep(pollMs)
|
|
115
115
|
}
|
|
116
116
|
return { settled: false, elapsed: Date.now() - start }
|
|
117
|
-
})()`}),{elapsed:h,settled:S}=i??{};return{elapsed:typeof h=="number"?h:d,settled:S===!0}}async function vt(s){let{bridge:d,args:a,positional:l}=s,g=l[1]?Number(l[1])*1e3:3e3,i=a.includes("--strict"),{elapsed:h,settled:S}=await ne({bridge:d,maxMs:g,strict:i});console.log(S?` settled in ${h}ms`:` timed out after ${h}ms (may still be animating)`)}async function kt(s){let d=s.positional[1]?Number(s.positional[1]):.5;(!Number.isFinite(d)||d<0)&&(console.error(s.inspectUsage("sleep","[seconds]")),process.exit(1)),await X(d*1e3),console.log(` slept ${d}s`)}async function Tt(s){let{bridge:d,args:a,positional:l}=s,g=l[1]?Number(l[1]):5,{tree:i}=await He(d,g);if(C(a)){B({depth:g,tree:i??null});return}console.log(typeof i=="string"?i:JSON.stringify(i,null,2))}async function Mt(s,d={args:[]}){let a=await Ue(s);if(C(d.args)){B(a);return}console.log(a.url)}async function It(s){let{wsPort:d,commandTimeoutMs:a,simId:l,simIdSource:g,positional:i}=s,h=i[1]?Number(i[1]):30,S=Math.max(1e3,(Number.isFinite(h)?h:30)*1e3),I=Math.max(1,Math.ceil(S/500));console.log(" waiting for sim reconnect...");let k=await lt(d,a,l,{attempts:I,simIdSource:g});k||(console.error(" timed out waiting for sim reconnect"),process.exit(1)),k.bridge.close(),ce({source:"inspect wait",step:{wait:S},summary:`wait ${Math.round(S/1e3)}s`}),console.log(` ready: ${k.count} nodes`)}var Nt=new Set(["app-launch","toast","keyboard","screen","route","alert","actionsheet","picker","notification","fetch","console","shell","scroll","gesture","text-input","react-commit","animation","reanimated"]);function fe(s,d){let a=s.indexOf(d);if(a>=0&&a+1<s.length)return s[a+1]}function ao(s,d){if(!d.filter&&!d.equals)return!0;let a=s.data,l=[];if(a&&typeof a=="object")for(let i of["url","displayUrl","message","name","activeName","path","pathname","title","phase","event","type","kind"]){let h=a[i];typeof h=="string"&&h.length>0&&l.push(h)}let g=l.join(" ");return d.equals?l.some(i=>i===d.equals):d.filter?g.toLowerCase().includes(d.filter.toLowerCase()):!0}async function Ft(s){let{bridge:d,args:a,positional:l,inspectUsage:g}=s,i=l[1];i||(console.error(g("wait event","<kind> [--max-ms 5000] [--filter <substring>] [--equals <exact>] [--since now|cursor]")),process.exit(1)),Nt.has(i)||console.error(` warning: '${i}' is not a known timeline kind \u2014 waiting anyway. known: ${[...Nt].sort().join(", ")}`);let h=fe(a,"--max-ms"),S=h&&Number.isFinite(Number(h))?Math.max(100,Number(h)):5e3,I=fe(a,"--filter"),k=fe(a,"--equals"),b=fe(a,"--since")??"now",v=a.includes("--json"),
|
|
117
|
+
})()`}),{elapsed:h,settled:S}=i??{};return{elapsed:typeof h=="number"?h:d,settled:S===!0}}async function vt(s){let{bridge:d,args:a,positional:l}=s,g=l[1]?Number(l[1])*1e3:3e3,i=a.includes("--strict"),{elapsed:h,settled:S}=await ne({bridge:d,maxMs:g,strict:i});console.log(S?` settled in ${h}ms`:` timed out after ${h}ms (may still be animating)`)}async function kt(s){let d=s.positional[1]?Number(s.positional[1]):.5;(!Number.isFinite(d)||d<0)&&(console.error(s.inspectUsage("sleep","[seconds]")),process.exit(1)),await X(d*1e3),console.log(` slept ${d}s`)}async function Tt(s){let{bridge:d,args:a,positional:l}=s,g=l[1]?Number(l[1]):5,{tree:i}=await He(d,g);if(C(a)){B({depth:g,tree:i??null});return}console.log(typeof i=="string"?i:JSON.stringify(i,null,2))}async function Mt(s,d={args:[]}){let a=await Ue(s);if(C(d.args)){B(a);return}console.log(a.url)}async function It(s){let{wsPort:d,commandTimeoutMs:a,simId:l,simIdSource:g,positional:i}=s,h=i[1]?Number(i[1]):30,S=Math.max(1e3,(Number.isFinite(h)?h:30)*1e3),I=Math.max(1,Math.ceil(S/500));console.log(" waiting for sim reconnect...");let k=await lt(d,a,l,{attempts:I,simIdSource:g});k||(console.error(" timed out waiting for sim reconnect"),process.exit(1)),k.bridge.close(),ce({source:"inspect wait",step:{wait:S},summary:`wait ${Math.round(S/1e3)}s`}),console.log(` ready: ${k.count} nodes`)}var Nt=new Set(["app-launch","toast","keyboard","screen","route","alert","actionsheet","picker","notification","fetch","console","shell","scroll","gesture","text-input","react-commit","animation","reanimated"]);function fe(s,d){let a=s.indexOf(d);if(a>=0&&a+1<s.length)return s[a+1]}function ao(s,d){if(!d.filter&&!d.equals)return!0;let a=s.data,l=[];if(a&&typeof a=="object")for(let i of["url","displayUrl","message","name","activeName","path","pathname","title","phase","event","type","kind"]){let h=a[i];typeof h=="string"&&h.length>0&&l.push(h)}let g=l.join(" ");return d.equals?l.some(i=>i===d.equals):d.filter?g.toLowerCase().includes(d.filter.toLowerCase()):!0}async function Ft(s){let{bridge:d,args:a,positional:l,inspectUsage:g}=s,i=l[1];i||(console.error(g("wait event","<kind> [--max-ms 5000] [--filter <substring>] [--equals <exact>] [--since now|cursor]")),process.exit(1)),Nt.has(i)||console.error(` warning: '${i}' is not a known timeline kind \u2014 waiting anyway. known: ${[...Nt].sort().join(", ")}`);let h=fe(a,"--max-ms"),S=h&&Number.isFinite(Number(h))?Math.max(100,Number(h)):5e3,I=fe(a,"--filter"),k=fe(a,"--equals"),b=fe(a,"--since")??"now",v=a.includes("--json"),N=Date.now(),T=N+S,E=200,J=N;for(;Date.now()<T;){let K={kinds:[i],since:b==="cursor"?void 0:J,limit:50},j=await d.send({type:"evaluate",code:`(async () => {
|
|
118
118
|
const t = window.SootSim?.bridges?.timeline
|
|
119
119
|
if (!t) return { ok: false, error: 'timeline bridge missing' }
|
|
120
120
|
return { ok: true, result: await t.recent(${JSON.stringify(K)}) }
|
|
121
|
-
})()`});(!j||!j.ok)&&(console.error(` could not query timeline: ${j&&"error"in j?j.error:"unknown"}`),process.exit(1));let D=j.result.events??[];for(let Y of D)if(ao(Y,{filter:I,equals:k})){let W=Date.now()-
|
|
122
|
-
`).slice(0,5);for(let h of i)console.log(` ${h.trim()}`)}}var Q="__sootsimCliPerf",fo=120;async function Dt(s,d){let a=s.find((
|
|
121
|
+
})()`});(!j||!j.ok)&&(console.error(` could not query timeline: ${j&&"error"in j?j.error:"unknown"}`),process.exit(1));let D=j.result.events??[];for(let Y of D)if(ao(Y,{filter:I,equals:k})){let W=Date.now()-N;console.log(v?JSON.stringify({found:!0,elapsedMs:W,event:Y}):` ${i} event after ${W}ms${I?` (filter: ${I})`:""}${k?` (equals: ${k})`:""}`);return}j.result.watermark&&j.result.watermark>J&&(J=j.result.watermark),await new Promise(Y=>setTimeout(Y,E))}let c=Date.now()-N;v?console.log(JSON.stringify({found:!1,elapsedMs:c,kind:i,filter:I,equals:k})):console.error(` \u26A0 wait event ${i} timed out after ${c}ms${I?` (filter: ${I})`:""}${k?` (equals: ${k})`:""}`),process.exit(1)}async function _t(s){let{bridge:d,args:a}=s,l=a.includes("--strict"),g=de(a,3e3),{elapsed:i,settled:h}=await ne({bridge:d,maxMs:g,strict:l});h?console.log(` idle in ${i}ms`):(console.error(` \u26A0 wait idle timed out after ${i}ms (may still be animating)`),process.exit(1))}async function At(s){let{bridge:d,args:a}=s,l=de(a,2e4),{ready:g,elapsedMs:i,nodes:h,targets:S,flag:I,loadingText:k,externalReady:b,externalError:v,errors:N}=await Ge(d,l);if(g){console.log(` ready in ${i}ms: ${h} nodes, ${S} targets`);return}let T=v?`guest app errored: ${v}`:k?`still showing "${k}"`:b===!1?"guest app is still loading":I!==!0?"guest app has not emitted sootsim:externalAppReady":S<=0?"ready flag emitted but no visible app content is inspectable yet":"node tree is still changing";console.error(` \u26A0 wait ready timed out after ${i}ms \u2014 ${T} (nodes: ${h}, targets: ${S}, errors: ${N})`),process.exit(1)}async function Ot(s){let{bridge:d,args:a,positional:l,inspectUsage:g}=s,i=l[1];i||(console.error(g("wait selector","<testid> [--max-ms 5000]")),process.exit(1));let h=a.indexOf("--max-ms"),S=h>=0&&a[h+1]?Math.max(100,Number(a[h+1])):5e3,{found:I,node:k,elapsed:b}=await Xe(d,i,S);if(I&&k){let v=k.absolutePosition?`@(${Math.round(k.absolutePosition.x)},${Math.round(k.absolutePosition.y)})`:"",N=k.layout?`${Math.round(k.layout.width)}x${Math.round(k.layout.height)}`:"?x?";console.log(` found #${i} in ${b}ms ${N} ${v}`)}else console.error(` \u26A0 wait selector #${i} timed out after ${b??S}ms`),process.exit(1)}function Bt(s){return s==null?"\u2014":s<1024?`${s}B`:s<1024*1024?`${(s/1024).toFixed(1)}K`:`${(s/1024/1024).toFixed(1)}M`}function jt(s){return s==null?" \u2026":s<1e3?`${s}ms`.padStart(5):`${(s/1e3).toFixed(2)}s`.padStart(5)}function co(s){return s.error?"err":s.status==null?" \u2026 ":String(s.status)}function Pt(s){let d=new Date(s.startTs).toLocaleTimeString(),a=co(s).padEnd(3),l=s.method.padEnd(5),g=Bt(s.size).padStart(6),i=jt(s.durationMs);console.log(` [${d}] ${a} ${l} ${g} ${i} ${s.displayUrl}`),s.error&&console.log(` error: ${s.error}`)}function uo(s){let d=[["id",s.id],["source",s.source],["kind",s.kind],["method",s.method],["status",s.error?`error: ${s.error}`:`${s.status??"\u2014"} ${s.statusText??""}`.trim()],["url",s.url],["started",new Date(s.startTs).toLocaleTimeString()],["duration",jt(s.durationMs).trim()],["size",Bt(s.size)],["content-type",s.type??"\u2014"]];for(let[a,l]of d)console.log(` ${a.padEnd(13)} ${l}`)}var mo={error:"\x1B[31m",warn:"\x1B[33m",info:"\x1B[36m",debug:"\x1B[35m",log:"\x1B[37m"},Rt="\x1B[0m",po="\x1B[2m";function Et(s,d){let a=new Date(s.ts).toLocaleTimeString(),l=s.level.toUpperCase().padEnd(5),g=s.args.join(" ");if(d){let i=mo[s.level];console.log(` ${po}[${a}]${Rt} ${i}${l}${Rt} ${g}`)}else console.log(` [${a}] ${l} ${g}`);if(s.stack&&s.level==="error"){let i=s.stack.split(`
|
|
122
|
+
`).slice(0,5);for(let h of i)console.log(` ${h.trim()}`)}}var Q="__sootsimCliPerf",fo=120;async function Dt(s,d){let a=s.find((N,T)=>s[T-1]==="--id"),l=s.find((N,T)=>s[T-1]==="--text");if(a||l){let N=await d.send({type:"evaluate",code:Je({id:a,text:l})});if(!N)throw new Error(a?`no node with id "${a}"`:`no node matching text "${l}"`);let{x:T,y:E,w:J,h:c}=N;return{x:T,y:E,w:J,h:c}}let g=s.find((N,T)=>s[T-1]==="--area");if(g){let N=g.split(",").map(K=>Number(K.trim()));if(N.length!==4||N.some(K=>!Number.isFinite(K)))throw new Error(`--area expects x,y,w,h (got "${g}")`);let[T,E,J,c]=N;return{x:T,y:E,w:J,h:c}}let i=N=>{let T=s.find((J,c)=>s[c-1]===N);if(T==null)return null;let E=Number(T);return Number.isFinite(E)?E:null},h=i("--x"),S=i("--y"),I=i("--w"),k=i("--h");if(h!=null||S!=null||I!=null||k!=null)return{x:h??0,y:S??0,w:I??1,h:k??1};let v=s.filter((N,T)=>T>0&&!N.startsWith("-")&&s[T-1]!=="--output"&&s[T-1]!=="--area"&&s[T-1]!=="--id"&&s[T-1]!=="--text"&&s[T-1]!=="--x"&&s[T-1]!=="--y"&&s[T-1]!=="--w"&&s[T-1]!=="--h").map(Number).filter(N=>Number.isFinite(N));if(v.length>=2){let[N,T,E=1,J=1]=v;return{x:N,y:T,w:E,h:J}}return null}function Fe(s){let d={"<8":0,"8-12":0,"12-16":0,"16-20":0,"20-33":0,">33":0};for(let a of s)a<8?d["<8"]++:a<12?d["8-12"]++:a<16?d["12-16"]++:a<20?d["16-20"]++:a<33?d["20-33"]++:d[">33"]++;console.log(" histogram:");for(let[a,l]of Object.entries(d)){let g="\u2588".repeat(Math.ceil(l/s.length*40));console.log(` ${a.padEnd(6)} ${g} ${l}`)}}async function ge(s,d,a){let l=Date.now()+d,g=await se(s,d);for(;;){if(a(g))return{settled:!0,state:g};if(Date.now()>=l)return{settled:!1,state:g};await X(16),g=await se(s)}}async function Ae(s){return s.send({type:"evaluate",code:`(async () => {
|
|
123
123
|
const kb = window.__sootsimKeyboard
|
|
124
124
|
const test = window.__sootsimTest
|
|
125
125
|
if (!kb) return { error: 'keyboard bridge not available' }
|
|
@@ -175,9 +175,9 @@ import{a as G}from"./chunk-RQHWF2OD.js";import{a as Je,b as We}from"./chunk-SMYS
|
|
|
175
175
|
`);console.log(`${e??""}
|
|
176
176
|
|
|
177
177
|
${o}
|
|
178
|
-
`),process.exit(0)}let
|
|
178
|
+
`),process.exit(0)}let N=g.wsPort,T=g.simId,E=g.simIdSource,J=g.commandTimeoutMs;if(h==="list"&&l.some(t=>t==="--drivers"||t==="-D")){let{buildDriverListRows:t}=await import("./drivers-CKGMOVM4.js"),e=t();console.log(` available drivers (${e.length}):
|
|
179
179
|
`);let o=Math.max(...e.map(r=>r.id.length),6),n=Math.max(...e.map(r=>r.kind.length),4);for(let r of e){let u=r.available?"\u2713":"\u2717",m=r.id.padEnd(o),w=r.kind.padEnd(n);console.log(` ${u} ${m} ${w} ${r.description}`),r.available&&r.detail?console.log(` ${r.detail}`):!r.available&&r.reason&&console.log(` unavailable: ${r.reason}`)}return}let c=De(g),K=T||"default",j=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","list","wait","sleep"]),D=200;function Y(t){let e=t.replace(/\s+/g," ").trim();if(!e)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(e)){let n=/<title[^>]*>([^<]+)<\/title>/i.exec(t)?.[1]?.trim(),r=/<body[^>]*>([\s\S]*?)<\//i.exec(t)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),u=n||r||"html error page";return`<html ${t.length}B> "${u}" (body elided \u2014 add --json for the full payload)`}return e.length<=D?e:`${e.slice(0,D)}\u2026 (+${e.length-D} more bytes)`}function W(t){let e=t.displayUrl||t.url;return t.status!=null?`${t.method} ${e} -> ${t.status}${t.statusText?` ${t.statusText}`:""}`:t.error?`${t.method} ${e} -> ${t.error}`:`${t.method} ${e}`}async function x(t){let e=ht()?5e3:1500;try{let{settled:o,elapsed:n}=await ne({bridge:t,maxMs:e,pollMs:32,stablePolls:2});o||process.stderr.write(` \u26A0 auto-wait timed out after ${n??e}ms \u2014 next command may see mid-animation state. use \`sootsim do settle\` for a longer wait.
|
|
180
|
-
`)}catch{}}async function
|
|
180
|
+
`)}catch{}}async function F(){try{return await c.send({type:"evaluate",code:`(() => ({
|
|
181
181
|
console: window.__sootsimConsole?.count?.() || null,
|
|
182
182
|
requests: window.__sootsimTest?.getRequestCounts?.() || null,
|
|
183
183
|
}))()`})||{console:null,requests:null}}catch{return{console:null,requests:null}}}async function Z(t={}){let e=t.counts!==void 0?t.counts:await z(c,"getRequestCounts");if(!e||typeof e!="object")return;let o=Math.max(0,Number(e.failed)||0);if(o===0||!t.includeTail&&!Me("requests",K,String(o))||(console.log(`
|
|
@@ -204,7 +204,7 @@ ${o}
|
|
|
204
204
|
return summary ? { summary, consoleSplit } : null
|
|
205
205
|
})()`)}catch{return}if(!o||!o.summary||!o.summary.total)return;let n=o.summary.byKind??{},r=[],u=new Set;for(let m of V){let w=n[m];if(w)if(u.add(m),m==="console"&&o.consoleSplit){let{error:f,warn:$}=o.consoleSplit;f>0&&r.push(`${f} error${f===1?"":"s"}`),$>0&&r.push(`${$} warning${$===1?"":"s"}`)}else r.push(`${w} ${m}${w===1?"":"s"}`)}for(let[m,w]of Object.entries(n))!u.has(m)&&w&&r.push(`${w} ${m}${w===1?"":"s"}`);if(r.length!==0&&(console.log(`
|
|
206
206
|
since last: ${r.join(" \xB7 ")} \u2014 sootsim what-happened`),o.summary.lastAt))try{await Se(t,"SootSim.bridges.timeline.cursorAdvance",e,o.summary.lastAt)}catch{}}let ee=new Set(["tap","double-tap","tap-text","tap-id","type","type-into","key","key-sequence","keycode","drag","swipe","long-press","touch","gesture","pinch","scroll","shell"]),he=new Set(["a11y","capture","count","double-tap","drag","find","gesture","layout","long-press","node","pinch","sample-color","scroll","screenshot","swipe","tap","tap-id","tap-text","touch","tree","type-into"]),be=(s.includes("--verbose")||s.includes("-v"))&&!s.includes("--json");S==="do"&&h==="shell"&&(console.error(" `sootsim do shell` was removed. use `sootsim shell ...` instead."),process.exit(1)),ee.has(h)&&await Ce(c),he.has(h)&&await ue(c,{verbose:be});try{switch(h){case"list":{await xt({bridge:c,simId:T,args:l});break}case"tree":{await Tt({bridge:c,args:l,positional:i});break}case"a11y":{let t=await ze(c);if(!Array.isArray(t)||t.length===0){console.log(" no accessible nodes found");break}if(s.includes("--json"))console.log(JSON.stringify(t,null,2));else{console.log(` accessibility tree (${t.length} nodes):
|
|
207
|
-
`);for(let e of t){let o=[];if(o.push(`[${e.role}]`),e.label){let n=e.label.length>50?e.label.slice(0,47)+"...":e.label;o.push(`"${n}"`)}if(e.hint&&o.push(`(hint: "${e.hint}")`),e.testID&&o.push(`#${e.testID}`),e.state){let n=[];e.state.disabled&&n.push("disabled"),e.state.selected&&n.push("selected"),e.state.checked===!0&&n.push("checked"),e.state.checked==="mixed"&&n.push("mixed"),e.state.busy&&n.push("busy"),e.state.expanded===!0&&n.push("expanded"),e.state.expanded===!1&&n.push("collapsed"),n.length&&o.push(`{${n.join(", ")}}`)}e.position&&o.push(`@(${e.position.x},${e.position.y})`),e.size&&o.push(`${e.size.w}x${e.size.h}`),console.log(" "+o.join(" "))}}break}case"find":{await bt({bridge:c,args:s,effectiveArgs:l,positional:i,inspectUsage:v});break}case"count":{await gt(c,{args:l});break}case"keyboard":{await wt(c,{json:s.includes("--json")});break}case"screens":{await St(c,{json:s.includes("--json")});break}case"memory":{await $t(c,{args:l});break}case"wait":{await It({wsPort:
|
|
207
|
+
`);for(let e of t){let o=[];if(o.push(`[${e.role}]`),e.label){let n=e.label.length>50?e.label.slice(0,47)+"...":e.label;o.push(`"${n}"`)}if(e.hint&&o.push(`(hint: "${e.hint}")`),e.testID&&o.push(`#${e.testID}`),e.state){let n=[];e.state.disabled&&n.push("disabled"),e.state.selected&&n.push("selected"),e.state.checked===!0&&n.push("checked"),e.state.checked==="mixed"&&n.push("mixed"),e.state.busy&&n.push("busy"),e.state.expanded===!0&&n.push("expanded"),e.state.expanded===!1&&n.push("collapsed"),n.length&&o.push(`{${n.join(", ")}}`)}e.position&&o.push(`@(${e.position.x},${e.position.y})`),e.size&&o.push(`${e.size.w}x${e.size.h}`),console.log(" "+o.join(" "))}}break}case"find":{await bt({bridge:c,args:s,effectiveArgs:l,positional:i,inspectUsage:v});break}case"count":{await gt(c,{args:l});break}case"keyboard":{await wt(c,{json:s.includes("--json")});break}case"screens":{await St(c,{json:s.includes("--json")});break}case"memory":{await $t(c,{args:l});break}case"wait":{await It({wsPort:N,commandTimeoutMs:J,simId:T,simIdSource:E,positional:i});break}case"sleep":{await kt({positional:i,inspectUsage:v});break}case"settle":{await vt({bridge:c,args:s,positional:i});break}case"ready":{await At({bridge:c,args:s});break}case"idle":{await _t({bridge:c,args:s,positional:i});break}case"selector":{await Ot({bridge:c,args:s,positional:i,inspectUsage:v});break}case"event":{await Ft({bridge:c,args:s,positional:i,inspectUsage:v});break}case"layout":{let t=i[1];t||(console.error(v("layout","<id>")),process.exit(1));let e=await c.send({type:"evaluate",code:`(async () => await window.__sootsimTest.getLayout(${JSON.stringify(t)}))()`});console.log(JSON.stringify(e,null,2));break}case"capture":case"screenshot":{let e=s.find((w,f)=>s[f-1]==="--output")||"/tmp/sootsim-inspect.png",o=await Dt(s,c),n={type:"screenshot"};o&&(n.crop=o);let u=(await c.send(n)).replace(/^data:image\/png;base64,/,"");o&&console.log(` area: x=${o.x} y=${o.y} w=${o.w} h=${o.h}`),(await import("fs")).writeFileSync(e,Buffer.from(u,"base64")),console.log(` saved: ${e}`);break}case"sample-color":{let t=await Dt(s,c);t||(console.error(v("sample-color","<x> <y> [w] [h] | --id <testID> | --text <text>")),console.error(" samples an averaged color from the canvas. coords are logical sootsim units."),process.exit(1));let e=await c.send({type:"evaluate",code:We(t)});if(s.includes("--json"))console.log(JSON.stringify(e,null,2));else{let{r:o,g:n,b:r,a:u,hex:m,samples:w}=e,f=t.w===1&&t.h===1?`@(${t.x},${t.y})`:`@(${t.x},${t.y}) ${t.w}x${t.h}`;console.log(` ${m} rgba(${o}, ${n}, ${r}, ${u}) ${f} ${w} samples`)}break}case"node":{let t=i[1];t||(console.error(v("node","<matcher>")),console.error(" resolves testID, id, then text \u2014 dumps full node info as JSON"),process.exit(1));let e=await c.send({type:"evaluate",code:`(async () => {
|
|
208
208
|
const t = window.__sootsimTest
|
|
209
209
|
const q = ${JSON.stringify(t)}
|
|
210
210
|
let node = null
|
|
@@ -633,7 +633,7 @@ ${o}
|
|
|
633
633
|
}
|
|
634
634
|
window.location.reload()
|
|
635
635
|
return { kind: 'page' }
|
|
636
|
-
})()`});n=!!m&&m.kind==="external-app",o=!0}catch{}console.log(" reloading...");let r=c,u=null;if(n)u=await Te(c,{timeoutMs:1e4,errorGraceMs:3e3});else{o&&await X(300);let m=await ct(
|
|
636
|
+
})()`});n=!!m&&m.kind==="external-app",o=!0}catch{}console.log(" reloading...");let r=c,u=null;if(n)u=await Te(c,{timeoutMs:1e4,errorGraceMs:3e3});else{o&&await X(300);let m=await ct(N,J,T,{timeoutMs:1e4,simIdSource:E});m?(r=m,u=await Te(m,{timeoutMs:1e4,errorGraceMs:3e3})):(console.log(" \u26A0 reload: bridge never reconnected within 10000ms"),r=null)}if(u)if(u.ready){let m=u.source==="nodes-fallback"?" (no ready signal, node-count fallback)":"";console.log(` ready in ${u.elapsedMs}ms: ${u.nodes} nodes${m}`)}else u.source==="error-bail"?console.log(` \u26A0 reload bailed after ${u.elapsedMs}ms: ${u.errors} console error(s), ready signal never fired`):console.log(` \u26A0 reload timed out after ${u.elapsedMs}ms (${u.nodes} nodes, ${u.errors} errors)`);if(r)try{let m=await r.send({type:"evaluate",code:"window.__sootsimConsole?.getErrors(10) || []"});if(r!==c&&r.close(),Array.isArray(m)&&m.length>0){console.log(`
|
|
637
637
|
\u26A0 ${m.length} error(s) during mount:
|
|
638
638
|
`);for(let w of m){let f=w.args.map($=>typeof $=="object"?JSON.stringify($):$).join(" ");if(console.log(` ${f}`),w.stack){let $=w.stack.split(`
|
|
639
639
|
`).slice(0,2);for(let _ of $)console.log(` ${_.trim()}`)}}}}catch{}u&&!u.ready&&(process.exitCode=1);break}case"eval":case"js":{let t=i.slice(1).join(" ");t||(console.error(v("js","<javascript>")),console.error(""),console.error(" runs the snippet in the engine realm. SootSim is the"),console.error(" canonical state surface \u2014 reach into it directly."),console.error(""),console.error(" examples:"),console.error(` ${b("js")} SootSim.bridges.test.findByText("Sign in")`),console.error(` ${b("js")} SootSim.bridges.debug.snapshot("before")`),console.error(` ${b("js")} SootSim.bridges.keyboard.type("hello")`),console.error(` ${b("js")} SootSim.state.root.children.length`),process.exit(1));let e=t;e.startsWith("(async")||(e=`(async () => ${e})()`);let o=await c.send({type:"evaluate",code:e});console.log(JSON.stringify(o,null,2));let n=t.toLowerCase(),r=[];(n.includes("sootsim:gohome")||n.includes("gohome"))&&r.push("sootsim shell home"),(n.includes("sootsim:appswitcher")||n.includes("appswitcher"))&&r.push("sootsim shell switcher"),(n.includes("keyboard.isvisible")||n.includes("keyboard.getmode"))&&r.push("sootsim debug state keyboard"),n.includes("interact.tap")&&r.push("sootsim do tap <x> <y>"),n.includes("keyboard.type")&&r.push("sootsim do type <text>"),(n.includes("keyboard.press")||n.includes("keyboard.dispatchkey"))&&r.push("sootsim do key <name>"),n.includes("keyboard.dismiss")&&r.push("sootsim do dismiss"),n.includes("dumptree")&&r.push("sootsim get tree"),n.includes("dumpaccessibilitytree")&&r.push("sootsim get a11y"),n.includes("getnodecount")&&r.push("sootsim get count"),n.includes("findbytext")&&r.push("sootsim find <text>"),(n.includes("findbytestid")||n.includes("findbyid"))&&r.push("sootsim find --testid <id>"),n.includes("document.hidden")&&r.push("sootsim debug state keyboard (includes tab health)"),r.length>0&&G("prefer-cli-over-eval",r);break}case"globals":{let t=await c.send({type:"evaluate",code:`(async () => {
|
|
@@ -1019,7 +1019,7 @@ ${o}
|
|
|
1019
1019
|
`);let q=new Set,H=!0,U=()=>{H=!1};process.on("SIGINT",U);try{for(;H;){let M=await $(),y=_(M);for(let p of y)p.durationMs!=null&&(q.has(p.id)||(q.add(p.id),w?console.log(JSON.stringify(p)):Pt(p)));await X(250)}}finally{process.off("SIGINT",U)}break}case"logs":{let t=i[1],e=null,o=null,n=null,r=!1,u=!1,m=!1;for(let y=0;y<l.length;y++){let p=l[y];if(p==="--filter")e=l[y+1]??null,y++;else if(p==="--limit"){let P=Number(l[y+1]);Number.isFinite(P)&&(o=P),y++}else p==="--level"?(n=l[y+1]??null,y++):p==="--tail"||p==="-f"?r=!0:p==="--json"?u=!0:(p==="--internal"||p==="--all")&&(m=!0)}let w=n?new Set(n.split(",").map(y=>y.trim()).filter(y=>y==="log"||y==="info"||y==="warn"||y==="error"||y==="debug")):null;if(t==="clear"){await st(c),console.log(" log buffer cleared");break}let f=!u&&process.stdout.isTTY===!0,$=o??(r?500:t?Number(t):50);Number.isFinite($)||(console.error(` invalid limit: ${t} \u2014 \`logs\` takes a numeric count (e.g. ${b("logs")} 100).
|
|
1020
1020
|
to target a specific sim, use \`--sim ${t}\` instead.`),process.exit(1));let _=()=>ot(c),q=y=>nt(y,{level:w,filter:e,showInternal:m});if(!r){let y=await _(),p=q(y).slice(-$);if(u){console.log(JSON.stringify(p,null,2));break}if(p.length===0){console.log(y.length===0?" no logs captured":" no matching logs");break}console.log(` ${p.length} log(s):
|
|
1021
1021
|
`);for(let P of p)Et(P,f);break}console.log(` tailing logs (ctrl-c to stop)...
|
|
1022
|
-
`);let H=new Set,U=!0,M=()=>{U=!1};process.on("SIGINT",M);try{for(;U;){let y=await _(),p=q(y);for(let P of p)H.has(P.id)||(H.add(P.id),u?console.log(JSON.stringify(P)):Et(P,f));await X(250)}}finally{process.off("SIGINT",M)}break}default:console.error(` unknown subcommand: ${h}`),process.exit(1)}if(ee.has(h)&&!s.includes("--no-wait")&&process.env.SOOTSIM_NO_AUTO_WAIT!=="1"&&await x(c),!j.has(h)&&!C(l))try{await oe(c)}catch{}}catch(t){let e=t instanceof Error?t.message:String(t);console.error(` ${h??"inspect"} failed: ${e}`);let o=/^no sim connected with id (.+)$/.exec(e),n=/^command timed out after \d+s$/.test(e)||e.startsWith("sim disconnected:")||e.startsWith("bridge never reconnected")||e.startsWith("could not connect to ws://");if(o)await ut(c,
|
|
1022
|
+
`);let H=new Set,U=!0,M=()=>{U=!1};process.on("SIGINT",M);try{for(;U;){let y=await _(),p=q(y);for(let P of p)H.has(P.id)||(H.add(P.id),u?console.log(JSON.stringify(P)):Et(P,f));await X(250)}}finally{process.off("SIGINT",M)}break}default:console.error(` unknown subcommand: ${h}`),process.exit(1)}if(ee.has(h)&&!s.includes("--no-wait")&&process.env.SOOTSIM_NO_AUTO_WAIT!=="1"&&await x(c),!j.has(h)&&!C(l))try{await oe(c)}catch{}}catch(t){let e=t instanceof Error?t.message:String(t);console.error(` ${h??"inspect"} failed: ${e}`);let o=/^no sim connected with id (.+)$/.exec(e),n=/^command timed out after \d+s$/.test(e)||e.startsWith("sim disconnected:")||e.startsWith("bridge never reconnected")||e.startsWith("could not connect to ws://");if(o)await ut(c,N,o[1]);else if(/^no sim connected$/.test(e))dt(N);else if(n)process.stderr.write(` the sim is not responding. recover it with:
|
|
1023
1023
|
sootsim close --sim <id> # force-close the wedged sim
|
|
1024
1024
|
sootsim list # confirm it's gone
|
|
1025
1025
|
`);else{try{await Le(c)}catch{}try{await O({includeTail:!0})}catch{}try{await Z({includeTail:!0})}catch{}}process.exit(1)}finally{c.close()}}export{en as runInspect};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as o}from"./chunk-L2SDB6G5.js";import"./chunk-FRANP4PR.js";import"./chunk-PTUCXL7Y.js";import"./chunk-JC5L5ZJX.js";import"./chunk-2EBGZC4A.js";import"./chunk-ZW3HKMLQ.js";import"./chunk-VGQXIMEX.js";import"./chunk-E6CRWOWO.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as b}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as b}from"./chunk-FRANP4PR.js";import{a as x}from"./chunk-FU33BTPL.js";import"./chunk-KKOOZPQP.js";import{spawn as k,spawnSync as u}from"child_process";import{chmodSync as S,createWriteStream as E,existsSync as w,mkdirSync as y,renameSync as T,rmSync as g,statSync as P}from"fs";import{tmpdir as D}from"os";import{dirname as M,join as f,resolve as v}from"path";var h="https://sootbean.com/api/electron-release";function A(){let r=process.arch;if(process.platform==="darwin"){let o=r==="arm64"?"mac-arm64":"mac-x64",n=`sootsim-latest-${o}.dmg`;return{platform:o,filename:n,url:`${h}/${n}`,install:_}}if(process.platform==="linux"){let o="sootsim-latest-linux-x64.AppImage";return{platform:"linux-x64",filename:o,url:`${h}/${o}`,install:L}}if(process.platform==="win32"){let o="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:o,url:`${h}/${o}`,install:C}}return null}async function O({url:r,dest:o,onProgress:n}){let s=await fetch(r,{redirect:"follow"});if(!s.ok)throw new Error(`download failed: ${s.status} ${s.statusText} (${r})`);let t=s.headers.get("content-length"),a=t?Number(t):null;if(!s.body)throw new Error("download failed: empty response body");y(M(o),{recursive:!0});let i=E(o),d=s.body.getReader(),c=0;try{for(;;){let{done:l,value:p}=await d.read();if(l)break;i.write(Buffer.from(p)),c+=p.byteLength,n?.(c,a)}}finally{await new Promise((l,p)=>{i.end(e=>e?p(e):l())})}}function I(r,o){let n=(r/1048576).toFixed(1);if(!o)return` ${n} MB`;let s=Math.min(100,Math.round(r/o*100)),t=(o/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${n} / ${t} MB`}async function _(r){let o=u("hdiutil",["attach","-nobrowse","-readonly",r],{encoding:"utf8"});if(o.status!==0)throw new Error(`hdiutil attach failed: ${o.stderr||o.stdout}`.trim());let n=o.stdout.trim().split(`
|
|
3
3
|
`),t=n[n.length-1].split(" ").pop()?.trim();if(!t||!w(t))throw new Error(`could not determine dmg mount point (output: ${o.stdout})`);let a=f(t,"sootsim.app");if(!w(a))throw u("hdiutil",["detach","-force",t]),new Error(`sootsim.app not found inside ${t}`);let i="/Applications",d=v(process.env.HOME||"","Applications"),c=i;try{let m=f(i,`.sootsim-write-probe-${process.pid}`);u("touch",[m]),w(m)?g(m,{force:!0}):c=d}catch{c=d}c===d&&y(c,{recursive:!0});let l=f(c,"sootsim.app");w(l)&&g(l,{recursive:!0,force:!0});let p=u("cp",["-R",a,l]),e=u("hdiutil",["detach","-force",t]);if(p.status!==0)throw new Error(`copy to ${l} failed: ${p.stderr?.toString()||""}`.trim());return e.status!==0&&console.warn(` warning: failed to unmount ${t} (${e.stderr?.toString().trim()||"unknown error"})`),u("xattr",["-dr","com.apple.quarantine",l]),l}async function L(r){let o=v(process.env.HOME||"","Applications");y(o,{recursive:!0});let n=f(o,"sootsim.AppImage");return w(n)&&g(n,{force:!0}),T(r,n),S(n,493),n}async function C(r){return await new Promise((o,n)=>{let s=k("cmd",["/c","start",'""',"/wait",r],{stdio:"inherit"});s.once("error",n),s.once("exit",t=>{t===0?o():n(new Error(`installer exited with code ${t}`))})}),r}async function Y(r){(r.includes("--help")||r.includes("-h"))&&(console.log(`
|
|
4
4
|
sootsim install-desktop \u2014 download and install the optional desktop GUI
|
|
5
5
|
|
|
@@ -20,4 +20,4 @@ examples:
|
|
|
20
20
|
`),process.exit(0));let o=r.includes("--yes")||r.includes("-y")||process.env.SOOTSIM_NO_PROMPT==="1"||process.env.CI==="1"||!process.stdin.isTTY,n=r.includes("--force"),s=x();if(s&&!n){console.log(` sootsim desktop already installed at: ${s.path}`),console.log(" pass --force to reinstall.");return}let t=A();if(t||(console.error(` no desktop build available for ${process.platform}/${process.arch}.`),console.error(" supported: darwin-arm64, darwin-x64, linux-x64, win32-x64"),process.exit(1)),console.log(` platform: ${t.platform}`),console.log(` download: ${t.url}`),console.log(),!o){if(!await b("download and install now?",!0)){console.log(" cancelled.");return}console.log()}let a=f(D(),`sootsim-install-${Date.now()}`),i=f(a,t.filename),d=0;process.stdout.write(` downloading ${t.filename}...
|
|
21
21
|
`);try{await O({url:t.url,dest:i,onProgress:(e,m)=>{let $=Date.now();$-d<100&&e<(m??1/0)||(d=$,process.stdout.isTTY&&process.stdout.write(`\r\x1B[2K${I(e,m)}`))}})}catch(e){g(a,{recursive:!0,force:!0}),console.error(`
|
|
22
22
|
download failed: ${e instanceof Error?e.message:String(e)}`),process.exit(1)}process.stdout.isTTY&&process.stdout.write(`
|
|
23
|
-
`);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-
|
|
23
|
+
`);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-GIA7FIKW.js");try{let e=await t.install(i);l({event:"cli_install_desktop_succeeded",properties:{platform:t.platform,size_bytes:c}}),console.log(` installed: ${e}`)}catch(e){l({event:"cli_install_desktop_failed",properties:{platform:t.platform,error:e instanceof Error?e.message:String(e)}}),await p(),console.error(` install failed: ${e instanceof Error?e.message:String(e)}`),console.error(` keeping download at ${i} for manual install.`),process.exit(1)}finally{g(a,{recursive:!0,force:!0})}console.log(),console.log(" next steps:"),console.log(" sootsim electron launch the desktop app"),console.log(" sootsim open <target> open a demo or bundle in it")}export{Y as runInstallDesktop};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as l,b as d,c as k,d as y,e as g}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as l,b as d,c as k,d as y,e as g}from"./chunk-UHYZO26V.js";import{d as c}from"./chunk-2EBGZC4A.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";async function a(){let s=await c();return s?.token||(process.stderr.write(" sootsim keys ... needs you to be signed in.\n run `sootsim login` first.\n"),process.exit(1)),{origin:s.origin,token:s.token}}function f(s){if(!s)return"never";try{return new Date(s).toLocaleString()}catch{return s}}async function h(s){let i=s[0];if(!i||i==="--help"||i==="-h"){u();return}if(i==="list"){let{origin:o,token:e}=await a(),n=await fetch(`${o.replace(/\/$/,"")}/api/sootsim/billing/keys`,{headers:{authorization:`Bearer ${e}`}});n.ok||(console.error(` keys list failed (${n.status})`),process.exit(1));let{keys:r}=await n.json();if(r.length===0){console.log(" no keys. create one with `sootsim keys create <label>`.");return}for(let t of r)console.log(` ${t.keyPrefix}\u2026 ${t.label.padEnd(24)} scopes=${t.scopes.join(",")} last=${f(t.lastUsedAt)} id=${t.id}`);return}if(i==="create"){let o=s[1]?.trim();o||(console.error(" usage: sootsim keys create <label>"),process.exit(1));let{origin:e,token:n}=await a(),r=await fetch(`${e.replace(/\/$/,"")}/api/sootsim/billing/keys`,{method:"POST",headers:{authorization:`Bearer ${n}`,"content-type":"application/json"},body:JSON.stringify({label:o})});r.ok||(console.error(` keys create failed (${r.status}): ${await r.text()}`),process.exit(1));let t=await r.json();console.log(`
|
|
3
3
|
created: ${t.record.label} (${t.record.keyPrefix}\u2026)`),console.log(` scopes: ${t.record.scopes.join(",")}`),console.log(`
|
|
4
4
|
secret: ${t.secret}
|
|
5
5
|
`),console.log(` copy this now \u2014 we can't show it again.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-5MRRLWSD.js";import{b as m}from"./chunk-NTEZEQSB.js";import{a as u}from"./chunk-FU33BTPL.js";import"./chunk-CBRKFAOD.js";import"./chunk-ELZHT3LB.js";import"./chunk-UH4H5HXN.js";import{D as c,E as r,F as l,y as s,z as a}from"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";import{spawn as p}from"child_process";import{existsSync as h}from"fs";async function I(n){if(n.includes("--help")||n.includes("-h")){console.log(`
|
|
3
3
|
sootsim launch \u2014 one-shot: install runtime if needed, start daemon, open app
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -13,4 +13,4 @@ options:
|
|
|
13
13
|
examples:
|
|
14
14
|
sootsim launch
|
|
15
15
|
sootsim launch --version 1.2.3
|
|
16
|
-
`);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),t=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;s(),await v({skipAutoInstall:e,channel:t,explicitVersion:f}),await d(),await x()}async function v(n){let e=a(),i=c();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:t}=await import("./runtime-
|
|
16
|
+
`);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),t=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;s(),await v({skipAutoInstall:e,channel:t,explicitVersion:f}),await d(),await x()}async function v(n){let e=a(),i=c();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:t}=await import("./runtime-QR5IHGKJ.js"),o=[];n.explicitVersion&&o.push(n.explicitVersion),n.channel!=="stable"&&o.push("--channel",n.channel),await t(["install",...o],{channel:n.channel})}async function d(){let n=r();if(l(n))return;console.log("sootsim: starting daemon");let e=w();p(e,["server","--quiet"],{detached:!0,stdio:"ignore",env:process.env}).unref();let t=Date.now()+8e3;for(;Date.now()<t;){let o=r();if(l(o))return;await g(150)}console.error(" daemon didn't become ready within 8s \u2014 check ~/.sootsim/ or run `sootsim server` in a terminal to see errors"),process.exit(1)}async function x(){u()||(console.error(" no sootsim desktop companion installed. run `sootsim install-desktop` to download electron + the shell."),process.exit(1));let e=await m.launch({});e.launched||(console.error(` ${e.message}`),process.exit(1)),console.log(` ${e.message}`)}function w(){let n=process.argv[1];return n&&h(n)?n:"sootsim"}function g(n){return new Promise(e=>setTimeout(e,n))}async function R(){s(),await d()}export{R as ensureDaemonRunning,I as runLaunch};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as f,d as m}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as f,d as m}from"./chunk-2EBGZC4A.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";import{exec as S}from"node:child_process";import{randomBytes as $}from"node:crypto";import _ from"node:http";var I=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",h="http://localhost:3000";async function x(t){if(t)return t;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${h}/api/auth/me`)).ok)return h}catch{}return I}function R(){console.log(`
|
|
3
3
|
sootsim login \u2014 sign in so desktop uploads can attach to your account
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -21,6 +21,6 @@ options:
|
|
|
21
21
|
<p style="color:#ccc">${t}</p>
|
|
22
22
|
</div>
|
|
23
23
|
</body>
|
|
24
|
-
</html>`}async function P(t){try{let o=await fetch(`${t.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(o.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!o.ok){let c=await o.text().catch(()=>"");return{ok:!1,error:`dev-login ${o.status}: ${c}`}}let e=await o.json();return e.token?{ok:!0,token:e.token,userId:e.user?.id,email:e.email}:{ok:!1,error:"dev-login response missing token"}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"dev-login fetch failed"}}}function A(t){try{let o=new URL(t).hostname;return o==="localhost"||o==="127.0.0.1"||o.endsWith(".local")}catch{return!1}}async function G(t){(t.includes("--help")||t.includes("-h"))&&(R(),process.exit(0));let o=[...t],e=await x(T(o,"--origin"));if(A(e)){console.log(` detected local origin (${e}) \u2014 signing in as dev user`);let r=await P(e);if(r.ok){f({token:r.token,user:r.userId?{id:r.userId,email:r.email}:null,origin:e,source:"cli"});let s=await m(e),l=s?.user?.email||r.email||s?.user?.id||r.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-
|
|
24
|
+
</html>`}async function P(t){try{let o=await fetch(`${t.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(o.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!o.ok){let c=await o.text().catch(()=>"");return{ok:!1,error:`dev-login ${o.status}: ${c}`}}let e=await o.json();return e.token?{ok:!0,token:e.token,userId:e.user?.id,email:e.email}:{ok:!1,error:"dev-login response missing token"}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"dev-login fetch failed"}}}function A(t){try{let o=new URL(t).hostname;return o==="localhost"||o==="127.0.0.1"||o.endsWith(".local")}catch{return!1}}async function G(t){(t.includes("--help")||t.includes("-h"))&&(R(),process.exit(0));let o=[...t],e=await x(T(o,"--origin"));if(A(e)){console.log(` detected local origin (${e}) \u2014 signing in as dev user`);let r=await P(e);if(r.ok){f({token:r.token,user:r.userId?{id:r.userId,email:r.email}:null,origin:e,source:"cli"});let s=await m(e),l=s?.user?.email||r.email||s?.user?.id||r.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-GIA7FIKW.js");n({event:"cli_login_succeeded",identity:{userId:r.userId??s?.user?.id??null},properties:{origin:e,mode:"dev"}}),await a(),console.log(` signed in${l?` as ${l}`:""} (dev)`);return}console.log(` dev-login not available (${r.error}); falling back to browser`)}let c=$(16).toString("hex"),i=await new Promise(r=>{let s=_.createServer((l,n)=>{try{let a=new URL(l.url||"/","http://127.0.0.1"),w=a.searchParams.get("state"),k=a.searchParams.get("token"),b=a.searchParams.get("email")||void 0,O=a.searchParams.get("userId")||void 0,g=a.searchParams.get("error");if(n.setHeader("content-type","text/html; charset=utf-8"),g){n.end(u(`sign-in failed: ${g}`)),r({ok:!1,error:g}),s.close();return}if(w!==c){n.end(u("state mismatch. close this tab and retry `sootsim login`.")),r({ok:!1,error:"state mismatch"}),s.close();return}if(!k){n.end(u("missing token. close this tab and retry `sootsim login`.")),r({ok:!1,error:"missing token"}),s.close();return}n.end(u("sign-in complete. you can return to the terminal.")),r({ok:!0,token:k,email:b,userId:O}),s.close()}catch(a){n.statusCode=500,n.end(u("sign-in callback failed. retry `sootsim login`.")),r({ok:!1,error:a instanceof Error?a.message:"callback failed"}),s.close()}});s.listen(0,"127.0.0.1",()=>{let l=s.address();if(!l||typeof l=="string"){r({ok:!1,error:"failed to bind callback server"}),s.close();return}let n=new URL(`${e.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",c),n.searchParams.set("port",String(l.port)),n.searchParams.set("sootbean",e),console.log(" opening browser for sootsim login..."),console.log(` waiting for callback on 127.0.0.1:${l.port}`),console.log(` if nothing opens, visit:
|
|
25
25
|
${n.toString()}
|
|
26
|
-
`),L(n.toString())})});if(!i.ok){let{trackCliEvent:r,flushCliTelemetry:s}=await import("./telemetry-
|
|
26
|
+
`),L(n.toString())})});if(!i.ok){let{trackCliEvent:r,flushCliTelemetry:s}=await import("./telemetry-GIA7FIKW.js");r({event:"cli_login_failed",properties:{origin:e,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}f({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:e,source:"cli"});let d=await m(e),p=d?.user?.email||i.email||d?.user?.id||i.userId,{trackCliEvent:y,flushCliTelemetry:v}=await import("./telemetry-GIA7FIKW.js");y({event:"cli_login_succeeded",identity:{userId:i.userId??d?.user?.id??null},properties:{origin:e}}),await v(),console.log(` signed in${p?` as ${p}`:""}`)}export{G as runLogin};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as r,b as i}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as r,b as i}from"./chunk-JC5L5ZJX.js";import{a as t,c as o}from"./chunk-2EBGZC4A.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as h,c as w}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as h,c as w}from"./chunk-GHTXP5R7.js";import"./chunk-M4HI2THN.js";import"./chunk-DLSOZVYM.js";import"./chunk-HNXQ2JP6.js";import"./chunk-UXFF7AEE.js";import"./chunk-UHYZO26V.js";import"./chunk-MSBMGQJE.js";import"./chunk-FPOQPEGK.js";import"./chunk-O56DABNK.js";import"./chunk-TRHZBTPF.js";import"./chunk-5ZB5ZN5Z.js";import"./chunk-6GZS5TCL.js";import"./chunk-NTEZEQSB.js";import"./chunk-FU33BTPL.js";import"./chunk-CBRKFAOD.js";import"./chunk-ELZHT3LB.js";import"./chunk-UH4H5HXN.js";import"./chunk-GZCZ4GCS.js";import"./chunk-B32KMMQV.js";import"./chunk-JC5L5ZJX.js";import"./chunk-2EBGZC4A.js";import"./chunk-OTWUZRFZ.js";import"./chunk-U5EQ5RWL.js";import"./chunk-ZW3HKMLQ.js";import"./chunk-VGQXIMEX.js";import"./chunk-E6CRWOWO.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";import*as i from"fs";import*as l from"path";var v=[".maestro","maestro"];function x(){console.log(`
|
|
3
3
|
sootsim maestro \u2014 run maestro YAML flows against sootsim (drop-in)
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-KKOOZPQP.js";import{resolve as c,dirname as m}from"path";import{fileURLToPath as a}from"url";var t=m(a(import.meta.resolve("sootsim-engine/package.json")));async function g(o,r){(o.includes("--help")||o.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim preview \u2014 production-like preview
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as s,c as i,d as t,e as n,f as c}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as s,c as i,d as t,e as n,f as c}from"./chunk-ELZHT3LB.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";function f(){console.log(`
|
|
3
3
|
sootsim profile \u2014 manage isolated storage profiles
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{c as w,e as b,h as m,i as f}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as w,e as b,h as m,i as f}from"./chunk-ZW3HKMLQ.js";import"./chunk-VGQXIMEX.js";import"./chunk-E6CRWOWO.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";function h(){console.log(`
|
|
3
3
|
sootsim react \u2014 inspect React component render cost in the tenant worker
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as C}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as C}from"./chunk-HNXQ2JP6.js";import"./chunk-UXFF7AEE.js";import{d as X}from"./chunk-UHYZO26V.js";import"./chunk-CBRKFAOD.js";import{d as H}from"./chunk-UH4H5HXN.js";import"./chunk-JC5L5ZJX.js";import"./chunk-2EBGZC4A.js";import{c as w,e as h}from"./chunk-ZW3HKMLQ.js";import{b as K}from"./chunk-VGQXIMEX.js";import"./chunk-E6CRWOWO.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";import{existsSync as ue,mkdirSync as O,readdirSync as me,readFileSync as fe,rmSync as W,writeFileSync as U}from"fs";import{homedir as pe,tmpdir as ge}from"os";import{dirname as P,extname as Y,join as E,resolve as we}from"path";var Q=6e4,he=3e4;async function N(e,r,o,i){let t=Math.max(2e4,i+he);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
|
|
3
3
|
the capture lock auto-releases, so simply retry the recording.
|
|
4
4
|
if it persists, recover the sim with \`sootsim close --sim <id>\`.`),process.exit(1)),/render host not available|already streaming|already recording/i.test(s)&&(console.error(` ${o} failed: ${s}
|
|
5
5
|
a prior recording was abandoned and its capture is still
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a}from"./chunk-MLPLYQGK.js";import"./chunk-ZW3HKMLQ.js";import"./chunk-VGQXIMEX.js";import"./chunk-E6CRWOWO.js";import"./chunk-5MMRIGC3.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";export{a as runRuntime};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-5MMRIGC3.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";export{a as DEFAULT_RUNTIME_CDN_ORIGIN,b as RUNTIME_CDN_ORIGIN_ENV,c as RUNTIME_CHANNEL_ENV,l as checkRuntimeUpToDate,h as fetchRuntimeManifest,j as installRuntime,d as resolveRuntimeCdnOrigin,e as resolveRuntimeChannel,i as resolveRuntimeVersion,f as runtimeManifestUrl,g as runtimeTarballUrl,k as updateRuntimeToLatest};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as S}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as S}from"./chunk-M4HI2THN.js";import"./chunk-DLSOZVYM.js";import{a as x}from"./chunk-S46M5JZP.js";import"./chunk-GZCZ4GCS.js";import"./chunk-OTWUZRFZ.js";import{f as m}from"./chunk-U5EQ5RWL.js";import{c as h,d as g,e as w,h as y}from"./chunk-ZW3HKMLQ.js";import"./chunk-VGQXIMEX.js";import"./chunk-E6CRWOWO.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";import{mkdirSync as R,writeFileSync as v}from"fs";import{dirname as _,resolve as $}from"path";async function W(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim screenshot \u2014 capture the canvas as a PNG
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as o}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as o}from"./chunk-X75XFMI4.js";import"./chunk-ZW3HKMLQ.js";import"./chunk-VGQXIMEX.js";import"./chunk-E6CRWOWO.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";async function n(e,s){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim screenshot-mode \u2014 toggle the screenshot-mode chrome overlay
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as Y}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as Y}from"./chunk-GHTXP5R7.js";import{b as j}from"./chunk-M4HI2THN.js";import"./chunk-DLSOZVYM.js";import"./chunk-HNXQ2JP6.js";import"./chunk-UXFF7AEE.js";import"./chunk-UHYZO26V.js";import{b as O}from"./chunk-MSBMGQJE.js";import"./chunk-FPOQPEGK.js";import"./chunk-O56DABNK.js";import"./chunk-TRHZBTPF.js";import"./chunk-5ZB5ZN5Z.js";import"./chunk-6GZS5TCL.js";import"./chunk-NTEZEQSB.js";import"./chunk-FU33BTPL.js";import"./chunk-CBRKFAOD.js";import"./chunk-ELZHT3LB.js";import"./chunk-UH4H5HXN.js";import"./chunk-GZCZ4GCS.js";import"./chunk-B32KMMQV.js";import"./chunk-JC5L5ZJX.js";import"./chunk-2EBGZC4A.js";import"./chunk-OTWUZRFZ.js";import{a as w,b as D,c as k,d as z,e as x,f as T}from"./chunk-U5EQ5RWL.js";import"./chunk-ZW3HKMLQ.js";import"./chunk-VGQXIMEX.js";import"./chunk-E6CRWOWO.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";import{mkdirSync as B,readFileSync as pe,writeFileSync as G}from"fs";import{tmpdir as je}from"os";import C from"path";import{mkdirSync as I,readFileSync as Q,writeFileSync as H}from"fs";import F from"path";function _(e){return e.replace(/\\/g,"/").replace(/\.png$/i,"").trim().split("/").filter(Boolean).join("--").replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"slide"}function v(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function ee(e){let t=e.trim();return/^#[0-9a-f]{3}$/i.test(t)?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t}function M(e,t){let o=ee(e),i=Math.max(0,Math.min(1,t)),n=o.match(/^#([0-9a-f]{6})$/i);if(n){let s=n[1],r=Number.parseInt(s.slice(0,2),16),a=Number.parseInt(s.slice(2,4),16),u=Number.parseInt(s.slice(4,6),16);return`rgba(${r}, ${a}, ${u}, ${i})`}return o.startsWith("rgb(")?o.replace(/^rgb\((.+)\)$/i,`rgba($1, ${i})`):o}function te(e){if(e.type==="solid")return e.color||"#000000";let t=e.direction??180,o=e.stops?.map(i=>`${i.color} ${i.offset}%`).join(", ")||"#000000 0%, #111111 100%";return`linear-gradient(${t}deg, ${o})`}function re(e){let t=e.glow;return t?`radial-gradient(circle at 50% 24%, ${M(t,.46)} 0%, ${M(t,.2)} 24%, rgba(0,0,0,0) 62%)`:"none"}function A(e){switch(e){case"tilted-left":return"perspective(2400px) rotateY(10deg) rotateZ(-2deg)";case"tilted-right":return"perspective(2400px) rotateY(-10deg) rotateZ(2deg)";case"cut-bottom":return"translateY(10%) scale(1.08)";case"cut-top":return"translateY(-16%) scale(1.08)";default:return"none"}}function L(...e){let t=e.map(o=>o.trim()).filter(o=>o.length>0&&o!=="none");return t.length>0?t.join(" "):"none"}function E(e){let t=M(e.color,e.opacity),o=M(e.color,e.opacity*.52);return`drop-shadow(0 34px ${e.spread}px ${o}) drop-shadow(0 0 ${e.blur}px ${t})`}function R(e,t){return!t.glow||e.color&&e.color!==w.color?e:{...e,color:t.glow}}function oe(e,t){if(e==="editorial-left"){let n=Math.round(t.height*.056),s=Math.round(t.height*.022);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.12)}px`,`left:${Math.round(t.width*.085)}px`,`width:${Math.round(t.width*.42)}px`,"text-align:left","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.92;`,subStyle:`font-size:${s}px;line-height:1.36;max-width:${Math.round(t.width*.36)}px;`,eyebrowStyle:"align-items:flex-start;",deviceStyle:(r,a,u)=>{let p=Math.round(t.width*.68*(a.scale??r.scale)),l=Math.round(t.height*(.03+r.offsetY+(a.offsetY??0))),c=a.pose||r.pose||"tilted-right",m=R(r.shadow,u);return["position:absolute",`top:${Math.round(t.height*.18)+l}px`,`left:${Math.round(t.width*.56)}px`,`width:${p}px`,"transform-origin:center center",`transform:${A(c)}`,`filter:${E(m)}`,"z-index:2"].join(";")}}}if(e==="minimal-bottom"){let n=Math.round(t.height*.041),s=Math.round(t.height*.019);return{copyStyle:["position:absolute",`left:${Math.round(t.width*.12)}px`,`right:${Math.round(t.width*.12)}px`,`bottom:${Math.round(t.height*.085)}px`,"text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.96;`,subStyle:`font-size:${s}px;line-height:1.34;max-width:${Math.round(t.width*.56)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(r,a,u)=>{let p=Math.round(t.width*.84*(a.scale??r.scale)),l=Math.round(t.height*(r.offsetY+(a.offsetY??0))),c=a.pose||r.pose,m=R(r.shadow,u);return["position:absolute",`top:${Math.round(t.height*.075)+l}px`,"left:50%",`width:${p}px`,"transform-origin:center center",`transform:${L("translateX(-50%)",A(c))}`,`filter:${E(m)}`,"z-index:2"].join(";")}}}let o=Math.round(t.height*.04),i=Math.round(t.height*.019);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.084)}px`,"left:50%",`width:${Math.round(t.width*.88)}px`,"transform:translateX(-50%)","text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${o}px;line-height:0.92;`,subStyle:`font-size:${i}px;line-height:1.34;max-width:${Math.round(t.width*.6)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(n,s,r)=>{let a=t.name==="ipad-13"?.54:.64,u=Math.round(t.width*a*(s.scale??n.scale)),p=Math.round(t.height*(n.offsetY+(s.offsetY??0))),l=s.pose||n.pose,c=R(n.shadow,r);return["position:absolute",`top:${Math.round(t.height*(t.name==="ipad-13"?.25:.28))+p}px`,"left:50%",`width:${u}px`,"transform-origin:center top",`transform:${L("translateX(-50%)",A(l))}`,`filter:${E(c)}`,"z-index:2"].join(";")}}}function ne({canvas:e,compose:t,slide:o,imageDataUrl:i}){let n=o.background??t.background,s=oe(t.text.preset,e),r=t.text.preset!=="none"&&!!(o.eyebrow||o.headline||o.subheadline),a=s.deviceStyle(t.frame,o,n),u=o.headline?`<div style="font-weight:780;white-space:pre-line;text-wrap:balance;${s.titleStyle}">${v(o.headline)}</div>`:"",p=o.subheadline?`<div style="margin-top:${Math.round(e.height*.018)}px;color:${t.text.subColor};white-space:pre-line;text-wrap:balance;${s.subStyle}">${v(o.subheadline)}</div>`:"",l=o.eyebrow?`<div style="display:flex;${s.eyebrowStyle}margin-bottom:${Math.round(e.height*.016)}px;"><div style="font-size:${Math.round(e.height*.014)}px;font-weight:700;letter-spacing:0.18em;text-transform:uppercase;color:${t.text.eyebrowColor};">${v(o.eyebrow)}</div></div>`:"";return`<!doctype html>
|
|
3
3
|
<html>
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8" />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as ee,c as D,d as te,e as H,f as ie,h as re,i as A,j as ne,k as se,l as oe,p as ae,s as k,t as ce,u as de,v as le,w as ue}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as ee,c as D,d as te,e as H,f as ie,h as re,i as A,j as ne,k as se,l as oe,p as ae,s as k,t as ce,u as de,v as le,w as ue}from"./chunk-NJ2ACA36.js";import"./chunk-GHFA4O5B.js";import{a as Q}from"./chunk-UXFF7AEE.js";import"./chunk-UHYZO26V.js";import{e as E}from"./chunk-O56DABNK.js";import"./chunk-6GZS5TCL.js";import"./chunk-CBRKFAOD.js";import{d as Y}from"./chunk-UH4H5HXN.js";import{a as F}from"./chunk-P2C3JX3D.js";import{a as z,b as X}from"./chunk-JC5L5ZJX.js";import"./chunk-2EBGZC4A.js";import"./chunk-ZW3HKMLQ.js";import"./chunk-VGQXIMEX.js";import{a as U}from"./chunk-E6CRWOWO.js";import{k as Z}from"./chunk-5MMRIGC3.js";import{A as $,B,D as J,E as K,F as G,G as V,H as q,I as N,u as L,v as W,y as T,z as j}from"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";import{spawn as Le}from"child_process";import w from"fs";import{createServer as Be}from"http";import S from"path";import{WebSocket as h,WebSocketServer as Ne}from"ws";import pe from"node:fs";import I from"node:path";var P=1;function Ae(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_POSTGRES||7432),Number(process.env.VITE_PORT_R2||9500)].filter(a=>Number.isFinite(a)&&a>0)}var R=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;opts;constructor(e={}){this.opts=e}registerSocket(e){this.allSockets.add(e)}unregisterSocket(e){let t=this.sessionsBySocket.get(e);if(t){for(let i of t)this.decrementSubscription(i);this.sessionsBySocket.delete(e)}this.allSockets.delete(e)}async handleMessage(e,t){let i=t?.type;if(typeof i!="string"||!i.startsWith("agent:"))return!1;let s=t.id;try{let n=await this.dispatch(e,i,t);this.respond(e,s,n)}catch(n){n instanceof k?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await oe()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
|
|
3
3
|
`)}}close(){for(let e of this.subscriptions.values())try{e.unsubscribe()}catch{}this.subscriptions.clear(),this.sessionsBySocket.clear(),this.allSockets.clear()}async dispatch(e,t,i){switch(t){case"agent:list-projects":return H();case"agent:upsert-project":return D(i.input??{});case"agent:delete-project":return re(String(i.projectId)),{ok:!0};case"agent:auto-attach-for-url":return this.autoAttachForUrl(i.input??{});case"agent:list-sessions":return ne(i.projectId?String(i.projectId):void 0);case"agent:start-session":return this.doStartSession(i.input??{});case"agent:send-prompt":{let n=String(i.sessionId),o=A(n);if(!o)throw new k("NO_SESSION",`no session: ${n}`);let r=this.normalizePromptEnvelope(i);return await de(n,r),this.notePromptAccepted(n,r,o.status==="working")}case"agent:end-session":this.dropSessionFanout(String(i.sessionId)),await le(String(i.sessionId));let s=A(String(i.sessionId));return s&&this.broadcastSessionStatus(s),{ok:!0};case"agent:get-transcript":return this.getTranscript(String(i.sessionId));case"agent:get-paths":return this.getPaths();case"agent:subscribe-events":return this.subscribeSocket(e,String(i.sessionId));case"agent:unsubscribe-events":return this.unsubscribeSocket(e,String(i.sessionId));default:throw new k("UNKNOWN_AGENT_MSG",`unknown agent message: ${t}`)}}async doStartSession(e){if(!te(e.projectId))throw new k("NO_PROJECT",`no project: ${e.projectId}`);let i=await ce(e);return this.broadcastSessionStatus(i.session),i}async autoAttachForUrl(e){let t=e.bundleUrl??"",i=(()=>{try{return new URL(t).port||null}catch{return null}})();if(!i)return{project:null};let s=this.opts.getExcludePorts?.()??Ae(),o=(await E({excludePorts:s})).find(d=>String(d.port)===i);if(!o||!o.cwd)return{project:null};let r=H().find(d=>d.cwd===o.cwd)??null,c=Array.from(new Set([...r?.knownBundleUrls??[],o.bundleUrl,t]));return{project:D({cwd:o.cwd,name:o.projectName??I.basename(o.cwd),preferredProvider:e.provider??r?.preferredProvider,sourceRoots:r?.sourceRoots??[o.cwd],knownBundleUrls:c,framework:r?.framework??ke(o.framework),bundleId:o.bundleId??r?.bundleId})}}getTranscript(e){let t=ae(e);return pe.existsSync(t)?pe.readFileSync(t,"utf8"):{error:"transcript not found",code:"NO_TRANSCRIPT"}}getPaths(){let e=ee();return{userDataDir:e,storeFile:I.join(e,"attached-projects.json"),sessionsDir:I.join(e,"sessions"),transcriptsDir:I.join(e,"transcripts")}}subscribeSocket(e,t){let i=this.sessionsBySocket.get(e);if(i||(i=new Set,this.sessionsBySocket.set(e,i)),i.has(t))return{ok:!0,refCount:this.subscriptions.get(t)?.refCount??1};i.add(t);let s=this.subscriptions.get(t);if(s)return s.refCount++,{ok:!0,refCount:s.refCount};let n=ue(t,o=>{let r=this.coalescePromptEcho(t,o);if(r&&(this.applySessionEvent(t,r),this.fanOutEvent(t,r)),o.type==="turn-completed"){let c=A(t);if(c)try{ie(c.projectId,{usd:o.costUsd,ts:o.ts})}catch(l){process.stderr.write(`[sootsim-agent] recordTurnTelemetry failed: ${l instanceof Error?l.message:String(l)}
|
|
4
4
|
`)}}});return this.subscriptions.set(t,{unsubscribe:n,refCount:1}),{ok:!0,refCount:1}}unsubscribeSocket(e,t){let i=this.sessionsBySocket.get(e);return!i||!i.has(t)?{ok:!0,refCount:0}:(i.delete(t),this.decrementSubscription(t))}decrementSubscription(e){let t=this.subscriptions.get(e);if(!t)return{ok:!0,refCount:0};if(t.refCount--,t.refCount<=0){try{t.unsubscribe()}catch{}return this.subscriptions.delete(e),{ok:!0,refCount:0}}return{ok:!0,refCount:t.refCount}}dropSessionFanout(e){let t=this.subscriptions.get(e);if(t){try{t.unsubscribe()}catch{}this.subscriptions.delete(e)}for(let i of this.sessionsBySocket.values())i.delete(e);this.clearPromptTracking(e)}normalizePromptEnvelope(e){if(e?.prompt&&typeof e.prompt=="object"){let t=e.prompt;return{text:String(t.text??""),...typeof t.displayText=="string"?{displayText:t.displayText}:{},...typeof t.inspectSummary=="string"?{inspectSummary:t.inspectSummary}:{},...typeof t.inspectTrace=="string"?{inspectTrace:t.inspectTrace}:{}}}return{text:String(e?.text??""),...typeof e?.displayText=="string"?{displayText:e.displayText}:{},...typeof e?.inspectSummary=="string"?{inspectSummary:e.inspectSummary}:{},...typeof e?.inspectTrace=="string"?{inspectTrace:e.inspectTrace}:{}}}notePromptAccepted(e,t,i){let s=Date.now(),n=this.pendingPromptEchoes.get(e)??[];n.push({sentAt:s}),this.pendingPromptEchoes.set(e,n);let o=Math.max(this.pendingTurns.get(e)??0,i?1:0)+1;this.pendingTurns.set(e,o);let r=t.displayText??t.text;return this.patchSession(e,{lastPrompt:r,status:"working",needsAttention:!1}),this.fanOutEvent(e,{type:"prompt-received",text:r,...t.inspectSummary?{inspectSummary:t.inspectSummary}:{},...t.inspectTrace?{inspectTrace:t.inspectTrace}:{},ts:s}),{ok:!0,queued:o>1,pendingTurns:o,queueDepth:Math.max(0,o-1)}}applySessionEvent(e,t){switch(t.type){case"prompt-received":case"turn-started":this.patchSession(e,{status:"working",needsAttention:!1});return;case"turn-completed":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"idle",needsAttention:!1,lastTurnFiles:t.filesTouched,currentlyEditing:void 0});return}case"approval-needed":this.patchSession(e,{status:"needs-attention",needsAttention:!0});return;case"error":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"needs-attention",needsAttention:i<=0,currentlyEditing:void 0});return}case"exited":this.clearPromptTracking(e),this.patchSession(e,{status:"ended",needsAttention:!1,wrapperPid:void 0,currentlyEditing:void 0});return;case"ready":case"turn-reasoning":case"turn-message":case"turn-plan":case"tool-call":case"file-edited":case"file-diff-delta":return}}patchSession(e,t){se(e,t);let i=A(e);i&&this.broadcastSessionStatus(i)}coalescePromptEcho(e,t){if(t.type!=="prompt-received")return t;let i=this.pendingPromptEchoes.get(e);if(!i||i.length===0)return t;for(;i.length>0&&Date.now()-i[0].sentAt>15e3;)i.shift();return i.length===0?(this.pendingPromptEchoes.delete(e),t):(i.shift(),i.length===0?this.pendingPromptEchoes.delete(e):this.pendingPromptEchoes.set(e,i),null)}consumeSettledTurn(e){let t=Math.max(0,(this.pendingTurns.get(e)??1)-1);return t>0?this.pendingTurns.set(e,t):this.pendingTurns.delete(e),t}clearPromptTracking(e){this.pendingPromptEchoes.delete(e),this.pendingTurns.delete(e)}fanOutEvent(e,t){let i=JSON.stringify({type:"agent:event",sessionId:e,event:t});for(let[s,n]of this.sessionsBySocket)if(n.has(e)&&s.readyState===P)try{s.send(i)}catch{}}broadcastSessionStatus(e){let t=JSON.stringify({type:"agent:session-status",session:e});for(let i of this.allSockets)if(i.readyState===P)try{i.send(t)}catch{}}respond(e,t,i){if(e.readyState===P)try{e.send(JSON.stringify({id:t,result:i}))}catch{}}respondError(e,t,i,s){if(e.readyState===P)try{e.send(JSON.stringify({id:t,error:i,...s?{code:s}:{}}))}catch{}}};function ke(a){return a==="expo"?"expo":a==="one"||a==="vxrn"?"one":"unknown"}import Ee from"http";import Ie from"https";var M="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36",Ce=[{hostSuffix:"uniswap.org",headers:{origin:"https://app.uniswap.org",referer:"https://app.uniswap.org/"}}];function Te(a){let e=a.toLowerCase();for(let t of Ce)if(e===t.hostSuffix||e.endsWith(`.${t.hostSuffix}`))return t.headers;return{}}function me(a){return{"accept-encoding":"identity","user-agent":M,...Te(a.hostname)}}var Pe=new Set(["host","origin","referer","user-agent","accept-encoding","cookie","connection","keep-alive","transfer-encoding","upgrade","content-length","sec-fetch-site","sec-fetch-mode","sec-fetch-dest","sec-ch-ua","sec-ch-ua-mobile","sec-ch-ua-platform"]),Re={"access-control-allow-origin":"*","access-control-allow-methods":"GET,POST,PUT,DELETE,PATCH,OPTIONS","access-control-allow-headers":"*","access-control-expose-headers":"*","access-control-max-age":"3600"};function C(a){for(let[e,t]of Object.entries(Re))a.setHeader(e,t)}function Oe(a,e){let t=[],i=e;i?.code&&t.push(i.code),i?.message&&t.push(i.message),i?.cause?.code&&t.push(i.cause.code),i?.cause?.message&&t.push(i.cause.message);let n=[...new Set(t.filter(Boolean))].join(" | ")||String(e);return a.includes("stored-in-.env.local")?`${n} | upstream url still contains placeholder env values`:n}function _e(a,e){let t={};for(let[i,s]of Object.entries(a))s&&(Pe.has(i.toLowerCase())||(t[i]=Array.isArray(s)?s.join(", "):s));return Object.assign(t,e?me(e):{"user-agent":M}),t}function he(a){return a?.startsWith("/__fetch-proxy?")||a?.startsWith("/__proxy?")||!1}function fe(a){return a?!!(a.startsWith("/__app-api?")||a.startsWith("/__app-api/")):!1}async function ge(a,e){if(a.method==="OPTIONS"){C(e),e.writeHead(204),e.end();return}let i=new URLSearchParams((a.url||"").split("?")[1]||"").get("url");if(!i){C(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("missing url param");return}let s;try{s=new URL(i)}catch{C(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("invalid url param");return}let n=_e(a.headers,s),o;if(a.method!=="GET"&&a.method!=="HEAD"){let d=[];for await(let u of a)d.push(Buffer.isBuffer(u)?u:Buffer.from(u));d.length>0&&(o=Buffer.concat(d))}let r;try{r=await fetch(s.href,{method:a.method,headers:n,body:o,redirect:"follow"})}catch(d){C(e),e.writeHead(502,{"Content-Type":"text/plain"}),e.end(`fetch proxy error: ${Oe(s.href,d)}`);return}r.headers.forEach((d,u)=>{let p=u.toLowerCase();p==="content-encoding"||p==="transfer-encoding"||p==="content-length"||p==="set-cookie"||p.startsWith("access-control-")||e.setHeader(u,d)}),C(e);let c=r.headers.getSetCookie?.()??[];c.length>0&&e.setHeader("x-sootsim-set-cookie",c.join(", ")),e.statusCode=r.status;let l=Buffer.from(await r.arrayBuffer());e.end(l)}function Se(a,e){let t=a.url||"",i="",s="";if(t.startsWith("/__app-api?")){let l=new URL(t,"http://sootsim.local");i=l.searchParams.get("path")||"",s=l.searchParams.get("origin")?.trim()||""}else if(t.startsWith("/__app-api/"))i=t.slice(10);else return!1;if(!s)return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: missing origin query param"),!0;if(a.method==="OPTIONS")return e.writeHead(204,{"Access-Control-Allow-Origin":a.headers.origin||"*","Access-Control-Allow-Methods":"GET,POST,PUT,PATCH,DELETE,OPTIONS","Access-Control-Allow-Headers":a.headers["access-control-request-headers"]||"*","Access-Control-Allow-Credentials":"true","Access-Control-Max-Age":"86400"}),e.end(),!0;let n;try{n=new URL(i,s)}catch{return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: invalid origin or path"),!0}let o=n.protocol==="https:"?Ie:Ee,r={...a.headers};delete r.host,r.host=n.host;let c=o.request({hostname:n.hostname,port:n.port||(n.protocol==="https:"?443:80),path:n.pathname+n.search,method:a.method,headers:r},l=>{let d=Object.keys(l.headers).filter(u=>{let p=u.toLowerCase();return!p.startsWith("access-control-")&&p!=="set-cookie"}).join(", ");e.writeHead(l.statusCode??502,{...l.headers,"access-control-allow-origin":a.headers.origin||"*","access-control-allow-credentials":"true","access-control-expose-headers":d}),l.pipe(e)});return c.on("error",l=>{e.statusCode=502,e.end(`app proxy error: ${l.message}`)}),a.pipe(c),!0}var De=new Set(["tap","keyboard"]),He=2e3,Me=1e3;function Ue(a){return!a||typeof a.type!="string"?!1:a.acquireLock===!0?!0:a.readOnly===!0?!1:De.has(a.type)}var Fe=5e3,We=3600*1e3,je="SOOTSIM_RUNTIME_UPDATE_INTERVAL_MS",$e={".html":"text/html; charset=utf-8",".js":"application/javascript",".cjs":"application/javascript",".mjs":"application/javascript",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".webp":"image/webp",".avif":"image/avif",".ico":"image/x-icon",".wasm":"application/wasm",".ttf":"font/ttf",".otf":"font/otf",".woff":"font/woff",".woff2":"font/woff2",".map":"application/json",".txt":"text/plain; charset=utf-8"};function ye(a,e,t){let i;try{let c=L();i=JSON.stringify(c)}catch{i="{}"}let s=e>0?`window.__sootsimBridgePort=${e};`:"",n=t?`window.__sootsimSootbeanOrigin=${JSON.stringify(t)};`:"",o=`<script>window.__sootsimSharedConfig=${i};`+s+n+`window.__sootsimCliVersion=${JSON.stringify(F())};</script>`,r=a.toString("utf8");return r.includes("</head>")?r.replace("</head>",o+"</head>"):r.includes("</body>")?r.replace("</body>",o+"</body>"):o+r}function ve(a){typeof a=="object"&&a!==null&&"unref"in a&&a.unref()}var O=class a{port;openUrlHandler;httpServer=null;wss=null;nextCommandId=1;nextSimNumber=161;sims=new Map;primarySimId=null;pendingCommands=new Map;cliBySentId=new Map;cliSimBySocket=new Map;cliLastCommandAt=new Map;cliIdentityKeyBySocket=new Map;cliLabelBySocket=new Map;restorableSims=new Map;nextCliFallbackId=1;cliIdleTimer=null;agentHost;static CLI_IDLE_TIMEOUT_MS=6e4;static CLI_LEASE_TTL_MS=6e5;static USER_ACTIVE_LEASE_TTL_MS=8e3;static USER_BOOT_LEASE_TTL_MS=6e4;static SIM_RECONNECT_TTL_MS=3e4;static SIM_IDLE_REAP_TTL_MS=30*6e4;preferredPort;portFallbackCount;simIdleReapTtlMs;shouldWriteLockfile;sootbeanOrigin=null;effectivePort=0;startedAt=0;heartbeatTimer=null;wsHeartbeatTimer=null;wsIsAlive=new WeakMap;static WS_HEARTBEAT_INTERVAL_MS=3e4;runtimeUpdateTimer=null;runtimeUpdateInFlight=null;activeRuntimeVersion=null;activeRuntimeDirPath=null;scanCache=null;scanCacheAt=0;inflightScan=null;static SCAN_FRESH_MS=2e3;constructor(e={}){this.preferredPort=e.port||7668,this.port=this.preferredPort,this.shouldWriteLockfile=e.writeLockfile===!0,this.portFallbackCount=Math.max(1,e.portFallbackCount??10),this.openUrlHandler=e.openUrl,this.agentHost=new R({getExcludePorts:e.agentScanExcludes}),this.sootbeanOrigin=e.sootbeanOrigin?.replace(/\/$/,"")||null,this.simIdleReapTtlMs=e.simIdleReapTtlMs??a.SIM_IDLE_REAP_TTL_MS}getAgentHost(){return this.agentHost}reapIdleSimsForTest(e=Date.now()){this.reapIdleSims(e)}start(e){this.startAsync(e)}async startAsync(e){if(this.httpServer||this.wss)return this.effectivePort;this.refreshActiveRuntime();for(let t=0;t<this.portFallbackCount;t++){let i=this.preferredPort+t;try{return await this.bindOnce(i,e?.silent===!0),this.effectivePort=i,this.port=i,this.startedAt=Date.now(),t>0&&!e?.silent&&process.stderr.write(`ws bridge bound to port ${i} (preferred ${this.preferredPort} was taken)
|
|
5
5
|
`),this.afterBind(),i}catch(s){if(s?.code!=="EADDRINUSE")throw s;e?.silent||process.stderr.write(`ws bridge port ${i} already in use, trying ${i+1}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a}from"./chunk-L2SDB6G5.js";import"./chunk-FRANP4PR.js";import"./chunk-PTUCXL7Y.js";import"./chunk-JC5L5ZJX.js";import"./chunk-2EBGZC4A.js";import"./chunk-ZW3HKMLQ.js";import"./chunk-VGQXIMEX.js";import"./chunk-E6CRWOWO.js";import"./chunk-TWKWXGN5.js";import"./chunk-KKOOZPQP.js";export{a as runSetupRepo};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.65 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-KKOOZPQP.js";import*as l from"fs";import*as i from"path";import{fileURLToPath as f}from"url";function g(){try{let s=f(import.meta.resolve("sootsim/package.json"));return i.join(i.dirname(s),"skills")}catch{let s=i.dirname(f(import.meta.url));return i.resolve(s,"../../skills")}}var m=g();function d(s){let n=s.match(/^---\n([\s\S]*?)\n---/);if(!n)return null;let e=n[1],o=e.match(/^name:\s*(.+)$/m),r=e.match(/^description:\s*(.+)$/m);return o?{name:o[1].trim(),description:r?.[1]?.trim()||""}:null}function p(){if(!l.existsSync(m))return[];let s=l.readdirSync(m).filter(e=>e.endsWith(".md")),n=[];for(let e of s){let o=l.readFileSync(i.join(m,e),"utf8"),r=d(o);r&&n.push({...r,filename:e})}return n}function u(s,n){let e=i.join(m,s.filename),o=i.join(n,s.filename);l.copyFileSync(e,o),console.log(` copied ${s.name} \u2192 ${o}`)}async function h(s){if(s.includes("--list")||s.includes("-l")||s.length===0){let t=p();if(t.length===0){console.log(" no skills found");return}console.log(`
|
|
3
3
|
available skills:
|
|
4
4
|
`);for(let c of t)console.log(` ${c.name}`),console.log(` ${c.description}
|
|
5
5
|
`);console.log(" usage: sootsim skills <target-dir> [skill-name...]"),console.log(" example: sootsim skills ./my-project"),console.log(` example: sootsim skills ./my-project debug perf
|