sootsim 0.1.294 → 0.1.295
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 +5 -5
- package/dist-cli/chunks/{agent-GDFF6G7N.js → agent-ASAYE5YY.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-ZUKQUOD2.js → agent-wrapper-K2D4Q5AA.js} +2 -2
- package/dist-cli/chunks/{app-fonts-IMYBO6AQ.js → app-fonts-36N7AVQ3.js} +2 -2
- package/dist-cli/chunks/{assert-GXOGZUKO.js → assert-4FKHHDY7.js} +2 -2
- package/dist-cli/chunks/{auth-P7FAKLHQ.js → auth-BQPOPEFK.js} +2 -2
- package/dist-cli/chunks/{beta-RXT5RU3A.js → beta-3LNYONDF.js} +2 -2
- package/dist-cli/chunks/{camera-RNVAC4IO.js → camera-Y5MZ5V4L.js} +2 -2
- package/dist-cli/chunks/{chunk-7HVMAGDK.js → chunk-2RI6RC6I.js} +2 -2
- package/dist-cli/chunks/{chunk-D2R7PDN5.js → chunk-3WQISFAK.js} +1 -1
- package/dist-cli/chunks/{chunk-ZUX5PIGI.js → chunk-4NJIXTVJ.js} +1 -1
- package/dist-cli/chunks/{chunk-3F2GAJ4Z.js → chunk-4ODQVUBH.js} +1 -1
- package/dist-cli/chunks/{chunk-W44PDEQH.js → chunk-4V2KYK5T.js} +2 -2
- package/dist-cli/chunks/chunk-6VF477QO.js +4 -0
- package/dist-cli/chunks/{chunk-24BJFJFB.js → chunk-7FYIMLU4.js} +18 -18
- package/dist-cli/chunks/{chunk-WQL3BLFD.js → chunk-7GVBNEQ3.js} +1 -1
- package/dist-cli/chunks/{chunk-PZTKQG6H.js → chunk-7GZ6XF2B.js} +5 -5
- package/dist-cli/chunks/{chunk-O6I5ZGMY.js → chunk-BX2NUJGR.js} +1 -1
- package/dist-cli/chunks/{chunk-ZFMJFX27.js → chunk-COEKUTWV.js} +2 -2
- package/dist-cli/chunks/chunk-CVDC2ER2.js +10 -0
- package/dist-cli/chunks/{chunk-CTMPC5DN.js → chunk-D2DU3ROC.js} +2 -2
- package/dist-cli/chunks/{chunk-FSRRJGYC.js → chunk-DKS75M2I.js} +2 -2
- package/dist-cli/chunks/{chunk-XYFP466E.js → chunk-DXCQP3VE.js} +2 -2
- package/dist-cli/chunks/{chunk-FNCSUHUR.js → chunk-E6DZD6JD.js} +1 -1
- package/dist-cli/chunks/{chunk-VXGCZUX4.js → chunk-ETDZQUGI.js} +2 -2
- package/dist-cli/chunks/{chunk-4Z4URZOG.js → chunk-FH7DQ2HB.js} +2 -2
- package/dist-cli/chunks/{chunk-5S3GPTX7.js → chunk-HT6WYHQL.js} +2 -2
- package/dist-cli/chunks/{chunk-AMKQUZA2.js → chunk-I4QJVACX.js} +1 -1
- package/dist-cli/chunks/chunk-I7AWRAXM.js +125 -0
- package/dist-cli/chunks/{chunk-WYRLRNIP.js → chunk-JPPGM6RZ.js} +2 -2
- package/dist-cli/chunks/{chunk-JUOQ4ZPA.js → chunk-K7LQB4IF.js} +1 -1
- package/dist-cli/chunks/{chunk-OYYQQBKP.js → chunk-L7V46673.js} +1 -1
- package/dist-cli/chunks/{chunk-EXTV6NWM.js → chunk-MEYVMDZR.js} +2 -2
- package/dist-cli/chunks/{chunk-6YN3IAWJ.js → chunk-OQ7SSRYK.js} +1 -1
- package/dist-cli/chunks/{chunk-BBVBMGTT.js → chunk-QKZVANQG.js} +3 -3
- package/dist-cli/chunks/{chunk-ISJ4ACWL.js → chunk-QPA44BZC.js} +3 -3
- package/dist-cli/chunks/{chunk-BXO2PTNM.js → chunk-RNW36VM5.js} +2 -2
- package/dist-cli/chunks/{chunk-I233T2T4.js → chunk-RV67EC7L.js} +2 -2
- package/dist-cli/chunks/{chunk-AFLGWOX3.js → chunk-S6BEA6OC.js} +1 -1
- package/dist-cli/chunks/{chunk-DUHBRW7J.js → chunk-SU5WQ4SQ.js} +1 -1
- package/dist-cli/chunks/{chunk-KWIURH7N.js → chunk-T2DHHOWE.js} +2 -2
- package/dist-cli/chunks/{chunk-7Q77LTPT.js → chunk-TGYZYSDB.js} +2 -2
- package/dist-cli/chunks/{chunk-VVVORIQI.js → chunk-TNKZWHD2.js} +1 -1
- package/dist-cli/chunks/{chunk-37ZXWXM3.js → chunk-TXURXDZN.js} +1 -1
- package/dist-cli/chunks/{chunk-V2MYTL4C.js → chunk-U2QPKFOY.js} +2 -2
- package/dist-cli/chunks/{chunk-2M7OZ6Y4.js → chunk-UAZ3NVKO.js} +2 -2
- package/dist-cli/chunks/{chunk-RWUNC66S.js → chunk-UBIGBHUM.js} +2 -2
- package/dist-cli/chunks/{chunk-SLMUW2WU.js → chunk-UWFAWMPE.js} +2 -2
- package/dist-cli/chunks/{chunk-N4MT5KEB.js → chunk-WFYQNZTT.js} +3 -3
- package/dist-cli/chunks/{chunk-PSOUSJSZ.js → chunk-X5FTDIHQ.js} +1 -1
- package/dist-cli/chunks/{chunk-K53YCAQM.js → chunk-XCCDO6I2.js} +1 -1
- package/dist-cli/chunks/{chunk-DI55E6CS.js → chunk-XQRUWC3F.js} +2 -2
- package/dist-cli/chunks/{chunk-AO65WEF7.js → chunk-Y6FJ5FCY.js} +1 -1
- package/dist-cli/chunks/{chunk-SPQKJDIK.js → chunk-ZJZYGLJ2.js} +1 -1
- package/dist-cli/chunks/{cleanup-74SKOD2P.js → cleanup-SMCA44QC.js} +2 -2
- package/dist-cli/chunks/{cli-version-2JGMYL4O.js → cli-version-I6BOBK57.js} +2 -2
- package/dist-cli/chunks/{compat-ME6HXEEU.js → compat-FCM2ZQLV.js} +3 -3
- package/dist-cli/chunks/{config-PM67EWT3.js → config-PZSANSAI.js} +2 -2
- package/dist-cli/chunks/{control-HV7GZXAH.js → control-PM554MHE.js} +2 -2
- package/dist-cli/chunks/daemon-5KXEZZLJ.js +4 -0
- package/dist-cli/chunks/{debug-XUGWZLIW.js → debug-VG2JOF6H.js} +3 -3
- package/dist-cli/chunks/{desktop-IO5HPX5Z.js → desktop-GH2POW6X.js} +3 -3
- package/dist-cli/chunks/{detox-E42OEJJZ.js → detox-X6T265L5.js} +2 -2
- package/dist-cli/chunks/{device-XA67L2EB.js → device-VDOOSAXO.js} +2 -2
- package/dist-cli/chunks/{diagnose-36FD6ECF.js → diagnose-6D6WNAGL.js} +2 -2
- package/dist-cli/chunks/disk-cleanup-HTOIDDKK.js +4 -0
- package/dist-cli/chunks/drivers-CKLBQDXG.js +4 -0
- package/dist-cli/chunks/{film-XARTGFIZ.js → film-UZWYISAB.js} +3 -3
- package/dist-cli/chunks/flow-VOS3RKB3.js +4 -0
- package/dist-cli/chunks/help-LVMDERFQ.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-T4ZALBE2.js → hidden-runtime-alias-UGMJ4LJX.js} +2 -2
- package/dist-cli/chunks/{home-paths-5L7N2FLS.js → home-paths-3LYT47SY.js} +2 -2
- package/dist-cli/chunks/inspect-FHCSOWGQ.js +4 -0
- package/dist-cli/chunks/install-desktop-KLMCVDGZ.js +4 -0
- package/dist-cli/chunks/{login-GF6WVVER.js → login-K43TRKUC.js} +4 -4
- package/dist-cli/chunks/{logout-6F6UKUNI.js → logout-L43CR6M2.js} +2 -2
- package/dist-cli/chunks/{maestro-FMPKHEMX.js → maestro-7VZFYLNS.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-QGPGNXI6.js → maestro-generate-PMYHUVH4.js} +3 -3
- package/dist-cli/chunks/{mode-JSNMAHDZ.js → mode-QQS5XFFX.js} +2 -2
- package/dist-cli/chunks/{optional-demo-registry-K4VERLJV.js → optional-demo-registry-2V327HDG.js} +2 -2
- package/dist-cli/chunks/{perf-PO7ARUTG.js → perf-CL5P3JVP.js} +2 -2
- package/dist-cli/chunks/{permissions-XI2QUAEZ.js → permissions-RGVCEC2B.js} +2 -2
- package/dist-cli/chunks/{record-4CJCJAFD.js → record-ASW6UFQT.js} +3 -3
- package/dist-cli/chunks/runtime-GB3ZE27C.js +4 -0
- package/dist-cli/chunks/{screenshot-command-NDVULWMZ.js → screenshot-command-FEJGQMQF.js} +3 -3
- package/dist-cli/chunks/{screenshots-capture-Q7UTXF3V.js → screenshots-capture-3JPZ5WMX.js} +2 -2
- package/dist-cli/chunks/{serve-UEUIBHCK.js → serve-SYXRHRQO.js} +2 -2
- package/dist-cli/chunks/{setup-ZEEWYK4B.js → setup-QLGL6MC6.js} +3 -3
- package/dist-cli/chunks/{skills-NFG6VAO5.js → skills-T6EEX5P6.js} +2 -2
- package/dist-cli/chunks/{storage-POWCOUCQ.js → storage-ZFUK4EQA.js} +2 -2
- package/dist-cli/chunks/store-WCDTSWJC.js +4 -0
- package/dist-cli/chunks/telemetry-D7SL4WW7.js +4 -0
- package/dist-cli/chunks/{timeline-MNHZCVAL.js → timeline-EIURYQVC.js} +2 -2
- package/dist-cli/chunks/{upgrade-X57SIG7L.js → upgrade-Q7ZGWMCJ.js} +2 -2
- package/dist-cli/chunks/upload-7XEICYJX.js +4 -0
- package/dist-cli/chunks/{version-V4IKIDX7.js → version-PDG4V26R.js} +2 -2
- package/dist-cli/chunks/web-AMW2TRWB.js +4 -0
- package/dist-cli/chunks/{what-happened-H74HHGRK.js → what-happened-L5ZN7S5G.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +2 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +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 +4 -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 +2 -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 +4 -1
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +8 -6
- package/dist-lib/vite.cjs +2 -1
- package/package.json +1 -1
- package/skills/contrast/SKILL.md +2 -2
- package/src/bridge-constants.ts +1 -0
- package/src/index.ts +4 -1
- package/dist-cli/chunks/chunk-JFWEDISV.js +0 -120
- package/dist-cli/chunks/chunk-JGGXQHXH.js +0 -10
- package/dist-cli/chunks/chunk-OKSGM6IG.js +0 -4
- package/dist-cli/chunks/daemon-LKRHF5OK.js +0 -4
- package/dist-cli/chunks/disk-cleanup-DDCFGFWK.js +0 -4
- package/dist-cli/chunks/drivers-C2SH3DWS.js +0 -4
- package/dist-cli/chunks/flow-E64G5LF3.js +0 -4
- package/dist-cli/chunks/help-4ZSRG4F4.js +0 -4
- package/dist-cli/chunks/inspect-U2SV25ER.js +0 -4
- package/dist-cli/chunks/install-desktop-LTGVT7ID.js +0 -4
- package/dist-cli/chunks/runtime-SN2RWDES.js +0 -4
- package/dist-cli/chunks/store-BJK7V7FL.js +0 -4
- package/dist-cli/chunks/telemetry-EJP5EW7K.js +0 -4
- package/dist-cli/chunks/upload-JABM3ITZ.js +0 -4
- package/dist-cli/chunks/web-F5CLF34I.js +0 -4
package/dist-cli/bin.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! sootsim v0.1.
|
|
2
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
3
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
4
4
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
5
|
-
import{a as w,b as g}from"./chunks/chunk-
|
|
5
|
+
import{a as w,b as g}from"./chunks/chunk-ZJZYGLJ2.js";import"./chunks/chunk-3WQISFAK.js";function b(t){let a=t instanceof Error?t.message:String(t);(/^command timed out after \d+s$/.test(a)||a.startsWith("sim disconnected:")||a.startsWith("bridge never reconnected")||a.startsWith("multiple sims are connected:")||a.startsWith("saved sim ")||a.startsWith("no sim connected with id ")||a.startsWith("could not connect to ws://")||a.startsWith("sootsim bridge daemon is not running")||a.startsWith("sootsim bridge lockfile is fresh")||a.startsWith("sootsim bridge exited before becoming ready")||a.startsWith("background daemon setup is unavailable")||a.startsWith("sootsim bridge did not start within"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${a}
|
|
6
6
|
`),process.exit(1)),t instanceof Error&&t.stack?process.stderr.write(`${t.stack}
|
|
7
7
|
`):process.stderr.write(`${a}
|
|
8
8
|
`),process.exit(1)}process.on("unhandledRejection",b);process.on("uncaughtException",b);var A=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,k=new Set(["desktop"]);function S(t){!A||!k.has(t)||(process.stderr.write(` sootsim ${t} isn't available in the standalone binary \u2014
|
|
9
9
|
it needs vite / electron / playwright from a project's node_modules.
|
|
10
10
|
run the npm package instead:
|
|
11
11
|
sootsim ${t}
|
|
12
|
-
`),process.exit(1))}var e=g(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:t}=await import("./chunks/hidden-runtime-alias-
|
|
13
|
-
`)}var f=!1;async function v(){if(!f&&(f=!0,!(e.command==="cleanup"||e.command==="serve"||e.command==="agent-wrapper"||e.command==="daemon"&&e.commandArgs[0]==="uninstall")))try{let{isAutomaticSootsimCleanupComplete:t}=await import("./chunks/disk-cleanup-
|
|
12
|
+
`),process.exit(1))}var e=g(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:t}=await import("./chunks/hidden-runtime-alias-UGMJ4LJX.js");e=t(e)}var _=e.command==="cleanup"&&e.commandArgs.length===1&&e.commandArgs[0]==="--automatic-worker";if(!_){let{trackCliEvent:t}=await import("./chunks/telemetry-D7SL4WW7.js");t({event:"cli_command_invoked",properties:{command:e.command||(e.version?"version":e.help?"help":"none"),arg_count:e.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}if(e.command!=="serve"&&e.command!=="daemon"){let{consumeRuntimeUpgradeNotice:t}=await import("./chunks/home-paths-3LYT47SY.js"),a=t();a&&process.stderr.write(` SootSim engine upgraded to v${a.to}`+(a.from?` (from v${a.from})`:"")+` \xB7 what's new: https://sootsim.com/changelog
|
|
13
|
+
`)}var f=!1;async function v(){if(!f&&(f=!0,!(e.command==="cleanup"||e.command==="serve"||e.command==="agent-wrapper"||e.command==="daemon"&&e.commandArgs[0]==="uninstall")))try{let{isAutomaticSootsimCleanupComplete:t}=await import("./chunks/disk-cleanup-HTOIDDKK.js");if(t())return;let{spawn:a}=await import("node:child_process"),s=["cleanup","--automatic-worker"],m=process.argv[1],d=A?a(process.execPath,s,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):m?a(process.execPath,[m,...s],{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):a("sootsim",s,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env});d.once("error",p=>{process.stderr.write(` SootSim automatic cleanup will retry on the next run: ${p.message}
|
|
14
14
|
`)}),d.unref()}catch(t){process.stderr.write(` SootSim automatic cleanup will retry on the next run: ${t instanceof Error?t.message:String(t)}
|
|
15
|
-
`)}}async function n(t){let{flushCliTelemetry:a}=await import("./chunks/telemetry-
|
|
15
|
+
`)}}async function n(t){let{flushCliTelemetry:a}=await import("./chunks/telemetry-D7SL4WW7.js");await a(),await v(),process.exit(t)}if(e.version){let{getCliVersion:t}=await import("./chunks/cli-version-I6BOBK57.js"),{IS_BETA:a,BETA_LABEL:s}=await import("./chunks/beta-3LNYONDF.js"),m=a?` \xB7 ${s}`:"";console.log(`sootsim v${t()}${m}`);let{readActiveRuntime:d}=await import("./chunks/home-paths-3LYT47SY.js"),p=d();console.log(p?`runtime v${p}`:"runtime not installed"),await n(0)}if(e.help&&!e.command){let{printHelp:t}=await import("./chunks/help-LVMDERFQ.js");t(),await n(0)}var o=e.globalFlags.port,c=e.verbose,l=e.globalFlags.device,u=e.globalFlags.theme,C=e.globalFlags.driver,O=e.globalFlags.headless===!0,h=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,i=h?["--sim",h,...e.commandArgs]:e.commandArgs;if(l||u){let{settingsStore:t}=await import("./chunks/store-WCDTSWJC.js"),a={};l&&(a.deviceModel=l),u&&(a.colorScheme=u),t.apply(a)}if(!e.command&&e.commandArgs.length===0){let{runSetup:t,shouldRunSetupForBareCommand:a}=await import("./chunks/setup-QLGL6MC6.js");a()&&(await t(["--from-welcome"]),await n(0));let{printHelp:s}=await import("./chunks/help-LVMDERFQ.js");s(),await n(0)}var r=e.command??"";if(!r){if(e.commandArgs.length>0){let a=e.commandArgs.find(s=>!s.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${a}`),console.error(" run `sootsim --help` to see the full surface."),await n(1)}let{printHelp:t}=await import("./chunks/help-LVMDERFQ.js");t(),await n(0)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(r==="skill"){let{runSkill:s}=await import("./chunks/skills-T6EEX5P6.js");await s(e.commandArgs),await n(0)}let t=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="perf"||r==="wait",a=e.commandArgs.find(s=>!s.startsWith("-"));if(!(r==="shell"||r==="perf"))if(t&&!a){let{printGroupHelp:s}=await import("./chunks/help-LVMDERFQ.js");s(r)&&await n(0)}else{let{printCommandHelp:s}=await import("./chunks/help-LVMDERFQ.js");s(t&&a?a:r,{prefer:t&&a?"verb":"command",group:t&&a?r:void 0}),await n(0)}}S(r);if(w.has(r)){let{runInspect:t}=await import("./chunks/inspect-FHCSOWGQ.js");await t([r,...i],{port:o,verbose:c})}else switch(r){case"assert":{let{runAssert:t}=await import("./chunks/assert-4FKHHDY7.js");await t(e.commandArgs);break}case"detox":{let{runDetox:t}=await import("./chunks/detox-X6T265L5.js");await t(e.commandArgs,{port:o,verbose:c});break}case"maestro":{let{runMaestro:t}=await import("./chunks/maestro-7VZFYLNS.js"),a=await t(i,{port:o,verbose:c});await n(typeof a=="number"?a:0)}case"record":{let{runRecord:t}=await import("./chunks/record-ASW6UFQT.js");await t(i,{port:o,verbose:c});break}case"film":{let{runFilm:t}=await import("./chunks/film-UZWYISAB.js"),a=await t(i,{port:o,verbose:c});await n(typeof a=="number"?a:0)}case"storage":{let{runStorage:t}=await import("./chunks/storage-ZFUK4EQA.js"),a=await t(i,{port:o,verbose:c});await n(typeof a=="number"?a:0)}case"perf":{let{runPerf:t}=await import("./chunks/perf-CL5P3JVP.js"),a=await t(i,{port:o,verbose:c});await n(typeof a=="number"?a:0)}case"screenshot":{let{runScreenshotCommand:t}=await import("./chunks/screenshot-command-FEJGQMQF.js"),a=await t(i,{port:o,verbose:c});await n(typeof a=="number"?a:0)}case"mode":{let{runMode:t}=await import("./chunks/mode-QQS5XFFX.js");await t(i,{port:o,verbose:c});break}case"permissions":{let{runPermissions:t}=await import("./chunks/permissions-RGVCEC2B.js"),a=await t(i,{port:o,verbose:c});await n(a)}case"inspect":{let{runInspect:t}=await import("./chunks/inspect-FHCSOWGQ.js");await t(i,{port:o,verbose:c});break}case"debug":{let{runDebug:t}=await import("./chunks/debug-VG2JOF6H.js");await t(i,{port:o,verbose:c});break}case"timeline":{let{runTimeline:t}=await import("./chunks/timeline-EIURYQVC.js");await t(i,{port:o,verbose:c});break}case"what-happened":{let{runWhatHappened:t}=await import("./chunks/what-happened-L5ZN7S5G.js");await t(i,{port:o,verbose:c});break}case"open":{let{runOpenCommand:t}=await import("./chunks/control-PM554MHE.js");await t(i,{port:o});break}case"use":{let{runUseCommand:t}=await import("./chunks/control-PM554MHE.js");await t(i,{port:o});break}case"claim":{let{runClaimCommand:t}=await import("./chunks/control-PM554MHE.js");await t(i,{port:o});break}case"close":{let{runCloseCommand:t}=await import("./chunks/control-PM554MHE.js");await t(i,{port:o});break}case"device":{let{runDeviceCommand:t}=await import("./chunks/device-VDOOSAXO.js");await t(i,{port:o});break}case"compat":{let{runCompat:t}=await import("./chunks/compat-FCM2ZQLV.js");await t(e.commandArgs);break}case"desktop":{let{runDesktop:t}=await import("./chunks/desktop-GH2POW6X.js");await t(e.commandArgs,{port:o,device:l,driver:C});break}case"login":{let{runLogin:t}=await import("./chunks/login-K43TRKUC.js");await t(e.commandArgs);break}case"logout":{let{runLogout:t}=await import("./chunks/logout-L43CR6M2.js");await t();break}case"auth":{let{runAuth:t}=await import("./chunks/auth-BQPOPEFK.js");await t(e.commandArgs);break}case"setup":{let{runSetup:t}=await import("./chunks/setup-QLGL6MC6.js");await t(e.commandArgs);break}case"serve":{let{runServe:t}=await import("./chunks/serve-SYXRHRQO.js");await t(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:t}=await import("./chunks/daemon-5KXEZZLJ.js");await t(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:t}=await import("./chunks/runtime-GB3ZE27C.js");await t(e.commandArgs);break}case"upgrade":{let{runUpgrade:t}=await import("./chunks/upgrade-Q7ZGWMCJ.js");await t(e.commandArgs);break}case"version":{let{runVersion:t}=await import("./chunks/version-PDG4V26R.js");await t(e.commandArgs);break}case"agent":{let{runAgentCommand:t}=await import("./chunks/agent-ASAYE5YY.js"),a=await t(e.commandArgs);await n(a)}case"agent-wrapper":{let{runAgentWrapper:t}=await import("./chunks/agent-wrapper-K2D4Q5AA.js"),a=await t(e.commandArgs);await n(a)}case"skill":{let{runSkill:t}=await import("./chunks/skills-T6EEX5P6.js");await t(e.commandArgs);break}case"app-fonts":{let{runAppFonts:t}=await import("./chunks/app-fonts-36N7AVQ3.js");await t(e.commandArgs);break}case"config":{let{runConfig:t}=await import("./chunks/config-PZSANSAI.js");await t(e.commandArgs);break}case"cleanup":{let{runCleanup:t}=await import("./chunks/cleanup-SMCA44QC.js"),a=await t(e.commandArgs);await n(a)}default:console.error(` unknown command: ${r}`),console.error(" run `sootsim --help` to see the full surface."),await n(1)}await v();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as b,b as E,c as A,d as l,e as S,g as j,h as T,j as I,n as k,o as D,p as x,q as g,r as O,s as C}from"./chunk-
|
|
4
|
+
import{a as b,b as E,c as A,d as l,e as S,g as j,h as T,j as I,n as k,o as D,p as x,q as g,r as O,s as C}from"./chunk-UAZ3NVKO.js";import"./chunk-BX2NUJGR.js";import{c as $}from"./chunk-CVDC2ER2.js";import"./chunk-RV67EC7L.js";import"./chunk-FH7DQ2HB.js";import"./chunk-XQRUWC3F.js";import"./chunk-ETDZQUGI.js";import"./chunk-6VF477QO.js";import"./chunk-K7LQB4IF.js";import"./chunk-I7AWRAXM.js";import{j as y}from"./chunk-7GVBNEQ3.js";import"./chunk-X5FTDIHQ.js";import"./chunk-SU5WQ4SQ.js";import"./chunk-3WQISFAK.js";import w from"node:fs";import d from"node:path";import{spawn as _}from"node:child_process";import F from"node:net";import{WebSocket as R}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new R(`ws://localhost:${this.port}`),this.ready=new Promise((t,r)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),r(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async sendClaimedPrompt(e,t){return this.send("agent:send-claimed-prompt",{simId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==R.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let r=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(r),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(r,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:r,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(r),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let r=this.pending.get(t.id);r&&(this.pending.delete(t.id),clearTimeout(r.timer),t.error?r.reject(new c(t.error,t.code)):r.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function M(n=7668,e=400){return new Promise(t=>{let r=new F.Socket,s=!1,o=i=>{s||(s=!0,r.destroy(),t(i))};r.setTimeout(e),r.once("connect",()=>o(!0)),r.once("timeout",()=>o(!1)),r.once("error",()=>o(!1)),r.connect(n,"127.0.0.1")})}async function B(n={}){let e=n.port??7668;if(await M(e))return{alreadyRunning:!0};if(y())throw new c(`no sootsim bridge on port ${e}. run \`sootsim setup\` to install the background daemon, or \`sootsim serve\` in another shell.`,"DEV_HOST_REFUSED");let{cmd:t,prefixArgs:r}=C(),s=[...r,"serve","--quiet"];e!==7668&&s.push("--port",String(e));let o=_(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(n.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await M(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned sootsim daemon on port ${e} but it did not come up in time. run \`sootsim serve\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await B({port:n.port,startupTimeoutMs:n.startupTimeoutMs});let e=new f(n);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function ge(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return L(),0;case"attach":return await W(t);case"projects":return await J();case"project":return await V(t);case"sessions":return await H(t);case"start":return await G(t);case"prompt":return await q(t);case"watch":return await K(t);case"transcript":return await z(t);case"end":return await Q(t);case"paths":return await Y();default:return process.stderr.write(`unknown agent subcommand: ${e}
|
|
5
5
|
`),L(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
|
|
6
6
|
`),1;throw r}}async function v(n){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await n(e)}finally{e.close()}}function L(){$("agent")}function P(n,e){let t={},r=[];for(let s=0;s<n.length;s++){let o=n[s],i=e[o];i==="value"?(t[o]=n[s+1]??"",s++):i==="bool"?t[o]=!0:r.push(o)}return{flags:t,positional:r}}function U(n,e="codex"){return n==="codex"||n==="claude"?n:e}async function W(n){let{flags:e,positional:t}=P(n,{"--name":"value","--provider":"value"}),r=t[0];if(!r)return process.stderr.write(`usage: sootsim agent attach <dir> [--name X] [--provider codex|claude]
|
|
7
7
|
`),2;let s=d.resolve(r);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{b as M}from"./chunk-
|
|
4
|
+
import{b as M}from"./chunk-BX2NUJGR.js";import"./chunk-3WQISFAK.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as C,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,f=!1,a=new Promise(s=>{t.on("exit",(o,e)=>{f=!0;let p=new Error(`codex app-server exited (code=${o}, signal=${e??""})`);for(let{reject:y}of r.values())y(p);r.clear(),s({code:o,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let o=s.trim();if(!o)return;let e;try{e=JSON.parse(o)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,y=p!=null?r.get(p):void 0;if(!y)return;r.delete(p),e.error?y.reject(new b(e.error.message,e.error.code,e.error.data)):y.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let y of p)try{y(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let o=m.get("__stderr__");if(o)for(let e of o)try{e({text:s})}catch{}});function n(s){if(!f)try{t.stdin.write(JSON.stringify(s)+`
|
|
5
5
|
`)}catch{}}return{exited:a,on(s,o){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(o),()=>{e?.delete(o)}},request(s,o){if(f)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,y)=>{r.set(e,{resolve:l=>p(l),reject:y,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:o})})},notify(s,o){n({jsonrpc:"2.0",method:s,params:o})},async shutdown(s=1500){if(f)return;try{t.stdin.end()}catch{}let o=setTimeout(()=>{if(!f)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(o)}},kill(s="SIGTERM"){if(!f)try{t.kill(s)}catch{}}}}var O="never",F="danger-full-access",Z={type:"dangerFullAccess"},D="fast",ee="medium",te=Q(G);async function ne(d,t){let r=t||d;if(r.includes("/")||r.includes("\\"))return C(r)?{ok:!0,path:r}:{ok:!1,message:`agent binary not found at path: ${r}`};try{let{stdout:m}=await te("which",[r],{timeout:1500}),u=m.trim();return u?{ok:!0,path:u}:{ok:!1,message:`${r} not found on PATH`}}catch{return{ok:!1,message:`${r} not found on PATH. install the ${d} CLI and retry, or pass --${d}-bin /path/to/${d} to agent start.`}}}function re(d){let t={"--session-id":"sessionId","--project-id":"projectId","--provider":"provider","--cwd":"cwd","--prompt-in":"promptIn","--events-out":"eventsOut","--transcript":"transcript","--codex-bin":"codexBin","--claude-bin":"claudeBin","--claude-session-uuid":"claudeSessionUuid"},r={};for(let m=0;m<d.length;m++){let u=d[m];if(u==="--fresh-thread"){r.freshThread=!0;continue}let f=t[u];f&&(r[f]=d[m+1],m++)}return r}async function Ie(d){let t=re(d);if(!t.sessionId||!t.projectId||!t.provider||!t.cwd||!t.promptIn||!t.eventsOut)return process.stderr.write(`usage: sootsim agent-wrapper --session-id <id> --project-id <id>
|
|
6
6
|
--provider codex|claude --cwd <path>
|
|
7
7
|
--prompt-in <fifo> --events-out <fifo>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{d as p}from"./chunk-
|
|
4
|
+
import{d as p}from"./chunk-TXURXDZN.js";import"./chunk-3WQISFAK.js";import{existsSync as h,mkdirSync as d,readFileSync as y,writeFileSync as g}from"node:fs";import{join as m}from"node:path";import{gzipSync as w}from"node:zlib";function f(t,e){let o=t.indexOf(`--${e}`);if(o!==-1&&o+1<t.length)return t[o+1];let i=t.find(r=>r.startsWith(`--${e}=`));return i?i.slice(e.length+3):void 0}async function S(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),i=f(t,"manifest");if((!o||!i)&&(console.error(" usage: sootsim app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>"),process.exit(1)),!e.trim()){console.log("no app fonts declared \u2014 nothing to stage");return}d(o,{recursive:!0});let r=await p(e,{onStaged:({url:n,byteLength:s})=>console.log(` staged app font: ${n} (${(s/1024).toFixed(1)} KiB)`),onError:(n,s)=>console.error(` warning: failed to fetch app font ${n}: ${s instanceof Error?s.message:s}`)}),a=[];for(let n of r){let s=w(n.bytes);g(m(o,n.urlhash),s),a.push({url:n.url,urlhash:n.urlhash,contentType:n.contentType,encoding:"gzip",sizeBytes:s.length,rawBytes:n.bytes.byteLength})}let c=[];if(h(i))try{let n=JSON.parse(y(i,"utf8"));Array.isArray(n)&&(c=n)}catch{}let u=new Set(c.map(n=>n.urlhash)),l=[...c,...a.filter(n=>!u.has(n.urlhash))];g(i,JSON.stringify(l)),console.log(`staged ${a.length} app font(s); manifest now has ${l.length} file(s)`)}async function E(t){let e=t[0];if(e==="stage"){await S(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import"./chunk-
|
|
4
|
+
import"./chunk-3WQISFAK.js";import{spawn as x}from"child_process";var w=new Set(["describe","find","list","network","logs","count","tree","url","a11y","node","layout","keyboard","errors","warnings","requests","animations","animation","state","sample-color"]),S=new Set(["--exists","--empty","--negate","--quiet","--allow-timeout","!"]),q=new Set(["--count","--count-at-least","--count-at-most","--contains","--not-contains","--matches","--not-matches","--equals","--jq","--has-path","--within"]),P=new Set(["--path-equals"]);function j(s){let r=[],u=[],n=0,e=!1,t=!1,i=!1;for(let o=0;o<s.length;o++){let a=s[o];if(a==="--within"){let c=Number(s[o+1]);if(!Number.isFinite(c)||c<0)return{error:`--within requires a non-negative number, got: ${s[o+1]}`};n=c,o++;continue}if(a==="--negate"||a==="!"){e=!0;continue}if(a==="--quiet"){t=!0;continue}if(a==="--allow-timeout"){i=!0;continue}if(S.has(a)){u.push({kind:a,args:[]});continue}if(q.has(a)){let c=s[o+1];if(c==null)return{error:`${a} requires a value`};u.push({kind:a,args:[c]}),o++;continue}if(P.has(a)){let c=s[o+1],f=s[o+2];if(c==null||f==null)return{error:`${a} requires <path> <value>`};u.push({kind:a,args:[c,f]}),o+=2;continue}r.push(a)}return r.length===0?{error:"assert requires a verb (e.g. find, describe, get errors)"}:{verbArgs:r,predicates:u,withinMs:n,negate:e,quiet:t,allowTimeout:i}}function N(s){return s[0]==="get"||s[0]==="debug"?w.has(s[1])?s[1]:null:s[0]==="do"||s[0]==="wait"?null:w.has(s[0])?s[0]:null}async function R(s){let u=[process.argv[1],...s,"--json"];return new Promise(n=>{let e=x(process.execPath,u,{stdio:["ignore","pipe","pipe"],env:process.env}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",o=>{n({ok:!1,payload:null,reason:`spawn failed: ${o.message}`})}),e.on("close",o=>{if(o!==0){let a=i.trim().split(`
|
|
5
5
|
`).slice(-2).join(" | ").slice(0,200);n({ok:!1,payload:null,reason:`verb exited ${o}${a?`: ${a}`:""}`});return}if(!t.trim()){n({ok:!1,payload:null,reason:"verb produced no output"});return}try{let a=JSON.parse(t);n({ok:!0,payload:a})}catch{n({ok:!1,payload:null,reason:`verb output was not valid json: ${t.slice(0,120)}`})}})})}function y(s,r){let u=r.split(".").filter(e=>e.length>0),n=s;for(let e of u){if(n==null)return{found:!1};if(Array.isArray(n)){let t=Number(e);if(!Number.isInteger(t)||t<0||t>=n.length)return{found:!1};n=n[t];continue}if(typeof n=="object"){let t=n;if(!(e in t))return{found:!1};n=t[e];continue}return{found:!1}}return{found:!0,value:n}}function d(s){return Array.isArray(s)?s.length:s&&typeof s=="object"?Object.keys(s).length:null}async function A(s,r){let{kind:u,args:n}=s;switch(u){case"--exists":return r==null?{ok:!1,reason:"payload is null"}:d(r)===0?{ok:!1,reason:"payload is empty"}:{ok:!0,reason:"exists"};case"--empty":{if(r==null)return{ok:!0,reason:"payload is null"};let e=d(r);return e===0?{ok:!0,reason:"payload is empty"}:{ok:!1,reason:`payload has ${e} item(s)`}}case"--count":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:`payload not countable (${typeof r})`}:{ok:t===e,reason:`count=${t}, want=${e}`}}case"--count-at-least":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t>=e,reason:`count=${t}, want>=${e}`}}case"--count-at-most":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t<=e,reason:`count=${t}, want<=${e}`}}case"--contains":{let e=n[0],t=JSON.stringify(r);return{ok:t.includes(e),reason:t.includes(e)?`contains "${e}"`:`missing "${e}"`}}case"--not-contains":{let e=n[0],t=JSON.stringify(r);return{ok:!t.includes(e),reason:t.includes(e)?`unexpected "${e}"`:`not contains "${e}"`}}case"--matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=e.test(t);return{ok:i,reason:i?`matches /${n[0]}/`:`no match for /${n[0]}/`}}case"--not-matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=!e.test(t);return{ok:i,reason:i?`not matches /${n[0]}/`:`unexpected /${n[0]}/`}}case"--equals":{let e=n[0],t=typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(r):JSON.stringify(r);return{ok:t===e,reason:`got=${JSON.stringify(t)}, want=${JSON.stringify(e)}`}}case"--has-path":{let e=y(r,n[0]);return{ok:e.found,reason:e.found?`path ${n[0]} present`:`path ${n[0]} missing`}}case"--path-equals":{let[e,t]=n,i=y(r,e);if(!i.found)return{ok:!1,reason:`path ${e} missing`};let o=typeof i.value=="string"||typeof i.value=="number"||typeof i.value=="boolean"?String(i.value):JSON.stringify(i.value);return{ok:o===t,reason:`${e}=${o}, want=${t}`}}case"--jq":{let e=n[0];try{let i=(await O(e,r)).trim();return{ok:i.length>0&&i!=="null"&&i!=="false"&&i!=='""',reason:`jq: ${i.slice(0,120)}`}}catch(t){throw new Error(`jq evaluation failed: ${t.message}`)}}default:return{ok:!1,reason:`unknown predicate ${u}`}}}function O(s,r){return new Promise((u,n)=>{let e=x("jq",[s],{stdio:["pipe","pipe","pipe"]}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",n),e.on("close",o=>{if(o!==0){n(new Error(i.trim()||`jq exited ${o}`));return}u(t)}),e.stdin.end(JSON.stringify(r))})}async function T(s){(s[0]==="--help"||s[0]==="-h"||s.length===0)&&(J(),process.exit(s.length===0?2:0));let r=j(s);"error"in r&&(process.stderr.write(` assert: ${r.error}
|
|
6
6
|
`),process.exit(2));let{verbArgs:u,predicates:n,withinMs:e,negate:t,quiet:i,allowTimeout:o}=r;N(u)||(process.stderr.write(` assert: unknown or non-read verb: ${u.join(" ")}
|
|
7
7
|
supported: ${Array.from(w).sort().join(", ")}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as t}from"./chunk-
|
|
4
|
+
import{a as t}from"./chunk-DKS75M2I.js";import{d as s}from"./chunk-UWFAWMPE.js";import"./chunk-7GVBNEQ3.js";import"./chunk-3WQISFAK.js";function i(){console.log(`
|
|
5
5
|
sootsim auth \u2014 inspect CLI auth
|
|
6
6
|
|
|
7
7
|
usage:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a,b,c,d}from"./chunk-
|
|
4
|
+
import{a,b,c,d}from"./chunk-SU5WQ4SQ.js";import"./chunk-3WQISFAK.js";export{d as BETA_ASK_HEADLINE,b as BETA_LABEL,c as BETA_TAGLINE,a as IS_BETA};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{m as d}from"./chunk-
|
|
4
|
+
import{m as d}from"./chunk-UBIGBHUM.js";import"./chunk-S6BEA6OC.js";import{h as l,j as m,l as p}from"./chunk-7GZ6XF2B.js";import"./chunk-6VF477QO.js";import"./chunk-K7LQB4IF.js";import"./chunk-7GVBNEQ3.js";import"./chunk-3WQISFAK.js";function f(){console.log(`
|
|
5
5
|
sootsim do scan \u2014 inject a barcode scan
|
|
6
6
|
|
|
7
7
|
usage:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{e as p}from"./chunk-
|
|
4
|
+
import{e as p}from"./chunk-RNW36VM5.js";import{a as c,b as l}from"./chunk-DKS75M2I.js";import{a}from"./chunk-UWFAWMPE.js";async function g(e,t){if(t)return t.replace(/\/$/,"");if(e.kind==="session"&&e.origin)return e.origin.replace(/\/$/,"");let i=a();return i?.origin?i.origin.replace(/\/$/,""):(await p()).replace(/\/$/,"")}async function m(e,t={}){let i=c();if(i||(process.stderr.write(`
|
|
5
5
|
sootsim ${e} needs auth before it can check recording access.
|
|
6
6
|
|
|
7
7
|
pick one:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
var t=Object.freeze({id:"ios",displayName:"iOS",isIOS:!0,isAndroid:!1,select:e=>e.ios}),r=Object.freeze({id:"android",displayName:"Android",isIOS:!1,isAndroid:!0,select:e=>e.android}),i=Object.freeze({ios:t,android:r});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
import{createInterface as i}from"readline";var c=()=>i({input:process.stdin,output:process.stdout});function s(o){return new Promise(n=>{let r=c();r.question(o,t=>{r.close(),n(t.trim())})})}async function u(o,n=!0){let r=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${o} ${r} ${n?"y":"n"} (non-interactive)`),n;let t=await s(` ${o} ${r} `);return t===""?n:t.toLowerCase().startsWith("y")}async function a(o,n){console.log(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{c as k,k as l,l as C,m as y}from"./chunk-
|
|
4
|
+
import{c as k,k as l,l as C,m as y}from"./chunk-ETDZQUGI.js";var m="sootsim:settings",a=["errorReporting","colorScheme","reduceMotion","boldText","fontSize","largerAccessibilitySizes","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","alwaysShowLiveWebViews","showFrame","showMenuBar","showRail","solidWindow","ambientGlow","agentProvider","onboardingComplete","betaConsentVersion","detailedTelemetry"];function R(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function g(e){let n={};for(let t of a){if(!(t in e))continue;let o=e[t],i=l[t];i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||(n[t]=o)}return n}function V(e){let n={};for(let t of a)n[t]=e[t];return n}function D(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(m);return e?g(JSON.parse(e)):{}}catch{return{}}}function j(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(m,JSON.stringify(e))}catch{}}function x(){let n=R()?.sharedConfig?.settings;return!n||typeof n!="object"?{}:g(n)}function M(e){let n=R();if(n?.writeSharedConfig)try{n.writeSharedConfig({settings:e})}catch{}}function K(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function T(){let e=K()?.settings;return!e||typeof e!="object"?{}:g(e)}function B(e){if(!K())return;let n={settings:e};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(n))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}catch{}}function P(){let e=D(),n=T(),t=x();return{...e,...n,...t}}function _(e,n={}){let t=V(e);for(let o of a)n[o]!==void 0&&(t[o]=n[o]);j(t),M(t),B(t)}function E(e){if(typeof window>"u")return()=>{};let n=r=>{if(!(r.key!==m||r.newValue==null))try{e(g(JSON.parse(r.newValue)))}catch{}};window.addEventListener("storage",n);let t=R(),o;t?.onSharedConfigChanged&&(o=t.onSharedConfigChanged(r=>{let d=r?.settings;!d||typeof d!="object"||e(g(d))}));let c=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(r=>{let d=r?.settings;!d||typeof d!="object"||e(g(d))});return()=>{window.removeEventListener("storage",n),o?.(),c?.()}}var I=C(),O=y(),p=P(),u=new Set,S={};for(let e of a)I[e]!==void 0&&(u.add(e),p[e]!==void 0&&(S[e]=p[e]),delete p[e]);var s={...O,...p},h=[],f=null;function w(){for(let e of h)e()}function b(){w(),_(s,S)}function v(e,n){let t=l[e];return t.validate&&!t.validate(n)||t.options&&!t.options.includes(n)||s[e]===n?!1:(s={...s,[e]:n},e==="deviceModel"&&(f=null),!0)}E(e=>{let n={...s},t=!1;for(let[o,i]of Object.entries(e)){let c=o;if(u.has(c)){S[c]=i;continue}n[c]!==i&&(n[c]=i,t=!0)}t&&(s=n,f=null,w())});var N={get(e){return s[e]},set(e,n){v(e,n)&&b()},setRuntime(e,n){u.has(e)||(u.add(e),a.includes(e)&&(S[e]=s[e])),v(e,n)&&w()},isRuntimeControlled(e){return u.has(e)},getAll(){return s},apply(e){let n=!1,t={...s};for(let[o,i]of Object.entries(e)){if(i===void 0)continue;let c=o,r=l[c];r&&(r.validate&&!r.validate(i)||r.options&&!r.options.includes(i)||t[c]!==i&&(t[c]=i,n=!0))}n&&(s=t,f=null,b())},applyRuntime(e){let n=!1;for(let t of Object.keys(e)){let o=e[t];o!==void 0&&(u.has(t)||(u.add(t),a.includes(t)&&(S[t]=s[t])),v(t,o)&&(n=!0))}n&&w()},reset(){s=y(),f=null,b()},subscribe(e){return h.push(e),()=>{h=h.filter(n=>n!==e)}},getDeviceSpec(){return f||(f=k(s.deviceModel)),f},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{N as a};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
var t="http://localhost:7668/";var r=4001,o="sootsim close";export{t as a,r as b,o as c};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as de}from"./chunk-
|
|
4
|
+
import{a as de}from"./chunk-JPPGM6RZ.js";import{b as Et,c as Pt,k as At}from"./chunk-TGYZYSDB.js";import{a as oe,b as D,c as A,d as Ie,e as ae,f as X,g as pe,h as ye,i as Ft,j as Ot,k as Te,l as Rt}from"./chunk-UBIGBHUM.js";import{A as bt,B as wt,C as $t,F as xt,H as St,J as ue,K as vt,Q as Le,a as ke,b as nt,c as rt,d as it,e as at,f as lt,g as ct,h as dt,i as ut,j as pt,k as Be,l as Ce,r as je,s as mt,t as ft,u as ge,v as gt,w as _e,x as qe,y as yt,z as ht}from"./chunk-S6BEA6OC.js";import{a as kt,f as _t,h as It,j as Tt,k as Mt,l as Nt,m as ce}from"./chunk-7GZ6XF2B.js";import{a as ot}from"./chunk-ZJZYGLJ2.js";import{a as Q}from"./chunk-FH7DQ2HB.js";import{c as st}from"./chunk-K7LQB4IF.js";import{c as Ae,e as De}from"./chunk-I7AWRAXM.js";function We(e){return`(async () => {
|
|
5
5
|
const bridge = globalThis.SootSim && globalThis.SootSim.bridges && globalThis.SootSim.bridges.hotRemount
|
|
6
6
|
if (!bridge || typeof bridge.reloadExternalApp !== 'function') return false
|
|
7
7
|
await bridge.reloadExternalApp({ resetStorage: ${e?"true":"false"} })
|
|
@@ -459,15 +459,15 @@ import{a as de}from"./chunk-WYRLRNIP.js";import{b as Et,c as Pt,k as At}from"./c
|
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
return { strategy: 'none' }
|
|
462
|
-
})()`});if(!c||!("node"in c))return c;let l=c.node,f=l.absolutePosition.x+l.layout.width/2,p=l.absolutePosition.y+l.layout.height/2,h=c.screen??null,$=!!h&&(f<0||p<0||f>h.width||p>h.height);return{...c,cx:f,cy:p,...$?{offscreen:!0,screen:h}:{},target:{id:l.id,testID:l.testID,text:c.strategy==="text"?t:l.text,type:l.type}}}})}async function zt(e,t={args:[]}){let s=await
|
|
462
|
+
})()`});if(!c||!("node"in c))return c;let l=c.node,f=l.absolutePosition.x+l.layout.width/2,p=l.absolutePosition.y+l.layout.height/2,h=c.screen??null,$=!!h&&(f<0||p<0||f>h.width||p>h.height);return{...c,cx:f,cy:p,...$?{offscreen:!0,screen:h}:{},target:{id:l.id,testID:l.testID,text:c.strategy==="text"?t:l.text,type:l.type}}}})}async function zt(e,t={args:[]}){let s=await rt(e);if(D(t.args)){A(s);return}console.log(` nodes: ${s.nodes}`)}function ze(e,t){let s=e.indexOf(t);return s>=0&&s+1<e.length?e[s+1]:null}async function Xt(e){let{bridge:t,args:s,positional:i}=e,c=s.includes("--verbose")||s.includes("-v"),l=D(s),f=c&&!l,p=s.includes("--watch")||s.includes("-w"),h=1e3,$=s.includes("--compact"),b=s.includes("--no-xy"),k=s.includes("--no-clipped"),N=s.includes("--include-occluded"),M=ze(s,"--testid-like"),j=ze(s,"--only"),O=ze(s,"--subtree"),d=i[1]&&!i[1].startsWith("-")?i[1]:void 0,q=d?/[*?]/.test(d):!1,R=!q&&!j?d:void 0,P=j??(q?d:void 0),J=async()=>{await pe(t,{verbose:f});let _=await lt(t,{describe:!0,verbose:c,filter:R||"",testIdLike:M||void 0,onlyGlob:P||void 0,subtreeRoot:O||void 0,compact:$,hideXy:b,includeOccluded:N}),F=_?.tree,H=_?.shell,K=_?.keyboard;if(l){A({shell:H,tree:F??"",keyboard:K});return}if(H&&typeof H=="object"){let C=[H.state?`state=${H.state}`:null,H.activeApp?`app=${H.activeApp}`:null,H.showSwitcher?"switcher":null,H.switcherPhase&&H.switcherPhase!=="idle"?`phase=${H.switcherPhase}`:null].filter(Boolean);C.length>0&&console.log(` shell: ${C.join(" ")}`)}if(typeof F=="string"&&F.startsWith("__SUBTREE_NOT_FOUND__:")){let C=F.slice(22);console.log(` subtree root not found: ${C}`),Q("subtree-root-not-found",C);return}if(!F){let C=_?.nodeCount??0;console.log(" no matching nodes found"),!(R||M||P||O)&&C<10&&Q("app-still-loading",C);return}let ee=F,te=0;if(k&&typeof ee=="string"){let C=ee.split(`
|
|
463
463
|
`),le=[];for(let Se of C){if(Se.includes("(clipped:")){te+=1;continue}le.push(Se)}ee=le.join(`
|
|
464
464
|
`)}console.log(ee),te>0&&console.log(` ${te} clipped row(s) hidden (omit --no-clipped to see)`);let ie=R||M||P||O;if((R||M||P)&&!p&&Q("describe-filter-context"),!ie&&!p&&F.split(`
|
|
465
465
|
`).length>=80&&Q("describe-use-filters"),K&&K.visible){let C=K.spec,le=[C?.keyboardType?`type=${C.keyboardType}`:null,C?.returnKeyType&&C.returnKeyType!=="default"?`return=${C.returnKeyType}`:null,K.mode!=="letters"?`mode=${K.mode}`:null,K.shifted?"shift":null,K.capsLock?"caps":null,C?.autoCapitalize&&C.autoCapitalize!=="sentences"?`autoCap=${C.autoCapitalize}`:null,K.accessoryBarId?`accessory=${K.accessoryBarId}`:null].filter(Boolean);console.log(`
|
|
466
466
|
keyboard: ${le.join(" ")||"visible"}`)}};if(p)for(console.log(` watching... (Ctrl+C to stop)
|
|
467
|
-
`);;)console.clear(),await J(),await oe(h);else await J()}var rs=["SOOTSIM_AGENT","TM_SESSION","CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","CURSOR_TRACE_ID","AIDER_MODEL"];function fe(){if(process.env.SOOTSIM_AGENT==="0")return!1;for(let e of rs){let t=process.env[e];if(t&&t.trim()&&t!=="0")return!0}return!1}async function Vt(e){let{bridge:t,args:s,effectiveArgs:i,positional:c,inspectUsage:l}=e,f=_=>{let F=i.indexOf(_);return F>=0&&F+1<i.length?i[F+1]:null},p=_=>i.includes(_),h=f("--testid")||f("--test-id"),$=f("--role"),b=f("--type"),k=f("--text"),N=p("--pressable"),M=p("--visible"),j=p("--interactive-targets")||p("--actions"),O=!h&&!$&&!b&&!k&&!N&&!M&&!j?c[1]:null,d=k??O,q=await
|
|
467
|
+
`);;)console.clear(),await J(),await oe(h);else await J()}var rs=["SOOTSIM_AGENT","TM_SESSION","CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","CURSOR_TRACE_ID","AIDER_MODEL"];function fe(){if(process.env.SOOTSIM_AGENT==="0")return!1;for(let e of rs){let t=process.env[e];if(t&&t.trim()&&t!=="0")return!0}return!1}async function Vt(e){let{bridge:t,args:s,effectiveArgs:i,positional:c,inspectUsage:l}=e,f=_=>{let F=i.indexOf(_);return F>=0&&F+1<i.length?i[F+1]:null},p=_=>i.includes(_),h=f("--testid")||f("--test-id"),$=f("--role"),b=f("--type"),k=f("--text"),N=p("--pressable"),M=p("--visible"),j=p("--interactive-targets")||p("--actions"),O=!h&&!$&&!b&&!k&&!N&&!M&&!j?c[1]:null,d=k??O,q=await pt(t,{testId:h,role:$,type:b,text:d,pressable:N,visible:M,interactive:j});q||(console.error(l("find","<text> | --text <t> | --testid <id> | --role <r> | --type <t> | --pressable | --visible | --interactive-targets")),process.exit(1));let{mode:R,result:P}=q,J=D(s),U=s.includes("--verbose")||s.includes("--dump");if(J)R==="interactive-targets"&&Array.isArray(P)?A(Be(P).map(_=>({..._,tap:Ce(_)}))):A(P??null);else if(Array.isArray(P))if(P.length===0){console.log(` no ${R} nodes found`);let _=await t.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount?.()) || 0)()"});typeof _=="number"&&_<10&&Q("app-still-loading",_)}else if(R==="interactive-targets"){let _=Be(P);console.log(` found ${_.length} interactive target${_.length===1?"":"s"} (sorted by score):`);for(let F of _.slice(0,20)){let H=F.absolutePosition?`@(${Math.round(F.absolutePosition.x)},${Math.round(F.absolutePosition.y)})`:"",K=F.layout?`${Math.round(F.layout.width)}x${Math.round(F.layout.height)}`:"?x?",ee=F.text?` "${F.text.slice(0,30)}"`:"",te=F.testID?` #${F.testID}`:"",ie=F.accessibilityLabel?` \u24D8"${String(F.accessibilityLabel).slice(0,24)}"`:"",xe=F.accessibilityRole?`[${F.accessibilityRole}]`:F.type,C=Ce(F);console.log(` ${xe}${ee}${ie}${te} ${K} ${H}`),console.log(` \u2192 ${C}`),U&&console.log(Xe(JSON.stringify(F,null,2)," "))}_.length>20&&console.log(` ... and ${_.length-20} more`)}else{console.log(` found ${P.length} node${P.length===1?"":"s"} (${R}):`);for(let _ of P.slice(0,20)){let F=_.absolutePosition?`@(${Math.round(_.absolutePosition.x)},${Math.round(_.absolutePosition.y)})`:"",H=_.layout?`${Math.round(_.layout.width)}x${Math.round(_.layout.height)}`:"?x?",K=_.text?` "${_.text.slice(0,30)}"`:"",ee=_.testID?` #${_.testID}`:"",te=_.pressable?" (tap)":"",ie=_.accessibilityRole?`[${_.accessibilityRole}]`:_.type;console.log(` ${ie}${K}${ee} ${H} ${F}${te}`),U&&console.log(Xe(JSON.stringify(_,null,2)," "))}P.length>20&&console.log(` ... and ${P.length-20} more`)}else if(P==null)console.log(` not found: ${d||h||$||b||""||R}`),h&&Q("wait-selector-for-missing-testid",h);else{let _=P;if(_.type&&_.absolutePosition){let F=`@(${Math.round(_.absolutePosition.x)},${Math.round(_.absolutePosition.y)})`,H=_.layout?`${Math.round(_.layout.width)}x${Math.round(_.layout.height)}`:"?x?",K=_.text?` "${_.text.slice(0,40)}"`:"",ee=_.testID?` #${_.testID}`:"",te=_.pressable?" (tap)":"",ie=_.accessibilityRole?`[${_.accessibilityRole}]`:_.type;console.log(` ${ie}${K}${ee} ${H} ${F}${te}`),U&&console.log(Xe(JSON.stringify(_,null,2)," "))}else console.log(JSON.stringify(P,null,2))}}function Xe(e,t){return e.split(`
|
|
468
468
|
`).map(s=>t+s).join(`
|
|
469
|
-
`)}async function Qt(e){let{bridge:t,args:s}=e,i=D(s);await pe(t,{verbose:!i});let c=s.includes("--styling"),l=s.indexOf("--filter"),f=l>=0?s[l+1]:void 0,p=await
|
|
470
|
-
`),console.log(
|
|
469
|
+
`)}async function Qt(e){let{bridge:t,args:s}=e,i=D(s);await pe(t,{verbose:!i});let c=s.includes("--styling"),l=s.indexOf("--filter"),f=l>=0?s[l+1]:void 0,p=await ct(t,{styling:c,filter:f});if(i){A({count:p.length,elements:p});return}console.log(` layout (${p.length} element${p.length===1?"":"s"}):
|
|
470
|
+
`),console.log(dt(p,{styling:c}))}async function Zt(e,t={}){let s=await St(e);if("error"in s&&(console.error(s.error),process.exit(1)),t.json){console.log(JSON.stringify(s,null,2));return}let{visible:i,spec:c,mode:l,shifted:f,capsLock:p,accessoryBarId:h}=s,$=[];$.push(`keyboard: ${i?"visible":"hidden"}`),c?($.push(` type: ${c.keyboardType}`),$.push(` returnKey: ${c.returnKeyType}`),$.push(` autoCap: ${c.autoCapitalize}`),$.push(` autoCorrect: ${c.autoCorrect?"on":"off"}`),$.push(` appearance: ${c.keyboardAppearance}`),c.secureTextEntry&&$.push(" secureTextEntry: true"),c.enablesReturnKeyAutomatically&&$.push(` return: ${c.currentTextIsEmpty?"disabled (empty)":"enabled"}`)):$.push(" spec: <none> (shown via dev-tools with no TextInput)"),$.push(` mode: ${l}${f?" (shifted)":""}${p?" (caps)":""}`),h&&$.push(` accessoryBar: ${h}`),console.log($.join(`
|
|
471
471
|
`))}async function eo(e){let t=await e.bridge.listSims(),s=e.args.includes("--all"),i=e.args.find((p,h)=>e.args[h-1]==="--bundle"),c=e.args.find((p,h)=>e.args[h-1]==="--app-port"),l=e.args.includes("--primary"),f=t.filter(p=>!(l&&!p.isPrimary||i&&!(p.url??"").includes(i)||c&&!(p.url??"").includes(`/rn/${c}`)||!s&&!i&&!c&&!l&&!(p.url&&(p.url.includes("bundle=")||p.url.includes("/index.bundle")))&&p.id!==e.simId));if(D(e.args)){A(f.map(p=>({...p,active:p.id===e.simId})));return}At(f,e.simId),f.length<t.length&&!D(e.args)&&console.log(` (${t.length-f.length} more hidden \u2014 pass --all to show)`)}function re(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`}function is(e,t){return t<=0?"?":`${(e/t*100).toFixed(0)}%`}function as(e){let t={},s=(i,c)=>{c&&(c.nodesRegistered!=null&&(t[`${i}.nodes`]=c.nodesRegistered),c.nodesDetached!=null&&(t[`${i}.detached`]=c.nodesDetached),c.objects&&(t[`${i}.paragraphs`]=c.objects.paragraphs,t[`${i}.yogaNodes`]=c.objects.yogaNodes,t[`${i}.pictures`]=c.objects.pictures,t[`${i}.rasterImages`]=c.objects.rasterImages),c.imageLoader&&(t[`${i}.imageCacheEntries`]=c.imageLoader.cacheEntries,t[`${i}.imagePixelBytes`]=c.imageLoader.cachePixelBytes),c.workerHeap&&(t[`${i}.heapBytes`]=c.workerHeap.usedJSHeapSize),c.wasmHeapBytes!=null&&(t[`${i}.wasmHeapBytes`]=c.wasmHeapBytes))};return s("tenant",e.tenant),s("shell",e.shell),s("compositor",e.compositor),e.hostHeap&&(t["host.heapBytes"]=e.hostHeap.usedJSHeapSize),t}function to(e,t){return e.endsWith("Bytes")?re(t):String(t)}function Ve(e,t){if(!t){console.log(` ${e}: not available`);return}let s=t.objects;if(console.log(` ${e}`),t.nodesRegistered!=null&&console.log(` nodes registered: ${t.nodesRegistered}`),t.nodesDetached!=null){let i=Object.entries(t.detachedTypes??{}).map(([c,l])=>`${c}:${l}`).join(" ");console.log(` nodes detached: ${t.nodesDetached}${i?` (${i})`:""}`)}if(s&&(console.log(` paragraphs: ${s.paragraphs}`),console.log(` yoga nodes: ${s.yogaNodes}`),console.log(` pictures: ${s.pictures}`),console.log(` raster images: ${s.rasterImages}`)),t.activeNativeAnimations!=null&&console.log(` native anims: ${t.activeNativeAnimations}`),t.imageLoader){let i=t.imageLoader;console.log(` image cache: ${i.cacheEntries}/${i.cacheMaxEntries} entries, ${re(i.cachePixelBytes)}/${re(i.cachePixelBudget)} (${is(i.cachePixelBytes,i.cachePixelBudget)})`)}t.workerHeap&&console.log(` js heap: ${re(t.workerHeap.usedJSHeapSize)} used / ${re(t.workerHeap.totalJSHeapSize)} total`),t.wasmHeapBytes!=null&&console.log(` canvaskit wasm: ${re(t.wasmHeapBytes)}`)}function ls(e){console.log(" memory:"),Ve("tenant worker",e.tenant),Ve("shell worker",e.shell),Ve("compositor worker",e.compositor),e.hostHeap?(console.log(" host"),console.log(` js heap: ${re(e.hostHeap.usedJSHeapSize)} used / ${re(e.hostHeap.totalJSHeapSize)} total`)):console.log(" host js heap: not available (chrome only)")}function cs(e,t,s){let i=e.indexOf(t);if(i===-1)return s;let c=Number(e[i+1]);return Number.isFinite(c)&&c>0?c:s}async function oo(e,t={args:[]}){let s=D(t.args),i=t.args.indexOf("--watch");if(i===-1){let O=await Le(e);if(s){A(O);return}ls(O);return}let c=Number(t.args[i+1]),l=Number.isFinite(c)&&c>0?c:60,f=cs(t.args,"--interval",5),p=[],h=Date.now(),$=null;for(s||console.log(` sampling every ${f}s for ${l}s \u2014 deltas per tick:`);;){let O=await Le(e),d=(Date.now()-h)/1e3,q=as(O);if(p.push({tSec:d,counters:q}),!s){let R=[];for(let[P,J]of Object.entries(q)){let U=$&&P in $?J-$[P]:null;if(U===null||U===0)continue;let _=U>0?"+":"-",F=P.endsWith("Bytes")?`${_}${re(Math.abs(U))}`:`${_}${Math.abs(U)}`;R.push(`${P} ${to(P,J)} (${F})`)}console.log(` t+${d.toFixed(0)}s ${R.length?R.join(" "):$?"no change":Object.entries(q).map(([P,J])=>`${P} ${to(P,J)}`).join(" ")}`)}if($=q,d>=l)break;await new Promise(R=>setTimeout(R,f*1e3))}let b=p[0],k=p[p.length-1],N=Math.max(k.tSec-b.tSec,.001),M={};for(let O of Object.keys(k.counters))O in b.counters&&(M[O]=(k.counters[O]-b.counters[O])/N);if(s){A({samples:p,perSecond:M,elapsedSec:N});return}console.log(`
|
|
472
472
|
slope over ${N.toFixed(0)}s:`);let j=Object.entries(M).filter(([,O])=>O!==0).sort((O,d)=>Math.abs(d[1])-Math.abs(O[1]));if(j.length===0){console.log(" all counters flat");return}for(let[O,d]of j){let q=O.endsWith("Bytes")?`${re(Math.abs(d))}/s${d<0?" (shrinking)":""}`:`${d>0?"+":""}${d.toFixed(2)}/s`;console.log(` ${O.padEnd(28)}${q}`)}}var Z="<redacted secure text>";function we(e){let t=e?.layout?.spec??e?.spec??null;return!!t?.secureTextEntry&&t.keyboardType!=="visible-password"}function Qe(e,t){return we(t)?Z:e}function Ze(e){if(!e||!we(e))return e;let t=e.focusedInput;return!t||typeof t!="object"?e:{...e,focusedInput:{...t,secureTextEntry:!0,text:typeof t.text=="string"?Z:t.text}}}function $e(e){let t=e.indexOf("--testid");if(t>=0&&e[t+1])return{mode:"testid",value:e[t+1]};let s=e.indexOf("--test-id");if(s>=0&&e[s+1])return{mode:"testid",value:e[s+1]};let i=e.indexOf("--text");return i>=0&&e[i+1]?{mode:"text",value:e[i+1]}:null}async function Oe(e,t){let s=JSON.stringify(t.value),i=t.mode==="testid"?`(await t.findByTestId(${s})) || (await t.findById(${s}))`:`await t.findByText(${s})`;return await e.send({type:"evaluate",code:`(async () => {
|
|
473
473
|
const t = window.__sootsimTest
|
|
@@ -494,12 +494,12 @@ import{a as de}from"./chunk-WYRLRNIP.js";import{b as Et,c as Pt,k as At}from"./c
|
|
|
494
494
|
text: ${JSON.stringify(t.mode==="text")} ? ${s} : (n.text ?? n.accessibilityLabel ?? null),
|
|
495
495
|
type: n.type ?? null,
|
|
496
496
|
}
|
|
497
|
-
})()`})??null}async function so(e,t={}){let{nav:s,route:i,keyboard:c,shell:l}=await
|
|
498
|
-
`))}async function no(e){let{bridge:t,args:s,positional:i}=e,c=i[1]?Number(i[1])*1e3:3e3,l=s.includes("--strict"),{elapsed:f,settled:p}=await se({bridge:t,maxMs:c,strict:l});console.log(p?` settled in ${f}ms`:` timed out after ${f}ms (may still be animating)`)}async function ro(e){let t=e.positional[1]?Number(e.positional[1]):.5;(!Number.isFinite(t)||t<0)&&(console.error(e.inspectUsage("sleep","[seconds]")),process.exit(1)),await oe(t*1e3),console.log(` slept ${t}s`)}async function io(e){let{bridge:t,args:s,positional:i}=e,c=s.includes("--boxes"),l=i[1]?Number(i[1]):c?50:5,{tree:f}=await
|
|
497
|
+
})()`})??null}async function so(e,t={}){let{nav:s,route:i,keyboard:c,shell:l}=await vt(e);if(t.json){console.log(JSON.stringify({shell:l??null,nav:s,route:i,keyboard:c},null,2));return}let f=[];if(l){let p=l.activeApp??l.state??"<none>",h=l.showSwitcher?" (app switcher open)":"",$=typeof l.launchProgress=="number"&&l.launchProgress<.98?` launching (${Math.round(l.launchProgress*100)}%)`:"";f.push(`shell: ${p}${h}${$}`)}else f.push("shell: <unavailable>");if(s){let p=s.transitionPhase!=="idle"?` (${s.transitionPhase}, ${s.activeTransitionCount} active)`:"";if(f.push(`nav: phase=${s.transitionPhase}${p}`),s.screens.length===0)f.push(" <no registered screens \u2014 app may not use react-native-screens>");else for(let h of s.screens){let $=h.isActive?"\u25B6":" ",b=h.routeName?` ${h.routeName}`:"",k=h.headerHeight>0?` header=${h.headerHeight}`:"",N=h.largeTitleState&&h.largeTitleState!=="expanded"?` large-title=${h.largeTitleState}`:"";f.push(` ${$} #${h.id}${b}${k}${N}`)}}else f.push("nav: <runtime not available>");if(f.push(`route: ${i?.currentPath??"<unavailable>"}`),i?.coveringPath&&f.push(`covered: a presented screen (${i.coveringPath}) is above this route`),c&&c.visible){let p=c.spec?.keyboardType??"default",h=c.spec?.returnKeyType??"default";f.push(`keyboard: visible (${p}, return=${h}, mode=${c.mode??"?"})`)}else f.push("keyboard: hidden");console.log(f.join(`
|
|
498
|
+
`))}async function no(e){let{bridge:t,args:s,positional:i}=e,c=i[1]?Number(i[1])*1e3:3e3,l=s.includes("--strict"),{elapsed:f,settled:p}=await se({bridge:t,maxMs:c,strict:l});console.log(p?` settled in ${f}ms`:` timed out after ${f}ms (may still be animating)`)}async function ro(e){let t=e.positional[1]?Number(e.positional[1]):.5;(!Number.isFinite(t)||t<0)&&(console.error(e.inspectUsage("sleep","[seconds]")),process.exit(1)),await oe(t*1e3),console.log(` slept ${t}s`)}async function io(e){let{bridge:t,args:s,positional:i}=e,c=s.includes("--boxes"),l=i[1]?Number(i[1]):c?50:5,{tree:f}=await it(t,l,c?{format:"boxes"}:void 0);if(D(s)){A({depth:l,tree:f??null});return}console.log(typeof f=="string"?f:JSON.stringify(f,null,2))}async function ao(e,t={args:[]}){let s=await at(e);if(D(t.args)){A(s);return}console.log(s.url)}async function lo(e){let{wsPort:t,commandTimeoutMs:s,simId:i,simIdSource:c,positional:l}=e,f=l[1]?Number(l[1]):30,p=Math.max(1e3,(Number.isFinite(f)?f:30)*1e3),h=Math.max(1,Math.ceil(p/500));console.log(" waiting for sim reconnect...");let $=await Ft(t,s,i,{attempts:h,simIdSource:c});$||(console.error(" timed out waiting for sim reconnect"),process.exit(1)),$.bridge.close(),Fe({source:"inspect wait",step:{wait:p},summary:`wait ${Math.round(p/1e3)}s`}),console.log(` ready: ${$.count} nodes`)}var co=new Set(["app-launch","toast","keyboard","screen","flow-step","route","alert","actionsheet","picker","notification","fetch","console","shell","scroll","gesture","text-input","react-commit","animation","reanimated"]);function Re(e,t){let s=e.indexOf(t);if(s>=0&&s+1<e.length)return e[s+1]}function ds(e,t){if(!t.filter&&!t.equals)return!0;let s=e.data,i=[];if(s&&typeof s=="object")for(let l of["url","displayUrl","message","name","activeName","path","pathname","title","phase","event","type","kind"]){let f=s[l];typeof f=="string"&&f.length>0&&i.push(f)}let c=i.join(" ");return t.equals?i.some(l=>l===t.equals):t.filter?c.toLowerCase().includes(t.filter.toLowerCase()):!0}async function uo(e){let{bridge:t,args:s,positional:i,inspectUsage:c}=e,l=i[1];l||(console.error(c("wait event","<kind> [--max-ms 5000] [--filter <substring>] [--equals <exact>] [--since now|cursor]")),process.exit(1)),co.has(l)||console.error(` warning: '${l}' is not a known timeline kind \u2014 waiting anyway. known: ${[...co].sort().join(", ")}`);let f=Re(s,"--max-ms"),p=f&&Number.isFinite(Number(f))?Math.max(100,Number(f)):5e3,h=Re(s,"--filter"),$=Re(s,"--equals"),b=Re(s,"--since")??"now",k=s.includes("--json"),N=Date.now(),M=N+p,j=200,O=N;for(;Date.now()<M;){let q={kinds:[l],since:b==="cursor"?void 0:O,limit:50},R=await t.send({type:"evaluate",code:`(async () => {
|
|
499
499
|
const t = window.SootSim?.bridges?.timeline
|
|
500
500
|
if (!t) return { ok: false, error: 'timeline bridge missing' }
|
|
501
501
|
return { ok: true, result: await t.recent(${JSON.stringify(q)}) }
|
|
502
|
-
})()`});(!R||!R.ok)&&(console.error(` could not query timeline: ${R&&"error"in R?R.error:"unknown"}`),process.exit(1));let P=R.result.events??[];for(let J of P)if(ds(J,{filter:h,equals:$})){let U=Date.now()-N;console.log(k?JSON.stringify({found:!0,elapsedMs:U,event:J}):` ${l} event after ${U}ms${h?` (filter: ${h})`:""}${$?` (equals: ${$})`:""}`);return}R.result.watermark&&R.result.watermark>O&&(O=R.result.watermark),await new Promise(J=>setTimeout(J,j))}let d=Date.now()-N;k?console.log(JSON.stringify({found:!1,elapsedMs:d,kind:l,filter:h,equals:$})):console.error(` \u26A0 wait event ${l} timed out after ${d}ms${h?` (filter: ${h})`:""}${$?` (equals: ${$})`:""}`),process.exit(1)}async function po(e){let{bridge:t,args:s}=e,i=s.includes("--strict"),c=ke(s,3e3),{elapsed:l,settled:f}=await se({bridge:t,maxMs:c,strict:i});f?console.log(` idle in ${l}ms`):(console.error(` \u26A0 wait idle timed out after ${l}ms (may still be animating)`),process.exit(1))}async function mo(e){let{bridge:t,args:s}=e,i=ke(s,2e4),{ready:c,elapsedMs:l,nodes:f,targets:p,liveFrameActive:h,liveFrameChannels:$,flag:b,loadingText:k,externalReady:N,externalError:M,suppressedEntryError:j,errors:O,bridgeError:d}=await
|
|
502
|
+
})()`});(!R||!R.ok)&&(console.error(` could not query timeline: ${R&&"error"in R?R.error:"unknown"}`),process.exit(1));let P=R.result.events??[];for(let J of P)if(ds(J,{filter:h,equals:$})){let U=Date.now()-N;console.log(k?JSON.stringify({found:!0,elapsedMs:U,event:J}):` ${l} event after ${U}ms${h?` (filter: ${h})`:""}${$?` (equals: ${$})`:""}`);return}R.result.watermark&&R.result.watermark>O&&(O=R.result.watermark),await new Promise(J=>setTimeout(J,j))}let d=Date.now()-N;k?console.log(JSON.stringify({found:!1,elapsedMs:d,kind:l,filter:h,equals:$})):console.error(` \u26A0 wait event ${l} timed out after ${d}ms${h?` (filter: ${h})`:""}${$?` (equals: ${$})`:""}`),process.exit(1)}async function po(e){let{bridge:t,args:s}=e,i=s.includes("--strict"),c=ke(s,3e3),{elapsed:l,settled:f}=await se({bridge:t,maxMs:c,strict:i});f?console.log(` idle in ${l}ms`):(console.error(` \u26A0 wait idle timed out after ${l}ms (may still be animating)`),process.exit(1))}async function mo(e){let{bridge:t,args:s}=e,i=ke(s,2e4),{ready:c,elapsedMs:l,nodes:f,targets:p,liveFrameActive:h,liveFrameChannels:$,flag:b,loadingText:k,externalReady:N,externalError:M,suppressedEntryError:j,errors:O,bridgeError:d}=await mt(t,i,{onProgress(R){console.error(` still waiting after ${R.elapsedMs}ms \u2014 ${je(R)} (nodes: ${R.nodes}, targets: ${R.targets}, live surfaces: ${R.liveFrameActive?R.liveFrameChannels:0}, errors: ${R.errors})`)}});if(c){let R=i-l,P=Math.max(100,Math.min(1e4,R)),J=await se({bridge:t,maxMs:P,pollMs:32,stablePolls:2});J.settled||(console.error(` \u26A0 wait ready timed out after ${l+J.elapsed}ms \u2014 app mounted but did not settle (nodes: ${f}, targets: ${p})`),process.exit(1)),console.log(` ready in ${l+J.elapsed}ms: ${f} nodes, ${p} targets${h?`, ${$} live surfaces`:""}`);return}let q=je({externalError:M,loadingText:k,externalReady:N,flag:b,targets:p,suppressedEntryError:j,bridgeError:d});console.error(` \u26A0 wait ready timed out after ${l}ms \u2014 ${q} (nodes: ${f}, targets: ${p}, live surfaces: ${h?$:0}, errors: ${O})`),process.exit(1)}async function fo(e){let{bridge:t,args:s,positional:i,inspectUsage:c}=e,l=i[1];l||(console.error(c("wait selector","<testid> [--max-ms 5000] [--gone]")),process.exit(1));let f=s.indexOf("--max-ms"),p=f>=0&&s[f+1]?Math.max(100,Number(s[f+1])):5e3,h=s.includes("--gone"),{found:$,node:b,elapsed:k}=await ft(t,l,p,{gone:h});if(h){$?console.log(` #${l} gone after ${k}ms`):(console.error(` \u26A0 wait selector #${l} --gone timed out after ${k??p}ms (still present)`),process.exit(1));return}if($&&b){let N=b.absolutePosition?`@(${Math.round(b.absolutePosition.x)},${Math.round(b.absolutePosition.y)})`:"",M=b.layout?`${Math.round(b.layout.width)}x${Math.round(b.layout.height)}`:"?x?";console.log(` found #${l} in ${k}ms ${M} ${N}`)}else console.error(` \u26A0 wait selector #${l} timed out after ${k??p}ms`),process.exit(1)}function _o(e){return e==null?"\u2014":e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}K`:`${(e/1024/1024).toFixed(1)}M`}function Io(e){return e==null?" \u2026":e<1e3?`${e}ms`.padStart(5):`${(e/1e3).toFixed(2)}s`.padStart(5)}function go(){process.stderr.write(` the sim is not responding. recover it with:
|
|
503
503
|
sootsim close --sim <id> # force-close the wedged sim
|
|
504
504
|
sootsim list # confirm it's gone
|
|
505
505
|
`)}async function ps(e){try{return await e.send({type:"evaluate",code:"1"},{timeoutMs:3e3}),!0}catch{return!1}}async function ms(e,t){try{let s=await e.send({type:"evaluate",code:`(async () => {
|
|
@@ -583,14 +583,14 @@ import{a as de}from"./chunk-WYRLRNIP.js";import{b as Et,c as Pt,k as At}from"./c
|
|
|
583
583
|
})()`}):e.send({type:"evaluate",code:`(async () => {
|
|
584
584
|
window.dispatchEvent(new CustomEvent('sootsim:shake'))
|
|
585
585
|
return { ok: true, action: 'shake' }
|
|
586
|
-
})()`})}function vs(e){let t={Enter:"return",NumpadEnter:"return",Backspace:"delete",Delete:"delete",Space:"space",ShiftLeft:"shift",ShiftRight:"shift"};if(t[e])return t[e];let s=e.match(/^Digit([0-9])$/);if(s)return s[1];let i=e.match(/^Key([A-Z])$/);return i?i[1].toLowerCase():null}function ks(e){if(typeof e!="string")return null;let t=e.replace(/\s+/g," ").trim();return t?t.slice(0,80):null}function To(...e){for(let t of e){if(typeof t!="string")continue;let s=t.trim();if(s)return s}return null}function _s(e){let t=e.indexOf("--node-id");if(t<0)return null;let s=e[t+1];if(!s)return null;let i=Number(s);return Number.isInteger(i)&&i>0?i:null}async function W(e,t,s){let i=Fe({source:e,step:t,summary:s});i.active&&(i.replaced?console.error(` draft: replaced unkept action "${i.replaced.summary}" \u2014 \`maestro keep\` commits one action at a time`):console.error(" draft: action pending \u2014 `sootsim maestro keep` to commit"))}function ko(e,t,s){if(!s||s.hit===!1)return null;let i=To(s.responderTestID,s.testID);if(i)return{step:{tapOn:{id:i}},summary:`tap #${i}`};let c=ks(s.text);return c?{step:{tapOn:c},summary:`tap "${c}"`}:{step:{tapAtCoords:{x:e,y:t}},summary:`tap @${Math.round(e)},${Math.round(t)}`}}function et(e,t,s){let i=To(t?.testID,t?.id);return i?{step:{tapOn:{id:i}},summary:`tap #${i}`}:s==="id"?{step:{tapOn:{id:e}},summary:`tap #${e}`}:{step:{tapOn:e},summary:`tap "${e}"`}}async function Rr(e,t){let s=e[0]==="get"||e[0]==="do"||e[0]==="debug"||e[0]==="wait"?e[0]:null,i=s?e.slice(1):e,c=It(i,{port:t.port,commandTimeoutMs:t.timeoutMs,stripBooleanFlags:["--verbose","-v","--help","-h","--clear-state","--json","--all","--watch","-w","--strict","--no-wait","--dump","--failed","--slow","--tail","-f","--interactive-targets","--actions","--internal","--compact","--no-xy","--no-clipped","--include-occluded"],stripValueFlags:["--output","--nth","--index","--testid","--test-id","--text","--node-id","--max-ms","--filter","--limit","--level","--threshold","--equals","--since","--testid-like","--only","--subtree"]}),l=c.positional,f=l[0],p=s==="get"||s==="do"||s==="debug"||s==="wait"?s:"inspect",h=typeof i[0]=="string"&&ot.has(i[0]),$=h?i[0]:null,b=x=>t.internalPerfCommand&&x==="perf"?`sootsim perf ${t.internalPerfCommand}`:h&&x===i[0]?`sootsim ${x}`:`sootsim ${p} ${x}`,k=(x,o)=>` usage: ${b(x)}${o?` ${o}`:""}`;if(!f||e.includes("--help")||e.includes("-h")){let x={bridgePort:7668,defaultShellUrl:
|
|
586
|
+
})()`})}function vs(e){let t={Enter:"return",NumpadEnter:"return",Backspace:"delete",Delete:"delete",Space:"space",ShiftLeft:"shift",ShiftRight:"shift"};if(t[e])return t[e];let s=e.match(/^Digit([0-9])$/);if(s)return s[1];let i=e.match(/^Key([A-Z])$/);return i?i[1].toLowerCase():null}function ks(e){if(typeof e!="string")return null;let t=e.replace(/\s+/g," ").trim();return t?t.slice(0,80):null}function To(...e){for(let t of e){if(typeof t!="string")continue;let s=t.trim();if(s)return s}return null}function _s(e){let t=e.indexOf("--node-id");if(t<0)return null;let s=e[t+1];if(!s)return null;let i=Number(s);return Number.isInteger(i)&&i>0?i:null}async function W(e,t,s){let i=Fe({source:e,step:t,summary:s});i.active&&(i.replaced?console.error(` draft: replaced unkept action "${i.replaced.summary}" \u2014 \`maestro keep\` commits one action at a time`):console.error(" draft: action pending \u2014 `sootsim maestro keep` to commit"))}function ko(e,t,s){if(!s||s.hit===!1)return null;let i=To(s.responderTestID,s.testID);if(i)return{step:{tapOn:{id:i}},summary:`tap #${i}`};let c=ks(s.text);return c?{step:{tapOn:c},summary:`tap "${c}"`}:{step:{tapAtCoords:{x:e,y:t}},summary:`tap @${Math.round(e)},${Math.round(t)}`}}function et(e,t,s){let i=To(t?.testID,t?.id);return i?{step:{tapOn:{id:i}},summary:`tap #${i}`}:s==="id"?{step:{tapOn:{id:e}},summary:`tap #${e}`}:{step:{tapOn:e},summary:`tap "${e}"`}}async function Rr(e,t){let s=e[0]==="get"||e[0]==="do"||e[0]==="debug"||e[0]==="wait"?e[0]:null,i=s?e.slice(1):e,c=It(i,{port:t.port,commandTimeoutMs:t.timeoutMs,stripBooleanFlags:["--verbose","-v","--help","-h","--clear-state","--json","--all","--watch","-w","--strict","--no-wait","--dump","--failed","--slow","--tail","-f","--interactive-targets","--actions","--internal","--compact","--no-xy","--no-clipped","--include-occluded"],stripValueFlags:["--output","--nth","--index","--testid","--test-id","--text","--node-id","--max-ms","--filter","--limit","--level","--threshold","--equals","--since","--testid-like","--only","--subtree"]}),l=c.positional,f=l[0],p=s==="get"||s==="do"||s==="debug"||s==="wait"?s:"inspect",h=typeof i[0]=="string"&&ot.has(i[0]),$=h?i[0]:null,b=x=>t.internalPerfCommand&&x==="perf"?`sootsim perf ${t.internalPerfCommand}`:h&&x===i[0]?`sootsim ${x}`:`sootsim ${p} ${x}`,k=(x,o)=>` usage: ${b(x)}${o?` ${o}`:""}`;if(!f||e.includes("--help")||e.includes("-h")){let x={bridgePort:7668,defaultShellUrl:kt};if(p==="do"||p==="get"||p==="debug"||p==="wait"){let r=Ae(p,x);r&&(console.log(`${r}
|
|
587
587
|
`),process.exit(0))}if($==="shell"){let r=De("shell",x);r&&(console.log(`${r}
|
|
588
588
|
`),process.exit(0))}let o=De("inspect",x),n=["do","get","debug","wait"].map(r=>Ae(r,x)).filter(r=>r!=null).join(`
|
|
589
589
|
|
|
590
590
|
`);console.log(`${o??""}
|
|
591
591
|
|
|
592
592
|
${n}
|
|
593
|
-
`),process.exit(0)}let N=c.wsPort,M=c.simId,j=c.simIdSource,O=c.commandTimeoutMs;if(p==="get"&&f==="diagnosis"){let x=i.indexOf("diagnosis"),o=x>=0?[...i.slice(0,x),...i.slice(x+1)]:i,{runDiagnose:n}=await import("./diagnose-
|
|
593
|
+
`),process.exit(0)}let N=c.wsPort,M=c.simId,j=c.simIdSource,O=c.commandTimeoutMs;if(p==="get"&&f==="diagnosis"){let x=i.indexOf("diagnosis"),o=x>=0?[...i.slice(0,x),...i.slice(x+1)]:i,{runDiagnose:n}=await import("./diagnose-6D6WNAGL.js"),r=await n(["recent",...o],t);process.exitCode=r;return}if(p==="do"&&f==="scan"){let{runCamera:x}=await import("./camera-Y5MZ5V4L.js");await x(i,{port:t.port});return}if(f==="list"&&i.some(x=>x==="--drivers"||x==="-D")){let{buildDriverListRows:x}=await import("./drivers-CKLBQDXG.js"),o=x();console.log(` available drivers (${o.length}):
|
|
594
594
|
`);let n=Math.max(...o.map(a=>a.id.length),6),r=Math.max(...o.map(a=>a.kind.length),4);for(let a of o){let u=a.available?"\u2713":"\u2717",m=a.id.padEnd(n),g=a.kind.padEnd(r);console.log(` ${u} ${m} ${g} ${a.description}`),a.available&&a.detail?console.log(` ${a.detail}`):!a.available&&a.reason&&console.log(` unavailable: ${a.reason}`)}return}let d=Tt(c),q=M||"default",R=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","storage-clear","list","wait","sleep"]),P=200;function J(x){let o=x.replace(/\s+/g," ").trim();if(!o)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(o)){let r=/<title[^>]*>([^<]+)<\/title>/i.exec(x)?.[1]?.trim(),a=/<body[^>]*>([\s\S]*?)<\//i.exec(x)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),u=r||a||"html error page";return`<html ${x.length}B> "${u}" (body elided \u2014 add --json for the full payload)`}return o.length<=P?o:`${o.slice(0,P)}\u2026 (+${o.length-P} more bytes)`}function U(x){let o=x.displayUrl||x.url;return x.status!=null?`${x.method} ${o} -> ${x.status}${x.statusText?` ${x.statusText}`:""}`:x.error?`${x.method} ${o} -> ${x.error}`:`${x.method} ${o}`}async function _(x){let o=fe()?400:200;try{let{settled:n,elapsed:r}=await se({bridge:x,maxMs:o,pollMs:32,stablePolls:2});n||process.stderr.write(` \u26A0 auto-wait timed out after ${r??o}ms \u2014 next command may see mid-animation state. use \`sootsim do settle\` for a longer wait.
|
|
595
595
|
`)}catch{}}function F(x,o){if(o.result?.reason==="offscreen"){let{x:n,y:r,screen:a}=o.result;console.error(` tap failed: ${x} resolved to (${Math.round(n)},${Math.round(r)}), outside the ${a?.width}x${a?.height} screen`),console.error(" the node exists but is scrolled out of view \u2014 scroll it on-screen first (sootsim do scroll / swipe), then tap.");return}console.error(` tap failed: ${x} stayed visible but did not receive a hittable press after ${o.attempts} attempt${o.attempts===1?"":"s"}`),o.result&&console.error(` last result: ${JSON.stringify(o.result)}`)}async function H(){try{return await d.send({type:"evaluate",code:`(() => ({
|
|
596
596
|
console: ${_e},
|
|
@@ -602,7 +602,7 @@ ${n}
|
|
|
602
602
|
note: ${o.label} is open${n} \u2014 taps/drags hit it, not the app`)}}async function te(x={}){let o=x.counts!==void 0?x.counts:await d.send({type:"evaluate",code:_e});if(!o||typeof o!="object")return;let n=o,r=Math.max(0,Number(n.errors)||0),a=Math.max(0,Number(n.warnings)||0);if(r===0&&a===0||!x.includeTail&&!Ye("console",q,`${r}:${a}`))return;let u=[];if(r>0&&u.push(`${r} console error${r===1?"":"s"}`),a>0&&u.push(`${a} console warning${a===1?"":"s"}`),console.error(`
|
|
603
603
|
console: ${u.join(", ")}`),console.error(` inspect: ${b("errors")} 5`),a>0&&console.error(` inspect: ${b("warnings")} 5`),!x.includeTail||r===0)return;let m=await ge(d,5);if(!(!Array.isArray(m)||m.length===0)){console.error(`
|
|
604
604
|
recent console errors:
|
|
605
|
-
`);for(let g of m){let w=ae(g.timestamp),y=Array.isArray(g.args)?g.args.map(v=>typeof v=="object"?JSON.stringify(v):String(v)).join(" "):String(g);console.error(` [${w}] ${y}`)}}}let ie=["console","fetch","toast","alert","notification","screen","app-launch","keyboard","route","actionsheet","picker","shell","scroll","gesture","text-input","animation","reanimated"];async function xe(x){let o=
|
|
605
|
+
`);for(let g of m){let w=ae(g.timestamp),y=Array.isArray(g.args)?g.args.map(v=>typeof v=="object"?JSON.stringify(v):String(v)).join(" "):String(g);console.error(` [${w}] ${y}`)}}}let ie=["console","fetch","toast","alert","notification","screen","app-launch","keyboard","route","actionsheet","picker","shell","scroll","gesture","text-input","animation","reanimated"];async function xe(x){let o=st(),n=null;try{n=await Nt(x,`(() => {
|
|
606
606
|
const tl = window.SootSim && window.SootSim.bridges && window.SootSim.bridges.timeline
|
|
607
607
|
if (!tl || typeof tl.summary !== 'function') return null
|
|
608
608
|
const cursorKey = ${JSON.stringify(o)}
|
|
@@ -619,7 +619,7 @@ ${n}
|
|
|
619
619
|
}
|
|
620
620
|
return summary ? { summary, consoleSplit } : null
|
|
621
621
|
})()`)}catch{return}if(!n||!n.summary||!n.summary.total)return;let r=n.summary.byKind??{},a=[],u=new Set;for(let m of ie){let g=r[m];if(g)if(u.add(m),m==="console"&&n.consoleSplit){let{error:w,warn:y}=n.consoleSplit;w>0&&a.push(`${w} error${w===1?"":"s"}`),y>0&&a.push(`${y} warning${y===1?"":"s"}`)}else a.push(`${g} ${m}${g===1?"":"s"}`)}for(let[m,g]of Object.entries(r))!u.has(m)&&g&&a.push(`${g} ${m}${g===1?"":"s"}`);if(a.length!==0&&(console.error(`
|
|
622
|
-
since last: ${a.join(" \xB7 ")} \u2014 sootsim what-happened`),n.summary.lastAt))try{await ce(x,"SootSim.bridges.timeline.cursorAdvance",o,n.summary.lastAt)}catch{}}let C=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","storage-clear"]),le=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"]),Se=(e.includes("--verbose")||e.includes("-v"))&&!e.includes("--json");p==="do"&&f==="shell"&&(console.error(" `sootsim do shell` was removed. use `sootsim shell ...` instead."),process.exit(1)),C.has(f)&&await Mt(d),le.has(f)&&await pe(d,{verbose:Se});try{let x=C.has(f)?await
|
|
622
|
+
since last: ${a.join(" \xB7 ")} \u2014 sootsim what-happened`),n.summary.lastAt))try{await ce(x,"SootSim.bridges.timeline.cursorAdvance",o,n.summary.lastAt)}catch{}}let C=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","storage-clear"]),le=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"]),Se=(e.includes("--verbose")||e.includes("-v"))&&!e.includes("--json");p==="do"&&f==="shell"&&(console.error(" `sootsim do shell` was removed. use `sootsim shell ...` instead."),process.exit(1)),C.has(f)&&await Mt(d),le.has(f)&&await pe(d,{verbose:Se});try{let x=C.has(f)?await xt(d):[];switch(f){case"list":{_t(c.wsPort),await eo({bridge:d,simId:M,args:i});break}case"tree":{await io({bridge:d,args:i,positional:l});break}case"a11y":{let o=await ut(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):
|
|
623
623
|
`);for(let n of o){let r=[];if(r.push(`[${n.role}]`),n.label){let a=n.label.length>50?n.label.slice(0,47)+"...":n.label;r.push(`"${a}"`)}if(n.hint&&r.push(`(hint: "${n.hint}")`),n.testID&&r.push(`#${n.testID}`),n.state){let a=[];n.state.disabled&&a.push("disabled"),n.state.selected&&a.push("selected"),n.state.checked===!0&&a.push("checked"),n.state.checked==="mixed"&&a.push("mixed"),n.state.busy&&a.push("busy"),n.state.expanded===!0&&a.push("expanded"),n.state.expanded===!1&&a.push("collapsed"),a.length&&r.push(`{${a.join(", ")}}`)}n.position&&r.push(`@(${n.position.x},${n.position.y})`),n.size&&r.push(`${n.size.w}x${n.size.h}`),console.log(" "+r.join(" "))}}break}case"find":{await Vt({bridge:d,args:e,effectiveArgs:i,positional:l,inspectUsage:k});break}case"count":{await zt(d,{args:i});break}case"keyboard":{await Zt(d,{json:e.includes("--json")});break}case"screens":{await so(d,{json:e.includes("--json")});break}case"memory":{await oo(d,{args:i});break}case"wait":{await lo({wsPort:N,commandTimeoutMs:O,simId:M,simIdSource:j,positional:l});break}case"sleep":{await ro({positional:l,inspectUsage:k});break}case"settle":{await no({bridge:d,args:e,positional:l});break}case"ready":{await mo({bridge:d,args:e});break}case"idle":{await po({bridge:d,args:e,positional:l});break}case"selector":{await fo({bridge:d,args:e,positional:l,inspectUsage:k});break}case"event":{await uo({bridge:d,args:e,positional:l,inspectUsage:k});break}case"layout":{let o=l[1];if(!o){await Qt({bridge:d,args:i});break}let n=await d.send({type:"evaluate",code:`(async () => await window.__sootsimTest.getLayout(${JSON.stringify(o)}))()`});console.log(JSON.stringify(n,null,2));break}case"capture":case"screenshot":{let n=e.find((w,y)=>e[y-1]==="--output")||"/tmp/sootsim-inspect.png",r=await $o(e,d),a={type:"screenshot"};r&&(a.crop=r);let m=(await d.send(a)).replace(/^data:image\/png;base64,/,"");r&&console.log(` area: x=${r.x} y=${r.y} w=${r.w} h=${r.h}`),(await import("fs")).writeFileSync(n,Buffer.from(m,"base64")),console.log(` saved: ${n}`);break}case"sample-color":{let o=await $o(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 n=await d.send({type:"evaluate",code:Bt(o)});if(e.includes("--json"))console.log(JSON.stringify(n,null,2));else{let{r,g:a,b:u,a:m,hex:g,samples:w}=n,y=o.w===1&&o.h===1?`@(${o.x},${o.y})`:`@(${o.x},${o.y}) ${o.w}x${o.h}`;console.log(` ${g} rgba(${r}, ${a}, ${u}, ${m}) ${y} ${w} samples`)}break}case"node":{let o=l[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 n=await d.send({type:"evaluate",code:`(async () => {
|
|
624
624
|
const t = window.__sootsimTest
|
|
625
625
|
const q = ${JSON.stringify(o)}
|
|
@@ -993,9 +993,9 @@ ${n}
|
|
|
993
993
|
return await window.__sootsimShellPerf.stop()
|
|
994
994
|
})()`});if(u?.error&&(console.error(` error: ${u.error}`),process.exit(1)),D(i)){A(u);break}Ie(` ${n} transition profiled:`),So(u);break}default:console.error(` unknown perf subcommand: ${o}`),console.error(" valid: start, stop, transition"),/^--?reset$/.test(o)&&console.error(" note: 'perf start' already clears prior frames \u2014 no reset needed"),(o==="stats"||o==="frames"||o==="worst")&&(console.error(" note: the tenant sampler (stats/frames/worst) was removed \u2014 it hardcoded"),console.error(" layout/render/copy to zero because the shell worker owns every real paint."),console.error(" use 'perf start' / 'perf stop' (worst frames are in the stop report).")),process.exit(1)}break}case"errors":{let o=l[1];if(o==="clear"){await qe(d),D(i)?A({cleared:!0}):console.log(" error buffer cleared");break}let n=o?Number(o):20,r=await ge(d,n);if(D(i)){A(r);break}if(r.length===0){console.log(" no errors captured");break}console.log(` ${r.length} error(s):
|
|
995
995
|
`);for(let a of r){let u=ae(a.timestamp),m=a.args.map(g=>typeof g=="object"?JSON.stringify(g):g).join(" ");if(console.log(` [${u}] ${m}`),a.stack){let g=a.stack.split(`
|
|
996
|
-
`).slice(0,3);for(let w of g)console.log(` ${w.trim()}`)}}break}case"warnings":{let o=l[1]?Number(l[1]):20,n=await
|
|
996
|
+
`).slice(0,3);for(let w of g)console.log(` ${w.trim()}`)}}break}case"warnings":{let o=l[1]?Number(l[1]):20,n=await gt(d,o);if(D(i)){A(n);break}if(n.length===0){console.log(" no warnings captured");break}console.log(` ${n.length} warning(s):
|
|
997
997
|
`);for(let r of n){let a=ae(r.timestamp),u=r.args.map(m=>typeof m=="object"?JSON.stringify(m):m).join(" ");console.log(` [${a}] ${u}`)}break}case"animations":{let o=await X(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):
|
|
998
|
-
`);for(let n of o){let r=String(n.realm??"tenant").padEnd(6),a=String(n.kind).padEnd(10),u=typeof n.from=="number"&&typeof n.to=="number"?`${n.from.toFixed(2)}\u2192${n.to.toFixed(2)}`:"\u2014",m=Number(n.current??0).toFixed(2),g=typeof n.progress=="number"?`${Math.round(n.progress*100)}%`:"\u2014",w=`${Math.round(n.elapsedMs??0)}ms`,y=[n.loop?"loop":null,n.layoutBound?"layout":null,n.remoteDriven?"remote-driven":n.graphBacked?"graph":null,n.visible===!1?"offscreen":null].filter(Boolean),v=y.length>0?` [${y.join(" ")}]`:"";console.log(` #${n.id} ${r} ${a} ${u.padEnd(14)} cur=${m.padEnd(7)} ${g.padStart(4)} ${w}${v}`)}break}case"animation":{let o=l[1];(!o||o==="--help"||o==="-h")&&(console.error(` usage: ${b("animation")} <id>`),process.exit(1));let n=Number(o);Number.isFinite(n)||(console.error(` invalid id: ${o}`),process.exit(1));let r=await X(d,"getAnimation",n);console.log(JSON.stringify(r,null,2));break}case"stop-animation":{let o=l[1];(!o||o==="--help"||o==="-h")&&(console.error(` usage: ${b("stop-animation")} <id|all>`),process.exit(1));let n=o==="all"?"all":Number(o);n!=="all"&&!Number.isFinite(n)&&(console.error(` invalid id: ${o}`),process.exit(1));let r=await X(d,"stopAnimation",n);console.log(` stopped ${r??0} animation(s)`);break}case"requests":{let o=l[1];if(o==="clear"){await
|
|
998
|
+
`);for(let n of o){let r=String(n.realm??"tenant").padEnd(6),a=String(n.kind).padEnd(10),u=typeof n.from=="number"&&typeof n.to=="number"?`${n.from.toFixed(2)}\u2192${n.to.toFixed(2)}`:"\u2014",m=Number(n.current??0).toFixed(2),g=typeof n.progress=="number"?`${Math.round(n.progress*100)}%`:"\u2014",w=`${Math.round(n.elapsedMs??0)}ms`,y=[n.loop?"loop":null,n.layoutBound?"layout":null,n.remoteDriven?"remote-driven":n.graphBacked?"graph":null,n.visible===!1?"offscreen":null].filter(Boolean),v=y.length>0?` [${y.join(" ")}]`:"";console.log(` #${n.id} ${r} ${a} ${u.padEnd(14)} cur=${m.padEnd(7)} ${g.padStart(4)} ${w}${v}`)}break}case"animation":{let o=l[1];(!o||o==="--help"||o==="-h")&&(console.error(` usage: ${b("animation")} <id>`),process.exit(1));let n=Number(o);Number.isFinite(n)||(console.error(` invalid id: ${o}`),process.exit(1));let r=await X(d,"getAnimation",n);console.log(JSON.stringify(r,null,2));break}case"stop-animation":{let o=l[1];(!o||o==="--help"||o==="-h")&&(console.error(` usage: ${b("stop-animation")} <id|all>`),process.exit(1));let n=o==="all"?"all":Number(o);n!=="all"&&!Number.isFinite(n)&&(console.error(` invalid id: ${o}`),process.exit(1));let r=await X(d,"stopAnimation",n);console.log(` stopped ${r??0} animation(s)`);break}case"requests":{let o=l[1];if(o==="clear"){await ht(d),D(i)?A({cleared:!0}):console.log(" request buffer cleared");break}let n=o==="all",r=n?l[2]:o,a=r?Number(r):20,u=await yt(d,{failed:!n,limit:a});if(D(i)){A(u);break}if(u.length===0){console.log(n?" no requests captured":" no failed requests captured");break}console.log(` ${u.length} ${n?"request(s)":"failed request(s)"}:
|
|
999
999
|
`);for(let m of u){let g=ae(m.timestamp);console.log(` [${g}] ${U(m)}`),m.responseBody?console.log(` ${m.responseBody}`):m.error&&console.log(` ${m.error}`)}break}case"network":{let o=l[1],n=null,r=null,a=!1,u=!1,m=1e3,g=!1,w=!1;for(let E=0;E<i.length;E++){let S=i[E];if(S==="--filter")n=i[E+1]??null,E++;else if(S==="--limit"){let I=Number(i[E+1]);Number.isFinite(I)&&(r=I),E++}else if(S==="--threshold"){let I=Number(i[E+1]);Number.isFinite(I)&&I>0&&(m=I),E++}else S==="--failed"?a=!0:S==="--slow"?u=!0:S==="--tail"||S==="-f"?g=!0:S==="--json"&&(w=!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 E=l[2];E||(console.error(" usage: sootsim network get <id>"),process.exit(1));let S=await d.send({type:"evaluate",code:`(() => {
|
|
1000
1000
|
const obs = window.__sootsimObservability;
|
|
1001
1001
|
if (!obs) return null;
|
|
@@ -1008,10 +1008,10 @@ ${n}
|
|
|
1008
1008
|
})()`});if(!E||!E.ok)throw new Error("observability bridge not installed \u2014 is the engine running?");return E.entries??[]},L=E=>{let S=E;if(a&&(S=S.filter(I=>!!I.error||I.status!=null&&I.status>=400)),u&&(S=S.filter(I=>I.durationMs!=null&&I.durationMs>=m)),n){let I=n.toLowerCase();S=S.filter(T=>(T.displayUrl||T.url).toLowerCase().includes(I))}return u&&!g&&(S=[...S].sort((I,T)=>(T.durationMs??0)-(I.durationMs??0))),S};if(!g){let E=await v(),S=L(E).slice(-y);if(w){console.log(JSON.stringify(S,null,2));break}if(S.length===0){E.length===0?console.log(" no network requests captured"):console.log(u?` no requests slower than ${m}ms (${E.length} total \u2014 try --threshold <ms>)`:" no matching requests");break}console.log(u?` ${S.length} request(s) slower than ${m}ms (sorted by duration desc):
|
|
1009
1009
|
`:` ${S.length} request(s):
|
|
1010
1010
|
`);for(let I of S)ho(I);break}console.log(` tailing network (ctrl-c to stop)...
|
|
1011
|
-
`);let V=new Set,G=!0,Y=()=>{G=!1};process.on("SIGINT",Y);try{for(;G;){let E=await v(),S=L(E);for(let I of S)I.durationMs!=null&&(V.has(I.id)||(V.add(I.id),w?console.log(JSON.stringify(I)):ho(I)));await oe(250)}}finally{process.off("SIGINT",Y)}break}case"logs":{let o=l[1],n=null,r=null,a=null,u=!1,m=!1,g=!1;for(let S=0;S<i.length;S++){let I=i[S];if(I==="--filter")n=i[S+1]??null,S++;else if(I==="--limit"){let T=Number(i[S+1]);Number.isFinite(T)&&(r=T),S++}else I==="--level"?(a=i[S+1]??null,S++):I==="--tail"||I==="-f"?u=!0:I==="--json"?m=!0:(I==="--internal"||I==="--all")&&(g=!0)}let w=a?new Set(a.split(",").map(S=>S.trim()).filter(S=>S==="log"||S==="info"||S==="warn"||S==="error"||S==="debug")):null;if(o==="clear"){await
|
|
1012
|
-
to target a specific sim, use \`--sim ${o}\` instead.`),process.exit(1));let L=()=>
|
|
1011
|
+
`);let V=new Set,G=!0,Y=()=>{G=!1};process.on("SIGINT",Y);try{for(;G;){let E=await v(),S=L(E);for(let I of S)I.durationMs!=null&&(V.has(I.id)||(V.add(I.id),w?console.log(JSON.stringify(I)):ho(I)));await oe(250)}}finally{process.off("SIGINT",Y)}break}case"logs":{let o=l[1],n=null,r=null,a=null,u=!1,m=!1,g=!1;for(let S=0;S<i.length;S++){let I=i[S];if(I==="--filter")n=i[S+1]??null,S++;else if(I==="--limit"){let T=Number(i[S+1]);Number.isFinite(T)&&(r=T),S++}else I==="--level"?(a=i[S+1]??null,S++):I==="--tail"||I==="-f"?u=!0:I==="--json"?m=!0:(I==="--internal"||I==="--all")&&(g=!0)}let w=a?new Set(a.split(",").map(S=>S.trim()).filter(S=>S==="log"||S==="info"||S==="warn"||S==="error"||S==="debug")):null;if(o==="clear"){await wt(d),console.log(" log buffer cleared");break}let y=!m&&process.stdout.isTTY===!0,v=r??(u?500:o?Number(o):50);Number.isFinite(v)||(console.error(` invalid limit: ${o} \u2014 \`logs\` takes a numeric count (e.g. ${b("logs")} 100).
|
|
1012
|
+
to target a specific sim, use \`--sim ${o}\` instead.`),process.exit(1));let L=()=>bt(d),V=S=>$t(S,{level:w,filter:n,showInternal:g});if(!u){let S=await L(),I=V(S).slice(-v);if(m){console.log(JSON.stringify(I,null,2));break}if(I.length===0){console.log(S.length===0?" no logs captured":" no matching logs");break}console.log(` ${I.length} log(s):
|
|
1013
1013
|
`);for(let T of I)wo(T,y);break}console.log(` tailing logs (ctrl-c to stop)...
|
|
1014
|
-
`);let G=new Set,Y=!0,E=()=>{Y=!1};process.on("SIGINT",E);try{for(;Y;){let S=await L(),I=V(S);for(let T of I)G.has(T.id)||(G.add(T.id),m?console.log(JSON.stringify(T)):wo(T,y));await oe(250)}}finally{process.off("SIGINT",E)}break}default:console.error(` unknown subcommand: ${f}`),process.exit(1)}if(C.has(f)&&!e.includes("--no-wait")&&process.env.SOOTSIM_NO_AUTO_WAIT!=="1"&&!await
|
|
1014
|
+
`);let G=new Set,Y=!0,E=()=>{Y=!1};process.on("SIGINT",E);try{for(;Y;){let S=await L(),I=V(S);for(let T of I)G.has(T.id)||(G.add(T.id),m?console.log(JSON.stringify(T)):wo(T,y));await oe(250)}}finally{process.off("SIGINT",E)}break}default:console.error(` unknown subcommand: ${f}`),process.exit(1)}if(C.has(f)&&!e.includes("--no-wait")&&process.env.SOOTSIM_NO_AUTO_WAIT!=="1"&&!await nt(d,f)&&await _(d),x.length>0&&ee(x),!R.has(f))try{await xe(d)}catch{}}catch(x){let o=x instanceof Error?x.message:String(x);console.error(` ${f??"inspect"} failed: ${o}`);let n=/^no sim connected with id ([^;]+)(?:; connected sims: .+)?$/.exec(o),r=/^command timed out after (\d+)s$/.exec(o),a=o.startsWith("sim disconnected:")||o.startsWith("bridge never reconnected")||o.startsWith("could not connect to ws://");if(n)await Pt(d,N,n[1]);else if(/^no sim connected$/.test(o))Et(N);else if(r)if(await ps(d)){let m=f??"describe";process.stderr.write(` the sim is still responsive \u2014 '${m}' just exceeded the ${r[1]}s command budget.
|
|
1015
1015
|
the screen's node tree is large; narrow the query or raise the budget:
|
|
1016
1016
|
sootsim ${m} --testid <id> # scope to one subtree
|
|
1017
1017
|
sootsim find --testid <id> # targeted single-node lookup
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.295 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
import{randomUUID as D}from"node:crypto";import r from"node:fs";import{homedir as x}from"node:os";import o from"node:path";var h="SOOTSIM_HOME",k="active",L="daemon.json",O="dev-bridge.json",A="config.json",S=3e4;function i(){let e=process.env[h];return e&&e.length>0?o.resolve(e):o.join(x(),".sootsim")}function E(){if(process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1")return!1;let e=process.env.SOOTSIM_DEV;if(e==="1"||e==="true")return!0;if(e==="0"||e==="false")return!1;let t=process.argv[1];if(!t)return!1;try{return r.realpathSync(t).includes(`${o.sep}packages${o.sep}sootsim${o.sep}`)}catch{return!1}}function N(){return process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1"?!1:process.env.IS_TAMAGUI_DEV==="1"}function J(){return E()||N()}function m(){return o.join(i(),"runtimes")}function _(e){return o.join(m(),e)}function b(){return o.join(m(),k)}function g(){return o.join(i(),"electron")}function V(){return o.join(g(),"userData")}function H(e){return o.join(g(),e)}function P(){return o.join(i(),"profiles")}function j(){return o.join(i(),"daemon-app")}function I(){return o.join(j(),"SootSim Daemon.app")}function G(){return o.join(I(),"Contents","MacOS","sootsim-daemon")}function w(){return o.join(i(),"cache")}function a(){return o.join(i(),L)}function f(){return o.join(i(),O)}function d(){return o.join(i(),A)}function y(){try{let e=r.readFileSync(d(),"utf8"),t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function v(e){s();let t=y(),u={...t,...e};e.settings&&typeof e.settings=="object"&&(u.settings={...t.settings&&typeof t.settings=="object"?t.settings:{},...e.settings});let c=`${d()}.tmp`;return r.writeFileSync(c,`${JSON.stringify(u,null,2)}
|