rnxsim 0.1.313 → 0.1.314
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-7YBDCYMA.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-JJYYW2WH.js → agent-wrapper-2GHFBHCR.js} +2 -2
- package/dist-cli/chunks/{app-fonts-IXRNQG6B.js → app-fonts-RSNVPQSU.js} +2 -2
- package/dist-cli/chunks/{assert-54T5SK5F.js → assert-XCMX3XJX.js} +2 -2
- package/dist-cli/chunks/{auth-FI5UDI45.js → auth-B442HRAX.js} +2 -2
- package/dist-cli/chunks/{beta-JV6UKADW.js → beta-XJ55JK3M.js} +2 -2
- package/dist-cli/chunks/camera-UGYSSLIK.js +33 -0
- package/dist-cli/chunks/{chunk-3NV2NCNX.js → chunk-277AEQZX.js} +2 -2
- package/dist-cli/chunks/{chunk-2YR5BGA5.js → chunk-2JNSK774.js} +2 -2
- package/dist-cli/chunks/{chunk-RSZWCKNT.js → chunk-32WOTSTR.js} +3 -3
- package/dist-cli/chunks/{chunk-WEXDAC74.js → chunk-3S753SNQ.js} +2 -2
- package/dist-cli/chunks/{chunk-IJO63TDP.js → chunk-46ZOLOYA.js} +2 -2
- package/dist-cli/chunks/{chunk-WUSWBCWA.js → chunk-5L7ELDQL.js} +8 -9
- package/dist-cli/chunks/{chunk-WF3T4SVI.js → chunk-7OOPFSQS.js} +2 -2
- package/dist-cli/chunks/{chunk-TZFFR3SD.js → chunk-7SV3RPRW.js} +2 -2
- package/dist-cli/chunks/{chunk-WWZIXIRD.js → chunk-7ZC35MOU.js} +1 -1
- package/dist-cli/chunks/chunk-AMG5E6CC.js +9 -0
- package/dist-cli/chunks/{chunk-WINYQ44O.js → chunk-APWNH3A4.js} +1 -1
- package/dist-cli/chunks/chunk-B57XUKY3.js +4 -0
- package/dist-cli/chunks/{chunk-YDGQTMQL.js → chunk-C2NL26TD.js} +1 -1
- package/dist-cli/chunks/{chunk-NMF2ZMZQ.js → chunk-D2FNUWAB.js} +4 -4
- package/dist-cli/chunks/{chunk-YIFT42WN.js → chunk-E5T4XSJ3.js} +2 -2
- package/dist-cli/chunks/{chunk-46EUUFJ5.js → chunk-EAC34EQS.js} +1 -1
- package/dist-cli/chunks/{chunk-OVFJFXUD.js → chunk-EG32ML36.js} +2 -2
- package/dist-cli/chunks/{chunk-5YJCOWCH.js → chunk-FXUAC6D5.js} +1 -1
- package/dist-cli/chunks/chunk-GQSL4USA.js +6 -0
- package/dist-cli/chunks/{chunk-VFCMSYZK.js → chunk-HAXW27SS.js} +2 -2
- package/dist-cli/chunks/{chunk-2D2UPBBR.js → chunk-IZAHPAN6.js} +1 -1
- package/dist-cli/chunks/{chunk-7GN3LVWB.js → chunk-J62KM5TB.js} +2 -2
- package/dist-cli/chunks/{chunk-BTWORNNG.js → chunk-JEMCD5E4.js} +1 -1
- package/dist-cli/chunks/{chunk-DCEMHR2Y.js → chunk-JZS3Q37N.js} +2 -2
- package/dist-cli/chunks/{chunk-D4FFVGI5.js → chunk-KR4JON7D.js} +1 -1
- package/dist-cli/chunks/chunk-KWCYKQIQ.js +4 -0
- package/dist-cli/chunks/{chunk-VNQEB4L7.js → chunk-MCWPL644.js} +2 -2
- package/dist-cli/chunks/chunk-MJYK3N2I.js +4 -0
- package/dist-cli/chunks/{chunk-5TEF3ET3.js → chunk-O6TRIZNS.js} +2 -2
- package/dist-cli/chunks/{chunk-QKDWYITG.js → chunk-P7XL2E73.js} +3 -3
- package/dist-cli/chunks/{chunk-BBULZ7CG.js → chunk-PFQTUKQ4.js} +62 -87
- package/dist-cli/chunks/{chunk-GGRX24GF.js → chunk-PG5RZCTN.js} +2 -2
- package/dist-cli/chunks/{chunk-W6K4EFPH.js → chunk-QGRI2Z4M.js} +2 -2
- package/dist-cli/chunks/{chunk-ZMJD5GEC.js → chunk-QLXXE7GE.js} +1 -1
- package/dist-cli/chunks/{chunk-VZXWHRUZ.js → chunk-QOJJJWJE.js} +89 -133
- package/dist-cli/chunks/{chunk-OZSSI4WN.js → chunk-RWZY5427.js} +2 -2
- package/dist-cli/chunks/{chunk-UC6U3MML.js → chunk-RZKU2K3J.js} +2 -2
- package/dist-cli/chunks/{chunk-IJ5CAZZC.js → chunk-SBV4IK4H.js} +1 -1
- package/dist-cli/chunks/{chunk-DZS6WPUI.js → chunk-SGMVFFMK.js} +1 -1
- package/dist-cli/chunks/{chunk-OHAZNXLK.js → chunk-TAX4UT2N.js} +1 -1
- package/dist-cli/chunks/{chunk-5DHC6KHQ.js → chunk-TUOFAWXT.js} +1 -1
- package/dist-cli/chunks/{chunk-GASE6UBA.js → chunk-UHZLOHGP.js} +1 -1
- package/dist-cli/chunks/{chunk-F5ZRSS3C.js → chunk-VC7V76U3.js} +1 -1
- package/dist-cli/chunks/{chunk-RTN5C5RL.js → chunk-VQVMLW4U.js} +1 -1
- package/dist-cli/chunks/{chunk-WMIIKMGK.js → chunk-VUKKYPZN.js} +2 -2
- package/dist-cli/chunks/{chunk-5TPRP5QT.js → chunk-WGGRJDRE.js} +1 -1
- package/dist-cli/chunks/chunk-X6H76EKP.js +15 -0
- package/dist-cli/chunks/chunk-XLZ5FNRT.js +27 -0
- package/dist-cli/chunks/{chunk-HI5TFJWN.js → chunk-XULEACM4.js} +2 -2
- package/dist-cli/chunks/{chunk-MJRLLB4R.js → chunk-YFSDM7AX.js} +4 -4
- package/dist-cli/chunks/chunk-YWI3UEVX.js +5 -0
- package/dist-cli/chunks/{chunk-XEVZYVIW.js → chunk-ZBSJO4NB.js} +10 -9
- package/dist-cli/chunks/{cleanup-P27PA6JI.js → cleanup-EYLGCA6Z.js} +2 -2
- package/dist-cli/chunks/cli-version-LL2UGIHE.js +4 -0
- package/dist-cli/chunks/{compat-ZD65FED3.js → compat-TLJYHB4E.js} +2 -2
- package/dist-cli/chunks/{config-XMJRNM2A.js → config-4JWUOEXK.js} +2 -2
- package/dist-cli/chunks/{control-KMIQT3QP.js → control-HPAOYF4N.js} +2 -2
- package/dist-cli/chunks/daemon-OYLASXLE.js +4 -0
- package/dist-cli/chunks/{debug-PT4HOP7N.js → debug-4BKXF6KI.js} +5 -5
- package/dist-cli/chunks/{desktop-S3FG72AK.js → desktop-ZQ6ZD2S6.js} +3 -3
- package/dist-cli/chunks/{detox-B3D4IFCN.js → detox-WNPASSS3.js} +2 -2
- package/dist-cli/chunks/{device-XBNDSB2R.js → device-BXLXVG3V.js} +2 -2
- package/dist-cli/chunks/{diagnose-HMQXJE5N.js → diagnose-3QX7W5RW.js} +2 -2
- package/dist-cli/chunks/{disk-cleanup-BLCZ5BSZ.js → disk-cleanup-KSWKI7WB.js} +2 -2
- package/dist-cli/chunks/drivers-EPIEFF7P.js +4 -0
- package/dist-cli/chunks/{film-BJGTBYZB.js → film-GDMR33VO.js} +3 -3
- package/dist-cli/chunks/flow-NKMPBYCJ.js +4 -0
- package/dist-cli/chunks/help-OGCBHOKA.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-ANOYADHM.js → hidden-runtime-alias-S2GTDX3T.js} +2 -2
- package/dist-cli/chunks/home-paths-QRCDLTTV.js +4 -0
- package/dist-cli/chunks/inspect-FUYMOZPY.js +4 -0
- package/dist-cli/chunks/install-desktop-FR6YKW7Y.js +4 -0
- package/dist-cli/chunks/{login-FJ737MWG.js → login-IJAPUZHI.js} +4 -4
- package/dist-cli/chunks/{logout-ZCNMMHMY.js → logout-QMXDFU2X.js} +2 -2
- package/dist-cli/chunks/{maestro-SZTNKLDF.js → maestro-ZXU3YCVX.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-DCFAIZ4H.js → maestro-generate-PYB5QY7K.js} +3 -3
- package/dist-cli/chunks/{mode-GRMQCRXR.js → mode-WGUCL5FZ.js} +2 -2
- package/dist-cli/chunks/{optional-demo-registry-W36EWFFB.js → optional-demo-registry-WH2O6H36.js} +2 -2
- package/dist-cli/chunks/{perf-QYBAAUZG.js → perf-TOD3UFAH.js} +2 -2
- package/dist-cli/chunks/{permissions-3QCQ6VF4.js → permissions-I5BRJGTB.js} +2 -2
- package/dist-cli/chunks/{record-QPPC2S4E.js → record-ZYL2FYSK.js} +3 -3
- package/dist-cli/chunks/{report-issue-7NMFP4HK.js → report-issue-TAI6DYZO.js} +2 -2
- package/dist-cli/chunks/reset-7YGYKQPQ.js +4 -0
- package/dist-cli/chunks/runtime-B4JO6QRI.js +4 -0
- package/dist-cli/chunks/{screenshot-command-67AECJFB.js → screenshot-command-7ANLODZY.js} +7 -7
- package/dist-cli/chunks/{screenshot-layers-ASWBYPJL.js → screenshot-layers-A7FYXSVU.js} +3 -3
- package/dist-cli/chunks/{screenshots-capture-PXA3HFQK.js → screenshots-capture-WT2ZY6CB.js} +2 -2
- package/dist-cli/chunks/serve-TG5WKA4V.js +44 -0
- package/dist-cli/chunks/{setup-7DWPMRSB.js → setup-PCWLD22V.js} +2 -2
- package/dist-cli/chunks/{skills-S3Y22TUA.js → skills-27ZHWCQS.js} +2 -2
- package/dist-cli/chunks/state-ZQVY46ZO.js +14 -0
- package/dist-cli/chunks/{storage-XUIMJWAJ.js → storage-OYC57C4X.js} +6 -6
- package/dist-cli/chunks/store-32HSPZHI.js +4 -0
- package/dist-cli/chunks/telemetry-PBJR7XHR.js +4 -0
- package/dist-cli/chunks/{timeline-TMPLQPSP.js → timeline-RAJJFQT6.js} +2 -2
- package/dist-cli/chunks/{upgrade-7HDSIM7K.js → upgrade-OEFNZRIP.js} +2 -2
- package/dist-cli/chunks/upload-LQJITLKK.js +4 -0
- package/dist-cli/chunks/version-NIXTY6PL.js +6 -0
- package/dist-cli/chunks/{web-DG3WBYD3.js → web-XBUTBVGR.js} +2 -2
- package/dist-cli/chunks/{what-happened-XFVUTZR7.js → what-happened-YNHRFUDX.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
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// sootsim timeline — control the semantic agent-facing event log
|
|
2
|
+
//
|
|
3
|
+
// `sootsim record` is for video/screen capture; `sootsim debug record` is
|
|
4
|
+
// for the engine-internal debug-channel ring; this command is the third
|
|
5
|
+
// surface and explicitly distinct: it manages SootSim.bridges.timeline,
|
|
6
|
+
// the unified, agent-facing semantic event stream across host / shell
|
|
7
|
+
// worker / tenant worker.
|
|
8
|
+
//
|
|
9
|
+
// usage:
|
|
10
|
+
// sootsim timeline status # what's enabled
|
|
11
|
+
// sootsim timeline start [kinds] # enable kinds (default: opt-in defaults)
|
|
12
|
+
// sootsim timeline stop [kinds] # disable kinds (or 'all')
|
|
13
|
+
// sootsim timeline clear # drop all events + cursors
|
|
14
|
+
// sootsim timeline dump <file> # write current ring to JSON
|
|
15
|
+
//
|
|
16
|
+
// see `sootsim what-happened` for the read side.
|
|
17
|
+
|
|
18
|
+
import { writeFileSync } from 'fs'
|
|
19
|
+
import { callInBridge, createBridgeFromParsed, parseBridgeCliArgs } from '../ws-bridge'
|
|
20
|
+
|
|
21
|
+
interface TimelineOptions {
|
|
22
|
+
port?: number
|
|
23
|
+
verbose?: boolean
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function printHelp() {
|
|
27
|
+
console.log(`
|
|
28
|
+
rnxsim timeline — control the semantic event timeline
|
|
29
|
+
|
|
30
|
+
usage:
|
|
31
|
+
rnxsim timeline <subcommand> [args]
|
|
32
|
+
|
|
33
|
+
subcommands:
|
|
34
|
+
status show enabled kinds and ring sizes
|
|
35
|
+
start [kinds] enable kinds (csv); 'all' for every opt-in
|
|
36
|
+
stop [kinds] disable kinds (csv); 'all' for every kind
|
|
37
|
+
clear drop all events + cursors
|
|
38
|
+
dump <file> write current merged ring to JSON
|
|
39
|
+
|
|
40
|
+
note: cheap kinds (console, fetch, app-launch, keyboard, screen, alert,
|
|
41
|
+
toast, notification, route, shell, actionsheet, picker) record at all times.
|
|
42
|
+
start/stop enables opt-in kinds (react-commit, scroll, gesture, text-input,
|
|
43
|
+
layout, reanimated, animation).
|
|
44
|
+
|
|
45
|
+
read the timeline with: rnxsim what-happened
|
|
46
|
+
`)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export async function runTimeline(args: string[], opts: TimelineOptions) {
|
|
50
|
+
const parsed = parseBridgeCliArgs(args, {
|
|
51
|
+
port: opts.port,
|
|
52
|
+
stripBooleanFlags: ['--json', '--help', '-h'],
|
|
53
|
+
})
|
|
54
|
+
const sub = parsed.positional[0]
|
|
55
|
+
if (!sub || args.includes('--help') || args.includes('-h')) {
|
|
56
|
+
printHelp()
|
|
57
|
+
process.exit(0)
|
|
58
|
+
}
|
|
59
|
+
const json = args.includes('--json')
|
|
60
|
+
const bridge = createBridgeFromParsed(parsed)
|
|
61
|
+
|
|
62
|
+
const rest = parsed.positional.slice(1)
|
|
63
|
+
const kinds = rest[0]
|
|
64
|
+
? rest[0]
|
|
65
|
+
.split(',')
|
|
66
|
+
.map((s) => s.trim())
|
|
67
|
+
.filter(Boolean)
|
|
68
|
+
: []
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
switch (sub) {
|
|
72
|
+
case 'status': {
|
|
73
|
+
const status = await callInBridge(bridge, 'SootSim.bridges.timeline.status')
|
|
74
|
+
console.log(JSON.stringify(status, null, json ? 0 : 2))
|
|
75
|
+
break
|
|
76
|
+
}
|
|
77
|
+
case 'start':
|
|
78
|
+
case 'enable': {
|
|
79
|
+
if (kinds.length === 0) kinds.push('all')
|
|
80
|
+
await callInBridge(bridge, 'SootSim.bridges.timeline.enable', ...kinds)
|
|
81
|
+
const status = await callInBridge(bridge, 'SootSim.bridges.timeline.status')
|
|
82
|
+
console.log(JSON.stringify(status, null, json ? 0 : 2))
|
|
83
|
+
break
|
|
84
|
+
}
|
|
85
|
+
case 'stop':
|
|
86
|
+
case 'disable': {
|
|
87
|
+
if (kinds.length === 0) kinds.push('all')
|
|
88
|
+
await callInBridge(bridge, 'SootSim.bridges.timeline.disable', ...kinds)
|
|
89
|
+
const status = await callInBridge(bridge, 'SootSim.bridges.timeline.status')
|
|
90
|
+
console.log(JSON.stringify(status, null, json ? 0 : 2))
|
|
91
|
+
break
|
|
92
|
+
}
|
|
93
|
+
case 'clear': {
|
|
94
|
+
await callInBridge(bridge, 'SootSim.bridges.timeline.clear')
|
|
95
|
+
console.log(' cleared')
|
|
96
|
+
break
|
|
97
|
+
}
|
|
98
|
+
case 'dump': {
|
|
99
|
+
const outPath = rest[0]
|
|
100
|
+
if (!outPath) {
|
|
101
|
+
console.error(' usage: rnxsim timeline dump <file>')
|
|
102
|
+
process.exit(1)
|
|
103
|
+
}
|
|
104
|
+
const result = await callInBridge<{ events: unknown[] }>(
|
|
105
|
+
bridge,
|
|
106
|
+
'SootSim.bridges.timeline.recent',
|
|
107
|
+
{ limit: 1_000_000 },
|
|
108
|
+
)
|
|
109
|
+
writeFileSync(outPath, JSON.stringify(result.events, null, 2) + '\n')
|
|
110
|
+
console.log(` wrote ${result.events.length} event(s) to ${outPath}`)
|
|
111
|
+
break
|
|
112
|
+
}
|
|
113
|
+
default: {
|
|
114
|
+
console.error(` unknown subcommand: ${sub}`)
|
|
115
|
+
printHelp()
|
|
116
|
+
process.exit(1)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
} finally {
|
|
120
|
+
bridge.close()
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
// sootsim upgrade — one command to get current.
|
|
2
|
+
//
|
|
3
|
+
// the sootsim CLI (the `sootsim` npm package) and the engine runtime (the
|
|
4
|
+
// versioned tarball served to the browser/electron shell) are versioned
|
|
5
|
+
// independently. that split is a frequent source of "I ran upgrade but the
|
|
6
|
+
// version didn't change" confusion — the user upgraded one half. this
|
|
7
|
+
// command checks and updates both:
|
|
8
|
+
//
|
|
9
|
+
// 1. CLI — query the npm registry; if behind, self-update the global
|
|
10
|
+
// install with the same package manager that installed it
|
|
11
|
+
// (bun/pnpm/npm, detected from the running binary's path).
|
|
12
|
+
// npx-cache runs can't self-update in place, so those get
|
|
13
|
+
// the exact command to run instead.
|
|
14
|
+
// 2. runtime — delegate to `sootsim runtime install`, which resolves the
|
|
15
|
+
// channel's latest, downloads + verifies
|
|
16
|
+
// it, and activates.
|
|
17
|
+
//
|
|
18
|
+
// each half is a no-op when already current, so the command is safe to
|
|
19
|
+
// run anytime.
|
|
20
|
+
|
|
21
|
+
import { spawn } from 'node:child_process'
|
|
22
|
+
import fs from 'node:fs'
|
|
23
|
+
import os from 'node:os'
|
|
24
|
+
import path from 'node:path'
|
|
25
|
+
import { compareSemver } from '@contrast/runtime-delivery'
|
|
26
|
+
import { getCliVersion } from '../../src/cli-version'
|
|
27
|
+
import {
|
|
28
|
+
isSootsimDevCheckout,
|
|
29
|
+
readActiveRuntime,
|
|
30
|
+
runtimeDir,
|
|
31
|
+
sootsimHomeDir,
|
|
32
|
+
} from '../../src/home-paths'
|
|
33
|
+
import { resolveSootSimAppConfig } from '../app-config'
|
|
34
|
+
import { fetchRuntimeReleaseNotes, formatRuntimeReleaseNotes } from '../runtime-notes'
|
|
35
|
+
import { runRuntime } from './runtime'
|
|
36
|
+
|
|
37
|
+
const REGISTRY_LATEST_URL = 'https://registry.npmjs.org/rnxsim/latest'
|
|
38
|
+
|
|
39
|
+
export async function runUpgrade(args: string[]): Promise<void> {
|
|
40
|
+
// `--help` is handled upstream in bin.ts via the CLI registry (meta.ts) —
|
|
41
|
+
// it never reaches here.
|
|
42
|
+
const channelIdx = args.indexOf('--channel')
|
|
43
|
+
const channel =
|
|
44
|
+
channelIdx >= 0 && args[channelIdx + 1] ? args[channelIdx + 1] : undefined
|
|
45
|
+
|
|
46
|
+
console.log('rnxsim upgrade\n')
|
|
47
|
+
|
|
48
|
+
// --- 1. engine runtime --------------------------------------------------
|
|
49
|
+
// runtime first, CLI last: the CLI self-update replaces this process's
|
|
50
|
+
// own dist files on disk, and any dynamic import after the swap resolves
|
|
51
|
+
// against renamed chunk hashes and crashes (observed in a container run).
|
|
52
|
+
console.log('runtime:')
|
|
53
|
+
const beforeRuntime = readActiveRuntime()
|
|
54
|
+
const { config } = await resolveSootSimAppConfig()
|
|
55
|
+
const configuredRuntime = config?.runtimeVersion
|
|
56
|
+
const configuredRuntimeWasInstalled = configuredRuntime
|
|
57
|
+
? fs.existsSync(path.join(runtimeDir(configuredRuntime), 'index.html'))
|
|
58
|
+
: false
|
|
59
|
+
if (configuredRuntime) {
|
|
60
|
+
console.log(` project config: v${configuredRuntime}`)
|
|
61
|
+
}
|
|
62
|
+
const install =
|
|
63
|
+
configuredRuntime && configuredRuntimeWasInstalled
|
|
64
|
+
? null
|
|
65
|
+
: await runRuntime(
|
|
66
|
+
[
|
|
67
|
+
'install',
|
|
68
|
+
...(configuredRuntime ? [configuredRuntime, '--set-active=false'] : []),
|
|
69
|
+
...(channel ? ['--channel', channel] : []),
|
|
70
|
+
],
|
|
71
|
+
{},
|
|
72
|
+
)
|
|
73
|
+
const installedRuntime = install?.version ?? configuredRuntime ?? readActiveRuntime()
|
|
74
|
+
if (installedRuntime) {
|
|
75
|
+
console.log(
|
|
76
|
+
configuredRuntime
|
|
77
|
+
? configuredRuntimeWasInstalled
|
|
78
|
+
? ` result: v${installedRuntime} already installed for this project`
|
|
79
|
+
: ` result: not installed → v${installedRuntime} for this project`
|
|
80
|
+
: beforeRuntime && beforeRuntime !== installedRuntime
|
|
81
|
+
? ` result: v${beforeRuntime} → v${installedRuntime}`
|
|
82
|
+
: !beforeRuntime
|
|
83
|
+
? ` result: not installed → v${installedRuntime}`
|
|
84
|
+
: ` result: v${installedRuntime} already current`,
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
const releaseNotes = installedRuntime
|
|
88
|
+
? await fetchRuntimeReleaseNotes(installedRuntime)
|
|
89
|
+
: null
|
|
90
|
+
|
|
91
|
+
// --- 2. CLI npm package -------------------------------------------------
|
|
92
|
+
console.log('\ncli:')
|
|
93
|
+
await upgradeCli()
|
|
94
|
+
|
|
95
|
+
if (installedRuntime) {
|
|
96
|
+
console.log(`\n${formatRuntimeReleaseNotes(installedRuntime, releaseNotes)}`)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
type CliInstallKind =
|
|
101
|
+
| { kind: 'dev' }
|
|
102
|
+
| { kind: 'npx' }
|
|
103
|
+
| { kind: 'global'; command: string; args: string[] }
|
|
104
|
+
|
|
105
|
+
// how is this CLI process installed? keyed off the real path of the running
|
|
106
|
+
// entry script — global installs land under each manager's global root,
|
|
107
|
+
// npx/bunx runs land in their throwaway caches, and the Contrast monorepo dev
|
|
108
|
+
// checkout runs from packages/sootsim.
|
|
109
|
+
function detectCliInstall(): CliInstallKind {
|
|
110
|
+
if (isSootsimDevCheckout()) return { kind: 'dev' }
|
|
111
|
+
let real = process.argv[1] ?? ''
|
|
112
|
+
try {
|
|
113
|
+
real = fs.realpathSync(real)
|
|
114
|
+
} catch {}
|
|
115
|
+
const sep = path.sep
|
|
116
|
+
if (real.includes(`${sep}_npx${sep}`) || real.includes(`${sep}.bunx${sep}`)) {
|
|
117
|
+
return { kind: 'npx' }
|
|
118
|
+
}
|
|
119
|
+
if (real.includes(`${sep}.bun${sep}`)) {
|
|
120
|
+
return { kind: 'global', command: 'bun', args: ['add', '-g', 'rnxsim@latest'] }
|
|
121
|
+
}
|
|
122
|
+
if (real.includes(`${sep}pnpm${sep}`)) {
|
|
123
|
+
return { kind: 'global', command: 'pnpm', args: ['add', '-g', 'rnxsim@latest'] }
|
|
124
|
+
}
|
|
125
|
+
// the desktop splash installs the CLI into a user-writable prefix under the
|
|
126
|
+
// sootsim home (`~/.sootsim/cli`) to dodge the EACCES a plain `npm i -g` hits
|
|
127
|
+
// when npm's global prefix is a system-owned dir. self-update into that same
|
|
128
|
+
// prefix so upgrade doesn't fall back to the unwritable global prefix.
|
|
129
|
+
const cliPrefix = path.join(sootsimHomeDir(), 'cli')
|
|
130
|
+
if (real.startsWith(`${cliPrefix}${sep}`)) {
|
|
131
|
+
return {
|
|
132
|
+
kind: 'global',
|
|
133
|
+
command: 'npm',
|
|
134
|
+
args: ['i', '-g', '--prefix', cliPrefix, 'rnxsim@latest'],
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
const installerPrefix = path.resolve(
|
|
138
|
+
process.env.SOOTSIM_CLI_PREFIX || path.join(os.homedir(), '.local'),
|
|
139
|
+
)
|
|
140
|
+
if (real.startsWith(`${installerPrefix}${sep}`)) {
|
|
141
|
+
return {
|
|
142
|
+
kind: 'global',
|
|
143
|
+
command: 'npm',
|
|
144
|
+
args: ['i', '-g', '--prefix', installerPrefix, 'rnxsim@latest'],
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return { kind: 'global', command: 'npm', args: ['i', '-g', 'rnxsim@latest'] }
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
async function upgradeCli(): Promise<void> {
|
|
151
|
+
const current = getCliVersion()
|
|
152
|
+
const latest = await fetchLatestCliVersion()
|
|
153
|
+
|
|
154
|
+
if (!latest) {
|
|
155
|
+
console.log(` v${current} — couldn't reach the npm registry, skipped`)
|
|
156
|
+
return
|
|
157
|
+
}
|
|
158
|
+
if (compareSemver(latest, current) <= 0) {
|
|
159
|
+
console.log(` v${current} (latest)`)
|
|
160
|
+
return
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const install = detectCliInstall()
|
|
164
|
+
console.log(` v${current} → v${latest}`)
|
|
165
|
+
|
|
166
|
+
if (install.kind === 'dev') {
|
|
167
|
+
console.log(` running from the Contrast dev checkout — pull instead of upgrading`)
|
|
168
|
+
return
|
|
169
|
+
}
|
|
170
|
+
if (install.kind === 'npx') {
|
|
171
|
+
console.log(` running from the npx cache — get the latest with:`)
|
|
172
|
+
console.log(` npx rnxsim@latest`)
|
|
173
|
+
return
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const printed = `${install.command} ${install.args.join(' ')}`
|
|
177
|
+
console.log(` updating global install (${printed})…`)
|
|
178
|
+
const ok = await runInherit(install.command, install.args)
|
|
179
|
+
if (ok) {
|
|
180
|
+
console.log(` updated to v${latest}`)
|
|
181
|
+
} else {
|
|
182
|
+
console.log(` update failed — run it yourself:`)
|
|
183
|
+
console.log(` ${printed}`)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function runInherit(command: string, args: string[]): Promise<boolean> {
|
|
188
|
+
return new Promise((resolve) => {
|
|
189
|
+
const child = spawn(command, args, { stdio: 'inherit' })
|
|
190
|
+
child.on('error', () => resolve(false))
|
|
191
|
+
child.on('exit', (code) => resolve(code === 0))
|
|
192
|
+
})
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
async function fetchLatestCliVersion(): Promise<string | null> {
|
|
196
|
+
try {
|
|
197
|
+
// cap the registry lookup so a hung npm registry can't stall upgrade.
|
|
198
|
+
const res = await fetch(REGISTRY_LATEST_URL, {
|
|
199
|
+
headers: { accept: 'application/json' },
|
|
200
|
+
signal: AbortSignal.timeout(8000),
|
|
201
|
+
})
|
|
202
|
+
if (!res.ok) return null
|
|
203
|
+
const json = (await res.json()) as { version?: unknown }
|
|
204
|
+
return typeof json.version === 'string' && json.version ? json.version : null
|
|
205
|
+
} catch {
|
|
206
|
+
return null
|
|
207
|
+
}
|
|
208
|
+
}
|