sootsim 0.1.126 → 0.1.128
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-XQDT2A2E.js → agent-KVBASG57.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-ZIBULEDW.js → agent-wrapper-CSUCCH35.js} +2 -2
- package/dist-cli/chunks/{app-fonts-J772RW3P.js → app-fonts-LK57Q63V.js} +2 -2
- package/dist-cli/chunks/{assert-LQ7RLUYW.js → assert-LMMXHK7P.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-CTWKEM4V.js +2 -0
- package/dist-cli/chunks/beta-KGUBAGXH.js +2 -0
- package/dist-cli/chunks/{chunk-E2X36IZI.js → chunk-374XJJVQ.js} +1 -1
- package/dist-cli/chunks/{chunk-TWAHJXNZ.js → chunk-3AAJ272V.js} +1 -1
- package/dist-cli/chunks/chunk-3TDPLIKL.js +2 -0
- package/dist-cli/chunks/{chunk-MJH6XTIY.js → chunk-7SSQQWXI.js} +2 -2
- package/dist-cli/chunks/{chunk-NONHFWQS.js → chunk-AJ34QMR4.js} +2 -2
- package/dist-cli/chunks/{chunk-46ALP2DD.js → chunk-ASKSZHOR.js} +3 -3
- package/dist-cli/chunks/{chunk-WTSJ25RM.js → chunk-B3HLOZ3N.js} +2 -2
- package/dist-cli/chunks/{chunk-5X6X5LES.js → chunk-CYKPWI35.js} +1 -1
- package/dist-cli/chunks/{chunk-N3F5BP3M.js → chunk-DKK3CC3D.js} +2 -2
- package/dist-cli/chunks/{chunk-KRLC6R5H.js → chunk-DTHD7QGU.js} +2 -2
- package/dist-cli/chunks/{chunk-LHXYIEZM.js → chunk-E3NRRI4M.js} +1 -1
- package/dist-cli/chunks/{chunk-QMPDHXRG.js → chunk-H7O2EPCU.js} +2 -2
- package/dist-cli/chunks/{chunk-Z72KJG4K.js → chunk-HDW4B3FW.js} +2 -2
- package/dist-cli/chunks/{chunk-DA2PKV6Q.js → chunk-HMBYOS66.js} +2 -2
- package/dist-cli/chunks/{chunk-I2VAJ6SU.js → chunk-HNRZM6GI.js} +3 -3
- package/dist-cli/chunks/{chunk-W2RSCYDO.js → chunk-HTFFTIEU.js} +1 -1
- package/dist-cli/chunks/{chunk-IV4WDF54.js → chunk-J7TYQVOU.js} +1 -1
- package/dist-cli/chunks/{chunk-R5DF7ZN7.js → chunk-JBVHVSVC.js} +2 -2
- package/dist-cli/chunks/{chunk-OTSWADHN.js → chunk-KABJPUT4.js} +1 -1
- package/dist-cli/chunks/{chunk-R677VUUU.js → chunk-KBW2VI34.js} +1 -1
- package/dist-cli/chunks/{chunk-ZHJP6ENB.js → chunk-KG3XVCAL.js} +2 -2
- package/dist-cli/chunks/{chunk-W77EWJQA.js → chunk-MQFUXG7V.js} +1 -1
- package/dist-cli/chunks/chunk-N2VJC564.js +1 -0
- package/dist-cli/chunks/{chunk-BBIGYURM.js → chunk-OAZYZXMH.js} +1 -1
- package/dist-cli/chunks/{chunk-G6DP2CFJ.js → chunk-OLXRO2UE.js} +1 -1
- package/dist-cli/chunks/{chunk-AK7USIKQ.js → chunk-OULIZJPC.js} +2 -2
- package/dist-cli/chunks/{chunk-XXNPMLXX.js → chunk-P4W42H4A.js} +3 -3
- package/dist-cli/chunks/{chunk-4HITITPE.js → chunk-PINZJVS6.js} +1 -1
- package/dist-cli/chunks/{chunk-DDK42V36.js → chunk-PSL42AVT.js} +2 -2
- package/dist-cli/chunks/{chunk-NJ3435S4.js → chunk-QNKKUBAX.js} +2 -2
- package/dist-cli/chunks/{chunk-E2BIG4B3.js → chunk-SKW6NBUP.js} +2 -2
- package/dist-cli/chunks/{chunk-4F2WVZZP.js → chunk-SQRVXVCM.js} +1 -1
- package/dist-cli/chunks/{chunk-OZSRMPSC.js → chunk-TGMTCNZ2.js} +2 -2
- package/dist-cli/chunks/{chunk-CQCMQFKK.js → chunk-TT5RWL45.js} +2 -2
- package/dist-cli/chunks/chunk-UNV6BGOP.js +1 -0
- package/dist-cli/chunks/{chunk-EGWYXC2Z.js → chunk-WBVNZ7R3.js} +2 -2
- package/dist-cli/chunks/{chunk-JWU65JVV.js → chunk-WCJMLITZ.js} +1 -1
- package/dist-cli/chunks/{chunk-2MMSLN4J.js → chunk-WEGRCMET.js} +2 -2
- package/dist-cli/chunks/{chunk-GLBMBO3X.js → chunk-X33P2PIG.js} +1 -1
- package/dist-cli/chunks/{chunk-27SE7NM3.js → chunk-XF5W3CGA.js} +2 -2
- package/dist-cli/chunks/{chunk-RA3KPNRU.js → chunk-YKUW3QNP.js} +2 -2
- package/dist-cli/chunks/{chunk-2OLYZLVT.js → chunk-ZB2LBNNH.js} +15 -15
- package/dist-cli/chunks/chunk-ZE7W2MTD.js +1 -0
- package/dist-cli/chunks/{chunk-JQZUUDUN.js → chunk-ZTHTQNVD.js} +2 -2
- package/dist-cli/chunks/cli-version-INZLODFN.js +2 -0
- package/dist-cli/chunks/{compat-KIIVGF6J.js → compat-WT4WILUH.js} +3 -3
- package/dist-cli/chunks/{config-JFMHR2HE.js → config-GKCHSOOI.js} +2 -2
- package/dist-cli/chunks/control-MSK5L3VF.js +2 -0
- package/dist-cli/chunks/{cpu-profile-3665LRD7.js → cpu-profile-HAHWXEDN.js} +2 -2
- package/dist-cli/chunks/{daemon-MDO3JYOH.js → daemon-Z2O7JY3O.js} +2 -2
- package/dist-cli/chunks/{debug-ARJ47K5P.js → debug-C7NG2DAG.js} +3 -3
- package/dist-cli/chunks/{detox-72O6RLWW.js → detox-Q45XNNH3.js} +2 -2
- package/dist-cli/chunks/{device-JARX3ONX.js → device-55XBOVDK.js} +2 -2
- package/dist-cli/chunks/{diagnose-ABHCJXCR.js → diagnose-I44BNF4T.js} +2 -2
- package/dist-cli/chunks/drivers-SYUDXJZK.js +2 -0
- package/dist-cli/chunks/{electron-G45U77TI.js → electron-XR7UGDZD.js} +3 -3
- package/dist-cli/chunks/flow-66GRPHHA.js +2 -0
- package/dist-cli/chunks/help-4VBCUZAR.js +2 -0
- package/dist-cli/chunks/{hints-HM2ZYYIF.js → hints-GTUK7PES.js} +2 -2
- package/dist-cli/chunks/{home-paths-232EBQYF.js → home-paths-N6TCKIQQ.js} +2 -2
- package/dist-cli/chunks/{inspect-YAG4RCQP.js → inspect-7WV43JZ3.js} +44 -49
- package/dist-cli/chunks/install-55EDLMPA.js +2 -0
- package/dist-cli/chunks/{install-desktop-2PS3QFFK.js → install-desktop-GFQYXJVD.js} +3 -3
- package/dist-cli/chunks/{keys-RRLRCDVB.js → keys-KHRGMVKB.js} +2 -2
- package/dist-cli/chunks/{launch-65QAKBP6.js → launch-EXL7RKQ7.js} +3 -3
- package/dist-cli/chunks/{login-VIYE4EAD.js → login-VCD33FX6.js} +4 -4
- package/dist-cli/chunks/{logout-ZI5LAJSV.js → logout-E2T66AOL.js} +2 -2
- package/dist-cli/chunks/{maestro-QD3LGRO7.js → maestro-ZANP2BL4.js} +2 -2
- package/dist-cli/chunks/{preview-6CDC72XL.js → preview-UBXWRORY.js} +2 -2
- package/dist-cli/chunks/{profile-4AYZP2AY.js → profile-XMGEEZ5K.js} +2 -2
- package/dist-cli/chunks/{react-FWQNHHU4.js → react-D6L6HQOQ.js} +2 -2
- package/dist-cli/chunks/{record-WNBQGMEW.js → record-JOHCXOWR.js} +2 -2
- package/dist-cli/chunks/runtime-SX4NL3N4.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-QCPOLACM.js → runtime-delivery-HERSJG4G.js} +2 -2
- package/dist-cli/chunks/{screenshot-YDRH5NYM.js → screenshot-B7OWAB6E.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-MWOV4YH5.js → screenshot-mode-Z5BJFBTW.js} +2 -2
- package/dist-cli/chunks/{screenshots-IVCQ4UP3.js → screenshots-XV6WVUPL.js} +2 -2
- package/dist-cli/chunks/{server-NOUN6O5W.js → server-GKB36CKN.js} +3 -3
- package/dist-cli/chunks/setup-repo-UKVZZ52B.js +2 -0
- package/dist-cli/chunks/{skills-ITSSQ57N.js → skills-KZMAEPI7.js} +2 -2
- package/dist-cli/chunks/{start-MTBOHVZB.js → start-U476YCIN.js} +4 -4
- package/dist-cli/chunks/store-JUR4T52G.js +2 -0
- package/dist-cli/chunks/telemetry-BZJQZXB2.js +2 -0
- package/dist-cli/chunks/{test-GDUXGV4Z.js → test-KZKN34BL.js} +3 -3
- package/dist-cli/chunks/{three-mode-U24VQDZC.js → three-mode-HCUMT2OW.js} +2 -2
- package/dist-cli/chunks/{timeline-JSHRI4CQ.js → timeline-EVARJJIQ.js} +2 -2
- package/dist-cli/chunks/{upgrade-V4VYWIRP.js → upgrade-NJMIIBUR.js} +2 -2
- package/dist-cli/chunks/upload-INJR46LD.js +2 -0
- package/dist-cli/chunks/{version-FDCSFJWE.js → version-VENV6XNR.js} +2 -2
- package/dist-cli/chunks/{web-SMWZNE4P.js → web-2ZJXPNQQ.js} +2 -2
- package/dist-cli/chunks/{what-happened-T74NXSMP.js → what-happened-P6T4UG2I.js} +2 -2
- package/dist-cli/chunks/{whoami-ZVUNQW67.js → whoami-MVMHRDM6.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/demo-app-registry.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +15 -10
- package/dist-lib/sdk.mjs +14 -10
- package/dist-lib/skills.cjs +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/package.json +3 -3
- package/dist-cli/chunks/auto-bootstrap-5ORFQ7N7.js +0 -2
- package/dist-cli/chunks/beta-PECTKFDT.js +0 -2
- package/dist-cli/chunks/chunk-2YI3QEGS.js +0 -1
- package/dist-cli/chunks/chunk-LIICOU6Q.js +0 -1
- package/dist-cli/chunks/chunk-NQJEALRY.js +0 -1
- package/dist-cli/chunks/chunk-OXWCMDNR.js +0 -2
- package/dist-cli/chunks/cli-version-W4R5JOIM.js +0 -2
- package/dist-cli/chunks/control-RNZSJAPQ.js +0 -2
- package/dist-cli/chunks/drivers-6GTIP5QQ.js +0 -2
- package/dist-cli/chunks/flow-NLXHSQKP.js +0 -2
- package/dist-cli/chunks/help-BPIZ5CUD.js +0 -2
- package/dist-cli/chunks/install-PGEVZLOP.js +0 -2
- package/dist-cli/chunks/runtime-G23B2OOP.js +0 -2
- package/dist-cli/chunks/setup-repo-UKUBUILR.js +0 -2
- package/dist-cli/chunks/store-3J3EUL4Z.js +0 -2
- package/dist-cli/chunks/telemetry-HVCJILV6.js +0 -2
- package/dist-cli/chunks/upload-P7IGFL7I.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-N2VJC564.js";import{a,b,c,d,e,f,g,h,i}from"./chunk-QNKKUBAX.js";import"./chunk-OAZYZXMH.js";import"./chunk-ZE7W2MTD.js";import"./chunk-SKW6NBUP.js";import"./chunk-OLXRO2UE.js";import"./chunk-CYKPWI35.js";import"./chunk-KBW2VI34.js";import"./chunk-KABJPUT4.js";export{e as ALL_DRIVERS,i as buildDriverListRows,a as chromiumDriver,b as electronDriver,f as getAllDrivers,g as getDriver,c as playwrightDriver,h as resolveDriver,d as systemDriver};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as g}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as g}from"./chunk-WCJMLITZ.js";import"./chunk-N2VJC564.js";import{a as v,g as h}from"./chunk-KG3XVCAL.js";import"./chunk-XF5W3CGA.js";import"./chunk-WEGRCMET.js";import"./chunk-ZB2LBNNH.js";import"./chunk-E3NRRI4M.js";import"./chunk-OULIZJPC.js";import{b as f,g as u}from"./chunk-QNKKUBAX.js";import{a as p}from"./chunk-OAZYZXMH.js";import"./chunk-ZE7W2MTD.js";import{c as m}from"./chunk-SKW6NBUP.js";import"./chunk-OLXRO2UE.js";import"./chunk-CYKPWI35.js";import"./chunk-3TDPLIKL.js";import"./chunk-PINZJVS6.js";import"./chunk-KBW2VI34.js";import"./chunk-KABJPUT4.js";function b(e){let r=e.indexOf("--port");if(r<0)return;let o=e[r+1],i=o?Number(o):Number.NaN;return(!Number.isInteger(i)||i<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),i}async function O(e,r){let o=b(e)??r.port;return o?h(String(o)):void 0}async function $(e,r){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim electron \u2014 launch the desktop companion
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -15,4 +15,4 @@ examples:
|
|
|
15
15
|
sootsim electron
|
|
16
16
|
sootsim electron --port 5173
|
|
17
17
|
sootsim electron --profile qa
|
|
18
|
-
`),process.exit(0));let o=e.indexOf("--driver"),i=o>=0?e[o+1]:void 0,t=e.find((n,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");t&&d&&(console.error(" sootsim electron: --profile cannot be combined with --ephemeral"),process.exit(1));let x=t?m(t).id:void 0,s=i||r.driver,l=f;if(s){let n=u(s);n||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=n}if(l.id==="electron"){let n=p();if(!n){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await g("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:I}=await import("./install-desktop-
|
|
18
|
+
`),process.exit(0));let o=e.indexOf("--driver"),i=o>=0?e[o+1]:void 0,t=e.find((n,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");t&&d&&(console.error(" sootsim electron: --profile cannot be combined with --ephemeral"),process.exit(1));let x=t?m(t).id:void 0,s=i||r.driver,l=f;if(s){let n=u(s);n||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=n}if(l.id==="electron"){let n=p();if(!n){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await g("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:I}=await import("./install-desktop-GFQYXJVD.js");await I(["--yes"]),n=p()}n||process.exit(1)}console.log(` launching ${n.path}`)}let w=await O(e,r),c=await l.launch({url:w,device:r.device,profileId:x,ephemeralProfile:d});c.launched||(console.error(` ${c.message}`),process.exit(1)),console.log(` ${c.message}`)}export{O as resolveElectronLaunchUrl,$ as runElectron};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as c,b as d,c as e,d as f}from"./chunk-P4W42H4A.js";import"./chunk-WBVNZ7R3.js";import"./chunk-UNV6BGOP.js";import"./chunk-HDW4B3FW.js";import"./chunk-ZTHTQNVD.js";import"./chunk-DKK3CC3D.js";import{d as a,e as b}from"./chunk-JBVHVSVC.js";import"./chunk-KG3XVCAL.js";import"./chunk-XF5W3CGA.js";import"./chunk-WEGRCMET.js";import"./chunk-ZB2LBNNH.js";import"./chunk-E3NRRI4M.js";import"./chunk-OULIZJPC.js";import"./chunk-QNKKUBAX.js";import"./chunk-OAZYZXMH.js";import"./chunk-ZE7W2MTD.js";import"./chunk-SKW6NBUP.js";import"./chunk-OLXRO2UE.js";import"./chunk-CYKPWI35.js";import"./chunk-AJ34QMR4.js";import"./chunk-H7O2EPCU.js";import"./chunk-DTHD7QGU.js";import"./chunk-3TDPLIKL.js";import"./chunk-PINZJVS6.js";import"./chunk-TT5RWL45.js";import"./chunk-X33P2PIG.js";import"./chunk-KBW2VI34.js";import"./chunk-KABJPUT4.js";export{c as discoverSootsimUrl,e as hoistLeadingSimFlag,a as parseFlowFile,f as runFlow,d as runFlowPlayback,b as validateFlowFile};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c}from"./chunk-B3HLOZ3N.js";import"./chunk-DTHD7QGU.js";import"./chunk-J7TYQVOU.js";import"./chunk-3TDPLIKL.js";import"./chunk-PINZJVS6.js";import"./chunk-SQRVXVCM.js";import"./chunk-MQFUXG7V.js";import"./chunk-X33P2PIG.js";import"./chunk-KBW2VI34.js";import"./chunk-KABJPUT4.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as n,c as r,d as l}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as n,c as r,d as l}from"./chunk-7SSQQWXI.js";import"./chunk-CYKPWI35.js";import"./chunk-KABJPUT4.js";function a(t){let s=t[0]??"list";if(s==="reset"){t[1]==="global"?(r(),console.log(" cleared global hint state")):(n(),console.log(" cleared hint state for this CLI identity"));return}if(s==="list"){let e=l();if(!e.length){console.log(" no hints registered");return}let i=Math.max(...e.map(o=>o.id.length));console.log(" registered hints:");for(let o of e){let c=typeof o.frequency=="string"?o.frequency:`cooldown ${o.frequency.cooldownMs}ms`;console.log(` ${o.id.padEnd(i)} ${c}`)}console.log(""),console.log(" env overrides:"),console.log(" SOOTSIM_HINTS=off suppress all hints"),console.log(" SOOTSIM_HINTS=always show every hint every time");return}console.error(` unknown subcommand: ${s}`),console.error(" usage:"),console.error(" sootsim hints list show registered hints"),console.error(" sootsim hints reset [global] clear shown-state"),process.exit(1)}export{a as runHints};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A,B,C,D,E,F,G,H,I,J,K,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A,B,C,D,E,F,G,H,I,J,K,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-KBW2VI34.js";import"./chunk-KABJPUT4.js";export{b as ACTIVE_RUNTIME_FILE,d as CONFIG_FILE,e as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,a as SOOTSIM_HOME_ENV,F as activeRuntimeDir,l as activeRuntimeFile,t as cacheDir,J as claimDaemonLockfile,E as compareSemver,v as configFilePath,r as daemonAppBundlePath,q as daemonAppDir,s as daemonAppLauncherPath,u as daemonLockfilePath,m as electronDir,n as electronUserDataDir,o as electronVersionDir,A as ensureSootsimHome,H as isDaemonLockfileFresh,h as isDevWorkstation,g as isSootsimDevCheckout,D as listInstalledRuntimes,p as profilesDir,B as readActiveRuntime,G as readDaemonLockfile,w as readSharedConfig,y as readTelemetryEnabled,K as removeDaemonLockfile,k as runtimeDir,j as runtimesDir,i as shouldSkipPersistentDaemon,f as sootsimHomeDir,C as writeActiveRuntime,I as writeDaemonLockfile,x as writeSharedConfig,z as writeTelemetryEnabled};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as G}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as G}from"./chunk-7SSQQWXI.js";import{a as wt,b as xt}from"./chunk-HTFFTIEU.js";import{a as Ye,h as $e,k as ee}from"./chunk-JBVHVSVC.js";import{b as $t,c as St,j as vt}from"./chunk-KG3XVCAL.js";import"./chunk-XF5W3CGA.js";import{a as Z,b as A,c as P,d as Pe,e as re,f as Y,g as ce,h as pe,i as yt,j as ht,k as Re,l as bt}from"./chunk-WEGRCMET.js";import{A as mt,E as pt,G as le,H as ft,N as gt,a as be,b as Ge,c as Xe,d as Ve,e as Qe,f as Ze,g as et,h as tt,i as ot,j as st,k as _e,l as Oe,p as Ae,q as nt,r as rt,s as we,t as it,u as xe,v as at,w as lt,x as ct,y as dt,z as ut}from"./chunk-ZB2LBNNH.js";import"./chunk-E3NRRI4M.js";import{c as He,e as Ue,f as Ke,g as ze,h as Fe}from"./chunk-OULIZJPC.js";import"./chunk-QNKKUBAX.js";import"./chunk-OAZYZXMH.js";import"./chunk-ZE7W2MTD.js";import"./chunk-SKW6NBUP.js";import"./chunk-OLXRO2UE.js";import{b as qe}from"./chunk-CYKPWI35.js";import{a as Je}from"./chunk-374XJJVQ.js";import{a as Ie,c as Ne}from"./chunk-J7TYQVOU.js";import{a as We}from"./chunk-3TDPLIKL.js";import"./chunk-PINZJVS6.js";import"./chunk-KBW2VI34.js";import"./chunk-KABJPUT4.js";import{existsSync as co,mkdirSync as uo,readFileSync as mo,rmSync as kt,writeFileSync as po}from"fs";import{tmpdir as fo}from"os";import{dirname as go,join as yo,resolve as ho}from"path";var fe=1,bo="SOOTSIM_INSPECT_NOTICE_PATH",wo=300*1e3,xo=15e3;function Tt(){return ho(process.env[bo]||yo(fo(),"sootsim-inspect-notice-state.json"))}function $o(e,c){return Object.fromEntries(Object.entries(e).filter(([,n])=>typeof n?.signature=="string"&&Number.isFinite(n?.updatedAt)&&c-n.updatedAt<=wo))}function So(e){let c=Tt();if(!co(c))return{version:fe,entries:{}};try{let n=JSON.parse(mo(c,"utf8"));return n.version!==fe||!n.entries||typeof n.entries!="object"?(kt(c,{force:!0}),{version:fe,entries:{}}):{version:fe,entries:$o(n.entries,e)}}catch{return kt(c,{force:!0}),{version:fe,entries:{}}}}function vo(e){let c=Tt();uo(go(c),{recursive:!0}),po(c,JSON.stringify(e,null,2)+`
|
|
3
3
|
`)}function ko(e,c){let n=c.trim()||"default";return`${e}:${n}`}function Ee(e,c,n,l={}){let m=l.nowMs??Date.now(),a=l.cooldownMs??xo,g=So(m),y=ko(e,c),T=g.entries[y];return T&&T.signature===n&&m-T.updatedAt<a?!1:(g.entries[y]={signature:n,updatedAt:m},vo(g),!0)}var To={initialWaitMs:3e3,deadlineMs:5e3,retryWaitMs:700},Mo={initialWaitMs:1200,deadlineMs:2500,retryWaitMs:700};function Io(e,c={}){return{...e?To:Mo,...c}}function de(e){return!(!e||e.hit===!1||e.ok===!1||e.pointerTapHandled===!1&&!e.keyboardOpened&&!e.isTextInput)}function No(e,c){return{id:e.target?.id??e.match?.id??e.node?.id??null,testID:e.target?.testID??e.match?.testID??e.node?.testID??null,text:e.target?.text??e.target?.accessibilityLabel??e.match?.text??e.match?.accessibilityLabel??e.node?.text??c??null,type:e.target?.type??e.match?.type??e.node?.type??null}}async function ge(e,c){let n=Io(!!c.agent,c.timing),l=0,m=null,a=null;try{await ee({bridge:e,maxMs:n.initialWaitMs,pollMs:32,stablePolls:2})}catch{}let g=Date.now()+n.deadlineMs;for(;Date.now()<=g||l===0;){l++;let y=await c.resolve();if(m=y,y?.error==="bridge-not-ready"||y?.ambiguous||y?.nthOutOfRange)return{payload:y,result:null,attempts:l,failure:"special"};if(y&&typeof y.cx=="number"&&typeof y.cy=="number"){let M=await e.send({type:"tap",x:y.cx,y:y.cy,target:No(y,c.textFallback)});if(a=M,de(M))return{payload:y,result:M,attempts:l}}let T=g-Date.now();if(T<=0)break;try{await ee({bridge:e,maxMs:Math.min(T,n.retryWaitMs),pollMs:32,stablePolls:2})}catch{await new Promise(M=>setTimeout(M,Math.min(120,T)))}}return{payload:m,result:a,attempts:l,failure:m&&typeof m.cx=="number"?"missed":"not-found"}}async function Mt(e,c,n,l){return e.send({type:"tap",x:c,y:n,...l?{target:l}:{}})}async function It(e,c,n={}){let l=JSON.stringify(c);return ge(e,{agent:n.agent,timing:n.timing,resolve:()=>e.send({type:"evaluate",code:`(async () => {
|
|
4
4
|
const t = window.__sootsimTest
|
|
5
5
|
if (!t) return null
|
|
@@ -197,16 +197,16 @@ import{a as G}from"./chunk-MJH6XTIY.js";import{a as wt,b as xt}from"./chunk-W2RS
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
return { strategy: 'none' }
|
|
200
|
-
})()`});if(!m||!("node"in m))return m;let a=m.node,g=a.absolutePosition.x+a.layout.width/2,y=a.absolutePosition.y+a.layout.height/2;return{...m,cx:g,cy:y,target:{id:a.id,testID:a.testID,text:m.strategy==="text"?c:a.text,type:a.type}}}})}async function _t(e,c={args:[]}){let n=await Xe(e);if(A(c.args)){P(n);return}console.log(` nodes: ${n.nodes}`)}function
|
|
201
|
-
`),ae=[];for(let o of
|
|
202
|
-
`)}console.log(X),Q>0&&console.log(` ${Q} clipped row(s) hidden (omit --no-clipped to see)`);let ne=B||I||
|
|
203
|
-
`).length>=80&&G("describe-use-filters"),W&&W.visible){let
|
|
200
|
+
})()`});if(!m||!("node"in m))return m;let a=m.node,g=a.absolutePosition.x+a.layout.width/2,y=a.absolutePosition.y+a.layout.height/2;return{...m,cx:g,cy:y,target:{id:a.id,testID:a.testID,text:m.strategy==="text"?c:a.text,type:a.type}}}})}async function _t(e,c={args:[]}){let n=await Xe(e);if(A(c.args)){P(n);return}console.log(` nodes: ${n.nodes}`)}function De(e,c){let n=e.indexOf(c);return n>=0&&n+1<e.length?e[n+1]:null}async function Ot(e){let{bridge:c,args:n,positional:l}=e,m=n.includes("--verbose")||n.includes("-v"),a=A(n),g=m&&!a,y=n.includes("--watch")||n.includes("-w"),T=1e3,M=n.includes("--compact"),h=n.includes("--no-xy"),k=n.includes("--no-clipped"),_=n.includes("--include-occluded"),I=De(n,"--testid-like"),R=De(n,"--only"),j=De(n,"--subtree"),d=l[1]&&!l[1].startsWith("-")?l[1]:void 0,z=d?/[*?]/.test(d):!1,B=!z&&!R?d:void 0,D=R??(z?d:void 0),V=async()=>{await ce(c,{verbose:g});let S=await Ze(c,{describe:!0,verbose:m,filter:B||"",testIdLike:I||void 0,onlyGlob:D||void 0,subtreeRoot:j||void 0,compact:M,hideXy:h,includeOccluded:_}),N=S?.tree,J=S?.shell,W=S?.keyboard;if(a){P({shell:J,tree:N??"",keyboard:W});return}if(J&&typeof J=="object"){let C=[J.state?`state=${J.state}`:null,J.activeApp?`app=${J.activeApp}`:null,J.showSwitcher?"switcher":null,J.switcherPhase&&J.switcherPhase!=="idle"?`phase=${J.switcherPhase}`:null].filter(Boolean);C.length>0&&console.log(` shell: ${C.join(" ")}`)}if(typeof N=="string"&&N.startsWith("__SUBTREE_NOT_FOUND__:")){let C=N.slice(22);console.log(` subtree root not found: ${C}`),G("subtree-root-not-found",C);return}if(!N){let C=S?.nodeCount??0;console.log(" no matching nodes found"),!(B||I||D||j)&&C<10&&G("app-still-loading",C);return}let X=N,Q=0;if(k&&typeof X=="string"){let C=X.split(`
|
|
201
|
+
`),ae=[];for(let o of C){if(o.includes("(clipped:")){Q+=1;continue}ae.push(o)}X=ae.join(`
|
|
202
|
+
`)}console.log(X),Q>0&&console.log(` ${Q} clipped row(s) hidden (omit --no-clipped to see)`);let ne=B||I||D||j;if((B||I||D)&&!y&&G("describe-filter-context"),!ne&&!y&&N.split(`
|
|
203
|
+
`).length>=80&&G("describe-use-filters"),W&&W.visible){let C=W.spec,ae=[C?.keyboardType?`type=${C.keyboardType}`:null,C?.returnKeyType&&C.returnKeyType!=="default"?`return=${C.returnKeyType}`:null,W.mode!=="letters"?`mode=${W.mode}`:null,W.shifted?"shift":null,W.capsLock?"caps":null,C?.autoCapitalize&&C.autoCapitalize!=="sentences"?`autoCap=${C.autoCapitalize}`:null,W.accessoryBarId?`accessory=${W.accessoryBarId}`:null].filter(Boolean);console.log(`
|
|
204
204
|
keyboard: ${ae.join(" ")||"visible"}`)}};if(y)for(console.log(` watching... (Ctrl+C to stop)
|
|
205
|
-
`);;)console.clear(),await V(),await Z(T);else await V()}var Fo=["SOOTSIM_AGENT","CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","CURSOR_TRACE_ID","AIDER_MODEL"];function ue(){if(process.env.SOOTSIM_AGENT==="0")return!1;for(let e of Fo){let c=process.env[e];if(c&&c.trim()&&c!=="0")return!0}return!1}async function At(e){let{bridge:c,args:n,effectiveArgs:l,positional:m,inspectUsage:a}=e,g=S=>{let N=l.indexOf(S);return N>=0&&N+1<l.length?l[N+1]:null},y=S=>l.includes(S),T=g("--testid")||g("--test-id"),M=g("--role"),h=g("--type"),k=g("--text"),_=y("--pressable"),I=y("--visible"),R=y("--interactive-targets")||y("--actions"),j=!T&&!M&&!h&&!k&&!_&&!I&&!R?m[1]:null,d=k??j,z=await st(c,{testId:T,role:M,type:h,text:d,pressable:_,visible:I,interactive:R});z||(console.error(a("find","<text> | --text <t> | --testid <id> | --role <r> | --type <t> | --pressable | --visible | --interactive-targets")),process.exit(1));let{mode:B,result:
|
|
205
|
+
`);;)console.clear(),await V(),await Z(T);else await V()}var Fo=["SOOTSIM_AGENT","CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","CURSOR_TRACE_ID","AIDER_MODEL"];function ue(){if(process.env.SOOTSIM_AGENT==="0")return!1;for(let e of Fo){let c=process.env[e];if(c&&c.trim()&&c!=="0")return!0}return!1}async function At(e){let{bridge:c,args:n,effectiveArgs:l,positional:m,inspectUsage:a}=e,g=S=>{let N=l.indexOf(S);return N>=0&&N+1<l.length?l[N+1]:null},y=S=>l.includes(S),T=g("--testid")||g("--test-id"),M=g("--role"),h=g("--type"),k=g("--text"),_=y("--pressable"),I=y("--visible"),R=y("--interactive-targets")||y("--actions"),j=!T&&!M&&!h&&!k&&!_&&!I&&!R?m[1]:null,d=k??j,z=await st(c,{testId:T,role:M,type:h,text:d,pressable:_,visible:I,interactive:R});z||(console.error(a("find","<text> | --text <t> | --testid <id> | --role <r> | --type <t> | --pressable | --visible | --interactive-targets")),process.exit(1));let{mode:B,result:D}=z,V=A(n),te=n.includes("--verbose")||n.includes("--dump");if(V)B==="interactive-targets"&&Array.isArray(D)?P(_e(D).map(S=>({...S,tap:Oe(S)}))):P(D??null);else if(Array.isArray(D))if(D.length===0){console.log(` no ${B} nodes found`);let S=await c.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount?.()) || 0)()"});typeof S=="number"&&S<10&&G("app-still-loading",S)}else if(B==="interactive-targets"){let S=_e(D);console.log(` found ${S.length} interactive target${S.length===1?"":"s"} (sorted by score):`);for(let N of S.slice(0,20)){let J=N.absolutePosition?`@(${Math.round(N.absolutePosition.x)},${Math.round(N.absolutePosition.y)})`:"",W=N.layout?`${Math.round(N.layout.width)}x${Math.round(N.layout.height)}`:"?x?",X=N.text?` "${N.text.slice(0,30)}"`:"",Q=N.testID?` #${N.testID}`:"",ne=N.accessibilityLabel?` \u24D8"${String(N.accessibilityLabel).slice(0,24)}"`:"",me=N.accessibilityRole?`[${N.accessibilityRole}]`:N.type,C=Oe(N);console.log(` ${me}${X}${ne}${Q} ${W} ${J}`),console.log(` \u2192 ${C}`),te&&console.log(Ce(JSON.stringify(N,null,2)," "))}S.length>20&&console.log(` ... and ${S.length-20} more`)}else{console.log(` found ${D.length} node${D.length===1?"":"s"} (${B}):`);for(let S of D.slice(0,20)){let N=S.absolutePosition?`@(${Math.round(S.absolutePosition.x)},${Math.round(S.absolutePosition.y)})`:"",J=S.layout?`${Math.round(S.layout.width)}x${Math.round(S.layout.height)}`:"?x?",W=S.text?` "${S.text.slice(0,30)}"`:"",X=S.testID?` #${S.testID}`:"",Q=S.pressable?" (tap)":"",ne=S.accessibilityRole?`[${S.accessibilityRole}]`:S.type;console.log(` ${ne}${W}${X} ${J} ${N}${Q}`),te&&console.log(Ce(JSON.stringify(S,null,2)," "))}D.length>20&&console.log(` ... and ${D.length-20} more`)}else if(D==null)console.log(` not found: ${d||T||M||h||""||B}`),T&&G("wait-selector-for-missing-testid",T);else{let S=D;if(S.type&&S.absolutePosition){let N=`@(${Math.round(S.absolutePosition.x)},${Math.round(S.absolutePosition.y)})`,J=S.layout?`${Math.round(S.layout.width)}x${Math.round(S.layout.height)}`:"?x?",W=S.text?` "${S.text.slice(0,40)}"`:"",X=S.testID?` #${S.testID}`:"",Q=S.pressable?" (tap)":"",ne=S.accessibilityRole?`[${S.accessibilityRole}]`:S.type;console.log(` ${ne}${W}${X} ${J} ${N}${Q}`),te&&console.log(Ce(JSON.stringify(S,null,2)," "))}else console.log(JSON.stringify(D,null,2))}}function Ce(e,c){return e.split(`
|
|
206
206
|
`).map(n=>c+n).join(`
|
|
207
207
|
`)}async function Pt(e){let{bridge:c,args:n}=e,l=A(n);await ce(c,{verbose:!l});let m=await et(c);if(l){P({count:m.length,elements:m});return}console.log(` layout (${m.length} element${m.length===1?"":"s"}):
|
|
208
208
|
`),console.log(tt(m))}async function Rt(e,c={}){let n=await pt(e);if("error"in n&&(console.error(n.error),process.exit(1)),c.json){console.log(JSON.stringify(n,null,2));return}let{visible:l,spec:m,mode:a,shifted:g,capsLock:y,accessoryBarId:T}=n,M=[];M.push(`keyboard: ${l?"visible":"hidden"}`),m?(M.push(` type: ${m.keyboardType}`),M.push(` returnKey: ${m.returnKeyType}`),M.push(` autoCap: ${m.autoCapitalize}`),M.push(` autoCorrect: ${m.autoCorrect?"on":"off"}`),M.push(` appearance: ${m.keyboardAppearance}`),m.secureTextEntry&&M.push(" secureTextEntry: true"),m.enablesReturnKeyAutomatically&&M.push(` return: ${m.currentTextIsEmpty?"disabled (empty)":"enabled"}`)):M.push(" spec: <none> (shown via dev-tools with no TextInput)"),M.push(` mode: ${a}${g?" (shifted)":""}${y?" (caps)":""}`),T&&M.push(` accessoryBar: ${T}`),console.log(M.join(`
|
|
209
|
-
`))}async function Et(e){let c=await e.bridge.listSims(),n=e.args.includes("--all"),l=e.args.find((y,T)=>e.args[T-1]==="--bundle"),m=e.args.find((y,T)=>e.args[T-1]==="--app-port"),a=e.args.includes("--primary"),g=c.filter(y=>!(a&&!y.isPrimary||l&&!(y.url??"").includes(l)||m&&!(y.url??"").includes(`/rn/${m}`)||!n&&!l&&!m&&!a&&!(y.url&&(y.url.includes("bundle=")||y.url.includes("/index.bundle")))&&y.id!==e.simId));if(A(e.args)){P(g.map(y=>({...y,active:y.id===e.simId})));return}vt(g,e.simId),g.length<c.length&&!A(e.args)&&console.log(` (${c.length-g.length} more hidden \u2014 pass --all to show)`)}function ie(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`}function Se(e,c){return c<=0?"?":`${(e/c*100).toFixed(0)}%`}async function
|
|
209
|
+
`))}async function Et(e){let c=await e.bridge.listSims(),n=e.args.includes("--all"),l=e.args.find((y,T)=>e.args[T-1]==="--bundle"),m=e.args.find((y,T)=>e.args[T-1]==="--app-port"),a=e.args.includes("--primary"),g=c.filter(y=>!(a&&!y.isPrimary||l&&!(y.url??"").includes(l)||m&&!(y.url??"").includes(`/rn/${m}`)||!n&&!l&&!m&&!a&&!(y.url&&(y.url.includes("bundle=")||y.url.includes("/index.bundle")))&&y.id!==e.simId));if(A(e.args)){P(g.map(y=>({...y,active:y.id===e.simId})));return}vt(g,e.simId),g.length<c.length&&!A(e.args)&&console.log(` (${c.length-g.length} more hidden \u2014 pass --all to show)`)}function ie(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`}function Se(e,c){return c<=0?"?":`${(e/c*100).toFixed(0)}%`}async function Dt(e,c={args:[]}){let n=await gt(e);if(A(c.args)){P(n);return}if(console.log(" memory:"),n.imageLoader){let l=n.imageLoader;console.log(" image-loader cache"),console.log(` entries: ${l.cacheEntries} / ${l.cacheMaxEntries} (${Se(l.cacheEntries,l.cacheMaxEntries)})`),console.log(` pixel bytes: ${ie(l.cachePixelBytes)} / ${ie(l.cachePixelBudget)} (${Se(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(n.workerHeap){let l=n.workerHeap;console.log(" worker heap (chrome only)"),console.log(` used: ${ie(l.usedJSHeapSize)} / ${ie(l.jsHeapSizeLimit)} (${Se(l.usedJSHeapSize,l.jsHeapSizeLimit)})`),console.log(` total: ${ie(l.totalJSHeapSize)}`)}if(n.hostHeap){let l=n.hostHeap;console.log(" host heap (chrome only)"),console.log(` used: ${ie(l.usedJSHeapSize)} / ${ie(l.jsHeapSizeLimit)} (${Se(l.usedJSHeapSize,l.jsHeapSizeLimit)})`),console.log(` total: ${ie(l.totalJSHeapSize)}`)}}function ye(e){let c=e.indexOf("--testid");if(c>=0&&e[c+1])return{mode:"testid",value:e[c+1]};let n=e.indexOf("--test-id");if(n>=0&&e[n+1])return{mode:"testid",value:e[n+1]};let l=e.indexOf("--text");return l>=0&&e[l+1]?{mode:"text",value:e[l+1]}:null}async function ve(e,c){let n=JSON.stringify(c.value),l=c.mode==="testid"?`(await t.findByTestId(${n})) || (await t.findById(${n}))`:`await t.findByText(${n})`;return await e.send({type:"evaluate",code:`(async () => {
|
|
210
210
|
const t = window.__sootsimTest
|
|
211
211
|
if (!t) return null
|
|
212
212
|
const n = ${l}
|
|
@@ -231,12 +231,12 @@ import{a as G}from"./chunk-MJH6XTIY.js";import{a as wt,b as xt}from"./chunk-W2RS
|
|
|
231
231
|
text: ${JSON.stringify(c.mode==="text")} ? ${n} : (n.text ?? n.accessibilityLabel ?? null),
|
|
232
232
|
type: n.type ?? null,
|
|
233
233
|
}
|
|
234
|
-
})()`})??null}async function
|
|
234
|
+
})()`})??null}async function Ct(e,c={}){let{nav:n,keyboard:l,shell:m}=await ft(e);if(c.json){console.log(JSON.stringify({shell:m??null,nav:n,keyboard:l},null,2));return}let a=[];if(m){let g=m.activeApp??m.state??"<none>",y=m.showSwitcher?" (app switcher open)":"",T=typeof m.launchProgress=="number"&&m.launchProgress<.98?` launching (${Math.round(m.launchProgress*100)}%)`:"";a.push(`shell: ${g}${y}${T}`)}else a.push("shell: <unavailable>");if(n){let g=n.transitionPhase!=="idle"?` (${n.transitionPhase}, ${n.activeTransitionCount} active)`:"";if(a.push(`nav: phase=${n.transitionPhase}${g}`),n.screens.length===0)a.push(" <no registered screens \u2014 app may not use react-native-screens>");else for(let y of n.screens){let T=y.isActive?"\u25B6":" ",M=y.routeName?` ${y.routeName}`:"",h=y.headerHeight>0?` header=${y.headerHeight}`:"",k=y.largeTitleState&&y.largeTitleState!=="expanded"?` large-title=${y.largeTitleState}`:"";a.push(` ${T} #${y.id}${M}${h}${k}`)}}else a.push("nav: <runtime not available>");if(l&&l.visible){let g=l.spec?.keyboardType??"default",y=l.spec?.returnKeyType??"default";a.push(`keyboard: visible (${g}, return=${y}, mode=${l.mode??"?"})`)}else a.push("keyboard: hidden");console.log(a.join(`
|
|
235
235
|
`))}async function Bt(e){let{bridge:c,args:n,positional:l}=e,m=l[1]?Number(l[1])*1e3:3e3,a=n.includes("--strict"),{elapsed:g,settled:y}=await ee({bridge:c,maxMs:m,strict:a});console.log(y?` settled in ${g}ms`:` timed out after ${g}ms (may still be animating)`)}async function jt(e){let c=e.positional[1]?Number(e.positional[1]):.5;(!Number.isFinite(c)||c<0)&&(console.error(e.inspectUsage("sleep","[seconds]")),process.exit(1)),await Z(c*1e3),console.log(` slept ${c}s`)}async function Lt(e){let{bridge:c,args:n,positional:l}=e,m=l[1]?Number(l[1]):5,{tree:a}=await Ve(c,m);if(A(n)){P({depth:m,tree:a??null});return}console.log(typeof a=="string"?a:JSON.stringify(a,null,2))}async function Jt(e,c={args:[]}){let n=await Qe(e);if(A(c.args)){P(n);return}console.log(n.url)}async function Wt(e){let{wsPort:c,commandTimeoutMs:n,simId:l,simIdSource:m,positional:a}=e,g=a[1]?Number(a[1]):30,y=Math.max(1e3,(Number.isFinite(g)?g:30)*1e3),T=Math.max(1,Math.ceil(y/500));console.log(" waiting for sim reconnect...");let M=await yt(c,n,l,{attempts:T,simIdSource:m});M||(console.error(" timed out waiting for sim reconnect"),process.exit(1)),M.bridge.close(),$e({source:"inspect wait",step:{wait:y},summary:`wait ${Math.round(y/1e3)}s`}),console.log(` ready: ${M.count} nodes`)}var qt=new Set(["app-launch","toast","keyboard","screen","route","alert","actionsheet","picker","notification","fetch","console","shell","scroll","gesture","text-input","react-commit","animation","reanimated"]);function ke(e,c){let n=e.indexOf(c);if(n>=0&&n+1<e.length)return e[n+1]}function _o(e,c){if(!c.filter&&!c.equals)return!0;let n=e.data,l=[];if(n&&typeof n=="object")for(let a of["url","displayUrl","message","name","activeName","path","pathname","title","phase","event","type","kind"]){let g=n[a];typeof g=="string"&&g.length>0&&l.push(g)}let m=l.join(" ");return c.equals?l.some(a=>a===c.equals):c.filter?m.toLowerCase().includes(c.filter.toLowerCase()):!0}async function Ht(e){let{bridge:c,args:n,positional:l,inspectUsage:m}=e,a=l[1];a||(console.error(m("wait event","<kind> [--max-ms 5000] [--filter <substring>] [--equals <exact>] [--since now|cursor]")),process.exit(1)),qt.has(a)||console.error(` warning: '${a}' is not a known timeline kind \u2014 waiting anyway. known: ${[...qt].sort().join(", ")}`);let g=ke(n,"--max-ms"),y=g&&Number.isFinite(Number(g))?Math.max(100,Number(g)):5e3,T=ke(n,"--filter"),M=ke(n,"--equals"),h=ke(n,"--since")??"now",k=n.includes("--json"),_=Date.now(),I=_+y,R=200,j=_;for(;Date.now()<I;){let z={kinds:[a],since:h==="cursor"?void 0:j,limit:50},B=await c.send({type:"evaluate",code:`(async () => {
|
|
236
236
|
const t = window.SootSim?.bridges?.timeline
|
|
237
237
|
if (!t) return { ok: false, error: 'timeline bridge missing' }
|
|
238
238
|
return { ok: true, result: await t.recent(${JSON.stringify(z)}) }
|
|
239
|
-
})()`});(!B||!B.ok)&&(console.error(` could not query timeline: ${B&&"error"in B?B.error:"unknown"}`),process.exit(1));let
|
|
239
|
+
})()`});(!B||!B.ok)&&(console.error(` could not query timeline: ${B&&"error"in B?B.error:"unknown"}`),process.exit(1));let D=B.result.events??[];for(let V of D)if(_o(V,{filter:T,equals:M})){let te=Date.now()-_;console.log(k?JSON.stringify({found:!0,elapsedMs:te,event:V}):` ${a} event after ${te}ms${T?` (filter: ${T})`:""}${M?` (equals: ${M})`:""}`);return}B.result.watermark&&B.result.watermark>j&&(j=B.result.watermark),await new Promise(V=>setTimeout(V,R))}let d=Date.now()-_;k?console.log(JSON.stringify({found:!1,elapsedMs:d,kind:a,filter:T,equals:M})):console.error(` \u26A0 wait event ${a} timed out after ${d}ms${T?` (filter: ${T})`:""}${M?` (equals: ${M})`:""}`),process.exit(1)}async function Ut(e){let{bridge:c,args:n}=e,l=n.includes("--strict"),m=be(n,3e3),{elapsed:a,settled:g}=await ee({bridge:c,maxMs:m,strict:l});g?console.log(` idle in ${a}ms`):(console.error(` \u26A0 wait idle timed out after ${a}ms (may still be animating)`),process.exit(1))}async function Kt(e){let{bridge:c,args:n}=e,l=be(n,2e4),{ready:m,elapsedMs:a,nodes:g,targets:y,flag:T,loadingText:M,externalReady:h,externalError:k,errors:_}=await nt(c,l,{onProgress(R){console.error(` still waiting after ${R.elapsedMs}ms \u2014 ${Ae(R)} (nodes: ${R.nodes}, targets: ${R.targets}, errors: ${R.errors})`)}});if(m){let R=l-a,j=Math.max(100,Math.min(1e4,R)),d=await ee({bridge:c,maxMs:j,pollMs:32,stablePolls:2});d.settled||(console.error(` \u26A0 wait ready timed out after ${a+d.elapsed}ms \u2014 app mounted but did not settle (nodes: ${g}, targets: ${y})`),process.exit(1)),console.log(` ready in ${a+d.elapsed}ms: ${g} nodes, ${y} targets`);return}let I=Ae({externalError:k,loadingText:M,externalReady:h,flag:T,targets:y});console.error(` \u26A0 wait ready timed out after ${a}ms \u2014 ${I} (nodes: ${g}, targets: ${y}, errors: ${_})`),process.exit(1)}async function zt(e){let{bridge:c,args:n,positional:l,inspectUsage:m}=e,a=l[1];a||(console.error(m("wait selector","<testid> [--max-ms 5000] [--gone]")),process.exit(1));let g=n.indexOf("--max-ms"),y=g>=0&&n[g+1]?Math.max(100,Number(n[g+1])):5e3,T=n.includes("--gone"),{found:M,node:h,elapsed:k}=await rt(c,a,y,{gone:T});if(T){M?console.log(` #${a} gone after ${k}ms`):(console.error(` \u26A0 wait selector #${a} --gone timed out after ${k??y}ms (still present)`),process.exit(1));return}if(M&&h){let _=h.absolutePosition?`@(${Math.round(h.absolutePosition.x)},${Math.round(h.absolutePosition.y)})`:"",I=h.layout?`${Math.round(h.layout.width)}x${Math.round(h.layout.height)}`:"?x?";console.log(` found #${a} in ${k}ms ${I} ${_}`)}else console.error(` \u26A0 wait selector #${a} timed out after ${k??y}ms`),process.exit(1)}function to(e){return e==null?"\u2014":e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}K`:`${(e/1024/1024).toFixed(1)}M`}function oo(e){return e==null?" \u2026":e<1e3?`${e}ms`.padStart(5):`${(e/1e3).toFixed(2)}s`.padStart(5)}function Yt(){process.stderr.write(` the sim is not responding. recover it with:
|
|
240
240
|
sootsim close --sim <id> # force-close the wedged sim
|
|
241
241
|
sootsim list # confirm it's gone
|
|
242
242
|
`)}async function Ao(e){try{return await e.send({type:"evaluate",code:"1"},{timeoutMs:3e3}),!0}catch{return!1}}async function Po(e,c){try{let n=await e.send({type:"evaluate",code:`(async () => {
|
|
@@ -258,7 +258,7 @@ import{a as G}from"./chunk-MJH6XTIY.js";import{a as wt,b as xt}from"./chunk-W2RS
|
|
|
258
258
|
} catch {
|
|
259
259
|
return []
|
|
260
260
|
}
|
|
261
|
-
})()`});if(!Array.isArray(n)||n.length===0)return;let l=c.toLowerCase(),m=n.map(a=>({id:a,score:Ro(l,a.toLowerCase())})).filter(a=>a.score<l.length+4).sort((a,g)=>a.score-g.score).slice(0,5);if(m.length===0)return;console.error(" similar testIDs:");for(let a of m)console.error(` ${a.id}`)}catch{}}function Ro(e,c){if(c===e)return 0;if(c.includes(e))return 1;if(e.includes(c))return 2;let n=0;for(;n<e.length&&n<c.length&&e[n]===c[n];)n+=1;return Eo(e,c)-n}function Eo(e,c){if(e===c)return 0;if(!e.length)return c.length;if(!c.length)return e.length;let n=new Array(c.length+1),l=new Array(c.length+1);for(let m=0;m<=c.length;m++)n[m]=m;for(let m=1;m<=e.length;m++){l[0]=m;for(let g=1;g<=c.length;g++)l[g]=Math.min(n[g]+1,l[g-1]+1,n[g-1]+(e[m-1]===c[g-1]?0:1));let a=n;n=l,l=a}return n[c.length]}function
|
|
261
|
+
})()`});if(!Array.isArray(n)||n.length===0)return;let l=c.toLowerCase(),m=n.map(a=>({id:a,score:Ro(l,a.toLowerCase())})).filter(a=>a.score<l.length+4).sort((a,g)=>a.score-g.score).slice(0,5);if(m.length===0)return;console.error(" similar testIDs:");for(let a of m)console.error(` ${a.id}`)}catch{}}function Ro(e,c){if(c===e)return 0;if(c.includes(e))return 1;if(e.includes(c))return 2;let n=0;for(;n<e.length&&n<c.length&&e[n]===c[n];)n+=1;return Eo(e,c)-n}function Eo(e,c){if(e===c)return 0;if(!e.length)return c.length;if(!c.length)return e.length;let n=new Array(c.length+1),l=new Array(c.length+1);for(let m=0;m<=c.length;m++)n[m]=m;for(let m=1;m<=e.length;m++){l[0]=m;for(let g=1;g<=c.length;g++)l[g]=Math.min(n[g]+1,l[g-1]+1,n[g-1]+(e[m-1]===c[g-1]?0:1));let a=n;n=l,l=a}return n[c.length]}function Do(e){return e.error?"err":e.status==null?" \u2026 ":String(e.status)}function Co(e){return e.externalError?`guest app errored: ${e.externalError}`:e.loadingText?`still showing "${e.loadingText}"`:e.externalReady===!1?"guest app is still loading":e.flag!==!0?"guest app has not emitted sootsim:externalAppReady":e.targets<=0?"ready flag emitted but no visible app content is inspectable yet":"node tree is still changing"}function Gt(e){let c=re(e.startTs),n=Do(e).padEnd(3),l=e.method.padEnd(5),m=to(e.size).padStart(6),a=oo(e.durationMs);console.log(` [${c}] ${n} ${l} ${m} ${a} ${e.displayUrl}`),e.error&&console.log(` error: ${e.error}`)}function Bo(e){let c=[["id",e.id],["source",e.source],["kind",e.kind],["method",e.method],["status",e.error?`error: ${e.error}`:`${e.status??"\u2014"} ${e.statusText??""}`.trim()],["url",e.url],["started",re(e.startTs)],["duration",oo(e.durationMs).trim()],["size",to(e.size)],["content-type",e.type??"\u2014"]];for(let[n,l]of c)console.log(` ${n.padEnd(13)} ${l}`)}var jo={error:"\x1B[31m",warn:"\x1B[33m",info:"\x1B[36m",debug:"\x1B[35m",log:"\x1B[37m"},Xt="\x1B[0m",Lo="\x1B[2m";function Vt(e,c){let n=re(e.ts),l=e.level.toUpperCase().padEnd(5),m=e.args.join(" ");if(c){let a=jo[e.level];console.log(` ${Lo}[${n}]${Xt} ${a}${l}${Xt} ${m}`)}else console.log(` [${n}] ${l} ${m}`);if(e.stack&&e.level==="error"){let a=e.stack.split(`
|
|
262
262
|
`).slice(0,5);for(let g of a)console.log(` ${g.trim()}`)}}var se="__sootsimCliPerf",Jo=120;async function Qt(e,c){let n=e.find((_,I)=>e[I-1]==="--id"),l=e.find((_,I)=>e[I-1]==="--text");if(n||l){let _=await c.send({type:"evaluate",code:wt({id:n,text:l})});if(!_)throw new Error(n?`no node with id "${n}"`:`no node matching text "${l}"`);let{x:I,y:R,w:j,h:d}=_;return{x:I,y:R,w:j,h:d}}let m=e.find((_,I)=>e[I-1]==="--area");if(m){let _=m.split(",").map(z=>Number(z.trim()));if(_.length!==4||_.some(z=>!Number.isFinite(z)))throw new Error(`--area expects x,y,w,h (got "${m}")`);let[I,R,j,d]=_;return{x:I,y:R,w:j,h:d}}let a=_=>{let I=e.find((j,d)=>e[d-1]===_);if(I==null)return null;let R=Number(I);return Number.isFinite(R)?R:null},g=a("--x"),y=a("--y"),T=a("--w"),M=a("--h");if(g!=null||y!=null||T!=null||M!=null)return{x:g??0,y:y??0,w:T??1,h:M??1};let k=e.filter((_,I)=>I>0&&!_.startsWith("-")&&e[I-1]!=="--output"&&e[I-1]!=="--area"&&e[I-1]!=="--id"&&e[I-1]!=="--text"&&e[I-1]!=="--x"&&e[I-1]!=="--y"&&e[I-1]!=="--w"&&e[I-1]!=="--h").map(Number).filter(_=>Number.isFinite(_));if(k.length>=2){let[_,I,R=1,j=1]=k;return{x:_,y:I,w:R,h:j}}return null}function Be(e){let c={"<8":0,"8-12":0,"12-16":0,"16-20":0,"20-33":0,">33":0};for(let n of e)n<8?c["<8"]++:n<12?c["8-12"]++:n<16?c["12-16"]++:n<20?c["16-20"]++:n<33?c["20-33"]++:c[">33"]++;console.log(" histogram:");for(let[n,l]of Object.entries(c)){let m="\u2588".repeat(Math.ceil(l/e.length*40));console.log(` ${n.padEnd(6)} ${m} ${l}`)}}async function Te(e,c,n){let l=Date.now()+c,m=await le(e,c);for(;;){if(n(m))return{settled:!0,state:m};if(Date.now()>=l)return{settled:!1,state:m};await Z(16),m=await le(e)}}async function Le(e){return e.send({type:"evaluate",code:`(async () => {
|
|
263
263
|
const kb = window.__sootsimKeyboard
|
|
264
264
|
const test = window.__sootsimTest
|
|
@@ -315,8 +315,8 @@ import{a as G}from"./chunk-MJH6XTIY.js";import{a as wt,b as xt}from"./chunk-W2RS
|
|
|
315
315
|
`);console.log(`${t??""}
|
|
316
316
|
|
|
317
317
|
${s}
|
|
318
|
-
`),process.exit(0)}let _=m.wsPort,I=m.simId,R=m.simIdSource,j=m.commandTimeoutMs;if(g==="list"&&l.some(o=>o==="--drivers"||o==="-D")){let{buildDriverListRows:o}=await import("./drivers-
|
|
319
|
-
`);let s=Math.max(...t.map(i=>i.id.length),6),r=Math.max(...t.map(i=>i.kind.length),4);for(let i of t){let u=i.available?"\u2713":"\u2717",p=i.id.padEnd(s),
|
|
318
|
+
`),process.exit(0)}let _=m.wsPort,I=m.simId,R=m.simIdSource,j=m.commandTimeoutMs;if(g==="list"&&l.some(o=>o==="--drivers"||o==="-D")){let{buildDriverListRows:o}=await import("./drivers-SYUDXJZK.js"),t=o();console.log(` available drivers (${t.length}):
|
|
319
|
+
`);let s=Math.max(...t.map(i=>i.id.length),6),r=Math.max(...t.map(i=>i.kind.length),4);for(let i of t){let u=i.available?"\u2713":"\u2717",p=i.id.padEnd(s),b=i.kind.padEnd(r);console.log(` ${u} ${p} ${b} ${i.description}`),i.available&&i.detail?console.log(` ${i.detail}`):!i.available&&i.reason&&console.log(` unavailable: ${i.reason}`)}return}let d=Ue(m),z=I||"default",B=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","list","wait","sleep"]),D=200;function V(o){let t=o.replace(/\s+/g," ").trim();if(!t)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(t)){let r=/<title[^>]*>([^<]+)<\/title>/i.exec(o)?.[1]?.trim(),i=/<body[^>]*>([\s\S]*?)<\//i.exec(o)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),u=r||i||"html error page";return`<html ${o.length}B> "${u}" (body elided \u2014 add --json for the full payload)`}return t.length<=D?t:`${t.slice(0,D)}\u2026 (+${t.length-D} more bytes)`}function te(o){let t=o.displayUrl||o.url;return o.status!=null?`${o.method} ${t} -> ${o.status}${o.statusText?` ${o.statusText}`:""}`:o.error?`${o.method} ${t} -> ${o.error}`:`${o.method} ${t}`}async function S(o){let t=ue()?5e3:1500;try{let{settled:s,elapsed:r}=await ee({bridge:o,maxMs:t,pollMs:32,stablePolls:2});s||process.stderr.write(` \u26A0 auto-wait timed out after ${r??t}ms \u2014 next command may see mid-animation state. use \`sootsim do settle\` for a longer wait.
|
|
320
320
|
`)}catch{}}function N(o,t){console.error(` tap failed: ${o} stayed visible but did not receive a hittable press after ${t.attempts} attempt${t.attempts===1?"":"s"}`),t.result&&console.error(` last result: ${JSON.stringify(t.result)}`)}async function J(){try{return await d.send({type:"evaluate",code:`(() => ({
|
|
321
321
|
console: ${xe},
|
|
322
322
|
requests: window.__sootsimTest?.getRequestCounts?.() || null,
|
|
@@ -326,7 +326,7 @@ ${s}
|
|
|
326
326
|
`);for(let i of r){let u=re(i.timestamp);console.log(` [${u}] ${te(i)}`),i.responseBody?console.log(` ${V(i.responseBody)}`):i.error&&console.log(` ${i.error}`)}}}async function X(o={}){let t=o.counts!==void 0?o.counts:await d.send({type:"evaluate",code:xe});if(!t||typeof t!="object")return;let s=t,r=Math.max(0,Number(s.errors)||0),i=Math.max(0,Number(s.warnings)||0);if(r===0&&i===0||!o.includeTail&&!Ee("console",z,`${r}:${i}`))return;let u=[];if(r>0&&u.push(`${r} console error${r===1?"":"s"}`),i>0&&u.push(`${i} console warning${i===1?"":"s"}`),console.log(`
|
|
327
327
|
console: ${u.join(", ")}`),console.log(` inspect: ${h("errors")} 5`),i>0&&console.log(` inspect: ${h("warnings")} 5`),!o.includeTail||r===0)return;let p=await we(d,5);if(!(!Array.isArray(p)||p.length===0)){console.log(`
|
|
328
328
|
recent console errors:
|
|
329
|
-
`);for(let
|
|
329
|
+
`);for(let b of p){let f=re(b.timestamp),x=Array.isArray(b.args)?b.args.map(O=>typeof O=="object"?JSON.stringify(O):String(O)).join(" "):String(b);console.log(` [${f}] ${x}`)}}}let Q=["console","fetch","toast","alert","notification","screen","app-launch","keyboard","route","actionsheet","picker","shell","scroll","gesture","text-input","animation","reanimated"];async function ne(o){let t=qe(),s=null;try{s=await ze(o,`(() => {
|
|
330
330
|
const tl = window.SootSim && window.SootSim.bridges && window.SootSim.bridges.timeline
|
|
331
331
|
if (!tl || typeof tl.summary !== 'function') return null
|
|
332
332
|
const cursorKey = ${JSON.stringify(t)}
|
|
@@ -342,9 +342,9 @@ ${s}
|
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
return summary ? { summary, consoleSplit } : null
|
|
345
|
-
})()`)}catch{return}if(!s||!s.summary||!s.summary.total)return;let r=s.summary.byKind??{},i=[],u=new Set;for(let p of Q){let
|
|
346
|
-
since last: ${i.join(" \xB7 ")} \u2014 sootsim what-happened`),s.summary.lastAt))try{await Fe(o,"SootSim.bridges.timeline.cursorAdvance",t,s.summary.lastAt)}catch{}}let me=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"]),
|
|
347
|
-
`);for(let t of o){let s=[];if(s.push(`[${t.role}]`),t.label){let r=t.label.length>50?t.label.slice(0,47)+"...":t.label;s.push(`"${r}"`)}if(t.hint&&s.push(`(hint: "${t.hint}")`),t.testID&&s.push(`#${t.testID}`),t.state){let r=[];t.state.disabled&&r.push("disabled"),t.state.selected&&r.push("selected"),t.state.checked===!0&&r.push("checked"),t.state.checked==="mixed"&&r.push("mixed"),t.state.busy&&r.push("busy"),t.state.expanded===!0&&r.push("expanded"),t.state.expanded===!1&&r.push("collapsed"),r.length&&s.push(`{${r.join(", ")}}`)}t.position&&s.push(`@(${t.position.x},${t.position.y})`),t.size&&s.push(`${t.size.w}x${t.size.h}`),console.log(" "+s.join(" "))}}break}case"find":{await At({bridge:d,args:e,effectiveArgs:l,positional:a,inspectUsage:k});break}case"count":{await _t(d,{args:l});break}case"keyboard":{await Rt(d,{json:e.includes("--json")});break}case"screens":{await
|
|
345
|
+
})()`)}catch{return}if(!s||!s.summary||!s.summary.total)return;let r=s.summary.byKind??{},i=[],u=new Set;for(let p of Q){let b=r[p];if(b)if(u.add(p),p==="console"&&s.consoleSplit){let{error:f,warn:x}=s.consoleSplit;f>0&&i.push(`${f} error${f===1?"":"s"}`),x>0&&i.push(`${x} warning${x===1?"":"s"}`)}else i.push(`${b} ${p}${b===1?"":"s"}`)}for(let[p,b]of Object.entries(r))!u.has(p)&&b&&i.push(`${b} ${p}${b===1?"":"s"}`);if(i.length!==0&&(console.log(`
|
|
346
|
+
since last: ${i.join(" \xB7 ")} \u2014 sootsim what-happened`),s.summary.lastAt))try{await Fe(o,"SootSim.bridges.timeline.cursorAdvance",t,s.summary.lastAt)}catch{}}let me=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"]),C=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"]),ae=(e.includes("--verbose")||e.includes("-v"))&&!e.includes("--json");y==="do"&&g==="shell"&&(console.error(" `sootsim do shell` was removed. use `sootsim shell ...` instead."),process.exit(1)),me.has(g)&&await Ke(d),C.has(g)&&await ce(d,{verbose:ae});try{switch(g){case"list":{await Et({bridge:d,simId:I,args:l});break}case"tree":{await Lt({bridge:d,args:l,positional:a});break}case"a11y":{let o=await ot(d);if(!Array.isArray(o)||o.length===0){console.log(" no accessible nodes found");break}if(e.includes("--json"))console.log(JSON.stringify(o,null,2));else{console.log(` accessibility tree (${o.length} nodes):
|
|
347
|
+
`);for(let t of o){let s=[];if(s.push(`[${t.role}]`),t.label){let r=t.label.length>50?t.label.slice(0,47)+"...":t.label;s.push(`"${r}"`)}if(t.hint&&s.push(`(hint: "${t.hint}")`),t.testID&&s.push(`#${t.testID}`),t.state){let r=[];t.state.disabled&&r.push("disabled"),t.state.selected&&r.push("selected"),t.state.checked===!0&&r.push("checked"),t.state.checked==="mixed"&&r.push("mixed"),t.state.busy&&r.push("busy"),t.state.expanded===!0&&r.push("expanded"),t.state.expanded===!1&&r.push("collapsed"),r.length&&s.push(`{${r.join(", ")}}`)}t.position&&s.push(`@(${t.position.x},${t.position.y})`),t.size&&s.push(`${t.size.w}x${t.size.h}`),console.log(" "+s.join(" "))}}break}case"find":{await At({bridge:d,args:e,effectiveArgs:l,positional:a,inspectUsage:k});break}case"count":{await _t(d,{args:l});break}case"keyboard":{await Rt(d,{json:e.includes("--json")});break}case"screens":{await Ct(d,{json:e.includes("--json")});break}case"memory":{await Dt(d,{args:l});break}case"wait":{await Wt({wsPort:_,commandTimeoutMs:j,simId:I,simIdSource:R,positional:a});break}case"sleep":{await jt({positional:a,inspectUsage:k});break}case"settle":{await Bt({bridge:d,args:e,positional:a});break}case"ready":{await Kt({bridge:d,args:e});break}case"idle":{await Ut({bridge:d,args:e,positional:a});break}case"selector":{await zt({bridge:d,args:e,positional:a,inspectUsage:k});break}case"event":{await Ht({bridge:d,args:e,positional:a,inspectUsage:k});break}case"layout":{let o=a[1];if(!o){await Pt({bridge:d,args:l});break}let t=await d.send({type:"evaluate",code:`(async () => await window.__sootsimTest.getLayout(${JSON.stringify(o)}))()`});console.log(JSON.stringify(t,null,2));break}case"capture":case"screenshot":{let t=e.find((b,f)=>e[f-1]==="--output")||"/tmp/sootsim-inspect.png",s=await Qt(e,d),r={type:"screenshot"};s&&(r.crop=s);let u=(await d.send(r)).replace(/^data:image\/png;base64,/,"");s&&console.log(` area: x=${s.x} y=${s.y} w=${s.w} h=${s.h}`),(await import("fs")).writeFileSync(t,Buffer.from(u,"base64")),console.log(` saved: ${t}`);break}case"sample-color":{let o=await Qt(e,d);o||(console.error(k("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 t=await d.send({type:"evaluate",code:xt(o)});if(e.includes("--json"))console.log(JSON.stringify(t,null,2));else{let{r:s,g:r,b:i,a:u,hex:p,samples:b}=t,f=o.w===1&&o.h===1?`@(${o.x},${o.y})`:`@(${o.x},${o.y}) ${o.w}x${o.h}`;console.log(` ${p} rgba(${s}, ${r}, ${i}, ${u}) ${f} ${b} samples`)}break}case"node":{let o=a[1];o||(console.error(k("node","<matcher>")),console.error(" resolves testID, id, then text \u2014 dumps full node info as JSON"),process.exit(1));let t=await d.send({type:"evaluate",code:`(async () => {
|
|
348
348
|
const t = window.__sootsimTest
|
|
349
349
|
const q = ${JSON.stringify(o)}
|
|
350
350
|
let node = null
|
|
@@ -400,17 +400,17 @@ ${s}
|
|
|
400
400
|
transform,
|
|
401
401
|
parentChain,
|
|
402
402
|
}
|
|
403
|
-
})()`});console.log(JSON.stringify(t,null,2));break}case"tap":{let o=Number(a[1]),t=Number(a[2]),s=ye(e);if(s){let u=await ge(d,{agent:ue(),textFallback:s.mode==="text"?s.value:void 0,resolve:async()=>{let f=await ve(d,s);return f?{cx:f.x,cy:f.y,match:{id:s.mode==="testid"?s.value:f.id??null,testID:s.mode==="testid"?s.value:f.testID??null,text:s.mode==="text"?s.value:f.text??null,type:f.type??null},target:{id:f.id??null,testID:f.testID??null,text:f.text??null,type:f.type??null}}:null}}),p=u.payload;(!p||typeof p.cx!="number")&&(console.error(` not found: ${s.value}`),s.mode==="testid"&&G("wait-selector-for-missing-testid",s.value),process.exit(1)),de(u.result)||(N(`${s.mode} "${s.value}"`,u),process.exit(1));let
|
|
403
|
+
})()`});console.log(JSON.stringify(t,null,2));break}case"tap":{let o=Number(a[1]),t=Number(a[2]),s=ye(e);if(s){let u=await ge(d,{agent:ue(),textFallback:s.mode==="text"?s.value:void 0,resolve:async()=>{let f=await ve(d,s);return f?{cx:f.x,cy:f.y,match:{id:s.mode==="testid"?s.value:f.id??null,testID:s.mode==="testid"?s.value:f.testID??null,text:s.mode==="text"?s.value:f.text??null,type:f.type??null},target:{id:f.id??null,testID:f.testID??null,text:f.text??null,type:f.type??null}}:null}}),p=u.payload;(!p||typeof p.cx!="number")&&(console.error(` not found: ${s.value}`),s.mode==="testid"&&G("wait-selector-for-missing-testid",s.value),process.exit(1)),de(u.result)||(N(`${s.mode} "${s.value}"`,u),process.exit(1));let b=eo(p.cx,p.cy,u.result);b&&await L("inspect tap",b.step,b.summary),console.log(JSON.stringify({...u.attempts>1?{attempts:u.attempts}:{},...u.result},null,2));break}(!Number.isFinite(o)||!Number.isFinite(t))&&(console.error(k("tap","<x> <y> | --testid <id> | --text <t>")),process.exit(1));let r=await Mt(d,o,t),i=eo(o,t,r);i&&await L("inspect tap",i.step,i.summary),console.log(JSON.stringify(r,null,2));break}case"drag":case"swipe":{let o=Number(a[1]),t=Number(a[2]),s=Number(a[3]),r=Number(a[4]),i=g==="swipe"?10:12,u=g==="swipe"?8:16,p=a[5]?Number(a[5]):i,b=a[6]?Number(a[6]):u;(!Number.isFinite(o)||!Number.isFinite(t)||!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(p)||!Number.isFinite(b))&&(console.error(k(g,"<x1> <y1> <x2> <y2> [steps] [stepMs]")),process.exit(1));let f=await d.send({type:"evaluate",code:`(async () => {
|
|
404
404
|
const interact = window.__sootsimInteract
|
|
405
405
|
if (!interact?.drag) return { ok: false, reason: 'no interact.drag' }
|
|
406
|
-
const value = await interact.drag(${o}, ${t}, ${s}, ${r}, ${Math.max(1,Math.round(p))}, ${Math.max(0,Math.round(
|
|
406
|
+
const value = await interact.drag(${o}, ${t}, ${s}, ${r}, ${Math.max(1,Math.round(p))}, ${Math.max(0,Math.round(b))})
|
|
407
407
|
return { ok: !!value, value }
|
|
408
|
-
})()`});if(f?.ok){let x=Math.max(1,Math.round(Math.max(1,p)*Math.max(0,
|
|
408
|
+
})()`});if(f?.ok){let x=Math.max(1,Math.round(Math.max(1,p)*Math.max(0,b)));await L(`inspect ${g}`,{swipe:{start:`${o}, ${t}`,end:`${s}, ${r}`,duration:x}},`${g} ${o},${t} -> ${s},${r}`)}console.log(JSON.stringify(f,null,2));break}case"pinch":{let o=Number(a[1]),t=Number(a[2]),s=Number(a[3]),r=Number(a[4]),i=Number(a[5]),u=Number(a[6]),p=Number(a[7]),b=Number(a[8]),f=a[9]?Number(a[9]):12,x=a[10]?Number(a[10]):16;(!Number.isFinite(o)||!Number.isFinite(t)||!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(u)||!Number.isFinite(p)||!Number.isFinite(b)||!Number.isFinite(f)||!Number.isFinite(x))&&(console.error(k("pinch","<x1> <y1> <x2> <y2> <x1'> <y1'> <x2'> <y2'> [steps] [stepMs]")),process.exit(1));let O=await d.send({type:"evaluate",code:`(async () => {
|
|
409
409
|
const interact = window.__sootsimInteract
|
|
410
410
|
if (!interact?.pinch) return { ok: false, reason: 'no interact.pinch' }
|
|
411
|
-
const value = await interact.pinch(${o}, ${t}, ${s}, ${r}, ${i}, ${u}, ${p}, ${
|
|
411
|
+
const value = await interact.pinch(${o}, ${t}, ${s}, ${r}, ${i}, ${u}, ${p}, ${b}, ${Math.max(1,Math.round(f))}, ${Math.max(0,Math.round(x))})
|
|
412
412
|
return { ok: !!value, value }
|
|
413
|
-
})()`});O?.ok&&await L("inspect pinch",{pinch:{from:[o,t,s,r],to:[i,u,p,
|
|
413
|
+
})()`});O?.ok&&await L("inspect pinch",{pinch:{from:[o,t,s,r],to:[i,u,p,b],steps:Math.max(1,Math.round(f)),stepMs:Math.max(0,Math.round(x))}},`pinch (${o},${t}) (${s},${r}) -> (${i},${u}) (${p},${b})`),console.log(JSON.stringify(O,null,2));break}case"tap-text":{let o=a[1];o||(console.error(k("tap-text","<text>")),process.exit(1));let t=K=>{let E=e.indexOf(K);return E>=0&&E+1<e.length?e[E+1]:null},s=K=>e.includes(K),r=t("--nth")??t("--index"),i=r!==null?Number(r):null;i!==null&&!Number.isFinite(i)&&(console.error(` --nth/--index requires an integer, got: ${r}`),process.exit(1));let u=t("--within"),p=t("--role"),b=s("--exact"),f=s("--first"),x=t("--min-y"),O=t("--max-y"),q=t("--min-x"),H=t("--max-x");for(let[K,E]of[["--min-y",x],["--max-y",O],["--min-x",q],["--max-x",H]])E!==null&&!Number.isFinite(Number(E))&&(console.error(` ${K} requires a number, got: ${E}`),process.exit(1));let U=e.indexOf("--near"),F=null;if(U>=0){let K=Number(e[U+1]),E=Number(e[U+2]);(!Number.isFinite(K)||!Number.isFinite(E))&&(console.error(" --near requires two numbers: --near <x> <y>"),process.exit(1)),F={x:K,y:E}}let w={exact:b,role:p,within:u,minX:q!==null?Number(q):null,maxX:H!==null?Number(H):null,minY:x!==null?Number(x):null,maxY:O!==null?Number(O):null,near:F,nth:i,first:f},$=await Nt(d,o,w,{agent:ue()}),v=$.payload;if(v?.error==="bridge-not-ready"&&(console.error(" sootsim test bridge not ready"),process.exit(1)),v?.ambiguous){let K=v.candidates;console.error(` ambiguous: ${v.total} matches for "${o}"`);for(let E of K){let he=E.abs?`@(${Math.round(E.abs.x)},${Math.round(E.abs.y)})`:"",no=E.layout?` ${E.layout.width}x${E.layout.height}`:"",ro=E.testID?` #${E.testID}`:"",io=E.text?` "${E.text}"`:"",ao=E.ancestorTestIDs.length>0?` within ${E.ancestorTestIDs.slice(0,3).map(lo=>`#${lo}`).join(" > ")}`:"";console.error(` [${E.idx}] <${E.type}>${io}${ro} ${he}${no}${ao}`)}v.total>K.length&&console.error(` ... and ${v.total-K.length} more`),console.error(" pick one:"),console.error(" --nth <index> pick the nth match (top-to-bottom, left-to-right; negatives from end)"),console.error(" --within <testID> narrow to descendants of a node"),console.error(" --min-y / --max-y geometric filter (pixels, absolute)"),console.error(" --min-x / --max-x geometric filter (pixels, absolute)"),console.error(" --near <x> <y> pick the closest match to a point"),console.error(" --exact exact text match (default is substring)"),console.error(" --role <role> narrow to accessibilityRole"),console.error(" --first keep the old pick-first-silently behavior"),process.exit(2)}v?.nthOutOfRange&&(console.error(` not found: nth ${v.nth} of ${v.total} match${v.total===1?"":"es"} for "${o}"`),process.exit(1)),(!v||typeof v.cx!="number")&&(console.error(` not found: ${o}`),process.exit(1)),de($.result)||(N(`text "${o}"`,$),process.exit(1));let oe=je(o,{id:v.target?.id??null,testID:v.target?.testID??null,type:v.target?.type??null,cx:v.cx,cy:v.cy},"text");await L("inspect tap-text",oe.step,oe.summary),console.log(JSON.stringify({matched:v.match,tapped:{nodeId:v.target?.nodeId??null,id:v.target?.id??null,testID:v.target?.testID??null,type:v.target?.type??null,cx:v.cx,cy:v.cy},...v.strategy&&v.strategy!=="matched-node"?{strategy:v.strategy}:{},...v.total>1||i!==null?{nth:{index:v.idx,total:v.total}}:{},...$.attempts>1?{attempts:$.attempts}:{},result:$.result},null,2));break}case"tap-best":{let o=a[1];o||(console.error(k("tap-best","<query>")),process.exit(1));let t=await Ft(d,o,{agent:ue()}),s=t.payload;s||(console.error(` tap-best: no testID or visible text matched "${o}". try \`sootsim find --interactive-targets\` to list candidates.`),process.exit(1)),"error"in s&&(console.error(` ${s.error}`),process.exit(1)),s.strategy==="none"&&(console.error(` tap-best: no testID or visible text matched "${o}". try \`sootsim find --interactive-targets\` to list candidates.`),process.exit(1));let r=s.node;de(t.result)||(N(`best "${o}"`,t),process.exit(1));let i=je(o,{id:r.id,testID:r.testID,type:r.type,cx:s.cx,cy:s.cy},s.strategy==="testid"?"id":"text");await L("inspect tap-best",i.step,i.summary),console.log(JSON.stringify({matched:{strategy:s.strategy,nodeId:r.nodeId,id:r.id,testID:r.testID,type:r.type,text:r.text},tapped:{cx:s.cx,cy:s.cy},...t.attempts>1?{attempts:t.attempts}:{},result:t.result},null,2));break}case"tap-id":{let o=a[1];o||(console.error(k("tap-id","<id>")),process.exit(1));let t=await It(d,o,{agent:ue()}),s=t.payload;(!s||typeof s.cx!="number")&&(console.error(` not found: ${o}`),await Po(d,o),process.exit(1)),de(t.result)||(N(`id "${o}"`,t),process.exit(1));let r=je(o,{id:s.target?.id??null,testID:s.target?.testID??null,type:s.target?.type??null,cx:s.cx,cy:s.cy},"id");await L("inspect tap-id",r.step,r.summary),console.log(JSON.stringify({matched:s.match,tapped:{nodeId:s.target?.nodeId??null,id:s.target?.id??null,testID:s.target?.testID??null,type:s.target?.type??null,cx:s.cx,cy:s.cy},...s.strategy&&s.strategy!=="matched-node"?{strategy:s.strategy}:{},...t.attempts>1?{attempts:t.attempts}:{},result:t.result},null,2));break}case"type-into":{let o=a[1],t=a.slice(2).join(" ");(!o||!t)&&(console.error(k("type-into","<id> <text>")),process.exit(1));let s=JSON.stringify(o),r=await d.send({type:"evaluate",code:`(async () => {
|
|
414
414
|
const t = window.__sootsimTest
|
|
415
415
|
if (!t) return null
|
|
416
416
|
const n = await (t.findByTestId(${s}) || t.findById(${s}))
|
|
@@ -447,18 +447,13 @@ ${s}
|
|
|
447
447
|
first,
|
|
448
448
|
second,
|
|
449
449
|
}
|
|
450
|
-
})()`});u?.ok&&await L("inspect double-tap",{doubleTapAtCoords:{x:o,y:t,gapMs:i}},`double-tap @${o},${t}`),console.log(JSON.stringify(u,null,2));break}case"long-press":{let o=Number(a[1]),t=Number(a[2]),s=ye(e);if(s){let
|
|
451
|
-
const interact = window.__sootsimInteract
|
|
452
|
-
if (!interact?.longPress) return { ok: false, reason: 'no interact.longPress' }
|
|
453
|
-
const value = await interact.longPress(${o}, ${t}, ${Math.max(0,Math.round(r))})
|
|
454
|
-
return { ok: !!value, value }
|
|
455
|
-
})()`});i?.ok&&await L("inspect long-press",{tapAtCoords:{x:o,y:t}},`long-press @${o},${t}`),console.log(JSON.stringify(i,null,2));break}case"touch":{let o=a[1],t=Number(a[2]),s=Number(a[3]),r=a[4]?Number(a[4]):999,i=o==="down"?"touchDown":o==="move"?"touchMove":o==="up"?"touchUp":o==="cancel"?"touchCancel":null;i||(console.error(k("touch","<down|move|up|cancel> <x> <y> [pointerId]")),process.exit(1)),o!=="cancel"&&(!Number.isFinite(t)||!Number.isFinite(s))&&(console.error(k("touch","<down|move|up|cancel> <x> <y> [pointerId]")),process.exit(1));let u=o==="down"?"tap":o==="move"?"move":null,p=u&&Number.isFinite(t)&&Number.isFinite(s)?`window.dispatchEvent(new CustomEvent('sootsim:agentAction', { detail: { type: '${u}', x: ${t}, y: ${s} } }));`:"",w=await d.send({type:"evaluate",code:`(async () => {
|
|
450
|
+
})()`});u?.ok&&await L("inspect double-tap",{doubleTapAtCoords:{x:o,y:t,gapMs:i}},`double-tap @${o},${t}`),console.log(JSON.stringify(u,null,2));break}case"long-press":{let o=Number(a[1]),t=Number(a[2]),s=ye(e),r=null;if(s){let f=await ve(d,s);f||(console.error(` not found: ${s.value}`),s.mode==="testid"&&G("wait-selector-for-missing-testid",s.value),process.exit(1)),o=f.x,t=f.y,r={id:f.id??null,testID:f.testID??null,text:f.text??null,type:f.type??null}}let i=s?a[1]:a[3],u=i?Number(i):600;(!Number.isFinite(o)||!Number.isFinite(t)||!Number.isFinite(u))&&(console.error(k("long-press","<x> <y> [durationMs] | --testid <id>")),process.exit(1));let p=Math.max(0,Math.round(u)),b=await d.send({type:"longPress",x:o,y:t,durationMs:p,target:r});b?.ok&&await L("inspect long-press",{tapAtCoords:{x:o,y:t}},`long-press @${o},${t}`),console.log(JSON.stringify(b,null,2));break}case"touch":{let o=a[1],t=Number(a[2]),s=Number(a[3]),r=a[4]?Number(a[4]):999,i=o==="down"?"touchDown":o==="move"?"touchMove":o==="up"?"touchUp":o==="cancel"?"touchCancel":null;i||(console.error(k("touch","<down|move|up|cancel> <x> <y> [pointerId]")),process.exit(1)),o!=="cancel"&&(!Number.isFinite(t)||!Number.isFinite(s))&&(console.error(k("touch","<down|move|up|cancel> <x> <y> [pointerId]")),process.exit(1));let u=o==="down"?"tap":o==="move"?"move":null,p=u&&Number.isFinite(t)&&Number.isFinite(s)?`window.dispatchEvent(new CustomEvent('sootsim:agentAction', { detail: { type: '${u}', x: ${t}, y: ${s} } }));`:"",b=await d.send({type:"evaluate",code:`(async () => {
|
|
456
451
|
${p}
|
|
457
452
|
const interact = window.__sootsimInteract
|
|
458
453
|
if (!interact?.${i}) return { ok: false, reason: 'no interact.${i}' }
|
|
459
454
|
const value = ${o==="cancel"?`await interact.${i}(${Math.max(1,Math.round(r))})`:`await interact.${i}(${t}, ${s}, ${Math.max(1,Math.round(r))})`}
|
|
460
455
|
return { ok: !!value, value }
|
|
461
|
-
})()`});
|
|
456
|
+
})()`});b?.ok&&o!=="cancel"&&await L("inspect touch",{tapAtCoords:{x:t,y:s}},`touch ${o} @${t},${s}`),console.log(JSON.stringify(b,null,2));break}case"gesture":{let o=["scroll-up","scroll-down","scroll-left","scroll-right","swipe-from-left-edge","swipe-from-right-edge","swipe-from-top-edge","swipe-from-bottom-edge"],t=a[1],s=a[2]?Number(a[2]):220;(!t||!Number.isFinite(s))&&(console.error(k("gesture","<preset> [durationMs]")),console.error(` presets: ${o.join(", ")}`),process.exit(1)),o.includes(t)||(console.error(` unknown gesture preset: ${t}`),console.error(` presets: ${o.join(", ")}`),process.exit(1));let r=await d.send({type:"evaluate",code:`(async () => {
|
|
462
457
|
const spec = globalThis.__sootsimDeviceSpec || {}
|
|
463
458
|
return {
|
|
464
459
|
width: spec.width || window.innerWidth || 393,
|
|
@@ -466,12 +461,12 @@ ${s}
|
|
|
466
461
|
statusBarHeight: spec.statusBarHeight || 0,
|
|
467
462
|
homeIndicatorHeight: spec.homeIndicatorHeight || 0,
|
|
468
463
|
}
|
|
469
|
-
})()`}),i=Number(r?.width)||393,u=Number(r?.height)||852,p=Number(r?.statusBarHeight)||0,
|
|
464
|
+
})()`}),i=Number(r?.width)||393,u=Number(r?.height)||852,p=Number(r?.statusBarHeight)||0,b=Number(r?.homeIndicatorHeight)||0,f=Math.round(i/2),x=Math.round(u/2),O=Math.max(24,p+18),q=Math.max(24,b+18),H=18,U=Math.min(220,Math.round(u*.24)),F=Math.min(180,Math.round(i*.32)),w=f,$=x,v=f,oe=x;switch(t){case"scroll-up":$=x+Math.round(U/2),oe=x-Math.round(U/2);break;case"scroll-down":$=x-Math.round(U/2),oe=x+Math.round(U/2);break;case"scroll-left":w=f+Math.round(F/2),v=f-Math.round(F/2);break;case"scroll-right":w=f-Math.round(F/2),v=f+Math.round(F/2);break;case"swipe-from-left-edge":w=H,$=x,v=Math.min(i-H,H+F);break;case"swipe-from-right-edge":w=i-H,$=x,v=Math.max(H,i-H-F);break;case"swipe-from-top-edge":w=f,$=O,oe=Math.min(u-q,O+U);break;case"swipe-from-bottom-edge":w=f,$=u-q,oe=Math.max(O,u-q-U);break}let K=Math.max(8,Math.round(s/16)),E=Math.max(1,Math.round(s/K)),he=await d.send({type:"evaluate",code:`(async () => {
|
|
470
465
|
const interact = window.__sootsimInteract
|
|
471
466
|
if (!interact?.drag) return { ok: false, reason: 'no interact.drag' }
|
|
472
|
-
const value = await interact.drag(${
|
|
467
|
+
const value = await interact.drag(${w}, ${$}, ${v}, ${oe}, ${K}, ${E})
|
|
473
468
|
return { ok: !!value, value }
|
|
474
|
-
})()`});he?.ok&&await L("inspect gesture",{swipe:{start:`${
|
|
469
|
+
})()`});he?.ok&&await L("inspect gesture",{swipe:{start:`${w}, ${$}`,end:`${v}, ${oe}`,duration:Math.max(1,Math.round(s))}},`gesture ${t}`),console.log(JSON.stringify({preset:t,from:{x:w,y:$},to:{x:v,y:oe},result:he},null,2));break}case"scroll":{let o=ye(e),t=Uo(e),s=o?.mode==="testid"?o.value:t==null?a[1]:null,r=o||t!=null?1:2,i=Number(a[r]),u=Number(a[r+1]);(!s&&t==null||!Number.isFinite(i)||!Number.isFinite(u))&&(console.error(k("scroll","<id> <x> <y> | --testid <id> <x> <y> | --node-id <nodeId> <x> <y>")),process.exit(1));let p=await d.send({type:"evaluate",code:`(async () => {
|
|
475
470
|
const t = window.__sootsimTest
|
|
476
471
|
if (!t) return null
|
|
477
472
|
const n = ${t!=null?`await t.inspectByNodeId(${JSON.stringify(t)})`:`await t.findByTestId(${JSON.stringify(s)})
|
|
@@ -481,7 +476,7 @@ ${s}
|
|
|
481
476
|
cx: n.absolutePosition.x + (n.layout.width || 0) / 2,
|
|
482
477
|
cy: n.absolutePosition.y + (n.layout.height || 0) / 2,
|
|
483
478
|
}
|
|
484
|
-
})()`}),
|
|
479
|
+
})()`}),b=await Y(d,"scrollTo",t!=null?{nodeId:t}:s,i,u,!1);if(b?.ok){let f=t!=null?`node ${t}`:`#${s}`;await L("inspect scroll",{scrollTo:{...t!=null?{nodeId:t}:{id:s},x:i,y:u}},`scroll ${f} -> ${i},${u}`)}console.log(JSON.stringify({...b,...p?{at:{x:p.cx,y:p.cy}}:{}},null,2));break}case"state":{let o=a[1];if(n==="get"&&!o){let s=await Y(d,"getRuntimeState"),r=await d.send({type:"evaluate",code:xe});if(s&&typeof s=="object"&&s.diagnostics&&(s.diagnostics.errors=r?.errors??0,s.diagnostics.warnings=r?.warnings??0),s&&typeof s=="object"&&s.shell==null)try{let i=await le(d);i&&(s.shell=i)}catch{}console.log(JSON.stringify(s,null,2));break}if(!o||o==="--help"||o==="-h"){console.log(`
|
|
485
480
|
${h("state")} \u2014 dump raw runtime state
|
|
486
481
|
|
|
487
482
|
subcommands:
|
|
@@ -559,7 +554,7 @@ ${s}
|
|
|
559
554
|
${h("shell")} open-card clock 800
|
|
560
555
|
${h("shell")} appearance dark
|
|
561
556
|
${h("shell")} lock
|
|
562
|
-
`);break}let t=o==="launch"||o==="open-card"||o==="home"||o==="switcher",s=o==="launch"||o==="open-card"?a[3]:a[2],r=s?Number(s):350;t&&(!Number.isFinite(r)||r<0)&&(console.error(k("shell",o==="launch"||o==="open-card"?"<launch|open-card> <appId> [settleMs]":"<home|switcher> [settleMs]")),process.exit(1));let i=!1,u=!1,p=null,
|
|
557
|
+
`);break}let t=o==="launch"||o==="open-card"||o==="home"||o==="switcher",s=o==="launch"||o==="open-card"?a[3]:a[2],r=s?Number(s):350;t&&(!Number.isFinite(r)||r<0)&&(console.error(k("shell",o==="launch"||o==="open-card"?"<launch|open-card> <appId> [settleMs]":"<home|switcher> [settleMs]")),process.exit(1));let i=!1,u=!1,p=null,b=e.includes("--clear-state");if(o==="launch"){let f=a[2];f||(console.error(k("shell","launch <appId> [settleMs] [--clear-state]")),process.exit(1)),b&&await d.send({type:"evaluate",code:Ye}),i=!!await pe(d,"launchApp",r,f),{settled:u,state:p}=await Te(d,Math.round(r),x=>!!x&&x.state==="app"&&x.activeApp===f&&x.showSwitcher===!1&&x.switcherPhase==="idle"&&typeof x.launchProgress=="number"&&x.launchProgress>=.98),i&&await L("inspect shell launch",b?{launchApp:{clearState:!0}}:{launchApp:{}},b?"launch app (clear state)":"launch app")}else if(o==="home")i=!!await pe(d,"goHome",r),{settled:u,state:p}=await Te(d,Math.round(r),f=>!!f&&f.state==="home"&&f.activeApp==null&&f.showSwitcher===!1&&f.switcherPhase==="idle"&&typeof f.launchProgress=="number"&&f.launchProgress>=.98);else if(o==="switcher")i=!!await pe(d,"openSwitcher",r),{settled:u,state:p}=await Te(d,Math.round(r),f=>!!f&&f.state==="app"&&f.showSwitcher===!0&&f.switcherPhase==="idle"&&typeof f.zoomLevel=="number"&&Math.abs(f.zoomLevel)<=.02&&typeof f.horizontalZoom=="number"&&Math.abs(f.horizontalZoom)<=.02),u&&(await Z(Jo),p=await le(d));else if(o==="open-card"){let f=a[2];f||(console.error(k("shell","open-card <appId> [settleMs]")),process.exit(1)),i=!!await pe(d,"openSwitcherCard",r,f),{settled:u,state:p}=await Te(d,Math.round(r),x=>!!x&&x.state==="app"&&x.activeApp===f&&x.showSwitcher===!1&&x.switcherPhase==="idle"&&typeof x.zoomLevel=="number"&&x.zoomLevel>=.98&&typeof x.horizontalZoom=="number"&&x.horizontalZoom>=.98),i&&await L("inspect shell open-card",{openSwitcherCard:{appId:f}},`open switcher card ${f}`)}else if(o==="appearance"){let f=a[2];(!f||!["light","dark","auto","toggle"].includes(f))&&(console.error(k("shell","appearance <light|dark|auto|toggle>")),process.exit(1));let x=await Zt(d,"appearance",f);if(i=!!x?.ok,p={appearance:x},i){let O=x?.applied??f;console.log(` appearance: ${O}`)}}else if(o==="lock"||o==="shake"){let f=await Zt(d,o);i=!!f?.ok,p={[o]:f}}else console.error(` unknown shell subcommand: ${o}`),process.exit(1);console.log(JSON.stringify({ok:i,settled:u,state:p},null,2));break}case"url":{await Jt(d,{args:l});break}case"reload":{let s=!1,r=!1;try{await d.send({type:"evaluate",code:"window.__sootsimConsole?.clear()"});let p=await d.send({type:"evaluate",code:`;(() => {
|
|
563
558
|
const reloadExternalApp = window.SootSim?.bridges?.hotRemount?.reloadExternalApp
|
|
564
559
|
if (typeof reloadExternalApp === 'function') {
|
|
565
560
|
reloadExternalApp()
|
|
@@ -567,9 +562,9 @@ ${s}
|
|
|
567
562
|
}
|
|
568
563
|
window.location.reload()
|
|
569
564
|
return { kind: 'page' }
|
|
570
|
-
})()`});r=!!p&&p.kind==="external-app",s=!0}catch{}console.log(" reloading...");let i=d,u=null;if(r)u=await Re(d,{timeoutMs:1e4,errorGraceMs:3e3});else{s&&await Z(300);let p=await ht(_,j,I,{timeoutMs:1e4,simIdSource:R});p?(i=p,u=await Re(p,{timeoutMs:1e4,errorGraceMs:3e3})):(console.log(" \u26A0 reload: bridge never reconnected within 10000ms"),i=null)}if(u)if(u.ready){let p=u.source==="nodes-fallback"?" (no ready signal, node-count fallback)":"";console.log(` ready in ${u.elapsedMs}ms: ${u.nodes} nodes${p}`)}else if(u.source==="error-bail")console.log(` \u26A0 reload bailed after ${u.elapsedMs}ms: ${u.errors} console error(s), ready signal never fired`);else{let p=
|
|
565
|
+
})()`});r=!!p&&p.kind==="external-app",s=!0}catch{}console.log(" reloading...");let i=d,u=null;if(r)u=await Re(d,{timeoutMs:1e4,errorGraceMs:3e3});else{s&&await Z(300);let p=await ht(_,j,I,{timeoutMs:1e4,simIdSource:R});p?(i=p,u=await Re(p,{timeoutMs:1e4,errorGraceMs:3e3})):(console.log(" \u26A0 reload: bridge never reconnected within 10000ms"),i=null)}if(u)if(u.ready){let p=u.source==="nodes-fallback"?" (no ready signal, node-count fallback)":"";console.log(` ready in ${u.elapsedMs}ms: ${u.nodes} nodes${p}`)}else if(u.source==="error-bail")console.log(` \u26A0 reload bailed after ${u.elapsedMs}ms: ${u.errors} console error(s), ready signal never fired`);else{let p=Co(u);console.log(` \u26A0 reload timed out after ${u.elapsedMs}ms \u2014 ${p} (nodes: ${u.nodes}, targets: ${u.targets}, errors: ${u.errors})`)}if(i)try{let p=await we(i,10);if(i!==d&&i.close(),Array.isArray(p)&&p.length>0){console.log(`
|
|
571
566
|
\u26A0 ${p.length} error(s) during mount:
|
|
572
|
-
`);for(let
|
|
567
|
+
`);for(let b of p){let f=b.args.map(x=>typeof x=="object"?JSON.stringify(x):x).join(" ");if(console.log(` ${f}`),b.stack){let x=b.stack.split(`
|
|
573
568
|
`).slice(0,2);for(let O of x)console.log(` ${O.trim()}`)}}}}catch{}u&&!u.ready&&(process.exitCode=1);break}case"eval":case"js":{let o=a.slice(1).join(" ");o||(console.error(k("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(` ${h("js")} SootSim.bridges.test.findByText("Sign in")`),console.error(` ${h("js")} SootSim.bridges.debug.snapshot("before")`),console.error(` ${h("js")} SootSim.bridges.keyboard.type("hello")`),console.error(` ${h("js")} SootSim.state.root.children.length`),process.exit(1));let t=o;t.startsWith("(async")||(t=`(async () => ${t})()`);let s=await d.send({type:"evaluate",code:t});console.log(JSON.stringify(s,null,2));let r=o.toLowerCase(),i=[];(r.includes("sootsim:gohome")||r.includes("gohome"))&&i.push("sootsim shell home"),(r.includes("sootsim:appswitcher")||r.includes("appswitcher"))&&i.push("sootsim shell switcher"),(r.includes("keyboard.isvisible")||r.includes("keyboard.getmode"))&&i.push("sootsim debug state keyboard"),r.includes("interact.tap")&&i.push("sootsim do tap <x> <y>"),r.includes("keyboard.type")&&i.push("sootsim do type <text>"),(r.includes("keyboard.press")||r.includes("keyboard.dispatchkey"))&&i.push("sootsim do key <name>"),r.includes("keyboard.dismiss")&&i.push("sootsim do dismiss"),r.includes("dumptree")&&i.push("sootsim get tree"),r.includes("dumpaccessibilitytree")&&i.push("sootsim get a11y"),r.includes("getnodecount")&&i.push("sootsim get count"),r.includes("findbytext")&&i.push("sootsim find <text>"),(r.includes("findbytestid")||r.includes("findbyid"))&&i.push("sootsim find --testid <id>"),r.includes("document.hidden")&&i.push("sootsim debug state keyboard (includes tab health)"),i.length>0&&G("prefer-cli-over-eval",i);break}case"globals":{let o=await d.send({type:"evaluate",code:`(async () => {
|
|
574
569
|
const globals = {}
|
|
575
570
|
|
|
@@ -812,7 +807,7 @@ ${s}
|
|
|
812
807
|
mode: 'main-thread',
|
|
813
808
|
frames: (stats.recentFrames || []).slice(-${t}),
|
|
814
809
|
}
|
|
815
|
-
})()`});if(s.error&&(console.error(` error: ${s.error}`),process.exit(1)),A(l)){P(s);break}if(s.mode==="render-worker"){let i=Array.isArray(s.samples)?s.samples:[];if(i.length===0){console.log(` no frame data \u2014 run '${h("perf")} start' first`);break}console.log(` last ${i.length} sampled frames (ms):`),console.log(" total layout render copy aux other t+");for(let[u,p,
|
|
810
|
+
})()`});if(s.error&&(console.error(` error: ${s.error}`),process.exit(1)),A(l)){P(s);break}if(s.mode==="render-worker"){let i=Array.isArray(s.samples)?s.samples:[];if(i.length===0){console.log(` no frame data \u2014 run '${h("perf")} start' first`);break}console.log(` last ${i.length} sampled frames (ms):`),console.log(" total layout render copy aux other t+");for(let[u,p,b,f,x,O,q]of i)console.log(` ${p.toFixed(2).padStart(7)} ${b.toFixed(2).padStart(7)} ${f.toFixed(2).padStart(7)} ${x.toFixed(2).padStart(7)} ${O.toFixed(2).padStart(6)} ${q.toFixed(2).padStart(7)} ${String(u).padStart(5)}`);console.log(""),Be(i.map(u=>u[1])),s.live&&console.log(" sampling continues");break}let r=Array.isArray(s.frames)?s.frames:Array.isArray(s)?s:[];if(r.length===0){console.log(` no frame data \u2014 run '${h("perf")} start' first`);break}console.log(` last ${r.length} frame times (ms):`),console.log(` ${r.map(i=>i.toFixed(2)).join(", ")}`),Be(r);break}case"worst":{let t=a[2]?Number(a[2]):20;(!Number.isFinite(t)||t<=0)&&(console.error(` error: expected a positive frame count, got "${a[2]}"`),process.exit(1));let s=await d.send({type:"evaluate",code:`(async () => {
|
|
816
811
|
if (window.__sootsimRenderHost) {
|
|
817
812
|
const session = window.${se} || {}
|
|
818
813
|
if (session.active) {
|
|
@@ -854,7 +849,7 @@ ${s}
|
|
|
854
849
|
mode: 'main-thread',
|
|
855
850
|
frames: recent.slice().sort((a, b) => b - a).slice(0, ${t}),
|
|
856
851
|
}
|
|
857
|
-
})()`});if(s.error&&(console.error(` error: ${s.error}`),process.exit(1)),A(l)){P(s);break}if(s.mode==="render-worker"){let i=Array.isArray(s.samples)?s.samples:[];if(i.length===0){console.log(` no frame data \u2014 run '${h("perf")} start' first`);break}console.log(` worst ${i.length} sampled frames (ms):`),console.log(" total layout render copy aux other t+");for(let[u,p,
|
|
852
|
+
})()`});if(s.error&&(console.error(` error: ${s.error}`),process.exit(1)),A(l)){P(s);break}if(s.mode==="render-worker"){let i=Array.isArray(s.samples)?s.samples:[];if(i.length===0){console.log(` no frame data \u2014 run '${h("perf")} start' first`);break}console.log(` worst ${i.length} sampled frames (ms):`),console.log(" total layout render copy aux other t+");for(let[u,p,b,f,x,O,q]of i)console.log(` ${p.toFixed(2).padStart(7)} ${b.toFixed(2).padStart(7)} ${f.toFixed(2).padStart(7)} ${x.toFixed(2).padStart(7)} ${O.toFixed(2).padStart(6)} ${q.toFixed(2).padStart(7)} ${String(u).padStart(5)}`);s.live&&(console.log(""),console.log(" sampling continues"));break}let r=Array.isArray(s.frames)?s.frames:Array.isArray(s)?s:[];if(r.length===0){console.log(` no frame data \u2014 run '${h("perf")} start' first`);break}console.log(` worst ${r.length} frame times (ms):`),console.log(` ${r.map(i=>i.toFixed(2)).join(", ")}`);break}case"transition":{let t=a[2];if(!t||!["goHome","appSwitcher","lockScreen"].includes(t)){console.log(`
|
|
858
853
|
${h("perf")} transition <event> \u2014 profile a shell transition
|
|
859
854
|
|
|
860
855
|
events:
|
|
@@ -944,27 +939,27 @@ ${s}
|
|
|
944
939
|
p50: ${i.p50.toFixed(2)}ms
|
|
945
940
|
p95: ${i.p95.toFixed(2)}ms
|
|
946
941
|
p99: ${i.p99.toFixed(2)}ms
|
|
947
|
-
jank: ${i.jankFrames} frames (${p}%) >16.67ms`),Array.isArray(i.samples)&&i.samples.length>0&&(console.log(""),Be(i.samples.map(
|
|
942
|
+
jank: ${i.jankFrames} frames (${p}%) >16.67ms`),Array.isArray(i.samples)&&i.samples.length>0&&(console.log(""),Be(i.samples.map(b=>b[1])));break}default:console.error(` unknown perf subcommand: ${o}`),console.error(" valid: stats, start, stop, frames, worst, transition"),/^--?reset$/.test(o)&&console.error(" note: 'perf start' already clears prior frames \u2014 no reset needed"),process.exit(1)}break}case"errors":{let o=a[1];if(o==="clear"){await at(d),A(l)?P({cleared:!0}):console.log(" error buffer cleared");break}let t=o?Number(o):20,s=await we(d,t);if(A(l)){P(s);break}if(s.length===0){console.log(" no errors captured");break}console.log(` ${s.length} error(s):
|
|
948
943
|
`);for(let r of s){let i=re(r.timestamp),u=r.args.map(p=>typeof p=="object"?JSON.stringify(p):p).join(" ");if(console.log(` [${i}] ${u}`),r.stack){let p=r.stack.split(`
|
|
949
|
-
`).slice(0,3);for(let
|
|
944
|
+
`).slice(0,3);for(let b of p)console.log(` ${b.trim()}`)}}break}case"warnings":{let o=a[1]?Number(a[1]):20,t=await it(d,o);if(A(l)){P(t);break}if(t.length===0){console.log(" no warnings captured");break}console.log(` ${t.length} warning(s):
|
|
950
945
|
`);for(let s of t){let r=re(s.timestamp),i=s.args.map(u=>typeof u=="object"?JSON.stringify(u):u).join(" ");console.log(` [${r}] ${i}`)}break}case"animations":{let o=await Y(d,"listAnimations")??[];if(e.includes("--json")){console.log(JSON.stringify(o,null,2));break}if(o.length===0){console.log(" no active animations");break}console.log(` ${o.length} active animation(s):
|
|
951
|
-
`);for(let t of o){let s=String(t.kind).padEnd(6),r=`${Number(t.from).toFixed(2)}\u2192${Number(t.to).toFixed(2)}`,i=Number(t.current??0).toFixed(2),u=`${Math.round((t.progress??0)*100)}%`,p=`${Math.round(t.elapsedMs??0)}ms`,
|
|
952
|
-
`);for(let u of i){let p=re(u.timestamp);console.log(` [${p}] ${te(u)}`),u.responseBody?console.log(` ${u.responseBody}`):u.error&&console.log(` ${u.error}`)}break}case"network":{let o=a[1],t=null,s=null,r=!1,i=!1,u=1e3,p=!1,
|
|
946
|
+
`);for(let t of o){let s=String(t.kind).padEnd(6),r=`${Number(t.from).toFixed(2)}\u2192${Number(t.to).toFixed(2)}`,i=Number(t.current??0).toFixed(2),u=`${Math.round((t.progress??0)*100)}%`,p=`${Math.round(t.elapsedMs??0)}ms`,b=t.loop?" loop":"",f=t.layoutBound?" layout":"";console.log(` #${t.id} ${s} ${r.padEnd(14)} cur=${i.padEnd(7)} ${u.padStart(4)} ${p}${b}${f}`)}break}case"animation":{let o=a[1];(!o||o==="--help"||o==="-h")&&(console.error(` usage: ${h("animation")} <id>`),process.exit(1));let t=Number(o);Number.isFinite(t)||(console.error(` invalid id: ${o}`),process.exit(1));let s=await Y(d,"getAnimation",t);console.log(JSON.stringify(s,null,2));break}case"stop-animation":{let o=a[1];(!o||o==="--help"||o==="-h")&&(console.error(` usage: ${h("stop-animation")} <id|all>`),process.exit(1));let t=o==="all"?"all":Number(o);t!=="all"&&!Number.isFinite(t)&&(console.error(` invalid id: ${o}`),process.exit(1));let s=await Y(d,"stopAnimation",t);console.log(` stopped ${s??0} animation(s)`);break}case"requests":{let o=a[1];if(o==="clear"){await ct(d),A(l)?P({cleared:!0}):console.log(" request buffer cleared");break}let t=o==="all",s=t?a[2]:o,r=s?Number(s):20,i=await lt(d,{failed:!t,limit:r});if(A(l)){P(i);break}if(i.length===0){console.log(t?" no requests captured":" no failed requests captured");break}console.log(` ${i.length} ${t?"request(s)":"failed request(s)"}:
|
|
947
|
+
`);for(let u of i){let p=re(u.timestamp);console.log(` [${p}] ${te(u)}`),u.responseBody?console.log(` ${u.responseBody}`):u.error&&console.log(` ${u.error}`)}break}case"network":{let o=a[1],t=null,s=null,r=!1,i=!1,u=1e3,p=!1,b=!1;for(let F=0;F<l.length;F++){let w=l[F];if(w==="--filter")t=l[F+1]??null,F++;else if(w==="--limit"){let $=Number(l[F+1]);Number.isFinite($)&&(s=$),F++}else if(w==="--threshold"){let $=Number(l[F+1]);Number.isFinite($)&&$>0&&(u=$),F++}else w==="--failed"?r=!0:w==="--slow"?i=!0:w==="--tail"||w==="-f"?p=!0:w==="--json"&&(b=!0)}if(o==="clear"){await d.send({type:"evaluate",code:'window.__sootsimObservability?.network.clear(); "cleared"'}),console.log(" network buffer cleared");break}if(o==="get"){let F=a[2];F||(console.error(" usage: sootsim network get <id>"),process.exit(1));let w=await d.send({type:"evaluate",code:`(() => {
|
|
953
948
|
const obs = window.__sootsimObservability;
|
|
954
949
|
if (!obs) return null;
|
|
955
950
|
return obs.network.getSnapshot().find(e => e.id === ${JSON.stringify(F)}) || null;
|
|
956
|
-
})()`});
|
|
951
|
+
})()`});w||(console.error(` no entry with id ${F}`),process.exit(1)),b?console.log(JSON.stringify(w,null,2)):Bo(w);break}let f=s??(p?200:o?Number(o):20);Number.isFinite(f)||(console.error(` invalid limit: ${o} \u2014 \`network\` takes a numeric count (e.g. ${h("network")} 100).
|
|
957
952
|
to target a specific sim, use \`--sim ${o}\` instead.`),process.exit(1));let x=async()=>{let F=await d.send({type:"evaluate",code:`(() => {
|
|
958
953
|
const obs = window.__sootsimObservability;
|
|
959
954
|
if (!obs) return { ok: false };
|
|
960
955
|
return { ok: true, entries: obs.network.getSnapshot() };
|
|
961
|
-
})()`});if(!F||!F.ok)throw new Error("observability bridge not installed \u2014 is the engine running?");return F.entries??[]},O=F=>{let
|
|
962
|
-
`:` ${
|
|
963
|
-
`);for(let $ of
|
|
964
|
-
`);let q=new Set,H=!0,U=()=>{H=!1};process.on("SIGINT",U);try{for(;H;){let F=await x(),
|
|
965
|
-
to target a specific sim, use \`--sim ${o}\` instead.`),process.exit(1));let O=()=>dt(d),q=
|
|
956
|
+
})()`});if(!F||!F.ok)throw new Error("observability bridge not installed \u2014 is the engine running?");return F.entries??[]},O=F=>{let w=F;if(r&&(w=w.filter($=>!!$.error||$.status!=null&&$.status>=400)),i&&(w=w.filter($=>$.durationMs!=null&&$.durationMs>=u)),t){let $=t.toLowerCase();w=w.filter(v=>(v.displayUrl||v.url).toLowerCase().includes($))}return i&&!p&&(w=[...w].sort(($,v)=>(v.durationMs??0)-($.durationMs??0))),w};if(!p){let F=await x(),w=O(F).slice(-f);if(b){console.log(JSON.stringify(w,null,2));break}if(w.length===0){F.length===0?console.log(" no network requests captured"):console.log(i?` no requests slower than ${u}ms (${F.length} total \u2014 try --threshold <ms>)`:" no matching requests");break}console.log(i?` ${w.length} request(s) slower than ${u}ms (sorted by duration desc):
|
|
957
|
+
`:` ${w.length} request(s):
|
|
958
|
+
`);for(let $ of w)Gt($);break}console.log(` tailing network (ctrl-c to stop)...
|
|
959
|
+
`);let q=new Set,H=!0,U=()=>{H=!1};process.on("SIGINT",U);try{for(;H;){let F=await x(),w=O(F);for(let $ of w)$.durationMs!=null&&(q.has($.id)||(q.add($.id),b?console.log(JSON.stringify($)):Gt($)));await Z(250)}}finally{process.off("SIGINT",U)}break}case"logs":{let o=a[1],t=null,s=null,r=null,i=!1,u=!1,p=!1;for(let w=0;w<l.length;w++){let $=l[w];if($==="--filter")t=l[w+1]??null,w++;else if($==="--limit"){let v=Number(l[w+1]);Number.isFinite(v)&&(s=v),w++}else $==="--level"?(r=l[w+1]??null,w++):$==="--tail"||$==="-f"?i=!0:$==="--json"?u=!0:($==="--internal"||$==="--all")&&(p=!0)}let b=r?new Set(r.split(",").map(w=>w.trim()).filter(w=>w==="log"||w==="info"||w==="warn"||w==="error"||w==="debug")):null;if(o==="clear"){await ut(d),console.log(" log buffer cleared");break}let f=!u&&process.stdout.isTTY===!0,x=s??(i?500:o?Number(o):50);Number.isFinite(x)||(console.error(` invalid limit: ${o} \u2014 \`logs\` takes a numeric count (e.g. ${h("logs")} 100).
|
|
960
|
+
to target a specific sim, use \`--sim ${o}\` instead.`),process.exit(1));let O=()=>dt(d),q=w=>mt(w,{level:b,filter:t,showInternal:p});if(!i){let w=await O(),$=q(w).slice(-x);if(u){console.log(JSON.stringify($,null,2));break}if($.length===0){console.log(w.length===0?" no logs captured":" no matching logs");break}console.log(` ${$.length} log(s):
|
|
966
961
|
`);for(let v of $)Vt(v,f);break}console.log(` tailing logs (ctrl-c to stop)...
|
|
967
|
-
`);let H=new Set,U=!0,F=()=>{U=!1};process.on("SIGINT",F);try{for(;U;){let
|
|
962
|
+
`);let H=new Set,U=!0,F=()=>{U=!1};process.on("SIGINT",F);try{for(;U;){let w=await O(),$=q(w);for(let v of $)H.has(v.id)||(H.add(v.id),u?console.log(JSON.stringify(v)):Vt(v,f));await Z(250)}}finally{process.off("SIGINT",F)}break}default:console.error(` unknown subcommand: ${g}`),process.exit(1)}if(me.has(g)&&!e.includes("--no-wait")&&process.env.SOOTSIM_NO_AUTO_WAIT!=="1"&&!await Ge(d,g)&&await S(d),!B.has(g)&&!A(l))try{await ne(d)}catch{}}catch(o){let t=o instanceof Error?o.message:String(o);console.error(` ${g??"inspect"} failed: ${t}`);let s=/^no sim connected with id (.+)$/.exec(t),r=/^command timed out after (\d+)s$/.exec(t),i=t.startsWith("sim disconnected:")||t.startsWith("bridge never reconnected")||t.startsWith("could not connect to ws://");if(s)await St(d,_,s[1]);else if(/^no sim connected$/.test(t))$t(_);else if(r)if(await Ao(d)){let p=g??"describe";process.stderr.write(` the sim is still responsive \u2014 '${p}' just exceeded the ${r[1]}s command budget.
|
|
968
963
|
the screen's node tree is large; narrow the query or raise the budget:
|
|
969
964
|
sootsim ${p} --testid <id> # scope to one subtree
|
|
970
965
|
sootsim find --testid <id> # targeted single-node lookup
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as o}from"./chunk-HMBYOS66.js";import"./chunk-WCJMLITZ.js";import"./chunk-HNRZM6GI.js";import"./chunk-OULIZJPC.js";import"./chunk-CYKPWI35.js";import"./chunk-AJ34QMR4.js";import"./chunk-H7O2EPCU.js";import"./chunk-PINZJVS6.js";import"./chunk-KBW2VI34.js";import"./chunk-KABJPUT4.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};
|