sootsim 0.1.304 → 0.1.306
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -4
- package/dist-cli/bin.js +5 -5
- package/dist-cli/chunks/{agent-EK355OQM.js → agent-43LRLQBS.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-LCJJWHZE.js → agent-wrapper-QYKQDC2Y.js} +2 -2
- package/dist-cli/chunks/{app-fonts-LIPU2DLT.js → app-fonts-IHE34DCY.js} +2 -2
- package/dist-cli/chunks/{assert-OASKCPBX.js → assert-LAXNLFZ6.js} +2 -2
- package/dist-cli/chunks/{auth-XYYKD33F.js → auth-CFTFPYKX.js} +2 -2
- package/dist-cli/chunks/{beta-TOL55XPM.js → beta-YPZFX3DF.js} +2 -2
- package/dist-cli/chunks/{camera-PHKVEQHR.js → camera-FHHHH6GY.js} +2 -2
- package/dist-cli/chunks/{chunk-XHYSASAX.js → chunk-2UC72ZR6.js} +1 -1
- package/dist-cli/chunks/{chunk-BJOT2LL6.js → chunk-3XUXMKKJ.js} +2 -2
- package/dist-cli/chunks/{chunk-HFA5ZACE.js → chunk-4735ZG3S.js} +1 -1
- package/dist-cli/chunks/{chunk-5NJTX5OP.js → chunk-4KABOHME.js} +2 -2
- package/dist-cli/chunks/chunk-4MLH5CMV.js +125 -0
- package/dist-cli/chunks/chunk-4TN4CD7M.js +15 -0
- package/dist-cli/chunks/{chunk-ITDTSNN2.js → chunk-4XGRVAXA.js} +2 -2
- package/dist-cli/chunks/{chunk-2MEUZOSD.js → chunk-6PIGQNS4.js} +1 -1
- package/dist-cli/chunks/{chunk-INBBOCU4.js → chunk-6SBFFSXO.js} +2 -2
- package/dist-cli/chunks/chunk-6SIWYEK5.js +4 -0
- package/dist-cli/chunks/{chunk-YAV6BH3A.js → chunk-6WCW6PES.js} +2 -2
- package/dist-cli/chunks/{chunk-2RLFUM3C.js → chunk-74Z7ENQL.js} +104 -127
- package/dist-cli/chunks/{chunk-RQJDIDJ3.js → chunk-7RZYUZEK.js} +1 -1
- package/dist-cli/chunks/{chunk-GF3LDVWF.js → chunk-7VVWOKJE.js} +2 -2
- package/dist-cli/chunks/chunk-B3CXF3EF.js +5 -0
- package/dist-cli/chunks/{chunk-RT7TUHH7.js → chunk-BPNVJLGT.js} +2 -2
- package/dist-cli/chunks/{chunk-3UUHIHA6.js → chunk-C6TKPNCZ.js} +2 -2
- package/dist-cli/chunks/{chunk-IWRRIQDJ.js → chunk-CLN6VD2I.js} +2 -2
- package/dist-cli/chunks/{chunk-FNI75AD7.js → chunk-FXC6BYKX.js} +1 -1
- package/dist-cli/chunks/{chunk-RJWQ3VAD.js → chunk-G73JPCHX.js} +11 -11
- package/dist-cli/chunks/{chunk-AJYA6R3N.js → chunk-HMW7QKJV.js} +2 -2
- package/dist-cli/chunks/{chunk-NXYKNKNL.js → chunk-HPCKCWSQ.js} +2 -2
- package/dist-cli/chunks/{chunk-EXW6TH3O.js → chunk-HTR4DSA5.js} +2 -2
- package/dist-cli/chunks/{chunk-RYQUO6LT.js → chunk-IGKZOI2V.js} +1 -1
- package/dist-cli/chunks/{chunk-VUR5QXVX.js → chunk-IXPUTLYO.js} +2 -2
- package/dist-cli/chunks/{chunk-GMILMS7P.js → chunk-JPQSUHXW.js} +2 -2
- package/dist-cli/chunks/chunk-KNPXTXMI.js +4 -0
- package/dist-cli/chunks/{chunk-Y5YM7XHU.js → chunk-LHCC656T.js} +1 -1
- package/dist-cli/chunks/{chunk-A4UYZTV7.js → chunk-LOXCEKKF.js} +2 -2
- package/dist-cli/chunks/{chunk-CMYVGJBQ.js → chunk-MBF4LLVB.js} +1 -1
- package/dist-cli/chunks/{chunk-V6JDDX4B.js → chunk-MCGRZYAP.js} +7 -7
- package/dist-cli/chunks/chunk-NH2KYSY7.js +4 -0
- package/dist-cli/chunks/{chunk-QWQHSUZC.js → chunk-NOLQ4UEP.js} +2 -2
- package/dist-cli/chunks/chunk-NQ56D5JF.js +4 -0
- package/dist-cli/chunks/{chunk-G4R7CPCY.js → chunk-OYFRTYRJ.js} +2 -2
- package/dist-cli/chunks/{chunk-ENXLKDQ6.js → chunk-QHGQTHHD.js} +3 -3
- package/dist-cli/chunks/{chunk-SVFN66PF.js → chunk-RYXC27XV.js} +15 -12
- package/dist-cli/chunks/{chunk-ZONISYZ5.js → chunk-TCB56ABT.js} +1 -1
- package/dist-cli/chunks/{chunk-UB3OWUVK.js → chunk-TR4FKAKQ.js} +1 -1
- package/dist-cli/chunks/{chunk-XXS4TCOO.js → chunk-U6NDLMBM.js} +24 -25
- package/dist-cli/chunks/{chunk-SN6ARNCL.js → chunk-UAYFVJ7N.js} +2 -2
- package/dist-cli/chunks/{chunk-HFKQUS4I.js → chunk-UBLLWSSF.js} +3 -3
- package/dist-cli/chunks/{chunk-MSYPDBFG.js → chunk-UTE2W4WC.js} +2 -2
- package/dist-cli/chunks/{chunk-XCVSB47R.js → chunk-UTHRVXG5.js} +2 -2
- package/dist-cli/chunks/{chunk-LRXSLMX4.js → chunk-V5PJXD2O.js} +1 -1
- package/dist-cli/chunks/{chunk-JDKWIB6V.js → chunk-VLKENZFJ.js} +1 -1
- package/dist-cli/chunks/{chunk-7RFXZXKH.js → chunk-VTPICQDM.js} +1 -1
- package/dist-cli/chunks/chunk-XZSXFV33.js +71 -0
- package/dist-cli/chunks/chunk-YBO7SFWN.js +6 -0
- package/dist-cli/chunks/{chunk-OSH6526H.js → chunk-YVWYARHY.js} +1 -1
- package/dist-cli/chunks/{cleanup-GCTEGJMP.js → cleanup-GYDCGNEJ.js} +2 -2
- package/dist-cli/chunks/{cli-version-G72HUH4E.js → cli-version-3HG7ILRV.js} +2 -2
- package/dist-cli/chunks/{compat-IC4JHGBH.js → compat-GS3SVTB4.js} +2 -2
- package/dist-cli/chunks/{config-C65MZFU3.js → config-W5LN7HWO.js} +2 -2
- package/dist-cli/chunks/control-BE55SA2W.js +4 -0
- package/dist-cli/chunks/daemon-3YMH272E.js +4 -0
- package/dist-cli/chunks/{debug-LEL32PDN.js → debug-2BBR66MJ.js} +3 -3
- package/dist-cli/chunks/desktop-PPB66SZO.js +31 -0
- package/dist-cli/chunks/{detox-SCCWUIKK.js → detox-P7SDHLB4.js} +2 -2
- package/dist-cli/chunks/{device-MTDEKDUK.js → device-JB4NSOZV.js} +2 -2
- package/dist-cli/chunks/{diagnose-UZJCKLPZ.js → diagnose-M662DIPM.js} +2 -2
- package/dist-cli/chunks/disk-cleanup-HN662P2U.js +4 -0
- package/dist-cli/chunks/drivers-ALHRJJGF.js +4 -0
- package/dist-cli/chunks/{film-YBE544PG.js → film-QZMDVCZI.js} +3 -3
- package/dist-cli/chunks/flow-BHSACBQ5.js +4 -0
- package/dist-cli/chunks/help-V2KS2AUT.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-KJYCJLSR.js → hidden-runtime-alias-LJXH6WPY.js} +2 -2
- package/dist-cli/chunks/{home-paths-NSHWNEGK.js → home-paths-TQ53NFW3.js} +2 -2
- package/dist-cli/chunks/inspect-6PW37GVK.js +4 -0
- package/dist-cli/chunks/install-desktop-VMVPZSXF.js +4 -0
- package/dist-cli/chunks/{login-AEVUU72R.js → login-7XXY5JP4.js} +4 -4
- package/dist-cli/chunks/{logout-72XHF6J2.js → logout-UNARNKTJ.js} +2 -2
- package/dist-cli/chunks/{maestro-OXSKQJ6B.js → maestro-66RNLMLU.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-AKZFORVJ.js → maestro-generate-IO25AY3E.js} +3 -3
- package/dist-cli/chunks/{mode-U6KRG2PE.js → mode-DPGASAG4.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-O5GGFNAI.js +4 -0
- package/dist-cli/chunks/{perf-KF2BJZIN.js → perf-CBUP2ERS.js} +2 -2
- package/dist-cli/chunks/{permissions-TRJG4QAI.js → permissions-3AOMCAT3.js} +2 -2
- package/dist-cli/chunks/{record-TICJYZOA.js → record-Q7VRLH7A.js} +3 -3
- package/dist-cli/chunks/{report-issue-OQPLBQMJ.js → report-issue-DTWZECYM.js} +2 -2
- package/dist-cli/chunks/runtime-VGYKLLTE.js +4 -0
- package/dist-cli/chunks/{screenshot-command-XLERKHVW.js → screenshot-command-SSWKZ4U3.js} +6 -6
- package/dist-cli/chunks/screenshot-layers-2ABSTF2O.js +20 -0
- package/dist-cli/chunks/{screenshots-capture-B6OORSD4.js → screenshots-capture-QA7T5DED.js} +2 -2
- package/dist-cli/chunks/{serve-5M7MIPWF.js → serve-T4EQBJM6.js} +3 -3
- package/dist-cli/chunks/{setup-HJZDC4PK.js → setup-BXQI3YT4.js} +2 -2
- package/dist-cli/chunks/{skills-RXHLMGGL.js → skills-AYSO5FJB.js} +2 -2
- package/dist-cli/chunks/{storage-MMPD2XBS.js → storage-KBHG5M5F.js} +2 -2
- package/dist-cli/chunks/store-GUNEQ4EC.js +4 -0
- package/dist-cli/chunks/telemetry-4VZ43AHH.js +4 -0
- package/dist-cli/chunks/{timeline-6PF5BZ37.js → timeline-AB2R26RE.js} +2 -2
- package/dist-cli/chunks/{upgrade-QSMIK3RC.js → upgrade-5XXQ7OCE.js} +2 -2
- package/dist-cli/chunks/upload-M55IQQHQ.js +4 -0
- package/dist-cli/chunks/{version-WLTFXEDC.js → version-PH3OUNPP.js} +2 -2
- package/dist-cli/chunks/{web-DI73LQ7N.js → web-XTOGNFZ7.js} +2 -2
- package/dist-cli/chunks/{what-happened-4SAMGZWR.js → what-happened-JLI3NTEU.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +43 -21
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +8 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +222 -302
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +43 -13
- package/dist-lib/sdk.cjs +47 -10
- package/dist-lib/sdk.mjs +47 -10
- package/dist-lib/skills.cjs +5708 -1217
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/scripts/dev-server-scanner.ts +9 -15
- package/scripts/optional-demo-registry.ts +52 -10
- package/skills/sootsim-debug/SKILL.md +4 -5
- package/skills/sootsim-setup/SKILL.md +29 -49
- package/src/bridge-constants.ts +15 -0
- package/src/host/bridge-host.ts +0 -16
- package/src/host/open-url.ts +2 -147
- package/src/plist.ts +27 -0
- package/src/settings-bundle.ts +2 -23
- package/src/skills/builtin/maestro-test.ts +4 -1
- package/src/vite-plugin.ts +2 -1
- package/dist-cli/chunks/chunk-76OLOD2G.js +0 -15
- package/dist-cli/chunks/chunk-ABHNOM2C.js +0 -4
- package/dist-cli/chunks/chunk-BPRMA4IC.js +0 -4
- package/dist-cli/chunks/chunk-M3ETYVNL.js +0 -4
- package/dist-cli/chunks/chunk-W3CSYOSQ.js +0 -4
- package/dist-cli/chunks/chunk-WNDYTKLC.js +0 -4
- package/dist-cli/chunks/chunk-YXHO2OUL.js +0 -7
- package/dist-cli/chunks/chunk-ZDRI2LUG.js +0 -125
- package/dist-cli/chunks/control-RWLYBKQR.js +0 -4
- package/dist-cli/chunks/daemon-D77E5G6Z.js +0 -4
- package/dist-cli/chunks/desktop-RDSISJH2.js +0 -34
- package/dist-cli/chunks/disk-cleanup-HLWRVTVW.js +0 -4
- package/dist-cli/chunks/drivers-Q7GMKTBM.js +0 -4
- package/dist-cli/chunks/flow-5VOVAVZN.js +0 -4
- package/dist-cli/chunks/help-2PESJ7V2.js +0 -4
- package/dist-cli/chunks/inspect-OIA3Q5MD.js +0 -4
- package/dist-cli/chunks/install-desktop-7KLACQUW.js +0 -4
- package/dist-cli/chunks/optional-demo-registry-L3VIWBI2.js +0 -4
- package/dist-cli/chunks/runtime-HDMLWNXW.js +0 -4
- package/dist-cli/chunks/store-APKY72ZY.js +0 -4
- package/dist-cli/chunks/telemetry-W3YRHE67.js +0 -4
- package/dist-cli/chunks/upload-HQEOYILQ.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.306 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a}from"./chunk-
|
|
4
|
+
import{a}from"./chunk-UTE2W4WC.js";import{A as l,C as u}from"./chunk-VTPICQDM.js";var c=/^[A-Za-z0-9._:-]{1,160}$/;function T(e){if(!e?.startsWith("TM_SESSION:"))return null;let n=e.slice(11).trim();return c.test(n)?n:null}function p(e){return c.test(e)}function f(){let e=process.env.DO_NOT_TRACK;return e==="1"||e==="true"||!l().productAnalytics}function m(){if(f())return null;let e=process.env.VITE_POSTHOG_API_KEY||"";if(!e)return null;let n=process.env.CONTRAST_POSTHOG_HOST||process.env.VITE_POSTHOG_HOST||"https://us.i.posthog.com";return{apiKey:e,host:n.replace(/\/+$/,"")}}function d(){try{return u()}catch{return"anonymous-cli"}}function S(e){return e?e.userId?e.userId:e.installationId!=null?`install:${e.installationId}`:e.repoId?`repo:${e.repoId}`:e.shareId?`share:${e.shareId}`:d():d()}function h(e){let n=e.identity??{},o=process.env.TM_SESSION,s=o&&p(o)?"team-machine":process.env.CI==="1"||process.env.CI==="true"||process.env.GITHUB_ACTIONS==="true"?"ci":null,t={$lib:"sootsim-cli",source:n.source??"cli",...e.properties,traffic_type:s?"automated":"human",is_automated:s!==null,...s?{automation_source:s}:{}};return n.userId&&(t.userId=n.userId),n.repoId&&(t.repoId=n.repoId),n.installationId!=null&&(t.installationId=String(n.installationId)),n.shareId&&(t.shareId=n.shareId),n.plan&&(t.plan=n.plan),{event:e.event,distinct_id:S(n),properties:t,timestamp:new Date().toISOString()}}var r=[],I=!1;async function i(){if(r.length===0)return;let e=m();if(!e){r.length=0;return}let n=r.splice(0,r.length).map(h);try{await fetch(`${e.host}/batch/`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:e.apiKey,batch:n}),signal:AbortSignal.timeout(2e3)})}catch{}}function g(){I||(I=!0,process.on("beforeExit",()=>void i()),process.on("exit",()=>void i()))}function C(e){if(f())return;g();let n=null;try{n=a()?.user?.id??null}catch{n=null}r.push({...e,identity:{source:"cli",userId:n,...e.identity}})}async function E(){await i()}export{T as a,p as b,C as c,E as d};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.306 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{I as F,m as B,n as A,p as h,u as E,w as P}from"./chunk-
|
|
4
|
+
import{I as F,m as B,n as A,p as h,u as E,w as P}from"./chunk-4735ZG3S.js";import{i as y,m as N,n as I}from"./chunk-MCGRZYAP.js";var k={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function z(e){return e.includes("--json")}function K(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
|
|
5
5
|
`)}function Q(e){process.stderr.write(`${e}
|
|
6
6
|
`)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function O(e,t,...r){return N(e,`__sootsimTest.${t}`,...r)}async function j(e,t,...r){return I(e,`SootSim.bridges.mainShell.${t}`,...r)}async function X(e,t={}){try{let r=await O(e,"waitForScreenTransitions",k);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function Z(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await j(e,t,...n)}catch(o){if(!F(o)||Date.now()>=s)throw o;await w(50)}}async function ee(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let i=0;i<s;i++){let u=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await w(o)}return null}async function te(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let i=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await i.send({type:"evaluate",code:"1"}),i}catch{i.close()}await w(o)}return null}async function ne(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,i=-1,u=o,c=null,d=!1,m={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,liveFrameActive:!1,liveFrameChannels:0,liveFramePublishes:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let a=await e.send({type:"evaluate",code:B}),g=Date.now()-o,f=Number(a?.nodes)||0,$=Number(a?.targets)||0,C=a?.liveFrameActive===!0,W=Number(a?.liveFrameChannels)||0,q=Number(a?.liveFramePublishes)||0,x=Number(a?.errors)||0,T=a?.flag===!0,p=a?.externalReady,M=typeof a?.loadingText=="string"?a.loadingText.trim():"",D=typeof a?.externalStatus=="string"?a.externalStatus.trim():"",R=typeof a?.externalError=="string"?a.externalError.trim():"",v=typeof a?.externalError=="string"&&R.length>0;if(c=p,d=v,f!==i&&(i=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,liveFrameActive:C,liveFrameChannels:W,liveFramePublishes:q,flag:a?.flag,loadingText:M,externalReady:typeof p=="boolean"?p:null,externalStatus:D,externalError:R,errors:x},T&&p!==!1&&!v&&!M&&h({liveFrameActive:C,nodes:f,targets:$})&&g-u>=A)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!T)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&h(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function H(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function L(e,t={}){let r=await e.send({type:"evaluate",code:P});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
|
|
7
7
|
console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await E(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.306 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as o}from"./chunk-
|
|
4
|
+
import{a as o}from"./chunk-UTE2W4WC.js";var c=["ghs_","ghp_","gho_","ghu_","github_pat_"];function d(n){return!!(n&&n.length>=20&&c.some(t=>n.startsWith(t)))}function p(){let n=process.env.CONTRAST_INSTALLATION_TOKEN?.trim(),t=process.env.GITHUB_TOKEN?.trim(),e=n||t;if(!d(e))return null;let r=(process.env.CONTRAST_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!r)return null;let[i,s]=r.includes("/")?r.split("/",2):[null,null],u=(process.env.CONTRAST_REPO_ID||process.env.GITHUB_REPOSITORY_ID||"").trim(),l=(process.env.CONTRAST_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:e,repoId:r,repositoryId:u||null,owner:i||null,repo:s||null,installationId:l||null,source:n?"contrast-runner":"github-actions"}}function a(){let n=process.env.SOOTSIM_API_KEY?.trim();if(n&&n.startsWith("sk_sootsim_"))return{kind:"api-key",secret:n,source:"env"};let t=p();if(t)return t;let e=o();return e?.token?{kind:"session",token:e.token,origin:e.origin}:null}function g(n){return n.kind==="api-key"?`Bearer ${n.secret}`:`Bearer ${n.token}`}function _(n){return!n||n.kind!=="github"?null:{repoId:n.repoId,owner:n.owner??void 0,repo:n.repo??void 0,installationId:n.installationId}}export{a,g as b,_ as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.306 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
var c="sootsim-agent-prompt-v1";function r(n){return typeof n=="string"?n.trim():""}function m(n){let e=r(n.text);if(!e)return"";let t=r(n.displayText),s=r(n.inspectSummary),o=r(n.inspectTrace);return!!s||!!o||/[\r\n]/.test(e)||!!t&&t!==e?JSON.stringify({__sootsimAgentPrompt:c,text:e,displayText:t,inspectSummary:s,inspectTrace:o}):e}function u(n){let e=r(n);if(!e)return null;try{let t=JSON.parse(e);if(t.__sootsimAgentPrompt!==c)return{text:e};let s=r(typeof t.text=="string"?t.text:void 0);if(!s)return null;let o=r(typeof t.displayText=="string"?t.displayText:void 0),i=r(typeof t.inspectSummary=="string"?t.inspectSummary:void 0),p=r(typeof t.inspectTrace=="string"?t.inspectTrace:void 0);return{text:s,...o?{displayText:o}:{},...i?{inspectSummary:i}:{},...p?{inspectTrace:p}:{}}}catch{return{text:e}}}export{m as a,u as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.306 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{
|
|
4
|
+
import{f}from"./chunk-B3CXF3EF.js";import{existsSync as w,mkdirSync as g,readFileSync as h,writeFileSync as S,rmSync as q}from"fs";import{tmpdir as y}from"os";import{dirname as b,join as p}from"path";var m=new Map;function o(e,t){m.set(e,t)}var s=1;function a(){return p(y(),`sootsim-cli-hints-${f()}.json`)}function d(){return p(y(),"sootsim-cli-hints-global.json")}function u(e){if(!w(e))return{version:s,shown:{}};try{let t=JSON.parse(h(e,"utf8"));return t?.version!==s||!t?.shown?{version:s,shown:{}}:t}catch{return{version:s,shown:{}}}}function l(e,t){try{g(b(e),{recursive:!0}),S(e,JSON.stringify(t)+`
|
|
5
5
|
`)}catch{}}function v(){let e=(process.env.SOOTSIM_HINTS||"").toLowerCase();return e==="off"||e==="0"||e==="false"?"off":e==="always"||e==="verbose"?"always":"normal"}function H(e,t){let i=v();if(i==="off")return!1;if(i==="always"||t==="always")return!0;let r=Date.now();if(t==="once-per-identity"){let n=u(a());return n.shown[e]?!1:(n.shown[e]=r,l(a(),n),!0)}if(t==="once-ever"){let n=u(d());return n.shown[e]?!1:(n.shown[e]=r,l(d(),n),!0)}if(typeof t=="object"&&"cooldownMs"in t){let n=u(a()),c=n.shown[e]??0;return r-c<t.cooldownMs?!1:(n.shown[e]=r,l(a(),n),!0)}return!0}function A(e,...t){let i=m.get(e);if(!i)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!H(e,i.frequency))return!1;let r=i.render(...t);if(r==null)return!1;let n=Array.isArray(r)?r:[r];for(let c of n)console.error(` hint: ${c}`);return!0}o("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`sootsim wait ready\` first.`});o("wait-selector-for-missing-testid",{frequency:"once-per-identity",render:e=>`sootsim wait selector ${e}`});o("prefer-cli-over-eval",{frequency:"once-per-identity",render:e=>e.length?["try the CLI shortcut instead:",...e.map(t=>` ${t}`)]:null});o("describe-use-filters",{frequency:"once-per-identity",render:()=>["describe output is long. narrow it with:"," sootsim describe --only '*Bottom Sheet*'"," sootsim describe --testid-like 'swap-*'"," sootsim describe --subtree <testID>"]});o("describe-filter-context",{frequency:"once-per-identity",render:()=>["filtered describe is search output, not current-route proof.","run `sootsim describe` without filters after navigation; clipped nodes are marked `(clipped:...)`."]});o("subtree-root-not-found",{frequency:"always",render:e=>`no node with testID/id "${e}" \u2014 try \`sootsim find --testid ${e}\` to discover available ids.`});o("clean-uninstall",{frequency:"once-ever",render:()=>["to remove the background daemon and all ~/.sootsim data, run `sootsim daemon uninstall`.","the optional desktop app and its macOS preference plist are separate from the daemon."]});export{A as a};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.306 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{e as p}from"./chunk-
|
|
4
|
+
import{e as p}from"./chunk-NOLQ4UEP.js";import{a as c,b as l}from"./chunk-HTR4DSA5.js";import{a}from"./chunk-UTE2W4WC.js";async function g(e,t){if(t)return t.replace(/\/$/,"");if(e.kind==="session"&&e.origin)return e.origin.replace(/\/$/,"");let i=a();return i?.origin?i.origin.replace(/\/$/,""):(await p()).replace(/\/$/,"")}async function m(e,t={}){let i=c();if(i||(process.stderr.write(`
|
|
5
5
|
sootsim ${e} needs auth before it can check recording access.
|
|
6
6
|
|
|
7
7
|
pick one:
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! sootsim v0.1.306 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
function m(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim desktop install"),console.error(""),console.error(" or run setup to install the background daemon:"),console.error(" sootsim setup"),console.error("")}function t(e){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${e}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function p(e,n,s){let r=[];try{r=await e.listSims()}catch{}if(console.error(""),r.length===0){t(n);return}console.error(` no sim with id "${s}" is connected to the bridge on port ${n}.`),console.error(""),console.error(" connected sims:");for(let o of r){let i=[o.isPrimary?"primary":null,o.readyState,o.userVisible===!1?"hidden":o.userVisible===!0?"visible":null,o.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${o.id} (${i})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}export{m as a,t as b,p as c};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.306 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.306 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{G as E,H as F,I as j,k as L,l as N,u as U,x as _}from"./chunk-
|
|
4
|
+
import{G as E,H as F,I as j,k as L,l as N,u as U,x as _}from"./chunk-VTPICQDM.js";import z from"node:fs";import G from"node:path";function A(e){return e.length<=100&&/^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(e)}function M(e){try{return z.readdirSync(e.runtimesDir(),{withFileTypes:!0}).filter(c=>c.isDirectory()).map(c=>c.name).sort(k)}catch{return[]}}function T(e,c){return G.posix.basename(e.tarballPath(c))}function k(e,c){let l=f=>{let v=f.indexOf("-"),V=v>=0?f.slice(0,v):f,$=v>=0?f.slice(v+1):"",D=V.split(".").map(I=>Number.parseInt(I,10));return D.some(I=>!Number.isFinite(I))?[[Number.POSITIVE_INFINITY],f]:[D,$]},[m,u]=l(e),[R,x]=l(c);for(let f=0;f<Math.max(m.length,R.length);f++){let v=m[f]??0,V=R[f]??0;if(v!==V)return v-V}return u===x?0:u?x?u<x?-1:1:-1:1}import{spawn as Z}from"node:child_process";import J from"node:crypto";import o from"node:fs";import Y from"node:os";import y from"node:path";import{Readable as q}from"node:stream";import{pipeline as B}from"node:stream/promises";var K=2;function H(e){function c(){try{let n=JSON.parse(o.readFileSync(e.configFile(),"utf8"));return n&&typeof n=="object"?n:{}}catch{return{}}}function l(n){let t=c();return(n||process.env[e.env.cdnOrigin]||t.cdnOrigin||e.defaultCdnOrigin).replace(/\/+$/,"")}function m(n){let t=c();return n||process.env[e.env.channel]||t.runtimeChannel||"stable"}function u(){if(!e.env.pin)return null;let n=process.env[e.env.pin];if(n&&n.trim())return n.trim();let t=c();return typeof t.runtimeVersion=="string"&&t.runtimeVersion.trim()?t.runtimeVersion.trim():null}function R(n){let t=new URL(`${l(n)}${e.manifestPath}`);return t.searchParams.set("t",String(Date.now())),t.toString()}function x(n,t){return`${l(t)}${e.tarballPath(n)}`}async function f(n){let t=R(n),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function v(n,t={}){let r=m(t.channel),i=t.version||u()||n.channels[r]?.latest;if(!i)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);if(!A(i))throw new Error(`invalid runtime version: ${i}`);let h=n.versions[i];if(!h)throw new Error(`version ${i} not found in manifest; available: ${Object.keys(n.versions).slice(-10).join(", ")||"(none)"}`);return{version:i,channel:r,entry:h}}async function V(n={}){e.ensureHome();let t=l(n.cdnOrigin),r=await f(t),{version:i,channel:h,entry:a}=v(r,n),d=e.runtimeDir(i),g=n.setActive!==!1,O=[i,...n.protectVersions??[]];if(b({protectVersions:O}),!n.force&&o.existsSync(y.join(d,e.installedMarker)))return g&&e.writeActiveRuntime(i),b({protectVersions:O}),{version:i,channel:h,cdnOrigin:t,runtimeDir:d,installed:!1,activated:g,manifest:r};let P=a.tarball||x(i,t),S=o.mkdtempSync(y.join(Y.tmpdir(),`${e.id}-runtime-download-`)),w=y.join(S,T(e,i)),p=y.join(y.dirname(d),`.installing-${i}-${process.pid}`);o.rmSync(p,{recursive:!0,force:!0});try{process.stderr.write(`${e.id}: downloading runtime ${i}\u2026
|
|
5
5
|
`),await Q(P,w),process.stderr.write(`${e.id}: extracting runtime ${i}\u2026
|
|
6
6
|
`);let s=await X(w);if(s!==a.sha256)throw new Error(`sha256 mismatch for runtime ${i}: expected ${a.sha256}, actual ${s}`);if(o.mkdirSync(p,{recursive:!0}),await ee(w,p),!o.existsSync(y.join(p,e.installedMarker)))throw new Error(`extracted tarball for runtime ${i} is missing ${e.installedMarker}`);o.rmSync(d,{recursive:!0,force:!0}),o.renameSync(p,d)}catch(s){throw o.rmSync(p,{recursive:!0,force:!0}),s}finally{o.rmSync(S,{recursive:!0,force:!0})}return g&&e.writeActiveRuntime(i),b({protectVersions:O}),{version:i,channel:h,cdnOrigin:t,runtimeDir:d,installed:!0,activated:g,manifest:r}}async function $(n={}){e.ensureHome(),b({protectVersions:n.protectVersions});let t=l(n.cdnOrigin),r=m(n.channel),i=u();if(i){let p=e.readActiveRuntime(),s=o.existsSync(y.join(e.runtimeDir(i),e.installedMarker));if(p===i&&s)return{checked:!0,updated:!1,reason:`runtime is pinned to ${i}`,activeVersion:p,latestVersion:i};let C=await V({version:i,channel:r,cdnOrigin:t,setActive:!1,protectVersions:n.protectVersions});return{checked:!0,updated:!0,reason:`runtime is pinned to ${i}`,activeVersion:i,latestVersion:i,install:C}}let h=await f(t),a=h.channels[r]?.latest;if(!a)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:e.readActiveRuntime()};if(!h.versions[a])return{checked:!0,updated:!1,reason:`manifest is missing version ${a}`,activeVersion:e.readActiveRuntime(),latestVersion:a};let g=e.readActiveRuntime(),O=g?e.runtimeDir(g):null,P=O?o.existsSync(y.join(O,e.installedMarker)):!1;if(!(!g||!P||k(a,g)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:g,latestVersion:a};let w=await V({version:a,channel:r,cdnOrigin:t,setActive:!1,protectVersions:n.protectVersions});return{checked:!0,updated:!0,activeVersion:a,latestVersion:a,install:w}}async function D(n={}){let t=e.readActiveRuntime(),r=u();if(r)return{active:t,latest:r,pinned:r,outdated:t!==r};try{let i=await f(l(n.cdnOrigin)),h=m(n.channel),a=i.channels[h]?.latest??null,d=!!(a&&(!t||k(a,t)>0));return{active:t,latest:a,pinned:null,outdated:d}}catch{return{active:t,latest:null,pinned:null,outdated:!1}}}function I(n={}){e.ensureHome();let t=Math.max(1,Math.floor(n.retainVersions??K)),r=M(e),i=new Set(r),h=e.readActiveRuntime(),a=u(),d=new Set;for(let s of[h,a,...n.protectVersions??[]])s&&i.has(s)&&d.add(s);for(let s of[...r].reverse()){if(d.size>=t)break;d.add(s)}let g="__RUNTIME_VERSION__",O=T(e,g),P=O.indexOf(g),S=O.slice(0,P),w=O.slice(P+g.length),p=[];if(P>=0)try{p=o.readdirSync(e.cacheDir(),{withFileTypes:!0}).filter(s=>{if(!s.isFile())return!1;let C=s.name.startsWith(S)&&s.name.endsWith(w),W=s.name.startsWith(S)&&s.name.endsWith(`${w}.partial`);return C||W}).map(s=>y.join(e.cacheDir(),s.name)).sort()}catch{}return{activeVersion:h,pinnedVersion:a,keepVersions:r.filter(s=>d.has(s)),removeVersions:r.filter(s=>!d.has(s)),removeCacheFiles:p}}function b(n={}){let t=I(n);for(let r of t.removeVersions)o.rmSync(e.runtimeDir(r),{recursive:!0,force:!0});for(let r of t.removeCacheFiles)o.rmSync(r,{force:!0});return t}return{product:e,resolveCdnOrigin:l,resolveChannel:m,resolvePin:u,manifestUrl:R,tarballUrl:x,fetchManifest:f,resolveVersion:v,install:V,updateToLatest:$,checkUpToDate:D,planLocalRetention:I,pruneLocalRetention:b,listInstalled:()=>M(e)}}async function Q(e,c){let l=await fetch(e);if(!l.ok||!l.body)throw new Error(`download failed: ${l.status} ${l.statusText} (${e})`);o.mkdirSync(y.dirname(c),{recursive:!0});let m=`${c}.partial`;try{await B(q.fromWeb(l.body),o.createWriteStream(m)),o.renameSync(m,c)}catch(u){try{o.unlinkSync(m)}catch{}throw u}}function X(e){return new Promise((c,l)=>{let m=J.createHash("sha256"),u=o.createReadStream(e);u.on("data",R=>m.update(R)),u.on("error",l),u.on("end",()=>c(m.digest("hex")))})}function ee(e,c){return new Promise((l,m)=>{let u=Z("tar",["-xzf",e,"-C",c],{stdio:["ignore","inherit","inherit"]});u.on("error",m),u.on("exit",R=>{R===0?l():m(new Error(`tar exited with code ${R}`))})})}var ne="https://contrast.dev",ve="https://sootsim.com/changelog",Oe="https://contrast.dev/api/changelog/sootsim",te={id:"sootsim",defaultCdnOrigin:ne,manifestPath:"/runtimes/manifest.json",tarballPath:e=>`/runtimes/sootsim-runtime-${e}.tar.gz`,installedMarker:"index.html",env:{cdnOrigin:"SOOTSIM_CDN_ORIGIN",channel:"SOOTSIM_RUNTIME_CHANNEL"},ensureHome:E,configFile:_,runtimesDir:L,runtimeDir:N,cacheDir:U,readActiveRuntime:F,writeActiveRuntime:j},ye=H(te);export{A as a,k as b,ne as c,ve as d,Oe as e,ye as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.306 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
import{createInterface as e}from"readline";var s=()=>e({input:process.stdin,output:process.stdout});function i(r){return new Promise(n=>{let t=s();t.question(r,o=>{t.close(),n(o.trim())})})}async function l(r,n=!0){let t=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${r} ${t} ${n?"y":"n"} (non-interactive)`),n;let o=await i(` ${r} ${t} `);return o===""?n:o.toLowerCase().startsWith("y")}export{l as a};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.306 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{
|
|
5
|
-
`)}var
|
|
6
|
-
`)}return t.on("message",s=>{let
|
|
7
|
-
\u26A0 ${
|
|
4
|
+
import{e as A,h as T,j as E}from"./chunk-B3CXF3EF.js";import{K as I,L as B,M as w,N as P,g as F}from"./chunk-VTPICQDM.js";var b="http://localhost:5173/";import{WebSocket as $}from"ws";var C=null;function M(){let i=F();if(C?.homeDir===i)return C.world;let r=_();return C={homeDir:i,world:r},r}function _(){let i=B();if(i&&P(i))return{source:"dev-bridge",bridgePort:i.bridgePort,shellBaseUrl:i.shellPort?`http://localhost:${i.shellPort}/`:b};let r=I();return r&&w(r)?{source:"daemon",bridgePort:r.bridgePort,shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:b}:{source:"default",bridgePort:7668,shellBaseUrl:b}}function U(i){let r=B();if(r&&P(r)&&r.bridgePort===i)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:b};let e=I();return e&&w(e)&&e.bridgePort===i?{source:"daemon",shellBaseUrl:e.runtimePort>0?`http://localhost:${e.runtimePort}/`:b}:null}function Q(i){let r;try{let l=new URL(i);r=l.port?Number(l.port):l.protocol==="https:"?443:80}catch{return null}if(!Number.isFinite(r)||r<=0)return null;let e=B();if(e&&P(e)&&(e.shellPort===r||e.runtimePort===r||e.bridgePort===r))return e.bridgePort;let o=I();return o&&w(o)&&(o.runtimePort===r||o.bridgePort===r)?o.bridgePort:null}function D(){return M().bridgePort}function z(i,r){let e=U(i),o=e?.source==="dev-bridge"?"dev bridge":e?.source==="daemon"?"daemon bridge":"bridge",l=e?`${e.source}.json`:"no lockfile",t=r??e?.shellBaseUrl;process.stderr.write(` \u2192 ${o} :${i} (${t?`shell ${t}, `:""}${l})
|
|
5
|
+
`)}var L=class extends Error{lock;constructor(r,e){super(r),this.name="BridgeSimLockedError",this.lock=e}};function N(i){return i==="flag"?"via --sim":i==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function X(i,r={}){let e=new Set,o=r.port??D(),l=r.commandTimeoutMs??15e3,t,u="none",v=new Set(r.stripBooleanFlags??[]),y=new Set(r.stripValueFlags??[]);for(let n=0;n<i.length;n++){let a=i[n];if(a==="--port"||a==="-p"){e.add(n),n+1<i.length&&(e.add(n+1),o=Number(i[n+1])),n++;continue}if(a.startsWith("--port=")){e.add(n),o=Number(a.slice(7));continue}if(a==="--timeout"){e.add(n),n+1<i.length&&(e.add(n+1),l=Number(i[n+1])),n++;continue}if(a==="--sim"||a==="--session"||a==="--tab"){e.add(n),n+1<i.length&&(e.add(n+1),t=i[n+1]?.trim()||void 0,u="flag"),n++;continue}let s=a.startsWith("--sim=")?a.slice(6):a.startsWith("--session=")?a.slice(10):a.startsWith("--tab=")?a.slice(6):void 0;if(s!==void 0){e.add(n),t=s.trim()||void 0,u="flag";continue}if(v.has(a)){e.add(n);continue}y.has(a)&&(e.add(n),n+1<i.length&&e.add(n+1),n++)}if(!t){let n=T();n&&(t=n.trim()||void 0,u="saved")}return{positional:i.filter((n,a)=>!e.has(a)),wsPort:o,simId:t,simIdSource:u,commandTimeoutMs:l}}function R(i,r={}){let e=1,o=r.commandTimeoutMs??15e3,l=new Map,t=new $(`ws://localhost:${i}`),u=A(),v=new Promise((s,d)=>{t.on("open",()=>{try{t.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:u.key,cliIdentitySource:u.source,cliLabel:r.cliLabel}))}catch{}s()}),t.on("error",c=>{let m=c.message?`: ${c.message}`:"";d(new Error(`could not connect to ws://localhost:${i}${m}`))})}),y=!1,n=!1;function a(s,d){if(n||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;n=!0;let c=d??"primary",m=N(d?r.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${m})
|
|
6
|
+
`)}return t.on("message",s=>{let d;try{d=JSON.parse(s.toString())}catch{return}if(d.id===0)return;let c=l.get(d.id);c&&(l.delete(d.id),d._otherCliCount>0&&!y&&(y=!0,process.stderr.write(`
|
|
7
|
+
\u26A0 ${d._otherCliCount} other CLI identity/identities are driving this sim
|
|
8
8
|
taps, scrolls, and keyboard input from multiple agents will collide on
|
|
9
9
|
the same screen state (this is not a bridge throughput limit).
|
|
10
10
|
use \`sootsim open --new\` for an isolated sim per agent.
|
|
11
11
|
|
|
12
|
-
`)),
|
|
12
|
+
`)),d.error?d._locked?c.reject(new L(d.error,d._locked)):c.reject(new Error(d.error)):c.resolve(d.result))}),t.on("close",(s,d)=>{let c=d?.toString()||"connection closed";for(let[m,h]of l)l.delete(m),h.reject(new Error(`sim disconnected: ${c} (code ${s})`))}),{async send(s,d){let c=d?.timeoutMs??o,m=async g=>{await v;let f=e++;return new Promise((p,W)=>{let x=setTimeout(()=>{l.delete(f),W(new Error(`command timed out after ${Math.round(c/1e3)}s`))},c);l.set(f,{resolve:k=>{clearTimeout(x),p(k)},reject:k=>{clearTimeout(x),W(k)}});let S={...s,id:f};S.simId===void 0&&g&&(S.simId=g),a(s.type??"",S.simId),t.send(JSON.stringify(S))})},h=r.simIdSource==="flag"?r.simId:T()??r.simId;try{return await m(h)}catch(g){let f=g instanceof Error?g.message:String(g),p=`no sim connected with id ${h}`;throw r.simIdSource!=="flag"&&h&&s.simId===void 0&&(f===p||f.startsWith(`${p};`))?(E(),new Error(`saved sim ${h} is gone${f.slice(p.length)}; run \`sootsim list\` and \`sootsim use <sim>\`, or open a fresh sim`)):g}},async listSims(){let s=await this.send({type:"bridge:list-sims"});return Array.isArray(s)?s:[]},async focusSim(s){return this.send({type:"focus",simId:s})},async closeSim(s){return this.send({type:"close",simId:s})},async claim(s,d={}){return await this.send({type:"bridge:claim",simId:s,force:d.force===!0})},close(){try{t.readyState===$.OPEN&&t.send(JSON.stringify({type:"bridge:bye",id:0}))}catch{}t.close();let s=setTimeout(()=>{t.readyState!==$.CLOSED&&t.terminate()},250)}}}function Y(i){return R(i.wsPort,{commandTimeoutMs:i.commandTimeoutMs,simId:i.simId,simIdSource:i.simIdSource})}function V(i,r){let e=i.filter(t=>t.readyState==="open"&&t.id!==r),o=e.find(t=>t.userFocused)??e.find(t=>t.userVisible===!0&&t.isPrimary)??e.find(t=>t.userVisible===!0)??e.find(t=>t.isPrimary);if(!o)return null;let l=[o.isPrimary?"primary":null,o.userVisible===!1?"hidden":o.userVisible===!0?"visible":null,o.userFocused?"focused":null].filter(Boolean);return`${o.id}${l.length?` [${l.join(", ")}]`:""}`}async function Z(i){try{let r=await i.send({type:"evaluate",code:`(() => ({
|
|
13
13
|
hidden: document.hidden,
|
|
14
14
|
visibilityState: document.visibilityState,
|
|
15
15
|
hasFocus: typeof document.hasFocus === 'function' ? document.hasFocus() : null,
|
|
@@ -23,4 +23,4 @@ import{b as A,e as T,g as E}from"./chunk-YXHO2OUL.js";import{K as S,L as I,M as
|
|
|
23
23
|
`+(l?` another open sim looks usable: ${l}; target it with --sim.
|
|
24
24
|
`:" run `sootsim list` to find the visible sim and target it with --sim.\n")+` page-level window.focus() cannot unhide a browser tab.
|
|
25
25
|
|
|
26
|
-
`),{hidden:!0,warned:!0,simId:e.simId}}return{hidden:!1,warned:!1,simId:e.simId}}catch{return{hidden:!1,warned:!1}}}async function ee(i,r,e={}){let
|
|
26
|
+
`),{hidden:!0,warned:!0,simId:e.simId}}return{hidden:!1,warned:!1,simId:e.simId}}catch{return{hidden:!1,warned:!1}}}async function ee(i,r,e={}){let o={type:"evaluate",code:r};return e.acquireLock&&(o.acquireLock=!0),i.send(o)}async function re(i,r,...e){return i.send({type:"call",path:r,args:e})}async function ie(i,r,...e){return i.send({type:"call",path:r,args:e,acquireLock:!0})}export{b as a,M as b,U as c,Q as d,D as e,z as f,L as g,X as h,R as i,Y as j,Z as k,ee as l,re as m,ie as n};
|