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
package/src/host/bridge-host.ts
CHANGED
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
writeDevBridgeLockfile,
|
|
28
28
|
writeRuntimeUpgradeNotice,
|
|
29
29
|
writeSharedConfig,
|
|
30
|
+
cameraFixturesDir,
|
|
30
31
|
sootsimHomeDir,
|
|
31
32
|
type DaemonLockfile,
|
|
32
33
|
type DevBridgeLockfile,
|
|
@@ -173,7 +174,14 @@ interface BridgeCliLease {
|
|
|
173
174
|
// `call` used to acquire a lease too, but most call paths are queries
|
|
174
175
|
// (`__sootsimTest.findByTestId`, state reads, etc.). the CLI opts write
|
|
175
176
|
// calls into lease acquisition via msg.acquireLock=true.
|
|
176
|
-
const WRITE_COMMAND_TYPES = new Set([
|
|
177
|
+
const WRITE_COMMAND_TYPES = new Set([
|
|
178
|
+
'tap',
|
|
179
|
+
'keyboard',
|
|
180
|
+
'longPress',
|
|
181
|
+
'perform',
|
|
182
|
+
'reset',
|
|
183
|
+
'camera',
|
|
184
|
+
])
|
|
177
185
|
|
|
178
186
|
// how long a `close` waits for the sim page to tear itself down before the
|
|
179
187
|
// host disconnects the sim socket. the close code is part of the protocol:
|
|
@@ -227,10 +235,11 @@ export interface BridgeHostOptions {
|
|
|
227
235
|
* anything embedded should leave it off to avoid clobbering a real
|
|
228
236
|
* daemon's lockfile. defaults to false. */
|
|
229
237
|
writeLockfile?: boolean
|
|
230
|
-
/** when true, write ~/.sootsim/dev-
|
|
231
|
-
* it on a heartbeat interval
|
|
232
|
-
*
|
|
233
|
-
*
|
|
238
|
+
/** when true, write an owner-scoped record under ~/.sootsim/dev-bridges on
|
|
239
|
+
* successful bind, update it on a heartbeat interval, and remove only that
|
|
240
|
+
* record on close. the Vite dev shell sets this so local CLI commands can
|
|
241
|
+
* address every live source bridge without concurrent worktrees replacing
|
|
242
|
+
* one shared pointer. */
|
|
234
243
|
writeDevLockfile?: boolean
|
|
235
244
|
/** resolve the http port of the vite shell dev server that hosts this
|
|
236
245
|
* bridge (e.g. 5173). called on every dev-lockfile write so the port
|
|
@@ -291,8 +300,21 @@ const HTTP_MIME_TYPES: Record<string, string> = {
|
|
|
291
300
|
'.woff2': 'font/woff2',
|
|
292
301
|
'.map': 'application/json',
|
|
293
302
|
'.txt': 'text/plain; charset=utf-8',
|
|
303
|
+
'.mp4': 'video/mp4',
|
|
304
|
+
'.m4v': 'video/mp4',
|
|
305
|
+
'.webm': 'video/webm',
|
|
306
|
+
'.mov': 'video/quicktime',
|
|
294
307
|
}
|
|
295
308
|
|
|
309
|
+
// `rnxsim camera play` stages a video under ~/.sootsim/camera-fixtures and the
|
|
310
|
+
// simulator plays it as the camera feed. the route below serves that one
|
|
311
|
+
// directory, addressed by basename only.
|
|
312
|
+
const CAMERA_FIXTURE_ROUTE = '/__camera-fixtures/'
|
|
313
|
+
// no slashes, no dots leading a segment, no traversal to express. a name that
|
|
314
|
+
// does not match is rejected rather than normalized, so there is nothing to
|
|
315
|
+
// get the normalization wrong about.
|
|
316
|
+
const CAMERA_FIXTURE_NAME_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/
|
|
317
|
+
|
|
296
318
|
/** inject host-provided globals into the served runtime html:
|
|
297
319
|
* - `window.__sootsimSharedConfig` — parsed `~/.sootsim/config.json`,
|
|
298
320
|
* read during engine settingsStore module init (see
|
|
@@ -1259,6 +1281,96 @@ export class SootSimBridgeHost {
|
|
|
1259
1281
|
return this.inflightScan
|
|
1260
1282
|
}
|
|
1261
1283
|
|
|
1284
|
+
// serves one staged camera fixture. addressed by basename inside
|
|
1285
|
+
// ~/.sootsim/camera-fixtures, never by a caller-supplied path, so there is
|
|
1286
|
+
// no traversal surface to defend: a name that is not a plain basename is
|
|
1287
|
+
// rejected outright. range support is not optional here — chrome asks for
|
|
1288
|
+
// byte ranges on media and cannot seek or loop a fixture without it.
|
|
1289
|
+
private handleCameraFixture(name: string, req: IncomingMessage, res: ServerResponse) {
|
|
1290
|
+
const method = (req.method || 'GET').toUpperCase()
|
|
1291
|
+
const cors = {
|
|
1292
|
+
'Access-Control-Allow-Origin': '*',
|
|
1293
|
+
'Cache-Control': 'no-store',
|
|
1294
|
+
}
|
|
1295
|
+
if (method === 'OPTIONS') {
|
|
1296
|
+
res.writeHead(204, {
|
|
1297
|
+
...cors,
|
|
1298
|
+
'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS',
|
|
1299
|
+
'Access-Control-Allow-Headers': 'range',
|
|
1300
|
+
})
|
|
1301
|
+
res.end()
|
|
1302
|
+
return
|
|
1303
|
+
}
|
|
1304
|
+
if (method !== 'GET' && method !== 'HEAD') {
|
|
1305
|
+
res.writeHead(405, cors)
|
|
1306
|
+
res.end()
|
|
1307
|
+
return
|
|
1308
|
+
}
|
|
1309
|
+
if (!CAMERA_FIXTURE_NAME_RE.test(name)) {
|
|
1310
|
+
res.writeHead(400, { ...cors, 'Content-Type': 'text/plain; charset=utf-8' })
|
|
1311
|
+
res.end('bad fixture name')
|
|
1312
|
+
return
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
const root = cameraFixturesDir()
|
|
1316
|
+
const filePath = path.join(root, name)
|
|
1317
|
+
let stats: fs.Stats
|
|
1318
|
+
try {
|
|
1319
|
+
// a symlink dropped into the fixtures dir is the one way out of it.
|
|
1320
|
+
// lstat rather than stat so a link is refused instead of followed.
|
|
1321
|
+
stats = fs.lstatSync(filePath)
|
|
1322
|
+
} catch {
|
|
1323
|
+
res.writeHead(404, { ...cors, 'Content-Type': 'text/plain; charset=utf-8' })
|
|
1324
|
+
res.end('not found')
|
|
1325
|
+
return
|
|
1326
|
+
}
|
|
1327
|
+
if (!stats.isFile()) {
|
|
1328
|
+
res.writeHead(403, { ...cors, 'Content-Type': 'text/plain; charset=utf-8' })
|
|
1329
|
+
res.end('forbidden')
|
|
1330
|
+
return
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
const contentType =
|
|
1334
|
+
HTTP_MIME_TYPES[path.extname(filePath).toLowerCase()] || 'application/octet-stream'
|
|
1335
|
+
const total = stats.size
|
|
1336
|
+
const range = /^bytes=(\d*)-(\d*)$/.exec(req.headers.range || '')
|
|
1337
|
+
if (range) {
|
|
1338
|
+
const [, startRaw, endRaw] = range
|
|
1339
|
+
const start = startRaw ? Number(startRaw) : 0
|
|
1340
|
+
const end = endRaw ? Math.min(Number(endRaw), total - 1) : total - 1
|
|
1341
|
+
if (!Number.isFinite(start) || start > end || start >= total) {
|
|
1342
|
+
res.writeHead(416, { ...cors, 'Content-Range': `bytes */${total}` })
|
|
1343
|
+
res.end()
|
|
1344
|
+
return
|
|
1345
|
+
}
|
|
1346
|
+
res.writeHead(206, {
|
|
1347
|
+
...cors,
|
|
1348
|
+
'Content-Type': contentType,
|
|
1349
|
+
'Content-Range': `bytes ${start}-${end}/${total}`,
|
|
1350
|
+
'Accept-Ranges': 'bytes',
|
|
1351
|
+
'Content-Length': String(end - start + 1),
|
|
1352
|
+
})
|
|
1353
|
+
if (method === 'HEAD') {
|
|
1354
|
+
res.end()
|
|
1355
|
+
return
|
|
1356
|
+
}
|
|
1357
|
+
fs.createReadStream(filePath, { start, end }).pipe(res)
|
|
1358
|
+
return
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
res.writeHead(200, {
|
|
1362
|
+
...cors,
|
|
1363
|
+
'Content-Type': contentType,
|
|
1364
|
+
'Accept-Ranges': 'bytes',
|
|
1365
|
+
'Content-Length': String(total),
|
|
1366
|
+
})
|
|
1367
|
+
if (method === 'HEAD') {
|
|
1368
|
+
res.end()
|
|
1369
|
+
return
|
|
1370
|
+
}
|
|
1371
|
+
fs.createReadStream(filePath).pipe(res)
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1262
1374
|
private handleServerScan(res: ServerResponse) {
|
|
1263
1375
|
const sendJson = (body: DiscoveredServer[]) => {
|
|
1264
1376
|
res.writeHead(200, {
|
|
@@ -1522,6 +1634,18 @@ export class SootSimBridgeHost {
|
|
|
1522
1634
|
return
|
|
1523
1635
|
}
|
|
1524
1636
|
|
|
1637
|
+
// /__camera-fixtures/<name> — the staged video behind `rnxsim camera play`.
|
|
1638
|
+
// the shell page is a different origin from this daemon (vite dev on 5173,
|
|
1639
|
+
// daemon on 7668+), and the camera pipeline draws the <video> to a canvas
|
|
1640
|
+
// and reads it back, so this needs real CORS or the canvas taints and
|
|
1641
|
+
// createImageBitmap throws. it sits above the read-only guard below
|
|
1642
|
+
// because it answers its own OPTIONS preflight with the CORS headers that
|
|
1643
|
+
// guard's bare 405 would omit.
|
|
1644
|
+
if (url.pathname.startsWith(CAMERA_FIXTURE_ROUTE)) {
|
|
1645
|
+
this.handleCameraFixture(url.pathname.slice(CAMERA_FIXTURE_ROUTE.length), req, res)
|
|
1646
|
+
return
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1525
1649
|
// every other daemon route is read-only unless its owning proxy handled
|
|
1526
1650
|
// the mutation above.
|
|
1527
1651
|
if (method !== 'GET' && method !== 'HEAD') {
|
|
@@ -2101,7 +2225,11 @@ export class SootSimBridgeHost {
|
|
|
2101
2225
|
}
|
|
2102
2226
|
if (this.shouldWriteDevLockfile) {
|
|
2103
2227
|
try {
|
|
2104
|
-
removeDevBridgeLockfile(
|
|
2228
|
+
removeDevBridgeLockfile({
|
|
2229
|
+
bridgePort: this.effectivePort,
|
|
2230
|
+
pid: process.pid,
|
|
2231
|
+
startedAt: this.startedAt,
|
|
2232
|
+
})
|
|
2105
2233
|
} catch {}
|
|
2106
2234
|
}
|
|
2107
2235
|
this.effectivePort = 0
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
|
-
// sootsim public package — CLI + framework integrations.
|
|
1
|
+
// sootsim public package — SDK client, CLI + framework integrations.
|
|
2
2
|
//
|
|
3
3
|
// the bridge client and plugins live here. the canvas rendering engine lives
|
|
4
4
|
// in the private `sootsim-engine` workspace package.
|
|
5
5
|
|
|
6
|
+
export { connect, type ConnectOptions } from './connect'
|
|
7
|
+
export {
|
|
8
|
+
SimClient,
|
|
9
|
+
SimClientError,
|
|
10
|
+
SimConnectError,
|
|
11
|
+
SimKeyboardError,
|
|
12
|
+
SimPerformError,
|
|
13
|
+
SimReadyTimeoutError,
|
|
14
|
+
SimResetError,
|
|
15
|
+
SimTapError,
|
|
16
|
+
type SimClientOptions,
|
|
17
|
+
type SimFindOptions,
|
|
18
|
+
type SimPerformStep,
|
|
19
|
+
type SimScreenshot,
|
|
20
|
+
type SimTapTarget,
|
|
21
|
+
} from './sim-client'
|
|
22
|
+
export type {
|
|
23
|
+
PerformOptions,
|
|
24
|
+
PerformResult,
|
|
25
|
+
PerformStep,
|
|
26
|
+
ResetOptions,
|
|
27
|
+
ResetResult,
|
|
28
|
+
SimStateOptions,
|
|
29
|
+
SimStateResult,
|
|
30
|
+
} from './bridge-contract'
|
|
31
|
+
|
|
6
32
|
export { sootsimPlugin } from './vite-plugin-one'
|
|
7
33
|
export { default as metroPlugin } from './metro-plugin'
|
|
8
34
|
export { default as jumpToSourceBabelPlugin } from './jump-to-source-babel'
|
package/src/sdk.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
// rnxsim/sdk — the scriptable sim-driving surface.
|
|
2
|
+
//
|
|
3
|
+
// exports the SimClient class plus the transport-agnostic inspect verbs it is
|
|
4
|
+
// built from. this entry MUST stay browser-safe (Contrast's in-browser agent
|
|
5
|
+
// imports it against an in-process preview bridge), so the node-only ws
|
|
6
|
+
// `connect()` lives on the ROOT `rnxsim` entry, not here.
|
|
7
|
+
|
|
8
|
+
export * from './sim-client'
|
|
1
9
|
export * from '../cli/commands/inspect/core'
|
|
2
10
|
export * from '../cli/commands/inspect/actions'
|
|
3
11
|
export { waitForSootsimIdle } from '../cli/commands/inspect/settling'
|