rnxsim 0.1.313 → 0.1.315
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/LICENSE +11 -10
- package/README.md +5 -0
- package/cli/app-config.ts +65 -0
- package/cli/app-fonts.ts +408 -0
- package/cli/app-project.ts +231 -0
- package/cli/app-splash.ts +185 -0
- package/cli/app-state-reset.ts +24 -0
- package/cli/auth.ts +155 -0
- package/cli/bin.ts +594 -0
- package/cli/bridge-diagnostics.ts +226 -0
- package/cli/bridge-flow-runner.ts +2830 -0
- package/cli/browser-evals.ts +96 -0
- package/cli/commands/agent-wrapper.ts +986 -0
- package/cli/commands/agent.ts +423 -0
- package/cli/commands/app-fonts.ts +98 -0
- package/cli/commands/assert.ts +541 -0
- package/cli/commands/auth.ts +59 -0
- package/cli/commands/camera.ts +266 -0
- package/cli/commands/cleanup.ts +169 -0
- package/cli/commands/compat.ts +87 -0
- package/cli/commands/config.ts +32 -0
- package/cli/commands/control.ts +2142 -0
- package/cli/commands/cpu-profile.ts +269 -0
- package/cli/commands/daemon-mac-app.ts +169 -0
- package/cli/commands/daemon.ts +874 -0
- package/cli/commands/debug.ts +719 -0
- package/cli/commands/desktop.ts +39 -0
- package/cli/commands/detect.ts +197 -0
- package/cli/commands/detox.ts +385 -0
- package/cli/commands/device.ts +133 -0
- package/cli/commands/diagnose.ts +589 -0
- package/cli/commands/electron.ts +95 -0
- package/cli/commands/film.ts +379 -0
- package/cli/commands/flow.ts +1124 -0
- package/cli/commands/inspect/actions.ts +622 -0
- package/cli/commands/inspect/core.ts +2405 -0
- package/cli/commands/inspect/count.ts +17 -0
- package/cli/commands/inspect/describe.ts +192 -0
- package/cli/commands/inspect/env.ts +23 -0
- package/cli/commands/inspect/find.ts +171 -0
- package/cli/commands/inspect/get-layout.ts +39 -0
- package/cli/commands/inspect/keyboard.ts +52 -0
- package/cli/commands/inspect/list.ts +58 -0
- package/cli/commands/inspect/memory.ts +215 -0
- package/cli/commands/inspect/redaction.ts +39 -0
- package/cli/commands/inspect/resolve-target.ts +82 -0
- package/cli/commands/inspect/screens.ts +78 -0
- package/cli/commands/inspect/settle.ts +22 -0
- package/cli/commands/inspect/settling.ts +158 -0
- package/cli/commands/inspect/shared.ts +353 -0
- package/cli/commands/inspect/sleep.ts +14 -0
- package/cli/commands/inspect/tree.ts +32 -0
- package/cli/commands/inspect/url.ts +17 -0
- package/cli/commands/inspect/wait-event.ts +210 -0
- package/cli/commands/inspect/wait-idle.ts +24 -0
- package/cli/commands/inspect/wait-ready.ts +74 -0
- package/cli/commands/inspect/wait-selector.ts +54 -0
- package/cli/commands/inspect/wait.ts +31 -0
- package/cli/commands/inspect.ts +4519 -0
- package/cli/commands/install-desktop.ts +351 -0
- package/cli/commands/login.ts +331 -0
- package/cli/commands/logout.ts +31 -0
- package/cli/commands/maestro-generate.ts +361 -0
- package/cli/commands/maestro.ts +453 -0
- package/cli/commands/mode.ts +57 -0
- package/cli/commands/no-bridge-hint.ts +80 -0
- package/cli/commands/perf.ts +66 -0
- package/cli/commands/permissions.ts +203 -0
- package/cli/commands/profile.ts +108 -0
- package/cli/commands/react.ts +353 -0
- package/cli/commands/record.ts +1434 -0
- package/cli/commands/report-issue.ts +305 -0
- package/cli/commands/reset.ts +85 -0
- package/cli/commands/runtime.ts +351 -0
- package/cli/commands/screenshot-command.ts +106 -0
- package/cli/commands/screenshot-layers.ts +143 -0
- package/cli/commands/screenshot-mode.ts +37 -0
- package/cli/commands/screenshot.ts +488 -0
- package/cli/commands/screenshots-capture.ts +607 -0
- package/cli/commands/screenshots.ts +127 -0
- package/cli/commands/serve.ts +168 -0
- package/cli/commands/setup.ts +545 -0
- package/cli/commands/shell-boolean-mode.ts +81 -0
- package/cli/commands/skills.ts +467 -0
- package/cli/commands/slides.ts +361 -0
- package/cli/commands/state.ts +87 -0
- package/cli/commands/storage.ts +58 -0
- package/cli/commands/telemetry.ts +54 -0
- package/cli/commands/three-mode.ts +763 -0
- package/cli/commands/timeline.ts +122 -0
- package/cli/commands/upgrade.ts +208 -0
- package/cli/commands/upload.ts +1225 -0
- package/cli/commands/version.ts +54 -0
- package/cli/commands/what-happened.ts +327 -0
- package/cli/current-sim.ts +204 -0
- package/cli/desktop-companion.ts +300 -0
- package/cli/drivers/electron.ts +70 -0
- package/cli/drivers/index.ts +20 -0
- package/cli/drivers/playwright-provisioning.ts +180 -0
- package/cli/drivers/playwright.ts +698 -0
- package/cli/drivers/registry.ts +65 -0
- package/cli/drivers/types.ts +102 -0
- package/cli/flow-file.ts +142 -0
- package/cli/flow-live-status.ts +120 -0
- package/cli/flow-session.ts +187 -0
- package/cli/help.ts +80 -0
- package/cli/hidden-runtime-alias.ts +19 -0
- package/cli/hints.ts +216 -0
- package/cli/inspect-notice-state.ts +114 -0
- package/cli/maestro-js.ts +334 -0
- package/cli/open-url.ts +8 -0
- package/cli/parent-pid.ts +204 -0
- package/cli/parse-args.ts +211 -0
- package/cli/prompt.ts +51 -0
- package/cli/recording-access.ts +107 -0
- package/cli/registry.ts +1 -0
- package/cli/resolve-assets.ts +63 -0
- package/cli/run-registry.ts +226 -0
- package/cli/runtime-notes.ts +66 -0
- package/cli/runtime-summary.ts +25 -0
- package/cli/setup-repository.ts +187 -0
- package/cli/telemetry.ts +187 -0
- package/cli/ws-bridge.ts +798 -0
- package/dist-cli/bin.js +5 -5
- package/dist-cli/chunks/{agent-XZ2KTPCU.js → agent-CBU2WDKV.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-JJYYW2WH.js → agent-wrapper-UNB4R27L.js} +2 -2
- package/dist-cli/chunks/{app-fonts-IXRNQG6B.js → app-fonts-YMLRF3JD.js} +2 -2
- package/dist-cli/chunks/{assert-54T5SK5F.js → assert-5N6HUCL5.js} +2 -2
- package/dist-cli/chunks/{auth-FI5UDI45.js → auth-BHDR3A6G.js} +2 -2
- package/dist-cli/chunks/{beta-JV6UKADW.js → beta-LWUVCPYK.js} +2 -2
- package/dist-cli/chunks/camera-CNO6B2JZ.js +33 -0
- package/dist-cli/chunks/{chunk-ZMJD5GEC.js → chunk-25VCR44B.js} +1 -1
- package/dist-cli/chunks/{chunk-WUSWBCWA.js → chunk-26CSIR76.js} +8 -9
- package/dist-cli/chunks/{chunk-WINYQ44O.js → chunk-26WMWUH4.js} +1 -1
- package/dist-cli/chunks/{chunk-BTWORNNG.js → chunk-2JZ53D4A.js} +1 -1
- package/dist-cli/chunks/{chunk-DCEMHR2Y.js → chunk-2POODCTW.js} +2 -2
- package/dist-cli/chunks/{chunk-5TEF3ET3.js → chunk-4LTBK3ZN.js} +2 -2
- package/dist-cli/chunks/{chunk-NMF2ZMZQ.js → chunk-54MIRTFE.js} +4 -4
- package/dist-cli/chunks/{chunk-WEXDAC74.js → chunk-56H6EVO4.js} +2 -2
- package/dist-cli/chunks/{chunk-F5ZRSS3C.js → chunk-657SQG4D.js} +1 -1
- package/dist-cli/chunks/{chunk-IJ5CAZZC.js → chunk-6ZMRJPKI.js} +1 -1
- package/dist-cli/chunks/{chunk-W6K4EFPH.js → chunk-AOGGOC4V.js} +2 -2
- package/dist-cli/chunks/chunk-BPCDO7ST.js +15 -0
- package/dist-cli/chunks/{chunk-D4FFVGI5.js → chunk-C5O5CTXJ.js} +1 -1
- package/dist-cli/chunks/{chunk-RTN5C5RL.js → chunk-CMM64PPR.js} +1 -1
- package/dist-cli/chunks/{chunk-BBULZ7CG.js → chunk-D3M36D7O.js} +62 -87
- package/dist-cli/chunks/{chunk-5DHC6KHQ.js → chunk-DNCNFZ7V.js} +1 -1
- package/dist-cli/chunks/{chunk-YIFT42WN.js → chunk-FNTTIR2P.js} +2 -2
- package/dist-cli/chunks/chunk-H362IX2I.js +4 -0
- package/dist-cli/chunks/{chunk-IJO63TDP.js → chunk-J6HMTUZH.js} +2 -2
- package/dist-cli/chunks/{chunk-RSZWCKNT.js → chunk-JZ6VTZ5B.js} +3 -3
- package/dist-cli/chunks/{chunk-MJRLLB4R.js → chunk-KQSJVNFE.js} +4 -4
- package/dist-cli/chunks/chunk-L4JZKVCC.js +6 -0
- package/dist-cli/chunks/{chunk-VFCMSYZK.js → chunk-LP2BTEJ6.js} +2 -2
- package/dist-cli/chunks/{chunk-2YR5BGA5.js → chunk-LT6UC7I3.js} +2 -2
- package/dist-cli/chunks/{chunk-OVFJFXUD.js → chunk-MCKQH4AM.js} +2 -2
- package/dist-cli/chunks/{chunk-TZFFR3SD.js → chunk-MF7WUHQ3.js} +2 -2
- package/dist-cli/chunks/{chunk-46EUUFJ5.js → chunk-MSSY4EEZ.js} +1 -1
- package/dist-cli/chunks/{chunk-WMIIKMGK.js → chunk-N5ZCYP5F.js} +2 -2
- package/dist-cli/chunks/{chunk-3NV2NCNX.js → chunk-NCKAD3V7.js} +2 -2
- package/dist-cli/chunks/{chunk-VNQEB4L7.js → chunk-O2KRHVTU.js} +2 -2
- package/dist-cli/chunks/{chunk-OZSSI4WN.js → chunk-OF2HTH25.js} +2 -2
- package/dist-cli/chunks/{chunk-GGRX24GF.js → chunk-OXS2IWO2.js} +2 -2
- package/dist-cli/chunks/{chunk-WWZIXIRD.js → chunk-PVL7XSPN.js} +1 -1
- package/dist-cli/chunks/{chunk-DZS6WPUI.js → chunk-PVPAP3TV.js} +1 -1
- package/dist-cli/chunks/{chunk-5YJCOWCH.js → chunk-PXNAZYGV.js} +1 -1
- package/dist-cli/chunks/chunk-QR3HTFRB.js +5 -0
- package/dist-cli/chunks/{chunk-5TPRP5QT.js → chunk-QR7MWAWE.js} +1 -1
- package/dist-cli/chunks/chunk-RJIEZ2NY.js +4 -0
- package/dist-cli/chunks/{chunk-UC6U3MML.js → chunk-RVM4EZ4E.js} +2 -2
- package/dist-cli/chunks/{chunk-2D2UPBBR.js → chunk-SZKSFMWS.js} +1 -1
- package/dist-cli/chunks/{chunk-7GN3LVWB.js → chunk-TEL7G234.js} +2 -2
- package/dist-cli/chunks/{chunk-GASE6UBA.js → chunk-U2HNIHBY.js} +1 -1
- package/dist-cli/chunks/chunk-UROXJVY3.js +27 -0
- package/dist-cli/chunks/{chunk-HI5TFJWN.js → chunk-WM32MGTJ.js} +2 -2
- package/dist-cli/chunks/{chunk-VZXWHRUZ.js → chunk-WMZ7NJAO.js} +89 -133
- package/dist-cli/chunks/{chunk-XEVZYVIW.js → chunk-WUXCH6WN.js} +10 -9
- package/dist-cli/chunks/chunk-XOXGC3EH.js +9 -0
- package/dist-cli/chunks/chunk-XSSHENNY.js +4 -0
- package/dist-cli/chunks/{chunk-OHAZNXLK.js → chunk-XZ6O67AR.js} +1 -1
- package/dist-cli/chunks/{chunk-QKDWYITG.js → chunk-Y2MWQKOS.js} +3 -3
- package/dist-cli/chunks/{chunk-YDGQTMQL.js → chunk-YY24QI25.js} +1 -1
- package/dist-cli/chunks/{chunk-WF3T4SVI.js → chunk-ZWX6DDIS.js} +2 -2
- package/dist-cli/chunks/{cleanup-P27PA6JI.js → cleanup-F3NUJ3SL.js} +2 -2
- package/dist-cli/chunks/cli-version-XIW6O3FG.js +4 -0
- package/dist-cli/chunks/{compat-ZD65FED3.js → compat-AX2SEPTH.js} +2 -2
- package/dist-cli/chunks/{config-XMJRNM2A.js → config-4QQO5JVU.js} +2 -2
- package/dist-cli/chunks/{control-KMIQT3QP.js → control-OCKKSOWA.js} +2 -2
- package/dist-cli/chunks/daemon-N5VLMYKQ.js +4 -0
- package/dist-cli/chunks/{debug-PT4HOP7N.js → debug-T6MWVEVX.js} +5 -5
- package/dist-cli/chunks/{desktop-S3FG72AK.js → desktop-NCW7R7CB.js} +3 -3
- package/dist-cli/chunks/{detox-B3D4IFCN.js → detox-G6GITO2X.js} +2 -2
- package/dist-cli/chunks/{device-XBNDSB2R.js → device-7BTEJCTH.js} +2 -2
- package/dist-cli/chunks/{diagnose-HMQXJE5N.js → diagnose-SC5LACE3.js} +2 -2
- package/dist-cli/chunks/{disk-cleanup-BLCZ5BSZ.js → disk-cleanup-KK56QQZA.js} +2 -2
- package/dist-cli/chunks/drivers-NPGVBWMG.js +4 -0
- package/dist-cli/chunks/{film-BJGTBYZB.js → film-WGYEHGIA.js} +3 -3
- package/dist-cli/chunks/flow-KQBIBM3N.js +4 -0
- package/dist-cli/chunks/help-G7CAKI65.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-ANOYADHM.js → hidden-runtime-alias-CWTZWH3L.js} +2 -2
- package/dist-cli/chunks/home-paths-EBT4XHAS.js +4 -0
- package/dist-cli/chunks/inspect-CCPZXVDU.js +4 -0
- package/dist-cli/chunks/install-desktop-NZ3VGTQZ.js +4 -0
- package/dist-cli/chunks/{login-FJ737MWG.js → login-GSYOTGVQ.js} +4 -4
- package/dist-cli/chunks/{logout-ZCNMMHMY.js → logout-JPRIR7YK.js} +2 -2
- package/dist-cli/chunks/{maestro-SZTNKLDF.js → maestro-LXKDNO5M.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-DCFAIZ4H.js → maestro-generate-5ZIKOU53.js} +3 -3
- package/dist-cli/chunks/{mode-GRMQCRXR.js → mode-N3QHXCES.js} +2 -2
- package/dist-cli/chunks/{optional-demo-registry-W36EWFFB.js → optional-demo-registry-XDH6X24N.js} +2 -2
- package/dist-cli/chunks/{perf-QYBAAUZG.js → perf-VOPL26FM.js} +2 -2
- package/dist-cli/chunks/{permissions-3QCQ6VF4.js → permissions-CZFKM4UD.js} +2 -2
- package/dist-cli/chunks/{record-QPPC2S4E.js → record-FODSOGMA.js} +3 -3
- package/dist-cli/chunks/{report-issue-7NMFP4HK.js → report-issue-FBPCZKOV.js} +2 -2
- package/dist-cli/chunks/reset-3H35GFO3.js +4 -0
- package/dist-cli/chunks/runtime-4OVFRXV5.js +4 -0
- package/dist-cli/chunks/{screenshot-command-67AECJFB.js → screenshot-command-7S3FYVO7.js} +7 -7
- package/dist-cli/chunks/{screenshot-layers-ASWBYPJL.js → screenshot-layers-CDYHPNC3.js} +3 -3
- package/dist-cli/chunks/{screenshots-capture-PXA3HFQK.js → screenshots-capture-EBIIY2YU.js} +2 -2
- package/dist-cli/chunks/serve-NELNSCZP.js +44 -0
- package/dist-cli/chunks/{setup-7DWPMRSB.js → setup-DF5ZDDIV.js} +2 -2
- package/dist-cli/chunks/{skills-S3Y22TUA.js → skills-E2QZF6WZ.js} +2 -2
- package/dist-cli/chunks/state-MBZDKZ7U.js +14 -0
- package/dist-cli/chunks/{storage-XUIMJWAJ.js → storage-J5BMNVXM.js} +6 -6
- package/dist-cli/chunks/store-U3DXC7HH.js +4 -0
- package/dist-cli/chunks/telemetry-XIPJVT5E.js +4 -0
- package/dist-cli/chunks/{timeline-TMPLQPSP.js → timeline-MC6N5BHY.js} +2 -2
- package/dist-cli/chunks/{upgrade-7HDSIM7K.js → upgrade-7UTU53DH.js} +2 -2
- package/dist-cli/chunks/upload-2M2KOTYI.js +4 -0
- package/dist-cli/chunks/version-VNACNYQK.js +6 -0
- package/dist-cli/chunks/{web-DG3WBYD3.js → web-MGJ2TUKR.js} +2 -2
- package/dist-cli/chunks/{what-happened-XFVUTZR7.js → what-happened-7DLKH3OD.js} +3 -3
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract.cjs +20 -0
- 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 +67 -28
- package/dist-lib/host/bridge-host.cjs +140 -12
- 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 +2815 -40
- 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/public-brand.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 +2549 -2061
- package/dist-lib/sdk.mjs +2543 -2061
- package/dist-lib/skills.cjs +480 -280
- package/dist-lib/vite.cjs +1 -1
- package/package.json +8 -2
- package/src/bridge-constants.ts +3 -4
- package/src/bridge-contract.ts +251 -0
- package/src/connect.ts +83 -0
- package/src/disk-cleanup.ts +30 -0
- package/src/home-paths.ts +81 -38
- package/src/host/bridge-host.ts +134 -6
- package/src/index.ts +27 -1
- package/src/sdk.ts +8 -0
- package/src/sim-client.ts +660 -0
- package/dist-cli/chunks/camera-VL73YIKP.js +0 -22
- package/dist-cli/chunks/chunk-4NPPOV2N.js +0 -5
- package/dist-cli/chunks/chunk-FSUYIVJ6.js +0 -9
- package/dist-cli/chunks/chunk-G2WW6L2C.js +0 -23
- package/dist-cli/chunks/chunk-KTHV3RUS.js +0 -26
- package/dist-cli/chunks/chunk-LF2ZVT7O.js +0 -6
- package/dist-cli/chunks/chunk-NFK7T35W.js +0 -4
- package/dist-cli/chunks/chunk-TIVZIMMW.js +0 -4
- package/dist-cli/chunks/cli-version-WWLPBDQ7.js +0 -4
- package/dist-cli/chunks/daemon-G2ME7NLB.js +0 -4
- package/dist-cli/chunks/drivers-LDECZGP2.js +0 -4
- package/dist-cli/chunks/flow-UEQNVTU7.js +0 -4
- package/dist-cli/chunks/help-T5FYSVGB.js +0 -4
- package/dist-cli/chunks/home-paths-GT3LFNOR.js +0 -4
- package/dist-cli/chunks/inspect-ZA6XF5LD.js +0 -4
- package/dist-cli/chunks/install-desktop-TIMUDHPL.js +0 -4
- package/dist-cli/chunks/runtime-XOAXMSTU.js +0 -4
- package/dist-cli/chunks/serve-BI2NBAXG.js +0 -44
- package/dist-cli/chunks/store-JTHEJLAZ.js +0 -4
- package/dist-cli/chunks/telemetry-ZYJGD2DB.js +0 -4
- package/dist-cli/chunks/upload-GMSZPWM6.js +0 -4
- package/dist-cli/chunks/version-HOCHZ37L.js +0 -6
package/cli/bin.ts
ADDED
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// sootsim CLI entry point. the full command and verb surface lives in the
|
|
4
|
+
// registry at `packages/sootsim-skills/src/cli/meta.ts` — help output,
|
|
5
|
+
// website docs, and agent skills all read from there. do not duplicate
|
|
6
|
+
// command listings in this file; run `sootsim --help` for the canonical
|
|
7
|
+
// surface.
|
|
8
|
+
|
|
9
|
+
import { rnxPublicBrand } from '../src/public-brand'
|
|
10
|
+
import { parseArgs, TOP_LEVEL_RUNTIME_COMMANDS } from './parse-args'
|
|
11
|
+
|
|
12
|
+
// `./help` is loaded lazily (only on help paths) — it statically pulls the full
|
|
13
|
+
// CLI registry renderers and engine settings, which would otherwise add ~400ms
|
|
14
|
+
// of eager chunk load to every command, including hot-path reads like
|
|
15
|
+
// `describe` / `do tap` that never render help. parse-args has no imports, so
|
|
16
|
+
// the startup floor stays at the runtime's own cost (~15ms).
|
|
17
|
+
|
|
18
|
+
// keep top-level dispatch crashes readable. without this, a 10s WS bridge
|
|
19
|
+
// timeout (the most common failure when a sim is dead) prints a 1KB minified
|
|
20
|
+
// chunk of the bundled CLI source straight to stderr, which buries the actual
|
|
21
|
+
// "command timed out after 10s" message and is uncopyable for a bug report.
|
|
22
|
+
// rejections that don't match this shape still get the verbose stack so we
|
|
23
|
+
// don't paper over real bugs.
|
|
24
|
+
function handleTopLevelError(err: unknown): never {
|
|
25
|
+
const msg = err instanceof Error ? err.message : String(err)
|
|
26
|
+
// sootsim's known top-level errors are all single-line, narrow strings.
|
|
27
|
+
// everything else gets the full stack so unexpected crashes still surface.
|
|
28
|
+
const isKnownCliFailure =
|
|
29
|
+
/^command timed out after \d+s$/.test(msg) ||
|
|
30
|
+
msg.startsWith('sim disconnected:') ||
|
|
31
|
+
msg.startsWith('bridge never reconnected') ||
|
|
32
|
+
msg.startsWith('multiple sims are connected:') ||
|
|
33
|
+
msg.startsWith('saved sim ') ||
|
|
34
|
+
msg.startsWith('no sim connected with id ') ||
|
|
35
|
+
msg.startsWith('could not connect to ws://') ||
|
|
36
|
+
msg.startsWith('rnx bridge daemon is not running') ||
|
|
37
|
+
msg.startsWith('rnx bridge lockfile is fresh') ||
|
|
38
|
+
msg.startsWith('rnx bridge exited before becoming ready') ||
|
|
39
|
+
msg.startsWith(`${rnxPublicBrand.commandName} open: requested bridge port`) ||
|
|
40
|
+
msg.startsWith('background daemon setup is unavailable') ||
|
|
41
|
+
msg.startsWith('rnx bridge did not start within')
|
|
42
|
+
if (isKnownCliFailure && !process.env.SOOTSIM_VERBOSE) {
|
|
43
|
+
process.stderr.write(` ${msg}\n`)
|
|
44
|
+
process.exit(1)
|
|
45
|
+
}
|
|
46
|
+
if (err instanceof Error && err.stack) {
|
|
47
|
+
process.stderr.write(`${err.stack}\n`)
|
|
48
|
+
} else {
|
|
49
|
+
process.stderr.write(`${msg}\n`)
|
|
50
|
+
}
|
|
51
|
+
process.exit(1)
|
|
52
|
+
}
|
|
53
|
+
process.on('unhandledRejection', handleTopLevelError)
|
|
54
|
+
process.on('uncaughtException', handleTopLevelError)
|
|
55
|
+
|
|
56
|
+
// set to `true` by build-cli-binary.ts via esbuild define. in the standalone
|
|
57
|
+
// binary, commands that rely on vite / electron / playwright from the user's
|
|
58
|
+
// node_modules can't run — gate them with a friendly message rather than
|
|
59
|
+
// letting the dynamic import fail with a confusing module-not-found error.
|
|
60
|
+
declare const __SOOTSIM_STANDALONE__: boolean | undefined
|
|
61
|
+
const IS_STANDALONE =
|
|
62
|
+
typeof __SOOTSIM_STANDALONE__ !== 'undefined' && __SOOTSIM_STANDALONE__
|
|
63
|
+
|
|
64
|
+
const STANDALONE_BLOCKED_COMMANDS = new Set(['desktop'])
|
|
65
|
+
|
|
66
|
+
function exitIfStandaloneBlocked(cmd: string): void {
|
|
67
|
+
if (!IS_STANDALONE || !STANDALONE_BLOCKED_COMMANDS.has(cmd)) return
|
|
68
|
+
process.stderr.write(
|
|
69
|
+
` ${rnxPublicBrand.commandName} ${cmd} isn't available in the standalone binary —\n` +
|
|
70
|
+
` it needs vite / electron / playwright from a project's node_modules.\n` +
|
|
71
|
+
` run the npm package instead:\n` +
|
|
72
|
+
` ${rnxPublicBrand.commandName} ${cmd}\n`,
|
|
73
|
+
)
|
|
74
|
+
process.exit(1)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let parsed = parseArgs(process.argv)
|
|
78
|
+
|
|
79
|
+
// runtime actions and reads also work as hidden root aliases. resolve only
|
|
80
|
+
// after the normal parser declined the token, so a real top-level command
|
|
81
|
+
// always wins. keep this lazy so ordinary commands don't load the docs registry.
|
|
82
|
+
if (!parsed.command && parsed.commandArgs.length > 0) {
|
|
83
|
+
const { resolveHiddenRuntimeAlias } = await import('./hidden-runtime-alias')
|
|
84
|
+
parsed = resolveHiddenRuntimeAlias(parsed)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const isAutomaticCleanupWorker =
|
|
88
|
+
parsed.command === 'cleanup' &&
|
|
89
|
+
parsed.commandArgs.length === 1 &&
|
|
90
|
+
parsed.commandArgs[0] === '--automatic-worker'
|
|
91
|
+
|
|
92
|
+
// invocation telemetry. enqueued here, flushed by command-specific paths
|
|
93
|
+
// (most commands run long enough that the beforeExit drain catches the
|
|
94
|
+
// event; fast-exit paths like --version/--help explicitly flush below).
|
|
95
|
+
if (!isAutomaticCleanupWorker) {
|
|
96
|
+
const { trackCliEvent } = await import('./telemetry')
|
|
97
|
+
trackCliEvent({
|
|
98
|
+
event: 'cli_command_invoked',
|
|
99
|
+
properties: {
|
|
100
|
+
command:
|
|
101
|
+
parsed.command || (parsed.version ? 'version' : parsed.help ? 'help' : 'none'),
|
|
102
|
+
arg_count: parsed.commandArgs.length,
|
|
103
|
+
platform: process.platform,
|
|
104
|
+
arch: process.arch,
|
|
105
|
+
node_version: process.versions.node,
|
|
106
|
+
},
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// one-shot "engine upgraded in the background" banner. the daemon's hourly
|
|
111
|
+
// auto-updater writes a notice file when it swaps the runtime; whichever
|
|
112
|
+
// interactive command runs next prints it once (stderr, so --json stdout
|
|
113
|
+
// stays parseable) and deletes it. the daemon/serve processes skip it so a
|
|
114
|
+
// background process can't eat the notice before a human sees it.
|
|
115
|
+
if (parsed.command !== 'serve' && parsed.command !== 'daemon') {
|
|
116
|
+
const { consumeRuntimeUpgradeNotice } = await import('../src/home-paths')
|
|
117
|
+
const notice = consumeRuntimeUpgradeNotice()
|
|
118
|
+
if (notice) {
|
|
119
|
+
process.stderr.write(
|
|
120
|
+
` ${rnxPublicBrand.name} engine upgraded to v${notice.to}` +
|
|
121
|
+
(notice.from ? ` (from v${notice.from})` : '') +
|
|
122
|
+
` · what's new: ${rnxPublicBrand.origin}/changelog\n`,
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
let automaticCleanupFinished = false
|
|
128
|
+
async function scheduleAutomaticCleanup(): Promise<void> {
|
|
129
|
+
if (automaticCleanupFinished) return
|
|
130
|
+
automaticCleanupFinished = true
|
|
131
|
+
if (
|
|
132
|
+
parsed.command === 'cleanup' ||
|
|
133
|
+
parsed.command === 'serve' ||
|
|
134
|
+
parsed.command === 'agent-wrapper' ||
|
|
135
|
+
(parsed.command === 'daemon' && parsed.commandArgs[0] === 'uninstall')
|
|
136
|
+
) {
|
|
137
|
+
return
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
try {
|
|
141
|
+
const { isAutomaticSootsimCleanupComplete } = await import('../src/disk-cleanup')
|
|
142
|
+
if (isAutomaticSootsimCleanupComplete()) return
|
|
143
|
+
|
|
144
|
+
const { spawn } = await import('node:child_process')
|
|
145
|
+
const workerArgs = ['cleanup', '--automatic-worker']
|
|
146
|
+
const entry = process.argv[1]
|
|
147
|
+
const child = IS_STANDALONE
|
|
148
|
+
? spawn(process.execPath, workerArgs, {
|
|
149
|
+
detached: true,
|
|
150
|
+
stdio: ['ignore', 'ignore', 'inherit'],
|
|
151
|
+
env: process.env,
|
|
152
|
+
})
|
|
153
|
+
: entry
|
|
154
|
+
? spawn(process.execPath, [entry, ...workerArgs], {
|
|
155
|
+
detached: true,
|
|
156
|
+
stdio: ['ignore', 'ignore', 'inherit'],
|
|
157
|
+
env: process.env,
|
|
158
|
+
})
|
|
159
|
+
: spawn(rnxPublicBrand.commandName, workerArgs, {
|
|
160
|
+
detached: true,
|
|
161
|
+
stdio: ['ignore', 'ignore', 'inherit'],
|
|
162
|
+
env: process.env,
|
|
163
|
+
})
|
|
164
|
+
child.once('error', (error) => {
|
|
165
|
+
process.stderr.write(
|
|
166
|
+
` ${rnxPublicBrand.name} automatic cleanup will retry on the next run: ${error.message}\n`,
|
|
167
|
+
)
|
|
168
|
+
})
|
|
169
|
+
child.unref()
|
|
170
|
+
} catch (error) {
|
|
171
|
+
process.stderr.write(
|
|
172
|
+
` ${rnxPublicBrand.name} automatic cleanup will retry on the next run: ${
|
|
173
|
+
error instanceof Error ? error.message : String(error)
|
|
174
|
+
}\n`,
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// fast-exit helper: every path that calls process.exit before reaching a
|
|
180
|
+
// command function would lose the cli_command_invoked event because node
|
|
181
|
+
// doesn't await pending fetches on exit. flush first, then exit.
|
|
182
|
+
async function exitWithFlush(code: number): Promise<never> {
|
|
183
|
+
const { flushCliTelemetry } = await import('./telemetry')
|
|
184
|
+
await flushCliTelemetry()
|
|
185
|
+
await scheduleAutomaticCleanup()
|
|
186
|
+
process.exit(code)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// --version
|
|
190
|
+
if (parsed.version) {
|
|
191
|
+
// use the single canonical, cached version source — the same one
|
|
192
|
+
// `--help`, `upgrade`, the startup flow, and the bridge-host use. it
|
|
193
|
+
// previously re-read package.json independently here, which could
|
|
194
|
+
// resolve a different copy (stale global install vs repo) and drift
|
|
195
|
+
// from `--help` within one session (QA F20-4).
|
|
196
|
+
const { getCliVersion } = await import('../src/cli-version')
|
|
197
|
+
const { IS_BETA, BETA_LABEL } = await import('../src/beta')
|
|
198
|
+
const suffix = IS_BETA ? ` · ${BETA_LABEL}` : ''
|
|
199
|
+
console.log(`rnxsim v${getCliVersion()}${suffix}`)
|
|
200
|
+
// runtime version on its own line — keeps the first line parseable while
|
|
201
|
+
// surfacing the (independently-versioned) engine runtime users actually
|
|
202
|
+
// render with. see `sootsim upgrade`.
|
|
203
|
+
const { readActiveRuntime } = await import('../src/home-paths')
|
|
204
|
+
const runtime = readActiveRuntime()
|
|
205
|
+
console.log(runtime ? `runtime v${runtime}` : 'runtime not installed')
|
|
206
|
+
await exitWithFlush(0)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// --help with no command
|
|
210
|
+
if (parsed.help && !parsed.command) {
|
|
211
|
+
const { printHelp } = await import('./help')
|
|
212
|
+
printHelp()
|
|
213
|
+
await exitWithFlush(0)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// apply settings from global flags
|
|
217
|
+
const port = parsed.globalFlags['port'] as number | undefined
|
|
218
|
+
const verbose = parsed.verbose
|
|
219
|
+
const device = parsed.globalFlags['device'] as string | undefined
|
|
220
|
+
const theme = parsed.globalFlags['theme'] as string | undefined
|
|
221
|
+
const driver = parsed.globalFlags['driver'] as string | undefined
|
|
222
|
+
const headless = (parsed.globalFlags['headless'] as boolean | undefined) === true
|
|
223
|
+
const globalSimTarget = (parsed.globalFlags['sim'] ??
|
|
224
|
+
parsed.globalFlags['session'] ??
|
|
225
|
+
parsed.globalFlags['tab']) as string | undefined
|
|
226
|
+
const commandArgsWithSim = globalSimTarget
|
|
227
|
+
? ['--sim', globalSimTarget, ...parsed.commandArgs]
|
|
228
|
+
: parsed.commandArgs
|
|
229
|
+
|
|
230
|
+
// apply device/theme to settings store if provided
|
|
231
|
+
if (device || theme) {
|
|
232
|
+
const { settingsStore } = await import('sootsim-engine/settings/store')
|
|
233
|
+
const overrides: Record<string, any> = {}
|
|
234
|
+
if (device) overrides.deviceModel = device
|
|
235
|
+
if (theme) overrides.colorScheme = theme
|
|
236
|
+
settingsStore.apply(overrides)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// no command, no args: show the clean surface. setup/open own actual work.
|
|
240
|
+
if (!parsed.command && parsed.commandArgs.length === 0) {
|
|
241
|
+
const { runSetup, shouldRunSetupForBareCommand } = await import('./commands/setup')
|
|
242
|
+
if (shouldRunSetupForBareCommand()) {
|
|
243
|
+
await runSetup(['--from-welcome'])
|
|
244
|
+
await exitWithFlush(0)
|
|
245
|
+
}
|
|
246
|
+
const { printHelp } = await import('./help')
|
|
247
|
+
printHelp()
|
|
248
|
+
await exitWithFlush(0)
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// route to command. an empty command at this point only happens if the
|
|
252
|
+
// caller passed bare positional args without a verb (e.g. `sootsim -- foo`),
|
|
253
|
+
// which used to fall through to the bundler-wrap behavior in `dev`. now that
|
|
254
|
+
// `dev` is gone, treat it as "show help".
|
|
255
|
+
const command = parsed.command ?? ''
|
|
256
|
+
if (!command) {
|
|
257
|
+
// a bare positional that isn't a known command lands here (parse-args
|
|
258
|
+
// leaves `command` null and pushes the token into commandArgs). don't
|
|
259
|
+
// silently dump the full help banner — name the unrecognized token so a
|
|
260
|
+
// typo'd subcommand is obvious. matches the switch `default:` wording.
|
|
261
|
+
if (parsed.commandArgs.length > 0) {
|
|
262
|
+
const attempted =
|
|
263
|
+
parsed.commandArgs.find((a) => !a.startsWith('-')) ?? parsed.commandArgs[0]
|
|
264
|
+
console.error(` unknown command: ${attempted}`)
|
|
265
|
+
console.error(` run \`rnxsim --help\` to see the full surface.`)
|
|
266
|
+
await exitWithFlush(1)
|
|
267
|
+
}
|
|
268
|
+
const { printHelp } = await import('./help')
|
|
269
|
+
printHelp()
|
|
270
|
+
await exitWithFlush(0)
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// --help with a command (either global flag or in commandArgs)
|
|
274
|
+
if (
|
|
275
|
+
parsed.help ||
|
|
276
|
+
parsed.commandArgs.includes('--help') ||
|
|
277
|
+
parsed.commandArgs.includes('-h')
|
|
278
|
+
) {
|
|
279
|
+
if (command === 'skill') {
|
|
280
|
+
const { runSkill } = await import('./commands/skills')
|
|
281
|
+
await runSkill(parsed.commandArgs)
|
|
282
|
+
await exitWithFlush(0)
|
|
283
|
+
}
|
|
284
|
+
if (command === 'state') {
|
|
285
|
+
const { runState } = await import('./commands/state')
|
|
286
|
+
await exitWithFlush(await runState(commandArgsWithSim, { port }))
|
|
287
|
+
}
|
|
288
|
+
if (command === 'reset') {
|
|
289
|
+
const { runReset } = await import('./commands/reset')
|
|
290
|
+
await exitWithFlush(await runReset(commandArgsWithSim, { port }))
|
|
291
|
+
}
|
|
292
|
+
// for grouping verbs, try to resolve per-verb help from the first
|
|
293
|
+
// positional arg. e.g. `sootsim do tap --help` shows tap's help page,
|
|
294
|
+
// not the generic `do` grouping page. bare `sootsim do --help` falls
|
|
295
|
+
// through to runInspect which has the full verb group listing.
|
|
296
|
+
const isGroupingVerb =
|
|
297
|
+
command === 'do' ||
|
|
298
|
+
command === 'get' ||
|
|
299
|
+
command === 'debug' ||
|
|
300
|
+
command === 'shell' ||
|
|
301
|
+
command === 'perf' ||
|
|
302
|
+
command === 'wait'
|
|
303
|
+
const subVerb = parsed.commandArgs.find((a) => !a.startsWith('-'))
|
|
304
|
+
if (command === 'shell' || command === 'perf') {
|
|
305
|
+
// shell and perf subcommands are documented by their runtime dispatchers.
|
|
306
|
+
// don't try to route through generated per-verb docs.
|
|
307
|
+
} else if (isGroupingVerb && !subVerb) {
|
|
308
|
+
// bare `sootsim <group> --help` — render from the registry.
|
|
309
|
+
const { printGroupHelp } = await import('./help')
|
|
310
|
+
if (printGroupHelp(command)) await exitWithFlush(0)
|
|
311
|
+
// fall through — runInspect shows the full help for anything the
|
|
312
|
+
// registry doesn't yet cover (e.g. shell).
|
|
313
|
+
} else {
|
|
314
|
+
const { printCommandHelp } = await import('./help')
|
|
315
|
+
const helpName = isGroupingVerb && subVerb ? subVerb : command
|
|
316
|
+
printCommandHelp(helpName, {
|
|
317
|
+
prefer: isGroupingVerb && subVerb ? 'verb' : 'command',
|
|
318
|
+
group: isGroupingVerb && subVerb ? command : undefined,
|
|
319
|
+
})
|
|
320
|
+
await exitWithFlush(0)
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// gate heavy commands in the standalone binary before any dynamic imports
|
|
325
|
+
// fire. the imports themselves would also fail (vite / electron etc. are
|
|
326
|
+
// kept external from the bundle), but the resulting module-not-found error
|
|
327
|
+
// is much harder to act on than this targeted message.
|
|
328
|
+
exitIfStandaloneBlocked(command)
|
|
329
|
+
|
|
330
|
+
if (TOP_LEVEL_RUNTIME_COMMANDS.has(command)) {
|
|
331
|
+
const { runInspect } = await import('./commands/inspect')
|
|
332
|
+
await runInspect([command, ...commandArgsWithSim], { port, verbose })
|
|
333
|
+
} else {
|
|
334
|
+
switch (command) {
|
|
335
|
+
case 'assert': {
|
|
336
|
+
// stays outside the usual dispatcher — it spawns self to get the
|
|
337
|
+
// inner verb's --json payload, so it never needs the shared bridge
|
|
338
|
+
// machinery that lives inside runInspect.
|
|
339
|
+
const { runAssert } = await import('./commands/assert')
|
|
340
|
+
await runAssert(parsed.commandArgs)
|
|
341
|
+
break
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
case 'detox': {
|
|
345
|
+
const { runDetox } = await import('./commands/detox')
|
|
346
|
+
await runDetox(parsed.commandArgs, { port, verbose })
|
|
347
|
+
break
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
case 'maestro': {
|
|
351
|
+
const { runMaestro } = await import('./commands/maestro')
|
|
352
|
+
// Maestro forwards playback argv to the shared runner, so it must
|
|
353
|
+
// receive the global `--sim`. passing the bare
|
|
354
|
+
// parsed.commandArgs dropped an explicit `sootsim --sim <id> maestro
|
|
355
|
+
// …`, silently falling back to the current/saved sim (QA F21-4).
|
|
356
|
+
const code = await runMaestro(commandArgsWithSim, { port, verbose })
|
|
357
|
+
// bridge + dynamic imports leave handles open that keep node alive.
|
|
358
|
+
await exitWithFlush(typeof code === 'number' ? code : 0)
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
case 'record': {
|
|
362
|
+
const { runRecord } = await import('./commands/record')
|
|
363
|
+
await runRecord(commandArgsWithSim, { port, verbose })
|
|
364
|
+
break
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
case 'film': {
|
|
368
|
+
const { runFilm } = await import('./commands/film')
|
|
369
|
+
// film chains the flow runner, which opens ws bridges + dynamic
|
|
370
|
+
// imports that keep node alive — exit explicitly like `flow` does.
|
|
371
|
+
const code = await runFilm(commandArgsWithSim, { port, verbose })
|
|
372
|
+
await exitWithFlush(typeof code === 'number' ? code : 0)
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
case 'storage': {
|
|
376
|
+
const { runStorage } = await import('./commands/storage')
|
|
377
|
+
const code = await runStorage(commandArgsWithSim, { port, verbose })
|
|
378
|
+
await exitWithFlush(typeof code === 'number' ? code : 0)
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
case 'state': {
|
|
382
|
+
const { runState } = await import('./commands/state')
|
|
383
|
+
const code = await runState(commandArgsWithSim, { port })
|
|
384
|
+
await exitWithFlush(code)
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
case 'reset': {
|
|
388
|
+
const { runReset } = await import('./commands/reset')
|
|
389
|
+
const code = await runReset(commandArgsWithSim, { port })
|
|
390
|
+
await exitWithFlush(code)
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
case 'perf': {
|
|
394
|
+
const { runPerf } = await import('./commands/perf')
|
|
395
|
+
const code = await runPerf(commandArgsWithSim, { port, verbose })
|
|
396
|
+
await exitWithFlush(typeof code === 'number' ? code : 0)
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
case 'screenshot': {
|
|
400
|
+
const { runScreenshotCommand } = await import('./commands/screenshot-command')
|
|
401
|
+
const code = await runScreenshotCommand(commandArgsWithSim, { port, verbose })
|
|
402
|
+
await exitWithFlush(typeof code === 'number' ? code : 0)
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
case 'camera': {
|
|
406
|
+
const { runCamera } = await import('./commands/camera')
|
|
407
|
+
const code = await runCamera(commandArgsWithSim, { port })
|
|
408
|
+
await exitWithFlush(typeof code === 'number' ? code : 0)
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
case 'mode': {
|
|
412
|
+
const { runMode } = await import('./commands/mode')
|
|
413
|
+
await runMode(commandArgsWithSim, { port, verbose })
|
|
414
|
+
break
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
case 'permissions': {
|
|
418
|
+
const { runPermissions } = await import('./commands/permissions')
|
|
419
|
+
const code = await runPermissions(commandArgsWithSim, { port, verbose })
|
|
420
|
+
await exitWithFlush(code)
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
case 'inspect': {
|
|
424
|
+
const { runInspect } = await import('./commands/inspect')
|
|
425
|
+
await runInspect(commandArgsWithSim, { port, verbose })
|
|
426
|
+
break
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
case 'debug': {
|
|
430
|
+
const { runDebug } = await import('./commands/debug')
|
|
431
|
+
await runDebug(commandArgsWithSim, { port, verbose })
|
|
432
|
+
break
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
case 'timeline': {
|
|
436
|
+
const { runTimeline } = await import('./commands/timeline')
|
|
437
|
+
await runTimeline(commandArgsWithSim, { port, verbose })
|
|
438
|
+
break
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
case 'what-happened': {
|
|
442
|
+
const { runWhatHappened } = await import('./commands/what-happened')
|
|
443
|
+
await runWhatHappened(commandArgsWithSim, { port, verbose })
|
|
444
|
+
break
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
case 'open': {
|
|
448
|
+
const { runOpenCommand } = await import('./commands/control')
|
|
449
|
+
await runOpenCommand(commandArgsWithSim, { port })
|
|
450
|
+
break
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
case 'use': {
|
|
454
|
+
const { runUseCommand } = await import('./commands/control')
|
|
455
|
+
await runUseCommand(commandArgsWithSim, { port })
|
|
456
|
+
break
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
case 'claim': {
|
|
460
|
+
const { runClaimCommand } = await import('./commands/control')
|
|
461
|
+
await runClaimCommand(commandArgsWithSim, { port })
|
|
462
|
+
break
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
case 'close': {
|
|
466
|
+
const { runCloseCommand } = await import('./commands/control')
|
|
467
|
+
await runCloseCommand(commandArgsWithSim, { port })
|
|
468
|
+
break
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
case 'device': {
|
|
472
|
+
const { runDeviceCommand } = await import('./commands/device')
|
|
473
|
+
await runDeviceCommand(commandArgsWithSim, { port })
|
|
474
|
+
break
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
case 'compat': {
|
|
478
|
+
const { runCompat } = await import('./commands/compat')
|
|
479
|
+
await runCompat(parsed.commandArgs)
|
|
480
|
+
break
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
case 'report-issue': {
|
|
484
|
+
const { runReportIssue } = await import('./commands/report-issue')
|
|
485
|
+
const code = await runReportIssue(parsed.commandArgs)
|
|
486
|
+
await exitWithFlush(code)
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
case 'desktop': {
|
|
490
|
+
const { runDesktop } = await import('./commands/desktop')
|
|
491
|
+
await runDesktop(parsed.commandArgs, { port, device })
|
|
492
|
+
break
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
case 'login': {
|
|
496
|
+
const { runLogin } = await import('./commands/login')
|
|
497
|
+
await runLogin(parsed.commandArgs)
|
|
498
|
+
break
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
case 'logout': {
|
|
502
|
+
const { runLogout } = await import('./commands/logout')
|
|
503
|
+
await runLogout()
|
|
504
|
+
break
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
case 'auth': {
|
|
508
|
+
const { runAuth } = await import('./commands/auth')
|
|
509
|
+
await runAuth(parsed.commandArgs)
|
|
510
|
+
break
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
case 'setup': {
|
|
514
|
+
const { runSetup } = await import('./commands/setup')
|
|
515
|
+
await runSetup(parsed.commandArgs)
|
|
516
|
+
break
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
case 'serve': {
|
|
520
|
+
const { runServe } = await import('./commands/serve')
|
|
521
|
+
await runServe(parsed.commandArgs, { port })
|
|
522
|
+
break
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
case 'daemon': {
|
|
526
|
+
const { runDaemon } = await import('./commands/daemon')
|
|
527
|
+
await runDaemon(parsed.commandArgs, { port })
|
|
528
|
+
break
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
case 'runtime': {
|
|
532
|
+
const { runRuntime } = await import('./commands/runtime')
|
|
533
|
+
await runRuntime(parsed.commandArgs)
|
|
534
|
+
break
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
case 'upgrade':
|
|
538
|
+
case 'update': {
|
|
539
|
+
const { runUpgrade } = await import('./commands/upgrade')
|
|
540
|
+
await runUpgrade(parsed.commandArgs)
|
|
541
|
+
break
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
case 'version': {
|
|
545
|
+
const { runVersion } = await import('./commands/version')
|
|
546
|
+
await runVersion(parsed.commandArgs)
|
|
547
|
+
break
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
case 'agent': {
|
|
551
|
+
const { runAgentCommand } = await import('./commands/agent')
|
|
552
|
+
const code = await runAgentCommand(parsed.commandArgs)
|
|
553
|
+
await exitWithFlush(code)
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
case 'agent-wrapper': {
|
|
557
|
+
const { runAgentWrapper } = await import('./commands/agent-wrapper')
|
|
558
|
+
const code = await runAgentWrapper(parsed.commandArgs)
|
|
559
|
+
await exitWithFlush(code)
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
case 'skill': {
|
|
563
|
+
const { runSkill } = await import('./commands/skills')
|
|
564
|
+
await runSkill(parsed.commandArgs)
|
|
565
|
+
break
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
case 'app-fonts': {
|
|
569
|
+
const { runAppFonts } = await import('./commands/app-fonts')
|
|
570
|
+
await runAppFonts(parsed.commandArgs)
|
|
571
|
+
break
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
case 'config': {
|
|
575
|
+
const { runConfig } = await import('./commands/config')
|
|
576
|
+
await runConfig(parsed.commandArgs)
|
|
577
|
+
break
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
case 'cleanup': {
|
|
581
|
+
const { runCleanup } = await import('./commands/cleanup')
|
|
582
|
+
const code = await runCleanup(parsed.commandArgs)
|
|
583
|
+
await exitWithFlush(code)
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
default: {
|
|
587
|
+
console.error(` unknown command: ${command}`)
|
|
588
|
+
console.error(` run \`rnxsim --help\` to see the full surface.`)
|
|
589
|
+
await exitWithFlush(1)
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
await scheduleAutomaticCleanup()
|