rnxsim 0.1.376 → 0.1.378
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -25
- package/cli/app-config.ts +9 -12
- package/cli/app-fonts.ts +3 -3
- package/cli/app-project.ts +8 -8
- package/cli/auth.ts +7 -9
- package/cli/bin.ts +16 -31
- package/cli/bridge-flow-runner.ts +3 -3
- package/cli/browser-backend.ts +44 -0
- package/cli/command-contract.ts +221 -0
- package/cli/command-registry.ts +291 -0
- package/cli/commands/agent-wrapper.ts +2 -2
- package/cli/commands/app-fonts.ts +2 -2
- package/cli/commands/assert.ts +3 -3
- package/cli/commands/auth.ts +1 -1
- package/cli/commands/box/cloud-box.ts +1 -1
- package/cli/commands/box/plane-share.ts +2 -2
- package/cli/commands/box.ts +4 -6
- package/cli/commands/compat.ts +1 -1
- package/cli/commands/config.ts +2 -2
- package/cli/commands/control.ts +29 -29
- package/cli/commands/cpu-profile.ts +7 -7
- package/cli/commands/daemon-mac-app.ts +7 -7
- package/cli/commands/daemon.ts +10 -10
- package/cli/commands/debug.ts +11 -11
- package/cli/commands/detox.ts +13 -13
- package/cli/commands/diagnose.ts +6 -6
- package/cli/commands/do-chain.ts +1 -2
- package/cli/commands/electron.ts +1 -3
- package/cli/commands/film.ts +3 -3
- package/cli/commands/flow.ts +43 -43
- package/cli/commands/inspect/count.ts +1 -1
- package/cli/commands/inspect/describe.ts +1 -1
- package/cli/commands/inspect/env.ts +2 -2
- package/cli/commands/inspect/get-layout.ts +1 -1
- package/cli/commands/inspect/keyboard.ts +1 -1
- package/cli/commands/inspect/list.ts +1 -1
- package/cli/commands/inspect/memory.ts +1 -1
- package/cli/commands/inspect/resolve-target.ts +1 -1
- package/cli/commands/inspect/screens.ts +1 -1
- package/cli/commands/inspect/tree.ts +1 -1
- package/cli/commands/inspect/url.ts +1 -1
- package/cli/commands/inspect/wait-event.ts +5 -5
- package/cli/commands/inspect.ts +34 -34
- package/cli/commands/install-desktop.ts +3 -3
- package/cli/commands/login.ts +6 -6
- package/cli/commands/maestro-generate.ts +5 -5
- package/cli/commands/maestro.ts +5 -5
- package/cli/commands/profile.ts +1 -1
- package/cli/commands/record.ts +9 -9
- package/cli/commands/runtime.ts +18 -18
- package/cli/commands/screenshot-command.ts +1 -1
- package/cli/commands/screenshot-layers.ts +5 -5
- package/cli/commands/screenshot-mode.ts +1 -1
- package/cli/commands/screenshot.ts +8 -8
- package/cli/commands/screenshots-capture.ts +5 -5
- package/cli/commands/serve.ts +3 -3
- package/cli/commands/setup.ts +20 -12
- package/cli/commands/skills.ts +5 -5
- package/cli/commands/slides.ts +1 -1
- package/cli/commands/telemetry.ts +1 -1
- package/cli/commands/three-mode.ts +1 -1
- package/cli/commands/timeline.ts +8 -8
- package/cli/commands/upgrade.ts +116 -131
- package/cli/commands/upload.ts +12 -12
- package/cli/commands/version.ts +7 -7
- package/cli/commands/what-happened.ts +9 -9
- package/cli/current-sim.ts +3 -3
- package/cli/desktop-companion.ts +1 -1
- package/cli/drivers/playwright.ts +9 -9
- package/cli/drivers/registry.ts +1 -1
- package/cli/drivers/types.ts +1 -1
- package/cli/flow-file.ts +2 -2
- package/cli/flow-session.ts +1 -1
- package/cli/help-core.ts +136 -0
- package/cli/help.ts +17 -53
- package/cli/hints.ts +5 -5
- package/cli/inspect-notice-state.ts +1 -1
- package/cli/maestro-js.ts +1 -1
- package/cli/outbound-endpoints.ts +23 -5
- package/cli/parse-args.ts +19 -66
- package/cli/recording-access.ts +1 -1
- package/cli/registry.ts +1 -0
- package/cli/run-registry.ts +1 -1
- package/cli/run-rnx-core.ts +148 -0
- package/cli/run-rnx.ts +6 -9
- package/cli/runtime-notes.ts +3 -3
- package/cli/standalone.ts +4 -0
- package/cli/ws-bridge.ts +8 -8
- package/detox/config-loader.ts +2 -2
- package/detox/index.ts +8 -8
- package/detox/jest-preset.cjs +1 -1
- package/detox/navigation.ts +2 -2
- package/dist-lib/agent-daemon-client.cjs +5 -5
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +2 -2
- package/dist-lib/agent-sessions.cjs +10 -10
- package/dist-lib/attached-projects.cjs +6 -6
- package/dist-lib/auth/shared-session.cjs +6 -6
- 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-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +25 -25
- package/dist-lib/detox/index.cjs +73 -31
- package/dist-lib/detox/jest-preset.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +29 -29
- package/dist-lib/host/bridge-host.cjs +128 -49
- 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/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +14 -14
- 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-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +8 -8
- package/dist-lib/profiles.cjs +12 -12
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +8 -8
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +329 -160
- package/dist-lib/vite.cjs +9 -9
- package/package.json +4 -11
- package/scripts/dev-server-scanner.ts +2 -2
- package/scripts/optional-demo-registry.ts +1 -1
- package/skills/contrast/SKILL.md +3 -3
- package/skills/rnx-debug/SKILL.md +1 -1
- package/skills/rnx-test/SKILL.md +2 -2
- package/src/agent-identity.ts +1 -1
- package/src/agent-sessions.ts +7 -5
- package/src/cli-version.ts +12 -4
- package/src/config.ts +26 -28
- package/src/disk-cleanup.ts +11 -11
- package/src/home-paths.ts +28 -28
- package/src/host/bridge-host.ts +16 -16
- package/src/metro-plugin.ts +2 -2
- package/src/profiles.ts +2 -2
- package/src/runtime-assets.ts +7 -7
- package/src/runtime-delivery.ts +13 -13
- package/src/screenshots/orchestrate.ts +1 -1
- package/src/screenshots/schema.ts +2 -2
- package/src/skills/builtin/a11y-review.ts +2 -2
- package/src/skills/builtin/compat-check.ts +2 -2
- package/src/skills/builtin/maestro-test.ts +2 -2
- package/src/skills/builtin/perf-profile.ts +2 -2
- package/src/skills/builtin/screenshot-all.ts +2 -2
- package/src/skills/builtin/visual-diff.ts +2 -2
- package/src/skills/registry.ts +8 -8
- package/src/skills/types.ts +1 -1
- package/src/vite-plugin-one.ts +3 -3
- package/src/vite-plugin.ts +15 -2
- package/dist-cli/bin.js +0 -15
- package/dist-cli/chunks/agent-H42FCKFF.js +0 -48
- package/dist-cli/chunks/agent-wrapper-BBZKTZS6.js +0 -17
- package/dist-cli/chunks/app-fonts-43VXIKF4.js +0 -4
- package/dist-cli/chunks/assert-IXOLVO5Z.js +0 -49
- package/dist-cli/chunks/auth-KFMFB6FU.js +0 -12
- package/dist-cli/chunks/beta-5AO3SJB7.js +0 -4
- package/dist-cli/chunks/box-ZHM66L6K.js +0 -1730
- package/dist-cli/chunks/camera-FNJVFCDQ.js +0 -33
- package/dist-cli/chunks/chunk-37MCSPTE.js +0 -71
- package/dist-cli/chunks/chunk-3PEMSUAQ.js +0 -30
- package/dist-cli/chunks/chunk-4TQ5HOK3.js +0 -7
- package/dist-cli/chunks/chunk-5YZYDEMI.js +0 -4
- package/dist-cli/chunks/chunk-6CV3R3XD.js +0 -15
- package/dist-cli/chunks/chunk-7LGK5XU6.js +0 -4
- package/dist-cli/chunks/chunk-7R2TK2NY.js +0 -4
- package/dist-cli/chunks/chunk-7VZZQQEE.js +0 -497
- package/dist-cli/chunks/chunk-AFOVILIL.js +0 -130
- package/dist-cli/chunks/chunk-BEU7CD7E.js +0 -9
- package/dist-cli/chunks/chunk-CE4JQJ6Y.js +0 -6
- package/dist-cli/chunks/chunk-CIE6CZXL.js +0 -142
- package/dist-cli/chunks/chunk-CSJ7L7ZL.js +0 -312
- package/dist-cli/chunks/chunk-CWCQP53A.js +0 -27
- package/dist-cli/chunks/chunk-DCS5FK5N.js +0 -7
- package/dist-cli/chunks/chunk-DEV3E3MV.js +0 -4
- package/dist-cli/chunks/chunk-DGJMIVZM.js +0 -5
- package/dist-cli/chunks/chunk-DGX3MN65.js +0 -5
- package/dist-cli/chunks/chunk-DNPQMTW5.js +0 -4
- package/dist-cli/chunks/chunk-DOVBJBVD.js +0 -5
- package/dist-cli/chunks/chunk-DPBJ3S3J.js +0 -3
- package/dist-cli/chunks/chunk-FVZBGPCU.js +0 -4
- package/dist-cli/chunks/chunk-GDKMOIUT.js +0 -4
- package/dist-cli/chunks/chunk-GIF2NJCS.js +0 -32
- package/dist-cli/chunks/chunk-GZE57ORL.js +0 -4
- package/dist-cli/chunks/chunk-H3U56DKI.js +0 -24
- package/dist-cli/chunks/chunk-HZLOYAPH.js +0 -4
- package/dist-cli/chunks/chunk-J2IKAEU2.js +0 -4
- package/dist-cli/chunks/chunk-JXAXYK7W.js +0 -11
- package/dist-cli/chunks/chunk-KJE2O2GK.js +0 -4
- package/dist-cli/chunks/chunk-KMNVDZZI.js +0 -423
- package/dist-cli/chunks/chunk-LC3QRIRB.js +0 -10
- package/dist-cli/chunks/chunk-LGFTAQYC.js +0 -4
- package/dist-cli/chunks/chunk-LQMUA5IY.js +0 -4
- package/dist-cli/chunks/chunk-MFIQTWC5.js +0 -4
- package/dist-cli/chunks/chunk-MGALNF2F.js +0 -7
- package/dist-cli/chunks/chunk-MLBZZHOY.js +0 -4
- package/dist-cli/chunks/chunk-NNRF7GIB.js +0 -107
- package/dist-cli/chunks/chunk-NORLYTTO.js +0 -7
- package/dist-cli/chunks/chunk-P6KVGV3H.js +0 -14
- package/dist-cli/chunks/chunk-PAJTUK33.js +0 -4
- package/dist-cli/chunks/chunk-QELIC5XP.js +0 -4
- package/dist-cli/chunks/chunk-QRDF33WD.js +0 -11
- package/dist-cli/chunks/chunk-R76BA7C7.js +0 -535
- package/dist-cli/chunks/chunk-RVEB4CZ2.js +0 -4
- package/dist-cli/chunks/chunk-SK4M7NXT.js +0 -5
- package/dist-cli/chunks/chunk-SKMG5DD7.js +0 -5
- package/dist-cli/chunks/chunk-TEESPOYR.js +0 -4
- package/dist-cli/chunks/chunk-TH2UFGVP.js +0 -4
- package/dist-cli/chunks/chunk-TLP3T3VO.js +0 -4
- package/dist-cli/chunks/chunk-TZUABDIJ.js +0 -38
- package/dist-cli/chunks/chunk-UB2W6OQM.js +0 -99
- package/dist-cli/chunks/chunk-UYVXALPB.js +0 -506
- package/dist-cli/chunks/chunk-VQDYFFIG.js +0 -5
- package/dist-cli/chunks/chunk-VWCNJPCJ.js +0 -5
- package/dist-cli/chunks/chunk-VZIK4WIS.js +0 -74
- package/dist-cli/chunks/chunk-W3FNXAQP.js +0 -4
- package/dist-cli/chunks/chunk-XCDNVNP3.js +0 -4
- package/dist-cli/chunks/chunk-XSVILA4Z.js +0 -4
- package/dist-cli/chunks/chunk-XUTJ7ZWD.js +0 -4
- package/dist-cli/chunks/chunk-YTXY3MHW.js +0 -4
- package/dist-cli/chunks/chunk-ZF7PVX44.js +0 -28
- package/dist-cli/chunks/chunk-ZSSG7OR7.js +0 -4
- package/dist-cli/chunks/cleanup-MLOK2OZA.js +0 -25
- package/dist-cli/chunks/cli-version-OBNR366V.js +0 -4
- package/dist-cli/chunks/compat-SHMFSKU7.js +0 -23
- package/dist-cli/chunks/config-TPEAEUJ2.js +0 -13
- package/dist-cli/chunks/connect-3LEXWTE5.js +0 -4
- package/dist-cli/chunks/control-Z3FWA6BO.js +0 -4
- package/dist-cli/chunks/daemon-RSVYSC65.js +0 -4
- package/dist-cli/chunks/debug-GUVAK2KR.js +0 -200
- package/dist-cli/chunks/desktop-OOP2PTKP.js +0 -31
- package/dist-cli/chunks/detox-C2ILVBEC.js +0 -52
- package/dist-cli/chunks/device-NXIQQJWR.js +0 -18
- package/dist-cli/chunks/diagnose-2JBGYE5L.js +0 -43
- package/dist-cli/chunks/disk-cleanup-VURWJYQV.js +0 -4
- package/dist-cli/chunks/do-chain-DJ4UQC7A.js +0 -5
- package/dist-cli/chunks/drivers-JMA2OIKU.js +0 -4
- package/dist-cli/chunks/env-KTNPKEZR.js +0 -4
- package/dist-cli/chunks/film-DCPS7EID.js +0 -74
- package/dist-cli/chunks/flow-4DZ7B2OA.js +0 -4
- package/dist-cli/chunks/help-34CJMQY2.js +0 -4
- package/dist-cli/chunks/hidden-runtime-alias-HHT2C7WE.js +0 -4
- package/dist-cli/chunks/home-paths-KTPGCPMS.js +0 -4
- package/dist-cli/chunks/inspect-JF5WYJRD.js +0 -4
- package/dist-cli/chunks/install-desktop-ZIC4CDXI.js +0 -4
- package/dist-cli/chunks/login-TTJAOI2Q.js +0 -26
- package/dist-cli/chunks/logout-ERAQ6SKW.js +0 -4
- package/dist-cli/chunks/maestro-W46QCF77.js +0 -108
- package/dist-cli/chunks/maestro-generate-VBLM3MTU.js +0 -36
- package/dist-cli/chunks/mode-ZEDZK7R7.js +0 -26
- package/dist-cli/chunks/optional-demo-registry-ZUTPSVYQ.js +0 -4
- package/dist-cli/chunks/perf-YVT2WXT4.js +0 -48
- package/dist-cli/chunks/permissions-L7VVDHFP.js +0 -13
- package/dist-cli/chunks/platform-7TJOU2FB.js +0 -6
- package/dist-cli/chunks/privacy-57UOTB5J.js +0 -4
- package/dist-cli/chunks/record-VXG37P7U.js +0 -72
- package/dist-cli/chunks/report-issue-WNNOBZHC.js +0 -29
- package/dist-cli/chunks/reset-H5NBFE5U.js +0 -4
- package/dist-cli/chunks/resolve-target-57TK5WLE.js +0 -4
- package/dist-cli/chunks/runtime-QU2NIF2K.js +0 -4
- package/dist-cli/chunks/screenshot-command-AN56TTG7.js +0 -159
- package/dist-cli/chunks/screenshot-layers-3W5R7DB2.js +0 -20
- package/dist-cli/chunks/screenshots-capture-6AWJY7XZ.js +0 -42
- package/dist-cli/chunks/serve-GLYO5Q7J.js +0 -56
- package/dist-cli/chunks/setup-UA2HLD7S.js +0 -4
- package/dist-cli/chunks/sim-client-5C2RDQQO.js +0 -4
- package/dist-cli/chunks/skills-EYXWBRNQ.js +0 -50
- package/dist-cli/chunks/state-REJ7W6K3.js +0 -14
- package/dist-cli/chunks/storage-CFMDHI3V.js +0 -37
- package/dist-cli/chunks/store-XMCUA45G.js +0 -4
- package/dist-cli/chunks/telemetry-FBL3NAKB.js +0 -4
- package/dist-cli/chunks/timeline-HMCHN5FO.js +0 -24
- package/dist-cli/chunks/upgrade-2QSPAA3P.js +0 -7
- package/dist-cli/chunks/upload-DUQBKZYV.js +0 -4
- package/dist-cli/chunks/version-IOA6QFGB.js +0 -6
- package/dist-cli/chunks/web-NCGUYVCJ.js +0 -4
- package/dist-cli/chunks/welcome-QYGSQCWQ.js +0 -5
- package/dist-cli/chunks/what-happened-YTOUK4LO.js +0 -25
- package/dist-cli/chunks/ws-bridge-OF4OZARG.js +0 -4
- package/scripts/postinstall.cjs +0 -3
- package/scripts/preuninstall.cjs +0 -118
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.378 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -44,6 +44,18 @@ function processCommand(pid) {
|
|
|
44
44
|
encoding: "utf8"
|
|
45
45
|
}).trim();
|
|
46
46
|
}
|
|
47
|
+
function processIdentity(pid) {
|
|
48
|
+
try {
|
|
49
|
+
const identity = (0, import_node_child_process.execFileSync)(
|
|
50
|
+
"/bin/ps",
|
|
51
|
+
["-p", String(pid), "-o", "lstart=", "-o", "command="],
|
|
52
|
+
{ encoding: "utf8" }
|
|
53
|
+
).trim();
|
|
54
|
+
return identity || null;
|
|
55
|
+
} catch {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
47
59
|
function softwareChromeAllowed(runtime = currentRuntime()) {
|
|
48
60
|
return runtime.platform === "linux" && runtime.env.GITHUB_ACTIONS === "true" && runtime.env.RUNNER_OS === "Linux";
|
|
49
61
|
}
|
|
@@ -169,6 +181,25 @@ function killTree(pid) {
|
|
|
169
181
|
} catch {
|
|
170
182
|
}
|
|
171
183
|
}
|
|
184
|
+
function killOwnedTree(tracked) {
|
|
185
|
+
if (tracked.readIdentity(tracked.pid) !== tracked.identity) return;
|
|
186
|
+
killTree(tracked.pid);
|
|
187
|
+
}
|
|
188
|
+
function trackReapPid(pid, readIdentity = processIdentity) {
|
|
189
|
+
const identity = readIdentity(pid);
|
|
190
|
+
if (identity === null) return null;
|
|
191
|
+
const current = reapPids.get(pid);
|
|
192
|
+
if (current?.identity === identity && current.readIdentity === readIdentity) {
|
|
193
|
+
return current;
|
|
194
|
+
}
|
|
195
|
+
const tracked = { pid, identity, readIdentity };
|
|
196
|
+
reapPids.set(pid, tracked);
|
|
197
|
+
installReaper();
|
|
198
|
+
return tracked;
|
|
199
|
+
}
|
|
200
|
+
function untrackReapPid(tracked) {
|
|
201
|
+
if (reapPids.get(tracked.pid) === tracked) reapPids.delete(tracked.pid);
|
|
202
|
+
}
|
|
172
203
|
function browserControl(b) {
|
|
173
204
|
const candidate = b;
|
|
174
205
|
if (!candidate || typeof candidate !== "object") return null;
|
|
@@ -183,11 +214,15 @@ function browserControl(b) {
|
|
|
183
214
|
return null;
|
|
184
215
|
}
|
|
185
216
|
}
|
|
186
|
-
function registerChromePid(browser, control, pid) {
|
|
217
|
+
function registerChromePid(browser, control, pid, readIdentity = processIdentity) {
|
|
187
218
|
if (browser && typeof browser === "object") discoveredChromePids.set(browser, pid);
|
|
188
219
|
discoveredChromePids.set(control, pid);
|
|
189
|
-
|
|
190
|
-
|
|
220
|
+
const tracked = trackReapPid(pid, readIdentity);
|
|
221
|
+
if (tracked === null) return;
|
|
222
|
+
if (browser && typeof browser === "object") {
|
|
223
|
+
discoveredChromeProcesses.set(browser, tracked);
|
|
224
|
+
}
|
|
225
|
+
discoveredChromeProcesses.set(control, tracked);
|
|
191
226
|
}
|
|
192
227
|
async function discoverChromePid(browser) {
|
|
193
228
|
const known = rootChromePid(browser);
|
|
@@ -205,10 +240,10 @@ async function discoverChromePid(browser) {
|
|
|
205
240
|
}
|
|
206
241
|
}
|
|
207
242
|
async function rejectLaunchedBrowser(browser) {
|
|
208
|
-
const
|
|
209
|
-
if (
|
|
210
|
-
|
|
211
|
-
|
|
243
|
+
const tracked = browser && typeof browser === "object" ? discoveredChromeProcesses.get(browser) : void 0;
|
|
244
|
+
if (tracked) {
|
|
245
|
+
killOwnedTree(tracked);
|
|
246
|
+
untrackReapPid(tracked);
|
|
212
247
|
return;
|
|
213
248
|
}
|
|
214
249
|
const candidate = browser;
|
|
@@ -219,12 +254,12 @@ async function rejectLaunchedBrowser(browser) {
|
|
|
219
254
|
}
|
|
220
255
|
}
|
|
221
256
|
}
|
|
222
|
-
async function validateLaunchedGpuBrowser(browser, runtime, rendererTarget, commandForPid = processCommand) {
|
|
257
|
+
async function validateLaunchedGpuBrowser(browser, runtime, rendererTarget, commandForPid = processCommand, readIdentity = processIdentity) {
|
|
223
258
|
if (softwareChromeAllowed(runtime)) return;
|
|
224
259
|
const root = rootChromePid(browser);
|
|
225
260
|
const launchedControl = browserControl(browser);
|
|
226
261
|
if (root !== null && launchedControl) {
|
|
227
|
-
registerChromePid(browser, launchedControl, root);
|
|
262
|
+
registerChromePid(browser, launchedControl, root, readIdentity);
|
|
228
263
|
}
|
|
229
264
|
if (root !== null && (runtime.platform === "darwin" || runtime.platform === "linux")) {
|
|
230
265
|
assertGpuBrowserCommand(commandForPid(root), runtime);
|
|
@@ -238,7 +273,7 @@ async function validateLaunchedGpuBrowser(browser, runtime, rendererTarget, comm
|
|
|
238
273
|
if (pid === null) {
|
|
239
274
|
throw new Error("[reap-browser] Chrome did not report its browser process id");
|
|
240
275
|
}
|
|
241
|
-
registerChromePid(browser, control, pid);
|
|
276
|
+
registerChromePid(browser, control, pid, readIdentity);
|
|
242
277
|
if (rendererBrowser && typeof rendererBrowser === "object") {
|
|
243
278
|
discoveredChromePids.set(rendererBrowser, pid);
|
|
244
279
|
}
|
|
@@ -257,7 +292,7 @@ function installReaper() {
|
|
|
257
292
|
if (installed) return;
|
|
258
293
|
installed = true;
|
|
259
294
|
const reap = () => {
|
|
260
|
-
for (const
|
|
295
|
+
for (const tracked of reapPids.values()) killOwnedTree(tracked);
|
|
261
296
|
};
|
|
262
297
|
if (!signalShutdownClaimed) {
|
|
263
298
|
process.on("SIGTERM", () => {
|
|
@@ -271,7 +306,7 @@ function installReaper() {
|
|
|
271
306
|
}
|
|
272
307
|
process.on("exit", reap);
|
|
273
308
|
}
|
|
274
|
-
async function launchReapedScoped(launch3) {
|
|
309
|
+
async function launchReapedScoped(launch3, readIdentity = processIdentity) {
|
|
275
310
|
const browser = await launch3();
|
|
276
311
|
let root = rootChromePid(browser);
|
|
277
312
|
if (root === null) {
|
|
@@ -283,29 +318,31 @@ async function launchReapedScoped(launch3) {
|
|
|
283
318
|
}
|
|
284
319
|
const mine = /* @__PURE__ */ new Set();
|
|
285
320
|
if (root != null) {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
installReaper();
|
|
321
|
+
const tracked = trackReapPid(root, readIdentity);
|
|
322
|
+
if (tracked !== null) mine.add(tracked);
|
|
289
323
|
}
|
|
290
324
|
const evented = browserControl(browser) ?? browser;
|
|
291
325
|
if (typeof evented.on === "function") {
|
|
292
326
|
const disconnectEvent = typeof evented.newBrowserCDPSession === "function" ? "disconnected" : "close";
|
|
293
327
|
evented.on(disconnectEvent, () => {
|
|
294
|
-
for (const
|
|
328
|
+
for (const tracked of mine) {
|
|
329
|
+
killOwnedTree(tracked);
|
|
330
|
+
untrackReapPid(tracked);
|
|
331
|
+
}
|
|
295
332
|
mine.clear();
|
|
296
333
|
});
|
|
297
334
|
}
|
|
298
335
|
const reapNow = () => {
|
|
299
|
-
for (const
|
|
300
|
-
|
|
301
|
-
|
|
336
|
+
for (const tracked of mine) {
|
|
337
|
+
killOwnedTree(tracked);
|
|
338
|
+
untrackReapPid(tracked);
|
|
302
339
|
}
|
|
303
340
|
mine.clear();
|
|
304
341
|
};
|
|
305
342
|
return { browser, reapNow };
|
|
306
343
|
}
|
|
307
|
-
async function launchReaped(launch3) {
|
|
308
|
-
const { browser } = await launchReapedScoped(launch3);
|
|
344
|
+
async function launchReaped(launch3, readIdentity = processIdentity) {
|
|
345
|
+
const { browser } = await launchReapedScoped(launch3, readIdentity);
|
|
309
346
|
return browser;
|
|
310
347
|
}
|
|
311
348
|
function gpuChromeArgs(platform = process.platform) {
|
|
@@ -394,7 +431,8 @@ function platformChromeLaunch(launch3, opts, rendererTarget, policy = {}) {
|
|
|
394
431
|
browser,
|
|
395
432
|
runtime,
|
|
396
433
|
rendererTarget,
|
|
397
|
-
policy.processCommand
|
|
434
|
+
policy.processCommand,
|
|
435
|
+
policy.processIdentity
|
|
398
436
|
);
|
|
399
437
|
} catch (err) {
|
|
400
438
|
await rejectLaunchedBrowser(browser);
|
|
@@ -435,15 +473,19 @@ function chromeLaunchOptions(opts = {}, runtime = currentRuntime()) {
|
|
|
435
473
|
return softwareChromeAllowed(runtime) ? softwareChromeLaunchOptions(opts) : gpuChromeLaunchOptions(opts, runtime);
|
|
436
474
|
}
|
|
437
475
|
async function launchReapedChrome(launch3, opts = {}, rendererTarget, policy = {}) {
|
|
438
|
-
return launchReaped(
|
|
476
|
+
return launchReaped(
|
|
477
|
+
platformChromeLaunch(launch3, opts, rendererTarget, policy),
|
|
478
|
+
policy.processIdentity
|
|
479
|
+
);
|
|
439
480
|
}
|
|
440
|
-
var import_node_child_process, discoveredChromePids, reapPids, installed, signalShutdownClaimed;
|
|
481
|
+
var import_node_child_process, discoveredChromePids, discoveredChromeProcesses, reapPids, installed, signalShutdownClaimed;
|
|
441
482
|
var init_reap_browser = __esm({
|
|
442
483
|
"../../scripts/lib/reap-browser.ts"() {
|
|
443
484
|
"use strict";
|
|
444
485
|
import_node_child_process = require("node:child_process");
|
|
445
486
|
discoveredChromePids = /* @__PURE__ */ new WeakMap();
|
|
446
|
-
|
|
487
|
+
discoveredChromeProcesses = /* @__PURE__ */ new WeakMap();
|
|
488
|
+
reapPids = /* @__PURE__ */ new Map();
|
|
447
489
|
installed = false;
|
|
448
490
|
signalShutdownClaimed = false;
|
|
449
491
|
}
|
|
@@ -1783,9 +1825,9 @@ var init_registry = __esm({
|
|
|
1783
1825
|
coverage: 0.9,
|
|
1784
1826
|
coverageSource: "estimated",
|
|
1785
1827
|
capabilityCoverage: CAPABILITY_INVENTORY_PACKAGE_COVERAGE["react-native-gesture-handler"],
|
|
1786
|
-
note: "tap, pan, pinch, rotation, fling, long press, race, manual, simultaneous",
|
|
1787
|
-
working: "GestureDetector, Gesture.Tap/Pan/Pinch/Rotation/Fling/LongPress/Manual/Race/Simultaneous/Exclusive/Hover, simultaneousWithExternalGesture/requireExternalGestureToFail/blocksExternalGesture, ScrollView/FlatList, Switch/RefreshControl, Pressable/Text, Touchables, BaseButton/RawButton/RectButton/BorderlessButton/PureNativeButton, Swipeable, ReanimatedSwipeable, DrawerLayout (the upstream component running on this seam: renderNavigationView, drawerPosition/drawerType/drawerWidth/edgeWidth, openDrawer/closeDrawer, edge-swipe drag, onDrawerOpen/onDrawerClose/onDrawerStateChanged), GestureHandlerRootView, createNativeWrapper, gestureHandlerRootHOC, PointerType/MouseButton/HoverEffect exports, velocity tracking, activeOffsets, multi-tap",
|
|
1788
|
-
missing: "
|
|
1828
|
+
note: "tap, pan, pinch, rotation, fling, long press, race, manual, simultaneous, force touch unavailable-hardware parity",
|
|
1829
|
+
working: "GestureDetector, Gesture.Tap/Pan/Pinch/Rotation/Fling/LongPress/ForceTouch/Manual/Race/Simultaneous/Exclusive/Hover, ForceTouchGestureHandler unavailable-hardware fallback (children render, forceTouchAvailable false, no force events), simultaneousWithExternalGesture/requireExternalGestureToFail/blocksExternalGesture, ScrollView/FlatList, Switch/RefreshControl, Pressable/Text, Touchables, BaseButton/RawButton/RectButton/BorderlessButton/PureNativeButton, Swipeable, ReanimatedSwipeable, DrawerLayout (the upstream component running on this seam: renderNavigationView, drawerPosition/drawerType/drawerWidth/edgeWidth, openDrawer/closeDrawer, edge-swipe drag, onDrawerOpen/onDrawerClose/onDrawerStateChanged), GestureHandlerRootView, createNativeWrapper, gestureHandlerRootHOC, PointerType/MouseButton/HoverEffect exports, velocity tracking, activeOffsets, multi-tap",
|
|
1830
|
+
missing: "Force Touch recognition is unavailable because browser pointer input has no pressure signal; both public APIs expose the upstream unavailable-hardware behavior instead of inventing force events"
|
|
1789
1831
|
}
|
|
1790
1832
|
]
|
|
1791
1833
|
},
|
|
@@ -2675,7 +2717,7 @@ var init_registry = __esm({
|
|
|
2675
2717
|
coverage: 0.95,
|
|
2676
2718
|
note: "suite-scoped NSUserDefaults-style string storage backed by localStorage or in-memory storage",
|
|
2677
2719
|
working: "default export, get, set, clear, getMultiple, setMultiple, clearMultiple, getAll, clearAll, setName, getName",
|
|
2678
|
-
missing: "sharing values with real native UserDefaults/app groups outside the
|
|
2720
|
+
missing: "sharing values with real native UserDefaults/app groups outside the RNX runtime"
|
|
2679
2721
|
}
|
|
2680
2722
|
]
|
|
2681
2723
|
},
|
|
@@ -14439,14 +14481,14 @@ var init_backend_origin = __esm({
|
|
|
14439
14481
|
function hasOwnKeys(value) {
|
|
14440
14482
|
return !!value && Object.keys(value).length > 0;
|
|
14441
14483
|
}
|
|
14442
|
-
function
|
|
14484
|
+
function hasRNXConfig(config) {
|
|
14443
14485
|
if (!config) return false;
|
|
14444
14486
|
return typeof config.runtimeVersion === "string" && config.runtimeVersion.length > 0 || hasOwnKeys(config.modules) || hasOwnKeys(config.turboModules) || hasOwnKeys(config.nativeModules) || hasOwnKeys(config.env) || hasOwnKeys(config.network?.remap) || hasOwnKeys(config.settings) || hasOwnKeys(config.initialState);
|
|
14445
14487
|
}
|
|
14446
|
-
function
|
|
14447
|
-
if (!
|
|
14448
|
-
if (!
|
|
14449
|
-
if (!
|
|
14488
|
+
function mergeRNXConfig(base, override) {
|
|
14489
|
+
if (!hasRNXConfig(base) && !hasRNXConfig(override)) return void 0;
|
|
14490
|
+
if (!hasRNXConfig(base)) return override ? { ...override } : void 0;
|
|
14491
|
+
if (!hasRNXConfig(override)) return base ? { ...base } : void 0;
|
|
14450
14492
|
return {
|
|
14451
14493
|
runtimeVersion: override.runtimeVersion ?? base.runtimeVersion,
|
|
14452
14494
|
modules: { ...base.modules || {}, ...override.modules || {} },
|
|
@@ -14466,20 +14508,20 @@ function mergeSootSimConfig(base, override) {
|
|
|
14466
14508
|
initialState: { ...base.initialState || {}, ...override.initialState || {} }
|
|
14467
14509
|
};
|
|
14468
14510
|
}
|
|
14469
|
-
function
|
|
14511
|
+
function applyRNXConfigToUrl(url, config) {
|
|
14470
14512
|
const parsed = new URL(url);
|
|
14471
|
-
if (
|
|
14472
|
-
parsed.searchParams.set(
|
|
14513
|
+
if (hasRNXConfig(config)) {
|
|
14514
|
+
parsed.searchParams.set(RNX_CONFIG_QUERY_PARAM, JSON.stringify(config));
|
|
14473
14515
|
} else {
|
|
14474
|
-
parsed.searchParams.delete(
|
|
14516
|
+
parsed.searchParams.delete(RNX_CONFIG_QUERY_PARAM);
|
|
14475
14517
|
}
|
|
14476
14518
|
return parsed.toString();
|
|
14477
14519
|
}
|
|
14478
|
-
var
|
|
14520
|
+
var RNX_CONFIG_QUERY_PARAM;
|
|
14479
14521
|
var init_config = __esm({
|
|
14480
14522
|
"src/config.ts"() {
|
|
14481
14523
|
"use strict";
|
|
14482
|
-
|
|
14524
|
+
RNX_CONFIG_QUERY_PARAM = "rnxConfig";
|
|
14483
14525
|
}
|
|
14484
14526
|
});
|
|
14485
14527
|
|
|
@@ -15219,7 +15261,7 @@ function withRuntimeConfig(port, bundleUrl, projectCwd) {
|
|
|
15219
15261
|
}) : [];
|
|
15220
15262
|
const exactKnownApps = knownApps.filter((app) => app.preferredPort === port);
|
|
15221
15263
|
const knownApp = exactKnownApps.length === 1 ? exactKnownApps[0] : exactKnownApps.length === 0 && knownApps.length === 1 ? knownApps[0] : void 0;
|
|
15222
|
-
const configured = knownApp?.runtimeConfig ?
|
|
15264
|
+
const configured = knownApp?.runtimeConfig ? applyRNXConfigToUrl(bundleUrl, knownApp.runtimeConfig) : bundleUrl;
|
|
15223
15265
|
return normalizeNativeDevBundleUrl(configured);
|
|
15224
15266
|
}
|
|
15225
15267
|
function isDirectOneBundleUrl(bundleUrl) {
|
|
@@ -15610,6 +15652,10 @@ var init_public_brand = __esm({
|
|
|
15610
15652
|
// src/cli-version.ts
|
|
15611
15653
|
function getCliVersion() {
|
|
15612
15654
|
if (cached2 != null) return cached2;
|
|
15655
|
+
if (typeof __RNX_CLI_VERSION__ !== "undefined" && typeof __RNX_CLI_VERSION__ === "string" && __RNX_CLI_VERSION__) {
|
|
15656
|
+
cached2 = __RNX_CLI_VERSION__;
|
|
15657
|
+
return cached2;
|
|
15658
|
+
}
|
|
15613
15659
|
const candidates = [
|
|
15614
15660
|
() => (0, import_node_url2.fileURLToPath)(import_meta.resolve(`${rnxPublicBrand.packageName}/package.json`)),
|
|
15615
15661
|
() => (0, import_node_url2.fileURLToPath)(new URL("../package.json", __sootsim_import_meta_url))
|
|
@@ -15647,7 +15693,7 @@ __export(home_paths_exports, {
|
|
|
15647
15693
|
DAEMON_HEARTBEAT_STALE_MS: () => DAEMON_HEARTBEAT_STALE_MS,
|
|
15648
15694
|
DAEMON_LOCKFILE: () => DAEMON_LOCKFILE,
|
|
15649
15695
|
DEV_BRIDGES_DIR: () => DEV_BRIDGES_DIR,
|
|
15650
|
-
|
|
15696
|
+
RNX_HOME_ENV: () => RNX_HOME_ENV,
|
|
15651
15697
|
activeRuntimeDir: () => activeRuntimeDir,
|
|
15652
15698
|
activeRuntimeFile: () => activeRuntimeFile,
|
|
15653
15699
|
cacheDir: () => cacheDir,
|
|
@@ -15664,7 +15710,7 @@ __export(home_paths_exports, {
|
|
|
15664
15710
|
electronDir: () => electronDir,
|
|
15665
15711
|
electronUserDataDir: () => electronUserDataDir,
|
|
15666
15712
|
electronVersionDir: () => electronVersionDir,
|
|
15667
|
-
|
|
15713
|
+
ensureRnxHome: () => ensureRnxHome,
|
|
15668
15714
|
isDaemonLockfileFresh: () => isDaemonLockfileFresh,
|
|
15669
15715
|
isDevBridgeLockfileFresh: () => isDevBridgeLockfileFresh,
|
|
15670
15716
|
isDevWorkstation: () => isDevWorkstation,
|
|
@@ -15681,11 +15727,11 @@ __export(home_paths_exports, {
|
|
|
15681
15727
|
readSimulatorDriverPreference: () => readSimulatorDriverPreference,
|
|
15682
15728
|
removeDaemonLockfile: () => removeDaemonLockfile,
|
|
15683
15729
|
removeDevBridgeLockfile: () => removeDevBridgeLockfile,
|
|
15730
|
+
rnxHomeDir: () => rnxHomeDir,
|
|
15684
15731
|
runtimeDir: () => runtimeDir,
|
|
15685
15732
|
runtimeUpgradeNoticePath: () => runtimeUpgradeNoticePath,
|
|
15686
15733
|
runtimesDir: () => runtimesDir,
|
|
15687
15734
|
shouldSkipPersistentDaemon: () => shouldSkipPersistentDaemon,
|
|
15688
|
-
sootsimHomeDir: () => sootsimHomeDir,
|
|
15689
15735
|
writeActiveRuntime: () => writeActiveRuntime,
|
|
15690
15736
|
writeDaemonLockfile: () => writeDaemonLockfile,
|
|
15691
15737
|
writeDevBridgeLockfile: () => writeDevBridgeLockfile,
|
|
@@ -15694,10 +15740,10 @@ __export(home_paths_exports, {
|
|
|
15694
15740
|
writeRuntimeUpgradeNotice: () => writeRuntimeUpgradeNotice,
|
|
15695
15741
|
writeSharedConfig: () => writeSharedConfig
|
|
15696
15742
|
});
|
|
15697
|
-
function
|
|
15698
|
-
const override = process.env[
|
|
15743
|
+
function rnxHomeDir() {
|
|
15744
|
+
const override = process.env[RNX_HOME_ENV];
|
|
15699
15745
|
if (override && override.length > 0) return import_node_path4.default.resolve(override);
|
|
15700
|
-
return import_node_path4.default.join((0, import_node_os.homedir)(), ".
|
|
15746
|
+
return import_node_path4.default.join((0, import_node_os.homedir)(), ".rnx");
|
|
15701
15747
|
}
|
|
15702
15748
|
function isSootsimDevCheckout() {
|
|
15703
15749
|
if (process.env.SOOTSIM_FORCE_DAEMON_INSTALL === "1") return false;
|
|
@@ -15721,7 +15767,7 @@ function shouldSkipPersistentDaemon() {
|
|
|
15721
15767
|
return isSootsimDevCheckout() || isDevWorkstation();
|
|
15722
15768
|
}
|
|
15723
15769
|
function runtimesDir() {
|
|
15724
|
-
return import_node_path4.default.join(
|
|
15770
|
+
return import_node_path4.default.join(rnxHomeDir(), "runtimes");
|
|
15725
15771
|
}
|
|
15726
15772
|
function runtimeDir(version) {
|
|
15727
15773
|
return import_node_path4.default.join(runtimesDir(), version);
|
|
@@ -15730,7 +15776,7 @@ function activeRuntimeFile() {
|
|
|
15730
15776
|
return import_node_path4.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
|
|
15731
15777
|
}
|
|
15732
15778
|
function electronDir() {
|
|
15733
|
-
return import_node_path4.default.join(
|
|
15779
|
+
return import_node_path4.default.join(rnxHomeDir(), "electron");
|
|
15734
15780
|
}
|
|
15735
15781
|
function electronUserDataDir() {
|
|
15736
15782
|
return import_node_path4.default.join(electronDir(), "userData");
|
|
@@ -15739,28 +15785,28 @@ function electronVersionDir(version) {
|
|
|
15739
15785
|
return import_node_path4.default.join(electronDir(), version);
|
|
15740
15786
|
}
|
|
15741
15787
|
function profilesDir() {
|
|
15742
|
-
return import_node_path4.default.join(
|
|
15788
|
+
return import_node_path4.default.join(rnxHomeDir(), "profiles");
|
|
15743
15789
|
}
|
|
15744
15790
|
function cameraFixturesDir() {
|
|
15745
|
-
return import_node_path4.default.join(
|
|
15791
|
+
return import_node_path4.default.join(rnxHomeDir(), "camera-fixtures");
|
|
15746
15792
|
}
|
|
15747
15793
|
function daemonAppDir() {
|
|
15748
|
-
return import_node_path4.default.join(
|
|
15794
|
+
return import_node_path4.default.join(rnxHomeDir(), "daemon-app");
|
|
15749
15795
|
}
|
|
15750
15796
|
function daemonAppBundlePath() {
|
|
15751
|
-
return import_node_path4.default.join(daemonAppDir(), "
|
|
15797
|
+
return import_node_path4.default.join(daemonAppDir(), "RNX Daemon.app");
|
|
15752
15798
|
}
|
|
15753
15799
|
function daemonAppLauncherPath() {
|
|
15754
|
-
return import_node_path4.default.join(daemonAppBundlePath(), "Contents", "MacOS", "
|
|
15800
|
+
return import_node_path4.default.join(daemonAppBundlePath(), "Contents", "MacOS", "rnx-daemon");
|
|
15755
15801
|
}
|
|
15756
15802
|
function cacheDir() {
|
|
15757
|
-
return import_node_path4.default.join(
|
|
15803
|
+
return import_node_path4.default.join(rnxHomeDir(), "cache");
|
|
15758
15804
|
}
|
|
15759
15805
|
function daemonLockfilePath() {
|
|
15760
|
-
return import_node_path4.default.join(
|
|
15806
|
+
return import_node_path4.default.join(rnxHomeDir(), DAEMON_LOCKFILE);
|
|
15761
15807
|
}
|
|
15762
15808
|
function devBridgesDir() {
|
|
15763
|
-
return import_node_path4.default.join(
|
|
15809
|
+
return import_node_path4.default.join(rnxHomeDir(), DEV_BRIDGES_DIR);
|
|
15764
15810
|
}
|
|
15765
15811
|
function devBridgeLockfilePath(bridgePort) {
|
|
15766
15812
|
if (!Number.isInteger(bridgePort) || bridgePort <= 0) {
|
|
@@ -15769,7 +15815,7 @@ function devBridgeLockfilePath(bridgePort) {
|
|
|
15769
15815
|
return import_node_path4.default.join(devBridgesDir(), `${bridgePort}.json`);
|
|
15770
15816
|
}
|
|
15771
15817
|
function configFilePath() {
|
|
15772
|
-
return import_node_path4.default.join(
|
|
15818
|
+
return import_node_path4.default.join(rnxHomeDir(), CONFIG_FILE);
|
|
15773
15819
|
}
|
|
15774
15820
|
function readSharedConfig() {
|
|
15775
15821
|
try {
|
|
@@ -15781,7 +15827,7 @@ function readSharedConfig() {
|
|
|
15781
15827
|
}
|
|
15782
15828
|
}
|
|
15783
15829
|
function writeSharedConfig(patch) {
|
|
15784
|
-
|
|
15830
|
+
ensureRnxHome();
|
|
15785
15831
|
const current = readSharedConfig();
|
|
15786
15832
|
const next = { ...current, ...patch };
|
|
15787
15833
|
if (patch.settings && typeof patch.settings === "object") {
|
|
@@ -15835,10 +15881,10 @@ function readOrCreateAnonymousId() {
|
|
|
15835
15881
|
return created;
|
|
15836
15882
|
}
|
|
15837
15883
|
function runtimeUpgradeNoticePath() {
|
|
15838
|
-
return import_node_path4.default.join(
|
|
15884
|
+
return import_node_path4.default.join(rnxHomeDir(), "runtime-upgraded.json");
|
|
15839
15885
|
}
|
|
15840
15886
|
function writeRuntimeUpgradeNotice(notice) {
|
|
15841
|
-
|
|
15887
|
+
ensureRnxHome();
|
|
15842
15888
|
const tmp = `${runtimeUpgradeNoticePath()}.tmp`;
|
|
15843
15889
|
import_node_fs4.default.writeFileSync(tmp, `${JSON.stringify(notice)}
|
|
15844
15890
|
`, "utf8");
|
|
@@ -15859,8 +15905,8 @@ function consumeRuntimeUpgradeNotice() {
|
|
|
15859
15905
|
return null;
|
|
15860
15906
|
}
|
|
15861
15907
|
}
|
|
15862
|
-
function
|
|
15863
|
-
import_node_fs4.default.mkdirSync(
|
|
15908
|
+
function ensureRnxHome() {
|
|
15909
|
+
import_node_fs4.default.mkdirSync(rnxHomeDir(), { recursive: true });
|
|
15864
15910
|
import_node_fs4.default.mkdirSync(runtimesDir(), { recursive: true });
|
|
15865
15911
|
import_node_fs4.default.mkdirSync(electronDir(), { recursive: true });
|
|
15866
15912
|
import_node_fs4.default.mkdirSync(profilesDir(), { recursive: true });
|
|
@@ -15983,7 +16029,7 @@ function readLiveRuntimeVersions() {
|
|
|
15983
16029
|
return [...versions].sort();
|
|
15984
16030
|
}
|
|
15985
16031
|
function writeDaemonLockfile(data) {
|
|
15986
|
-
|
|
16032
|
+
ensureRnxHome();
|
|
15987
16033
|
const lockfilePath = daemonLockfilePath();
|
|
15988
16034
|
const existing = readDaemonLockfile();
|
|
15989
16035
|
if (!existing) {
|
|
@@ -16113,7 +16159,7 @@ function releaseDaemonClaim(owner) {
|
|
|
16113
16159
|
}
|
|
16114
16160
|
}
|
|
16115
16161
|
function claimDaemonLockfile(data) {
|
|
16116
|
-
|
|
16162
|
+
ensureRnxHome();
|
|
16117
16163
|
if (!acquireDaemonClaim(data)) return false;
|
|
16118
16164
|
try {
|
|
16119
16165
|
const existing = readDaemonLockfile();
|
|
@@ -16154,7 +16200,7 @@ function removeDevBridgeLockfile(owner) {
|
|
|
16154
16200
|
} catch {
|
|
16155
16201
|
}
|
|
16156
16202
|
}
|
|
16157
|
-
var import_node_crypto, import_node_fs4, import_node_os, import_node_path4,
|
|
16203
|
+
var import_node_crypto, import_node_fs4, import_node_os, import_node_path4, RNX_HOME_ENV, ACTIVE_RUNTIME_FILE, DAEMON_LOCKFILE, DEV_BRIDGES_DIR, CONFIG_FILE, DAEMON_HEARTBEAT_STALE_MS, CURRENT_ONBOARDING_VERSION, DAEMON_LOCKFILE_MAX_BYTES, DAEMON_CLAIM_STALE_MS;
|
|
16158
16204
|
var init_home_paths = __esm({
|
|
16159
16205
|
"src/home-paths.ts"() {
|
|
16160
16206
|
"use strict";
|
|
@@ -16162,7 +16208,7 @@ var init_home_paths = __esm({
|
|
|
16162
16208
|
import_node_fs4 = __toESM(require("node:fs"), 1);
|
|
16163
16209
|
import_node_os = require("node:os");
|
|
16164
16210
|
import_node_path4 = __toESM(require("node:path"), 1);
|
|
16165
|
-
|
|
16211
|
+
RNX_HOME_ENV = "RNX_HOME";
|
|
16166
16212
|
ACTIVE_RUNTIME_FILE = "active";
|
|
16167
16213
|
DAEMON_LOCKFILE = "daemon.json";
|
|
16168
16214
|
DEV_BRIDGES_DIR = "dev-bridges";
|
|
@@ -16612,7 +16658,7 @@ function findMonorepoRoot() {
|
|
|
16612
16658
|
return null;
|
|
16613
16659
|
}
|
|
16614
16660
|
function resolveDevCheckoutRuntimeRoot() {
|
|
16615
|
-
if (process.env.
|
|
16661
|
+
if (process.env.RNX_HOME && readActiveRuntime()) return null;
|
|
16616
16662
|
const root = findMonorepoRoot();
|
|
16617
16663
|
if (!root) return null;
|
|
16618
16664
|
const devBuild = import_path.default.join(root, "public/sootsim");
|
|
@@ -16682,7 +16728,7 @@ var init_runtime_assets = __esm({
|
|
|
16682
16728
|
});
|
|
16683
16729
|
|
|
16684
16730
|
// src/runtime-delivery.ts
|
|
16685
|
-
var DEFAULT_RUNTIME_CDN_ORIGIN,
|
|
16731
|
+
var DEFAULT_RUNTIME_CDN_ORIGIN, RNX_CHANGELOG_URL, RNX_CHANGELOG_API_URL, RNX_RUNTIME_PRODUCT, rnxRuntime;
|
|
16686
16732
|
var init_runtime_delivery = __esm({
|
|
16687
16733
|
"src/runtime-delivery.ts"() {
|
|
16688
16734
|
"use strict";
|
|
@@ -16690,10 +16736,10 @@ var init_runtime_delivery = __esm({
|
|
|
16690
16736
|
init_home_paths();
|
|
16691
16737
|
init_public_brand();
|
|
16692
16738
|
DEFAULT_RUNTIME_CDN_ORIGIN = "https://contrast.dev";
|
|
16693
|
-
|
|
16694
|
-
|
|
16695
|
-
|
|
16696
|
-
id: "
|
|
16739
|
+
RNX_CHANGELOG_URL = `${rnxPublicBrand.origin}/changelog`;
|
|
16740
|
+
RNX_CHANGELOG_API_URL = "https://contrast.dev/api/changelog/sootsim";
|
|
16741
|
+
RNX_RUNTIME_PRODUCT = {
|
|
16742
|
+
id: "rnx",
|
|
16697
16743
|
defaultCdnOrigin: DEFAULT_RUNTIME_CDN_ORIGIN,
|
|
16698
16744
|
manifestPath: "/runtimes/manifest.json",
|
|
16699
16745
|
tarballPath: (version) => `/runtimes/sootsim-runtime-${version}.tar.gz`,
|
|
@@ -16702,10 +16748,10 @@ var init_runtime_delivery = __esm({
|
|
|
16702
16748
|
// vite/metro plugins serve, so its absence means the tarball is not one.
|
|
16703
16749
|
installedMarker: "index.html",
|
|
16704
16750
|
env: {
|
|
16705
|
-
cdnOrigin: "
|
|
16706
|
-
channel: "
|
|
16751
|
+
cdnOrigin: "RNX_CDN_ORIGIN",
|
|
16752
|
+
channel: "RNX_RUNTIME_CHANNEL"
|
|
16707
16753
|
},
|
|
16708
|
-
ensureHome:
|
|
16754
|
+
ensureHome: ensureRnxHome,
|
|
16709
16755
|
configFile: configFilePath,
|
|
16710
16756
|
runtimesDir,
|
|
16711
16757
|
runtimeDir,
|
|
@@ -16713,7 +16759,7 @@ var init_runtime_delivery = __esm({
|
|
|
16713
16759
|
readActiveRuntime,
|
|
16714
16760
|
writeActiveRuntime
|
|
16715
16761
|
};
|
|
16716
|
-
|
|
16762
|
+
rnxRuntime = createRuntimeDelivery(RNX_RUNTIME_PRODUCT);
|
|
16717
16763
|
}
|
|
16718
16764
|
});
|
|
16719
16765
|
|
|
@@ -17076,8 +17122,8 @@ function pidIsAlive(pid, sessionId) {
|
|
|
17076
17122
|
return true;
|
|
17077
17123
|
}
|
|
17078
17124
|
function resolveSootsimInvocation() {
|
|
17079
|
-
if (process.env.
|
|
17080
|
-
return { cmd: process.env.
|
|
17125
|
+
if (process.env.RNX_BIN) {
|
|
17126
|
+
return { cmd: process.env.RNX_BIN, prefixArgs: [] };
|
|
17081
17127
|
}
|
|
17082
17128
|
if (process.versions.electron) {
|
|
17083
17129
|
const resourcesPath = process.resourcesPath;
|
|
@@ -17100,7 +17146,7 @@ function resolveSootsimInvocation() {
|
|
|
17100
17146
|
}
|
|
17101
17147
|
if (!argv1 || argv1.includes("/.bin/")) {
|
|
17102
17148
|
throw new Error(
|
|
17103
|
-
"rnx CLI not found. set
|
|
17149
|
+
"rnx CLI not found. set RNX_BIN to the path of the rnx binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`."
|
|
17104
17150
|
);
|
|
17105
17151
|
}
|
|
17106
17152
|
return { cmd: argv0, prefixArgs: [] };
|
|
@@ -17109,7 +17155,7 @@ function tryWorkspaceSootsim() {
|
|
|
17109
17155
|
try {
|
|
17110
17156
|
const sootsimDir = resolveSootsimPackageDir();
|
|
17111
17157
|
if (!sootsimDir) return null;
|
|
17112
|
-
const binaryName = `
|
|
17158
|
+
const binaryName = `rnx-${process.platform === "win32" ? "windows" : process.platform}-${process.arch}${process.platform === "win32" ? ".exe" : ""}`;
|
|
17113
17159
|
const distBinary = import_node_path8.default.join(sootsimDir, "dist-bin", binaryName);
|
|
17114
17160
|
if (import_node_fs8.default.existsSync(distBinary)) return { cmd: distBinary, prefixArgs: [] };
|
|
17115
17161
|
const distBin = import_node_path8.default.join(sootsimDir, "dist-cli", "bin.js");
|
|
@@ -18514,6 +18560,131 @@ var init_open_url = __esm({
|
|
|
18514
18560
|
}
|
|
18515
18561
|
});
|
|
18516
18562
|
|
|
18563
|
+
// ../contrast-harness/src/planeProtocol.ts
|
|
18564
|
+
function encodeBase64(bytes) {
|
|
18565
|
+
let binary = "";
|
|
18566
|
+
const CHUNK = 32768;
|
|
18567
|
+
for (let i = 0; i < bytes.length; i += CHUNK) {
|
|
18568
|
+
binary += String.fromCharCode(...bytes.subarray(i, i + CHUNK));
|
|
18569
|
+
}
|
|
18570
|
+
return btoa(binary);
|
|
18571
|
+
}
|
|
18572
|
+
function decodeBase64(value) {
|
|
18573
|
+
const binary = atob(value);
|
|
18574
|
+
const bytes = new Uint8Array(binary.length);
|
|
18575
|
+
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
|
|
18576
|
+
return bytes;
|
|
18577
|
+
}
|
|
18578
|
+
function indexVersion(index) {
|
|
18579
|
+
let a = 2166136261;
|
|
18580
|
+
let b = 16777619;
|
|
18581
|
+
for (const key of [...index.keys()].sort()) {
|
|
18582
|
+
const meta = index.get(key);
|
|
18583
|
+
if (!meta) continue;
|
|
18584
|
+
const line = `${key} ${meta.size} ${meta.readOnly ? 1 : 0}${meta.binary ? 1 : 0} ${meta.hash ?? ""}`;
|
|
18585
|
+
for (let i = 0; i < line.length; i++) {
|
|
18586
|
+
const c = line.charCodeAt(i);
|
|
18587
|
+
a = Math.imul(a ^ c, 16777619);
|
|
18588
|
+
b = Math.imul(b + c, 2246822507) ^ b >>> 13;
|
|
18589
|
+
}
|
|
18590
|
+
}
|
|
18591
|
+
return `${(a >>> 0).toString(36)}${(b >>> 0).toString(36)}-${index.size}`;
|
|
18592
|
+
}
|
|
18593
|
+
function serializeIndex(index) {
|
|
18594
|
+
const out = [];
|
|
18595
|
+
for (const [key, meta] of index) {
|
|
18596
|
+
const flags = (meta.readOnly ? PLANE_FLAG_READ_ONLY : 0) | (meta.binary ? PLANE_FLAG_BINARY : 0);
|
|
18597
|
+
out.push(meta.hash ? [key, meta.size, flags, meta.hash] : [key, meta.size, flags]);
|
|
18598
|
+
}
|
|
18599
|
+
return out;
|
|
18600
|
+
}
|
|
18601
|
+
async function dispatchPlaneCommand(plane, type, msg, mutationOptions) {
|
|
18602
|
+
switch (type) {
|
|
18603
|
+
case "plane:index":
|
|
18604
|
+
case "plane:refresh": {
|
|
18605
|
+
await plane.refresh();
|
|
18606
|
+
const version = indexVersion(plane.index());
|
|
18607
|
+
if (msg.sinceVersion && msg.sinceVersion === version) {
|
|
18608
|
+
return { result: { version, unchanged: true }, version };
|
|
18609
|
+
}
|
|
18610
|
+
return { result: { version, entries: serializeIndex(plane.index()) }, version };
|
|
18611
|
+
}
|
|
18612
|
+
case "plane:read":
|
|
18613
|
+
return { result: { content: await plane.read(String(msg.path)) } };
|
|
18614
|
+
case "plane:read-bytes":
|
|
18615
|
+
return { result: { base64: encodeBase64(await plane.readBytes(String(msg.path))) } };
|
|
18616
|
+
case "plane:write": {
|
|
18617
|
+
mutationOptions?.signal?.throwIfAborted();
|
|
18618
|
+
await plane.write(
|
|
18619
|
+
String(msg.path),
|
|
18620
|
+
decodeBase64(String(msg.base64 ?? "")),
|
|
18621
|
+
mutationOptions
|
|
18622
|
+
);
|
|
18623
|
+
const version = indexVersion(plane.index());
|
|
18624
|
+
return { result: { version }, version };
|
|
18625
|
+
}
|
|
18626
|
+
case "plane:delete": {
|
|
18627
|
+
mutationOptions?.signal?.throwIfAborted();
|
|
18628
|
+
await plane.delete(String(msg.path), mutationOptions);
|
|
18629
|
+
const version = indexVersion(plane.index());
|
|
18630
|
+
return { result: { version }, version };
|
|
18631
|
+
}
|
|
18632
|
+
default:
|
|
18633
|
+
return null;
|
|
18634
|
+
}
|
|
18635
|
+
}
|
|
18636
|
+
var PLANE_FLAG_READ_ONLY, PLANE_FLAG_BINARY;
|
|
18637
|
+
var init_planeProtocol = __esm({
|
|
18638
|
+
"../contrast-harness/src/planeProtocol.ts"() {
|
|
18639
|
+
"use strict";
|
|
18640
|
+
PLANE_FLAG_READ_ONLY = 1;
|
|
18641
|
+
PLANE_FLAG_BINARY = 2;
|
|
18642
|
+
}
|
|
18643
|
+
});
|
|
18644
|
+
|
|
18645
|
+
// ../contrast-harness/src/projectFileCache.ts
|
|
18646
|
+
var init_projectFileCache = __esm({
|
|
18647
|
+
"../contrast-harness/src/projectFileCache.ts"() {
|
|
18648
|
+
"use strict";
|
|
18649
|
+
}
|
|
18650
|
+
});
|
|
18651
|
+
|
|
18652
|
+
// ../contrast-harness/src/planeClient.ts
|
|
18653
|
+
var init_planeClient = __esm({
|
|
18654
|
+
"../contrast-harness/src/planeClient.ts"() {
|
|
18655
|
+
"use strict";
|
|
18656
|
+
init_planeProtocol();
|
|
18657
|
+
init_projectFileCache();
|
|
18658
|
+
}
|
|
18659
|
+
});
|
|
18660
|
+
|
|
18661
|
+
// ../contrast-harness/src/projectFilePlaneRpc.ts
|
|
18662
|
+
var init_projectFilePlaneRpc = __esm({
|
|
18663
|
+
"../contrast-harness/src/projectFilePlaneRpc.ts"() {
|
|
18664
|
+
"use strict";
|
|
18665
|
+
init_planeProtocol();
|
|
18666
|
+
}
|
|
18667
|
+
});
|
|
18668
|
+
|
|
18669
|
+
// ../contrast-harness/src/planeTransport.browser.ts
|
|
18670
|
+
var init_planeTransport_browser = __esm({
|
|
18671
|
+
"../contrast-harness/src/planeTransport.browser.ts"() {
|
|
18672
|
+
"use strict";
|
|
18673
|
+
}
|
|
18674
|
+
});
|
|
18675
|
+
|
|
18676
|
+
// ../contrast-harness/src/plane.ts
|
|
18677
|
+
var init_plane = __esm({
|
|
18678
|
+
"../contrast-harness/src/plane.ts"() {
|
|
18679
|
+
"use strict";
|
|
18680
|
+
init_planeProtocol();
|
|
18681
|
+
init_planeClient();
|
|
18682
|
+
init_projectFilePlaneRpc();
|
|
18683
|
+
init_planeTransport_browser();
|
|
18684
|
+
init_projectFileCache();
|
|
18685
|
+
}
|
|
18686
|
+
});
|
|
18687
|
+
|
|
18517
18688
|
// cli/commands/box/checkout-plane.ts
|
|
18518
18689
|
function looksBinary(filePath, size) {
|
|
18519
18690
|
if (size === 0) return false;
|
|
@@ -18639,13 +18810,13 @@ var init_checkout_plane = __esm({
|
|
|
18639
18810
|
});
|
|
18640
18811
|
|
|
18641
18812
|
// src/host/plane-host.ts
|
|
18642
|
-
var import_node_fs11, import_node_path11,
|
|
18813
|
+
var import_node_fs11, import_node_path11, WS_OPEN2, PlaneNotRegisteredError, PlaneHost;
|
|
18643
18814
|
var init_plane_host = __esm({
|
|
18644
18815
|
"src/host/plane-host.ts"() {
|
|
18645
18816
|
"use strict";
|
|
18646
18817
|
import_node_fs11 = __toESM(require("node:fs"), 1);
|
|
18647
18818
|
import_node_path11 = __toESM(require("node:path"), 1);
|
|
18648
|
-
|
|
18819
|
+
init_plane();
|
|
18649
18820
|
init_checkout_plane();
|
|
18650
18821
|
WS_OPEN2 = 1;
|
|
18651
18822
|
PlaneNotRegisteredError = class extends Error {
|
|
@@ -18737,7 +18908,7 @@ var init_plane_host = __esm({
|
|
|
18737
18908
|
const entry = {
|
|
18738
18909
|
root,
|
|
18739
18910
|
plane,
|
|
18740
|
-
version:
|
|
18911
|
+
version: indexVersion(plane.index()),
|
|
18741
18912
|
sockets: /* @__PURE__ */ new Set([ws])
|
|
18742
18913
|
};
|
|
18743
18914
|
this.open.set(planeId, entry);
|
|
@@ -18751,7 +18922,7 @@ var init_plane_host = __esm({
|
|
|
18751
18922
|
}
|
|
18752
18923
|
default: {
|
|
18753
18924
|
const entry = this.entry(msg);
|
|
18754
|
-
const handled = await
|
|
18925
|
+
const handled = await dispatchPlaneCommand(entry.plane, type, msg);
|
|
18755
18926
|
if (!handled) throw new Error(`unknown plane command: ${type}`);
|
|
18756
18927
|
if (handled.version) entry.version = handled.version;
|
|
18757
18928
|
return handled.result;
|
|
@@ -19546,7 +19717,7 @@ var init_bridge_host = __esm({
|
|
|
19546
19717
|
return;
|
|
19547
19718
|
}
|
|
19548
19719
|
if (msg.type === "runtime:list") {
|
|
19549
|
-
const versions =
|
|
19720
|
+
const versions = rnxRuntime.listInstalled();
|
|
19550
19721
|
const active = this.getActiveRuntime();
|
|
19551
19722
|
const reply = {
|
|
19552
19723
|
type: "runtime:list:ok",
|
|
@@ -19563,7 +19734,7 @@ var init_bridge_host = __esm({
|
|
|
19563
19734
|
}
|
|
19564
19735
|
if (msg.type === "runtime:use") {
|
|
19565
19736
|
const version = typeof msg.version === "string" ? msg.version : "";
|
|
19566
|
-
const installed2 =
|
|
19737
|
+
const installed2 = rnxRuntime.listInstalled();
|
|
19567
19738
|
if (!installed2.includes(version)) {
|
|
19568
19739
|
try {
|
|
19569
19740
|
ws.send(
|
|
@@ -19926,7 +20097,7 @@ var init_bridge_host = __esm({
|
|
|
19926
20097
|
this.wsHeartbeatTimer.unref();
|
|
19927
20098
|
if (this.shouldWriteLockfile) {
|
|
19928
20099
|
try {
|
|
19929
|
-
|
|
20100
|
+
ensureRnxHome();
|
|
19930
20101
|
const claimed = claimDaemonLockfile(this.buildLockfileSnapshot());
|
|
19931
20102
|
if (!claimed) {
|
|
19932
20103
|
throw new Error(
|
|
@@ -20056,7 +20227,7 @@ var init_bridge_host = __esm({
|
|
|
20056
20227
|
return this.inflightScan;
|
|
20057
20228
|
}
|
|
20058
20229
|
// serves one staged camera fixture. addressed by basename inside
|
|
20059
|
-
// ~/.
|
|
20230
|
+
// ~/.rnx/camera-fixtures, never by a caller-supplied path, so there is
|
|
20060
20231
|
// no traversal surface to defend: a name that is not a plain basename is
|
|
20061
20232
|
// rejected outright. range support is not optional here — chrome asks for
|
|
20062
20233
|
// byte ranges on media and cannot seek or loop a fixture without it.
|
|
@@ -20166,8 +20337,8 @@ var init_bridge_host = __esm({
|
|
|
20166
20337
|
}
|
|
20167
20338
|
startRuntimeUpdater() {
|
|
20168
20339
|
if (!this.shouldWriteLockfile || this.runtimeUpdateTimer) return;
|
|
20169
|
-
if (import_fs2.default.existsSync(import_path2.default.join(
|
|
20170
|
-
if (process.env.
|
|
20340
|
+
if (import_fs2.default.existsSync(import_path2.default.join(rnxHomeDir(), "runtime-update-disabled"))) return;
|
|
20341
|
+
if (process.env.RNX_HOME && isSootsimDevCheckout() && !readActiveRuntime()) {
|
|
20171
20342
|
return;
|
|
20172
20343
|
}
|
|
20173
20344
|
void this.runRuntimeUpdate("startup");
|
|
@@ -20184,7 +20355,7 @@ var init_bridge_host = __esm({
|
|
|
20184
20355
|
if (reason === "startup") {
|
|
20185
20356
|
process.stderr.write("rnx: checking for runtime updates\u2026\n");
|
|
20186
20357
|
}
|
|
20187
|
-
const result = await
|
|
20358
|
+
const result = await rnxRuntime.updateToLatest({
|
|
20188
20359
|
protectVersions: this.connectedRuntimeVersions()
|
|
20189
20360
|
});
|
|
20190
20361
|
if (!result.updated || !result.latestVersion) {
|
|
@@ -21448,7 +21619,7 @@ function getCurrentSimPath() {
|
|
|
21448
21619
|
return (0, import_path3.resolve)(process.env[CURRENT_SIM_PATH_ENV]);
|
|
21449
21620
|
}
|
|
21450
21621
|
const key = getCliIdentityKey();
|
|
21451
|
-
return (0, import_path3.join)((0, import_os.tmpdir)(), `
|
|
21622
|
+
return (0, import_path3.join)((0, import_os.tmpdir)(), `rnx-current-sim-${key}.json`);
|
|
21452
21623
|
}
|
|
21453
21624
|
function readCurrentSim() {
|
|
21454
21625
|
const filepath = getCurrentSimPath();
|
|
@@ -21504,7 +21675,7 @@ var init_current_sim = __esm({
|
|
|
21504
21675
|
CURRENT_SIM_VERSION = 1;
|
|
21505
21676
|
CURRENT_SIM_PATH_ENV = "SOOTSIM_CLI_CURRENT_SIM_PATH";
|
|
21506
21677
|
IDENTITY_ENV_VARS = [
|
|
21507
|
-
"
|
|
21678
|
+
"RNX_CLI_IDENTITY",
|
|
21508
21679
|
// explicit override — fastest path, skips all pid lookups
|
|
21509
21680
|
"TM_SESSION",
|
|
21510
21681
|
// Team Machine session id; routes prompt-bar followups back to this agent
|
|
@@ -21609,7 +21780,7 @@ function resolveDefaultDevBridgeLockfile() {
|
|
|
21609
21780
|
return lockfiles.find((lockfile) => lockfile.bridgePort === DEFAULT_SOOTSIM_BRIDGE_PORT) ?? lockfiles[0];
|
|
21610
21781
|
}
|
|
21611
21782
|
function resolveBridgeWorld() {
|
|
21612
|
-
const homeDir =
|
|
21783
|
+
const homeDir = rnxHomeDir();
|
|
21613
21784
|
if (resolvedWorld?.homeDir === homeDir) return resolvedWorld.world;
|
|
21614
21785
|
const world = resolveBridgeWorldFresh();
|
|
21615
21786
|
resolvedWorld = { homeDir, world };
|
|
@@ -22324,7 +22495,7 @@ function withDefault(index) {
|
|
|
22324
22495
|
};
|
|
22325
22496
|
}
|
|
22326
22497
|
function writeIndex(index) {
|
|
22327
|
-
|
|
22498
|
+
ensureRnxHome();
|
|
22328
22499
|
const next = withDefault(index);
|
|
22329
22500
|
const tmp = `${profileIndexPath()}.tmp`;
|
|
22330
22501
|
import_fs5.default.writeFileSync(tmp, `${JSON.stringify(next, null, 2)}
|
|
@@ -22383,8 +22554,8 @@ function firstNamedFile(dir, names) {
|
|
|
22383
22554
|
function findExpoAppConfig(dir) {
|
|
22384
22555
|
return firstNamedFile(dir, EXPO_APP_CONFIG_NAMES);
|
|
22385
22556
|
}
|
|
22386
|
-
function
|
|
22387
|
-
return firstNamedFile(dir,
|
|
22557
|
+
function findRNXAppConfig(dir) {
|
|
22558
|
+
return firstNamedFile(dir, RNX_APP_CONFIG_NAMES);
|
|
22388
22559
|
}
|
|
22389
22560
|
function resolveAppProject(projectRoot) {
|
|
22390
22561
|
const appDir = import_node_path14.default.resolve(projectRoot);
|
|
@@ -22393,13 +22564,13 @@ function resolveAppProject(projectRoot) {
|
|
|
22393
22564
|
} catch {
|
|
22394
22565
|
return null;
|
|
22395
22566
|
}
|
|
22396
|
-
const configPath =
|
|
22567
|
+
const configPath = findRNXAppConfig(appDir);
|
|
22397
22568
|
if (!configPath && !findExpoAppConfig(appDir) && !import_node_fs13.default.existsSync(import_node_path14.default.join(appDir, "package.json"))) {
|
|
22398
22569
|
return null;
|
|
22399
22570
|
}
|
|
22400
22571
|
return { appDir, configPath };
|
|
22401
22572
|
}
|
|
22402
|
-
var import_node_fs13, import_node_path14, EXPO_APP_CONFIG_NAMES,
|
|
22573
|
+
var import_node_fs13, import_node_path14, EXPO_APP_CONFIG_NAMES, RNX_APP_CONFIG_NAMES;
|
|
22403
22574
|
var init_app_project = __esm({
|
|
22404
22575
|
"cli/app-project.ts"() {
|
|
22405
22576
|
"use strict";
|
|
@@ -22412,11 +22583,11 @@ var init_app_project = __esm({
|
|
|
22412
22583
|
"app.config.mjs",
|
|
22413
22584
|
"app.json"
|
|
22414
22585
|
];
|
|
22415
|
-
|
|
22416
|
-
"
|
|
22417
|
-
"
|
|
22418
|
-
"
|
|
22419
|
-
"
|
|
22586
|
+
RNX_APP_CONFIG_NAMES = [
|
|
22587
|
+
"rnx.config.ts",
|
|
22588
|
+
"rnx.config.js",
|
|
22589
|
+
"rnx.config.mjs",
|
|
22590
|
+
"rnx.config.cjs"
|
|
22420
22591
|
];
|
|
22421
22592
|
}
|
|
22422
22593
|
});
|
|
@@ -22425,7 +22596,7 @@ var init_app_project = __esm({
|
|
|
22425
22596
|
function isOptionalRecord(value) {
|
|
22426
22597
|
return value === void 0 || value !== null && typeof value === "object" && !Array.isArray(value);
|
|
22427
22598
|
}
|
|
22428
|
-
function
|
|
22599
|
+
function isRNXConfig(value) {
|
|
22429
22600
|
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
22430
22601
|
const runtimeVersion = Reflect.get(value, "runtimeVersion");
|
|
22431
22602
|
const network = Reflect.get(value, "network");
|
|
@@ -22444,7 +22615,7 @@ function resolveConfigReplacementFiles(config, configPath) {
|
|
|
22444
22615
|
)
|
|
22445
22616
|
};
|
|
22446
22617
|
}
|
|
22447
|
-
async function
|
|
22618
|
+
async function loadRNXAppConfig(project) {
|
|
22448
22619
|
if (!project?.configPath) return void 0;
|
|
22449
22620
|
try {
|
|
22450
22621
|
const jiti = (0, import_jiti.createJiti)(__sootsim_import_meta_url, {
|
|
@@ -22456,7 +22627,7 @@ async function loadSootSimAppConfig(project) {
|
|
|
22456
22627
|
}
|
|
22457
22628
|
});
|
|
22458
22629
|
const loaded = await jiti.import(project.configPath, { default: true });
|
|
22459
|
-
if (!
|
|
22630
|
+
if (!isRNXConfig(loaded)) {
|
|
22460
22631
|
throw new Error("the default export must be an rnx config object");
|
|
22461
22632
|
}
|
|
22462
22633
|
return resolveConfigReplacementFiles(loaded, project.configPath);
|
|
@@ -22465,9 +22636,9 @@ async function loadSootSimAppConfig(project) {
|
|
|
22465
22636
|
throw new Error(`could not load ${project.configPath}: ${message}`);
|
|
22466
22637
|
}
|
|
22467
22638
|
}
|
|
22468
|
-
async function
|
|
22639
|
+
async function resolveRNXAppConfig(startDir = process.cwd()) {
|
|
22469
22640
|
const project = resolveAppProject(startDir);
|
|
22470
|
-
return { project, config: await
|
|
22641
|
+
return { project, config: await loadRNXAppConfig(project) };
|
|
22471
22642
|
}
|
|
22472
22643
|
var import_node_module, import_node_path15, import_jiti, require2;
|
|
22473
22644
|
var init_app_config = __esm({
|
|
@@ -23942,7 +24113,7 @@ function resolveUserDataDir(opts) {
|
|
|
23942
24113
|
return playwrightProfileUserDataDir(ensureProfile(opts.profileId).id);
|
|
23943
24114
|
}
|
|
23944
24115
|
if (opts.ephemeralProfile) {
|
|
23945
|
-
return (0, import_fs7.mkdtempSync)((0, import_path6.join)((0, import_os2.tmpdir)(), "
|
|
24116
|
+
return (0, import_fs7.mkdtempSync)((0, import_path6.join)((0, import_os2.tmpdir)(), "rnx-playwright-profile-"));
|
|
23946
24117
|
}
|
|
23947
24118
|
return "";
|
|
23948
24119
|
}
|
|
@@ -23974,7 +24145,7 @@ async function launch2(opts) {
|
|
|
23974
24145
|
}
|
|
23975
24146
|
const errLog = (0, import_path6.join)(
|
|
23976
24147
|
(0, import_os2.tmpdir)(),
|
|
23977
|
-
`
|
|
24148
|
+
`rnx-playwright-host-${Date.now().toString(36)}-${process.pid}.log`
|
|
23978
24149
|
);
|
|
23979
24150
|
const connectAckFile = `${errLog}.connected`;
|
|
23980
24151
|
const errFd = (0, import_fs7.openSync)(errLog, "a");
|
|
@@ -24066,7 +24237,7 @@ const callerUserDataDir = process.env.SOOTSIM_PW_USERDATADIR || '';
|
|
|
24066
24237
|
const ownerPid = Number(process.env.SOOTSIM_PW_OWNER_PID || 0);
|
|
24067
24238
|
const ownerPollMs = Number(process.env.SOOTSIM_PW_OWNER_POLL_MS || 5000);
|
|
24068
24239
|
// optional CDP port \u2014 exposes Chrome's remote-debugging endpoint so a
|
|
24069
|
-
// bridge-driven sim can also be cpu-profiled (
|
|
24240
|
+
// bridge-driven sim can also be cpu-profiled (rnx perf cpu --cdp-port).
|
|
24070
24241
|
// playwright keeps its own pipe connection; the port is an additional endpoint.
|
|
24071
24242
|
const cdpPort = process.env.SOOTSIM_PW_CDP_PORT || '';
|
|
24072
24243
|
// extra chromium launch args, space-separated. a linux GPU runner injects
|
|
@@ -24110,7 +24281,7 @@ const { join } = require('path');
|
|
|
24110
24281
|
//
|
|
24111
24282
|
// the prior approach was \`pgrep -f ms-playwright/[c]hromium\`. it never matched
|
|
24112
24283
|
// system Chrome, so the reaper was a no-op in the common case and every
|
|
24113
|
-
// aborted/closed \`
|
|
24284
|
+
// aborted/closed \`rnx open\` leaked a renderer + gpu helper burning 100%+
|
|
24114
24285
|
// CPU until manually killed (multiple incidents 2026-06).
|
|
24115
24286
|
//
|
|
24116
24287
|
// fix: identify our chrome tree by its UNIQUE user-data-dir. every helper a
|
|
@@ -24123,13 +24294,13 @@ const reapEnabled = process.platform !== 'win32';
|
|
|
24123
24294
|
let profileDir = callerUserDataDir;
|
|
24124
24295
|
let ephemeralProfile = false;
|
|
24125
24296
|
if (!profileDir) {
|
|
24126
|
-
profileDir = mkdtempSync(join(tmpdir(), '
|
|
24297
|
+
profileDir = mkdtempSync(join(tmpdir(), 'rnx-playwright-host-'));
|
|
24127
24298
|
ephemeralProfile = true;
|
|
24128
24299
|
}
|
|
24129
24300
|
// browser HTTP caches are acceleration data, not profile identity. give each
|
|
24130
24301
|
// host a bounded temporary cache so persistent named profiles retain cookies
|
|
24131
24302
|
// and storage without multiplying a private cache for every profile.
|
|
24132
|
-
const diskCacheDir = mkdtempSync(join(tmpdir(), '
|
|
24303
|
+
const diskCacheDir = mkdtempSync(join(tmpdir(), 'rnx-playwright-cache-'));
|
|
24133
24304
|
const chromePidsByProfile = () => {
|
|
24134
24305
|
if (!reapEnabled) return [];
|
|
24135
24306
|
try {
|
|
@@ -24300,7 +24471,7 @@ const cleanupProfile = () => {
|
|
|
24300
24471
|
// through shutdown(); the exit hook (sync sweep) still reaps the tree.
|
|
24301
24472
|
process.on('exit', () => { reapChrome(); cleanupProfile(); });
|
|
24302
24473
|
// owner-liveness watchdog \u2014 the load-bearing fix for leaked Chrome hosts.
|
|
24303
|
-
// we are spawned detached + unref'd so \`
|
|
24474
|
+
// we are spawned detached + unref'd so \`rnx open\` returns immediately,
|
|
24304
24475
|
// which means nothing in the OS process tree ties Chrome's lifetime to the
|
|
24305
24476
|
// session that asked for it. once the sim connects, the connect-timeout
|
|
24306
24477
|
// safety net is cleared, so absent an explicit \`sootsim close\` (or the
|
|
@@ -24329,7 +24500,7 @@ const cleanupProfile = () => {
|
|
|
24329
24500
|
// com.google.chrome.for.testing identity cannot intercept open/quit events for
|
|
24330
24501
|
// the user's com.google.Chrome browser. CI may use chromium_headless_shell;
|
|
24331
24502
|
// local rendering fails closed because that shell has no GPU and silently
|
|
24332
|
-
// chooses SwiftShader. NOTE: this is NOT enough to make \`
|
|
24503
|
+
// chooses SwiftShader. NOTE: this is NOT enough to make \`rnx perf cpu\`
|
|
24333
24504
|
// work \u2014 that profiles the tenant *worker*, and the JS Self-Profiler API
|
|
24334
24505
|
// cannot be constructed in a dedicated worker (see
|
|
24335
24506
|
// worker-handlers/cpu-profile.ts). cpu-profile needs a CDP-based profiler
|
|
@@ -24595,7 +24766,7 @@ var init_run_rnx = __esm({
|
|
|
24595
24766
|
|
|
24596
24767
|
// cli/commands/inspect/env.ts
|
|
24597
24768
|
function isAgentEnv() {
|
|
24598
|
-
if (process.env.
|
|
24769
|
+
if (process.env.RNX_AGENT === "0") return false;
|
|
24599
24770
|
for (const name2 of AGENT_ENV_VARS) {
|
|
24600
24771
|
const v = process.env[name2];
|
|
24601
24772
|
if (v && v.trim() && v !== "0") return true;
|
|
@@ -24607,7 +24778,7 @@ var init_env = __esm({
|
|
|
24607
24778
|
"cli/commands/inspect/env.ts"() {
|
|
24608
24779
|
"use strict";
|
|
24609
24780
|
AGENT_ENV_VARS = [
|
|
24610
|
-
"
|
|
24781
|
+
"RNX_AGENT",
|
|
24611
24782
|
"TM_SESSION",
|
|
24612
24783
|
"CLAUDECODE",
|
|
24613
24784
|
"CLAUDE_CODE_ENTRYPOINT",
|
|
@@ -24631,7 +24802,7 @@ function isChangelogEntry(value) {
|
|
|
24631
24802
|
}
|
|
24632
24803
|
async function fetchRuntimeReleaseNotes(version, fetchImpl = fetch) {
|
|
24633
24804
|
try {
|
|
24634
|
-
const url = new URL(
|
|
24805
|
+
const url = new URL(RNX_CHANGELOG_API_URL);
|
|
24635
24806
|
url.searchParams.set("version", version);
|
|
24636
24807
|
const response = await fetchImpl(url, {
|
|
24637
24808
|
headers: { accept: "application/json" },
|
|
@@ -24659,7 +24830,7 @@ function formatRuntimeReleaseNotes(version, entry) {
|
|
|
24659
24830
|
}
|
|
24660
24831
|
}
|
|
24661
24832
|
}
|
|
24662
|
-
lines.push(` full changelog: ${
|
|
24833
|
+
lines.push(` full changelog: ${RNX_CHANGELOG_URL}`);
|
|
24663
24834
|
return lines.join("\n");
|
|
24664
24835
|
}
|
|
24665
24836
|
var init_runtime_notes = __esm({
|
|
@@ -24701,7 +24872,7 @@ async function runRuntime(args, opts = {}) {
|
|
|
24701
24872
|
}
|
|
24702
24873
|
function printHelp() {
|
|
24703
24874
|
console.log(`
|
|
24704
|
-
rnx runtime \u2014 manage engine runtimes under ~/.
|
|
24875
|
+
rnx runtime \u2014 manage engine runtimes under ~/.rnx/runtimes/
|
|
24705
24876
|
|
|
24706
24877
|
usage:
|
|
24707
24878
|
rnx runtime install [version] install a version (default: channel latest)
|
|
@@ -24717,7 +24888,7 @@ flags:
|
|
|
24717
24888
|
--set-active=false do not switch active runtime after install
|
|
24718
24889
|
|
|
24719
24890
|
environment:
|
|
24720
|
-
|
|
24891
|
+
RNX_CDN_ORIGIN override the CDN base URL (default: ${DEFAULT_RUNTIME_CDN_ORIGIN})
|
|
24721
24892
|
|
|
24722
24893
|
examples:
|
|
24723
24894
|
rnx runtime install
|
|
@@ -24732,11 +24903,11 @@ async function runtimeInstall(args, opts) {
|
|
|
24732
24903
|
const channel = flags.channel ?? opts.channel ?? "stable";
|
|
24733
24904
|
const force = flags.force === true;
|
|
24734
24905
|
const setActive = flags.setActive !== false;
|
|
24735
|
-
|
|
24906
|
+
ensureRnxHome();
|
|
24736
24907
|
console.log(`rnx runtime install`);
|
|
24737
|
-
console.log(` cdn: ${
|
|
24908
|
+
console.log(` cdn: ${rnxRuntime.resolveCdnOrigin()}`);
|
|
24738
24909
|
try {
|
|
24739
|
-
const result = await
|
|
24910
|
+
const result = await rnxRuntime.install({
|
|
24740
24911
|
version: versionArg,
|
|
24741
24912
|
channel,
|
|
24742
24913
|
force,
|
|
@@ -24813,8 +24984,8 @@ async function tellDaemonRuntimeChanged(version) {
|
|
|
24813
24984
|
});
|
|
24814
24985
|
}
|
|
24815
24986
|
async function runtimeList(_args) {
|
|
24816
|
-
|
|
24817
|
-
const installed2 =
|
|
24987
|
+
ensureRnxHome();
|
|
24988
|
+
const installed2 = rnxRuntime.listInstalled();
|
|
24818
24989
|
const active = readActiveRuntime();
|
|
24819
24990
|
console.log(`installed:`);
|
|
24820
24991
|
if (installed2.length === 0) {
|
|
@@ -24826,7 +24997,7 @@ async function runtimeList(_args) {
|
|
|
24826
24997
|
}
|
|
24827
24998
|
}
|
|
24828
24999
|
try {
|
|
24829
|
-
const manifest = await
|
|
25000
|
+
const manifest = await rnxRuntime.fetchManifest();
|
|
24830
25001
|
console.log(`available (latest per channel):`);
|
|
24831
25002
|
for (const [name2, ch] of Object.entries(manifest.channels)) {
|
|
24832
25003
|
console.log(` ${name2.padEnd(8)} ${ch.latest}`);
|
|
@@ -24846,7 +25017,7 @@ async function runtimeUse(args) {
|
|
|
24846
25017
|
console.error(` usage: rnx runtime use <version>`);
|
|
24847
25018
|
rnxExit(1);
|
|
24848
25019
|
}
|
|
24849
|
-
const installed2 =
|
|
25020
|
+
const installed2 = rnxRuntime.listInstalled();
|
|
24850
25021
|
if (!installed2.includes(version)) {
|
|
24851
25022
|
console.error(` version ${version} is not installed`);
|
|
24852
25023
|
console.error(` installed: ${installed2.join(", ") || "(none)"}`);
|
|
@@ -24894,11 +25065,11 @@ async function runtimeNotes(args) {
|
|
|
24894
25065
|
console.error(` usage: rnx runtime notes`);
|
|
24895
25066
|
rnxExit(1);
|
|
24896
25067
|
}
|
|
24897
|
-
const { config } = await
|
|
25068
|
+
const { config } = await resolveRNXAppConfig();
|
|
24898
25069
|
const version = config?.runtimeVersion ?? readActiveRuntime();
|
|
24899
25070
|
if (!version) {
|
|
24900
25071
|
console.log(` no active runtime`);
|
|
24901
|
-
console.log(` release notes: ${
|
|
25072
|
+
console.log(` release notes: ${RNX_CHANGELOG_URL}`);
|
|
24902
25073
|
return;
|
|
24903
25074
|
}
|
|
24904
25075
|
console.log(formatRuntimeReleaseNotes(version, await fetchRuntimeReleaseNotes(version)));
|
|
@@ -25064,7 +25235,7 @@ function assertExplicitBridgeLock(preferredPort, explicitPort, lock) {
|
|
|
25064
25235
|
return;
|
|
25065
25236
|
}
|
|
25066
25237
|
throw new Error(
|
|
25067
|
-
`${rnxPublicBrand.commandName} open: requested bridge port ${preferredPort}, but the active daemon owns port ${lock.bridgePort}. explicit --port never selects another bridge; stop that daemon or use an isolated
|
|
25238
|
+
`${rnxPublicBrand.commandName} open: requested bridge port ${preferredPort}, but the active daemon owns port ${lock.bridgePort}. explicit --port never selects another bridge; stop that daemon or use an isolated RNX_HOME.`
|
|
25068
25239
|
);
|
|
25069
25240
|
}
|
|
25070
25241
|
async function ensureRuntimeForOpen() {
|
|
@@ -25278,7 +25449,7 @@ async function resolveOpenAppProject(resolvedBundle) {
|
|
|
25278
25449
|
async function ensureConfiguredRuntime(version) {
|
|
25279
25450
|
if (import_node_fs16.default.existsSync(import_node_path18.default.join(runtimeDir(version), "index.html"))) return;
|
|
25280
25451
|
console.error(` installing configured engine runtime ${version}...`);
|
|
25281
|
-
const result = await
|
|
25452
|
+
const result = await rnxRuntime.install({
|
|
25282
25453
|
version,
|
|
25283
25454
|
setActive: false,
|
|
25284
25455
|
protectVersions: readLiveRuntimeVersions()
|
|
@@ -25746,16 +25917,16 @@ function printOpenedSim(openUrl2, sim, mode, quiet = false) {
|
|
|
25746
25917
|
try {
|
|
25747
25918
|
const parsed = new URL(value);
|
|
25748
25919
|
let changed = false;
|
|
25749
|
-
if (parsed.searchParams.has(
|
|
25750
|
-
parsed.searchParams.set(
|
|
25920
|
+
if (parsed.searchParams.has(RNX_CONFIG_QUERY_PARAM)) {
|
|
25921
|
+
parsed.searchParams.set(RNX_CONFIG_QUERY_PARAM, "[redacted]");
|
|
25751
25922
|
changed = true;
|
|
25752
25923
|
}
|
|
25753
25924
|
const bundle = parsed.searchParams.get("bundle");
|
|
25754
25925
|
if (bundle) {
|
|
25755
25926
|
try {
|
|
25756
25927
|
const parsedBundle = new URL(bundle);
|
|
25757
|
-
if (parsedBundle.searchParams.has(
|
|
25758
|
-
parsedBundle.searchParams.set(
|
|
25928
|
+
if (parsedBundle.searchParams.has(RNX_CONFIG_QUERY_PARAM)) {
|
|
25929
|
+
parsedBundle.searchParams.set(RNX_CONFIG_QUERY_PARAM, "[redacted]");
|
|
25759
25930
|
parsed.searchParams.set("bundle", parsedBundle.toString());
|
|
25760
25931
|
changed = true;
|
|
25761
25932
|
}
|
|
@@ -25971,10 +26142,10 @@ async function runOpenCommand(args, opts = {}) {
|
|
|
25971
26142
|
}
|
|
25972
26143
|
const resolvedBundle = shouldResolveBundleTargetInCli(target) ? await resolveConnectionInputForCli(target) : void 0;
|
|
25973
26144
|
const project = await resolveOpenAppProject(resolvedBundle);
|
|
25974
|
-
const appConfig = await
|
|
26145
|
+
const appConfig = await loadRNXAppConfig(project);
|
|
25975
26146
|
const configuredRuntimeVersion = appConfig?.runtimeVersion;
|
|
25976
|
-
const runtimeConfig =
|
|
25977
|
-
|
|
26147
|
+
const runtimeConfig = mergeRNXConfig(
|
|
26148
|
+
mergeRNXConfig(
|
|
25978
26149
|
appConfig ? { ...appConfig, runtimeVersion: void 0 } : void 0,
|
|
25979
26150
|
opts.runtimeConfig
|
|
25980
26151
|
),
|
|
@@ -26063,7 +26234,7 @@ async function runOpenCommand(args, opts = {}) {
|
|
|
26063
26234
|
if (!targetSim && parsed.simIdSource !== "flag") {
|
|
26064
26235
|
targetShellUrl = await buildShellUrl(
|
|
26065
26236
|
target,
|
|
26066
|
-
|
|
26237
|
+
applyRNXConfigToUrl(baseUrl, runtimeConfig),
|
|
26067
26238
|
buildShellUrlOpts
|
|
26068
26239
|
);
|
|
26069
26240
|
const normalizedTarget = new URL(targetShellUrl);
|
|
@@ -26092,7 +26263,7 @@ async function runOpenCommand(args, opts = {}) {
|
|
|
26092
26263
|
const resolvedBaseUrl = hasExplicitBaseUrl || looksLikeSootsimUrl(target) ? baseUrl : deriveCurrentSimBaseUrl(targetSim, baseUrl);
|
|
26093
26264
|
const shellUrl = targetShellUrl ?? await buildShellUrl(
|
|
26094
26265
|
target,
|
|
26095
|
-
|
|
26266
|
+
applyRNXConfigToUrl(resolvedBaseUrl, runtimeConfig),
|
|
26096
26267
|
buildShellUrlOpts
|
|
26097
26268
|
);
|
|
26098
26269
|
bridge.send({
|
|
@@ -26129,7 +26300,7 @@ async function runOpenCommand(args, opts = {}) {
|
|
|
26129
26300
|
const resolvedBaseUrl = hasExplicitBaseUrl || looksLikeSootsimUrl(target) ? baseUrl : deriveCurrentSimBaseUrl(targetSim, baseUrl);
|
|
26130
26301
|
const shellUrl = targetShellUrl ?? await buildShellUrl(
|
|
26131
26302
|
target,
|
|
26132
|
-
|
|
26303
|
+
applyRNXConfigToUrl(resolvedBaseUrl, runtimeConfig),
|
|
26133
26304
|
buildShellUrlOpts
|
|
26134
26305
|
);
|
|
26135
26306
|
printOpenedSim(shellUrl, { ...targetSim, url: shellUrl }, "current sim", quiet);
|
|
@@ -26140,7 +26311,7 @@ async function runOpenCommand(args, opts = {}) {
|
|
|
26140
26311
|
bridge.close();
|
|
26141
26312
|
}
|
|
26142
26313
|
}
|
|
26143
|
-
const configuredBaseUrl =
|
|
26314
|
+
const configuredBaseUrl = applyRNXConfigToUrl(baseUrl, runtimeConfig);
|
|
26144
26315
|
const token = `cli-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
26145
26316
|
const openUrl2 = await buildOpenUrl(target, configuredBaseUrl, token, buildShellUrlOpts);
|
|
26146
26317
|
const ownerPid = getStableOwnerPid();
|
|
@@ -26236,7 +26407,7 @@ async function runUseLikeCommand(args, opts = {}) {
|
|
|
26236
26407
|
` refused: ${target.id} is leased by ${target.lockedBy} (${secs}s)`
|
|
26237
26408
|
);
|
|
26238
26409
|
console.error(
|
|
26239
|
-
` \`
|
|
26410
|
+
` \`rnx use ${target.id} --force\` to take it, or \`rnx open --new\` for a fresh sim`
|
|
26240
26411
|
);
|
|
26241
26412
|
rnxExit(1);
|
|
26242
26413
|
}
|
|
@@ -27453,14 +27624,12 @@ function resolveGitHubActionsAuth() {
|
|
|
27453
27624
|
};
|
|
27454
27625
|
}
|
|
27455
27626
|
function isCliApiKeySecret(secret) {
|
|
27456
|
-
return secret.startsWith("sk_rnx_")
|
|
27627
|
+
return secret.startsWith("sk_rnx_");
|
|
27457
27628
|
}
|
|
27458
27629
|
function readApiKeyFromEnv() {
|
|
27459
|
-
|
|
27460
|
-
|
|
27461
|
-
|
|
27462
|
-
}
|
|
27463
|
-
return null;
|
|
27630
|
+
const envName = "RNX_API_KEY";
|
|
27631
|
+
const secret = process.env[envName]?.trim();
|
|
27632
|
+
return secret && isCliApiKeySecret(secret) ? { secret, envName } : null;
|
|
27464
27633
|
}
|
|
27465
27634
|
function resolveCliAuth() {
|
|
27466
27635
|
const envKey = readApiKeyFromEnv();
|
|
@@ -27504,7 +27673,7 @@ var init_run_registry = __esm({
|
|
|
27504
27673
|
// cli/commands/upload.ts
|
|
27505
27674
|
async function resolveDefaultUploadOrigin(explicitOrigin) {
|
|
27506
27675
|
if (explicitOrigin) return explicitOrigin;
|
|
27507
|
-
if (process.env.
|
|
27676
|
+
if (process.env.RNX_UPLOAD_ORIGIN) return process.env.RNX_UPLOAD_ORIGIN;
|
|
27508
27677
|
return REMOTE_DEFAULT_ORIGIN;
|
|
27509
27678
|
}
|
|
27510
27679
|
var import_compress, import_compress_node, import_presigned_upload, import_trace, REMOTE_DEFAULT_ORIGIN, REMOTE_DEFAULT_PUBLIC_PREVIEW_ORIGIN;
|
|
@@ -27523,8 +27692,8 @@ var init_upload = __esm({
|
|
|
27523
27692
|
init_run_registry();
|
|
27524
27693
|
init_run_rnx();
|
|
27525
27694
|
init_ws_bridge();
|
|
27526
|
-
REMOTE_DEFAULT_ORIGIN = process.env.
|
|
27527
|
-
REMOTE_DEFAULT_PUBLIC_PREVIEW_ORIGIN = process.env.
|
|
27695
|
+
REMOTE_DEFAULT_ORIGIN = process.env.RNX_UPLOAD_ORIGIN || "https://contrast.dev";
|
|
27696
|
+
REMOTE_DEFAULT_PUBLIC_PREVIEW_ORIGIN = process.env.RNX_PREVIEW_ORIGIN || rnxPublicBrand.origin;
|
|
27528
27697
|
}
|
|
27529
27698
|
});
|
|
27530
27699
|
|
|
@@ -27942,7 +28111,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
27942
28111
|
const extension = videoMime.includes("mp4") ? "mp4" : "webm";
|
|
27943
28112
|
const outputPath = path18.join(
|
|
27944
28113
|
this.opts.recordingOutputDir,
|
|
27945
|
-
`
|
|
28114
|
+
`rnx-${Date.now()}.${extension}`
|
|
27946
28115
|
);
|
|
27947
28116
|
fs18.writeFileSync(outputPath, Buffer.concat(chunks));
|
|
27948
28117
|
return outputPath;
|
|
@@ -29988,9 +30157,9 @@ var skillRegistry = {
|
|
|
29988
30157
|
this.register(skill7);
|
|
29989
30158
|
}
|
|
29990
30159
|
},
|
|
29991
|
-
// load skills from a project manifest (
|
|
30160
|
+
// load skills from a project manifest (rnx-skills.json)
|
|
29992
30161
|
async loadFromManifest(projectDir) {
|
|
29993
|
-
const manifestPath = path19.join(projectDir, "
|
|
30162
|
+
const manifestPath = path19.join(projectDir, "rnx-skills.json");
|
|
29994
30163
|
if (!fs19.existsSync(manifestPath)) return;
|
|
29995
30164
|
try {
|
|
29996
30165
|
const manifest = JSON.parse(fs19.readFileSync(manifestPath, "utf8"));
|