sootsim 0.1.183 → 0.1.184
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 +22 -19
- package/dist-cli/bin.js +6 -6
- package/dist-cli/chunks/{agent-AFAFZKMT.js → agent-KSX5D27X.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-MV5WGYCS.js → agent-wrapper-MS6TJF5Y.js} +2 -2
- package/dist-cli/chunks/{app-fonts-ERD5J644.js → app-fonts-HHN6X2VJ.js} +2 -2
- package/dist-cli/chunks/{assert-IBMYHSKD.js → assert-XHVSQZOE.js} +2 -2
- package/dist-cli/chunks/beta-JS4JTDFC.js +2 -0
- package/dist-cli/chunks/{camera-Y6XUIEAP.js → camera-7L7D4XUO.js} +2 -2
- package/dist-cli/chunks/chunk-3KK3YZQ3.js +62 -0
- package/dist-cli/chunks/{chunk-IJMDXS7N.js → chunk-3S5BOWO5.js} +1 -1
- package/dist-cli/chunks/{chunk-AP22KA3Q.js → chunk-53KKDNCU.js} +1 -1
- package/dist-cli/chunks/{chunk-FO3RPGBR.js → chunk-6GC57KRY.js} +2 -2
- package/dist-cli/chunks/{chunk-KSV6H2IC.js → chunk-6MPD3QXA.js} +1 -1
- package/dist-cli/chunks/{chunk-RQDJPT6N.js → chunk-7C6RC3BU.js} +2 -2
- package/dist-cli/chunks/{chunk-WOOWTKM7.js → chunk-7DHLNDOA.js} +1 -1
- package/dist-cli/chunks/{chunk-QF6RJQ2U.js → chunk-7DKGX746.js} +2 -2
- package/dist-cli/chunks/{chunk-BTIARV2B.js → chunk-AKQWG57K.js} +2 -2
- package/dist-cli/chunks/chunk-BB432MX4.js +1 -0
- package/dist-cli/chunks/{chunk-XGVVYY6P.js → chunk-C3WRMMUM.js} +2 -2
- package/dist-cli/chunks/{chunk-W3G5M4UB.js → chunk-FAB5CDE7.js} +3 -3
- package/dist-cli/chunks/{chunk-6GCEDCO5.js → chunk-FD4BKULK.js} +2 -2
- package/dist-cli/chunks/{chunk-C7BIPAXT.js → chunk-ID25RWPE.js} +1 -1
- package/dist-cli/chunks/{chunk-FODJBAWY.js → chunk-IG7F7DTQ.js} +1 -1
- package/dist-cli/chunks/{chunk-YSTCZI6L.js → chunk-IHH3JCV5.js} +1 -1
- package/dist-cli/chunks/{chunk-JR7LKXPB.js → chunk-IZMNFZXZ.js} +1 -1
- package/dist-cli/chunks/{chunk-WN6XO6JV.js → chunk-JFCJIRX6.js} +1 -1
- package/dist-cli/chunks/{chunk-QQDPEM7F.js → chunk-M6RZYHFK.js} +1 -1
- package/dist-cli/chunks/chunk-MFL73VJG.js +2 -0
- package/dist-cli/chunks/{chunk-N2EXJ7HK.js → chunk-MXXD5U6B.js} +2 -2
- package/dist-cli/chunks/{chunk-3JW7SSYR.js → chunk-N5LA5G7V.js} +2 -2
- package/dist-cli/chunks/{chunk-BYKEWDZO.js → chunk-NBF2SXAH.js} +4 -4
- package/dist-cli/chunks/{chunk-SGWTX6CO.js → chunk-NWNFGZSI.js} +2 -2
- package/dist-cli/chunks/{chunk-UXHEGFHQ.js → chunk-OGLOOKK6.js} +1 -1
- package/dist-cli/chunks/{chunk-RQXZANGL.js → chunk-Q2S6VBXK.js} +1 -1
- package/dist-cli/chunks/{chunk-OIFGVAV2.js → chunk-Q6EHTP4Q.js} +1 -1
- package/dist-cli/chunks/{chunk-RAEIXWER.js → chunk-QQ4JDVR6.js} +2 -2
- package/dist-cli/chunks/{chunk-6TNJLDAQ.js → chunk-QZW44BMW.js} +1 -1
- package/dist-cli/chunks/{chunk-WV7QBUFY.js → chunk-S5XWFD5C.js} +2 -2
- package/dist-cli/chunks/{chunk-L3FPLPA4.js → chunk-T4XAQ7VQ.js} +2 -2
- package/dist-cli/chunks/{chunk-HW65ZTXM.js → chunk-T5YWTSGG.js} +2 -2
- package/dist-cli/chunks/{chunk-CD3KUHS3.js → chunk-U636Z2JZ.js} +2 -2
- package/dist-cli/chunks/{chunk-QP4W3SGO.js → chunk-V36X7TNR.js} +1 -1
- package/dist-cli/chunks/chunk-VGTPGXKM.js +1 -0
- package/dist-cli/chunks/{chunk-MBR6TG2P.js → chunk-VVACMCCE.js} +7 -7
- package/dist-cli/chunks/{chunk-CPZNH3B3.js → chunk-WAZCQ5UO.js} +3 -3
- package/dist-cli/chunks/{chunk-4HJKPRWO.js → chunk-WDMIABUY.js} +10 -10
- package/dist-cli/chunks/{chunk-B3W63SZA.js → chunk-WLDAMCQK.js} +4 -4
- package/dist-cli/chunks/{chunk-4FVYQIRB.js → chunk-WMLFWLD7.js} +1 -1
- package/dist-cli/chunks/{chunk-PY4P54SD.js → chunk-WNUF6LJX.js} +2 -2
- package/dist-cli/chunks/{chunk-RC3FKTYP.js → chunk-WSN7MF4E.js} +2 -2
- package/dist-cli/chunks/{chunk-64EKAMA3.js → chunk-XSWATK6S.js} +2 -2
- package/dist-cli/chunks/{chunk-VSDVOOWG.js → chunk-YQNX7JK6.js} +2 -2
- package/dist-cli/chunks/{chunk-7SP7PFUR.js → chunk-YYS2ITHH.js} +1 -1
- package/dist-cli/chunks/cli-version-L6NDSEVW.js +2 -0
- package/dist-cli/chunks/{compat-ZTFIQOVI.js → compat-EGXOXW5F.js} +3 -3
- package/dist-cli/chunks/{control-XWU7LZWC.js → control-LUH3EQQG.js} +2 -2
- package/dist-cli/chunks/{cpu-profile-3F2OQNCM.js → cpu-profile-7LF5VVWE.js} +2 -2
- package/dist-cli/chunks/daemon-NGDXMG6R.js +2 -0
- package/dist-cli/chunks/{debug-7MIHREPG.js → debug-3J74TASS.js} +3 -3
- package/dist-cli/chunks/{detox-CDYD54PS.js → detox-PHLGST7G.js} +2 -2
- package/dist-cli/chunks/{device-H53IDQ67.js → device-CBGLBSS6.js} +2 -2
- package/dist-cli/chunks/{diagnose-YWSZCFPG.js → diagnose-BXUHKEVI.js} +2 -2
- package/dist-cli/chunks/drivers-QX77DPCG.js +2 -0
- package/dist-cli/chunks/electron-UYJPUPAG.js +19 -0
- package/dist-cli/chunks/flow-KDVDRUEN.js +2 -0
- package/dist-cli/chunks/help-4L6UVSAZ.js +2 -0
- package/dist-cli/chunks/{hints-BYH6BMHP.js → hints-7A4UIZZL.js} +2 -2
- package/dist-cli/chunks/{home-paths-AXKOJS62.js → home-paths-THYEF54Y.js} +2 -2
- package/dist-cli/chunks/{inspect-TGQU6MZQ.js → inspect-QULPTQ5V.js} +13 -13
- package/dist-cli/chunks/{install-desktop-AOJACCWA.js → install-desktop-X7G7VTBV.js} +4 -4
- package/dist-cli/chunks/{keys-RC6SP7XY.js → keys-JLP4YC4T.js} +2 -2
- package/dist-cli/chunks/{login-EQDNEJFU.js → login-VB4HG5WR.js} +4 -4
- package/dist-cli/chunks/{logout-QEDUWSSY.js → logout-TIVYUTTD.js} +2 -2
- package/dist-cli/chunks/{maestro-6SVETVRL.js → maestro-C2WVLDFM.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-WV2BZJ5T.js +2 -0
- package/dist-cli/chunks/{preview-UNXWRROE.js → preview-YBV54B2S.js} +2 -2
- package/dist-cli/chunks/{profile-UBHQS25I.js → profile-67C256LQ.js} +2 -2
- package/dist-cli/chunks/{react-THVP5NZX.js → react-HJ3WPDNO.js} +2 -2
- package/dist-cli/chunks/{record-SOACBRM3.js → record-FD4QYCBW.js} +2 -2
- package/dist-cli/chunks/runtime-BY3EB4G7.js +2 -0
- package/dist-cli/chunks/{screenshot-MJKWIVV6.js → screenshot-UTVYF7F4.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-RP67FQSA.js → screenshot-mode-WPSK6REL.js} +2 -2
- package/dist-cli/chunks/{screenshots-LWDOE4RD.js → screenshots-OXRAQXWN.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-RUXUL5GO.js → screenshots-capture-KDNNRKDL.js} +2 -2
- package/dist-cli/chunks/{serve-TMMMRVTI.js → serve-ZKEXM2U5.js} +2 -2
- package/dist-cli/chunks/setup-A5RLMR3I.js +97 -0
- package/dist-cli/chunks/{skills-P3HEQGPB.js → skills-FSJFEKNP.js} +2 -2
- package/dist-cli/chunks/{slides-MICILFXO.js → slides-UU3DFZDY.js} +2 -2
- package/dist-cli/chunks/store-TZH6LKFH.js +2 -0
- package/dist-cli/chunks/telemetry-AHIQ3SS5.js +2 -0
- package/dist-cli/chunks/{telemetry-7ZVCPD7R.js → telemetry-TOTJDY6O.js} +2 -2
- package/dist-cli/chunks/{test-NT7SGPG5.js → test-D6T7Z4XS.js} +3 -3
- package/dist-cli/chunks/{three-mode-6ADYURNM.js → three-mode-CAKEPRJQ.js} +2 -2
- package/dist-cli/chunks/{timeline-JZNPRKEH.js → timeline-D6NKNKNS.js} +2 -2
- package/dist-cli/chunks/upgrade-DBT6E6DD.js +4 -0
- package/dist-cli/chunks/upload-JR2B3YT7.js +2 -0
- package/dist-cli/chunks/{version-GS2J6SFA.js → version-4PLJ73Q3.js} +2 -2
- package/dist-cli/chunks/{web-J2XC4OK4.js → web-O6QWIX3V.js} +2 -2
- package/dist-cli/chunks/{what-happened-O5MCMYJL.js → what-happened-67DBMM4S.js} +2 -2
- package/dist-cli/chunks/{whoami-Z2Y2X2DN.js → whoami-PSQRCMUL.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/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 +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.cjs +1 -1
- package/skills/soot.md +2 -2
- package/skills/sootsim-setup.md +7 -6
- package/dist-cli/chunks/beta-T7Z7WSTK.js +0 -2
- package/dist-cli/chunks/chunk-77GTIGLV.js +0 -1
- package/dist-cli/chunks/chunk-D7ZB6A5T.js +0 -2
- package/dist-cli/chunks/chunk-F6DIP2WH.js +0 -62
- package/dist-cli/chunks/chunk-NLI4YQOY.js +0 -1
- package/dist-cli/chunks/cli-version-P4SZNBPQ.js +0 -2
- package/dist-cli/chunks/daemon-CUQB4QAP.js +0 -2
- package/dist-cli/chunks/drivers-RRCIIDGS.js +0 -2
- package/dist-cli/chunks/electron-UPH35PTF.js +0 -18
- package/dist-cli/chunks/flow-ZDJI7ICC.js +0 -2
- package/dist-cli/chunks/help-U5QGSMDR.js +0 -2
- package/dist-cli/chunks/optional-demo-registry-KXYBVP4S.js +0 -2
- package/dist-cli/chunks/runtime-BAS2IZFB.js +0 -2
- package/dist-cli/chunks/setup-WYKWQPJW.js +0 -77
- package/dist-cli/chunks/store-7CIU7X6W.js +0 -2
- package/dist-cli/chunks/telemetry-LVBDBPPV.js +0 -2
- package/dist-cli/chunks/upgrade-K6V3HYCU.js +0 -4
- package/dist-cli/chunks/upload-Q2ZFKOSR.js +0 -2
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ internally splits into a **shell worker** and a **tenant worker**.
|
|
|
54
54
|
graph TD
|
|
55
55
|
subgraph cli["sootsim CLI process (short-lived, cli/)"]
|
|
56
56
|
BIN["bin.ts (dispatcher + telemetry)"]
|
|
57
|
-
SETUP["commands/setup.ts (daemon
|
|
57
|
+
SETUP["commands/setup.ts (guided daemon setup)"]
|
|
58
58
|
RUNTIMECMD["commands/runtime.ts (runtime install/use)"]
|
|
59
59
|
INSPECT["commands/inspect/* (describe/find/do/get/wait)"]
|
|
60
60
|
FLOW["bridge-flow-runner.ts (maestro + flow)"]
|
|
@@ -131,9 +131,11 @@ graph TD
|
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
**The CLI process** (`cli/bin.ts`) parses argv, emits invocation telemetry, and
|
|
134
|
-
lazy-imports exactly one command module per run. `sootsim
|
|
135
|
-
one-time work:
|
|
136
|
-
|
|
134
|
+
lazy-imports exactly one command module per run. Bare `sootsim` and
|
|
135
|
+
`sootsim setup` own guided one-time machine work: ask which package manager you
|
|
136
|
+
use for app commands, explain repo-pinned Node versions, recommend a global
|
|
137
|
+
`sootsim` install, and install the faster background daemon when it is
|
|
138
|
+
missing. `sootsim open`
|
|
137
139
|
ensures the engine runtime exists and starts a local foreground bridge when no
|
|
138
140
|
daemon is reachable, then opens a `WsBridge` (`cli/ws-bridge.ts`) on **port
|
|
139
141
|
7668** and sends JSON commands. Inspection/interaction verbs live in
|
|
@@ -178,7 +180,7 @@ distinguish the host page thread, the shell worker, and the tenant worker.)
|
|
|
178
180
|
|
|
179
181
|
| component | role | key files |
|
|
180
182
|
| --- | --- | --- |
|
|
181
|
-
| sootsim CLI (bin + dispatcher) | Short-lived terminal entry point. Parses argv, emits telemetry, lazy-imports one command per run, and routes setup/open/runtime/inspection flows without a hidden bootstrap path. | `cli/bin.ts`, `cli/parse-args.ts`, `cli/help.ts`, `cli/commands/setup.ts`, `cli/commands/control.ts` |
|
|
183
|
+
| sootsim CLI (bin + dispatcher) | Short-lived terminal entry point. Parses argv, emits telemetry, lazy-imports one command per run, and routes guided setup/open/runtime/inspection flows without a hidden bootstrap path. | `cli/bin.ts`, `cli/parse-args.ts`, `cli/help.ts`, `cli/commands/setup.ts`, `cli/commands/control.ts` |
|
|
182
184
|
| WsBridge client | Client side of the CLI→daemon link. Resolves the daemon port from the lockfile, opens a WS to `:7668`, sends JSON commands and awaits `{id,result}`/`{id,error}`. Used by every interactive command. | `cli/ws-bridge.ts`, `src/bridge-constants.ts`, `cli/current-sim.ts` |
|
|
183
185
|
| inspect / SDK command surface | Runtime inspection + interaction verbs (describe, find, do tap, get errors, wait, layout, settle). Re-exported as `sootsim/sdk` so programmatic callers drive a sim the same way the CLI does. | `cli/commands/inspect/core.ts`, `cli/commands/inspect/actions.ts`, `cli/commands/inspect.ts`, `src/sdk.ts` |
|
|
184
186
|
| flow / maestro / detox runners | Drop-in test compatibility. `bridge-flow-runner.ts` runs maestro-format YAML and recorded flows over the bridge; `detox/` provides a `by`/`element`/`expect`/`device` driver + jest preset so existing Detox suites run unchanged. | `cli/bridge-flow-runner.ts`, `cli/commands/maestro.ts`, `cli/commands/detox.ts`, `detox/index.ts`, `detox/jest-preset.cjs` |
|
|
@@ -194,25 +196,26 @@ distinguish the host page thread, the shell worker, and the tenant worker.)
|
|
|
194
196
|
## Getting started
|
|
195
197
|
|
|
196
198
|
```sh
|
|
197
|
-
|
|
198
|
-
sootsim setup
|
|
199
|
-
sootsim open 8081
|
|
200
|
-
sootsim link /settings
|
|
199
|
+
npx sootsim # bootstrap into guided setup
|
|
200
|
+
sootsim setup # guided one-time machine setup
|
|
201
|
+
sootsim open 8081 # load a running metro/expo dev server
|
|
202
|
+
sootsim link /settings # dispatch a React Native deep link into that app
|
|
201
203
|
```
|
|
202
204
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
`npx sootsim` is the bootstrap path; `sootsim` is the normal path after the
|
|
206
|
+
guided setup has you install the CLI globally. There is no per-app install:
|
|
207
|
+
start your Metro, Expo, or One dev server the way you already do, then open it
|
|
208
|
+
from the CLI. There is no iOS native build in the inner loop; Metro alone is
|
|
209
|
+
enough. `sootsim open` starts a local bridge when no daemon is reachable; the
|
|
210
|
+
guided setup installs the faster background daemon so later CLI commands reuse
|
|
211
|
+
one server. A desktop GUI (Electron) is optional on top, via `sootsim
|
|
212
|
+
install-desktop`. In Electron, `File > New Window`
|
|
207
213
|
duplicates the focused simulator, while `File > New Simulator >` opens a new
|
|
208
214
|
window for a selected device (same device list as the `Window >` menu).
|
|
209
215
|
|
|
210
|
-
To uninstall
|
|
211
|
-
the launchd / systemd daemon and
|
|
212
|
-
profiles + lockfile, ~80 MB)
|
|
213
|
-
`yarn` / `pnpm` / `bun` (their preuninstall handling varies) or with
|
|
214
|
-
`npm rm --ignore-scripts`, run `sootsim daemon uninstall` first — it does the
|
|
215
|
-
same teardown manually. Both paths are idempotent and safe to re-run.
|
|
216
|
+
To uninstall the machine daemon and cached runtimes, run
|
|
217
|
+
`sootsim daemon uninstall`. It stops the launchd / systemd daemon and
|
|
218
|
+
removes `~/.sootsim/` (cache + runtimes + profiles + lockfile, ~80 MB).
|
|
216
219
|
|
|
217
220
|
## Jump to source in inspect mode
|
|
218
221
|
|
package/dist-cli/bin.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! sootsim v0.1.
|
|
3
|
-
import{a as u,b as d,c as g}from"./chunks/chunk-
|
|
2
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
|
+
import{a as u,b as d,c as g}from"./chunks/chunk-M6RZYHFK.js";import"./chunks/chunk-IHH3JCV5.js";function f(a){let t=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(t)||t.startsWith("sim disconnected:")||t.startsWith("bridge never reconnected")||t.startsWith("no sim connected with id ")||t.startsWith("could not connect to ws://")||t.startsWith("sootsim bridge daemon is not running")||t.startsWith("sootsim bridge lockfile is fresh")||t.startsWith("sootsim bridge exited before becoming ready")||t.startsWith("background daemon setup is unavailable")||t.startsWith("sootsim bridge did not start within"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${t}
|
|
4
4
|
`),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
|
|
5
|
-
`):process.stderr.write(`${
|
|
5
|
+
`):process.stderr.write(`${t}
|
|
6
6
|
`),process.exit(1)}process.on("unhandledRejection",f);process.on("uncaughtException",f);var A=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,k=new Set(["preview","electron","install-desktop"]);function v(a){!A||!k.has(a)||(process.stderr.write(` sootsim ${a} isn't available in the standalone binary \u2014
|
|
7
7
|
it needs vite / electron / playwright from a project's node_modules.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
`),process.exit(1))}var
|
|
8
|
+
run the npm package instead:
|
|
9
|
+
sootsim ${a}
|
|
10
|
+
`),process.exit(1))}var e=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-AHIQ3SS5.js");a({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}})}async function c(a){let{flushCliTelemetry:t}=await import("./chunks/telemetry-AHIQ3SS5.js");await t(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-L6NDSEVW.js"),{IS_BETA:t,BETA_LABEL:i}=await import("./chunks/beta-JS4JTDFC.js"),m=t?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-THYEF54Y.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(e.help&&!e.command){let{printHelp:a}=await import("./chunks/help-4L6UVSAZ.js");a(),await c(0)}var o=e.globalFlags.port,n=e.verbose,p=e.globalFlags.device,l=e.globalFlags.theme,S=e.globalFlags.driver,E=e.globalFlags.headless===!0,b=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,s=b?["--sim",b,...e.commandArgs]:e.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-TZH6LKFH.js"),t={};p&&(t.deviceModel=p),l&&(t.colorScheme=l),a.apply(t)}if(!e.command&&e.commandArgs.length===0){let{runSetup:a,shouldRunSetupForBareCommand:t}=await import("./chunks/setup-A5RLMR3I.js");t()&&(await a(["--from-welcome"]),await c(0));let{printHelp:i}=await import("./chunks/help-4L6UVSAZ.js");i(),await c(0)}var r=e.command??"";if(!r){if(e.commandArgs.length>0){let t=e.commandArgs.find(i=>!i.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${t}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-4L6UVSAZ.js");a(),await c(0)}if(r in d){let a=d[r],t=e.commandArgs.length>0?` ${e.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),t&&console.error(` \u2192 ${a}${t}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(r==="skill"){let{runSkill:i}=await import("./chunks/skills-FSJFEKNP.js");await i(e.commandArgs),await c(0)}let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",t=e.commandArgs.find(i=>!i.startsWith("-"));if(r!=="shell")if(a&&!t){let{printGroupHelp:i}=await import("./chunks/help-4L6UVSAZ.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-4L6UVSAZ.js");i(a&&t?t:r,{prefer:a&&t?"verb":"command",group:a&&t?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{runInspect:a}=await import("./chunks/inspect-QULPTQ5V.js");await a([r,...s],{port:o,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-XHVSQZOE.js");await a(e.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-KDVDRUEN.js"),t=await a(s);process.exit(typeof t=="number"?t:0)}case"test":{let{runTest:a}=await import("./chunks/test-D6T7Z4XS.js");await a(e.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-PHLGST7G.js");await a(e.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-C2WVLDFM.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-YBV54B2S.js");await a(e.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-FD4QYCBW.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-67C256LQ.js"),t=await a(e.commandArgs,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-7LF5VVWE.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"react":{let{runReact:a}=await import("./chunks/react-HJ3WPDNO.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-UTVYF7F4.js");await a(s,{port:o,verbose:n});break}case"screenshots":{if(e.commandArgs[0]==="capture"){let{runScreenshotsCapture:i}=await import("./chunks/screenshots-capture-KDNNRKDL.js"),m=await i(e.commandArgs.slice(1));process.exit(typeof m=="number"?m:0)}let{runScreenshots:a}=await import("./chunks/screenshots-OXRAQXWN.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-WPSK6REL.js");await a(e.commandArgs,{port:o,verbose:n});break}case"slides":{let{runSlides:a}=await import("./chunks/slides-UU3DFZDY.js");await a(s,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-CAKEPRJQ.js");await a(e.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-QULPTQ5V.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-3J74TASS.js");await a(s,{port:o,verbose:n});break}case"camera":{let{runCamera:a}=await import("./chunks/camera-7L7D4XUO.js");await a(s,{port:o});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-D6NKNKNS.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-67DBMM4S.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-BXUHKEVI.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"open":{let{runOpenCommand:a}=await import("./chunks/control-LUH3EQQG.js");await a(s,{port:o});break}case"link":{let{runLinkCommand:a}=await import("./chunks/control-LUH3EQQG.js");await a(s,{port:o});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-LUH3EQQG.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-LUH3EQQG.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-LUH3EQQG.js");await a(s,{port:o});break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-CBGLBSS6.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-EGXOXW5F.js");await a(e.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-UYJPUPAG.js");await a(e.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-VB4HG5WR.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-TIVYUTTD.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-PSQRCMUL.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-JLP4YC4T.js");await a(e.commandArgs);break}case"setup":{let{runSetup:a}=await import("./chunks/setup-A5RLMR3I.js");await a(e.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-X7G7VTBV.js");await a(e.commandArgs);break}case"serve":{let{runServe:a}=await import("./chunks/serve-ZKEXM2U5.js");await a(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-NGDXMG6R.js");await a(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-BY3EB4G7.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-DBT6E6DD.js");await a(e.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-4PLJ73Q3.js");await a(e.commandArgs);break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-KSX5D27X.js"),t=await a(e.commandArgs);process.exit(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-MS6TJF5Y.js"),t=await a(e.commandArgs);process.exit(t)}case"skill":{let{runSkill:a}=await import("./chunks/skills-FSJFEKNP.js");await a(e.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-JR2B3YT7.js");await a(e.commandArgs,{port:o,verbose:n});break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-HHN6X2VJ.js");await a(e.commandArgs);break}case"hints":{let{runHints:a}=await import("./chunks/hints-7A4UIZZL.js");a(e.commandArgs);break}case"telemetry":{let{runTelemetry:a}=await import("./chunks/telemetry-TOTJDY6O.js");await a(e.commandArgs);break}default:console.error(` unknown command: ${r}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
|
|
@@ -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,m as k,n as D,o as x,p as g,q as O,r as C}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.184 | (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,m as k,n as D,o as x,p as g,q as O,r as C}from"./chunk-QQ4JDVR6.js";import"./chunk-3S5BOWO5.js";import{c as $}from"./chunk-NWNFGZSI.js";import"./chunk-S5XWFD5C.js";import"./chunk-T4XAQ7VQ.js";import"./chunk-VVACMCCE.js";import"./chunk-WAZCQ5UO.js";import"./chunk-MFL73VJG.js";import"./chunk-Q2S6VBXK.js";import"./chunk-V36X7TNR.js";import{j as y}from"./chunk-53KKDNCU.js";import"./chunk-6MPD3QXA.js";import"./chunk-QZW44BMW.js";import"./chunk-OGLOOKK6.js";import"./chunk-IHH3JCV5.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.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as M}from"./chunk-3S5BOWO5.js";import"./chunk-IHH3JCV5.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 I,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,g=!1,a=new Promise(s=>{t.on("exit",(i,e)=>{g=!0;let p=new Error(`codex app-server exited (code=${i}, signal=${e??""})`);for(let{reject:f}of r.values())f(p);r.clear(),s({code:i,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let i=s.trim();if(!i)return;let e;try{e=JSON.parse(i)}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,f=p!=null?r.get(p):void 0;if(!f)return;r.delete(p),e.error?f.reject(new b(e.error.message,e.error.code,e.error.data)):f.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let f of p)try{f(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 i=m.get("__stderr__");if(i)for(let e of i)try{e({text:s})}catch{}});function n(s){if(!g)try{t.stdin.write(JSON.stringify(s)+`
|
|
3
3
|
`)}catch{}}return{exited:a,on(s,i){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(i),()=>{e?.delete(i)}},request(s,i){if(g)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,f)=>{r.set(e,{resolve:l=>p(l),reject:f,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:i})})},notify(s,i){n({jsonrpc:"2.0",method:s,params:i})},async shutdown(s=1500){if(g)return;try{t.stdin.end()}catch{}let i=setTimeout(()=>{if(!g)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(i)}},kill(s="SIGTERM"){if(!g)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 I(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 g=t[u];g&&(r[g]=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.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as p}from"./chunk-ID25RWPE.js";import"./chunk-IHH3JCV5.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.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-IHH3JCV5.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{m as f}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{m as f}from"./chunk-7DKGX746.js";import"./chunk-7DHLNDOA.js";import{c as m,e as l,g as p}from"./chunk-7C6RC3BU.js";import"./chunk-Q2S6VBXK.js";import"./chunk-V36X7TNR.js";import"./chunk-53KKDNCU.js";import"./chunk-IHH3JCV5.js";function d(){console.log(`
|
|
3
3
|
sootsim camera \u2014 drive the sim camera
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as R,b as U}from"./chunk-YQNX7JK6.js";import{c as F}from"./chunk-NWNFGZSI.js";import{g as N,j as E,r as _,s as v,t as B}from"./chunk-53KKDNCU.js";import{a as O}from"./chunk-6MPD3QXA.js";import{execFileSync as W,spawnSync as s}from"child_process";import{existsSync as a,mkdirSync as x,readFileSync as nt,realpathSync as ot,rmSync as $,writeFileSync as H}from"fs";import{homedir as P}from"os";import{basename as st,dirname as T,resolve as f,sep as Y}from"path";import{execFileSync as X}from"child_process";import{chmodSync as Q,mkdirSync as I,rmSync as z,writeFileSync as A}from"fs";import{dirname as L}from"path";var J="dev.sootsim.daemon",j="SootSim Daemon",M="0.1.36";function V(t,e,r){let n=v(),o=B(),c=L(L(o)),l=L(o),u=`${c}/Resources`;z(n,{recursive:!0,force:!0}),I(_(),{recursive:!0}),I(l,{recursive:!0}),I(u,{recursive:!0}),A(`${c}/Info.plist`,Z()),A(`${c}/PkgInfo`,"APPL????"),A(o,tt(t,e,r)),Q(o,493);try{X("codesign",["--force","--sign","-","--deep",n],{stdio:"pipe"})}catch(i){let p=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${n} failed: ${p}
|
|
3
|
+
the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:n,launcherPath:o}}function Z(){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>${j}</string>
|
|
9
|
+
<key>CFBundleExecutable</key><string>sootsim-daemon</string>
|
|
10
|
+
<key>CFBundleIdentifier</key><string>${J}</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
|
|
12
|
+
<key>CFBundleName</key><string>${j}</string>
|
|
13
|
+
<key>CFBundlePackageType</key><string>APPL</string>
|
|
14
|
+
<key>CFBundleShortVersionString</key><string>${M}</string>
|
|
15
|
+
<key>CFBundleSignature</key><string>????</string>
|
|
16
|
+
<key>CFBundleVersion</key><string>${M}</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 tt(t,e,r){let o=[t.executable,...t.prefixArgs,"serve","--quiet","--port",String(e)].map(et).join(" ");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
|
+
exec ${o}
|
|
31
|
+
`}function et(t){return`'${t.replace(/'/g,"'\\''")}'`}var K=60,y="dev.sootsim.daemon",m="sootsim-daemon",g=f(P(),"Library/Logs/sootsim"),b=f(P(),".local/state/sootsim");async function Ft(t,e={}){let[r,...n]=t,o=e.port??7668;if(!r||r==="--help"||r==="-h"){q();return}new Set(["uninstall","restart","start","stop","logs"]).has(r)&&R({event:`daemon_${r}`,properties:{platform:process.platform,subsource:"daemon"}});try{switch(r){case"uninstall":return await ht();case"status":return await $t();case"restart":return await St();case"start":return await wt();case"stop":return await kt();case"logs":return await vt(n);default:console.error(` unknown daemon subcommand: ${r}`),q(),process.exit(1)}}finally{await U()}}function q(){F("daemon")}function it(){let t=at();if(t)return t;let e=ut();return{executable:process.execPath,prefixArgs:[e]}}function at(){if(!ct())return null;let t=lt();if(!t)return null;let e=O(),r=e==="0.0.0"?"sootsim":`sootsim@${e}`;return{executable:process.execPath,prefixArgs:[t,"exec","--yes","--package",r,"--","sootsim"]}}function ct(){let t=process.argv[1];return process.env.npm_command==="exec"?!0:t?D(t).includes(`${Y}_npx${Y}`):!1}function lt(){try{let e=W("which",["npm"],{encoding:"utf8"}).trim();if(e&&a(e))return G(e)}catch{}let t=process.env.npm_execpath;return t&&a(t)?G(t):null}function G(t){let e=D(t);if(st(e)==="npx-cli.js"){let r=f(T(e),"npm-cli.js");if(a(r))return r}return e}function ut(){try{let e=W("which",["sootsim"],{encoding:"utf8"}).trim();if(e&&a(e))return D(e)}catch{}let t=process.argv[1];if(t&&a(t))return D(t);throw new Error("could not locate the sootsim binary")}function D(t){try{return ot(t)}catch{return t}}function pt(t,e){x(g,{recursive:!0});let r=f(g,"bridge.out.log"),n=f(g,"bridge.err.log"),{launcherPath:o}=V(t,e,{stdout:r,stderr:n}),c=` <string>${mt(o)}</string>`;return`<?xml version="1.0" encoding="UTF-8"?>
|
|
32
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
33
|
+
<plist version="1.0">
|
|
34
|
+
<dict>
|
|
35
|
+
<key>Label</key><string>${y}</string>
|
|
36
|
+
<key>ProgramArguments</key>
|
|
37
|
+
<array>
|
|
38
|
+
${c}
|
|
39
|
+
</array>
|
|
40
|
+
<key>RunAtLoad</key><true/>
|
|
41
|
+
<key>KeepAlive</key><true/>
|
|
42
|
+
<key>ThrottleInterval</key><integer>${K}</integer>
|
|
43
|
+
<key>ProcessType</key><string>Background</string>
|
|
44
|
+
<key>StandardOutPath</key><string>${r}</string>
|
|
45
|
+
<key>StandardErrorPath</key><string>${n}</string>
|
|
46
|
+
</dict>
|
|
47
|
+
</plist>
|
|
48
|
+
`}function dt(t,e){return x(b,{recursive:!0}),`[Unit]
|
|
49
|
+
Description=sootsim bridge daemon
|
|
50
|
+
After=default.target
|
|
51
|
+
|
|
52
|
+
[Service]
|
|
53
|
+
Type=simple
|
|
54
|
+
ExecStart=${[t.executable,...t.prefixArgs].map(gt).join(" ")} serve --quiet --port ${e}
|
|
55
|
+
Restart=always
|
|
56
|
+
RestartSec=${K}
|
|
57
|
+
|
|
58
|
+
[Install]
|
|
59
|
+
WantedBy=default.target
|
|
60
|
+
`}function mt(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function gt(t){return/[^\w@%+=:,./-]/.test(t)?`'${t.replace(/'/g,"'\\''")}'`:t}function S(){return f(P(),"Library/LaunchAgents",`${y}.plist`)}function w(){return f(P(),".config/systemd/user",`${m}.service`)}function jt(){if(E())return{supported:!1,installed:!1};if(process.platform==="darwin"){let t=S();return{supported:!0,installed:a(t),path:t}}if(process.platform==="linux"){let t=w();return{supported:!0,installed:a(t),path:t}}return{supported:!1,installed:!1}}async function Mt({port:t,force:e}){if(E())throw new Error("background daemon setup is unavailable in this environment");let r=it();if(console.log(` binary: ${[r.executable,...r.prefixArgs].join(" ")}`),console.log(` port: ${t}`),process.platform==="darwin"){let n=S();if(a(n)&&!e){console.log(` already installed at ${n}`),console.log(" pass --force to overwrite, or use 'sootsim daemon restart' to reload");return}x(T(n),{recursive:!0}),H(n,pt(r,t)),console.log(` wrote ${n}`);let o=`gui/${process.getuid()}`,c=`${o}/${y}`,l=()=>{let d=s("launchctl",["bootstrap",o,n],{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 C=s("launchctl",["print",c],{encoding:"utf8"});return C.status!==0?{ok:!1,reason:`bootstrap returned 0 but service not registered (print exit ${C.status})`}:{ok:!0}},u=l();if(!u.ok){let d=u.reason;if(s("launchctl",["bootout",c],{stdio:"ignore"}),u=l(),!u.ok)throw new Error(`launchctl bootstrap failed: ${u.reason}`+(d!==u.reason?` (initial: ${d})`:"")+" \u2014 try `sootsim daemon uninstall` then retry, or reboot if launchd state is stuck.")}let i=Date.now()+4e3,p,h;for(;Date.now()<i;){let d=s("launchctl",["print",c],{encoding:"utf8"});if(d.status===0&&(p=d.stdout?.match(/state\s*=\s*(\w+)/)?.[1],h=d.stdout?.match(/pid\s*=\s*(\d+)/)?.[1],p==="running"||h))break;await new Promise(k=>setTimeout(k,150))}if(p!=="running"&&!h)throw new Error(`daemon registered but did not reach running state within 4s (last state: ${p||"unknown"}). check ${f(g,"bridge.err.log")} \u2014 typically a stale runtime or a port already bound by another process.`);console.log(` registered (state: ${p||"unknown"}${h?`, pid ${h}`:""}, log: ${f(g,"bridge.err.log")})`);return}if(process.platform==="linux"){let n=w();if(a(n)&&!e){console.log(` already installed at ${n}`),console.log(" pass --force to overwrite, or use 'sootsim daemon restart' to reload");return}x(T(n),{recursive:!0}),H(n,dt(r,t)),console.log(` wrote ${n}`);let o=s("systemctl",["--user","daemon-reload"],{stdio:"pipe",encoding:"utf8"});if(o.status!==0){let i=(o.stderr||o.stdout||"").trim();throw new Error(`systemctl daemon-reload failed${i?`: ${i}`:""}`)}let c=s("systemctl",["--user","enable","--now",m],{stdio:"pipe",encoding:"utf8"});if(c.status!==0){let i=(c.stderr||c.stdout||"").trim();throw new Error(`systemctl enable --now failed${i?`: ${i}`:""} \u2014 try \`sootsim daemon uninstall\` then retry.`)}let u=(s("systemctl",["--user","is-active",m],{encoding:"utf8"}).stdout||"").trim()||"unknown";console.log(` registered (state: ${u}, journalctl --user -u ${m} to tail logs)`);try{let i=process.env.USER||process.env.LOGNAME||"";if(i){let p=s("loginctl",["show-user",i,"--property=Linger","--value"],{encoding:"utf8"});!((p.stdout||"").trim().toLowerCase()==="yes")&&p.status===0&&console.log(` note: linger is not enabled for "${i}". the daemon will exit at logout.
|
|
61
|
+
enable persistence with: sudo loginctl enable-linger ${i}`)}}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 ft(){let t=[];if(process.platform==="darwin"){let e=S();a(e)&&(s("launchctl",["bootout",`gui/${process.getuid()}/${y}`],{stdio:"ignore"}),$(e,{force:!0}),t.push(e));let r=v();return a(r)&&($(r,{recursive:!0,force:!0}),t.push(r)),a(g)&&($(g,{recursive:!0,force:!0}),t.push(g)),{removed:t,missing:t.length===0}}if(process.platform==="linux"){let e=w();return a(e)&&(s("systemctl",["--user","disable","--now",m],{stdio:"ignore"}),$(e,{force:!0}),s("systemctl",["--user","daemon-reload"],{stdio:"ignore"}),s("systemctl",["--user","reset-failed",m],{stdio:"ignore"}),t.push(e)),a(b)&&($(b,{recursive:!0,force:!0}),t.push(b)),{removed:t,missing:t.length===0}}return{removed:t,missing:!0}}function yt(){let t=[],e=N();return a(e)&&($(e,{recursive:!0,force:!0}),t.push(e)),{removed:t,missing:t.length===0}}async function ht(){let t=ft();for(let r of t.removed)console.log(` removed ${r}`);let e=yt();for(let r of e.removed)console.log(` removed ${r}`);t.missing&&e.missing&&console.log(" not installed")}async function $t(){if(process.platform==="darwin"){let t=S();if(!a(t)){console.log(" installed: no");return}console.log(` installed: yes (${t})`);let e=bt(t);e&&console.log(` binary: ${e}`);let r=s("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=w();if(!a(t)){console.log(" installed: no");return}console.log(` installed: yes (${t})`);let e=s("systemctl",["--user","is-active",m],{encoding:"utf8"});console.log(` state: ${e.stdout.trim()||"unknown"}`);return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function St(){if(process.platform==="darwin"){let t=S();a(t)||(console.error(" daemon not registered \u2014 run `sootsim setup`"),process.exit(1));let e=s("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=w();a(t)||(console.error(" daemon not registered \u2014 run `sootsim setup`"),process.exit(1));let e=s("systemctl",["--user","restart",m],{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 wt(){if(process.platform==="darwin"){s("launchctl",["kickstart",`gui/${process.getuid()}/${y}`],{stdio:"inherit"});return}if(process.platform==="linux"){s("systemctl",["--user","start",m],{stdio:"inherit"});return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function kt(){if(process.platform==="darwin"){s("launchctl",["bootout",`gui/${process.getuid()}/${y}`],{stdio:"inherit"});return}if(process.platform==="linux"){s("systemctl",["--user","stop",m],{stdio:"inherit"});return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function vt(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=f(g,"bridge.out.log"),c=f(g,"bridge.err.log"),l=[o,c].filter(i=>a(i));l.length===0&&(console.error(` no daemon logs yet at ${g} \u2014 run \`sootsim setup\` to install the daemon`),process.exit(1));let u=n?["-n",String(r),"-F",...l]:["-n",String(r),...l];s("tail",u,{stdio:"inherit"});return}if(process.platform==="linux"){let o=`${m}.service`,c=["--user","-u",o,"-n",String(r),"--no-pager"],l=s("journalctl",n?[...c,"-f"]:c,{encoding:"utf8",stdio:n?"inherit":"pipe"});if(n)return;let u=`${l.stdout||""}${l.stderr||""}`,i=/insufficient permissions|No journal files were opened/i.test(u);if(l.status===0&&!i){process.stdout.write(l.stdout||"");return}let p=s("journalctl",[`_SYSTEMD_USER_UNIT=${o}`,"-n",String(r),"--no-pager"],{encoding:"utf8"});if(p.status===0&&(p.stdout||"").trim()){process.stdout.write(p.stdout);return}console.error(` could not read --user journal for ${o} (this user isn't in the systemd-journal group yet).
|
|
62
|
+
run: sudo journalctl _SYSTEMD_USER_UNIT=${o} -n ${r} --no-pager`),process.exit(1)}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}function bt(t){try{return nt(t,"utf8").match(/<array>\s*<string>([^<]+)<\/string>/)?.[1]||null}catch{return null}}export{Ft as a,jt as b,Mt as c,ft as d,yt as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.184 | (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,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import t from"node:fs";import{homedir as A}from"node:os";import o from"node:path";var E="SOOTSIM_HOME",_="active",I="daemon.json",N="dev-bridge.json",j="config.json",h=3e4;function u(){let e=process.env[E];return e&&e.length>0?o.resolve(e):o.join(A(),".sootsim")}function F(){if(process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1")return!1;let e=process.env.SOOTSIM_DEV;if(e==="1"||e==="true")return!0;if(e==="0"||e==="false")return!1;let r=process.argv[1];if(!r)return!1;try{return t.realpathSync(r).includes(`${o.sep}packages${o.sep}sootsim${o.sep}`)}catch{return!1}}function P(){return process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1"?!1:process.env.IS_TAMAGUI_DEV==="1"}function W(){return F()||P()}function f(){return o.join(u(),"runtimes")}function w(e){return o.join(f(),e)}function k(){return o.join(f(),_)}function D(){return o.join(u(),"electron")}function X(){return o.join(D(),"userData")}function q(e){return o.join(D(),e)}function T(){return o.join(u(),"profiles")}function B(){return o.join(u(),"daemon-app")}function M(){return o.join(B(),"SootSim Daemon.app")}function z(){return o.join(M(),"Contents","MacOS","sootsim-daemon")}function C(){return o.join(u(),"cache")}function p(){return o.join(u(),I)}function m(){return o.join(u(),N)}function b(){return o.join(u(),j)}function L(){try{let e=t.readFileSync(b(),"utf8"),r=JSON.parse(e);return r&&typeof r=="object"?r:{}}catch{return{}}}function R(e){g();let r=L(),i={...r,...e};e.settings&&typeof e.settings=="object"&&(i.settings={...r.settings&&typeof r.settings=="object"?r.settings:{},...e.settings});let c=`${b()}.tmp`;return t.writeFileSync(c,`${JSON.stringify(i,null,2)}
|
|
3
3
|
`,"utf8"),t.renameSync(c,b()),i}function Q(){return L().telemetry!==!1}function Z(e){R({telemetry:e})}function g(){t.mkdirSync(u(),{recursive:!0}),t.mkdirSync(f(),{recursive:!0}),t.mkdirSync(D(),{recursive:!0}),t.mkdirSync(T(),{recursive:!0}),t.mkdirSync(C(),{recursive:!0})}function $(){try{let e=t.readFileSync(k(),"utf8").trim();return e.length>0?e:null}catch{return null}}function ee(e){t.mkdirSync(f(),{recursive:!0}),t.writeFileSync(k(),`${e}
|
|
4
4
|
`,"utf8")}function re(){try{return t.readdirSync(f(),{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name).sort(J)}catch{return[]}}function J(e,r){let i=s=>{let a=s.indexOf("-"),l=a>=0?s.slice(0,a):s,O=a>=0?s.slice(a+1):"",x=l.split(".").map(S=>Number.parseInt(S,10));return x.some(S=>!Number.isFinite(S))?[[Number.POSITIVE_INFINITY],s]:[x,O]},[c,n]=i(e),[v,y]=i(r);for(let s=0;s<Math.max(c.length,v.length);s++){let a=c[s]??0,l=v[s]??0;if(a!==l)return a-l}return n===y?0:n?y?n<y?-1:1:-1:1}function te(){let e=$();if(!e)return null;let r=w(e);try{if(t.statSync(r).isDirectory())return r}catch{}return null}var d=16*1024;function V(){try{let e=t.openSync(p(),"r");try{let r=Buffer.alloc(d),i=t.readSync(e,r,0,d,0),c=r.subarray(0,i).toString("utf8"),n=JSON.parse(c);return n&&n.schema===1&&typeof n.pid=="number"&&typeof n.bridgePort=="number"&&typeof n.runtimePort=="number"&&typeof n.startedAt=="number"&&typeof n.heartbeatAt=="number"?n:null}finally{t.closeSync(e)}}catch{return null}}function ne(){try{let e=t.openSync(m(),"r");try{let r=Buffer.alloc(d),i=t.readSync(e,r,0,d,0),c=r.subarray(0,i).toString("utf8"),n=JSON.parse(c);return n&&n.schema===1&&n.source==="vite-dev"&&typeof n.pid=="number"&&typeof n.bridgePort=="number"&&typeof n.runtimePort=="number"&&typeof n.cwd=="string"&&typeof n.startedAt=="number"&&typeof n.heartbeatAt=="number"?n:null}finally{t.closeSync(e)}}catch{return null}}function H(e,r=Date.now()){if(!e||r-e.heartbeatAt>h)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function oe(e,r=Date.now()){if(!e||r-e.heartbeatAt>h)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function G(e){g();let r=`${p()}.tmp`;t.writeFileSync(r,`${JSON.stringify(e,null,2)}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as s}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as s}from"./chunk-N5LA5G7V.js";import{o}from"./chunk-53KKDNCU.js";import{chmodSync as p,existsSync as d,mkdirSync as g,readFileSync as I,rmSync as f,writeFileSync as _}from"node:fs";import{dirname as y,join as h,resolve as k}from"node:path";function i(){return h(o(),"credentials.json")}function S(){let n=i();if(!d(n))return null;try{let t=JSON.parse(I(n,"utf8"));return t.version!==1||typeof t.apiKey!="string"||!t.apiKey.startsWith("sk_sootsim_")?null:t.apiKey}catch{return null}}function w(n){if(!n.startsWith("sk_sootsim_"))throw new Error("api key must start with sk_sootsim_");let t=i();g(y(k(t)),{recursive:!0}),_(t,JSON.stringify({version:1,apiKey:n,savedAt:new Date().toISOString()},null,2)+`
|
|
3
3
|
`);try{p(t,384)}catch{}}function E(){f(i(),{force:!0})}var m=["ghs_","ghp_","gho_","ghu_","github_pat_"];function O(n){return!!(n&&n.length>=20&&m.some(t=>n.startsWith(t)))}function A(){let n=process.env.SOOT_INSTALLATION_TOKEN?.trim(),t=process.env.GITHUB_TOKEN?.trim(),r=n||t;if(!O(r))return null;let e=(process.env.SOOT_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!e)return null;let[l,u]=e.includes("/")?e.split("/",2):[null,null],c=(process.env.SOOT_REPO_ID||process.env.GITHUB_REPOSITORY_ID||"").trim(),a=(process.env.SOOT_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:r,repoId:e,repositoryId:c||null,owner:l||null,repo:u||null,installationId:a||null,source:n?"soot-runner":"github-actions"}}function x(){let n=process.env.SOOTSIM_API_KEY?.trim();if(n&&n.startsWith("sk_sootsim_"))return{kind:"api-key",secret:n,source:"env"};let t=A();if(t)return t;let r=S();if(r)return{kind:"api-key",secret:r,source:"file"};let e=s();return e?.token?{kind:"session",token:e.token,origin:e.origin}:null}function H(n){return n.kind==="api-key"?`Bearer ${n.secret}`:`Bearer ${n.token}`}function N(n){return!n||n.kind!=="github"?null:{repoId:n.repoId,owner:n.owner??void 0,repo:n.repo??void 0,installationId:n.installationId}}export{S as a,w as b,E as c,x as d,H as e,N as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.184 | (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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as A,d as W,f as x}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as A,d as W,f as x}from"./chunk-V36X7TNR.js";import{I as v,J as P,K as T,L as C,j as k}from"./chunk-53KKDNCU.js";import{WebSocket as I}from"ws";function E(){if(k()){let n=P();if(n&&C(n))return n.bridgePort}let e=v();return e&&T(e)?e.bridgePort:7668}var w=class extends Error{lock;constructor(n,i){super(n),this.name="BridgeSimLockedError",this.lock=i}};function L(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function V(e,n={}){let i=new Set,a=n.port??E(),l=n.commandTimeoutMs??15e3,r,m="none",h=new Set(n.stripBooleanFlags??[]),b=new Set(n.stripValueFlags??[]);for(let t=0;t<e.length;t++){let d=e[t];if(d==="--port"||d==="-p"){i.add(t),t+1<e.length&&(i.add(t+1),a=Number(e[t+1])),t++;continue}if(d.startsWith("--port=")){i.add(t),a=Number(d.slice(7));continue}if(d==="--timeout"){i.add(t),t+1<e.length&&(i.add(t+1),l=Number(e[t+1])),t++;continue}if(d==="--sim"||d==="--session"||d==="--tab"){i.add(t),t+1<e.length&&(i.add(t+1),r=e[t+1]?.trim()||void 0,m="flag"),t++;continue}let s=d.startsWith("--sim=")?d.slice(6):d.startsWith("--session=")?d.slice(10):d.startsWith("--tab=")?d.slice(6):void 0;if(s!==void 0){i.add(t),r=s.trim()||void 0,m="flag";continue}if(h.has(d)){i.add(t);continue}b.has(d)&&(i.add(t),t+1<e.length&&i.add(t+1),t++)}if(!r){let t=W();t&&(r=t.trim()||void 0,m="saved")}return{positional:e.filter((t,d)=>!i.has(d)),wsPort:a,simId:r,simIdSource:m,commandTimeoutMs:l}}function M(e,n={}){let i=1,a=n.commandTimeoutMs??15e3,l=new Map,r=new I(`ws://localhost:${e}`),m=A(),h=new Promise((s,o)=>{r.on("open",()=>{try{r.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:m.key,cliIdentitySource:m.source,cliLabel:n.cliLabel}))}catch{}s()}),r.on("error",c=>{let g=c.message?`: ${c.message}`:"";o(new Error(`could not connect to ws://localhost:${e}${g}`))})}),b=!1,t=!1;function d(s,o){if(t||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;t=!0;let c=o??"primary",g=L(o?n.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${g})
|
|
3
3
|
`)}return r.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&&!b&&(b=!0,process.stderr.write(`
|
|
4
4
|
\u26A0 ${o._otherCliCount} other CLI identity/identities are driving this sim
|
|
5
5
|
taps, scrolls, and keyboard input from multiple agents will collide on
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function H(t,e){let r=["--max-ms","--maxMs","--maxms","--max_ms"];for(let n of r){let s=t.indexOf(n);if(s>=0&&t[s+1]){let o=Number(t[s+1]);if(Number.isFinite(o))return Math.max(100,o)}}return e}var w=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function S(t){return typeof t=="string"&&w.has(t)}async function v(t){return await t.send({type:"evaluate",code:"window.__sootsimEngineState?.inspectActive === true"})===!0}async function C(t,e){if(!S(e))return!1;try{return await v(t)}catch{return!1}}async function B(t){let e=await t.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof e=="number"?e:0}}async function W(t,e=5){let r=await t.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${e}))()`});return{depth:e,tree:r}}async function F(t){let e=await t.send({type:"evaluate",code:"window.location.href"});return{url:typeof e=="string"?e:""}}async function z(t,e){let r=`(async () => {
|
|
3
3
|
const t = window.__sootsimTest
|
|
4
4
|
const mainShell = window.SootSim?.bridges?.mainShell
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{H as I,m as B,n as E,o as y,t as v,v as A}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{H as I,m as B,n as E,o as y,t as v,v as A}from"./chunk-7DHLNDOA.js";import{d as h,h as N,i as P}from"./chunk-7C6RC3BU.js";var q={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function U(e){return e.includes("--json")}function Y(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
|
|
3
3
|
`)}function V(e){process.stderr.write(`${e}
|
|
4
4
|
`)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function D(e,t,...r){return N(e,`__sootsimTest.${t}`,...r)}async function k(e,t,...r){return P(e,`SootSim.bridges.mainShell.${t}`,...r)}async function z(e,t={}){try{let r=await D(e,"waitForScreenTransitions",q);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function K(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await k(e,t,...n)}catch(o){if(!I(o)||Date.now()>=s)throw o;await w(50)}}async function Q(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let a=0;a<s;a++){let u=h(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await w(o)}return null}async function X(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let a=h(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await a.send({type:"evaluate",code:"1"}),a}catch{a.close()}await w(o)}return null}async function Z(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,a=-1,u=o,c=null,d=!1,m={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let i=await e.send({type:"evaluate",code:B}),g=Date.now()-o,f=Number(i?.nodes)||0,$=Number(i?.targets)||0,x=Number(i?.errors)||0,C=i?.flag===!0,p=i?.externalReady,T=typeof i?.loadingText=="string"?i.loadingText.trim():"",W=typeof i?.externalStatus=="string"?i.externalStatus.trim():"",M=typeof i?.externalError=="string"?i.externalError.trim():"",R=typeof i?.externalError=="string"&&M.length>0;if(c=p,d=R,f!==a&&(a=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,flag:i?.flag,loadingText:T,externalReady:typeof p=="boolean"?p:null,externalStatus:W,externalError:M,errors:x},C&&p!==!1&&!R&&!T&&y({nodes:f,targets:$})&&g-u>=E)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!C)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&y(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function O(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function F(e,t={}){let r=await e.send({type:"evaluate",code:A});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
|
|
5
5
|
console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await v(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as u,b as w}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as u,b as w}from"./chunk-JFCJIRX6.js";import{a as d,b as g,c as v}from"./chunk-IZMNFZXZ.js";import{a as m,c as f}from"./chunk-WNUF6LJX.js";import{c as p}from"./chunk-V36X7TNR.js";function x(){let e=d();return e?{available:!0,reason:null,detail:e}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function I(e){if(e.headless)return{launched:!1,message:"the chromium driver launches a visible browser window and cannot run headless \u2014 a headless `chrome --headless=new` process exits immediately and the sim never connects. for headless automation use `--driver playwright`."};let r=d();if(!r)return{launched:!1,message:"chromium not found \u2014 install chrome or run `sootsim list --drivers`"};if(!e.url)return{launched:!1,message:"chromium driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current Chrome profile"};try{let t=await v(e.url,{detached:e.detached??!0});return{launched:!0,message:`chromium launched \u2192 ${e.url}`,pid:t.pid,target:t.target??r,attachUrl:e.url}}catch(t){return{launched:!1,message:`chromium spawn failed: ${t instanceof Error?t.message:String(t)}`}}}var y={id:"chromium",name:"chromium",description:"system chrome / chromium / edge \u2014 visible window (headless: use playwright)",kind:"browser",availability:x,launch:I};function _(){let e=u();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"sootsim desktop app not installed (run `sootsim install-desktop`)"}}async function M(e){let r=u();if(!r)return{launched:!1,message:"sootsim desktop app not installed"};try{let t=await w(e.url,r,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile});return t.launched?{launched:!0,message:e.url?`electron launched via ${t.via} \u2192 ${e.url}`:`electron launched via ${t.via}`,target:t.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(t){return{launched:!1,message:`electron launch failed: ${t instanceof Error?t.message:String(t)}`}}}var b={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:_,launch:M};import{spawn as A}from"child_process";import{closeSync as C,mkdtempSync as L,openSync as E,readFileSync as W}from"fs";import{createRequire as R}from"module";import{tmpdir as P}from"os";import{join as S}from"path";var N=`
|
|
3
3
|
const modulePath = process.env.SOOTSIM_PW_MODULE;
|
|
4
4
|
const url = process.env.SOOTSIM_PW_URL;
|
|
5
5
|
const headless = process.env.SOOTSIM_PW_HEADLESS === '1';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{h as u}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{h as u}from"./chunk-OGLOOKK6.js";var S=52,l=18,h=42,x=96,g=54,E=1.5,$="inset 0 0 0 0.5px #000, inset 0 0 0 2px #757575, inset 0 0 0 5px #212121",w=1;function y(e){let t=u(e),r=t.scale,o=!t.dynamicIsland&&t.homeIndicatorHeight===0&&t.cornerRadius===0,n=t.width,i=t.height,a=o?t.width+l*2:t.width+32,d=o?t.height+h+x:t.height+32,c=9.5,b=w,p=a+c*2,m=d+w*2,f=c+(o?l:16),B=o?h:16,H=o?S:t.cornerRadius+16,v=[{side:"right",top:t.hardwareButtons.lock.top,height:t.hardwareButtons.lock.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.ringToggle.top,height:t.hardwareButtons.ringToggle.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.volumeUp.top,height:t.hardwareButtons.volumeUp.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.volumeDown.top,height:t.hardwareButtons.volumeDown.height,width:t.hardwareButtons.width}];return{model:e,renderScale:r,outerWidth:Math.round(p*r),outerHeight:Math.round(m*r),logicalOuterWidth:p,logicalOuterHeight:m,logicalFrameWidth:a,logicalFrameHeight:d,logicalFrameLeft:c,logicalFrameTop:b,logicalScreenWidth:n,logicalScreenHeight:i,logicalScreenLeft:f,logicalScreenTop:B,logicalScreenRadius:o?0:t.cornerRadius,logicalFrameRadius:H,frameBackground:o?"linear-gradient(180deg, #1b1c20 0%, #0f1012 42%, #050608 100%)":"#000000",frameOutline:o?"0 0 0 1px #1f2125":"0 0 0 1px #333",metallicRingShadow:o?null:$,buttons:v,legacyHomeButton:o?{top:h+t.height+(x-g)/2,left:t.width/2-g/2+l,size:g,ring:E}:null,showHomeIndicator:t.homeIndicatorHeight>0,logicalHomeIndicatorStripHeight:t.homeIndicatorHeight}}function L(e){let t=e.side==="right",r=t?"inset(-3px -3px -3px 0)":"inset(-3px 0 -3px -3px)";return`
|
|
3
3
|
<div
|
|
4
4
|
aria-hidden="true"
|
|
5
5
|
style="
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as p,b as $,c as w,e as y,f as R}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as p,b as $,c as w,e as y,f as R}from"./chunk-XSWATK6S.js";import{a as d}from"./chunk-7C6RC3BU.js";import{C as m,D as a,E as h,F as f,l as v}from"./chunk-53KKDNCU.js";import b from"fs";import{WebSocket as A}from"ws";async function P(n,e={}){let[o,...t]=n;if(!o||o==="--help"||o==="-h"){O();return}switch(o){case"install":return D(t,e);case"list":case"ls":return N(t);case"use":return T(t);case"remove":case"rm":return L(t);case"which":case"active":return _();case"notes":case"changelog":return C(t);default:console.error(` unknown runtime subcommand: ${o}`),O(),process.exit(1)}}function O(){console.log(`
|
|
3
3
|
sootsim runtime \u2014 manage engine runtimes under ~/.sootsim/runtimes/
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -24,4 +24,4 @@ examples:
|
|
|
24
24
|
sootsim runtime install --channel beta
|
|
25
25
|
sootsim runtime use 1.2.3
|
|
26
26
|
sootsim runtime notes
|
|
27
|
-
`)}async function D(n,e){let{version:o,flags:t}=E(n),s=t.channel??e.channel??"stable",l=t.force===!0,c=t.setActive!==!1;m(),console.log("sootsim runtime install"),console.log(` cdn: ${w()}`);try{let i=await R({version:o,channel:s,force:l,setActive:c});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),c&&await I(i.version)}catch(i){console.error(` ${k(i)}`),process.exit(1)}}async function I(n){h(n),console.log(` active: ${n}`),await S(n)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${n})`)}async function S(n){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-
|
|
27
|
+
`)}async function D(n,e){let{version:o,flags:t}=E(n),s=t.channel??e.channel??"stable",l=t.force===!0,c=t.setActive!==!1;m(),console.log("sootsim runtime install"),console.log(` cdn: ${w()}`);try{let i=await R({version:o,channel:s,force:l,setActive:c});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),c&&await I(i.version)}catch(i){console.error(` ${k(i)}`),process.exit(1)}}async function I(n){h(n),console.log(` active: ${n}`),await S(n)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${n})`)}async function S(n){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-THYEF54Y.js"),t=o();if(!e(t))return!1;let s=d();return new Promise(l=>{let c=!1,i=!1,u=x=>{c||(c=!0,l(x))},r=new A(`ws://127.0.0.1:${s}`,{handshakeTimeout:800}),g=setTimeout(()=>{try{r.close()}catch{}u(i)},1500);r.on("open",()=>{try{r.send(JSON.stringify({type:"runtime:use",version:n,id:0})),i=!0}catch{}setTimeout(()=>{try{r.close()}catch{}},100)}),r.on("close",()=>{clearTimeout(g),u(i)}),r.on("error",()=>{clearTimeout(g),u(!1)})})}async function N(n){m();let e=f(),o=a();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let t of e)console.log(` ${t===o?"*":" "} ${t}`);try{let t=await y();console.log("available (latest per channel):");for(let[s,l]of Object.entries(t.channels))console.log(` ${s.padEnd(8)} ${l.latest}`)}catch(t){console.log(`available: (could not fetch manifest: ${k(t)})`)}}async function T(n){let e=n[0];e||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let o=f();o.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${o.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${e}\` first`),process.exit(1)),await I(e)}async function L(n){let e=n[0];e||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),a()===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 t=v(e);if(!b.existsSync(t)){console.error(` ${e} is not installed`);return}b.rmSync(t,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function _(){let n=a();if(!n){console.log(" no active runtime");return}console.log(n)}async function C(n){n.length>0&&(console.error(" usage: sootsim runtime notes"),process.exit(1));let e=a();e&&console.log(` active runtime: v${e}`),console.log(` release notes: ${$}`)}function E(n){let e={},o=[];for(let t=0;t<n.length;t++){let s=n[t];if(s==="--channel"&&t+1<n.length){e.channel=n[t+1],t++;continue}if(s.startsWith("--channel=")){e.channel=s.slice(10);continue}if(s==="--force"){e.force=!0;continue}if(s==="--set-active=false"||s==="--no-set-active"){e.setActive=!1;continue}o.push(s)}return{version:o[0]??null,flags:e}}function k(n){return n instanceof Error?n.message:String(n)}export{P as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as M,b as U}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as M,b as U}from"./chunk-YYS2ITHH.js";var _="sootsimConfig";function m(e){return!!e&&Object.keys(e).length>0}function $(e){return e?m(e.modules)||m(e.turboModules)||m(e.nativeModules)||m(e.env)||m(e.network?.remap)||m(e.settings)||m(e.initialState):!1}function D(e,o){let n=new URL(e);return $(o)?n.searchParams.set(_,JSON.stringify(o)):n.searchParams.delete(_),n.toString()}var ae="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function E(e){return/^https?:\/\//i.test(e)}function T(e){return e.endsWith(".bundle")}function L(e){process.env.SOOTSIM_PREVIEW_PROD_BUNDLE&&(e.searchParams.set("dev","false"),e.searchParams.set("minify","true"),e.searchParams.has("hot")&&e.searchParams.set("hot","false"))}function N(e){try{let o=E(e),n=new URL(e,"http://soot.local");return n.pathname=n.pathname.replace(/\.\.bundle$/,".bundle"),T(n.pathname)?(n.searchParams.delete("transform.bytecode"),n.searchParams.get("lazy")==="true"&&n.searchParams.set("lazy","false"),L(n),o?n.toString():`${n.pathname}${n.search}${n.hash}`):e}catch{return e}}function ce(e,o){try{let n=E(e),t=new URL(e,"http://soot.local");return T(t.pathname)?(t.searchParams.set("hot",o?"true":"false"),n?t.toString():`${t.pathname}${t.search}${t.hash}`):e}catch{return e}}import{exec as O}from"child_process";import I from"http";import j from"net";import{promisify as B}from"util";var k=B(O);M();var H=250,F=1500,W=120;function G(e,o=W){return new Promise(n=>{let t=new j.Socket,s=!1,i=a=>{s||(s=!0,t.destroy(),n(a))};t.setTimeout(o),t.once("connect",()=>i(!0)),t.once("timeout",()=>i(!1)),t.once("error",()=>i(!1)),t.connect(e,"localhost")})}function h(e,o,n="GET",t=H,s={}){return new Promise(i=>{let a=I.request({hostname:"localhost",port:e,path:o,method:n,timeout:t,headers:s},r=>{let c="";r.on("data",l=>c+=l.toString());let u=(()=>{let l=r.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();r.on("end",()=>i({statusCode:r.statusCode||0,body:c,contentType:u}))});a.on("error",()=>i(null)),a.setTimeout(t,()=>{a.destroy(),i(null)}),a.end()})}var z=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function P(e,o){return!(e<=0||e>=2e4||o.has(e)||e>=5170&&e<=5200)}async function J(e=[]){let o=new Set(e);try{let{stdout:n}=await k("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(n.trim()){let t=new Map;for(let s of n.trim().split(`
|
|
3
3
|
`)){let i=s.trim().split(/\s+/);if(i.length<9)continue;let a=Number(i[1]),c=i[8].match(/:(\d+)$/);if(!c)continue;let u=Number(c[1]);P(u,o)&&(t.has(u)||t.set(u,a))}if(t.size>0)return[...t.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}try{let{stdout:n}=await k(`ss -tlnp 2>/dev/null | grep -E '"(node|bun)"'`,{encoding:"utf8",timeout:2e3});if(n.trim()){let t=new Map;for(let s of n.trim().split(`
|
|
4
4
|
`)){let i=s.match(/:(\d+)\s/),a=s.match(/pid=(\d+)/);if(!i)continue;let r=Number(i[1]),c=a?Number(a[1]):0;P(r,o)&&(t.has(r)||t.set(r,c))}if(t.size>0)return[...t.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}return z.filter(n=>P(n.port,o))}var v=new Map;async function K(e){if(e<=0)return null;let o=v.get(e);if(o)return o;try{let{stdout:n}=await k(`lsof -p ${e} -a -d cwd -Fn 2>/dev/null`,{encoding:"utf8",timeout:1500});for(let t of n.split(`
|
|
5
5
|
`))if(t.startsWith("n")&&t.length>1){let s=t.slice(1).trim();if(s)return v.set(e,s),s}}catch{}return null}function V(e,o){return{port:e,framework:o,bundleUrl:g(e,`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()}}function g(e,o){let n=U().find(s=>s.preferredPort===e),t=n?.runtimeConfig?D(o,n.runtimeConfig):o;return N(t)}function q(e){return e.includes("/node_modules/one/metro-entry.bundle")}function Q(e){try{let o=JSON.parse(e);return o&&typeof o=="object"?o:null}catch{return null}}function S(e,o,n){if(!o)return e;try{let t=JSON.parse(o.body),s=t?.extra?.expoClient||t?.extra||{};s.name&&(e.projectName=s.name),s.ios?.bundleIdentifier&&(e.bundleId=s.ios.bundleIdentifier),e.framework==="metro"&&s.sdkVersion&&(e.framework="expo");let i=t?.launchAsset?.url;i&&!e.patched&&!q(e.bundleUrl)&&(e.bundleUrl=g(e.port,i));let a=s.iconUrl||s.ios?.iconUrl||s.icon||s.ios?.icon;if(a)if(e.iconPath=a,n)if(a.startsWith("http"))e.iconUrl=n(a);else{let r=a.replace(/^\.\//,"");e.iconUrl=n(`http://localhost:${e.port}/assets/${r}`)}else e.iconUrl=a.startsWith("http")?a:`http://localhost:${e.port}/assets/${a.replace(/^\.\//,"")}`}catch{}return e}var Y=2e4,b=new Map,R=new Set;function C(e,o){if(e.projectName)return e;let n=b.get(e.port);if(n)return n.projectName&&(e.projectName=n.projectName),n.iconUrl&&!e.iconUrl&&(e.iconUrl=n.iconUrl,e.iconPath=n.iconPath),n.bundleId&&!e.bundleId&&(e.bundleId=n.bundleId),e;if(!R.has(e.port)){R.add(e.port);let t=e.port;X(t,o).finally(()=>R.delete(t))}return e}async function X(e,o){let n=await h(e,"/","GET",Y,{"expo-platform":"ios"});if(!n||n.statusCode!==200)return;let t=S({port:e,framework:"one",bundleUrl:"",lastSeen:0},n,o);!t.projectName&&!t.iconUrl||(b.set(e,{projectName:t.projectName,iconUrl:t.iconUrl,iconPath:t.iconPath,bundleId:t.bundleId}),w.delete(e))}var d=new Set,p=new Set,y=new Set;async function Z(e,o){if(!await G(e))return null;let n="/node_modules/one/metro-entry.bundle?platform=ios&dev=true",[t,s,i,a]=await Promise.all([d.has(e)?Promise.resolve(null):h(e,"/__soot/"),h(e,"/status"),y.has(e)?Promise.resolve(null):h(e,"/","GET",F,{"expo-platform":"ios"}),p.has(e)?Promise.resolve(null):h(e,"/_expo/status")]);a&&a.statusCode===200?p.delete(e):p.has(e)||p.add(e);let r=i?Q(i.body):null,c=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:null,u=r?.extra?.expoClient||r?.extra||{};if(r&&(c||typeof u.name=="string")){d.add(e);let x=c||`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`,A=x.includes("/one/metro-entry.bundle")?"one":"expo";return S({port:e,framework:A,bundleUrl:g(e,x),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,o)}if(s&&s.body.includes("packager-status:running"))return d.add(e),C(S(V(e,a&&a.statusCode===200?"expo":"metro"),i,o),o);if(t&&t.statusCode===200&&t.body.includes("sootsim-patched"))return d.delete(e),C(S({port:e,framework:"one",bundleUrl:g(e,`http://localhost:${e}/__soot/bundle.js`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now(),patched:!0},i,o),o);if(s&&s.statusCode===200||a&&a.statusCode===200||i&&i.statusCode===200&&r!=null)return null;let f=await h(e,n,"HEAD");return f&&f.statusCode>0&&f.statusCode<400&&/application\/javascript/i.test(f.contentType||"")?(d.add(e),y.add(e),C(S({port:e,framework:"one",bundleUrl:g(e,`http://localhost:${e}${n}&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,o),o)):(d.add(e),null)}function ee(e){return!!e.bundleId?.trim().toLowerCase()?.startsWith("dev.sootsim.")}var w=new Map,ne=3e4,te=1500;function re(e){return!e||e.framework==="metro"||e.framework==="unknown"}function oe(e){return e?g(e.port,e.bundleUrl)===e.bundleUrl:!0}function se(e,o,n=Date.now()){if(o===0||e.pid!==o||!oe(e.result))return!1;let t=n-e.cachedAt;return!(e.result===null&&t>=ne||re(e.result)&&t>=te)}async function Se(e={}){let o=await J(e.excludePorts),n=new Set(o.map(r=>r.port));for(let r of[...w.keys()])n.has(r)||w.delete(r);for(let r of[...d])n.has(r)||d.delete(r);for(let r of[...p])n.has(r)||p.delete(r);for(let r of[...y])n.has(r)||y.delete(r);for(let r of[...b.keys()])n.has(r)||b.delete(r);let t=[],s=[];for(let{port:r,pid:c}of o){let u=w.get(r);if(u&&se(u,c)){u.result&&t.push(u.result);continue}u&&u.pid!==c&&(d.delete(r),p.delete(r),y.delete(r),b.delete(r)),s.push({port:r,pid:c})}s.length>0&&(await Promise.all(s.map(c=>Z(c.port,e.buildIconProxyUrl)))).forEach((c,u)=>{let{port:l,pid:f}=s[u];f!==0&&w.set(l,{pid:f,result:c,cachedAt:Date.now()}),c&&t.push(c)});let i=new Map;for(let{port:r,pid:c}of o)c>0&&i.set(r,c);await Promise.all(t.map(async r=>{let c=i.get(r.port);if(!c)return;r.pid=c;let u=await K(c);u&&(r.cwd=u)}));let a=new Set(i.values());for(let r of[...v.keys()])a.has(r)||v.delete(r);return t.filter(r=>!ee(r))}export{D as a,ae as b,N as c,ce as d,Z as e,Se as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.184 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{createHash as b}from"node:crypto";import g from"node:fs";import{createRequire as S}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=S(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 R=["app.config.js","app.config.ts","app.config.cjs","app.config.mjs","app.json"];function w(t){for(let n of R)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 F(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)||F(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.SOOT_REPO_DIR,o=r?u.resolve(r):process.cwd();if(!r&&!_(o))return[];let e=[];if(r)F(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.SOOT_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 A=f.exp.plugins;if(Array.isArray(A)){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 G(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,G as d};
|