rnxsim 0.0.0 → 0.1.312
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +512 -0
- package/detox/colors.ts +54 -0
- package/detox/config-loader.ts +135 -0
- package/detox/element-types.ts +39 -0
- package/detox/expectations.ts +537 -0
- package/detox/gestures.ts +480 -0
- package/detox/index.ts +2118 -0
- package/detox/jest-preset.cjs +51 -0
- package/detox/jest-setup-after-env.cjs +18 -0
- package/detox/matchers.ts +30 -0
- package/detox/motion-change.cjs +109 -0
- package/detox/motion-change.d.cts +35 -0
- package/detox/navigation.ts +43 -0
- package/detox/screenshots/animated-color-test-rest-norngh.png +0 -0
- package/detox/screenshots/color-test-after-drag-norngh.png +0 -0
- package/detox/screenshots/color-test-rest-norngh.png +0 -0
- package/detox/screenshots/theme-blue-toggle.png +0 -0
- package/detox/screenshots/theme-blue.png +0 -0
- package/detox/screenshots/theme-red-toggle.png +0 -0
- package/detox/screenshots/theme-red.png +0 -0
- package/dist-cli/bin.js +15 -0
- package/dist-cli/chunks/agent-NXVDDCFG.js +48 -0
- package/dist-cli/chunks/agent-wrapper-DXJCFKL3.js +17 -0
- package/dist-cli/chunks/app-fonts-W5AJZQJF.js +4 -0
- package/dist-cli/chunks/assert-3LOJEUDT.js +49 -0
- package/dist-cli/chunks/auth-MFTYYPNX.js +12 -0
- package/dist-cli/chunks/beta-GT3NN67B.js +4 -0
- package/dist-cli/chunks/camera-6EAK7CUL.js +22 -0
- package/dist-cli/chunks/chunk-274UD5FD.js +4 -0
- package/dist-cli/chunks/chunk-2SA2VTGP.js +5 -0
- package/dist-cli/chunks/chunk-33FKQH54.js +5 -0
- package/dist-cli/chunks/chunk-37I5AIS7.js +3 -0
- package/dist-cli/chunks/chunk-3D57IBPC.js +4 -0
- package/dist-cli/chunks/chunk-4BXCZHAU.js +4 -0
- package/dist-cli/chunks/chunk-5OX7ANRA.js +5 -0
- package/dist-cli/chunks/chunk-66NF2KNG.js +9 -0
- package/dist-cli/chunks/chunk-6UKJB2VC.js +125 -0
- package/dist-cli/chunks/chunk-7INBNA3U.js +26 -0
- package/dist-cli/chunks/chunk-7VWOSTD5.js +5 -0
- package/dist-cli/chunks/chunk-AY47WKS5.js +23 -0
- package/dist-cli/chunks/chunk-B7KMNHX7.js +4 -0
- package/dist-cli/chunks/chunk-BKNOLP3J.js +4 -0
- package/dist-cli/chunks/chunk-BRIZOR4K.js +28 -0
- package/dist-cli/chunks/chunk-DM6KUAOZ.js +4 -0
- package/dist-cli/chunks/chunk-EUAVBTKU.js +4 -0
- package/dist-cli/chunks/chunk-FTC4M26Q.js +4 -0
- package/dist-cli/chunks/chunk-FWYYCUAZ.js +4 -0
- package/dist-cli/chunks/chunk-G74YIEVS.js +7 -0
- package/dist-cli/chunks/chunk-GZDHEONW.js +507 -0
- package/dist-cli/chunks/chunk-HG7ORJMT.js +5 -0
- package/dist-cli/chunks/chunk-HMDOLCKG.js +15 -0
- package/dist-cli/chunks/chunk-JG6S4RSH.js +4 -0
- package/dist-cli/chunks/chunk-KR5BGMBZ.js +4 -0
- package/dist-cli/chunks/chunk-KZW5WBGU.js +983 -0
- package/dist-cli/chunks/chunk-L24Z3CRS.js +30 -0
- package/dist-cli/chunks/chunk-LDQ7HVCW.js +4 -0
- package/dist-cli/chunks/chunk-MENV7VLD.js +4 -0
- package/dist-cli/chunks/chunk-MNGQ42QE.js +568 -0
- package/dist-cli/chunks/chunk-N6A3SXMR.js +4 -0
- package/dist-cli/chunks/chunk-NLEMQ4PY.js +6 -0
- package/dist-cli/chunks/chunk-NPVGMH2N.js +101 -0
- package/dist-cli/chunks/chunk-OR3XTXEB.js +107 -0
- package/dist-cli/chunks/chunk-PEPUGJVI.js +4 -0
- package/dist-cli/chunks/chunk-Q3RGLERJ.js +142 -0
- package/dist-cli/chunks/chunk-SI3BUTQR.js +4 -0
- package/dist-cli/chunks/chunk-T4FT6CM7.js +4 -0
- package/dist-cli/chunks/chunk-TBMVBI26.js +7 -0
- package/dist-cli/chunks/chunk-TCWQJILS.js +5 -0
- package/dist-cli/chunks/chunk-TGQNQ6XT.js +766 -0
- package/dist-cli/chunks/chunk-TYE3WBSR.js +5 -0
- package/dist-cli/chunks/chunk-U4PN6JOT.js +6 -0
- package/dist-cli/chunks/chunk-VUFRB347.js +4 -0
- package/dist-cli/chunks/chunk-VZBLFMYC.js +10 -0
- package/dist-cli/chunks/chunk-WBT32R6N.js +25 -0
- package/dist-cli/chunks/chunk-XRGEEPJ5.js +38 -0
- package/dist-cli/chunks/chunk-Y2FSZSO7.js +71 -0
- package/dist-cli/chunks/chunk-YRV7HR3P.js +74 -0
- package/dist-cli/chunks/chunk-YZRFF4YA.js +14 -0
- package/dist-cli/chunks/chunk-ZMZTHU7V.js +4 -0
- package/dist-cli/chunks/cleanup-H3GWQB63.js +25 -0
- package/dist-cli/chunks/cli-version-3QPAJ3LC.js +4 -0
- package/dist-cli/chunks/compat-5WG2XJV7.js +20 -0
- package/dist-cli/chunks/config-ANMBVVLL.js +13 -0
- package/dist-cli/chunks/control-NSGNQFJG.js +4 -0
- package/dist-cli/chunks/daemon-JHF4BJ3U.js +4 -0
- package/dist-cli/chunks/debug-CHV2O2KF.js +200 -0
- package/dist-cli/chunks/desktop-FIPIK4CH.js +31 -0
- package/dist-cli/chunks/detox-CVUJP7K6.js +52 -0
- package/dist-cli/chunks/device-6WCUM4W6.js +18 -0
- package/dist-cli/chunks/diagnose-I6EMWEII.js +43 -0
- package/dist-cli/chunks/disk-cleanup-P27CYFTN.js +4 -0
- package/dist-cli/chunks/drivers-HQ6AKZT6.js +4 -0
- package/dist-cli/chunks/film-UOQFFYNF.js +74 -0
- package/dist-cli/chunks/flow-N27MRRNL.js +4 -0
- package/dist-cli/chunks/help-SF6FEGEE.js +4 -0
- package/dist-cli/chunks/hidden-runtime-alias-NJYFSJKZ.js +4 -0
- package/dist-cli/chunks/home-paths-XOV44JEF.js +4 -0
- package/dist-cli/chunks/inspect-CWFRFQTY.js +4 -0
- package/dist-cli/chunks/install-desktop-KLQDNXZQ.js +4 -0
- package/dist-cli/chunks/login-BPFQENCX.js +28 -0
- package/dist-cli/chunks/logout-5A45ZGY7.js +4 -0
- package/dist-cli/chunks/maestro-E4CSDMLM.js +104 -0
- package/dist-cli/chunks/maestro-generate-CKMOJQX2.js +36 -0
- package/dist-cli/chunks/mode-SZYNMIQF.js +26 -0
- package/dist-cli/chunks/optional-demo-registry-FRH4SFVG.js +4 -0
- package/dist-cli/chunks/perf-VXU2XJAX.js +48 -0
- package/dist-cli/chunks/permissions-IRIAOVND.js +13 -0
- package/dist-cli/chunks/record-RY7FPLLH.js +72 -0
- package/dist-cli/chunks/report-issue-KNWXOE53.js +29 -0
- package/dist-cli/chunks/runtime-AR3GJTGK.js +4 -0
- package/dist-cli/chunks/screenshot-command-QLALR6GY.js +159 -0
- package/dist-cli/chunks/screenshot-layers-OQFMFVRL.js +20 -0
- package/dist-cli/chunks/screenshots-capture-6TSRJFGB.js +42 -0
- package/dist-cli/chunks/serve-F54J2NQO.js +44 -0
- package/dist-cli/chunks/setup-7V6UKX4U.js +32 -0
- package/dist-cli/chunks/skills-QQBOSETH.js +50 -0
- package/dist-cli/chunks/storage-TAPMKK5O.js +37 -0
- package/dist-cli/chunks/store-7NX3S43H.js +4 -0
- package/dist-cli/chunks/telemetry-E7BUK6RA.js +4 -0
- package/dist-cli/chunks/timeline-IAM564NA.js +24 -0
- package/dist-cli/chunks/upgrade-CD55QXIX.js +7 -0
- package/dist-cli/chunks/upload-GZ6LIMYM.js +4 -0
- package/dist-cli/chunks/version-3DYJ5AS3.js +6 -0
- package/dist-cli/chunks/web-6NW6YLPI.js +4 -0
- package/dist-cli/chunks/what-happened-CZZDOOVG.js +25 -0
- package/dist-lib/agent-daemon-client.cjs +468 -0
- package/dist-lib/agent-events.cjs +48 -0
- package/dist-lib/agent-identity.cjs +53 -0
- package/dist-lib/agent-sessions.cjs +725 -0
- package/dist-lib/attached-projects.cjs +526 -0
- package/dist-lib/auth/shared-session.cjs +195 -0
- package/dist-lib/backend-origin.cjs +70 -0
- package/dist-lib/beta.cjs +41 -0
- package/dist-lib/beta.mjs +13 -0
- package/dist-lib/bridge-constants.cjs +161 -0
- package/dist-lib/cli-constants.cjs +32 -0
- package/dist-lib/config.cjs +96 -0
- package/dist-lib/detox/index.cjs +2863 -0
- package/dist-lib/detox/jest-preset.cjs +51 -0
- package/dist-lib/dev-bundle-resolution.cjs +223 -0
- package/dist-lib/home-paths.cjs +421 -0
- package/dist-lib/host/bridge-host.cjs +5600 -0
- package/dist-lib/host/fetch-proxy-handler.cjs +373 -0
- package/dist-lib/host/fetch-proxy-overrides.cjs +63 -0
- package/dist-lib/host/fetch-proxy-overrides.mjs +37 -0
- package/dist-lib/host/websocket-proxy.cjs +214 -0
- package/dist-lib/index.cjs +513 -0
- package/dist-lib/jump-to-source-babel.cjs +93 -0
- package/dist-lib/menu.cjs +620 -0
- package/dist-lib/menu.mjs +581 -0
- package/dist-lib/metro.cjs +297 -0
- package/dist-lib/profiles.cjs +246 -0
- package/dist-lib/public-brand.cjs +39 -0
- package/dist-lib/render-mode.cjs +54 -0
- package/dist-lib/scripts/dev-server-scanner.cjs +1034 -0
- package/dist-lib/sdk.cjs +2333 -0
- package/dist-lib/sdk.mjs +2240 -0
- package/dist-lib/skills.cjs +23911 -0
- package/dist-lib/vite.cjs +358 -0
- package/package.json +189 -18
- package/scripts/dev-server-scanner.ts +941 -0
- package/scripts/optional-demo-registry.ts +113 -0
- package/scripts/postinstall.cjs +3 -0
- package/scripts/preuninstall.cjs +118 -0
- package/skills/contrast/SKILL.md +171 -0
- package/skills/rnx-debug/SKILL.md +425 -0
- package/skills/rnx-perf/SKILL.md +295 -0
- package/skills/rnx-setup/SKILL.md +160 -0
- package/skills/rnx-test/SKILL.md +292 -0
- package/skills/rnx-visual/SKILL.md +122 -0
- package/src/agent-daemon-client.ts +410 -0
- package/src/agent-events.ts +71 -0
- package/src/agent-identity.ts +23 -0
- package/src/agent-prompt.ts +71 -0
- package/src/agent-sessions.ts +573 -0
- package/src/attached-projects.ts +539 -0
- package/src/auth/shared-session.ts +204 -0
- package/src/backend-origin.ts +49 -0
- package/src/beta.ts +19 -0
- package/src/bridge-constants.ts +171 -0
- package/src/browser-cache.ts +16 -0
- package/src/cli-constants.ts +1 -0
- package/src/cli-version.ts +32 -0
- package/src/codex-client.ts +215 -0
- package/src/config.ts +134 -0
- package/src/dev-bundle-resolution.ts +236 -0
- package/src/disk-cleanup.ts +466 -0
- package/src/home-paths.ts +552 -0
- package/src/host/agent-host.ts +666 -0
- package/src/host/bridge-host.ts +2626 -0
- package/src/host/fetch-proxy-handler.ts +397 -0
- package/src/host/fetch-proxy-overrides.ts +51 -0
- package/src/host/open-url.ts +89 -0
- package/src/host/websocket-proxy.ts +210 -0
- package/src/index.ts +12 -705
- package/src/jump-to-source-babel.ts +135 -0
- package/src/menu.ts +734 -0
- package/src/metro-plugin.ts +139 -0
- package/src/native-dev-bundle-url.ts +96 -0
- package/src/native-seam-manifest.ts +341 -0
- package/src/plist.ts +27 -0
- package/src/poll-until.ts +92 -0
- package/src/profiles.ts +179 -0
- package/src/public-brand.ts +9 -0
- package/src/render-mode.ts +27 -0
- package/src/runtime-assets.ts +228 -0
- package/src/runtime-delivery.ts +54 -0
- package/src/screenshots/compose.ts +422 -0
- package/src/screenshots/frame-compose.ts +454 -0
- package/src/screenshots/orchestrate.ts +256 -0
- package/src/screenshots/org-deck.ts +91 -0
- package/src/screenshots/registry.ts +58 -0
- package/src/screenshots/schema.ts +364 -0
- package/src/sdk.ts +7 -0
- package/src/settings-bundle.ts +418 -0
- package/src/skills/builtin/a11y-review.ts +132 -0
- package/src/skills/builtin/compat-check.ts +71 -0
- package/src/skills/builtin/maestro-test.ts +121 -0
- package/src/skills/builtin/perf-profile.ts +90 -0
- package/src/skills/builtin/screenshot-all.ts +52 -0
- package/src/skills/builtin/visual-diff.ts +100 -0
- package/src/skills/registry.ts +107 -0
- package/src/skills/types.ts +41 -0
- package/src/team-machine-prompt.ts +73 -0
- package/src/vite-plugin-one.ts +190 -0
- package/src/vite-plugin.ts +1750 -0
- package/src/worklets-babel.ts +134 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
|
+
"use strict";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// src/auth/shared-session.ts
|
|
33
|
+
var shared_session_exports = {};
|
|
34
|
+
__export(shared_session_exports, {
|
|
35
|
+
clearSharedDesktopAuthSession: () => clearSharedDesktopAuthSession,
|
|
36
|
+
getSharedDesktopAuthFilePath: () => getSharedDesktopAuthFilePath,
|
|
37
|
+
readSharedDesktopAuthSession: () => readSharedDesktopAuthSession,
|
|
38
|
+
refreshSharedDesktopAuthSession: () => refreshSharedDesktopAuthSession,
|
|
39
|
+
writeSharedDesktopAuthSession: () => writeSharedDesktopAuthSession
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(shared_session_exports);
|
|
42
|
+
var import_node_fs = require("node:fs");
|
|
43
|
+
var import_node_path2 = require("node:path");
|
|
44
|
+
|
|
45
|
+
// src/home-paths.ts
|
|
46
|
+
var import_node_os = require("node:os");
|
|
47
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
48
|
+
var SOOTSIM_HOME_ENV = "SOOTSIM_HOME";
|
|
49
|
+
function sootsimHomeDir() {
|
|
50
|
+
const override = process.env[SOOTSIM_HOME_ENV];
|
|
51
|
+
if (override && override.length > 0) return import_node_path.default.resolve(override);
|
|
52
|
+
return import_node_path.default.join((0, import_node_os.homedir)(), ".sootsim");
|
|
53
|
+
}
|
|
54
|
+
function electronDir() {
|
|
55
|
+
return import_node_path.default.join(sootsimHomeDir(), "electron");
|
|
56
|
+
}
|
|
57
|
+
function electronUserDataDir() {
|
|
58
|
+
return import_node_path.default.join(electronDir(), "userData");
|
|
59
|
+
}
|
|
60
|
+
var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
|
|
61
|
+
|
|
62
|
+
// src/auth/shared-session.ts
|
|
63
|
+
var SESSION_VERSION = 1;
|
|
64
|
+
var SESSION_FILE_ENV = "SOOTSIM_SHARED_AUTH_FILE";
|
|
65
|
+
var DEFAULT_ORIGIN = "https://contrast.dev";
|
|
66
|
+
function getBaseDir() {
|
|
67
|
+
const explicit = process.env[SESSION_FILE_ENV];
|
|
68
|
+
if (explicit?.trim()) {
|
|
69
|
+
return (0, import_node_path2.dirname)((0, import_node_path2.resolve)(explicit));
|
|
70
|
+
}
|
|
71
|
+
return electronUserDataDir();
|
|
72
|
+
}
|
|
73
|
+
function getSharedDesktopAuthFilePath() {
|
|
74
|
+
const explicit = process.env[SESSION_FILE_ENV];
|
|
75
|
+
if (explicit?.trim()) return (0, import_node_path2.resolve)(explicit);
|
|
76
|
+
return (0, import_node_path2.join)(getBaseDir(), "desktop-auth.json");
|
|
77
|
+
}
|
|
78
|
+
function normalizeUser(input) {
|
|
79
|
+
if (!input || typeof input !== "object") return null;
|
|
80
|
+
const value = input;
|
|
81
|
+
if (typeof value.id !== "string" || !value.id.trim()) return null;
|
|
82
|
+
return {
|
|
83
|
+
id: value.id.trim(),
|
|
84
|
+
name: typeof value.name === "string" ? value.name : void 0,
|
|
85
|
+
email: typeof value.email === "string" ? value.email : void 0,
|
|
86
|
+
image: typeof value.image === "string" ? value.image : void 0,
|
|
87
|
+
githubUsername: typeof value.githubUsername === "string" ? value.githubUsername : void 0,
|
|
88
|
+
isAdmin: value.isAdmin === true,
|
|
89
|
+
teams: Array.isArray(value.teams) ? value.teams.map((team) => {
|
|
90
|
+
if (!team || typeof team !== "object") return null;
|
|
91
|
+
const t = team;
|
|
92
|
+
if (typeof t.id !== "string" || typeof t.name !== "string") return null;
|
|
93
|
+
return {
|
|
94
|
+
id: t.id,
|
|
95
|
+
name: t.name,
|
|
96
|
+
role: t.role === "owner" ? "owner" : "member",
|
|
97
|
+
githubOrg: typeof t.githubOrg === "string" ? t.githubOrg : null
|
|
98
|
+
};
|
|
99
|
+
}).filter((team) => !!team) : void 0
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function normalizeSession(input) {
|
|
103
|
+
if (!input || typeof input !== "object") return null;
|
|
104
|
+
const value = input;
|
|
105
|
+
if (value.version !== SESSION_VERSION) return null;
|
|
106
|
+
if (typeof value.token !== "string" || !value.token.trim()) return null;
|
|
107
|
+
const origin = typeof value.origin === "string" && value.origin.trim() ? value.origin.trim() : DEFAULT_ORIGIN;
|
|
108
|
+
const source = value.source === "cli" || value.source === "electron" || value.source === "browser" || value.source === "unknown" ? value.source : "unknown";
|
|
109
|
+
const updatedAt = typeof value.updatedAt === "string" && value.updatedAt ? value.updatedAt : (/* @__PURE__ */ new Date()).toISOString();
|
|
110
|
+
const validatedAt = typeof value.validatedAt === "string" && value.validatedAt ? value.validatedAt : void 0;
|
|
111
|
+
return {
|
|
112
|
+
version: SESSION_VERSION,
|
|
113
|
+
token: value.token.trim(),
|
|
114
|
+
user: normalizeUser(value.user),
|
|
115
|
+
origin,
|
|
116
|
+
source,
|
|
117
|
+
updatedAt,
|
|
118
|
+
validatedAt
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function readSharedDesktopAuthSession() {
|
|
122
|
+
const filepath = getSharedDesktopAuthFilePath();
|
|
123
|
+
if (!(0, import_node_fs.existsSync)(filepath)) return null;
|
|
124
|
+
try {
|
|
125
|
+
const parsed = JSON.parse((0, import_node_fs.readFileSync)(filepath, "utf8"));
|
|
126
|
+
const normalized = normalizeSession(parsed);
|
|
127
|
+
if (!normalized) {
|
|
128
|
+
(0, import_node_fs.rmSync)(filepath, { force: true });
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
return normalized;
|
|
132
|
+
} catch {
|
|
133
|
+
(0, import_node_fs.rmSync)(filepath, { force: true });
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function writeSharedDesktopAuthSession(session) {
|
|
138
|
+
const filepath = getSharedDesktopAuthFilePath();
|
|
139
|
+
(0, import_node_fs.mkdirSync)((0, import_node_path2.dirname)(filepath), { recursive: true });
|
|
140
|
+
const normalized = {
|
|
141
|
+
version: SESSION_VERSION,
|
|
142
|
+
token: session.token.trim(),
|
|
143
|
+
user: session.user ? normalizeUser(session.user) : null,
|
|
144
|
+
origin: session.origin?.trim() || DEFAULT_ORIGIN,
|
|
145
|
+
source: session.source,
|
|
146
|
+
updatedAt: session.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
147
|
+
validatedAt: session.validatedAt
|
|
148
|
+
};
|
|
149
|
+
(0, import_node_fs.writeFileSync)(filepath, JSON.stringify(normalized, null, 2) + "\n");
|
|
150
|
+
try {
|
|
151
|
+
(0, import_node_fs.chmodSync)(filepath, 384);
|
|
152
|
+
} catch {
|
|
153
|
+
}
|
|
154
|
+
return normalized;
|
|
155
|
+
}
|
|
156
|
+
function clearSharedDesktopAuthSession() {
|
|
157
|
+
(0, import_node_fs.rmSync)(getSharedDesktopAuthFilePath(), { force: true });
|
|
158
|
+
}
|
|
159
|
+
async function refreshSharedDesktopAuthSession(originOverride) {
|
|
160
|
+
const current = readSharedDesktopAuthSession();
|
|
161
|
+
if (!current?.token) return null;
|
|
162
|
+
const origin = originOverride || current.origin || DEFAULT_ORIGIN;
|
|
163
|
+
try {
|
|
164
|
+
const res = await fetch(`${origin.replace(/\/$/, "")}/api/auth/me`, {
|
|
165
|
+
headers: { authorization: `Bearer ${current.token}` }
|
|
166
|
+
});
|
|
167
|
+
if (res.status === 401) {
|
|
168
|
+
clearSharedDesktopAuthSession();
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
if (!res.ok) return current;
|
|
172
|
+
const data = await res.json();
|
|
173
|
+
if (!data.user?.id) {
|
|
174
|
+
clearSharedDesktopAuthSession();
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
return writeSharedDesktopAuthSession({
|
|
178
|
+
token: current.token,
|
|
179
|
+
user: data.user,
|
|
180
|
+
origin,
|
|
181
|
+
source: current.source,
|
|
182
|
+
validatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
183
|
+
});
|
|
184
|
+
} catch {
|
|
185
|
+
return current;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
189
|
+
0 && (module.exports = {
|
|
190
|
+
clearSharedDesktopAuthSession,
|
|
191
|
+
getSharedDesktopAuthFilePath,
|
|
192
|
+
readSharedDesktopAuthSession,
|
|
193
|
+
refreshSharedDesktopAuthSession,
|
|
194
|
+
writeSharedDesktopAuthSession
|
|
195
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/backend-origin.ts
|
|
23
|
+
var backend_origin_exports = {};
|
|
24
|
+
__export(backend_origin_exports, {
|
|
25
|
+
DEFAULT_CONTRAST_BACKEND_ORIGIN: () => DEFAULT_CONTRAST_BACKEND_ORIGIN,
|
|
26
|
+
isContrastBackendHost: () => isContrastBackendHost,
|
|
27
|
+
isContrastBackendOrigin: () => isContrastBackendOrigin,
|
|
28
|
+
isLoopbackHost: () => isLoopbackHost,
|
|
29
|
+
resolveContrastBackendOrigin: () => resolveContrastBackendOrigin
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(backend_origin_exports);
|
|
32
|
+
var DEFAULT_CONTRAST_BACKEND_ORIGIN = "https://contrast.dev";
|
|
33
|
+
function normalizeHostname(hostname) {
|
|
34
|
+
return hostname.replace(/^\[|\]$/g, "").toLowerCase();
|
|
35
|
+
}
|
|
36
|
+
function isLoopbackHost(hostname) {
|
|
37
|
+
const normalized = normalizeHostname(hostname);
|
|
38
|
+
return normalized === "localhost" || normalized.endsWith(".localhost") || normalized === "0.0.0.0" || normalized === "::1" || /^127(?:\.\d{1,3}){3}$/.test(normalized);
|
|
39
|
+
}
|
|
40
|
+
function isContrastBackendHost(hostname) {
|
|
41
|
+
const normalized = normalizeHostname(hostname);
|
|
42
|
+
return isLoopbackHost(normalized) || normalized === "contrast.dev" || normalized.endsWith(".contrast.dev");
|
|
43
|
+
}
|
|
44
|
+
function isContrastBackendOrigin(origin) {
|
|
45
|
+
try {
|
|
46
|
+
return isContrastBackendHost(new URL(origin).hostname);
|
|
47
|
+
} catch {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function resolveContrastBackendOrigin(currentOrigin) {
|
|
52
|
+
const origin = currentOrigin?.trim();
|
|
53
|
+
if (!origin) return DEFAULT_CONTRAST_BACKEND_ORIGIN;
|
|
54
|
+
try {
|
|
55
|
+
const parsed = new URL(origin);
|
|
56
|
+
if (isLoopbackHost(parsed.hostname) || isContrastBackendHost(parsed.hostname)) {
|
|
57
|
+
return parsed.origin;
|
|
58
|
+
}
|
|
59
|
+
} catch {
|
|
60
|
+
}
|
|
61
|
+
return DEFAULT_CONTRAST_BACKEND_ORIGIN;
|
|
62
|
+
}
|
|
63
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
+
0 && (module.exports = {
|
|
65
|
+
DEFAULT_CONTRAST_BACKEND_ORIGIN,
|
|
66
|
+
isContrastBackendHost,
|
|
67
|
+
isContrastBackendOrigin,
|
|
68
|
+
isLoopbackHost,
|
|
69
|
+
resolveContrastBackendOrigin
|
|
70
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/beta.ts
|
|
23
|
+
var beta_exports = {};
|
|
24
|
+
__export(beta_exports, {
|
|
25
|
+
BETA_ASK_HEADLINE: () => BETA_ASK_HEADLINE,
|
|
26
|
+
BETA_LABEL: () => BETA_LABEL,
|
|
27
|
+
BETA_TAGLINE: () => BETA_TAGLINE,
|
|
28
|
+
IS_BETA: () => IS_BETA
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(beta_exports);
|
|
31
|
+
var IS_BETA = true;
|
|
32
|
+
var BETA_LABEL = "public beta";
|
|
33
|
+
var BETA_TAGLINE = BETA_LABEL;
|
|
34
|
+
var BETA_ASK_HEADLINE = "we send anonymous error and dependency data while you use it";
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
BETA_ASK_HEADLINE,
|
|
38
|
+
BETA_LABEL,
|
|
39
|
+
BETA_TAGLINE,
|
|
40
|
+
IS_BETA
|
|
41
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
|
|
3
|
+
// src/beta.ts
|
|
4
|
+
var IS_BETA = true;
|
|
5
|
+
var BETA_LABEL = "public beta";
|
|
6
|
+
var BETA_TAGLINE = BETA_LABEL;
|
|
7
|
+
var BETA_ASK_HEADLINE = "we send anonymous error and dependency data while you use it";
|
|
8
|
+
export {
|
|
9
|
+
BETA_ASK_HEADLINE,
|
|
10
|
+
BETA_LABEL,
|
|
11
|
+
BETA_TAGLINE,
|
|
12
|
+
IS_BETA
|
|
13
|
+
};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/bridge-constants.ts
|
|
23
|
+
var bridge_constants_exports = {};
|
|
24
|
+
__export(bridge_constants_exports, {
|
|
25
|
+
DEFAULT_SOOTSIM_BRIDGE_PORT: () => DEFAULT_SOOTSIM_BRIDGE_PORT,
|
|
26
|
+
DEFAULT_SOOTSIM_BRIDGE_URL: () => DEFAULT_SOOTSIM_BRIDGE_URL,
|
|
27
|
+
SOOTSIM_BRIDGE_SIM_CLOSE_CODE: () => SOOTSIM_BRIDGE_SIM_CLOSE_CODE,
|
|
28
|
+
SOOTSIM_BRIDGE_SIM_CLOSE_REASON: () => SOOTSIM_BRIDGE_SIM_CLOSE_REASON,
|
|
29
|
+
isSootsimBridgeHealth: () => isSootsimBridgeHealth,
|
|
30
|
+
resolveSootsimBridgePort: () => resolveSootsimBridgePort,
|
|
31
|
+
resolveSootsimBridgePortForHttpPort: () => resolveSootsimBridgePortForHttpPort,
|
|
32
|
+
resolveSootsimBridgePortForRuntimeLocation: () => resolveSootsimBridgePortForRuntimeLocation,
|
|
33
|
+
resolveSootsimBridgeWebSocketUrl: () => resolveSootsimBridgeWebSocketUrl,
|
|
34
|
+
resolveSootsimShellBaseUrlForBridgePort: () => resolveSootsimShellBaseUrlForBridgePort,
|
|
35
|
+
resolveSootsimWebSocketProxyUrl: () => resolveSootsimWebSocketProxyUrl
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(bridge_constants_exports);
|
|
38
|
+
var DEFAULT_SOOTSIM_BRIDGE_PORT = 7668;
|
|
39
|
+
var DEFAULT_SOOTSIM_BRIDGE_URL = `http://localhost:${DEFAULT_SOOTSIM_BRIDGE_PORT}/`;
|
|
40
|
+
function parsePort(value) {
|
|
41
|
+
if (typeof value === "number") {
|
|
42
|
+
return Number.isInteger(value) && value > 0 ? value : null;
|
|
43
|
+
}
|
|
44
|
+
if (typeof value !== "string") return null;
|
|
45
|
+
const trimmed = value.trim();
|
|
46
|
+
if (!trimmed) return null;
|
|
47
|
+
const parsed = Number(trimmed);
|
|
48
|
+
return Number.isInteger(parsed) && parsed > 0 ? parsed : null;
|
|
49
|
+
}
|
|
50
|
+
function parsePortOffset(value) {
|
|
51
|
+
const parsed = parsePort(value);
|
|
52
|
+
return parsed === null ? 0 : parsed;
|
|
53
|
+
}
|
|
54
|
+
function resolveSootsimBridgePort(input = {}) {
|
|
55
|
+
const explicitPort = parsePort(input.explicitPort);
|
|
56
|
+
if (explicitPort !== null) return explicitPort;
|
|
57
|
+
return DEFAULT_SOOTSIM_BRIDGE_PORT + parsePortOffset(input.portOffset);
|
|
58
|
+
}
|
|
59
|
+
function resolveSootsimBridgePortForHttpPort(input) {
|
|
60
|
+
const explicitPort = parsePort(input.explicitPort);
|
|
61
|
+
if (explicitPort !== null) return explicitPort;
|
|
62
|
+
const httpPort = parsePort(input.httpPort);
|
|
63
|
+
const portOffset = httpPort === null ? 0 : Math.max(0, httpPort - input.baseHttpPort);
|
|
64
|
+
return resolveSootsimBridgePort({ portOffset });
|
|
65
|
+
}
|
|
66
|
+
var CONTRAST_DEV_HTTP_BASE_PORT = 3e3;
|
|
67
|
+
var SOOTSIM_SITE_DEV_HTTP_BASE_PORT = 3001;
|
|
68
|
+
var SOOTSIM_SHELL_DEV_HTTP_BASE_PORT = 5173;
|
|
69
|
+
var LOCAL_DEV_HTTP_BASE_PORTS = [
|
|
70
|
+
CONTRAST_DEV_HTTP_BASE_PORT,
|
|
71
|
+
SOOTSIM_SHELL_DEV_HTTP_BASE_PORT
|
|
72
|
+
];
|
|
73
|
+
var MAX_LOCAL_DEV_PORT_OFFSET = 2e3;
|
|
74
|
+
function parseHrefUrl(value) {
|
|
75
|
+
if (typeof value !== "string" || !value.trim()) return null;
|
|
76
|
+
try {
|
|
77
|
+
return new URL(value);
|
|
78
|
+
} catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function closestLocalDevBaseHttpPort(httpPort) {
|
|
83
|
+
let closest = null;
|
|
84
|
+
for (const basePort of LOCAL_DEV_HTTP_BASE_PORTS) {
|
|
85
|
+
const offset = httpPort - basePort;
|
|
86
|
+
if (offset < 0 || offset > MAX_LOCAL_DEV_PORT_OFFSET) continue;
|
|
87
|
+
if (!closest || offset < closest.offset) closest = { basePort, offset };
|
|
88
|
+
}
|
|
89
|
+
return closest?.basePort ?? null;
|
|
90
|
+
}
|
|
91
|
+
function resolveSootsimShellBaseUrlForBridgePort(bridgePort) {
|
|
92
|
+
const offset = bridgePort - DEFAULT_SOOTSIM_BRIDGE_PORT;
|
|
93
|
+
if (offset < 0 || offset > MAX_LOCAL_DEV_PORT_OFFSET) return null;
|
|
94
|
+
return `http://localhost:${SOOTSIM_SHELL_DEV_HTTP_BASE_PORT + offset}/`;
|
|
95
|
+
}
|
|
96
|
+
function resolveSootsimBridgePortForRuntimeLocation(input = {}) {
|
|
97
|
+
const explicitPort = parsePort(input.explicitPort);
|
|
98
|
+
if (explicitPort !== null) return explicitPort;
|
|
99
|
+
const hrefUrl = parseHrefUrl(input.href);
|
|
100
|
+
const httpPort = parsePort(input.httpPort) ?? parsePort(hrefUrl?.port);
|
|
101
|
+
if (httpPort === null) return DEFAULT_SOOTSIM_BRIDGE_PORT;
|
|
102
|
+
if (hrefUrl?.pathname.startsWith("/sootsim") && (hrefUrl.searchParams.has("embed") || hrefUrl.searchParams.has("nativePreview"))) {
|
|
103
|
+
return resolveSootsimBridgePortForHttpPort({
|
|
104
|
+
httpPort,
|
|
105
|
+
baseHttpPort: CONTRAST_DEV_HTTP_BASE_PORT
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (hrefUrl?.pathname.startsWith("/sootsim") && httpPort >= SOOTSIM_SITE_DEV_HTTP_BASE_PORT && httpPort <= SOOTSIM_SITE_DEV_HTTP_BASE_PORT + MAX_LOCAL_DEV_PORT_OFFSET) {
|
|
109
|
+
return resolveSootsimBridgePortForHttpPort({
|
|
110
|
+
httpPort,
|
|
111
|
+
baseHttpPort: SOOTSIM_SITE_DEV_HTTP_BASE_PORT
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
const baseHttpPort = closestLocalDevBaseHttpPort(httpPort);
|
|
115
|
+
if (baseHttpPort === null) return DEFAULT_SOOTSIM_BRIDGE_PORT;
|
|
116
|
+
return resolveSootsimBridgePortForHttpPort({ httpPort, baseHttpPort });
|
|
117
|
+
}
|
|
118
|
+
function resolveSootsimWebSocketProxyUrl(input) {
|
|
119
|
+
const pageUrl = parseHrefUrl(input.href);
|
|
120
|
+
if (!pageUrl || pageUrl.protocol !== "http:" && pageUrl.protocol !== "https:") {
|
|
121
|
+
throw new Error(`invalid rnx websocket proxy page URL: ${input.href}`);
|
|
122
|
+
}
|
|
123
|
+
let targetUrl;
|
|
124
|
+
try {
|
|
125
|
+
targetUrl = new URL(input.targetUrl);
|
|
126
|
+
} catch {
|
|
127
|
+
throw new Error(`invalid rnx websocket proxy target URL: ${input.targetUrl}`);
|
|
128
|
+
}
|
|
129
|
+
if (targetUrl.protocol !== "ws:" && targetUrl.protocol !== "wss:") {
|
|
130
|
+
throw new Error(`invalid rnx websocket proxy target URL: ${input.targetUrl}`);
|
|
131
|
+
}
|
|
132
|
+
const proxyUrl = new URL("/__websocket-proxy", pageUrl);
|
|
133
|
+
proxyUrl.protocol = pageUrl.protocol === "https:" ? "wss:" : "ws:";
|
|
134
|
+
proxyUrl.searchParams.set("url", input.targetUrl);
|
|
135
|
+
return proxyUrl.href;
|
|
136
|
+
}
|
|
137
|
+
function resolveSootsimBridgeWebSocketUrl(input) {
|
|
138
|
+
return resolveSootsimWebSocketProxyUrl({
|
|
139
|
+
targetUrl: `ws://localhost:${input.bridgePort}`,
|
|
140
|
+
href: input.href
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function isSootsimBridgeHealth(value, expectedPort) {
|
|
144
|
+
return typeof value === "object" && value !== null && Reflect.get(value, "ok") === true && Reflect.get(value, "bridgePort") === expectedPort;
|
|
145
|
+
}
|
|
146
|
+
var SOOTSIM_BRIDGE_SIM_CLOSE_CODE = 4001;
|
|
147
|
+
var SOOTSIM_BRIDGE_SIM_CLOSE_REASON = "sootsim close";
|
|
148
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
149
|
+
0 && (module.exports = {
|
|
150
|
+
DEFAULT_SOOTSIM_BRIDGE_PORT,
|
|
151
|
+
DEFAULT_SOOTSIM_BRIDGE_URL,
|
|
152
|
+
SOOTSIM_BRIDGE_SIM_CLOSE_CODE,
|
|
153
|
+
SOOTSIM_BRIDGE_SIM_CLOSE_REASON,
|
|
154
|
+
isSootsimBridgeHealth,
|
|
155
|
+
resolveSootsimBridgePort,
|
|
156
|
+
resolveSootsimBridgePortForHttpPort,
|
|
157
|
+
resolveSootsimBridgePortForRuntimeLocation,
|
|
158
|
+
resolveSootsimBridgeWebSocketUrl,
|
|
159
|
+
resolveSootsimShellBaseUrlForBridgePort,
|
|
160
|
+
resolveSootsimWebSocketProxyUrl
|
|
161
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/cli-constants.ts
|
|
23
|
+
var cli_constants_exports = {};
|
|
24
|
+
__export(cli_constants_exports, {
|
|
25
|
+
DEFAULT_SOOTSIM_SHELL_URL: () => DEFAULT_SOOTSIM_SHELL_URL
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(cli_constants_exports);
|
|
28
|
+
var DEFAULT_SOOTSIM_SHELL_URL = "http://localhost:5173/";
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
DEFAULT_SOOTSIM_SHELL_URL
|
|
32
|
+
});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/config.ts
|
|
23
|
+
var config_exports = {};
|
|
24
|
+
__export(config_exports, {
|
|
25
|
+
SOOTSIM_CONFIG_QUERY_PARAM: () => SOOTSIM_CONFIG_QUERY_PARAM,
|
|
26
|
+
applySootSimConfigToUrl: () => applySootSimConfigToUrl,
|
|
27
|
+
defineConfig: () => defineConfig,
|
|
28
|
+
hasSootSimConfig: () => hasSootSimConfig,
|
|
29
|
+
mergeSootSimConfig: () => mergeSootSimConfig,
|
|
30
|
+
readSootSimConfigFromSearchParams: () => readSootSimConfigFromSearchParams
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(config_exports);
|
|
33
|
+
var SOOTSIM_CONFIG_QUERY_PARAM = "sootsimConfig";
|
|
34
|
+
function defineConfig(config) {
|
|
35
|
+
return config;
|
|
36
|
+
}
|
|
37
|
+
function hasOwnKeys(value) {
|
|
38
|
+
return !!value && Object.keys(value).length > 0;
|
|
39
|
+
}
|
|
40
|
+
function hasSootSimConfig(config) {
|
|
41
|
+
if (!config) return false;
|
|
42
|
+
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);
|
|
43
|
+
}
|
|
44
|
+
function mergeSootSimConfig(base, override) {
|
|
45
|
+
if (!hasSootSimConfig(base) && !hasSootSimConfig(override)) return void 0;
|
|
46
|
+
if (!hasSootSimConfig(base)) return override ? { ...override } : void 0;
|
|
47
|
+
if (!hasSootSimConfig(override)) return base ? { ...base } : void 0;
|
|
48
|
+
return {
|
|
49
|
+
runtimeVersion: override.runtimeVersion ?? base.runtimeVersion,
|
|
50
|
+
modules: { ...base.modules || {}, ...override.modules || {} },
|
|
51
|
+
turboModules: { ...base.turboModules || {}, ...override.turboModules || {} },
|
|
52
|
+
nativeModules: {
|
|
53
|
+
...base.nativeModules || {},
|
|
54
|
+
...override.nativeModules || {}
|
|
55
|
+
},
|
|
56
|
+
env: { ...base.env || {}, ...override.env || {} },
|
|
57
|
+
network: {
|
|
58
|
+
remap: { ...base.network?.remap || {}, ...override.network?.remap || {} }
|
|
59
|
+
},
|
|
60
|
+
settings: {
|
|
61
|
+
...base.settings || {},
|
|
62
|
+
...override.settings || {}
|
|
63
|
+
},
|
|
64
|
+
initialState: { ...base.initialState || {}, ...override.initialState || {} }
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function readSootSimConfigFromSearchParams(searchParams) {
|
|
68
|
+
const raw = searchParams.get(SOOTSIM_CONFIG_QUERY_PARAM);
|
|
69
|
+
if (!raw) return void 0;
|
|
70
|
+
try {
|
|
71
|
+
const parsed = JSON.parse(raw);
|
|
72
|
+
return hasSootSimConfig(parsed) ? parsed : void 0;
|
|
73
|
+
} catch (error) {
|
|
74
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
75
|
+
console.warn(`[rnx] invalid ${SOOTSIM_CONFIG_QUERY_PARAM}: ${message}`);
|
|
76
|
+
return void 0;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function applySootSimConfigToUrl(url, config) {
|
|
80
|
+
const parsed = new URL(url);
|
|
81
|
+
if (hasSootSimConfig(config)) {
|
|
82
|
+
parsed.searchParams.set(SOOTSIM_CONFIG_QUERY_PARAM, JSON.stringify(config));
|
|
83
|
+
} else {
|
|
84
|
+
parsed.searchParams.delete(SOOTSIM_CONFIG_QUERY_PARAM);
|
|
85
|
+
}
|
|
86
|
+
return parsed.toString();
|
|
87
|
+
}
|
|
88
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
+
0 && (module.exports = {
|
|
90
|
+
SOOTSIM_CONFIG_QUERY_PARAM,
|
|
91
|
+
applySootSimConfigToUrl,
|
|
92
|
+
defineConfig,
|
|
93
|
+
hasSootSimConfig,
|
|
94
|
+
mergeSootSimConfig,
|
|
95
|
+
readSootSimConfigFromSearchParams
|
|
96
|
+
});
|