sootsim 0.1.286 → 0.1.288
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -4
- package/dist-cli/bin.js +7 -5
- package/dist-cli/chunks/{agent-33P56S6H.js → agent-Y676XHOX.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-6NYFNE5W.js → agent-wrapper-VDTQJTDH.js} +2 -2
- package/dist-cli/chunks/{app-fonts-YK2Q6XKF.js → app-fonts-VHJ5H6YV.js} +2 -2
- package/dist-cli/chunks/{assert-6TQVO73U.js → assert-IMFPF5IL.js} +2 -2
- package/dist-cli/chunks/{auth-YUR4PLG6.js → auth-3V4RZW4N.js} +2 -2
- package/dist-cli/chunks/beta-LVZUWQRW.js +2 -0
- package/dist-cli/chunks/{camera-AH6HX7J7.js → camera-H6SDZMVF.js} +2 -2
- package/dist-cli/chunks/{chunk-ZCTN2EB2.js → chunk-2AZWJSDI.js} +1 -1
- package/dist-cli/chunks/chunk-2E7NPIZK.js +4 -0
- package/dist-cli/chunks/chunk-2FXHVGBY.js +72 -0
- package/dist-cli/chunks/{chunk-REZHG5VM.js → chunk-3C72OK23.js} +2 -2
- package/dist-cli/chunks/{chunk-XSDCNF6M.js → chunk-3LOQ4DCR.js} +2 -2
- package/dist-cli/chunks/{chunk-HOHHKCIP.js → chunk-4SHHPFOG.js} +3 -3
- package/dist-cli/chunks/{chunk-MKF2EME3.js → chunk-57SYWOXM.js} +1 -1
- package/dist-cli/chunks/{chunk-KSZREXK6.js → chunk-6CZJDONZ.js} +2 -2
- package/dist-cli/chunks/{chunk-WXNQ4S3U.js → chunk-6R2NNCM6.js} +1 -1
- package/dist-cli/chunks/{chunk-ITM34X5G.js → chunk-6T37OB55.js} +4 -4
- package/dist-cli/chunks/{chunk-KNHPTZSC.js → chunk-6YYWSTTR.js} +1 -1
- package/dist-cli/chunks/{chunk-SBVZ626T.js → chunk-7O7ECDP6.js} +1 -1
- package/dist-cli/chunks/{chunk-AOUWTAAX.js → chunk-BVG6UDMP.js} +1 -1
- package/dist-cli/chunks/{chunk-25DVDAPA.js → chunk-C4O44UV2.js} +2 -2
- package/dist-cli/chunks/{chunk-J4BM7F3Q.js → chunk-DKBPCF3I.js} +32 -8
- package/dist-cli/chunks/{chunk-5FTZJTI4.js → chunk-DTCS6PX5.js} +2 -2
- package/dist-cli/chunks/{chunk-AA5JDZ5V.js → chunk-DUQ6NAH7.js} +1 -1
- package/dist-cli/chunks/{chunk-AXAMST3F.js → chunk-DY4ETZUA.js} +3 -3
- package/dist-cli/chunks/chunk-E5KAJLCE.js +2 -0
- package/dist-cli/chunks/{chunk-E6IX4HRY.js → chunk-EMJBIJHK.js} +1 -1
- package/dist-cli/chunks/{chunk-IGSWIL6S.js → chunk-ERXIEAAA.js} +2 -2
- package/dist-cli/chunks/{chunk-R5OLHSBE.js → chunk-EWMWHQND.js} +2 -2
- package/dist-cli/chunks/{chunk-CRSQUCBK.js → chunk-FBM5UMFY.js} +1 -1
- package/dist-cli/chunks/{chunk-AP2SEG7G.js → chunk-GPEFE36K.js} +1 -1
- package/dist-cli/chunks/{chunk-QDYEMLUL.js → chunk-GXDDHTOJ.js} +2 -2
- package/dist-cli/chunks/{chunk-Z5H2WCXE.js → chunk-HF6J2BIO.js} +2 -2
- package/dist-cli/chunks/chunk-HYBMX6YE.js +1 -0
- package/dist-cli/chunks/{chunk-MF6XW3H6.js → chunk-IE5VGFI7.js} +1 -1
- package/dist-cli/chunks/chunk-IIURCDJE.js +118 -0
- package/dist-cli/chunks/{chunk-RVO5TPAW.js → chunk-JDS7NQGJ.js} +1 -1
- package/dist-cli/chunks/{chunk-ELWYA2FG.js → chunk-LISO377N.js} +1 -1
- package/dist-cli/chunks/{chunk-EN3G4QDH.js → chunk-M7PUH4OV.js} +1 -1
- package/dist-cli/chunks/chunk-MU5NYZW2.js +4 -0
- package/dist-cli/chunks/{chunk-PEBWKIKE.js → chunk-OPLXKOJP.js} +2 -2
- package/dist-cli/chunks/{chunk-SQ4KZFHS.js → chunk-P7WHR67J.js} +2 -2
- package/dist-cli/chunks/{chunk-UIS673DZ.js → chunk-QJR4A3AT.js} +2 -2
- package/dist-cli/chunks/{chunk-EHCNYSIL.js → chunk-SGIRBGTQ.js} +3 -3
- package/dist-cli/chunks/chunk-V62SROO2.js +2 -0
- package/dist-cli/chunks/{chunk-6KCHUVWD.js → chunk-WGBXASPC.js} +2 -2
- package/dist-cli/chunks/{chunk-VOHHRMFC.js → chunk-XRWQYYRY.js} +1 -1
- package/dist-cli/chunks/chunk-XYVOQPAW.js +2 -0
- package/dist-cli/chunks/{chunk-EJWY734U.js → chunk-YSJTYIZG.js} +2 -2
- package/dist-cli/chunks/{chunk-6SLQ3G7E.js → chunk-YWUKWQC6.js} +2 -2
- package/dist-cli/chunks/{chunk-EK6AUUE6.js → chunk-Z472LVDA.js} +1 -1
- package/dist-cli/chunks/{chunk-G53Q3VYK.js → chunk-ZEJWSA35.js} +1 -1
- package/dist-cli/chunks/{chunk-4YYNJCS5.js → chunk-ZPQBCWBR.js} +3 -3
- package/dist-cli/chunks/cleanup-GHJTGGY7.js +23 -0
- package/dist-cli/chunks/cli-version-M24PIJH6.js +2 -0
- package/dist-cli/chunks/{compat-PVCAO5DO.js → compat-XKTM3M7W.js} +3 -3
- package/dist-cli/chunks/{config-P6OFDB24.js → config-DB5WUN4B.js} +2 -2
- package/dist-cli/chunks/control-7QH4PRCO.js +2 -0
- package/dist-cli/chunks/daemon-OMCLCKGX.js +2 -0
- package/dist-cli/chunks/{debug-4Q7RLYX3.js → debug-DYSWVVNG.js} +3 -3
- package/dist-cli/chunks/{desktop-X2FAW2A3.js → desktop-CLE46QCT.js} +3 -3
- package/dist-cli/chunks/{detox-3AZOBP4F.js → detox-K4ZQQ36C.js} +2 -2
- package/dist-cli/chunks/{device-WF2C7YGD.js → device-VYMGAGMD.js} +2 -2
- package/dist-cli/chunks/{diagnose-DCAC3BLD.js → diagnose-4IJ7OIKZ.js} +2 -2
- package/dist-cli/chunks/disk-cleanup-4QDVAVCP.js +2 -0
- package/dist-cli/chunks/drivers-MXV3L74Q.js +2 -0
- package/dist-cli/chunks/{film-F6TSZPL3.js → film-Z2PSEJF5.js} +3 -3
- package/dist-cli/chunks/flow-CI4W7CB7.js +2 -0
- package/dist-cli/chunks/help-MSJI6T7H.js +2 -0
- package/dist-cli/chunks/{hidden-runtime-alias-Z3H5SAJD.js → hidden-runtime-alias-OAE76Q46.js} +2 -2
- package/dist-cli/chunks/{home-paths-BSP5ZYAG.js → home-paths-W277VF23.js} +2 -2
- package/dist-cli/chunks/inspect-MQQS3PL7.js +2 -0
- package/dist-cli/chunks/install-desktop-6OHIHZBG.js +2 -0
- package/dist-cli/chunks/{login-P2M43UX5.js → login-26BKHAQL.js} +4 -4
- package/dist-cli/chunks/{logout-GMHE3AEY.js → logout-WCOKGMYQ.js} +2 -2
- package/dist-cli/chunks/{maestro-2EWEIZL4.js → maestro-UDB3IHJ7.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-BJP6ETUZ.js → maestro-generate-CTXLTIAL.js} +3 -3
- package/dist-cli/chunks/{mode-45537T6B.js → mode-UJBQNCG3.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-RVZEEKXA.js +2 -0
- package/dist-cli/chunks/{perf-R4IWNVFR.js → perf-3DCFEOFO.js} +2 -2
- package/dist-cli/chunks/{record-2XO4LKVA.js → record-Q5C4E5DS.js} +3 -3
- package/dist-cli/chunks/runtime-4TUHMJHY.js +2 -0
- package/dist-cli/chunks/{screenshot-command-DF7ZYHK7.js → screenshot-command-PXNYWNJU.js} +3 -3
- package/dist-cli/chunks/{screenshots-capture-JGGKYSSF.js → screenshots-capture-TLOFBC2U.js} +2 -2
- package/dist-cli/chunks/{serve-SX3MWFVT.js → serve-KUHJQO7L.js} +18 -18
- package/dist-cli/chunks/{setup-2HIHHC32.js → setup-2JAIBVNC.js} +3 -3
- package/dist-cli/chunks/{skills-NN3GPY3W.js → skills-PCGOTJR5.js} +2 -2
- package/dist-cli/chunks/{storage-QEJPPERQ.js → storage-3NLFAHM6.js} +2 -2
- package/dist-cli/chunks/store-DNGROAER.js +2 -0
- package/dist-cli/chunks/telemetry-RJLEHABK.js +2 -0
- package/dist-cli/chunks/{timeline-IVCWY7TU.js → timeline-G42TNE2L.js} +2 -2
- package/dist-cli/chunks/{upgrade-JEWTGSRU.js → upgrade-LBVHIFE6.js} +4 -4
- package/dist-cli/chunks/upload-SRSHTDNT.js +2 -0
- package/dist-cli/chunks/{version-K2Z4QDLF.js → version-VLZAAAFN.js} +3 -3
- package/dist-cli/chunks/{web-QUBUEOZK.js → web-FTIRIJF5.js} +2 -2
- package/dist-cli/chunks/{what-happened-JQYAXHQV.js → what-happened-3SKL7YDL.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +74 -9
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +76 -10
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/scripts/preuninstall.cjs +2 -0
- package/skills/contrast/SKILL.md +1 -0
- package/src/browser-cache.ts +16 -0
- package/src/disk-cleanup.ts +487 -0
- package/src/home-paths.ts +2 -0
- package/src/native-seam-manifest.ts +10 -0
- package/dist-cli/chunks/beta-G5D5LQAJ.js +0 -2
- package/dist-cli/chunks/chunk-CXAYWHAW.js +0 -118
- package/dist-cli/chunks/chunk-MUA7UKHH.js +0 -2
- package/dist-cli/chunks/chunk-OB3VWEUJ.js +0 -62
- package/dist-cli/chunks/chunk-QIKS26RZ.js +0 -4
- package/dist-cli/chunks/chunk-SBI67KAK.js +0 -1
- package/dist-cli/chunks/chunk-WIN33BUE.js +0 -2
- package/dist-cli/chunks/cli-version-LK3EWXJW.js +0 -2
- package/dist-cli/chunks/control-CGMOX77G.js +0 -2
- package/dist-cli/chunks/daemon-52LZDDWE.js +0 -2
- package/dist-cli/chunks/drivers-WNXYXJPY.js +0 -2
- package/dist-cli/chunks/flow-ZGCBJNHD.js +0 -2
- package/dist-cli/chunks/help-AKWMOTP6.js +0 -2
- package/dist-cli/chunks/inspect-5D66GDPY.js +0 -2
- package/dist-cli/chunks/install-desktop-3GHJAG7Z.js +0 -2
- package/dist-cli/chunks/optional-demo-registry-P7FM5VU5.js +0 -2
- package/dist-cli/chunks/runtime-QCF7EVMT.js +0 -2
- package/dist-cli/chunks/store-HJXDEIFN.js +0 -2
- package/dist-cli/chunks/telemetry-PCSHSCNK.js +0 -2
- package/dist-cli/chunks/upload-VESUJ2M4.js +0 -2
package/README.md
CHANGED
|
@@ -218,8 +218,12 @@ duplicates the focused simulator, while `File > New Simulator >` opens a new
|
|
|
218
218
|
window for a selected device (same device list as the `Window >` menu).
|
|
219
219
|
|
|
220
220
|
To uninstall the machine daemon and cached runtimes, run
|
|
221
|
-
`sootsim daemon uninstall`. It stops
|
|
222
|
-
removes `~/.sootsim/` (
|
|
221
|
+
`sootsim daemon uninstall`. It stops current and legacy launchd / systemd
|
|
222
|
+
services, removes daemon logs, and removes `~/.sootsim/` (runtimes, profiles,
|
|
223
|
+
recordings, and lockfiles). It does not remove the optional
|
|
224
|
+
`/Applications/sootsim.app` desktop bundle or macOS preference plist. To inspect
|
|
225
|
+
existing disk usage before uninstalling, run `sootsim cleanup`; add `--apply`
|
|
226
|
+
only after reviewing the preview.
|
|
223
227
|
|
|
224
228
|
## Jump to source in inspect mode
|
|
225
229
|
|
|
@@ -444,14 +448,34 @@ verifies its sha256, and unpacks it under `~/.sootsim`:
|
|
|
444
448
|
```
|
|
445
449
|
~/.sootsim/
|
|
446
450
|
├── runtimes/
|
|
447
|
-
│
|
|
451
|
+
│ ├── <active>/ unpacked engine assets (served at /__soot/)
|
|
452
|
+
│ └── <rollback>/ previous version for rollback
|
|
453
|
+
├── cache/ transient downloads; empty after extraction
|
|
454
|
+
├── profiles/ persistent named app storage, without browser caches
|
|
455
|
+
├── electron/userData/ desktop app storage, with bounded browser caches
|
|
448
456
|
├── daemon.json lockfile: pid, ports, active runtime, heartbeat
|
|
457
|
+
├── automatic-cleanup-v1.json completed legacy cleanup generation
|
|
449
458
|
└── config.json user prefs: update channel, cdn origin override
|
|
450
459
|
```
|
|
451
460
|
|
|
452
461
|
The bridge daemon serves these assets over HTTP and exposes a self-update route;
|
|
453
462
|
`sootsim upgrade` / `sootsim runtime` drive explicit version changes from the
|
|
454
|
-
CLI side.
|
|
463
|
+
CLI side. Installation retains the active runtime plus one rollback and removes
|
|
464
|
+
the downloaded archive after extraction. Disposable Playwright caches live in a
|
|
465
|
+
bounded per-session temporary directory; Electron's persistent HTTP cache is
|
|
466
|
+
disabled for simulator profiles and globally capped for app chrome. Cookies,
|
|
467
|
+
localStorage, IndexedDB, service workers, recordings, and captured frames are
|
|
468
|
+
user-owned data and are not removed by the default cleanup command.
|
|
469
|
+
|
|
470
|
+
The first interactive CLI command after this cleanup generation finishes its
|
|
471
|
+
requested work, then launches the same safe default plan in a detached
|
|
472
|
+
maintenance process. The app and terminal command are usable before the legacy
|
|
473
|
+
filesystem scan begins. The worker prints the reclaimed size to stderr, records
|
|
474
|
+
completion, and does not run the scan again. Open browser profiles and a runtime
|
|
475
|
+
served by the live daemon are left untouched; the automatic pass retries on a
|
|
476
|
+
later command after they close. The explicit `sootsim cleanup --aggressive`
|
|
477
|
+
command remains the only path that removes the rollback runtime or user-created
|
|
478
|
+
recordings.
|
|
455
479
|
|
|
456
480
|
## Development and building
|
|
457
481
|
|
package/dist-cli/bin.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! sootsim v0.1.
|
|
3
|
-
import{a as w,b as
|
|
2
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
|
+
import{a as w,b as g}from"./chunks/chunk-XYVOQPAW.js";import"./chunks/chunk-DUQ6NAH7.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}
|
|
4
4
|
`),process.exit(1)),t instanceof Error&&t.stack?process.stderr.write(`${t.stack}
|
|
5
5
|
`):process.stderr.write(`${a}
|
|
6
|
-
`),process.exit(1)}process.on("unhandledRejection",
|
|
6
|
+
`),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
|
|
7
7
|
it needs vite / electron / playwright from a project's node_modules.
|
|
8
8
|
run the npm package instead:
|
|
9
9
|
sootsim ${t}
|
|
10
|
-
`),process.exit(1))}var e=
|
|
11
|
-
`)}async function
|
|
10
|
+
`),process.exit(1))}var e=g(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:t}=await import("./chunks/hidden-runtime-alias-OAE76Q46.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-RJLEHABK.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-W277VF23.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
|
|
11
|
+
`)}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-4QDVAVCP.js");if(t())return;let{spawn:a}=await import("node:child_process"),n=["cleanup","--automatic-worker"],m=process.argv[1],d=A?a(process.execPath,n,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):m?a(process.execPath,[m,...n],{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):a("sootsim",n,{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}
|
|
12
|
+
`)}),d.unref()}catch(t){process.stderr.write(` SootSim automatic cleanup will retry on the next run: ${t instanceof Error?t.message:String(t)}
|
|
13
|
+
`)}}async function r(t){let{flushCliTelemetry:a}=await import("./chunks/telemetry-RJLEHABK.js");await a(),await v(),process.exit(t)}if(e.version){let{getCliVersion:t}=await import("./chunks/cli-version-M24PIJH6.js"),{IS_BETA:a,BETA_LABEL:n}=await import("./chunks/beta-LVZUWQRW.js"),m=a?` \xB7 ${n}`:"";console.log(`sootsim v${t()}${m}`);let{readActiveRuntime:d}=await import("./chunks/home-paths-W277VF23.js"),p=d();console.log(p?`runtime v${p}`:"runtime not installed"),await r(0)}if(e.help&&!e.command){let{printHelp:t}=await import("./chunks/help-MSJI6T7H.js");t(),await r(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-DNGROAER.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-2JAIBVNC.js");a()&&(await t(["--from-welcome"]),await r(0));let{printHelp:n}=await import("./chunks/help-MSJI6T7H.js");n(),await r(0)}var s=e.command??"";if(!s){if(e.commandArgs.length>0){let a=e.commandArgs.find(n=>!n.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${a}`),console.error(" run `sootsim --help` to see the full surface."),await r(1)}let{printHelp:t}=await import("./chunks/help-MSJI6T7H.js");t(),await r(0)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(s==="skill"){let{runSkill:n}=await import("./chunks/skills-PCGOTJR5.js");await n(e.commandArgs),await r(0)}let t=s==="do"||s==="get"||s==="debug"||s==="shell"||s==="perf"||s==="wait",a=e.commandArgs.find(n=>!n.startsWith("-"));if(!(s==="shell"||s==="perf"))if(t&&!a){let{printGroupHelp:n}=await import("./chunks/help-MSJI6T7H.js");n(s)&&await r(0)}else{let{printCommandHelp:n}=await import("./chunks/help-MSJI6T7H.js");n(t&&a?a:s,{prefer:t&&a?"verb":"command",group:t&&a?s:void 0}),await r(0)}}S(s);if(w.has(s)){let{runInspect:t}=await import("./chunks/inspect-MQQS3PL7.js");await t([s,...i],{port:o,verbose:c})}else switch(s){case"assert":{let{runAssert:t}=await import("./chunks/assert-IMFPF5IL.js");await t(e.commandArgs);break}case"detox":{let{runDetox:t}=await import("./chunks/detox-K4ZQQ36C.js");await t(e.commandArgs,{port:o,verbose:c});break}case"maestro":{let{runMaestro:t}=await import("./chunks/maestro-UDB3IHJ7.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"record":{let{runRecord:t}=await import("./chunks/record-Q5C4E5DS.js");await t(i,{port:o,verbose:c});break}case"film":{let{runFilm:t}=await import("./chunks/film-Z2PSEJF5.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"storage":{let{runStorage:t}=await import("./chunks/storage-3NLFAHM6.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"perf":{let{runPerf:t}=await import("./chunks/perf-3DCFEOFO.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"screenshot":{let{runScreenshotCommand:t}=await import("./chunks/screenshot-command-PXNYWNJU.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"mode":{let{runMode:t}=await import("./chunks/mode-UJBQNCG3.js");await t(i,{port:o,verbose:c});break}case"inspect":{let{runInspect:t}=await import("./chunks/inspect-MQQS3PL7.js");await t(i,{port:o,verbose:c});break}case"debug":{let{runDebug:t}=await import("./chunks/debug-DYSWVVNG.js");await t(i,{port:o,verbose:c});break}case"timeline":{let{runTimeline:t}=await import("./chunks/timeline-G42TNE2L.js");await t(i,{port:o,verbose:c});break}case"what-happened":{let{runWhatHappened:t}=await import("./chunks/what-happened-3SKL7YDL.js");await t(i,{port:o,verbose:c});break}case"open":{let{runOpenCommand:t}=await import("./chunks/control-7QH4PRCO.js");await t(i,{port:o});break}case"use":{let{runUseCommand:t}=await import("./chunks/control-7QH4PRCO.js");await t(i,{port:o});break}case"claim":{let{runClaimCommand:t}=await import("./chunks/control-7QH4PRCO.js");await t(i,{port:o});break}case"close":{let{runCloseCommand:t}=await import("./chunks/control-7QH4PRCO.js");await t(i,{port:o});break}case"device":{let{runDeviceCommand:t}=await import("./chunks/device-VYMGAGMD.js");await t(i,{port:o});break}case"compat":{let{runCompat:t}=await import("./chunks/compat-XKTM3M7W.js");await t(e.commandArgs);break}case"desktop":{let{runDesktop:t}=await import("./chunks/desktop-CLE46QCT.js");await t(e.commandArgs,{port:o,device:l,driver:C});break}case"login":{let{runLogin:t}=await import("./chunks/login-26BKHAQL.js");await t(e.commandArgs);break}case"logout":{let{runLogout:t}=await import("./chunks/logout-WCOKGMYQ.js");await t();break}case"auth":{let{runAuth:t}=await import("./chunks/auth-3V4RZW4N.js");await t(e.commandArgs);break}case"setup":{let{runSetup:t}=await import("./chunks/setup-2JAIBVNC.js");await t(e.commandArgs);break}case"serve":{let{runServe:t}=await import("./chunks/serve-KUHJQO7L.js");await t(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:t}=await import("./chunks/daemon-OMCLCKGX.js");await t(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:t}=await import("./chunks/runtime-4TUHMJHY.js");await t(e.commandArgs);break}case"upgrade":{let{runUpgrade:t}=await import("./chunks/upgrade-LBVHIFE6.js");await t(e.commandArgs);break}case"version":{let{runVersion:t}=await import("./chunks/version-VLZAAAFN.js");await t(e.commandArgs);break}case"agent":{let{runAgentCommand:t}=await import("./chunks/agent-Y676XHOX.js"),a=await t(e.commandArgs);await r(a)}case"agent-wrapper":{let{runAgentWrapper:t}=await import("./chunks/agent-wrapper-VDTQJTDH.js"),a=await t(e.commandArgs);await r(a)}case"skill":{let{runSkill:t}=await import("./chunks/skills-PCGOTJR5.js");await t(e.commandArgs);break}case"app-fonts":{let{runAppFonts:t}=await import("./chunks/app-fonts-VHJ5H6YV.js");await t(e.commandArgs);break}case"config":{let{runConfig:t}=await import("./chunks/config-DB5WUN4B.js");await t(e.commandArgs);break}case"cleanup":{let{runCleanup:t}=await import("./chunks/cleanup-GHJTGGY7.js"),a=await t(e.commandArgs);await r(a)}default:console.error(` unknown command: ${s}`),console.error(" run `sootsim --help` to see the full surface."),await r(1)}await v();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
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-
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
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-HF6J2BIO.js";import"./chunk-57SYWOXM.js";import{c as $}from"./chunk-P7WHR67J.js";import"./chunk-ERXIEAAA.js";import"./chunk-SGIRBGTQ.js";import"./chunk-3LOQ4DCR.js";import"./chunk-XRWQYYRY.js";import"./chunk-ZEJWSA35.js";import"./chunk-6YYWSTTR.js";import"./chunk-IIURCDJE.js";import{j as y}from"./chunk-GPEFE36K.js";import"./chunk-BVG6UDMP.js";import"./chunk-6R2NNCM6.js";import"./chunk-DUQ6NAH7.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}
|
|
3
3
|
`),L(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
|
|
4
4
|
`),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]
|
|
5
5
|
`),2;let s=d.resolve(r);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as M}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as M}from"./chunk-57SYWOXM.js";import"./chunk-DUQ6NAH7.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)+`
|
|
3
3
|
`)}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>
|
|
4
4
|
--provider codex|claude --cwd <path>
|
|
5
5
|
--prompt-in <fifo> --events-out <fifo>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{d as p}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as p}from"./chunk-7O7ECDP6.js";import"./chunk-DUQ6NAH7.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,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-DUQ6NAH7.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(`
|
|
3
3
|
`).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}
|
|
4
4
|
`),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(" ")}
|
|
5
5
|
supported: ${Array.from(w).sort().join(", ")}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as t}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as t}from"./chunk-GXDDHTOJ.js";import{d as s}from"./chunk-C4O44UV2.js";import"./chunk-GPEFE36K.js";import"./chunk-DUQ6NAH7.js";function i(){console.log(`
|
|
3
3
|
sootsim auth \u2014 inspect CLI auth
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{m as d}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{m as d}from"./chunk-QJR4A3AT.js";import"./chunk-JDS7NQGJ.js";import{g as l,i as m,k as p}from"./chunk-6CZJDONZ.js";import"./chunk-ZEJWSA35.js";import"./chunk-6YYWSTTR.js";import"./chunk-GPEFE36K.js";import"./chunk-DUQ6NAH7.js";function f(){console.log(`
|
|
3
3
|
sootsim do scan \u2014 inject a barcode scan
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
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(`
|
|
3
3
|
${o}
|
|
4
4
|
`);for(let e=0;e<n.length;e++)console.log(` ${e+1}. ${n[e]}`);if(console.log(),!process.stdin.isTTY)return console.log(` choose [1-${n.length}]: 1 (non-interactive)`),0;let r=await s(` choose [1-${n.length}]: `),t=parseInt(r,10);return t>=1&&t<=n.length?t-1:0}export{u as a,a as b};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{G as _,H as E,I as F,k as N,l as U,u as L,x as A}from"./chunk-GPEFE36K.js";import W from"node:fs";import z from"node:path";function T(e){try{return W.readdirSync(e.runtimesDir(),{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name).sort(k)}catch{return[]}}function D(e,a){return z.posix.basename(e.tarballPath(a))}function k(e,a){let o=f=>{let p=f.indexOf("-"),P=p>=0?f.slice(0,p):f,C=p>=0?f.slice(p+1):"",M=P.split(".").map(b=>Number.parseInt(b,10));return M.some(b=>!Number.isFinite(b))?[[Number.POSITIVE_INFINITY],f]:[M,C]},[m,u]=o(e),[R,S]=o(a);for(let f=0;f<Math.max(m.length,R.length);f++){let p=m[f]??0,P=R[f]??0;if(p!==P)return p-P}return u===S?0:u?S?u<S?-1:1:-1:1}import{spawn as G}from"node:child_process";import J from"node:crypto";import l from"node:fs";import w from"node:path";import{Readable as Y}from"node:stream";import{pipeline as q}from"node:stream/promises";var B=2;function j(e){function a(){try{let t=JSON.parse(l.readFileSync(e.configFile(),"utf8"));return t&&typeof t=="object"?t:{}}catch{return{}}}function o(t){let n=a();return(t||process.env[e.env.cdnOrigin]||n.cdnOrigin||e.defaultCdnOrigin).replace(/\/+$/,"")}function m(t){let n=a();return t||process.env[e.env.channel]||n.runtimeChannel||"stable"}function u(){let t=process.env[e.env.pin];if(t&&t.trim())return t.trim();let n=a();return typeof n.runtimeVersion=="string"&&n.runtimeVersion.trim()?n.runtimeVersion.trim():null}function R(t){let n=new URL(`${o(t)}${e.manifestPath}`);return n.searchParams.set("t",String(Date.now())),n.toString()}function S(t,n){return`${o(n)}${e.tarballPath(t)}`}async function f(t){let n=R(t),r=await fetch(n,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${n})`);return await r.json()}function p(t,n={}){let r=m(n.channel),i=n.version||u()||t.channels[r]?.latest;if(!i)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let h=t.versions[i];if(!h)throw new Error(`version ${i} not found in manifest; available: ${Object.keys(t.versions).slice(-10).join(", ")||"(none)"}`);return{version:i,channel:r,entry:h}}async function P(t={}){e.ensureHome();let n=o(t.cdnOrigin),r=await f(n),{version:i,channel:h,entry:s}=p(r,t),d=e.runtimeDir(i),g=t.setActive!==!1;if(x({protectVersions:[i]}),!t.force&&l.existsSync(w.join(d,e.installedMarker)))return g&&e.writeActiveRuntime(i),x({protectVersions:[i]}),{version:i,channel:h,cdnOrigin:n,runtimeDir:d,installed:!1,activated:g,manifest:r};let I=s.tarball||S(i,n),v=w.join(e.cacheDir(),D(e,i));process.stderr.write(`${e.id}: downloading runtime ${i}\u2026
|
|
3
|
+
`),await K(I,v),process.stderr.write(`${e.id}: extracting runtime ${i}\u2026
|
|
4
|
+
`);let O=w.join(w.dirname(d),`.installing-${i}-${process.pid}`);l.rmSync(O,{recursive:!0,force:!0});try{let y=await Q(v);if(y!==s.sha256)throw new Error(`sha256 mismatch for runtime ${i}: expected ${s.sha256}, actual ${y}`);if(l.mkdirSync(O,{recursive:!0}),await X(v,O),!l.existsSync(w.join(O,e.installedMarker)))throw new Error(`extracted tarball for runtime ${i} is missing ${e.installedMarker}`);l.rmSync(d,{recursive:!0,force:!0}),l.renameSync(O,d)}catch(y){throw l.rmSync(O,{recursive:!0,force:!0}),y}finally{l.rmSync(v,{force:!0})}return g&&e.writeActiveRuntime(i),x({protectVersions:[i]}),{version:i,channel:h,cdnOrigin:n,runtimeDir:d,installed:!0,activated:g,manifest:r}}async function C(t={}){e.ensureHome(),x();let n=o(t.cdnOrigin),r=m(t.channel),i=u();if(i){let V=e.readActiveRuntime(),c=l.existsSync(w.join(e.runtimeDir(i),e.installedMarker));if(V===i&&c)return{checked:!0,updated:!1,reason:`runtime is pinned to ${i}`,activeVersion:V,latestVersion:i};let $=await P({version:i,channel:r,cdnOrigin:n,setActive:!1});return{checked:!0,updated:!0,reason:`runtime is pinned to ${i}`,activeVersion:i,latestVersion:i,install:$}}let h=await f(n),s=h.channels[r]?.latest;if(!s)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:e.readActiveRuntime()};if(!h.versions[s])return{checked:!0,updated:!1,reason:`manifest is missing version ${s}`,activeVersion:e.readActiveRuntime(),latestVersion:s};let g=e.readActiveRuntime(),I=g?e.runtimeDir(g):null,v=I?l.existsSync(w.join(I,e.installedMarker)):!1;if(!(!g||!v||k(s,g)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:g,latestVersion:s};let y=await P({version:s,channel:r,cdnOrigin:n,setActive:!1});return{checked:!0,updated:!0,activeVersion:s,latestVersion:s,install:y}}async function M(t={}){let n=e.readActiveRuntime(),r=u();if(r)return{active:n,latest:r,pinned:r,outdated:n!==r};try{let i=await f(o(t.cdnOrigin)),h=m(t.channel),s=i.channels[h]?.latest??null,d=!!(s&&(!n||k(s,n)>0));return{active:n,latest:s,pinned:null,outdated:d}}catch{return{active:n,latest:null,pinned:null,outdated:!1}}}function b(t={}){e.ensureHome();let n=Math.max(1,Math.floor(t.retainVersions??B)),r=T(e),i=new Set(r),h=e.readActiveRuntime(),s=u(),d=new Set;for(let c of[h,s,...t.protectVersions??[]])c&&i.has(c)&&d.add(c);for(let c of[...r].reverse()){if(d.size>=n)break;d.add(c)}let g="__RUNTIME_VERSION__",I=D(e,g),v=I.indexOf(g),O=I.slice(0,v),y=I.slice(v+g.length),V=[];if(v>=0)try{V=l.readdirSync(e.cacheDir(),{withFileTypes:!0}).filter(c=>{if(!c.isFile())return!1;let $=c.name.startsWith(O)&&c.name.endsWith(y),H=c.name.startsWith(O)&&c.name.endsWith(`${y}.partial`);return $||H}).map(c=>w.join(e.cacheDir(),c.name)).sort()}catch{}return{activeVersion:h,pinnedVersion:s,keepVersions:r.filter(c=>d.has(c)),removeVersions:r.filter(c=>!d.has(c)),removeCacheFiles:V}}function x(t={}){let n=b(t);for(let r of n.removeVersions)l.rmSync(e.runtimeDir(r),{recursive:!0,force:!0});for(let r of n.removeCacheFiles)l.rmSync(r,{force:!0});return n}return{product:e,resolveCdnOrigin:o,resolveChannel:m,resolvePin:u,manifestUrl:R,tarballUrl:S,fetchManifest:f,resolveVersion:p,install:P,updateToLatest:C,checkUpToDate:M,planLocalRetention:b,pruneLocalRetention:x,listInstalled:()=>T(e)}}async function K(e,a){let o=await fetch(e);if(!o.ok||!o.body)throw new Error(`download failed: ${o.status} ${o.statusText} (${e})`);l.mkdirSync(w.dirname(a),{recursive:!0});let m=`${a}.partial`;try{await q(Y.fromWeb(o.body),l.createWriteStream(m)),l.renameSync(m,a)}catch(u){try{l.unlinkSync(m)}catch{}throw u}}function Q(e){return new Promise((a,o)=>{let m=J.createHash("sha256"),u=l.createReadStream(e);u.on("data",R=>m.update(R)),u.on("error",o),u.on("end",()=>a(m.digest("hex")))})}function X(e,a){return new Promise((o,m)=>{let u=G("tar",["-xzf",e,"-C",a],{stdio:["ignore","inherit","inherit"]});u.on("error",m),u.on("exit",R=>{R===0?o():m(new Error(`tar exited with code ${R}`))})})}var Z="https://contrast.dev",he="https://sootsim.com/changelog",ee={id:"sootsim",defaultCdnOrigin:Z,manifestPath:"/runtimes/manifest.json",tarballPath:e=>`/runtimes/sootsim-runtime-${e}.tar.gz`,installedMarker:"index.html",env:{cdnOrigin:"SOOTSIM_CDN_ORIGIN",channel:"SOOTSIM_RUNTIME_CHANNEL",pin:"SOOTSIM_RUNTIME_VERSION"},ensureHome:_,configFile:A,runtimesDir:N,runtimeDir:U,cacheDir:L,readActiveRuntime:E,writeActiveRuntime:F},Re=j(ee);export{k as a,Z as b,he as c,Re as d};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as F,d as M}from"./chunk-E5KAJLCE.js";import{c as H}from"./chunk-P7WHR67J.js";import{g as R,j as L,r as U,s as x,t as O}from"./chunk-GPEFE36K.js";import{a as j}from"./chunk-BVG6UDMP.js";import{execFileSync as Q,spawnSync as a}from"child_process";import{existsSync as l,mkdirSync as E,readFileSync as it,realpathSync as at,rmSync as h,writeFileSync as q}from"fs";import{homedir as b}from"os";import{basename as ct,dirname as C,resolve as u,sep as W}from"path";import{execFileSync as Z}from"child_process";import{chmodSync as tt,mkdirSync as A,rmSync as et,writeFileSync as I}from"fs";import{dirname as _}from"path";var rt="dev.sootsim.daemon",V="SootSim Daemon",Y="0.1.36";function G(t,e,r){let n=x(),o=O(),i=_(_(o)),c=_(o),p=`${i}/Resources`;et(n,{recursive:!0,force:!0}),A(U(),{recursive:!0}),A(c,{recursive:!0}),A(p,{recursive:!0}),I(`${i}/Info.plist`,ot()),I(`${i}/PkgInfo`,"APPL????"),I(o,nt(t,e,r)),tt(o,493);try{Z("codesign",["--force","--sign","-","--deep",n],{stdio:"pipe"})}catch(s){let f=s instanceof Error?s.message:String(s);console.warn(` warning: ad-hoc codesign of ${n} failed: ${f}
|
|
3
|
+
the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:n,launcherPath:o}}function ot(){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
4
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
5
|
+
<plist version="1.0">
|
|
6
|
+
<dict>
|
|
7
|
+
<key>CFBundleDevelopmentRegion</key><string>en</string>
|
|
8
|
+
<key>CFBundleDisplayName</key><string>${V}</string>
|
|
9
|
+
<key>CFBundleExecutable</key><string>sootsim-daemon</string>
|
|
10
|
+
<key>CFBundleIdentifier</key><string>${rt}</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
|
|
12
|
+
<key>CFBundleName</key><string>${V}</string>
|
|
13
|
+
<key>CFBundlePackageType</key><string>APPL</string>
|
|
14
|
+
<key>CFBundleShortVersionString</key><string>${Y}</string>
|
|
15
|
+
<key>CFBundleSignature</key><string>????</string>
|
|
16
|
+
<key>CFBundleVersion</key><string>${Y}</string>
|
|
17
|
+
<key>LSBackgroundOnly</key><true/>
|
|
18
|
+
<key>LSUIElement</key><true/>
|
|
19
|
+
<key>LSMinimumSystemVersion</key><string>13.0</string>
|
|
20
|
+
<key>NSHumanReadableCopyright</key><string>Tamagui LLC</string>
|
|
21
|
+
</dict>
|
|
22
|
+
</plist>
|
|
23
|
+
`}function nt(t,e,r){let o=[t.executable,...t.prefixArgs,"serve","--quiet","--port",String(e)].map(T).join(" "),i=T(r.stdout),c=T(r.stderr);return`#!/bin/sh
|
|
24
|
+
# SootSim Daemon launcher \u2014 auto-generated by 'sootsim setup'.
|
|
25
|
+
# launchd spawns this; we exec the real sootsim invocation in place so
|
|
26
|
+
# launchd tracks the daemon process, not the shell wrapper.
|
|
27
|
+
#
|
|
28
|
+
# stdout: ${r.stdout}
|
|
29
|
+
# stderr: ${r.stderr}
|
|
30
|
+
# a missing or broken executable can make launchd retry forever. truncate a
|
|
31
|
+
# retry log before it passes 10 MiB so that failure stays bounded on disk.
|
|
32
|
+
for log_path in ${i} ${c}; do
|
|
33
|
+
if [ -f "$log_path" ]; then
|
|
34
|
+
log_bytes=$(wc -c < "$log_path" 2>/dev/null || echo 0)
|
|
35
|
+
if [ "$log_bytes" -gt 10485760 ]; then
|
|
36
|
+
: > "$log_path"
|
|
37
|
+
fi
|
|
38
|
+
fi
|
|
39
|
+
done
|
|
40
|
+
exec ${o}
|
|
41
|
+
`}function T(t){return`'${t.replace(/'/g,"'\\''")}'`}var z=60,y="dev.sootsim.daemon",N="dev.sootsim.server",g="sootsim-daemon",m=u(b(),"Library/Logs/sootsim"),D=u(b(),".local/state/sootsim");async function Yt(t,e={}){let[r,...n]=t,o=e.port??7668;if(!r||r==="--help"||r==="-h"){K();return}new Set(["install","uninstall","restart","start","stop","logs"]).has(r)&&F({event:`daemon_${r}`,properties:{platform:process.platform,subsource:"daemon"}});try{switch(r){case"install":return await bt({port:o,force:n.includes("--force")});case"uninstall":return await St();case"status":return await kt();case"restart":return await xt();case"start":return await Dt();case"stop":return await Et();case"logs":return await Pt(n);default:console.error(` unknown daemon subcommand: ${r}`),K(),process.exit(1)}}finally{await M()}}function K(){H("daemon")}function lt(){let t=ut();if(t)return t;let e=gt();return{executable:process.execPath,prefixArgs:[e]}}function ut(){if(!pt())return null;let t=dt();if(!t)return null;let e=j(),r=e==="0.0.0"?"sootsim":`sootsim@${e}`;return{executable:process.execPath,prefixArgs:[t,"exec","--yes","--package",r,"--","sootsim"]}}function pt(){let t=process.argv[1];return process.env.npm_command==="exec"?!0:t?P(t).includes(`${W}_npx${W}`):!1}function dt(){try{let e=Q("which",["npm"],{encoding:"utf8"}).trim();if(e&&l(e))return X(e)}catch{}let t=process.env.npm_execpath;return t&&l(t)?X(t):null}function X(t){let e=P(t);if(ct(e)==="npx-cli.js"){let r=u(C(e),"npm-cli.js");if(l(r))return r}return e}function gt(){try{let e=Q("which",["sootsim"],{encoding:"utf8"}).trim();if(e&&l(e))return P(e)}catch{}let t=process.argv[1];if(t&&l(t))return P(t);throw new Error("could not locate the sootsim binary")}function P(t){try{return at(t)}catch{return t}}function mt(t,e){E(m,{recursive:!0});let r=u(m,"bridge.out.log"),n=u(m,"bridge.err.log"),{launcherPath:o}=G(t,e,{stdout:r,stderr:n}),i=` <string>${ht(o)}</string>`;return`<?xml version="1.0" encoding="UTF-8"?>
|
|
42
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
43
|
+
<plist version="1.0">
|
|
44
|
+
<dict>
|
|
45
|
+
<key>Label</key><string>${y}</string>
|
|
46
|
+
<key>ProgramArguments</key>
|
|
47
|
+
<array>
|
|
48
|
+
${i}
|
|
49
|
+
</array>
|
|
50
|
+
<key>RunAtLoad</key><true/>
|
|
51
|
+
<key>KeepAlive</key><true/>
|
|
52
|
+
<key>ThrottleInterval</key><integer>${z}</integer>
|
|
53
|
+
<key>ProcessType</key><string>Background</string>
|
|
54
|
+
<key>StandardOutPath</key><string>${r}</string>
|
|
55
|
+
<key>StandardErrorPath</key><string>${n}</string>
|
|
56
|
+
</dict>
|
|
57
|
+
</plist>
|
|
58
|
+
`}function ft(t,e){return E(D,{recursive:!0}),`[Unit]
|
|
59
|
+
Description=sootsim bridge daemon
|
|
60
|
+
After=default.target
|
|
61
|
+
|
|
62
|
+
[Service]
|
|
63
|
+
Type=simple
|
|
64
|
+
ExecStart=${[t.executable,...t.prefixArgs].map(yt).join(" ")} serve --quiet --port ${e}
|
|
65
|
+
Restart=always
|
|
66
|
+
RestartSec=${z}
|
|
67
|
+
|
|
68
|
+
[Install]
|
|
69
|
+
WantedBy=default.target
|
|
70
|
+
`}function ht(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function yt(t){return/[^\w@%+=:,./-]/.test(t)?`'${t.replace(/'/g,"'\\''")}'`:t}function w(){return u(b(),"Library/LaunchAgents",`${y}.plist`)}function $t(t=b()){return u(t,"Library/LaunchAgents",`${N}.plist`)}function S(){return u(b(),".config/systemd/user",`${g}.service`)}function Gt(){if(L())return{supported:!1,installed:!1};if(process.platform==="darwin"){let t=w();return{supported:!0,installed:l(t),path:t}}if(process.platform==="linux"){let t=S();return{supported:!0,installed:l(t),path:t}}return{supported:!1,installed:!1}}async function bt({port:t,force:e}){if(L())throw new Error("background daemon setup is unavailable in this environment");let r=lt();if(console.log(` binary: ${[r.executable,...r.prefixArgs].join(" ")}`),console.log(` port: ${t}`),process.platform==="darwin"){J().missing||console.log(` removed legacy ${N} service`);let o=w();if(l(o)&&!e){console.log(` already installed at ${o}`),console.log(" pass --force to overwrite, or use 'sootsim daemon restart' to reload");return}E(C(o),{recursive:!0}),q(o,mt(r,t)),console.log(` wrote ${o}`);let i=`gui/${process.getuid()}`,c=`${i}/${y}`,p=()=>{let d=a("launchctl",["bootstrap",i,o],{stdio:"pipe",encoding:"utf8"}),k=(d.stderr||d.stdout||"").trim();if(d.status!==0)return{ok:!1,reason:`bootstrap exit ${d.status}${k?`: ${k}`:""}`};let B=a("launchctl",["print",c],{encoding:"utf8"});return B.status!==0?{ok:!1,reason:`bootstrap returned 0 but service not registered (print exit ${B.status})`}:{ok:!0}},s=p();if(!s.ok){let d=s.reason;if(a("launchctl",["bootout",c],{stdio:"ignore"}),s=p(),!s.ok)throw new Error(`launchctl bootstrap failed: ${s.reason}`+(d!==s.reason?` (initial: ${d})`:"")+" \u2014 try `sootsim daemon uninstall` then retry, or reboot if launchd state is stuck.")}let f=Date.now()+4e3,$,v;for(;Date.now()<f;){let d=a("launchctl",["print",c],{encoding:"utf8"});if(d.status===0&&($=d.stdout?.match(/state\s*=\s*(\w+)/)?.[1],v=d.stdout?.match(/pid\s*=\s*(\d+)/)?.[1],$==="running"||v))break;await new Promise(k=>setTimeout(k,150))}if($!=="running"&&!v)throw new Error(`daemon registered but did not reach running state within 4s (last state: ${$||"unknown"}). check ${u(m,"bridge.err.log")} \u2014 typically a stale runtime or a port already bound by another process.`);console.log(` registered (state: ${$||"unknown"}${v?`, pid ${v}`:""}, log: ${u(m,"bridge.err.log")})`);return}if(process.platform==="linux"){let n=S();if(l(n)&&!e){console.log(` already installed at ${n}`),console.log(" pass --force to overwrite, or use 'sootsim daemon restart' to reload");return}E(C(n),{recursive:!0}),q(n,ft(r,t)),console.log(` wrote ${n}`);let o=a("systemctl",["--user","daemon-reload"],{stdio:"pipe",encoding:"utf8"});if(o.status!==0){let s=(o.stderr||o.stdout||"").trim();throw new Error(`systemctl daemon-reload failed${s?`: ${s}`:""}`)}let i=a("systemctl",["--user","enable","--now",g],{stdio:"pipe",encoding:"utf8"});if(i.status!==0){let s=(i.stderr||i.stdout||"").trim();throw new Error(`systemctl enable --now failed${s?`: ${s}`:""} \u2014 try \`sootsim daemon uninstall\` then retry.`)}let p=(a("systemctl",["--user","is-active",g],{encoding:"utf8"}).stdout||"").trim()||"unknown";console.log(` registered (state: ${p}, journalctl --user -u ${g} to tail logs)`);try{let s=process.env.USER||process.env.LOGNAME||"";if(s){let f=a("loginctl",["show-user",s,"--property=Linger","--value"],{encoding:"utf8"});!((f.stdout||"").trim().toLowerCase()==="yes")&&f.status===0&&console.log(` note: linger is not enabled for "${s}". the daemon will exit at logout.
|
|
71
|
+
enable persistence with: sudo loginctl enable-linger ${s}`)}}catch{}return}console.error(` background daemon is not supported on ${process.platform}`),console.error(" run 'sootsim serve' in a persistent shell instead"),process.exit(1)}function J(t={}){let e=t.userHome??b(),r=$t(e),n=u(e,"Library/Logs/sootsim"),o=[];if(l(r)){let i=`${t.launchTarget??`gui/${process.getuid?.()??0}`}/${N}`;(t.bootout??(p=>{a("launchctl",["bootout",p],{stdio:"ignore"})}))(i),h(r,{force:!0}),o.push(r)}for(let i of["server.err.log","server.out.log"]){let c=u(n,i);l(c)&&(h(c,{force:!0}),o.push(c))}return{removed:o,missing:o.length===0}}function vt(){let t=[];if(process.platform==="darwin"){let e=J();t.push(...e.removed);let r=w();l(r)&&(a("launchctl",["bootout",`gui/${process.getuid()}/${y}`],{stdio:"ignore"}),h(r,{force:!0}),t.push(r));let n=x();return l(n)&&(h(n,{recursive:!0,force:!0}),t.push(n)),l(m)&&(h(m,{recursive:!0,force:!0}),t.push(m)),{removed:t,missing:t.length===0}}if(process.platform==="linux"){let e=S();return l(e)&&(a("systemctl",["--user","disable","--now",g],{stdio:"ignore"}),h(e,{force:!0}),a("systemctl",["--user","daemon-reload"],{stdio:"ignore"}),a("systemctl",["--user","reset-failed",g],{stdio:"ignore"}),t.push(e)),l(D)&&(h(D,{recursive:!0,force:!0}),t.push(D)),{removed:t,missing:t.length===0}}return{removed:t,missing:!0}}function wt(){let t=[],e=R();return l(e)&&(h(e,{recursive:!0,force:!0}),t.push(e)),{removed:t,missing:t.length===0}}async function St(){let t=vt();for(let r of t.removed)console.log(` removed ${r}`);let e=wt();for(let r of e.removed)console.log(` removed ${r}`);t.missing&&e.missing&&console.log(" not installed")}async function kt(){if(process.platform==="darwin"){let t=w();if(!l(t)){console.log(" installed: no");return}console.log(` installed: yes (${t})`);let e=Lt(t);e&&console.log(` binary: ${e}`);let r=a("launchctl",["print",`gui/${process.getuid()}/${y}`],{encoding:"utf8"});if(r.status===0){let n=r.stdout.match(/state\s*=\s*(\w+)/)?.[1],o=r.stdout.match(/pid\s*=\s*(\d+)/)?.[1];console.log(` state: ${n||"unknown"}${o?` (pid ${o})`:""}`)}else console.log(" state: not running");return}if(process.platform==="linux"){let t=S();if(!l(t)){console.log(" installed: no");return}console.log(` installed: yes (${t})`);let e=a("systemctl",["--user","is-active",g],{encoding:"utf8"});console.log(` state: ${e.stdout.trim()||"unknown"}`);return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function xt(){if(process.platform==="darwin"){let t=w();l(t)||(console.error(" daemon not registered \u2014 run `sootsim setup`"),process.exit(1));let e=a("launchctl",["kickstart","-k",`gui/${process.getuid()}/${y}`],{stdio:"pipe",encoding:"utf8"});e.status!==0&&(console.error(` kickstart failed: ${e.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}if(process.platform==="linux"){let t=S();l(t)||(console.error(" daemon not registered \u2014 run `sootsim setup`"),process.exit(1));let e=a("systemctl",["--user","restart",g],{stdio:"pipe",encoding:"utf8"});e.status!==0&&(console.error(` restart failed: ${e.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Dt(){if(process.platform==="darwin"){a("launchctl",["kickstart",`gui/${process.getuid()}/${y}`],{stdio:"inherit"});return}if(process.platform==="linux"){a("systemctl",["--user","start",g],{stdio:"inherit"});return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Et(){if(process.platform==="darwin"){a("launchctl",["bootout",`gui/${process.getuid()}/${y}`],{stdio:"inherit"});return}if(process.platform==="linux"){a("systemctl",["--user","stop",g],{stdio:"inherit"});return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function Pt(t){let e=t.find(o=>/^-n\d+$|^--lines=\d+$|^\d+$/.test(o)),r=e?Number(e.replace(/\D/g,"")):200,n=t.includes("-f")||t.includes("--follow");if(process.platform==="darwin"){let o=u(m,"bridge.out.log"),i=u(m,"bridge.err.log"),c=[o,i].filter(s=>l(s));c.length===0&&(console.error(` no daemon logs yet at ${m} \u2014 run \`sootsim setup\` to install the daemon`),process.exit(1));let p=n?["-n",String(r),"-F",...c]:["-n",String(r),...c];a("tail",p,{stdio:"inherit"});return}if(process.platform==="linux"){let o=`${g}.service`,i=["--user","-u",o,"-n",String(r),"--no-pager"],c=a("journalctl",n?[...i,"-f"]:i,{encoding:"utf8",stdio:n?"inherit":"pipe"});if(n)return;let p=`${c.stdout||""}${c.stderr||""}`,s=/insufficient permissions|No journal files were opened/i.test(p);if(c.status===0&&!s){process.stdout.write(c.stdout||"");return}let f=a("journalctl",[`_SYSTEMD_USER_UNIT=${o}`,"-n",String(r),"--no-pager"],{encoding:"utf8"});if(f.status===0&&(f.stdout||"").trim()){process.stdout.write(f.stdout);return}console.error(` could not read --user journal for ${o} (this user isn't in the systemd-journal group yet).
|
|
72
|
+
run: sudo journalctl _SYSTEMD_USER_UNIT=${o} -n ${r} --no-pager`),process.exit(1)}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}function Lt(t){try{return it(t,"utf8").match(/<array>\s*<string>([^<]+)<\/string>/)?.[1]||null}catch{return null}}export{Yt as a,Gt as b,bt as c,J as d,vt as e,wt as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as K,b as V,c as Ne}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as K,b as V,c as Ne}from"./chunk-GXDDHTOJ.js";import{c as Pe}from"./chunk-M7PUH4OV.js";import{d as _e}from"./chunk-7O7ECDP6.js";import{d as Oe}from"./chunk-LISO377N.js";import{g as $e,i as Fe,k as B}from"./chunk-6CZJDONZ.js";import{c as Ue,d as E}from"./chunk-E5KAJLCE.js";import{a as Ae}from"./chunk-C4O44UV2.js";import{createHash as St}from"crypto";import{readFileSync as M}from"fs";import je from"path";import{gzipSync as ge,gunzipSync as vt}from"zlib";function Ce(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}import{brotliCompressSync as ut,constants as ct}from"node:zlib";var dt=9;function Le(e){return ut(e,{params:{[ct.BROTLI_PARAM_QUALITY]:dt}})}function ce(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function pt(e){let t=ce(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${s.slice(0,200)}`)}}async function mt(e,t=8,r){let s=0,o=0,i=e.length;await Promise.all(Array.from({length:Math.min(t,i)},async()=>{for(;s<i;){let l=e[s++];await pt(l),o++,r?.(o,i)}}))}function ft(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let i of e.files){let l=r.get(i.urlhash);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.timeline&&s?.timelineBytes&&o.push({url:e.timeline.putUrl,contentType:e.timeline.contentType,bytes:s.timelineBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),e.failureBundle&&s?.failureBundleBytes&&o.push({url:e.failureBundle.putUrl,contentType:e.failureBundle.contentType,bytes:s.failureBundleBytes});for(let i of e.snapshots??[]){let l=s?.snapshotBytes?.get(i.id);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}return o}function gt(e){return e.replace(/\/+$/,"")}var W=class extends Error{constructor(r,s,o,i=""){super(r);this.status=s;this.phase=o;this.responseText=i;this.name="PresignedUploadError"}};async function ze(e){let t=gt(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-contrast-admin-upload-bypass"]=e.adminBypassToken);let s=ce(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let T=await o.text().catch(()=>"");throw new W(`init failed: ${o.status} ${T.slice(0,200)}`,o.status,"init",T)}let i=await o.json(),l=ft(i,e.bundleBytes,e.filesByHash,e.extras);await mt(l,e.concurrency??8,e.onPutProgress);let m=ce(3e4,"finalize"),c;try{c=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:i.token}),signal:m.signal})}finally{m.cancel()}if(!c.ok){let T=await c.text().catch(()=>"");throw new W(`finalize failed: ${c.status} ${T.slice(0,200)}`,c.status,"finalize",T)}let h=await c.json();return{init:i,finalize:h}}function ht(e){return e!==null&&typeof e=="object"?e:null}function De(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function de(e){let t=ht(e);return t?t.schemaVersion===1&&De(t.t)!==void 0&&De(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function yt(e,t){let r=[];for(let s of e.split(`
|
|
3
3
|
`)){let o=s.trim();if(o)try{let i=JSON.parse(o);t(i)&&r.push(i)}catch{}}return r}function He(e){return yt(e,de)}import{execSync as bt}from"child_process";function me(e){try{return bt(e,{stdio:["ignore","pipe","ignore"],timeout:3e3,encoding:"utf8"}).trim()||null}catch{return null}}function pe(e){let t=e?.trim();return!t||!/^\d+$/.test(t)?null:Number(t)}function wt(){let e=me("git remote get-url origin");if(!e)return null;let t=e.match(/github\.com[/:]([^/\s]+)\/([^/\s]+?)(?:\.git)?\/?$/i);return t?{owner:t[1],repo:t[2]}:null}function fe(){let e=process.env.GITHUB_ACTIONS==="true",t=process.env.CONTRAST_BRANCH?.trim()||null,r=process.env.CONTRAST_SHA?.trim()||null,s=process.env.CONTRAST_PR_TITLE?.trim()||null,o=(process.env.CONTRAST_REPO||process.env.GITHUB_REPOSITORY||"").trim(),[i,l]=o.includes("/")?o.split("/",2):[null,null];if(e){let h=process.env.GITHUB_REF?.match(/^refs\/pull\/(\d+)\//)?.[1];return{owner:i,repo:l,branch:t||process.env.GITHUB_HEAD_REF?.trim()||process.env.GITHUB_REF_NAME?.trim()||null,commitSha:r||process.env.GITHUB_SHA?.trim()||null,githubUsername:process.env.GITHUB_ACTOR?.trim()||null,pullRequestNumber:pe(process.env.CONTRAST_PR_NUMBER)??pe(h),pullRequestTitle:s,githubRunId:process.env.GITHUB_RUN_ID?.trim()||null,source:"ci"}}let m=t??me("git rev-parse --abbrev-ref HEAD"),c=i?null:wt();return{owner:i??c?.owner??null,repo:l??c?.repo??null,branch:m==="HEAD"?null:m,commitSha:r??me("git rev-parse HEAD"),githubUsername:null,pullRequestNumber:pe(process.env.CONTRAST_PR_NUMBER),pullRequestTitle:s,githubRunId:null,source:"cli"}}function Yt(e){if(e.length===0)return{stepCount:null,failedStepIndex:null};let t=e.find(r=>r.status==="failure");return{stepCount:e.length,failedStepIndex:t?t.stepIndex:null}}function Qt(e){return e.auth?e.uploadedShare?!0:e.auth.kind==="github"||process.env.GITHUB_ACTIONS==="true":!1}async function Xt(e){let t=e.auth??K();if(!t)return null;let r=fe(),s=e.owner??(t.kind==="github"?t.owner:null)??r.owner,o=e.repo??(t.kind==="github"?t.repo:null)??r.repo;try{let i=await fetch(`${e.origin.replace(/\/$/,"")}/api/sootsim/test-runs`,{method:"POST",headers:{"content-type":"application/json",authorization:V(t)},body:JSON.stringify({kind:e.kind,source:r.source,name:e.name??void 0,prompt:e.prompt??void 0,summary:e.summary??void 0,status:e.status,failureMessage:e.failureMessage??void 0,previewShareId:e.previewShareId??void 0,owner:s??void 0,repo:o??void 0,branch:r.branch??void 0,commitSha:r.commitSha??void 0,githubUsername:r.githubUsername??void 0,pullRequestNumber:r.pullRequestNumber??void 0,githubRunId:r.githubRunId??void 0,stepCount:e.stepCount??void 0,failedStepIndex:e.failedStepIndex??void 0,durationMs:e.durationMs??void 0,flowYamlSizeBytes:e.flowYamlSizeBytes??void 0})});if(!i.ok){let m=await i.text().catch(()=>"");return console.warn(` warn: run registration failed: /api/sootsim/test-runs ${i.status}${m?`: ${m.slice(0,200)}`:""}`),null}let l=await i.json();return l.run?.id?{id:l.run.id,previewUrl:l.run.previewUrl??null,traceUrl:l.run.traceUrl??null}:(console.warn(" warn: run registration returned no id"),null)}catch(i){return console.warn(` warn: run registration failed: ${i instanceof Error?i.message:String(i)}`),null}}function Rt(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}function xt(e){let t=JSON.parse(M(e,"utf8"));if(!Array.isArray(t))throw new Error("snapshot manifest must be an array");let r=new Set;return t.map((s,o)=>{if(s===null||typeof s!="object")throw new Error(`snapshot manifest entry ${o} must be an object`);let i=Reflect.get(s,"id"),l=Reflect.get(s,"label"),m=Reflect.get(s,"path"),c=Reflect.get(s,"t");if(typeof i!="string"||!i||r.has(i))throw new Error(`snapshot manifest entry ${o} has an invalid or duplicate id`);if(typeof m!="string"||!m)throw new Error(`snapshot manifest entry ${o} has no PNG path`);if(typeof c!="number"||!Number.isFinite(c)||c<0)throw new Error(`snapshot manifest entry ${o} has an invalid capture time`);r.add(i);let h=M(m);return{meta:{id:i,label:typeof l=="string"&&l?l:i,kind:"interaction",t:Math.round(c),contentType:"image/png",sizeBytes:h.byteLength},bytes:h}})}var Ve=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://contrast.dev",We=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",ye="https://contrast.localhost:3000",kt=2e3;async function Et(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${ye}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(kt)});if(t.ok||t.status===204||t.status===405)return ye}catch{}return Ve}function N(e){return e.replace(/\/$/,"")}function Bt(e){try{let r=new URL(e).hostname.replace(/^\[|\]$/g,"").toLowerCase();return r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r)}catch{return!1}}function It(e){try{let t=new URL(e).hostname.toLowerCase();return t==="contrast.dev"||t.endsWith(".contrast.dev")}catch{return!1}}function At(e,t){return t?N(t):process.env.SOOTSIM_PREVIEW_ORIGIN?N(process.env.SOOTSIM_PREVIEW_ORIGIN):Bt(e)?N(e):It(e)?N(We):N(e)}function Ut(){console.log(`
|
|
4
4
|
sootsim record upload \u2014 publish the current recorded bundle as a /preview/<id> link
|
|
5
5
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{k as n}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{k as n}from"./chunk-XRWQYYRY.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
|
|
3
3
|
`)}export{g as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as de}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as de}from"./chunk-YWUKWQC6.js";import{b as Rt,c as Pt,k as At}from"./chunk-WGBXASPC.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 Et}from"./chunk-QJR4A3AT.js";import{A as $t,B as xt,E as St,G as vt,I as ue,J as kt,P as Le,a as ke,b as rt,c as it,d as at,e as lt,f as ct,g as dt,h as ut,i as pt,j as mt,k as Be,l as Ce,q as je,r as ft,s as gt,t as ge,u as yt,v as _e,w as qe,x as ht,y as bt,z as wt}from"./chunk-JDS7NQGJ.js";import{e as _t,g as It,i as Tt,j as Mt,k as Nt,l as ce}from"./chunk-6CZJDONZ.js";import{a as ot}from"./chunk-XYVOQPAW.js";import{a as Q}from"./chunk-SGIRBGTQ.js";import{c as st}from"./chunk-ZEJWSA35.js";import{c as nt}from"./chunk-6YYWSTTR.js";import{c as Ae,e as De}from"./chunk-IIURCDJE.js";function We(e){return`(async () => {
|
|
3
3
|
const bridge = globalThis.SootSim && globalThis.SootSim.bridges && globalThis.SootSim.bridges.hotRemount
|
|
4
4
|
if (!bridge || typeof bridge.reloadExternalApp !== 'function') return false
|
|
5
5
|
await bridge.reloadExternalApp({ resetStorage: ${e?"true":"false"} })
|
|
@@ -588,7 +588,7 @@ import{a as de}from"./chunk-6SLQ3G7E.js";import{b as Rt,c as Pt,k as At}from"./c
|
|
|
588
588
|
`);console.log(`${o??""}
|
|
589
589
|
|
|
590
590
|
${n}
|
|
591
|
-
`),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-
|
|
591
|
+
`),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-4IJ7OIKZ.js"),r=await n(["recent",...o],t);process.exitCode=r;return}if(p==="do"&&f==="scan"){let{runCamera:x}=await import("./camera-H6SDZMVF.js");await x(i,{port:t.port});return}if(f==="list"&&i.some(x=>x==="--drivers"||x==="-D")){let{buildDriverListRows:x}=await import("./drivers-MXV3L74Q.js"),o=x();console.log(` available drivers (${o.length}):
|
|
592
592
|
`);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",E=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.
|
|
593
593
|
`)}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:`(() => ({
|
|
594
594
|
console: ${_e},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var c="sootsim-agent-prompt-v1";function r(n){return typeof n=="string"?n.trim():""}function m(n){let e=r(n.text);if(!e)return"";let t=r(n.displayText),s=r(n.inspectSummary),o=r(n.inspectTrace);return!!s||!!o||/[\r\n]/.test(e)||!!t&&t!==e?JSON.stringify({__sootsimAgentPrompt:c,text:e,displayText:t,inspectSummary:s,inspectTrace:o}):e}function u(n){let e=r(n);if(!e)return null;try{let t=JSON.parse(e);if(t.__sootsimAgentPrompt!==c)return{text:e};let s=r(typeof t.text=="string"?t.text:void 0);if(!s)return null;let o=r(typeof t.displayText=="string"?t.displayText:void 0),i=r(typeof t.inspectSummary=="string"?t.inspectSummary:void 0),p=r(typeof t.inspectTrace=="string"?t.inspectTrace:void 0);return{text:s,...o?{displayText:o}:{},...i?{inspectSummary:i}:{},...p?{inspectTrace:p}:{}}}catch{return{text:e}}}export{m as a,u as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{c as b}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as b}from"./chunk-ZEJWSA35.js";import{b as L,e as T,g as E}from"./chunk-6YYWSTTR.js";import{K as S,L as I,M as B,N as P,g as A}from"./chunk-GPEFE36K.js";import{WebSocket as $}from"ws";var W=null;function O(){let i=A();if(W?.homeDir===i)return W.world;let r=U();return W={homeDir:i,world:r},r}function U(){let i=I();if(i&&P(i))return{source:"dev-bridge",bridgePort:i.bridgePort,shellBaseUrl:i.shellPort?`http://localhost:${i.shellPort}/`:b};let r=S();return r&&B(r)?{source:"daemon",bridgePort:r.bridgePort,shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:b}:{source:"default",bridgePort:7668,shellBaseUrl:b}}function _(i){let r=I();if(r&&P(r)&&r.bridgePort===i)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:b};let e=S();return e&&B(e)&&e.bridgePort===i?{source:"daemon",shellBaseUrl:e.runtimePort>0?`http://localhost:${e.runtimePort}/`:b}:null}function K(i){let r;try{let l=new URL(i);r=l.port?Number(l.port):l.protocol==="https:"?443:80}catch{return null}if(!Number.isFinite(r)||r<=0)return null;let e=I();if(e&&P(e)&&(e.shellPort===r||e.runtimePort===r||e.bridgePort===r))return e.bridgePort;let d=S();return d&&B(d)&&(d.runtimePort===r||d.bridgePort===r)?d.bridgePort:null}function D(){return O().bridgePort}function Q(i,r){let e=_(i),d=e?.source==="dev-bridge"?"dev bridge":e?.source==="daemon"?"daemon bridge":"bridge",l=e?`${e.source}.json`:"no lockfile",t=r??e?.shellBaseUrl;process.stderr.write(` \u2192 ${d} :${i} (${t?`shell ${t}, `:""}${l})
|
|
3
3
|
`)}var C=class extends Error{lock;constructor(r,e){super(r),this.name="BridgeSimLockedError",this.lock=e}};function N(i){return i==="flag"?"via --sim":i==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function z(i,r={}){let e=new Set,d=r.port??D(),l=r.commandTimeoutMs??15e3,t,u="none",v=new Set(r.stripBooleanFlags??[]),y=new Set(r.stripValueFlags??[]);for(let n=0;n<i.length;n++){let a=i[n];if(a==="--port"||a==="-p"){e.add(n),n+1<i.length&&(e.add(n+1),d=Number(i[n+1])),n++;continue}if(a.startsWith("--port=")){e.add(n),d=Number(a.slice(7));continue}if(a==="--timeout"){e.add(n),n+1<i.length&&(e.add(n+1),l=Number(i[n+1])),n++;continue}if(a==="--sim"||a==="--session"||a==="--tab"){e.add(n),n+1<i.length&&(e.add(n+1),t=i[n+1]?.trim()||void 0,u="flag"),n++;continue}let s=a.startsWith("--sim=")?a.slice(6):a.startsWith("--session=")?a.slice(10):a.startsWith("--tab=")?a.slice(6):void 0;if(s!==void 0){e.add(n),t=s.trim()||void 0,u="flag";continue}if(v.has(a)){e.add(n);continue}y.has(a)&&(e.add(n),n+1<i.length&&e.add(n+1),n++)}if(!t){let n=T();n&&(t=n.trim()||void 0,u="saved")}return{positional:i.filter((n,a)=>!e.has(a)),wsPort:d,simId:t,simIdSource:u,commandTimeoutMs:l}}function R(i,r={}){let e=1,d=r.commandTimeoutMs??15e3,l=new Map,t=new $(`ws://localhost:${i}`),u=L(),v=new Promise((s,o)=>{t.on("open",()=>{try{t.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:u.key,cliIdentitySource:u.source,cliLabel:r.cliLabel}))}catch{}s()}),t.on("error",c=>{let m=c.message?`: ${c.message}`:"";o(new Error(`could not connect to ws://localhost:${i}${m}`))})}),y=!1,n=!1;function a(s,o){if(n||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;n=!0;let c=o??"primary",m=N(o?r.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${m})
|
|
4
4
|
`)}return t.on("message",s=>{let o;try{o=JSON.parse(s.toString())}catch{return}if(o.id===0)return;let c=l.get(o.id);c&&(l.delete(o.id),o._otherCliCount>0&&!y&&(y=!0,process.stderr.write(`
|
|
5
5
|
\u26A0 ${o._otherCliCount} other CLI identity/identities are driving this sim
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var o=!0,e="public beta",t=e,n="we send anonymous error and dependency data while you use it";export{o as a,e as b,t as c,n as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as R}from"./chunk-6CZJDONZ.js";import{a as w,b as y,c as b,d as r}from"./chunk-2E7NPIZK.js";import{G as d,H as u,I as $,l as p,z as g}from"./chunk-GPEFE36K.js";import k from"fs";import{WebSocket as x}from"ws";async function H(t,e={}){let[s,...n]=t;if(!s||s==="--help"||s==="-h"){I();return}switch(s){case"install":return S(n,e);case"list":case"ls":return D(n);case"use":return N(n);case"remove":case"rm":return T(n);case"which":case"active":return L();case"pin":return _(n);case"unpin":return C();case"notes":case"changelog":return P(n);default:console.error(` unknown runtime subcommand: ${s}`),I(),process.exit(1)}}function I(){console.log(`
|
|
3
3
|
sootsim runtime \u2014 manage engine runtimes under ~/.sootsim/runtimes/
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -18,7 +18,7 @@ flags:
|
|
|
18
18
|
--set-active=false do not switch active runtime after install
|
|
19
19
|
|
|
20
20
|
environment:
|
|
21
|
-
SOOTSIM_CDN_ORIGIN override the CDN base URL (default: ${
|
|
21
|
+
SOOTSIM_CDN_ORIGIN override the CDN base URL (default: ${y})
|
|
22
22
|
|
|
23
23
|
examples:
|
|
24
24
|
sootsim runtime install
|
|
@@ -26,4 +26,4 @@ examples:
|
|
|
26
26
|
sootsim runtime install --channel beta
|
|
27
27
|
sootsim runtime use 1.2.3
|
|
28
28
|
sootsim runtime notes
|
|
29
|
-
`)}async function S(t,e){let{version:s,flags:n}=U(t),o=n.channel??e.channel??"stable",c=n.force===!0,l=n.setActive!==!1;d(),console.log("sootsim runtime install"),console.log(` cdn: ${r.resolveCdnOrigin()}`);try{let i=await r.install({version:s,channel:o,force:c,setActive:l});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),l&&await m(i.version)}catch(i){console.error(` ${v(i)}`),process.exit(1)}}async function m(t){$(t),console.log(` active: ${t}`),await A(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function A(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:s}=await import("./home-paths-
|
|
29
|
+
`)}async function S(t,e){let{version:s,flags:n}=U(t),o=n.channel??e.channel??"stable",c=n.force===!0,l=n.setActive!==!1;d(),console.log("sootsim runtime install"),console.log(` cdn: ${r.resolveCdnOrigin()}`);try{let i=await r.install({version:s,channel:o,force:c,setActive:l});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),l&&await m(i.version)}catch(i){console.error(` ${v(i)}`),process.exit(1)}}async function m(t){$(t),console.log(` active: ${t}`),await A(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function A(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:s}=await import("./home-paths-W277VF23.js"),n=s();if(!e(n))return!1;let o=R();return new Promise(c=>{let l=!1,i=!1,f=O=>{l||(l=!0,c(O))},a=new x(`ws://127.0.0.1:${o}`,{handshakeTimeout:800}),h=setTimeout(()=>{try{a.close()}catch{}f(i)},1500);a.on("open",()=>{try{a.send(JSON.stringify({type:"runtime:use",version:t,id:0})),i=!0}catch{}setTimeout(()=>{try{a.close()}catch{}},100)}),a.on("close",()=>{clearTimeout(h),f(i)}),a.on("error",()=>{clearTimeout(h),f(!1)})})}async function D(t){d();let e=r.listInstalled(),s=u(),n=r.resolvePin();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let o of e)console.log(` ${o===s?"*":" "} ${o}${o===n?" (pinned)":""}`);n&&!e.includes(n)&&console.log(`pinned: ${n} (not installed \u2014 run \`sootsim runtime install\`)`);try{let o=await r.fetchManifest();console.log("available (latest per channel):");for(let[l,i]of Object.entries(o.channels))console.log(` ${l.padEnd(8)} ${i.latest}`);let c=Object.keys(o.versions).sort(w).reverse();if(c.length>1){console.log("hosted versions:");for(let l of c)console.log(` ${l}`)}}catch(o){console.log(`available: (could not fetch manifest: ${v(o)})`)}}async function N(t){let e=t[0];e||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let s=r.listInstalled();s.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${s.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${e}\` first`),process.exit(1)),await m(e)}async function T(t){let e=t[0];e||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),u()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `sootsim runtime use <other>` first, or install another version"),process.exit(1));let n=p(e);if(!k.existsSync(n)){console.error(` ${e} is not installed`);return}k.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function L(){let t=u();if(!t){console.log(" no active runtime");return}console.log(t)}async function _(t){let e=t[0];if(!e){let n=r.resolvePin();n?console.log(` runtime pinned to ${n}`):(console.log(" no pin \u2014 runtime follows channel latest"),console.log(" usage: sootsim runtime pin <version>"));return}if(g({runtimeVersion:e}),console.log(` pinned runtime to ${e}`),r.listInstalled().includes(e)){u()!==e&&await m(e);return}try{let n=await r.install({version:e,setActive:!1});console.log(n.installed?` installed ${n.version}`:` already installed at ${n.runtimeDir}`),await m(e)}catch(n){console.error(` ${v(n)}`),console.error(` pin saved, but ${e} could not be installed \u2014 check \`sootsim runtime list\` for hosted versions`),process.exit(1)}}async function C(){let t=r.resolvePin();if(!t){console.log(" no pin set");return}g({runtimeVersion:void 0}),console.log(` unpinned (was ${t}) \u2014 runtime follows channel latest again`),console.log(" run `sootsim upgrade` to move to the latest now")}async function P(t){t.length>0&&(console.error(" usage: sootsim runtime notes"),process.exit(1));let e=u();e&&console.log(` active runtime: v${e}`),console.log(` release notes: ${b}`)}function U(t){let e={},s=[];for(let n=0;n<t.length;n++){let o=t[n];if(o==="--channel"&&n+1<t.length){e.channel=t[n+1],n++;continue}if(o.startsWith("--channel=")){e.channel=o.slice(10);continue}if(o==="--force"){e.force=!0;continue}if(o==="--set-active=false"||o==="--no-set-active"){e.setActive=!1;continue}s.push(o)}return{version:s[0]??null,flags:e}}function v(t){return t instanceof Error?t.message:String(t)}export{H as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{existsSync as A,mkdirSync as M,readFileSync as v,rmSync as f,writeFileSync as h}from"fs";import{tmpdir as w}from"os";import{dirname as B,join as $,resolve as U}from"path";import{execFileSync as _}from"child_process";import{readFileSync as b}from"fs";import{createRequire as y}from"module";var c=null,p=null;function m(r){c||(c=T());try{return c(r)}catch{return null}}function C(r){p||(p=O());try{return p(r)}catch{return null}}function O(){if(process.platform==="linux")return r=>{try{return b(`/proc/${r}/comm`,"utf8").trim()||null}catch{return null}};if(process.platform==="darwin"){let r=x();return r||F()}return()=>null}function T(){let r=Number(process.env.PPID);if(Number.isFinite(r)&&r>1&&r!==process.ppid)return()=>r;if(process.platform==="linux")return D();if(process.platform==="darwin"){let n=R();return n||k()}return()=>null}function D(){return r=>{try{let n=b(`/proc/${r}/stat`,"utf8"),t=n.lastIndexOf(")");if(t<0)return null;let e=n.slice(t+1).trim().split(/\s+/),i=Number(e[1]);return Number.isFinite(i)&&i>0?i:null}catch{return null}}}var N=3,l=216,P=16,S=48,L=16;function R(){if(!process.versions?.bun)return null;try{let r=y(import.meta.url),{dlopen:n,FFIType:t}=r("bun:ffi"),e=n("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[t.i32,t.i32,t.u64,t.ptr,t.i32],returns:t.i32}}),i=Buffer.alloc(l);return o=>{if(Number(e.symbols.proc_pidinfo(o,N,0n,i,l))<=0)return null;let u=i.readUInt32LE(P);return u>0?u:null}}catch{return null}}function x(){if(!process.versions?.bun)return null;try{let r=y(import.meta.url),{dlopen:n,FFIType:t}=r("bun:ffi"),e=n("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[t.i32,t.i32,t.u64,t.ptr,t.i32],returns:t.i32}}),i=Buffer.alloc(l);return o=>{if(Number(e.symbols.proc_pidinfo(o,N,0n,i,l))<=0)return null;let u=i.subarray(S,S+L),I=u.indexOf(0);return u.subarray(0,I<0?u.length:I).toString("utf8")||null}}catch{return null}}function F(){return r=>{try{let t=_("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
|
|
3
3
|
`)[1];return t&&t.trim().split(/\s+/)[0]||null}catch{return null}}}function k(){return r=>{try{let t=_("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
|
|
4
4
|
`)[1];if(!t)return null;let e=t.trim().split(/\s+/),i=Number(e[2]);return Number.isFinite(i)&&i>1?i:null}catch{return null}}}var d=1,g="SOOTSIM_CLI_CURRENT_SIM_PATH",V=["SOOTSIM_CLI_IDENTITY","AGENTBUS_SESSION","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"],W=/^(?:tmux|screen)|^tm$/i;function E(r,n=20){let t=r,e=m(r);if(!e||e<=1)return null;for(let i=0;i<n;i++){let o=C(e);if(o&&W.test(o))return t;let s=m(e);if(!s||s<=1)return o?e:t;t=e,e=s}return e}function Y(){for(let n of V){let t=process.env[n];if(t&&t.trim())return{key:`${n}:${t.trim()}`,source:n,stable:!0}}let r=E(process.ppid);return r&&r>1?{key:`gppid-${r}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}function H(){return Y().key}function tr(){return E(process.ppid)}function a(){if(process.env[g])return U(process.env[g]);let r=H();return $(w(),`sootsim-current-sim-${r}.json`)}function J(){let r=a();if(!A(r))return null;try{let n=JSON.parse(v(r,"utf8"));return n.version!==d||typeof n.simId!="string"||!n.simId.trim()||typeof n.updatedAt!="string"?(f(r,{force:!0}),null):{version:d,simId:n.simId.trim(),updatedAt:n.updatedAt}}catch{return f(r,{force:!0}),null}}function nr(){return J()?.simId||null}function er(r){let n=r.trim();if(!n)return;let t=a();M(B(t),{recursive:!0}),h(t,JSON.stringify({version:d,simId:n,updatedAt:new Date().toISOString()},null,2)+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{createHash as b}from"node:crypto";import g from"node:fs";import{createRequire as R}from"node:module";import u from"node:path";var y=/\.(ttf|otf|woff|woff2)$/i;function P(t,n,r){if(!t||typeof t!="object")return;let o=t.fonts;if(Array.isArray(o))for(let i of o)typeof i=="string"&&r.push(i);let e=t[n];if(!e||typeof e!="object")return;let s=e.fonts;if(Array.isArray(s))for(let i of s){if(typeof i=="string"){r.push(i);continue}if(!i||typeof i!="object")continue;let c=i.fontDefinitions;if(Array.isArray(c))for(let a of c){if(!a||typeof a!="object")continue;let p=a.path;typeof p=="string"&&r.push(p)}}}function m(t,n){if(!Array.isArray(t))return[];let r=[];for(let o of t){let e=Array.isArray(o)?o[0]:o;if(typeof e!="string"||!/(^|\/)expo-font$/.test(e))continue;let s=Array.isArray(o)?o[1]??{}:{};P(s,n,r)}return r}function C(t){return t.slice(t.lastIndexOf("/")+1).replace(y,"")}function h(t,n){let r=n.replace(/\/+$/,""),o=new Set,e=[];for(let s of t){let i=s.replace(/^\.\//,"").replace(/^\/+/,"");!i||o.has(i)||(o.add(i),y.test(i)&&e.push({family:C(i),url:`${r}/assets/${i}`}))}return e}var d=R(import.meta.url);function x(t){try{let n=new URL(t),r=n.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r))return n.origin}catch{}return null}var S=["app.config.js","app.config.ts","app.config.cjs","app.config.mjs","app.json"];function w(t){for(let n of S)try{if(g.statSync(u.join(t,n)).isFile())return!0}catch{}return!1}var j=new Set(["node_modules","artifacts","dist","build","out","coverage","tmp","public","ios","android","macos","windows","__fixtures__","__tests__","examples","example"]);function A(t,n){w(t)&&n.push(t);let r;try{r=g.readdirSync(t,{withFileTypes:!0})}catch{return}for(let o of r)o.isDirectory()&&(o.name.startsWith(".")||j.has(o.name)||A(u.join(t,o.name),n))}function _(t){try{return g.statSync(u.join(t,"package.json")).isFile()}catch{return!1}}function I(t){let n=x(t.bundleUrl);if(!n)return[];let r=t.repoDir||process.env.CONTRAST_REPO_DIR,o=r?u.resolve(r):process.cwd();if(!r&&!_(o))return[];let e=[];if(r)A(o,e),e.includes(o)||e.push(o);else{if(!w(o))return[];e.push(o)}if(e.length===0)return[];let s=(t.platform||process.env.CONTRAST_PLATFORM||"ios").toLowerCase(),i=null;try{let l=d.resolve("@expo/config",{paths:[...e,o]}),f=d(l);typeof f.getConfig=="function"&&(i=f.getConfig)}catch{}if(!i)return[];let c;for(let l of e)try{let f=i(l,{skipSDKVersionRequirement:!0});if(f?.exp&&typeof f.exp=="object"){let F=f.exp.plugins;if(Array.isArray(F)){c=f.exp;break}}}catch{}if(!c||typeof c!="object")return[];let a=c.plugins;if(!Array.isArray(a))return[];let p=m(a,s==="android"?"android":"ios");return h(p,n)}async function L(t,n){let r=x(t);if(!r)return null;let o=new AbortController,e=setTimeout(()=>o.abort(),n?.timeoutMs??1500);try{let s=await fetch(`${r}/`,{headers:{"expo-platform":"ios",Accept:"application/json"},signal:o.signal});if(!s.ok)return null;let c=(await s.json())?.extra?.expoClient?._internal?.projectRoot;return typeof c=="string"&&c.length>0?c:null}catch{return null}finally{clearTimeout(e)}}function M(t){return t.map(n=>`${encodeURIComponent(n.url)}::${encodeURIComponent(n.family)}`).join(",")}function k(t){let n=[];for(let r of t.split(",")){let o=r.trim();if(!o)continue;let e=o.indexOf("::"),s=e===-1?o:o.slice(0,e);try{n.push(decodeURIComponent(s))}catch{n.push(s)}}return n.filter(Boolean)}function D(t){let n=(t.split("?")[0].split(".").pop()||"").toLowerCase();return n==="ttf"?"font/ttf":n==="otf"?"font/otf":n==="woff"?"font/woff":n==="woff2"?"font/woff2":"application/octet-stream"}async function N(t,n){let r=[],o=new Set;for(let e of k(t)){let s=b("sha256").update(e).digest("hex");if(!o.has(s)){o.add(s);try{let i=await fetch(e);if(!i.ok){n?.onError?.(e,new Error(`${i.status} ${i.statusText}`));continue}let c=new Uint8Array(await i.arrayBuffer());r.push({url:e,urlhash:s,contentType:D(e),bytes:c}),n?.onStaged?.({url:e,byteLength:c.byteLength})}catch(i){n?.onError?.(e,i)}}}return r}export{I as a,L as b,M as c,N as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{readFileSync as i}from"node:fs";import{fileURLToPath as e}from"node:url";var r=null;function l(){if(r!=null)return r;let o=[()=>e(import.meta.resolve("sootsim/package.json")),()=>e(new URL("../package.json",import.meta.url))];for(let n of o)try{let t=JSON.parse(i(n(),"utf8")).version;if(typeof t=="string"&&t)return r=t,r}catch{}return r="0.0.0",r}export{l as a};
|