rnxsim 0.1.375 → 0.1.376
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/cli/commands/control.ts +18 -4
- package/dist-cli/bin.js +5 -5
- package/dist-cli/chunks/{agent-JJN7U6FR.js → agent-H42FCKFF.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-AVVUJ3WF.js → agent-wrapper-BBZKTZS6.js} +2 -2
- package/dist-cli/chunks/{app-fonts-QJ22CNAZ.js → app-fonts-43VXIKF4.js} +2 -2
- package/dist-cli/chunks/{assert-PZZKIY3K.js → assert-IXOLVO5Z.js} +2 -2
- package/dist-cli/chunks/{auth-5AVDJO33.js → auth-KFMFB6FU.js} +2 -2
- package/dist-cli/chunks/{beta-PFRGP266.js → beta-5AO3SJB7.js} +2 -2
- package/dist-cli/chunks/{box-ILC2O7ZO.js → box-ZHM66L6K.js} +44 -44
- package/dist-cli/chunks/{camera-J3V62PP7.js → camera-FNJVFCDQ.js} +2 -2
- package/dist-cli/chunks/{chunk-CCMZSHJB.js → chunk-37MCSPTE.js} +1 -1
- package/dist-cli/chunks/{chunk-FUTYK55H.js → chunk-3PEMSUAQ.js} +3 -3
- package/dist-cli/chunks/chunk-4TQ5HOK3.js +7 -0
- package/dist-cli/chunks/{chunk-25KRGDZT.js → chunk-5YZYDEMI.js} +1 -1
- package/dist-cli/chunks/{chunk-OJNKRIZF.js → chunk-6CV3R3XD.js} +2 -2
- package/dist-cli/chunks/{chunk-5HHWECGT.js → chunk-7LGK5XU6.js} +2 -2
- package/dist-cli/chunks/{chunk-K7QQWKGE.js → chunk-7R2TK2NY.js} +1 -1
- package/dist-cli/chunks/{chunk-EZXV6U2N.js → chunk-7VZZQQEE.js} +3 -3
- package/dist-cli/chunks/{chunk-XUBV77WH.js → chunk-AFOVILIL.js} +1 -1
- package/dist-cli/chunks/{chunk-S65CK3RI.js → chunk-BEU7CD7E.js} +1 -1
- package/dist-cli/chunks/{chunk-F5F7FIPM.js → chunk-CE4JQJ6Y.js} +2 -2
- package/dist-cli/chunks/{chunk-RLCQLMFF.js → chunk-CIE6CZXL.js} +2 -2
- package/dist-cli/chunks/{chunk-5PZVYF42.js → chunk-CSJ7L7ZL.js} +1 -1
- package/dist-cli/chunks/{chunk-7NCPUZ52.js → chunk-CWCQP53A.js} +2 -2
- package/dist-cli/chunks/{chunk-Z6LOIW46.js → chunk-DCS5FK5N.js} +1 -1
- package/dist-cli/chunks/{chunk-MXJ2UWRV.js → chunk-DEV3E3MV.js} +1 -1
- package/dist-cli/chunks/{chunk-H4MYYOYJ.js → chunk-DGJMIVZM.js} +2 -2
- package/dist-cli/chunks/{chunk-GEX7RVHY.js → chunk-DGX3MN65.js} +1 -1
- package/dist-cli/chunks/{chunk-FZDRA7Z4.js → chunk-DNPQMTW5.js} +2 -2
- package/dist-cli/chunks/{chunk-TPPVAA7Z.js → chunk-DOVBJBVD.js} +2 -2
- package/dist-cli/chunks/{chunk-FW6AN7I2.js → chunk-DPBJ3S3J.js} +1 -1
- package/dist-cli/chunks/{chunk-PBOWUNXO.js → chunk-FVZBGPCU.js} +2 -2
- package/dist-cli/chunks/{chunk-PNRJFHX4.js → chunk-GDKMOIUT.js} +1 -1
- package/dist-cli/chunks/{chunk-4IKE4YUS.js → chunk-GIF2NJCS.js} +2 -2
- package/dist-cli/chunks/{chunk-MP2GPO4T.js → chunk-GZE57ORL.js} +1 -1
- package/dist-cli/chunks/{chunk-LD7I266X.js → chunk-H3U56DKI.js} +2 -2
- package/dist-cli/chunks/{chunk-JOHJZUGG.js → chunk-HZLOYAPH.js} +2 -2
- package/dist-cli/chunks/{chunk-DSD2UBZI.js → chunk-J2IKAEU2.js} +2 -2
- package/dist-cli/chunks/{chunk-HEV7BAPE.js → chunk-JXAXYK7W.js} +2 -2
- package/dist-cli/chunks/{chunk-XYSDYGKC.js → chunk-KJE2O2GK.js} +2 -2
- package/dist-cli/chunks/{chunk-V7RGRZOL.js → chunk-KMNVDZZI.js} +1 -1
- package/dist-cli/chunks/{chunk-4ALPWIMP.js → chunk-LC3QRIRB.js} +2 -2
- package/dist-cli/chunks/{chunk-SXBFGGAM.js → chunk-LGFTAQYC.js} +1 -1
- package/dist-cli/chunks/{chunk-4CEZZKRY.js → chunk-LQMUA5IY.js} +1 -1
- package/dist-cli/chunks/{chunk-LAOKTKT4.js → chunk-MFIQTWC5.js} +2 -2
- package/dist-cli/chunks/{chunk-2IUMRRYV.js → chunk-MGALNF2F.js} +2 -2
- package/dist-cli/chunks/{chunk-HNPHODBD.js → chunk-MLBZZHOY.js} +2 -2
- package/dist-cli/chunks/{chunk-7OSIJCBR.js → chunk-NNRF7GIB.js} +2 -2
- package/dist-cli/chunks/{chunk-5CGJFU27.js → chunk-NORLYTTO.js} +2 -2
- package/dist-cli/chunks/{chunk-CX7VCKAT.js → chunk-P6KVGV3H.js} +11 -11
- package/dist-cli/chunks/chunk-PAJTUK33.js +4 -0
- package/dist-cli/chunks/{chunk-C6B5FOP3.js → chunk-QELIC5XP.js} +1 -1
- package/dist-cli/chunks/{chunk-HWDVC6YA.js → chunk-QRDF33WD.js} +1 -1
- package/dist-cli/chunks/{chunk-LSOGXSDV.js → chunk-R76BA7C7.js} +3 -3
- package/dist-cli/chunks/{chunk-SWBUNMQS.js → chunk-RVEB4CZ2.js} +2 -2
- package/dist-cli/chunks/{chunk-BQCEI37V.js → chunk-SK4M7NXT.js} +1 -1
- package/dist-cli/chunks/{chunk-JWUDT4QK.js → chunk-SKMG5DD7.js} +2 -2
- package/dist-cli/chunks/{chunk-AQ5TMOAI.js → chunk-TEESPOYR.js} +1 -1
- package/dist-cli/chunks/{chunk-T4ISWS5H.js → chunk-TH2UFGVP.js} +1 -1
- package/dist-cli/chunks/{chunk-4ZXR2M3D.js → chunk-TLP3T3VO.js} +1 -1
- package/dist-cli/chunks/{chunk-2BRBFLWA.js → chunk-TZUABDIJ.js} +2 -2
- package/dist-cli/chunks/{chunk-Z5O5H4O7.js → chunk-UB2W6OQM.js} +2 -2
- package/dist-cli/chunks/{chunk-HNDWYCND.js → chunk-UYVXALPB.js} +2 -2
- package/dist-cli/chunks/{chunk-ZXFVBYJY.js → chunk-VQDYFFIG.js} +2 -2
- package/dist-cli/chunks/{chunk-YNHRSDVG.js → chunk-VWCNJPCJ.js} +2 -2
- package/dist-cli/chunks/{chunk-2GXNAZHB.js → chunk-VZIK4WIS.js} +2 -2
- package/dist-cli/chunks/{chunk-LMHBU5LZ.js → chunk-W3FNXAQP.js} +1 -1
- package/dist-cli/chunks/{chunk-GDLE4NIV.js → chunk-XCDNVNP3.js} +1 -1
- package/dist-cli/chunks/{chunk-4EUKOIAV.js → chunk-XSVILA4Z.js} +2 -2
- package/dist-cli/chunks/{chunk-USM3P74H.js → chunk-XUTJ7ZWD.js} +2 -2
- package/dist-cli/chunks/{chunk-YX52RJKO.js → chunk-YTXY3MHW.js} +2 -2
- package/dist-cli/chunks/{chunk-QJQOK34O.js → chunk-ZF7PVX44.js} +2 -2
- package/dist-cli/chunks/{chunk-DQUPSAHE.js → chunk-ZSSG7OR7.js} +1 -1
- package/dist-cli/chunks/{cleanup-KPUW4SFK.js → cleanup-MLOK2OZA.js} +2 -2
- package/dist-cli/chunks/cli-version-OBNR366V.js +4 -0
- package/dist-cli/chunks/{compat-XXRFD2TW.js → compat-SHMFSKU7.js} +2 -2
- package/dist-cli/chunks/{config-DDMFDQ7F.js → config-TPEAEUJ2.js} +2 -2
- package/dist-cli/chunks/{connect-IPG47YXM.js → connect-3LEXWTE5.js} +2 -2
- package/dist-cli/chunks/control-Z3FWA6BO.js +4 -0
- package/dist-cli/chunks/daemon-RSVYSC65.js +4 -0
- package/dist-cli/chunks/{debug-MYIP46TM.js → debug-GUVAK2KR.js} +3 -3
- package/dist-cli/chunks/{desktop-ENFFBQAA.js → desktop-OOP2PTKP.js} +3 -3
- package/dist-cli/chunks/{detox-J5WVK6OH.js → detox-C2ILVBEC.js} +2 -2
- package/dist-cli/chunks/{device-RAVQVL75.js → device-NXIQQJWR.js} +2 -2
- package/dist-cli/chunks/{diagnose-PJMPXKJY.js → diagnose-2JBGYE5L.js} +2 -2
- package/dist-cli/chunks/{disk-cleanup-YLAY445J.js → disk-cleanup-VURWJYQV.js} +2 -2
- package/dist-cli/chunks/{do-chain-UBE7GIOU.js → do-chain-DJ4UQC7A.js} +2 -2
- package/dist-cli/chunks/drivers-JMA2OIKU.js +4 -0
- package/dist-cli/chunks/{env-Y5XJSNRD.js → env-KTNPKEZR.js} +2 -2
- package/dist-cli/chunks/{film-W3V6VURB.js → film-DCPS7EID.js} +3 -3
- package/dist-cli/chunks/flow-4DZ7B2OA.js +4 -0
- package/dist-cli/chunks/help-34CJMQY2.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-S5DJ7EDF.js → hidden-runtime-alias-HHT2C7WE.js} +2 -2
- package/dist-cli/chunks/{home-paths-5O4IZPYV.js → home-paths-KTPGCPMS.js} +2 -2
- package/dist-cli/chunks/inspect-JF5WYJRD.js +4 -0
- package/dist-cli/chunks/install-desktop-ZIC4CDXI.js +4 -0
- package/dist-cli/chunks/{login-V6TZ54ZH.js → login-TTJAOI2Q.js} +2 -2
- package/dist-cli/chunks/{logout-SPMLFWYA.js → logout-ERAQ6SKW.js} +2 -2
- package/dist-cli/chunks/{maestro-5ISTBAZE.js → maestro-W46QCF77.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-WUI64NHR.js → maestro-generate-VBLM3MTU.js} +3 -3
- package/dist-cli/chunks/{mode-QPNBYXUF.js → mode-ZEDZK7R7.js} +2 -2
- package/dist-cli/chunks/{optional-demo-registry-CBSYF4CG.js → optional-demo-registry-ZUTPSVYQ.js} +2 -2
- package/dist-cli/chunks/{perf-T6N5PVYV.js → perf-YVT2WXT4.js} +2 -2
- package/dist-cli/chunks/{permissions-YZ7RRSZJ.js → permissions-L7VVDHFP.js} +2 -2
- package/dist-cli/chunks/{platform-XDQAA72X.js → platform-7TJOU2FB.js} +3 -3
- package/dist-cli/chunks/privacy-57UOTB5J.js +4 -0
- package/dist-cli/chunks/{record-QGYXRUKP.js → record-VXG37P7U.js} +3 -3
- package/dist-cli/chunks/{report-issue-VUUTGX7V.js → report-issue-WNNOBZHC.js} +2 -2
- package/dist-cli/chunks/reset-H5NBFE5U.js +4 -0
- package/dist-cli/chunks/resolve-target-57TK5WLE.js +4 -0
- package/dist-cli/chunks/runtime-QU2NIF2K.js +4 -0
- package/dist-cli/chunks/{screenshot-command-NZCMSJ4P.js → screenshot-command-AN56TTG7.js} +3 -3
- package/dist-cli/chunks/{screenshot-layers-VMTQ6XIU.js → screenshot-layers-3W5R7DB2.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-K3MWIDBK.js → screenshots-capture-6AWJY7XZ.js} +2 -2
- package/dist-cli/chunks/{serve-QJRIB2BV.js → serve-GLYO5Q7J.js} +2 -2
- package/dist-cli/chunks/setup-UA2HLD7S.js +4 -0
- package/dist-cli/chunks/{sim-client-5YUVL45C.js → sim-client-5C2RDQQO.js} +2 -2
- package/dist-cli/chunks/{skills-T3CS7CXK.js → skills-EYXWBRNQ.js} +2 -2
- package/dist-cli/chunks/{state-AJC3VK3G.js → state-REJ7W6K3.js} +2 -2
- package/dist-cli/chunks/{storage-KVGZKC3Y.js → storage-CFMDHI3V.js} +2 -2
- package/dist-cli/chunks/store-XMCUA45G.js +4 -0
- package/dist-cli/chunks/telemetry-FBL3NAKB.js +4 -0
- package/dist-cli/chunks/{timeline-DXDCAZUA.js → timeline-HMCHN5FO.js} +2 -2
- package/dist-cli/chunks/{upgrade-SRPTJACU.js → upgrade-2QSPAA3P.js} +2 -2
- package/dist-cli/chunks/upload-DUQBKZYV.js +4 -0
- package/dist-cli/chunks/{version-SOLPSBMG.js → version-IOA6QFGB.js} +2 -2
- package/dist-cli/chunks/{web-RT75LD7A.js → web-NCGUYVCJ.js} +2 -2
- package/dist-cli/chunks/welcome-QYGSQCWQ.js +5 -0
- package/dist-cli/chunks/{what-happened-CEIWJIWK.js → what-happened-YTOUK4LO.js} +2 -2
- package/dist-cli/chunks/{ws-bridge-YK5R3HOI.js → ws-bridge-OF4OZARG.js} +2 -2
- 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-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 +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +148 -134
- 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 +1 -1
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.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/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 +18 -4
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +217 -196
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/scripts/dev-server-scanner.ts +23 -5
- package/dist-cli/chunks/chunk-EWPAI4MO.js +0 -7
- package/dist-cli/chunks/chunk-V4EJJHF5.js +0 -4
- package/dist-cli/chunks/cli-version-APGT6GAT.js +0 -4
- package/dist-cli/chunks/control-O22Z3UJ5.js +0 -4
- package/dist-cli/chunks/daemon-PADUIMJV.js +0 -4
- package/dist-cli/chunks/drivers-ZFNX3T5Z.js +0 -4
- package/dist-cli/chunks/flow-VMLI7BYM.js +0 -4
- package/dist-cli/chunks/help-PKZCWHJJ.js +0 -4
- package/dist-cli/chunks/inspect-LT4MXK37.js +0 -4
- package/dist-cli/chunks/install-desktop-EXCFMXFS.js +0 -4
- package/dist-cli/chunks/privacy-54FIGXLT.js +0 -4
- package/dist-cli/chunks/reset-CGO52KBW.js +0 -4
- package/dist-cli/chunks/resolve-target-NNQCALDM.js +0 -4
- package/dist-cli/chunks/runtime-4EP6YJVL.js +0 -4
- package/dist-cli/chunks/setup-6XXEJQVF.js +0 -4
- package/dist-cli/chunks/store-AWUMOQUH.js +0 -4
- package/dist-cli/chunks/telemetry-W5ZDGWK6.js +0 -4
- package/dist-cli/chunks/upload-ZDV4BFED.js +0 -4
- package/dist-cli/chunks/welcome-IJ55EC7U.js +0 -5
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.376 | (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;
|
|
@@ -1688,14 +1688,6 @@ var init_unsupported_packages = __esm({
|
|
|
1688
1688
|
"react-native-in-app-purchase": {
|
|
1689
1689
|
note: "store billing runs entirely in StoreKit and Play Billing, which have no browser equivalent",
|
|
1690
1690
|
recovery: "Use react-native-purchases for a full sandbox catalog, or react-native-iap if you only need the connection lifecycle."
|
|
1691
|
-
},
|
|
1692
|
-
// not a package refusal at all — a routing framework refusal. expo-router
|
|
1693
|
-
// owns the entry point, the bundler config, the navigation tree and the app
|
|
1694
|
-
// shell, so it is not something a seam can back. a Contrast app is already
|
|
1695
|
-
// routed by One, which has the same file-based semantics.
|
|
1696
|
-
"expo-router": {
|
|
1697
|
-
note: "it is a whole routing framework that owns the app entry point, the bundler config and the navigation tree, so no native seam can back it",
|
|
1698
|
-
recovery: "Contrast apps route with One, which has the same file-based routing: put screens in app/, and use Link, Stack, Tabs and useRouter from one."
|
|
1699
1691
|
}
|
|
1700
1692
|
};
|
|
1701
1693
|
UNSUPPORTABLE = new Set(Object.keys(UNSUPPORTED_NATIVE_PACKAGES));
|
|
@@ -15211,9 +15203,22 @@ function makeResult(hostname, port, framework, owner) {
|
|
|
15211
15203
|
};
|
|
15212
15204
|
}
|
|
15213
15205
|
function withRuntimeConfig(port, bundleUrl, projectCwd) {
|
|
15214
|
-
|
|
15215
|
-
|
|
15216
|
-
|
|
15206
|
+
let physicalProjectCwd;
|
|
15207
|
+
if (projectCwd) {
|
|
15208
|
+
try {
|
|
15209
|
+
physicalProjectCwd = (0, import_node_fs2.realpathSync)((0, import_node_path3.resolve)(projectCwd));
|
|
15210
|
+
} catch {
|
|
15211
|
+
}
|
|
15212
|
+
}
|
|
15213
|
+
const knownApps = physicalProjectCwd ? optionalDemoAppsSync().filter((app) => {
|
|
15214
|
+
try {
|
|
15215
|
+
return (0, import_node_fs2.realpathSync)((0, import_node_path3.resolve)(app.dir)) === physicalProjectCwd;
|
|
15216
|
+
} catch {
|
|
15217
|
+
return false;
|
|
15218
|
+
}
|
|
15219
|
+
}) : [];
|
|
15220
|
+
const exactKnownApps = knownApps.filter((app) => app.preferredPort === port);
|
|
15221
|
+
const knownApp = exactKnownApps.length === 1 ? exactKnownApps[0] : exactKnownApps.length === 0 && knownApps.length === 1 ? knownApps[0] : void 0;
|
|
15217
15222
|
const configured = knownApp?.runtimeConfig ? applySootSimConfigToUrl(bundleUrl, knownApp.runtimeConfig) : bundleUrl;
|
|
15218
15223
|
return normalizeNativeDevBundleUrl(configured);
|
|
15219
15224
|
}
|
|
@@ -15533,7 +15538,7 @@ async function scanDevServers(opts = {}) {
|
|
|
15533
15538
|
}
|
|
15534
15539
|
return results.filter((r) => !isSootSimSelfServer(r));
|
|
15535
15540
|
}
|
|
15536
|
-
var import_child_process, import_promises2, import_http, import_net, import_node_path3, EXEC_EXIT_GRACE_MS, TIMEOUT_MS, MANIFEST_TIMEOUT_MS, TCP_GATE_MS, BODY_TIMEOUT_MS, FALLBACK_PORTS, SELF_PORT_RANGE_START, SELF_PORT_RANGE_END, DevServerScanUnavailableError, LISTING_TIMEOUT_MS, cwdByPid, ENRICH_TIMEOUT_MS, enrichmentCache, enrichmentInFlight, knownNonPatched, knownNonExpo, knownOne, portCache, NEGATIVE_CACHE_TTL_MS, WEAK_RESULT_CACHE_TTL_MS;
|
|
15541
|
+
var import_child_process, import_promises2, import_http, import_net, import_node_fs2, import_node_path3, EXEC_EXIT_GRACE_MS, TIMEOUT_MS, MANIFEST_TIMEOUT_MS, TCP_GATE_MS, BODY_TIMEOUT_MS, FALLBACK_PORTS, SELF_PORT_RANGE_START, SELF_PORT_RANGE_END, DevServerScanUnavailableError, LISTING_TIMEOUT_MS, cwdByPid, ENRICH_TIMEOUT_MS, enrichmentCache, enrichmentInFlight, knownNonPatched, knownNonExpo, knownOne, portCache, NEGATIVE_CACHE_TTL_MS, WEAK_RESULT_CACHE_TTL_MS;
|
|
15537
15542
|
var init_dev_server_scanner = __esm({
|
|
15538
15543
|
"scripts/dev-server-scanner.ts"() {
|
|
15539
15544
|
"use strict";
|
|
@@ -15541,6 +15546,7 @@ var init_dev_server_scanner = __esm({
|
|
|
15541
15546
|
import_promises2 = require("fs/promises");
|
|
15542
15547
|
import_http = __toESM(require("http"), 1);
|
|
15543
15548
|
import_net = __toESM(require("net"), 1);
|
|
15549
|
+
import_node_fs2 = require("node:fs");
|
|
15544
15550
|
import_node_path3 = require("node:path");
|
|
15545
15551
|
init_backend_origin();
|
|
15546
15552
|
init_config();
|
|
@@ -15610,7 +15616,7 @@ function getCliVersion() {
|
|
|
15610
15616
|
];
|
|
15611
15617
|
for (const resolve7 of candidates) {
|
|
15612
15618
|
try {
|
|
15613
|
-
const version = JSON.parse((0,
|
|
15619
|
+
const version = JSON.parse((0, import_node_fs3.readFileSync)(resolve7(), "utf8")).version;
|
|
15614
15620
|
if (typeof version === "string" && version) {
|
|
15615
15621
|
cached2 = version;
|
|
15616
15622
|
return cached2;
|
|
@@ -15621,11 +15627,11 @@ function getCliVersion() {
|
|
|
15621
15627
|
cached2 = "0.0.0";
|
|
15622
15628
|
return cached2;
|
|
15623
15629
|
}
|
|
15624
|
-
var
|
|
15630
|
+
var import_node_fs3, import_node_url2, import_meta, cached2;
|
|
15625
15631
|
var init_cli_version = __esm({
|
|
15626
15632
|
"src/cli-version.ts"() {
|
|
15627
15633
|
"use strict";
|
|
15628
|
-
|
|
15634
|
+
import_node_fs3 = require("node:fs");
|
|
15629
15635
|
import_node_url2 = require("node:url");
|
|
15630
15636
|
init_public_brand();
|
|
15631
15637
|
import_meta = {};
|
|
@@ -15701,7 +15707,7 @@ function isSootsimDevCheckout() {
|
|
|
15701
15707
|
const argv1 = process.argv[1];
|
|
15702
15708
|
if (!argv1) return false;
|
|
15703
15709
|
try {
|
|
15704
|
-
const real =
|
|
15710
|
+
const real = import_node_fs4.default.realpathSync(argv1);
|
|
15705
15711
|
return real.includes(`${import_node_path4.default.sep}packages${import_node_path4.default.sep}sootsim${import_node_path4.default.sep}`);
|
|
15706
15712
|
} catch {
|
|
15707
15713
|
return false;
|
|
@@ -15767,7 +15773,7 @@ function configFilePath() {
|
|
|
15767
15773
|
}
|
|
15768
15774
|
function readSharedConfig() {
|
|
15769
15775
|
try {
|
|
15770
|
-
const raw =
|
|
15776
|
+
const raw = import_node_fs4.default.readFileSync(configFilePath(), "utf8");
|
|
15771
15777
|
const parsed = JSON.parse(raw);
|
|
15772
15778
|
return parsed && typeof parsed === "object" ? parsed : {};
|
|
15773
15779
|
} catch {
|
|
@@ -15785,9 +15791,9 @@ function writeSharedConfig(patch) {
|
|
|
15785
15791
|
};
|
|
15786
15792
|
}
|
|
15787
15793
|
const tmp = `${configFilePath()}.tmp`;
|
|
15788
|
-
|
|
15794
|
+
import_node_fs4.default.writeFileSync(tmp, `${JSON.stringify(next, null, 2)}
|
|
15789
15795
|
`, "utf8");
|
|
15790
|
-
|
|
15796
|
+
import_node_fs4.default.renameSync(tmp, configFilePath());
|
|
15791
15797
|
return next;
|
|
15792
15798
|
}
|
|
15793
15799
|
function isOnboardingComplete() {
|
|
@@ -15834,14 +15840,14 @@ function runtimeUpgradeNoticePath() {
|
|
|
15834
15840
|
function writeRuntimeUpgradeNotice(notice) {
|
|
15835
15841
|
ensureSootsimHome();
|
|
15836
15842
|
const tmp = `${runtimeUpgradeNoticePath()}.tmp`;
|
|
15837
|
-
|
|
15843
|
+
import_node_fs4.default.writeFileSync(tmp, `${JSON.stringify(notice)}
|
|
15838
15844
|
`, "utf8");
|
|
15839
|
-
|
|
15845
|
+
import_node_fs4.default.renameSync(tmp, runtimeUpgradeNoticePath());
|
|
15840
15846
|
}
|
|
15841
15847
|
function consumeRuntimeUpgradeNotice() {
|
|
15842
15848
|
try {
|
|
15843
|
-
const raw =
|
|
15844
|
-
|
|
15849
|
+
const raw = import_node_fs4.default.readFileSync(runtimeUpgradeNoticePath(), "utf8");
|
|
15850
|
+
import_node_fs4.default.unlinkSync(runtimeUpgradeNoticePath());
|
|
15845
15851
|
const parsed = JSON.parse(raw);
|
|
15846
15852
|
if (typeof parsed?.to !== "string" || !parsed.to) return null;
|
|
15847
15853
|
return {
|
|
@@ -15854,23 +15860,23 @@ function consumeRuntimeUpgradeNotice() {
|
|
|
15854
15860
|
}
|
|
15855
15861
|
}
|
|
15856
15862
|
function ensureSootsimHome() {
|
|
15857
|
-
|
|
15858
|
-
|
|
15859
|
-
|
|
15860
|
-
|
|
15861
|
-
|
|
15863
|
+
import_node_fs4.default.mkdirSync(sootsimHomeDir(), { recursive: true });
|
|
15864
|
+
import_node_fs4.default.mkdirSync(runtimesDir(), { recursive: true });
|
|
15865
|
+
import_node_fs4.default.mkdirSync(electronDir(), { recursive: true });
|
|
15866
|
+
import_node_fs4.default.mkdirSync(profilesDir(), { recursive: true });
|
|
15867
|
+
import_node_fs4.default.mkdirSync(cacheDir(), { recursive: true });
|
|
15862
15868
|
}
|
|
15863
15869
|
function readActiveRuntime() {
|
|
15864
15870
|
try {
|
|
15865
|
-
const value =
|
|
15871
|
+
const value = import_node_fs4.default.readFileSync(activeRuntimeFile(), "utf8").trim();
|
|
15866
15872
|
return value.length > 0 ? value : null;
|
|
15867
15873
|
} catch {
|
|
15868
15874
|
return null;
|
|
15869
15875
|
}
|
|
15870
15876
|
}
|
|
15871
15877
|
function writeActiveRuntime(version) {
|
|
15872
|
-
|
|
15873
|
-
|
|
15878
|
+
import_node_fs4.default.mkdirSync(runtimesDir(), { recursive: true });
|
|
15879
|
+
import_node_fs4.default.writeFileSync(activeRuntimeFile(), `${version}
|
|
15874
15880
|
`, "utf8");
|
|
15875
15881
|
}
|
|
15876
15882
|
function activeRuntimeDir() {
|
|
@@ -15878,17 +15884,17 @@ function activeRuntimeDir() {
|
|
|
15878
15884
|
if (!version) return null;
|
|
15879
15885
|
const dir = runtimeDir(version);
|
|
15880
15886
|
try {
|
|
15881
|
-
if (
|
|
15887
|
+
if (import_node_fs4.default.statSync(dir).isDirectory()) return dir;
|
|
15882
15888
|
} catch {
|
|
15883
15889
|
}
|
|
15884
15890
|
return null;
|
|
15885
15891
|
}
|
|
15886
15892
|
function readDaemonLockfile() {
|
|
15887
15893
|
try {
|
|
15888
|
-
const fd =
|
|
15894
|
+
const fd = import_node_fs4.default.openSync(daemonLockfilePath(), "r");
|
|
15889
15895
|
try {
|
|
15890
15896
|
const buf = Buffer.alloc(DAEMON_LOCKFILE_MAX_BYTES);
|
|
15891
|
-
const bytesRead =
|
|
15897
|
+
const bytesRead = import_node_fs4.default.readSync(fd, buf, 0, DAEMON_LOCKFILE_MAX_BYTES, 0);
|
|
15892
15898
|
const raw = buf.subarray(0, bytesRead).toString("utf8");
|
|
15893
15899
|
const parsed = JSON.parse(raw);
|
|
15894
15900
|
if (parsed && parsed.schema === 1 && typeof parsed.pid === "number" && typeof parsed.bridgePort === "number" && typeof parsed.runtimePort === "number" && typeof parsed.startedAt === "number" && typeof parsed.heartbeatAt === "number" && (parsed.servedRuntimes === void 0 || Array.isArray(parsed.servedRuntimes) && parsed.servedRuntimes.every((version) => typeof version === "string"))) {
|
|
@@ -15896,7 +15902,7 @@ function readDaemonLockfile() {
|
|
|
15896
15902
|
}
|
|
15897
15903
|
return null;
|
|
15898
15904
|
} finally {
|
|
15899
|
-
|
|
15905
|
+
import_node_fs4.default.closeSync(fd);
|
|
15900
15906
|
}
|
|
15901
15907
|
} catch {
|
|
15902
15908
|
return null;
|
|
@@ -15916,7 +15922,7 @@ function parseDevBridgeLockfile(raw) {
|
|
|
15916
15922
|
function readDevBridgeLockfiles() {
|
|
15917
15923
|
let entries;
|
|
15918
15924
|
try {
|
|
15919
|
-
entries =
|
|
15925
|
+
entries = import_node_fs4.default.readdirSync(devBridgesDir(), { withFileTypes: true });
|
|
15920
15926
|
} catch {
|
|
15921
15927
|
return [];
|
|
15922
15928
|
}
|
|
@@ -15925,10 +15931,10 @@ function readDevBridgeLockfiles() {
|
|
|
15925
15931
|
if (!entry.isFile() || !/^\d+\.json$/.test(entry.name)) continue;
|
|
15926
15932
|
try {
|
|
15927
15933
|
const filePath = import_node_path4.default.join(devBridgesDir(), entry.name);
|
|
15928
|
-
const fd =
|
|
15934
|
+
const fd = import_node_fs4.default.openSync(filePath, "r");
|
|
15929
15935
|
try {
|
|
15930
15936
|
const buf = Buffer.alloc(DAEMON_LOCKFILE_MAX_BYTES);
|
|
15931
|
-
const bytesRead =
|
|
15937
|
+
const bytesRead = import_node_fs4.default.readSync(fd, buf, 0, DAEMON_LOCKFILE_MAX_BYTES, 0);
|
|
15932
15938
|
const lockfile = parseDevBridgeLockfile(
|
|
15933
15939
|
buf.subarray(0, bytesRead).toString("utf8")
|
|
15934
15940
|
);
|
|
@@ -15936,7 +15942,7 @@ function readDevBridgeLockfiles() {
|
|
|
15936
15942
|
lockfiles.push(lockfile);
|
|
15937
15943
|
}
|
|
15938
15944
|
} finally {
|
|
15939
|
-
|
|
15945
|
+
import_node_fs4.default.closeSync(fd);
|
|
15940
15946
|
}
|
|
15941
15947
|
} catch {
|
|
15942
15948
|
}
|
|
@@ -15988,28 +15994,28 @@ function writeDaemonLockfile(data) {
|
|
|
15988
15994
|
throw new Error("refusing to overwrite another rnx daemon lockfile");
|
|
15989
15995
|
}
|
|
15990
15996
|
const tmp = `${lockfilePath}.${data.pid}.${(0, import_node_crypto.randomUUID)()}.tmp`;
|
|
15991
|
-
|
|
15997
|
+
import_node_fs4.default.writeFileSync(tmp, `${JSON.stringify(data, null, 2)}
|
|
15992
15998
|
`, "utf8");
|
|
15993
15999
|
try {
|
|
15994
16000
|
const current = readDaemonLockfile();
|
|
15995
16001
|
if (!current || !sameDaemonOwner(current, data)) {
|
|
15996
16002
|
throw new Error("rnx daemon lock ownership changed during heartbeat");
|
|
15997
16003
|
}
|
|
15998
|
-
|
|
16004
|
+
import_node_fs4.default.renameSync(tmp, lockfilePath);
|
|
15999
16005
|
} finally {
|
|
16000
16006
|
try {
|
|
16001
|
-
|
|
16007
|
+
import_node_fs4.default.unlinkSync(tmp);
|
|
16002
16008
|
} catch {
|
|
16003
16009
|
}
|
|
16004
16010
|
}
|
|
16005
16011
|
}
|
|
16006
16012
|
function writeDevBridgeLockfile(data) {
|
|
16007
|
-
|
|
16013
|
+
import_node_fs4.default.mkdirSync(devBridgesDir(), { recursive: true });
|
|
16008
16014
|
const lockfilePath = devBridgeLockfilePath(data.bridgePort);
|
|
16009
16015
|
const tmp = `${lockfilePath}.${data.pid}.tmp`;
|
|
16010
|
-
|
|
16016
|
+
import_node_fs4.default.writeFileSync(tmp, `${JSON.stringify(data, null, 2)}
|
|
16011
16017
|
`, "utf8");
|
|
16012
|
-
|
|
16018
|
+
import_node_fs4.default.renameSync(tmp, lockfilePath);
|
|
16013
16019
|
}
|
|
16014
16020
|
function sameDaemonOwner(left, right) {
|
|
16015
16021
|
return left.pid === right.pid && left.startedAt === right.startedAt;
|
|
@@ -16020,17 +16026,17 @@ function isAlreadyExists(error) {
|
|
|
16020
16026
|
function createDaemonLockfileExclusive(data) {
|
|
16021
16027
|
const lockfilePath = daemonLockfilePath();
|
|
16022
16028
|
const tmp = `${lockfilePath}.${data.pid}.${(0, import_node_crypto.randomUUID)()}.claim`;
|
|
16023
|
-
|
|
16029
|
+
import_node_fs4.default.writeFileSync(tmp, `${JSON.stringify(data, null, 2)}
|
|
16024
16030
|
`, "utf8");
|
|
16025
16031
|
try {
|
|
16026
|
-
|
|
16032
|
+
import_node_fs4.default.linkSync(tmp, lockfilePath);
|
|
16027
16033
|
return true;
|
|
16028
16034
|
} catch (error) {
|
|
16029
16035
|
if (isAlreadyExists(error)) return false;
|
|
16030
16036
|
throw error;
|
|
16031
16037
|
} finally {
|
|
16032
16038
|
try {
|
|
16033
|
-
|
|
16039
|
+
import_node_fs4.default.unlinkSync(tmp);
|
|
16034
16040
|
} catch {
|
|
16035
16041
|
}
|
|
16036
16042
|
}
|
|
@@ -16054,7 +16060,7 @@ function parseDaemonClaim(raw) {
|
|
|
16054
16060
|
}
|
|
16055
16061
|
function readDaemonClaim() {
|
|
16056
16062
|
try {
|
|
16057
|
-
return parseDaemonClaim(
|
|
16063
|
+
return parseDaemonClaim(import_node_fs4.default.readFileSync(daemonClaimPath(), "utf8"));
|
|
16058
16064
|
} catch {
|
|
16059
16065
|
return null;
|
|
16060
16066
|
}
|
|
@@ -16078,7 +16084,7 @@ function acquireDaemonClaim(data) {
|
|
|
16078
16084
|
`;
|
|
16079
16085
|
for (let attempt = 0; attempt < 8; attempt++) {
|
|
16080
16086
|
try {
|
|
16081
|
-
|
|
16087
|
+
import_node_fs4.default.writeFileSync(daemonClaimPath(), serialized, { encoding: "utf8", flag: "wx" });
|
|
16082
16088
|
return true;
|
|
16083
16089
|
} catch (error) {
|
|
16084
16090
|
if (!isAlreadyExists(error)) throw error;
|
|
@@ -16088,11 +16094,11 @@ function acquireDaemonClaim(data) {
|
|
|
16088
16094
|
if (existing && isDaemonClaimFresh(existing)) return false;
|
|
16089
16095
|
let before;
|
|
16090
16096
|
try {
|
|
16091
|
-
before =
|
|
16097
|
+
before = import_node_fs4.default.readFileSync(daemonClaimPath(), "utf8");
|
|
16092
16098
|
const latest = parseDaemonClaim(before);
|
|
16093
16099
|
if (latest && isDaemonClaimFresh(latest)) return false;
|
|
16094
|
-
if (
|
|
16095
|
-
|
|
16100
|
+
if (import_node_fs4.default.readFileSync(daemonClaimPath(), "utf8") !== before) continue;
|
|
16101
|
+
import_node_fs4.default.unlinkSync(daemonClaimPath());
|
|
16096
16102
|
} catch {
|
|
16097
16103
|
}
|
|
16098
16104
|
}
|
|
@@ -16102,7 +16108,7 @@ function releaseDaemonClaim(owner) {
|
|
|
16102
16108
|
try {
|
|
16103
16109
|
const claim = readDaemonClaim();
|
|
16104
16110
|
if (!claim || !sameDaemonOwner(claim, owner)) return;
|
|
16105
|
-
|
|
16111
|
+
import_node_fs4.default.unlinkSync(daemonClaimPath());
|
|
16106
16112
|
} catch {
|
|
16107
16113
|
}
|
|
16108
16114
|
}
|
|
@@ -16121,7 +16127,7 @@ function claimDaemonLockfile(data) {
|
|
|
16121
16127
|
if (!latest || !sameDaemonOwner(latest, existing)) return false;
|
|
16122
16128
|
if (isDaemonLockfileFresh(latest)) return false;
|
|
16123
16129
|
try {
|
|
16124
|
-
|
|
16130
|
+
import_node_fs4.default.unlinkSync(daemonLockfilePath());
|
|
16125
16131
|
} catch {
|
|
16126
16132
|
return false;
|
|
16127
16133
|
}
|
|
@@ -16135,25 +16141,25 @@ function removeDaemonLockfile(owner) {
|
|
|
16135
16141
|
try {
|
|
16136
16142
|
const lockfile = readDaemonLockfile();
|
|
16137
16143
|
if (!lockfile || !sameDaemonOwner(lockfile, owner)) return;
|
|
16138
|
-
|
|
16144
|
+
import_node_fs4.default.unlinkSync(daemonLockfilePath());
|
|
16139
16145
|
} catch {
|
|
16140
16146
|
}
|
|
16141
16147
|
}
|
|
16142
16148
|
function removeDevBridgeLockfile(owner) {
|
|
16143
16149
|
try {
|
|
16144
16150
|
const lockfilePath = devBridgeLockfilePath(owner.bridgePort);
|
|
16145
|
-
const lockfile = parseDevBridgeLockfile(
|
|
16151
|
+
const lockfile = parseDevBridgeLockfile(import_node_fs4.default.readFileSync(lockfilePath, "utf8"));
|
|
16146
16152
|
if (lockfile?.pid !== owner.pid || lockfile.startedAt !== owner.startedAt) return;
|
|
16147
|
-
|
|
16153
|
+
import_node_fs4.default.unlinkSync(lockfilePath);
|
|
16148
16154
|
} catch {
|
|
16149
16155
|
}
|
|
16150
16156
|
}
|
|
16151
|
-
var import_node_crypto,
|
|
16157
|
+
var import_node_crypto, import_node_fs4, import_node_os, import_node_path4, SOOTSIM_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;
|
|
16152
16158
|
var init_home_paths = __esm({
|
|
16153
16159
|
"src/home-paths.ts"() {
|
|
16154
16160
|
"use strict";
|
|
16155
16161
|
import_node_crypto = require("node:crypto");
|
|
16156
|
-
|
|
16162
|
+
import_node_fs4 = __toESM(require("node:fs"), 1);
|
|
16157
16163
|
import_node_os = require("node:os");
|
|
16158
16164
|
import_node_path4 = __toESM(require("node:path"), 1);
|
|
16159
16165
|
SOOTSIM_HOME_ENV = "SOOTSIM_HOME";
|
|
@@ -16174,7 +16180,7 @@ function isValidRuntimeVersion(value) {
|
|
|
16174
16180
|
}
|
|
16175
16181
|
function listInstalledRuntimes(product) {
|
|
16176
16182
|
try {
|
|
16177
|
-
return
|
|
16183
|
+
return import_node_fs5.default.readdirSync(product.runtimesDir(), { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort(compareSemver);
|
|
16178
16184
|
} catch {
|
|
16179
16185
|
return [];
|
|
16180
16186
|
}
|
|
@@ -16203,11 +16209,11 @@ function compareSemver(a, b) {
|
|
|
16203
16209
|
if (!bp) return -1;
|
|
16204
16210
|
return ap < bp ? -1 : 1;
|
|
16205
16211
|
}
|
|
16206
|
-
var
|
|
16212
|
+
var import_node_fs5, import_node_path5;
|
|
16207
16213
|
var init_product = __esm({
|
|
16208
16214
|
"../contrast-runtime-delivery/src/product.ts"() {
|
|
16209
16215
|
"use strict";
|
|
16210
|
-
|
|
16216
|
+
import_node_fs5 = __toESM(require("node:fs"), 1);
|
|
16211
16217
|
import_node_path5 = __toESM(require("node:path"), 1);
|
|
16212
16218
|
}
|
|
16213
16219
|
});
|
|
@@ -16217,7 +16223,7 @@ function createRuntimeDelivery(product) {
|
|
|
16217
16223
|
function readConfig() {
|
|
16218
16224
|
try {
|
|
16219
16225
|
const parsed = JSON.parse(
|
|
16220
|
-
|
|
16226
|
+
import_node_fs6.default.readFileSync(product.configFile(), "utf8")
|
|
16221
16227
|
);
|
|
16222
16228
|
return parsed && typeof parsed === "object" ? parsed : {};
|
|
16223
16229
|
} catch {
|
|
@@ -16290,7 +16296,7 @@ function createRuntimeDelivery(product) {
|
|
|
16290
16296
|
const setActive = opts.setActive !== false;
|
|
16291
16297
|
const protectVersions = [version, ...opts.protectVersions ?? []];
|
|
16292
16298
|
pruneLocalRetention({ protectVersions });
|
|
16293
|
-
if (!opts.force &&
|
|
16299
|
+
if (!opts.force && import_node_fs6.default.existsSync(import_node_path6.default.join(destDir, product.installedMarker))) {
|
|
16294
16300
|
if (setActive) product.writeActiveRuntime(version);
|
|
16295
16301
|
pruneLocalRetention({ protectVersions });
|
|
16296
16302
|
return {
|
|
@@ -16304,7 +16310,7 @@ function createRuntimeDelivery(product) {
|
|
|
16304
16310
|
};
|
|
16305
16311
|
}
|
|
16306
16312
|
const tarUrl = entry.tarball || tarballUrl(version, cdnOrigin);
|
|
16307
|
-
const downloadDir =
|
|
16313
|
+
const downloadDir = import_node_fs6.default.mkdtempSync(
|
|
16308
16314
|
import_node_path6.default.join(import_node_os2.default.tmpdir(), `${product.id}-runtime-download-`)
|
|
16309
16315
|
);
|
|
16310
16316
|
const runtimeArchivePath = import_node_path6.default.join(
|
|
@@ -16315,7 +16321,7 @@ function createRuntimeDelivery(product) {
|
|
|
16315
16321
|
import_node_path6.default.dirname(destDir),
|
|
16316
16322
|
`.installing-${version}-${process.pid}`
|
|
16317
16323
|
);
|
|
16318
|
-
|
|
16324
|
+
import_node_fs6.default.rmSync(tmpDir, { recursive: true, force: true });
|
|
16319
16325
|
try {
|
|
16320
16326
|
process.stderr.write(`${product.id}: downloading runtime ${version}\u2026
|
|
16321
16327
|
`);
|
|
@@ -16328,20 +16334,20 @@ function createRuntimeDelivery(product) {
|
|
|
16328
16334
|
`sha256 mismatch for runtime ${version}: expected ${entry.sha256}, actual ${actualSha}`
|
|
16329
16335
|
);
|
|
16330
16336
|
}
|
|
16331
|
-
|
|
16337
|
+
import_node_fs6.default.mkdirSync(tmpDir, { recursive: true });
|
|
16332
16338
|
await extractTarball(runtimeArchivePath, tmpDir);
|
|
16333
|
-
if (!
|
|
16339
|
+
if (!import_node_fs6.default.existsSync(import_node_path6.default.join(tmpDir, product.installedMarker))) {
|
|
16334
16340
|
throw new Error(
|
|
16335
16341
|
`extracted tarball for runtime ${version} is missing ${product.installedMarker}`
|
|
16336
16342
|
);
|
|
16337
16343
|
}
|
|
16338
|
-
|
|
16339
|
-
|
|
16344
|
+
import_node_fs6.default.rmSync(destDir, { recursive: true, force: true });
|
|
16345
|
+
import_node_fs6.default.renameSync(tmpDir, destDir);
|
|
16340
16346
|
} catch (err) {
|
|
16341
|
-
|
|
16347
|
+
import_node_fs6.default.rmSync(tmpDir, { recursive: true, force: true });
|
|
16342
16348
|
throw err;
|
|
16343
16349
|
} finally {
|
|
16344
|
-
|
|
16350
|
+
import_node_fs6.default.rmSync(downloadDir, { recursive: true, force: true });
|
|
16345
16351
|
}
|
|
16346
16352
|
if (setActive) product.writeActiveRuntime(version);
|
|
16347
16353
|
pruneLocalRetention({ protectVersions });
|
|
@@ -16363,7 +16369,7 @@ function createRuntimeDelivery(product) {
|
|
|
16363
16369
|
const pin = resolvePin();
|
|
16364
16370
|
if (pin) {
|
|
16365
16371
|
const activeVersion2 = product.readActiveRuntime();
|
|
16366
|
-
const pinInstalled =
|
|
16372
|
+
const pinInstalled = import_node_fs6.default.existsSync(
|
|
16367
16373
|
import_node_path6.default.join(product.runtimeDir(pin), product.installedMarker)
|
|
16368
16374
|
);
|
|
16369
16375
|
if (activeVersion2 === pin && pinInstalled) {
|
|
@@ -16413,7 +16419,7 @@ function createRuntimeDelivery(product) {
|
|
|
16413
16419
|
}
|
|
16414
16420
|
const activeVersion = product.readActiveRuntime();
|
|
16415
16421
|
const activeDir = activeVersion ? product.runtimeDir(activeVersion) : null;
|
|
16416
|
-
const activeInstalled = activeDir ?
|
|
16422
|
+
const activeInstalled = activeDir ? import_node_fs6.default.existsSync(import_node_path6.default.join(activeDir, product.installedMarker)) : false;
|
|
16417
16423
|
const shouldInstall = !activeVersion || !activeInstalled || compareSemver(latestVersion, activeVersion) > 0;
|
|
16418
16424
|
if (!shouldInstall) {
|
|
16419
16425
|
return {
|
|
@@ -16488,7 +16494,7 @@ function createRuntimeDelivery(product) {
|
|
|
16488
16494
|
let removeCacheFiles = [];
|
|
16489
16495
|
if (markerOffset >= 0) {
|
|
16490
16496
|
try {
|
|
16491
|
-
removeCacheFiles =
|
|
16497
|
+
removeCacheFiles = import_node_fs6.default.readdirSync(product.cacheDir(), { withFileTypes: true }).filter((entry) => {
|
|
16492
16498
|
if (!entry.isFile()) return false;
|
|
16493
16499
|
const complete = entry.name.startsWith(cachePrefix) && entry.name.endsWith(cacheSuffix);
|
|
16494
16500
|
const partial = entry.name.startsWith(cachePrefix) && entry.name.endsWith(`${cacheSuffix}.partial`);
|
|
@@ -16508,10 +16514,10 @@ function createRuntimeDelivery(product) {
|
|
|
16508
16514
|
function pruneLocalRetention(opts = {}) {
|
|
16509
16515
|
const plan = planLocalRetention(opts);
|
|
16510
16516
|
for (const version of plan.removeVersions) {
|
|
16511
|
-
|
|
16517
|
+
import_node_fs6.default.rmSync(product.runtimeDir(version), { recursive: true, force: true });
|
|
16512
16518
|
}
|
|
16513
16519
|
for (const cacheFile of plan.removeCacheFiles) {
|
|
16514
|
-
|
|
16520
|
+
import_node_fs6.default.rmSync(cacheFile, { force: true });
|
|
16515
16521
|
}
|
|
16516
16522
|
return plan;
|
|
16517
16523
|
}
|
|
@@ -16537,17 +16543,17 @@ async function downloadToFile(url, destPath) {
|
|
|
16537
16543
|
if (!res.ok || !res.body) {
|
|
16538
16544
|
throw new Error(`download failed: ${res.status} ${res.statusText} (${url})`);
|
|
16539
16545
|
}
|
|
16540
|
-
|
|
16546
|
+
import_node_fs6.default.mkdirSync(import_node_path6.default.dirname(destPath), { recursive: true });
|
|
16541
16547
|
const tmp = `${destPath}.partial`;
|
|
16542
16548
|
try {
|
|
16543
16549
|
await (0, import_promises3.pipeline)(
|
|
16544
16550
|
import_node_stream.Readable.fromWeb(res.body),
|
|
16545
|
-
|
|
16551
|
+
import_node_fs6.default.createWriteStream(tmp)
|
|
16546
16552
|
);
|
|
16547
|
-
|
|
16553
|
+
import_node_fs6.default.renameSync(tmp, destPath);
|
|
16548
16554
|
} catch (err) {
|
|
16549
16555
|
try {
|
|
16550
|
-
|
|
16556
|
+
import_node_fs6.default.unlinkSync(tmp);
|
|
16551
16557
|
} catch {
|
|
16552
16558
|
}
|
|
16553
16559
|
throw err;
|
|
@@ -16556,7 +16562,7 @@ async function downloadToFile(url, destPath) {
|
|
|
16556
16562
|
function sha256File(filePath) {
|
|
16557
16563
|
return new Promise((resolve7, reject) => {
|
|
16558
16564
|
const hash = import_node_crypto2.default.createHash("sha256");
|
|
16559
|
-
const stream =
|
|
16565
|
+
const stream = import_node_fs6.default.createReadStream(filePath);
|
|
16560
16566
|
stream.on("data", (chunk) => hash.update(chunk));
|
|
16561
16567
|
stream.on("error", reject);
|
|
16562
16568
|
stream.on("end", () => resolve7(hash.digest("hex")));
|
|
@@ -16574,13 +16580,13 @@ function extractTarball(tarPath, destDir) {
|
|
|
16574
16580
|
});
|
|
16575
16581
|
});
|
|
16576
16582
|
}
|
|
16577
|
-
var import_node_child_process2, import_node_crypto2,
|
|
16583
|
+
var import_node_child_process2, import_node_crypto2, import_node_fs6, import_node_os2, import_node_path6, import_node_stream, import_promises3, DEFAULT_LOCAL_RUNTIME_RETENTION_COUNT;
|
|
16578
16584
|
var init_src = __esm({
|
|
16579
16585
|
"../contrast-runtime-delivery/src/index.ts"() {
|
|
16580
16586
|
"use strict";
|
|
16581
16587
|
import_node_child_process2 = require("node:child_process");
|
|
16582
16588
|
import_node_crypto2 = __toESM(require("node:crypto"), 1);
|
|
16583
|
-
|
|
16589
|
+
import_node_fs6 = __toESM(require("node:fs"), 1);
|
|
16584
16590
|
import_node_os2 = __toESM(require("node:os"), 1);
|
|
16585
16591
|
import_node_path6 = __toESM(require("node:path"), 1);
|
|
16586
16592
|
import_node_stream = require("node:stream");
|
|
@@ -16786,7 +16792,7 @@ function loadStore() {
|
|
|
16786
16792
|
const file = storeFile();
|
|
16787
16793
|
let raw;
|
|
16788
16794
|
try {
|
|
16789
|
-
raw =
|
|
16795
|
+
raw = import_node_fs7.default.readFileSync(file, "utf8");
|
|
16790
16796
|
} catch (err) {
|
|
16791
16797
|
if (err.code === "ENOENT") return cloneEmpty();
|
|
16792
16798
|
throw err;
|
|
@@ -16803,7 +16809,7 @@ function loadStore() {
|
|
|
16803
16809
|
} catch (err) {
|
|
16804
16810
|
const quarantine = `${file}.corrupt-${Date.now()}`;
|
|
16805
16811
|
try {
|
|
16806
|
-
|
|
16812
|
+
import_node_fs7.default.renameSync(file, quarantine);
|
|
16807
16813
|
console.warn(
|
|
16808
16814
|
`[sootsim] attached-projects.json was unparseable; quarantined to ${quarantine}. original error: ${err.message}`
|
|
16809
16815
|
);
|
|
@@ -16814,16 +16820,16 @@ function loadStore() {
|
|
|
16814
16820
|
}
|
|
16815
16821
|
function writeStore(store) {
|
|
16816
16822
|
const file = storeFile();
|
|
16817
|
-
|
|
16823
|
+
import_node_fs7.default.mkdirSync(import_node_path7.default.dirname(file), { recursive: true });
|
|
16818
16824
|
const tmp = `${file}.tmp-${process.pid}-${Date.now()}`;
|
|
16819
|
-
const fd =
|
|
16825
|
+
const fd = import_node_fs7.default.openSync(tmp, "w", 384);
|
|
16820
16826
|
try {
|
|
16821
|
-
|
|
16822
|
-
|
|
16827
|
+
import_node_fs7.default.writeFileSync(fd, JSON.stringify(store, null, 2));
|
|
16828
|
+
import_node_fs7.default.fsyncSync(fd);
|
|
16823
16829
|
} finally {
|
|
16824
|
-
|
|
16830
|
+
import_node_fs7.default.closeSync(fd);
|
|
16825
16831
|
}
|
|
16826
|
-
|
|
16832
|
+
import_node_fs7.default.renameSync(tmp, file);
|
|
16827
16833
|
}
|
|
16828
16834
|
function mutateStore(fn) {
|
|
16829
16835
|
const store = loadStore();
|
|
@@ -17009,7 +17015,7 @@ async function seedFromDemoAppRegistry() {
|
|
|
17009
17015
|
if (apps.length === 0) return;
|
|
17010
17016
|
mutateStore((store) => {
|
|
17011
17017
|
for (const app of apps) {
|
|
17012
|
-
if (!
|
|
17018
|
+
if (!import_node_fs7.default.existsSync(app.dir)) continue;
|
|
17013
17019
|
const cwd = import_node_path7.default.resolve(app.dir);
|
|
17014
17020
|
const id = projectIdForCwd(cwd);
|
|
17015
17021
|
if (store.attachedProjects.some((p) => p.id === id)) continue;
|
|
@@ -17031,12 +17037,12 @@ async function seedFromDemoAppRegistry() {
|
|
|
17031
17037
|
}
|
|
17032
17038
|
});
|
|
17033
17039
|
}
|
|
17034
|
-
var import_node_crypto3,
|
|
17040
|
+
var import_node_crypto3, import_node_fs7, import_node_path7, overrideDir, COST_HISTORY_MAX_AGE_MS;
|
|
17035
17041
|
var init_attached_projects = __esm({
|
|
17036
17042
|
"src/attached-projects.ts"() {
|
|
17037
17043
|
"use strict";
|
|
17038
17044
|
import_node_crypto3 = require("node:crypto");
|
|
17039
|
-
|
|
17045
|
+
import_node_fs7 = __toESM(require("node:fs"), 1);
|
|
17040
17046
|
import_node_path7 = __toESM(require("node:path"), 1);
|
|
17041
17047
|
init_home_paths();
|
|
17042
17048
|
overrideDir = null;
|
|
@@ -17065,7 +17071,7 @@ function pidIsAlive(pid, sessionId) {
|
|
|
17065
17071
|
return false;
|
|
17066
17072
|
}
|
|
17067
17073
|
if (sessionId) {
|
|
17068
|
-
if (!
|
|
17074
|
+
if (!import_node_fs8.default.existsSync(sessionDir(sessionId))) return false;
|
|
17069
17075
|
}
|
|
17070
17076
|
return true;
|
|
17071
17077
|
}
|
|
@@ -17081,7 +17087,7 @@ function resolveSootsimInvocation() {
|
|
|
17081
17087
|
import_node_path8.default.join(resourcesPath, "bin", `sootsim-${process.platform}-${process.arch}`)
|
|
17082
17088
|
];
|
|
17083
17089
|
for (const c of candidates) {
|
|
17084
|
-
if (
|
|
17090
|
+
if (import_node_fs8.default.existsSync(c)) return { cmd: c, prefixArgs: [] };
|
|
17085
17091
|
}
|
|
17086
17092
|
}
|
|
17087
17093
|
}
|
|
@@ -17105,14 +17111,14 @@ function tryWorkspaceSootsim() {
|
|
|
17105
17111
|
if (!sootsimDir) return null;
|
|
17106
17112
|
const binaryName = `sootsim-${process.platform}-${process.arch}`;
|
|
17107
17113
|
const distBinary = import_node_path8.default.join(sootsimDir, "dist-bin", binaryName);
|
|
17108
|
-
if (
|
|
17114
|
+
if (import_node_fs8.default.existsSync(distBinary)) return { cmd: distBinary, prefixArgs: [] };
|
|
17109
17115
|
const distBin = import_node_path8.default.join(sootsimDir, "dist-cli", "bin.js");
|
|
17110
|
-
if (
|
|
17116
|
+
if (import_node_fs8.default.existsSync(distBin)) {
|
|
17111
17117
|
try {
|
|
17112
17118
|
const src = import_node_path8.default.join(sootsimDir, "cli", "commands", "agent-wrapper.ts");
|
|
17113
|
-
if (
|
|
17114
|
-
const srcMtime =
|
|
17115
|
-
const buildMtime =
|
|
17119
|
+
if (import_node_fs8.default.existsSync(src)) {
|
|
17120
|
+
const srcMtime = import_node_fs8.default.statSync(src).mtimeMs;
|
|
17121
|
+
const buildMtime = import_node_fs8.default.statSync(distBin).mtimeMs;
|
|
17116
17122
|
if (buildMtime < srcMtime) {
|
|
17117
17123
|
console.warn(
|
|
17118
17124
|
`[rnx] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with \`bun run --cwd packages/sootsim build:cli\`.`
|
|
@@ -17140,8 +17146,8 @@ function resolveSootsimPackageDir() {
|
|
|
17140
17146
|
for (let i = 0; i < 8; i++) {
|
|
17141
17147
|
const pkg = import_node_path8.default.join(cur, "package.json");
|
|
17142
17148
|
try {
|
|
17143
|
-
if (
|
|
17144
|
-
const parsed = JSON.parse(
|
|
17149
|
+
if (import_node_fs8.default.existsSync(pkg)) {
|
|
17150
|
+
const parsed = JSON.parse(import_node_fs8.default.readFileSync(pkg, "utf8"));
|
|
17145
17151
|
if (parsed.name === rnxPublicBrand.packageName) return cur;
|
|
17146
17152
|
}
|
|
17147
17153
|
} catch {
|
|
@@ -17163,9 +17169,9 @@ function fileFromImportMeta() {
|
|
|
17163
17169
|
}
|
|
17164
17170
|
async function withStartLock(projectId, provider, fn) {
|
|
17165
17171
|
const lockDir = import_node_path8.default.join(getUserDataDir(), "locks");
|
|
17166
|
-
|
|
17172
|
+
import_node_fs8.default.mkdirSync(lockDir, { recursive: true });
|
|
17167
17173
|
try {
|
|
17168
|
-
|
|
17174
|
+
import_node_fs8.default.chmodSync(lockDir, 448);
|
|
17169
17175
|
} catch {
|
|
17170
17176
|
}
|
|
17171
17177
|
const lockPath = import_node_path8.default.join(lockDir, `start-${projectId}-${provider}.lock`);
|
|
@@ -17173,17 +17179,17 @@ async function withStartLock(projectId, provider, fn) {
|
|
|
17173
17179
|
let fd = null;
|
|
17174
17180
|
while (fd === null) {
|
|
17175
17181
|
try {
|
|
17176
|
-
fd =
|
|
17182
|
+
fd = import_node_fs8.default.openSync(
|
|
17177
17183
|
lockPath,
|
|
17178
|
-
|
|
17184
|
+
import_node_fs8.constants.O_WRONLY | import_node_fs8.constants.O_CREAT | import_node_fs8.constants.O_EXCL,
|
|
17179
17185
|
384
|
|
17180
17186
|
);
|
|
17181
17187
|
} catch (err) {
|
|
17182
17188
|
if (err.code !== "EEXIST") throw err;
|
|
17183
17189
|
try {
|
|
17184
|
-
const stale = Number(
|
|
17190
|
+
const stale = Number(import_node_fs8.default.readFileSync(lockPath, "utf8").trim());
|
|
17185
17191
|
if (stale && !isProcessAlive(stale)) {
|
|
17186
|
-
|
|
17192
|
+
import_node_fs8.default.unlinkSync(lockPath);
|
|
17187
17193
|
continue;
|
|
17188
17194
|
}
|
|
17189
17195
|
} catch {
|
|
@@ -17197,15 +17203,15 @@ async function withStartLock(projectId, provider, fn) {
|
|
|
17197
17203
|
}
|
|
17198
17204
|
}
|
|
17199
17205
|
try {
|
|
17200
|
-
|
|
17206
|
+
import_node_fs8.default.writeFileSync(fd, String(process.pid));
|
|
17201
17207
|
return await fn();
|
|
17202
17208
|
} finally {
|
|
17203
17209
|
try {
|
|
17204
|
-
|
|
17210
|
+
import_node_fs8.default.closeSync(fd);
|
|
17205
17211
|
} catch {
|
|
17206
17212
|
}
|
|
17207
17213
|
try {
|
|
17208
|
-
|
|
17214
|
+
import_node_fs8.default.unlinkSync(lockPath);
|
|
17209
17215
|
} catch {
|
|
17210
17216
|
}
|
|
17211
17217
|
}
|
|
@@ -17220,24 +17226,24 @@ function isProcessAlive(pid) {
|
|
|
17220
17226
|
}
|
|
17221
17227
|
function mkfifoSync(p) {
|
|
17222
17228
|
const parent = import_node_path8.default.dirname(p);
|
|
17223
|
-
|
|
17229
|
+
import_node_fs8.default.mkdirSync(parent, { recursive: true });
|
|
17224
17230
|
try {
|
|
17225
|
-
|
|
17231
|
+
import_node_fs8.default.chmodSync(parent, 448);
|
|
17226
17232
|
} catch {
|
|
17227
17233
|
}
|
|
17228
|
-
if (
|
|
17234
|
+
if (import_node_fs8.default.existsSync(p)) {
|
|
17229
17235
|
try {
|
|
17230
|
-
const stat2 =
|
|
17236
|
+
const stat2 = import_node_fs8.default.statSync(p);
|
|
17231
17237
|
if (stat2.isFIFO()) {
|
|
17232
17238
|
try {
|
|
17233
|
-
|
|
17239
|
+
import_node_fs8.default.chmodSync(p, 384);
|
|
17234
17240
|
} catch {
|
|
17235
17241
|
}
|
|
17236
17242
|
return;
|
|
17237
17243
|
}
|
|
17238
|
-
|
|
17244
|
+
import_node_fs8.default.unlinkSync(p);
|
|
17239
17245
|
} catch {
|
|
17240
|
-
|
|
17246
|
+
import_node_fs8.default.unlinkSync(p);
|
|
17241
17247
|
}
|
|
17242
17248
|
}
|
|
17243
17249
|
const result = (0, import_node_child_process3.spawnSync)("mkfifo", ["-m", "600", p]);
|
|
@@ -17278,9 +17284,9 @@ async function startSession(opts) {
|
|
|
17278
17284
|
mkfifoSync(promptIn);
|
|
17279
17285
|
mkfifoSync(eventsOut);
|
|
17280
17286
|
const transcriptDir = import_node_path8.default.dirname(transcript);
|
|
17281
|
-
|
|
17287
|
+
import_node_fs8.default.mkdirSync(transcriptDir, { recursive: true });
|
|
17282
17288
|
try {
|
|
17283
|
-
|
|
17289
|
+
import_node_fs8.default.chmodSync(transcriptDir, 448);
|
|
17284
17290
|
} catch {
|
|
17285
17291
|
}
|
|
17286
17292
|
const { cmd, prefixArgs } = resolveSootsimInvocation();
|
|
@@ -17331,7 +17337,7 @@ async function startSession(opts) {
|
|
|
17331
17337
|
}
|
|
17332
17338
|
}
|
|
17333
17339
|
try {
|
|
17334
|
-
|
|
17340
|
+
import_node_fs8.default.rmSync(sessionDir(session.id), { recursive: true, force: true });
|
|
17335
17341
|
} catch {
|
|
17336
17342
|
}
|
|
17337
17343
|
updateSessionStatus(session.id, { status: "ended" });
|
|
@@ -17359,18 +17365,18 @@ async function sendPrompt(sessionId, prompt) {
|
|
|
17359
17365
|
);
|
|
17360
17366
|
}
|
|
17361
17367
|
const fifo = promptFifoPath(sessionId);
|
|
17362
|
-
if (!
|
|
17368
|
+
if (!import_node_fs8.default.existsSync(fifo)) {
|
|
17363
17369
|
throw new AgentSessionError("NO_FIFO", `prompt FIFO missing: ${fifo}`);
|
|
17364
17370
|
}
|
|
17365
|
-
const fd =
|
|
17371
|
+
const fd = import_node_fs8.default.openSync(fifo, import_node_fs8.constants.O_WRONLY);
|
|
17366
17372
|
try {
|
|
17367
17373
|
const wireText = encodeAgentPromptEnvelope(prompt);
|
|
17368
17374
|
if (!wireText) {
|
|
17369
17375
|
throw new AgentSessionError("EMPTY_PROMPT", "prompt text is empty");
|
|
17370
17376
|
}
|
|
17371
|
-
|
|
17377
|
+
import_node_fs8.default.writeSync(fd, wireText + "\n");
|
|
17372
17378
|
} finally {
|
|
17373
|
-
|
|
17379
|
+
import_node_fs8.default.closeSync(fd);
|
|
17374
17380
|
}
|
|
17375
17381
|
updateSessionStatus(sessionId, {
|
|
17376
17382
|
lastPrompt: prompt.displayText ?? prompt.text,
|
|
@@ -17392,7 +17398,7 @@ async function endSession(sessionId) {
|
|
|
17392
17398
|
const base = getUserDataDir();
|
|
17393
17399
|
if (dir.startsWith(base)) {
|
|
17394
17400
|
try {
|
|
17395
|
-
|
|
17401
|
+
import_node_fs8.default.rmSync(dir, { recursive: true, force: true });
|
|
17396
17402
|
} catch {
|
|
17397
17403
|
}
|
|
17398
17404
|
}
|
|
@@ -17400,11 +17406,11 @@ async function endSession(sessionId) {
|
|
|
17400
17406
|
}
|
|
17401
17407
|
function subscribeEvents(sessionId, onEvent) {
|
|
17402
17408
|
const fifo = eventsFifoPath(sessionId);
|
|
17403
|
-
if (!
|
|
17409
|
+
if (!import_node_fs8.default.existsSync(fifo)) {
|
|
17404
17410
|
throw new AgentSessionError("NO_FIFO", `events FIFO missing: ${fifo}`);
|
|
17405
17411
|
}
|
|
17406
|
-
const fd =
|
|
17407
|
-
const stream =
|
|
17412
|
+
const fd = import_node_fs8.default.openSync(fifo, import_node_fs8.constants.O_RDWR);
|
|
17413
|
+
const stream = import_node_fs8.default.createReadStream("", { fd, autoClose: true });
|
|
17408
17414
|
const rl = import_node_readline.default.createInterface({ input: stream, crlfDelay: Infinity });
|
|
17409
17415
|
rl.on("line", (line) => {
|
|
17410
17416
|
const event = parseAgentEventLine(line);
|
|
@@ -17415,7 +17421,7 @@ function subscribeEvents(sessionId, onEvent) {
|
|
|
17415
17421
|
if (closed) return;
|
|
17416
17422
|
closed = true;
|
|
17417
17423
|
try {
|
|
17418
|
-
|
|
17424
|
+
import_node_fs8.default.writeSync(fd, "\n");
|
|
17419
17425
|
} catch {
|
|
17420
17426
|
}
|
|
17421
17427
|
try {
|
|
@@ -17429,7 +17435,7 @@ function subscribeEvents(sessionId, onEvent) {
|
|
|
17429
17435
|
};
|
|
17430
17436
|
}
|
|
17431
17437
|
async function waitForFirstEvent(fifo, predicate, timeoutMs) {
|
|
17432
|
-
const fd =
|
|
17438
|
+
const fd = import_node_fs8.default.openSync(fifo, import_node_fs8.constants.O_RDWR | import_node_fs8.constants.O_NONBLOCK);
|
|
17433
17439
|
const buf = Buffer.alloc(8192);
|
|
17434
17440
|
let leftover = "";
|
|
17435
17441
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -17437,7 +17443,7 @@ async function waitForFirstEvent(fifo, predicate, timeoutMs) {
|
|
|
17437
17443
|
while (Date.now() < deadline) {
|
|
17438
17444
|
let n = 0;
|
|
17439
17445
|
try {
|
|
17440
|
-
n =
|
|
17446
|
+
n = import_node_fs8.default.readSync(fd, buf, 0, buf.length, null);
|
|
17441
17447
|
} catch (err) {
|
|
17442
17448
|
if (err.code !== "EAGAIN") throw err;
|
|
17443
17449
|
n = 0;
|
|
@@ -17457,16 +17463,16 @@ async function waitForFirstEvent(fifo, predicate, timeoutMs) {
|
|
|
17457
17463
|
}
|
|
17458
17464
|
return null;
|
|
17459
17465
|
} finally {
|
|
17460
|
-
|
|
17466
|
+
import_node_fs8.default.closeSync(fd);
|
|
17461
17467
|
}
|
|
17462
17468
|
}
|
|
17463
|
-
var import_node_child_process3, import_node_crypto4,
|
|
17469
|
+
var import_node_child_process3, import_node_crypto4, import_node_fs8, import_node_path8, import_node_readline, AgentSessionError;
|
|
17464
17470
|
var init_agent_sessions = __esm({
|
|
17465
17471
|
"src/agent-sessions.ts"() {
|
|
17466
17472
|
"use strict";
|
|
17467
17473
|
import_node_child_process3 = require("node:child_process");
|
|
17468
17474
|
import_node_crypto4 = require("node:crypto");
|
|
17469
|
-
|
|
17475
|
+
import_node_fs8 = __toESM(require("node:fs"), 1);
|
|
17470
17476
|
import_node_path8 = __toESM(require("node:path"), 1);
|
|
17471
17477
|
import_node_readline = __toESM(require("node:readline"), 1);
|
|
17472
17478
|
init_agent_events();
|
|
@@ -17580,11 +17586,11 @@ function mapFrameworkToProjectFramework(fw) {
|
|
|
17580
17586
|
if (fw === "one" || fw === "vxrn") return "one";
|
|
17581
17587
|
return "unknown";
|
|
17582
17588
|
}
|
|
17583
|
-
var
|
|
17589
|
+
var import_node_fs9, import_node_path9, WS_OPEN, SESSION_STATUS_PERSIST_DELAY_MS, AgentHost;
|
|
17584
17590
|
var init_agent_host = __esm({
|
|
17585
17591
|
"src/host/agent-host.ts"() {
|
|
17586
17592
|
"use strict";
|
|
17587
|
-
|
|
17593
|
+
import_node_fs9 = __toESM(require("node:fs"), 1);
|
|
17588
17594
|
import_node_path9 = __toESM(require("node:path"), 1);
|
|
17589
17595
|
init_dev_server_scanner();
|
|
17590
17596
|
init_agent_sessions();
|
|
@@ -17795,10 +17801,10 @@ var init_agent_host = __esm({
|
|
|
17795
17801
|
}
|
|
17796
17802
|
getTranscript(sessionId) {
|
|
17797
17803
|
const p = transcriptPath(sessionId);
|
|
17798
|
-
if (!
|
|
17804
|
+
if (!import_node_fs9.default.existsSync(p)) {
|
|
17799
17805
|
return { error: "transcript not found", code: "NO_TRANSCRIPT" };
|
|
17800
17806
|
}
|
|
17801
|
-
return
|
|
17807
|
+
return import_node_fs9.default.readFileSync(p, "utf8");
|
|
17802
17808
|
}
|
|
17803
17809
|
getPaths() {
|
|
17804
17810
|
const dir = getUserDataDir();
|
|
@@ -18513,22 +18519,22 @@ function looksBinary(filePath, size) {
|
|
|
18513
18519
|
if (size === 0) return false;
|
|
18514
18520
|
let fd;
|
|
18515
18521
|
try {
|
|
18516
|
-
fd =
|
|
18522
|
+
fd = import_node_fs10.default.openSync(filePath, "r");
|
|
18517
18523
|
const buffer = Buffer.alloc(Math.min(BINARY_SNIFF_BYTES, size));
|
|
18518
|
-
const read =
|
|
18524
|
+
const read = import_node_fs10.default.readSync(fd, buffer, 0, buffer.length, 0);
|
|
18519
18525
|
return buffer.subarray(0, read).includes(0);
|
|
18520
18526
|
} catch {
|
|
18521
18527
|
return false;
|
|
18522
18528
|
} finally {
|
|
18523
|
-
if (fd !== void 0)
|
|
18529
|
+
if (fd !== void 0) import_node_fs10.default.closeSync(fd);
|
|
18524
18530
|
}
|
|
18525
18531
|
}
|
|
18526
|
-
var import_node_child_process5,
|
|
18532
|
+
var import_node_child_process5, import_node_fs10, import_node_path10, CheckoutRequiresGitError, BINARY_SNIFF_BYTES, LIST_FILES_TIMEOUT_MS, CheckoutFilePlane;
|
|
18527
18533
|
var init_checkout_plane = __esm({
|
|
18528
18534
|
"cli/commands/box/checkout-plane.ts"() {
|
|
18529
18535
|
"use strict";
|
|
18530
18536
|
import_node_child_process5 = require("node:child_process");
|
|
18531
|
-
|
|
18537
|
+
import_node_fs10 = __toESM(require("node:fs"), 1);
|
|
18532
18538
|
import_node_path10 = __toESM(require("node:path"), 1);
|
|
18533
18539
|
CheckoutRequiresGitError = class extends Error {
|
|
18534
18540
|
};
|
|
@@ -18581,7 +18587,7 @@ var init_checkout_plane = __esm({
|
|
|
18581
18587
|
if (!relative) continue;
|
|
18582
18588
|
let stat2;
|
|
18583
18589
|
try {
|
|
18584
|
-
stat2 =
|
|
18590
|
+
stat2 = import_node_fs10.default.statSync(import_node_path10.default.join(this.root, relative));
|
|
18585
18591
|
} catch {
|
|
18586
18592
|
continue;
|
|
18587
18593
|
}
|
|
@@ -18608,15 +18614,15 @@ var init_checkout_plane = __esm({
|
|
|
18608
18614
|
return resolved;
|
|
18609
18615
|
}
|
|
18610
18616
|
async read(planePath) {
|
|
18611
|
-
return
|
|
18617
|
+
return import_node_fs10.default.promises.readFile(this.absolute(planePath), "utf8");
|
|
18612
18618
|
}
|
|
18613
18619
|
async readBytes(planePath) {
|
|
18614
|
-
return
|
|
18620
|
+
return import_node_fs10.default.promises.readFile(this.absolute(planePath));
|
|
18615
18621
|
}
|
|
18616
18622
|
async write(planePath, content) {
|
|
18617
18623
|
const absolute = this.absolute(planePath);
|
|
18618
|
-
await
|
|
18619
|
-
await
|
|
18624
|
+
await import_node_fs10.default.promises.mkdir(import_node_path10.default.dirname(absolute), { recursive: true });
|
|
18625
|
+
await import_node_fs10.default.promises.writeFile(absolute, content);
|
|
18620
18626
|
this.entries.set(planePath, {
|
|
18621
18627
|
size: content.byteLength,
|
|
18622
18628
|
readOnly: false,
|
|
@@ -18625,7 +18631,7 @@ var init_checkout_plane = __esm({
|
|
|
18625
18631
|
});
|
|
18626
18632
|
}
|
|
18627
18633
|
async delete(planePath) {
|
|
18628
|
-
await
|
|
18634
|
+
await import_node_fs10.default.promises.rm(this.absolute(planePath), { force: true });
|
|
18629
18635
|
this.entries.delete(planePath);
|
|
18630
18636
|
}
|
|
18631
18637
|
};
|
|
@@ -18633,11 +18639,11 @@ var init_checkout_plane = __esm({
|
|
|
18633
18639
|
});
|
|
18634
18640
|
|
|
18635
18641
|
// src/host/plane-host.ts
|
|
18636
|
-
var
|
|
18642
|
+
var import_node_fs11, import_node_path11, import_plane, WS_OPEN2, PlaneNotRegisteredError, PlaneHost;
|
|
18637
18643
|
var init_plane_host = __esm({
|
|
18638
18644
|
"src/host/plane-host.ts"() {
|
|
18639
18645
|
"use strict";
|
|
18640
|
-
|
|
18646
|
+
import_node_fs11 = __toESM(require("node:fs"), 1);
|
|
18641
18647
|
import_node_path11 = __toESM(require("node:path"), 1);
|
|
18642
18648
|
import_plane = require("@contrast/harness/plane");
|
|
18643
18649
|
init_checkout_plane();
|
|
@@ -18764,11 +18770,11 @@ var init_plane_host = __esm({
|
|
|
18764
18770
|
const resolved = import_node_path11.default.resolve(root);
|
|
18765
18771
|
let real;
|
|
18766
18772
|
try {
|
|
18767
|
-
real =
|
|
18773
|
+
real = import_node_fs11.default.realpathSync(resolved);
|
|
18768
18774
|
} catch {
|
|
18769
18775
|
throw new Error(`no such directory: ${resolved}`);
|
|
18770
18776
|
}
|
|
18771
|
-
if (!
|
|
18777
|
+
if (!import_node_fs11.default.statSync(real).isDirectory()) throw new Error(`not a directory: ${real}`);
|
|
18772
18778
|
return real;
|
|
18773
18779
|
}
|
|
18774
18780
|
respond(ws, id, result) {
|
|
@@ -21561,7 +21567,7 @@ function liveDevBridgeLockfiles() {
|
|
|
21561
21567
|
function checkoutRoot(cwd) {
|
|
21562
21568
|
let current = import_node_path13.default.resolve(cwd);
|
|
21563
21569
|
while (true) {
|
|
21564
|
-
if (
|
|
21570
|
+
if (import_node_fs12.default.existsSync(import_node_path13.default.join(current, ".git"))) return current;
|
|
21565
21571
|
const parent = import_node_path13.default.dirname(current);
|
|
21566
21572
|
if (parent === current) return null;
|
|
21567
21573
|
current = parent;
|
|
@@ -21998,11 +22004,11 @@ async function callInBridge(bridge, path20, ...args) {
|
|
|
21998
22004
|
async function callInBridgeWrite(bridge, path20, ...args) {
|
|
21999
22005
|
return bridge.send({ type: "call", path: path20, args, acquireLock: true });
|
|
22000
22006
|
}
|
|
22001
|
-
var
|
|
22007
|
+
var import_node_fs12, import_node_path13, import_ws3, RNX_PLACEMENT_ENV, resolvedWorld, BridgeSimLockedError;
|
|
22002
22008
|
var init_ws_bridge = __esm({
|
|
22003
22009
|
"cli/ws-bridge.ts"() {
|
|
22004
22010
|
"use strict";
|
|
22005
|
-
|
|
22011
|
+
import_node_fs12 = __toESM(require("node:fs"), 1);
|
|
22006
22012
|
import_node_path13 = __toESM(require("node:path"), 1);
|
|
22007
22013
|
import_ws3 = require("ws");
|
|
22008
22014
|
init_bridge_constants();
|
|
@@ -22368,7 +22374,7 @@ function firstNamedFile(dir, names) {
|
|
|
22368
22374
|
for (const name2 of names) {
|
|
22369
22375
|
const candidate = import_node_path14.default.join(dir, name2);
|
|
22370
22376
|
try {
|
|
22371
|
-
if (
|
|
22377
|
+
if (import_node_fs13.default.statSync(candidate).isFile()) return candidate;
|
|
22372
22378
|
} catch {
|
|
22373
22379
|
}
|
|
22374
22380
|
}
|
|
@@ -22383,21 +22389,21 @@ function findSootSimAppConfig(dir) {
|
|
|
22383
22389
|
function resolveAppProject(projectRoot) {
|
|
22384
22390
|
const appDir = import_node_path14.default.resolve(projectRoot);
|
|
22385
22391
|
try {
|
|
22386
|
-
if (!
|
|
22392
|
+
if (!import_node_fs13.default.statSync(appDir).isDirectory()) return null;
|
|
22387
22393
|
} catch {
|
|
22388
22394
|
return null;
|
|
22389
22395
|
}
|
|
22390
22396
|
const configPath = findSootSimAppConfig(appDir);
|
|
22391
|
-
if (!configPath && !findExpoAppConfig(appDir) && !
|
|
22397
|
+
if (!configPath && !findExpoAppConfig(appDir) && !import_node_fs13.default.existsSync(import_node_path14.default.join(appDir, "package.json"))) {
|
|
22392
22398
|
return null;
|
|
22393
22399
|
}
|
|
22394
22400
|
return { appDir, configPath };
|
|
22395
22401
|
}
|
|
22396
|
-
var
|
|
22402
|
+
var import_node_fs13, import_node_path14, EXPO_APP_CONFIG_NAMES, SOOTSIM_APP_CONFIG_NAMES;
|
|
22397
22403
|
var init_app_project = __esm({
|
|
22398
22404
|
"cli/app-project.ts"() {
|
|
22399
22405
|
"use strict";
|
|
22400
|
-
|
|
22406
|
+
import_node_fs13 = __toESM(require("node:fs"), 1);
|
|
22401
22407
|
import_node_path14 = __toESM(require("node:path"), 1);
|
|
22402
22408
|
EXPO_APP_CONFIG_NAMES = [
|
|
22403
22409
|
"app.config.js",
|
|
@@ -22536,7 +22542,7 @@ function discoverNativeLinkedAppFonts(opts) {
|
|
|
22536
22542
|
scannedFontDirectories++;
|
|
22537
22543
|
let entries;
|
|
22538
22544
|
try {
|
|
22539
|
-
entries =
|
|
22545
|
+
entries = import_node_fs14.default.readdirSync(current.dir, { withFileTypes: true });
|
|
22540
22546
|
} catch {
|
|
22541
22547
|
continue;
|
|
22542
22548
|
}
|
|
@@ -22558,7 +22564,7 @@ function discoverNativeLinkedAppFonts(opts) {
|
|
|
22558
22564
|
};
|
|
22559
22565
|
try {
|
|
22560
22566
|
const packageJson = JSON.parse(
|
|
22561
|
-
|
|
22567
|
+
import_node_fs14.default.readFileSync(import_node_path16.default.join(selectedAppDir, "package.json"), "utf8")
|
|
22562
22568
|
);
|
|
22563
22569
|
const dependencyNames = /* @__PURE__ */ new Set();
|
|
22564
22570
|
for (const field of ["dependencies", "devDependencies", "optionalDependencies"]) {
|
|
@@ -22600,7 +22606,7 @@ function discoverNativeLinkedAppFonts(opts) {
|
|
|
22600
22606
|
}
|
|
22601
22607
|
try {
|
|
22602
22608
|
const configPath = import_node_path16.default.join(selectedAppDir, "react-native.config.js");
|
|
22603
|
-
if (
|
|
22609
|
+
if (import_node_fs14.default.statSync(configPath).isFile()) {
|
|
22604
22610
|
const appConfigRequire = (0, import_node_module2.createRequire)(import_node_path16.default.join(selectedAppDir, "package.json"));
|
|
22605
22611
|
const rnConfig = appConfigRequire(configPath);
|
|
22606
22612
|
const assets = rnConfig && typeof rnConfig === "object" ? Reflect.get(rnConfig, "assets") : null;
|
|
@@ -22619,7 +22625,7 @@ function discoverNativeLinkedAppFonts(opts) {
|
|
|
22619
22625
|
if (platform === "ios") {
|
|
22620
22626
|
const iosDir = import_node_path16.default.join(selectedAppDir, "ios");
|
|
22621
22627
|
try {
|
|
22622
|
-
const targetDirs =
|
|
22628
|
+
const targetDirs = import_node_fs14.default.readdirSync(iosDir, { withFileTypes: true }).filter(
|
|
22623
22629
|
(entry) => entry.isDirectory() && !entry.isSymbolicLink() && entry.name !== "Pods" && entry.name !== "build" && !entry.name.startsWith(".")
|
|
22624
22630
|
).slice(0, 64);
|
|
22625
22631
|
const plistPaths = [import_node_path16.default.join(iosDir, "Info.plist")];
|
|
@@ -22629,7 +22635,7 @@ function discoverNativeLinkedAppFonts(opts) {
|
|
|
22629
22635
|
for (const plistPath of plistPaths) {
|
|
22630
22636
|
let parsed;
|
|
22631
22637
|
try {
|
|
22632
|
-
parsed = parsePlistSource(
|
|
22638
|
+
parsed = parsePlistSource(import_node_fs14.default.readFileSync(plistPath, "utf8"));
|
|
22633
22639
|
} catch {
|
|
22634
22640
|
continue;
|
|
22635
22641
|
}
|
|
@@ -22646,7 +22652,7 @@ function discoverNativeLinkedAppFonts(opts) {
|
|
|
22646
22652
|
const relative = import_node_path16.default.relative(selectedAppDir, candidate);
|
|
22647
22653
|
if (relative.startsWith("..") || import_node_path16.default.isAbsolute(relative)) return false;
|
|
22648
22654
|
try {
|
|
22649
|
-
return
|
|
22655
|
+
return import_node_fs14.default.statSync(candidate).isFile();
|
|
22650
22656
|
} catch {
|
|
22651
22657
|
return false;
|
|
22652
22658
|
}
|
|
@@ -22692,11 +22698,11 @@ async function resolveMetroProjectRoot(bundleUrl, opts) {
|
|
|
22692
22698
|
function encodeAppFontsWire(specs) {
|
|
22693
22699
|
return specs.map((spec) => `${encodeURIComponent(spec.url)}::${encodeURIComponent(spec.family)}`).join(",");
|
|
22694
22700
|
}
|
|
22695
|
-
var
|
|
22701
|
+
var import_node_fs14, import_node_module2, import_node_path16, import_config_plugin_fonts, require3;
|
|
22696
22702
|
var init_app_fonts = __esm({
|
|
22697
22703
|
"cli/app-fonts.ts"() {
|
|
22698
22704
|
"use strict";
|
|
22699
|
-
|
|
22705
|
+
import_node_fs14 = __toESM(require("node:fs"), 1);
|
|
22700
22706
|
import_node_module2 = require("node:module");
|
|
22701
22707
|
import_node_path16 = __toESM(require("node:path"), 1);
|
|
22702
22708
|
import_config_plugin_fonts = require("sootsim-engine/engine/config-plugin-fonts");
|
|
@@ -23789,7 +23795,7 @@ function resolvePlaywright() {
|
|
|
23789
23795
|
try {
|
|
23790
23796
|
const modulePath = requireFromRoot.resolve(spec);
|
|
23791
23797
|
const packageJsonPath = requireFromRoot.resolve(`${spec}/package.json`);
|
|
23792
|
-
const parsed = JSON.parse((0,
|
|
23798
|
+
const parsed = JSON.parse((0, import_node_fs15.readFileSync)(packageJsonPath, "utf8"));
|
|
23793
23799
|
if (!isRecord3(parsed) || typeof parsed.version !== "string") continue;
|
|
23794
23800
|
const bin = parsed.bin;
|
|
23795
23801
|
let binPath = null;
|
|
@@ -23802,7 +23808,7 @@ function resolvePlaywright() {
|
|
|
23802
23808
|
}
|
|
23803
23809
|
if (!binPath) continue;
|
|
23804
23810
|
const cliPath = (0, import_node_path17.join)((0, import_node_path17.dirname)(packageJsonPath), binPath);
|
|
23805
|
-
if (!(0,
|
|
23811
|
+
if (!(0, import_node_fs15.existsSync)(cliPath)) continue;
|
|
23806
23812
|
return {
|
|
23807
23813
|
spec,
|
|
23808
23814
|
modulePath,
|
|
@@ -23841,7 +23847,7 @@ function probeBrowser(resolved, env) {
|
|
|
23841
23847
|
return {
|
|
23842
23848
|
ok: true,
|
|
23843
23849
|
executablePath: parsed.executablePath,
|
|
23844
|
-
exists: parsed.exists && (0,
|
|
23850
|
+
exists: parsed.exists && (0, import_node_fs15.existsSync)(parsed.executablePath)
|
|
23845
23851
|
};
|
|
23846
23852
|
} catch (error) {
|
|
23847
23853
|
return {
|
|
@@ -23880,12 +23886,12 @@ ${detail}` : ""}`
|
|
|
23880
23886
|
}
|
|
23881
23887
|
return { ok: true, executablePath: after.executablePath, installed: true };
|
|
23882
23888
|
}
|
|
23883
|
-
var import_node_child_process6,
|
|
23889
|
+
var import_node_child_process6, import_node_fs15, import_node_module4, import_node_path17, PLAYWRIGHT_BROWSER_PROBE;
|
|
23884
23890
|
var init_playwright_provisioning = __esm({
|
|
23885
23891
|
"cli/drivers/playwright-provisioning.ts"() {
|
|
23886
23892
|
"use strict";
|
|
23887
23893
|
import_node_child_process6 = require("node:child_process");
|
|
23888
|
-
|
|
23894
|
+
import_node_fs15 = require("node:fs");
|
|
23889
23895
|
import_node_module4 = require("node:module");
|
|
23890
23896
|
import_node_path17 = require("node:path");
|
|
23891
23897
|
PLAYWRIGHT_BROWSER_PROBE = `
|
|
@@ -24954,6 +24960,7 @@ __export(control_exports, {
|
|
|
24954
24960
|
planBulkCloseTargets: () => planBulkCloseTargets,
|
|
24955
24961
|
playwrightHostPidForSim: () => playwrightHostPidForSim,
|
|
24956
24962
|
printConnectedSims: () => printConnectedSims,
|
|
24963
|
+
printOpenedSim: () => printOpenedSim,
|
|
24957
24964
|
resolveBundleTarget: () => resolveBundleTarget,
|
|
24958
24965
|
resolveDefaultShellBaseUrl: () => resolveDefaultShellBaseUrl,
|
|
24959
24966
|
resolveDriverConnectWaitOptions: () => resolveDriverConnectWaitOptions,
|
|
@@ -25062,14 +25069,14 @@ function assertExplicitBridgeLock(preferredPort, explicitPort, lock) {
|
|
|
25062
25069
|
}
|
|
25063
25070
|
async function ensureRuntimeForOpen() {
|
|
25064
25071
|
const active = readActiveRuntime();
|
|
25065
|
-
if (active &&
|
|
25072
|
+
if (active && import_node_fs16.default.existsSync(runtimeDir(active))) return;
|
|
25066
25073
|
console.error(" installing rnx engine runtime...");
|
|
25067
25074
|
const { runRuntime: runRuntime2 } = await Promise.resolve().then(() => (init_runtime(), runtime_exports));
|
|
25068
25075
|
await runRuntime2(["install"], {});
|
|
25069
25076
|
}
|
|
25070
25077
|
function spawnSootsim(args) {
|
|
25071
25078
|
const entry = process.argv[1];
|
|
25072
|
-
if (entry &&
|
|
25079
|
+
if (entry && import_node_fs16.default.existsSync(entry)) {
|
|
25073
25080
|
return (0, import_node_child_process7.spawn)(process.execPath, [entry, ...args], {
|
|
25074
25081
|
detached: true,
|
|
25075
25082
|
stdio: "ignore",
|
|
@@ -25238,7 +25245,7 @@ function parseOpenRuntimeConfig(args) {
|
|
|
25238
25245
|
}
|
|
25239
25246
|
const moduleName = raw.slice(0, eqIndex).trim();
|
|
25240
25247
|
const filePath = normalizeReplacementPath(raw.slice(eqIndex + 1).trim());
|
|
25241
|
-
if (!
|
|
25248
|
+
if (!import_node_fs16.default.existsSync(filePath)) {
|
|
25242
25249
|
console.error(` rnx open: replacement file not found: ${filePath}`);
|
|
25243
25250
|
rnxExit(1);
|
|
25244
25251
|
}
|
|
@@ -25269,7 +25276,7 @@ async function resolveOpenAppProject(resolvedBundle) {
|
|
|
25269
25276
|
return advertisedRoot ? resolveAppProject(advertisedRoot) : null;
|
|
25270
25277
|
}
|
|
25271
25278
|
async function ensureConfiguredRuntime(version) {
|
|
25272
|
-
if (
|
|
25279
|
+
if (import_node_fs16.default.existsSync(import_node_path18.default.join(runtimeDir(version), "index.html"))) return;
|
|
25273
25280
|
console.error(` installing configured engine runtime ${version}...`);
|
|
25274
25281
|
const result = await sootsimRuntime.install({
|
|
25275
25282
|
version,
|
|
@@ -25629,7 +25636,7 @@ function playwrightHostPidForSim(sim) {
|
|
|
25629
25636
|
function signalDriverLaunchConnected(result) {
|
|
25630
25637
|
if (!result.connectAckFile) return false;
|
|
25631
25638
|
try {
|
|
25632
|
-
|
|
25639
|
+
import_node_fs16.default.writeFileSync(
|
|
25633
25640
|
result.connectAckFile,
|
|
25634
25641
|
`${JSON.stringify({ connectedAt: Date.now(), pid: result.pid ?? null })}
|
|
25635
25642
|
`,
|
|
@@ -25643,7 +25650,7 @@ function signalDriverLaunchConnected(result) {
|
|
|
25643
25650
|
function printDriverDiagnosticLogTail(result) {
|
|
25644
25651
|
if (!result.diagnosticLogPath) return;
|
|
25645
25652
|
try {
|
|
25646
|
-
const detail =
|
|
25653
|
+
const detail = import_node_fs16.default.readFileSync(result.diagnosticLogPath, "utf8").trim();
|
|
25647
25654
|
if (!detail) {
|
|
25648
25655
|
console.error(` ${import_node_path18.default.basename(result.diagnosticLogPath)} was empty`);
|
|
25649
25656
|
return;
|
|
@@ -25738,10 +25745,24 @@ function printOpenedSim(openUrl2, sim, mode, quiet = false) {
|
|
|
25738
25745
|
if (!value) return value;
|
|
25739
25746
|
try {
|
|
25740
25747
|
const parsed = new URL(value);
|
|
25741
|
-
|
|
25742
|
-
|
|
25743
|
-
|
|
25748
|
+
let changed = false;
|
|
25749
|
+
if (parsed.searchParams.has(SOOTSIM_CONFIG_QUERY_PARAM)) {
|
|
25750
|
+
parsed.searchParams.set(SOOTSIM_CONFIG_QUERY_PARAM, "[redacted]");
|
|
25751
|
+
changed = true;
|
|
25752
|
+
}
|
|
25753
|
+
const bundle = parsed.searchParams.get("bundle");
|
|
25754
|
+
if (bundle) {
|
|
25755
|
+
try {
|
|
25756
|
+
const parsedBundle = new URL(bundle);
|
|
25757
|
+
if (parsedBundle.searchParams.has(SOOTSIM_CONFIG_QUERY_PARAM)) {
|
|
25758
|
+
parsedBundle.searchParams.set(SOOTSIM_CONFIG_QUERY_PARAM, "[redacted]");
|
|
25759
|
+
parsed.searchParams.set("bundle", parsedBundle.toString());
|
|
25760
|
+
changed = true;
|
|
25761
|
+
}
|
|
25762
|
+
} catch {
|
|
25763
|
+
}
|
|
25744
25764
|
}
|
|
25765
|
+
if (changed) return parsed.toString();
|
|
25745
25766
|
} catch {
|
|
25746
25767
|
}
|
|
25747
25768
|
return value;
|
|
@@ -26452,12 +26473,12 @@ async function runCloseCommand(args, opts = {}) {
|
|
|
26452
26473
|
bridge.close();
|
|
26453
26474
|
}
|
|
26454
26475
|
}
|
|
26455
|
-
var import_node_child_process7,
|
|
26476
|
+
var import_node_child_process7, import_node_fs16, import_node_os3, import_node_path18, import_settings, import_ws5, DEFAULT_DRIVER_CONNECT_TIMEOUT_MS, DRIVER_CONNECT_INTERVAL_MS, DRIVER_CONNECT_HOST_GRACE_MS, OPEN_BRIDGE_SPAWN_TIMEOUT_MS, SHELL_APPS;
|
|
26456
26477
|
var init_control = __esm({
|
|
26457
26478
|
"cli/commands/control.ts"() {
|
|
26458
26479
|
"use strict";
|
|
26459
26480
|
import_node_child_process7 = require("node:child_process");
|
|
26460
|
-
|
|
26481
|
+
import_node_fs16 = __toESM(require("node:fs"), 1);
|
|
26461
26482
|
import_node_os3 = __toESM(require("node:os"), 1);
|
|
26462
26483
|
import_node_path18 = __toESM(require("node:path"), 1);
|
|
26463
26484
|
import_settings = require("sootsim-engine/settings");
|
|
@@ -27377,25 +27398,25 @@ function normalizeSession(input) {
|
|
|
27377
27398
|
}
|
|
27378
27399
|
function readSharedDesktopAuthSession() {
|
|
27379
27400
|
const filepath = getSharedDesktopAuthFilePath();
|
|
27380
|
-
if (!(0,
|
|
27401
|
+
if (!(0, import_node_fs17.existsSync)(filepath)) return null;
|
|
27381
27402
|
try {
|
|
27382
|
-
const parsed = JSON.parse((0,
|
|
27403
|
+
const parsed = JSON.parse((0, import_node_fs17.readFileSync)(filepath, "utf8"));
|
|
27383
27404
|
const normalized = normalizeSession(parsed);
|
|
27384
27405
|
if (!normalized) {
|
|
27385
|
-
(0,
|
|
27406
|
+
(0, import_node_fs17.rmSync)(filepath, { force: true });
|
|
27386
27407
|
return null;
|
|
27387
27408
|
}
|
|
27388
27409
|
return normalized;
|
|
27389
27410
|
} catch {
|
|
27390
|
-
(0,
|
|
27411
|
+
(0, import_node_fs17.rmSync)(filepath, { force: true });
|
|
27391
27412
|
return null;
|
|
27392
27413
|
}
|
|
27393
27414
|
}
|
|
27394
|
-
var
|
|
27415
|
+
var import_node_fs17, import_node_path19, SESSION_VERSION, SESSION_FILE_ENV, DEFAULT_ORIGIN;
|
|
27395
27416
|
var init_shared_session = __esm({
|
|
27396
27417
|
"src/auth/shared-session.ts"() {
|
|
27397
27418
|
"use strict";
|
|
27398
|
-
|
|
27419
|
+
import_node_fs17 = require("node:fs");
|
|
27399
27420
|
import_node_path19 = require("node:path");
|
|
27400
27421
|
init_home_paths();
|
|
27401
27422
|
SESSION_VERSION = 1;
|