peachsim 0.1.754 → 0.1.756

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.
Files changed (83) hide show
  1. package/cli/app-config.ts +4 -29
  2. package/cli/commands/daemon.ts +117 -116
  3. package/cli/commands/install-desktop.ts +13 -8
  4. package/cli/desktop-companion.ts +9 -2
  5. package/dist-lib/agent-daemon-client.cjs +1 -1
  6. package/dist-lib/agent-events.cjs +1 -1
  7. package/dist-lib/agent-identity.cjs +1 -1
  8. package/dist-lib/agent-sessions.cjs +1 -1
  9. package/dist-lib/attached-projects.cjs +1 -1
  10. package/dist-lib/auth/shared-session.cjs +8 -5
  11. package/dist-lib/backend-origin.cjs +1 -1
  12. package/dist-lib/beta.cjs +1 -1
  13. package/dist-lib/beta.mjs +1 -1
  14. package/dist-lib/bridge-constants.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.cjs +1 -1
  16. package/dist-lib/bridge-contract-input.mjs +1 -1
  17. package/dist-lib/bridge-contract.cjs +1 -1
  18. package/dist-lib/bridge-contract.mjs +1 -1
  19. package/dist-lib/capture-contract.cjs +1 -1
  20. package/dist-lib/capture-contract.mjs +1 -1
  21. package/dist-lib/cli-constants.cjs +1 -1
  22. package/dist-lib/cloud-contract.cjs +1 -1
  23. package/dist-lib/cloud-contract.mjs +1 -1
  24. package/dist-lib/cloud-test-args.cjs +1 -1
  25. package/dist-lib/cloud-test-args.mjs +1 -1
  26. package/dist-lib/cloud.cjs +1 -1
  27. package/dist-lib/cloud.mjs +1 -1
  28. package/dist-lib/config.cjs +88 -1
  29. package/dist-lib/detox/index.cjs +1 -1
  30. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  31. package/dist-lib/home-paths.cjs +2 -23
  32. package/dist-lib/host/bridge-host.cjs +54 -38
  33. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  34. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  35. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  36. package/dist-lib/host/replacement-module-handler.cjs +13 -5
  37. package/dist-lib/host/websocket-proxy.cjs +1 -1
  38. package/dist-lib/index.cjs +2551 -2220
  39. package/dist-lib/jump-to-source-babel.cjs +1 -1
  40. package/dist-lib/jump-to-source-native.cjs +1 -1
  41. package/dist-lib/kotlin-host.cjs +1 -1
  42. package/dist-lib/menu.cjs +1 -1
  43. package/dist-lib/menu.mjs +1 -1
  44. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  46. package/dist-lib/metro-production-bundle.cjs +1 -1
  47. package/dist-lib/metro-production-bundle.mjs +1 -1
  48. package/dist-lib/metro.cjs +914 -584
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/native-firebase-metadata.cjs +1 -1
  52. package/dist-lib/native-firebase-metadata.mjs +1 -1
  53. package/dist-lib/plist.cjs +1 -1
  54. package/dist-lib/plist.mjs +1 -1
  55. package/dist-lib/profiles.cjs +1 -1
  56. package/dist-lib/public-brand.cjs +1 -1
  57. package/dist-lib/react-native-host-modules.cjs +1 -1
  58. package/dist-lib/react-native-host-modules.mjs +1 -1
  59. package/dist-lib/render-mode.cjs +1 -1
  60. package/dist-lib/scripts/dev-server-scanner.cjs +4 -4
  61. package/dist-lib/sdk.cjs +1 -1
  62. package/dist-lib/sdk.mjs +1 -1
  63. package/dist-lib/skills.cjs +137 -107
  64. package/dist-lib/swift-compile.cjs +6 -2
  65. package/dist-lib/swift-compile.mjs +6 -2
  66. package/dist-lib/swift-package.cjs +1 -1
  67. package/dist-lib/swift-package.mjs +1 -1
  68. package/dist-lib/swift-submit.cjs +1 -1
  69. package/dist-lib/swift-submit.mjs +1 -1
  70. package/dist-lib/swift-toolchain.cjs +1 -1
  71. package/dist-lib/swift.cjs +1 -1
  72. package/dist-lib/vite-swift.cjs +6 -2
  73. package/dist-lib/vite.cjs +10 -4
  74. package/package.json +1 -1
  75. package/src/auth/shared-session.ts +9 -4
  76. package/src/config.ts +92 -0
  77. package/src/configured-bundle-producer.ts +110 -0
  78. package/src/desktop-host-delivery.ts +82 -19
  79. package/src/home-paths.ts +5 -22
  80. package/src/host/agent-host.ts +4 -1
  81. package/src/host/replacement-module-handler.ts +8 -2
  82. package/src/metro-plugin.ts +27 -0
  83. package/src/swift-compile.ts +4 -0
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.754 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.756 | (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 __defProp = Object.defineProperty;
@@ -22,15 +22,95 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
22
22
  // src/config.ts
23
23
  var config_exports = {};
24
24
  __export(config_exports, {
25
+ PEACH_CONFIGURED_FILES_HOOK: () => PEACH_CONFIGURED_FILES_HOOK,
25
26
  PEACH_CONFIG_QUERY_PARAM: () => PEACH_CONFIG_QUERY_PARAM,
26
27
  applyPeachConfigToUrl: () => applyPeachConfigToUrl,
28
+ collectConfiguredFileModules: () => collectConfiguredFileModules,
29
+ createPeachBundleConfigFooter: () => createPeachBundleConfigFooter,
27
30
  defineConfig: () => defineConfig,
31
+ detachPeachBundleConfigFooter: () => detachPeachBundleConfigFooter,
28
32
  hasPeachConfig: () => hasPeachConfig,
33
+ isPeachConfig: () => isPeachConfig,
29
34
  mergePeachConfig: () => mergePeachConfig,
35
+ readPeachBundleConfig: () => readPeachBundleConfig,
36
+ readPeachBundleConfigFooter: () => readPeachBundleConfigFooter,
30
37
  readPeachConfigFromSearchParams: () => readPeachConfigFromSearchParams
31
38
  });
32
39
  module.exports = __toCommonJS(config_exports);
40
+
41
+ // ../contrast-runtime-delivery/src/version.ts
42
+ function isValidRuntimeVersion(value) {
43
+ return value.length <= 100 && /^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(value);
44
+ }
45
+
46
+ // src/is-record.ts
47
+ function isRecord(value) {
48
+ return typeof value === "object" && value !== null && !Array.isArray(value);
49
+ }
50
+
51
+ // src/config.ts
33
52
  var PEACH_CONFIG_QUERY_PARAM = "peachConfig";
53
+ function collectConfiguredFileModules(config) {
54
+ return [
55
+ ...new Set(
56
+ ["modules", "turboModules", "nativeModules", "nativeViews"].flatMap((key) => {
57
+ const entries = config && Reflect.get(config, key);
58
+ if (!isRecord(entries)) return [];
59
+ return Object.values(entries).flatMap(
60
+ (entry) => isRecord(entry) && typeof entry.file === "string" ? [entry.file] : []
61
+ );
62
+ })
63
+ )
64
+ ];
65
+ }
66
+ function isPeachConfig(value) {
67
+ if (!isRecord(value)) return false;
68
+ return (value.runtimeVersion === void 0 || typeof value.runtimeVersion === "string" && value.runtimeVersion === value.runtimeVersion.trim() && isValidRuntimeVersion(value.runtimeVersion)) && [
69
+ "modules",
70
+ "turboModules",
71
+ "nativeModules",
72
+ "nativeViews",
73
+ "env",
74
+ "network",
75
+ "settings",
76
+ "initialState"
77
+ ].every((key) => value[key] === void 0 || isRecord(value[key]));
78
+ }
79
+ var BUNDLE_CONFIG_PREFIX = "globalThis.__peachBundleConfig=";
80
+ var PEACH_CONFIGURED_FILES_HOOK = "__peachInstallConfiguredFiles";
81
+ function readPeachBundleConfig(value) {
82
+ if (value === void 0 || value === null) return null;
83
+ if (!isRecord(value) || !isPeachConfig(value.config) || !Array.isArray(value.runtimePackages) || !value.runtimePackages.every((name) => typeof name === "string")) {
84
+ throw new Error("configured bundle metadata is malformed");
85
+ }
86
+ return { config: value.config, runtimePackages: [...value.runtimePackages] };
87
+ }
88
+ function readPeachBundleConfigFooter(source) {
89
+ const start = source.lastIndexOf("\n" + BUNDLE_CONFIG_PREFIX);
90
+ if (start < 0) return null;
91
+ const end = source.indexOf("\n", start + 1);
92
+ const line = source.slice(start + 1, end < 0 ? void 0 : end);
93
+ if (!line.endsWith(";")) throw new Error("configured bundle footer is truncated");
94
+ const result = readPeachBundleConfig(
95
+ JSON.parse(line.slice(BUNDLE_CONFIG_PREFIX.length, -1))
96
+ );
97
+ if (!result) throw new Error("configured bundle footer is empty");
98
+ return result;
99
+ }
100
+ function createPeachBundleConfigFooter(config) {
101
+ const json = JSON.stringify(config).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/<\//g, "<\\/");
102
+ return "\n" + BUNDLE_CONFIG_PREFIX + json + ";";
103
+ }
104
+ function detachPeachBundleConfigFooter(source) {
105
+ const configuredBundle = readPeachBundleConfigFooter(source);
106
+ if (!configuredBundle) return { source, configuredBundle };
107
+ const start = source.lastIndexOf("\n" + BUNDLE_CONFIG_PREFIX);
108
+ const end = source.indexOf("\n", start + 1);
109
+ return {
110
+ source: source.slice(0, start) + source.slice(end < 0 ? source.length : end),
111
+ configuredBundle
112
+ };
113
+ }
34
114
  function defineConfig(config) {
35
115
  return config;
36
116
  }
@@ -88,10 +168,17 @@ function applyPeachConfigToUrl(url, config) {
88
168
  }
89
169
  // Annotate the CommonJS export names for ESM import in node:
90
170
  0 && (module.exports = {
171
+ PEACH_CONFIGURED_FILES_HOOK,
91
172
  PEACH_CONFIG_QUERY_PARAM,
92
173
  applyPeachConfigToUrl,
174
+ collectConfiguredFileModules,
175
+ createPeachBundleConfigFooter,
93
176
  defineConfig,
177
+ detachPeachBundleConfigFooter,
94
178
  hasPeachConfig,
179
+ isPeachConfig,
95
180
  mergePeachConfig,
181
+ readPeachBundleConfig,
182
+ readPeachBundleConfigFooter,
96
183
  readPeachConfigFromSearchParams
97
184
  });
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.754 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.756 | (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;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.754 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.756 | (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 __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.754 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.756 | (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;
@@ -66,7 +66,6 @@ __export(home_paths_exports, {
66
66
  isSootsimDevCheckout: () => isSootsimDevCheckout,
67
67
  playwrightCoreDir: () => playwrightCoreDir,
68
68
  profilesDir: () => profilesDir,
69
- readActiveDesktopHost: () => readActiveDesktopHost,
70
69
  readActiveRuntime: () => readActiveRuntime,
71
70
  readDaemonLockfile: () => readDaemonLockfile,
72
71
  readDefaultBox: () => readDefaultBox,
@@ -83,7 +82,6 @@ __export(home_paths_exports, {
83
82
  runtimeUpgradeNoticePath: () => runtimeUpgradeNoticePath,
84
83
  runtimesDir: () => runtimesDir,
85
84
  shouldSkipPersistentDaemon: () => shouldSkipPersistentDaemon,
86
- writeActiveDesktopHost: () => writeActiveDesktopHost,
87
85
  writeActiveRuntime: () => writeActiveRuntime,
88
86
  writeDaemonLockfile: () => writeDaemonLockfile,
89
87
  writeDefaultBox: () => writeDefaultBox,
@@ -141,28 +139,11 @@ function activeRuntimeFile() {
141
139
  return import_node_path.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
142
140
  }
143
141
  function desktopHostsDir() {
144
- return import_node_path.default.join(rnxHomeDir(), "desktop");
142
+ return import_node_path.default.join(rnxHomeDir(), "desktop", "versions");
145
143
  }
146
144
  function desktopHostDir(version) {
147
145
  return import_node_path.default.join(desktopHostsDir(), version);
148
146
  }
149
- function readActiveDesktopHost() {
150
- try {
151
- const value = import_node_fs.default.readFileSync(import_node_path.default.join(desktopHostsDir(), ACTIVE_RUNTIME_FILE), "utf8").trim();
152
- return value.length > 0 ? value : null;
153
- } catch {
154
- return null;
155
- }
156
- }
157
- function writeActiveDesktopHost(version) {
158
- import_node_fs.default.mkdirSync(desktopHostsDir(), { recursive: true });
159
- import_node_fs.default.writeFileSync(
160
- import_node_path.default.join(desktopHostsDir(), ACTIVE_RUNTIME_FILE),
161
- `${version}
162
- `,
163
- "utf8"
164
- );
165
- }
166
147
  function electronDir() {
167
148
  return import_node_path.default.join(rnxHomeDir(), "electron");
168
149
  }
@@ -648,7 +629,6 @@ function removeDevBridgeLockfile(owner) {
648
629
  isSootsimDevCheckout,
649
630
  playwrightCoreDir,
650
631
  profilesDir,
651
- readActiveDesktopHost,
652
632
  readActiveRuntime,
653
633
  readDaemonLockfile,
654
634
  readDefaultBox,
@@ -665,7 +645,6 @@ function removeDevBridgeLockfile(owner) {
665
645
  runtimeUpgradeNoticePath,
666
646
  runtimesDir,
667
647
  shouldSkipPersistentDaemon,
668
- writeActiveDesktopHost,
669
648
  writeActiveRuntime,
670
649
  writeDaemonLockfile,
671
650
  writeDefaultBox,
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.754 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.756 | (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;
@@ -77,6 +77,16 @@ var init_backend_origin = __esm({
77
77
  }
78
78
  });
79
79
 
80
+ // src/is-record.ts
81
+ function isRecord(value) {
82
+ return typeof value === "object" && value !== null && !Array.isArray(value);
83
+ }
84
+ var init_is_record = __esm({
85
+ "src/is-record.ts"() {
86
+ "use strict";
87
+ }
88
+ });
89
+
80
90
  // ../../node_modules/plist/lib/parse.js
81
91
  var require_parse = __commonJS({
82
92
  "../../node_modules/plist/lib/parse.js"(exports2) {
@@ -753,16 +763,6 @@ var init_public_brand = __esm({
753
763
  }
754
764
  });
755
765
 
756
- // src/is-record.ts
757
- function isRecord2(value) {
758
- return typeof value === "object" && value !== null && !Array.isArray(value);
759
- }
760
- var init_is_record = __esm({
761
- "src/is-record.ts"() {
762
- "use strict";
763
- }
764
- });
765
-
766
766
  // src/auth/shared-session.ts
767
767
  function sharedDesktopAuthAccounts(user) {
768
768
  return [
@@ -3032,7 +3032,8 @@ async function readOrInferModuleIdentity(bundle, mode, inferModuleIdentity) {
3032
3032
  }
3033
3033
  async function buildRnxCloudArtifact(bundle, options = {}) {
3034
3034
  const mode = options.mode ?? "production";
3035
- const firebase = (0, import_native_firebase_metadata.detachNativeFirebaseFooter)(bundle);
3035
+ const configured = (0, import_config2.detachPeachBundleConfigFooter)(bundle);
3036
+ const firebase = (0, import_native_firebase_metadata.detachNativeFirebaseFooter)(configured.source);
3036
3037
  const nativeIdentity = (0, import_native_app_identity.detachNativeAppIdentityFooter)(firebase.source);
3037
3038
  const identity = await readOrInferModuleIdentity(
3038
3039
  nativeIdentity.source,
@@ -3061,7 +3062,7 @@ async function buildRnxCloudArtifact(bundle, options = {}) {
3061
3062
  })
3062
3063
  ]);
3063
3064
  const body = pieces.map((piece) => piece.code).join("\n");
3064
- const code = body + (nativeIdentity.identity ? (0, import_native_app_identity.createNativeAppIdentityFooter)(nativeIdentity.identity) : "") + (firebase.config ? (0, import_native_firebase_metadata.createNativeFirebaseFooter)(firebase.config) : "") + (0, import_metro_production_bundle.createRNXMetroModuleIdentityFooter)({
3065
+ const code = body + (nativeIdentity.identity ? (0, import_native_app_identity.createNativeAppIdentityFooter)(nativeIdentity.identity) : "") + (firebase.config ? (0, import_native_firebase_metadata.createNativeFirebaseFooter)(firebase.config) : "") + (configured.configuredBundle ? (0, import_config2.createPeachBundleConfigFooter)(configured.configuredBundle) : "") + (0, import_metro_production_bundle.createRNXMetroModuleIdentityFooter)({
3065
3066
  version: identity.version,
3066
3067
  identitySource: identity.identitySource,
3067
3068
  modulePaths: identity.modulePaths,
@@ -3124,10 +3125,11 @@ async function buildRnxCloudArtifact(bundle, options = {}) {
3124
3125
  }
3125
3126
  };
3126
3127
  }
3127
- var import_metro_production_bundle, import_native_app_identity, import_native_firebase_metadata, import_terser, MODULE_PATHS_REQUIRED, SOURCE_MAP_REQUIRED, MINIFY_OPTIONS;
3128
+ var import_config2, import_metro_production_bundle, import_native_app_identity, import_native_firebase_metadata, import_terser, MODULE_PATHS_REQUIRED, SOURCE_MAP_REQUIRED, MINIFY_OPTIONS;
3128
3129
  var init_metroCloudArtifact = __esm({
3129
3130
  "../contrast-bundler/src/metroCloudArtifact.ts"() {
3130
3131
  "use strict";
3132
+ import_config2 = require("peachsim/config");
3131
3133
  import_metro_production_bundle = require("peachsim/metro-production-bundle");
3132
3134
  import_native_app_identity = require("peachsim/native-app-identity");
3133
3135
  import_native_firebase_metadata = require("peachsim/native-firebase-metadata");
@@ -4346,8 +4348,8 @@ function failureSentence(text) {
4346
4348
  } catch {
4347
4349
  return null;
4348
4350
  }
4349
- if (!isRecord2(parsed)) return null;
4350
- if (isRecord2(parsed.error) && typeof parsed.error.message === "string") {
4351
+ if (!isRecord(parsed)) return null;
4352
+ if (isRecord(parsed.error) && typeof parsed.error.message === "string") {
4351
4353
  const code = typeof parsed.error.code === "string" && parsed.error.code ? ` [${parsed.error.code}]` : "";
4352
4354
  return `${parsed.error.message}${code}`;
4353
4355
  }
@@ -4792,16 +4794,16 @@ async function produceArtifact(bundlePath, maxBytes, command, assetPolicy) {
4792
4794
  };
4793
4795
  }
4794
4796
  function readCreateResponse(value, expectedBytes, expectedSha256) {
4795
- if (!isRecord2(value)) throw new Error("remote simulator create returned invalid JSON");
4797
+ if (!isRecord(value)) throw new Error("remote simulator create returned invalid JSON");
4796
4798
  const artifactId = `sha256:${expectedSha256}`;
4797
- const isExpectedArtifact = (artifact) => isRecord2(artifact) && artifact.id === artifactId && typeof artifact.bytes === "number" && Number.isInteger(artifact.bytes) && artifact.bytes === expectedBytes;
4799
+ const isExpectedArtifact = (artifact) => isRecord(artifact) && artifact.id === artifactId && typeof artifact.bytes === "number" && Number.isInteger(artifact.bytes) && artifact.bytes === expectedBytes;
4798
4800
  const boxId = value.boxId;
4799
4801
  const boxToken = value.token;
4800
4802
  const simulator = value.simulator;
4801
- const simId = isRecord2(simulator) ? simulator.simId : null;
4802
- const claim = isRecord2(simulator) ? simulator.claim : null;
4803
- const simulatorToken = isRecord2(simulator) ? simulator.token : null;
4804
- if (typeof boxId !== "string" || !boxId || value.size !== "nano" || typeof boxToken !== "string" || !boxToken || !isExpectedArtifact(value.artifact) || !isRecord2(simulator) || typeof simId !== "string" || !simId || !isExpectedArtifact(simulator.artifact) || !isRecord2(claim) || typeof claim.id !== "string" || !claim.id || typeof claim.expiresAt !== "number" || typeof simulatorToken !== "string" || !simulatorToken) {
4803
+ const simId = isRecord(simulator) ? simulator.simId : null;
4804
+ const claim = isRecord(simulator) ? simulator.claim : null;
4805
+ const simulatorToken = isRecord(simulator) ? simulator.token : null;
4806
+ if (typeof boxId !== "string" || !boxId || value.size !== "nano" || typeof boxToken !== "string" || !boxToken || !isExpectedArtifact(value.artifact) || !isRecord(simulator) || typeof simId !== "string" || !simId || !isExpectedArtifact(simulator.artifact) || !isRecord(claim) || typeof claim.id !== "string" || !claim.id || typeof claim.expiresAt !== "number" || typeof simulatorToken !== "string" || !simulatorToken) {
4805
4807
  throw new Error("remote simulator create returned an invalid receipt");
4806
4808
  }
4807
4809
  return {
@@ -4947,8 +4949,8 @@ async function sendToBox(options) {
4947
4949
  simId: options.simId,
4948
4950
  code: '(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'
4949
4951
  });
4950
- const bundleUrl = isRecord2(captured) ? captured.bundleUrl : null;
4951
- if (!isRecord2(captured) || typeof bundleUrl !== "string" || !bundleUrl) {
4952
+ const bundleUrl = isRecord(captured) ? captured.bundleUrl : null;
4953
+ if (!isRecord(captured) || typeof bundleUrl !== "string" || !bundleUrl) {
4952
4954
  throw new Error(
4953
4955
  "send to box needs a simulator running an app: this one has no bundle loaded"
4954
4956
  );
@@ -4964,7 +4966,7 @@ async function sendToBox(options) {
4964
4966
  const storage = dumped;
4965
4967
  const created = await createCloudBox({
4966
4968
  bundlePath: toRNXProductionBundleUrl(bundleUrl),
4967
- device: options.device ?? cloudDevice(isRecord2(captured.deviceSpec) ? captured.deviceSpec.model : null),
4969
+ device: options.device ?? cloudDevice(isRecord(captured.deviceSpec) ? captured.deviceSpec.model : null),
4968
4970
  authorization: options.authorization,
4969
4971
  accountId: options.accountId,
4970
4972
  apiOrigin: options.apiOrigin,
@@ -5172,7 +5174,13 @@ async function terminateProcessGroup(child, signal = "SIGTERM", gracefulTimeoutM
5172
5174
  // scripts/dev-server-scanner.ts
5173
5175
  init_backend_origin();
5174
5176
 
5177
+ // ../contrast-runtime-delivery/src/version.ts
5178
+ function isValidRuntimeVersion(value) {
5179
+ return value.length <= 100 && /^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(value);
5180
+ }
5181
+
5175
5182
  // src/config.ts
5183
+ init_is_record();
5176
5184
  var PEACH_CONFIG_QUERY_PARAM = "peachConfig";
5177
5185
  function hasOwnKeys(value) {
5178
5186
  return !!value && Object.keys(value).length > 0;
@@ -5252,7 +5260,7 @@ var MAX_CHILD_DEPTH = 8;
5252
5260
  var MAX_PLIST_FILES = 32;
5253
5261
  var MAX_SPECIFIERS = 512;
5254
5262
  var settingsBundleCache = /* @__PURE__ */ new Map();
5255
- function isRecord(value) {
5263
+ function isRecord2(value) {
5256
5264
  return typeof value === "object" && value !== null && !Array.isArray(value);
5257
5265
  }
5258
5266
  function optionalString(value) {
@@ -5381,7 +5389,7 @@ async function parsePlistRecord(path20) {
5381
5389
  if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
5382
5390
  const source = await (0, import_promises.readFile)(path20, "utf8");
5383
5391
  const parsed = parsePlistSource(source);
5384
- return isRecord(parsed) ? parsed : null;
5392
+ return isRecord2(parsed) ? parsed : null;
5385
5393
  } catch {
5386
5394
  return null;
5387
5395
  }
@@ -5417,7 +5425,7 @@ function normalizeMultiValue(raw2, key, title) {
5417
5425
  };
5418
5426
  }
5419
5427
  async function normalizeSpecifier(raw2, context) {
5420
- if (!isRecord(raw2)) return null;
5428
+ if (!isRecord2(raw2)) return null;
5421
5429
  if (context.budget.specifiers >= MAX_SPECIFIERS) return null;
5422
5430
  const type = requiredString(raw2.Type);
5423
5431
  if (!type) return null;
@@ -6365,7 +6373,7 @@ function swiftDistributionHost(platform, arch) {
6365
6373
  }
6366
6374
  var isStrings = (value) => Array.isArray(value) && value.every((item) => typeof item === "string");
6367
6375
  function parseSwiftDistributionManifest(value) {
6368
- if (!isRecord2(value) || typeof value.id !== "string" || typeof value.release !== "string" || typeof value.wasmSdkId !== "string" || typeof value.wasmSdkUrl !== "string" || typeof value.wasmSdkChecksum !== "string" || !isStrings(value.modules) || !isStrings(value.objects) || !isStrings(value.link) || !isRecord2(value.files) || !Object.values(value.files).every((sha) => typeof sha === "string") || typeof value.host !== "string" || !isStrings(value.plugins)) {
6376
+ if (!isRecord(value) || typeof value.id !== "string" || typeof value.release !== "string" || typeof value.wasmSdkId !== "string" || typeof value.wasmSdkUrl !== "string" || typeof value.wasmSdkChecksum !== "string" || !isStrings(value.modules) || !isStrings(value.objects) || !isStrings(value.link) || !isRecord(value.files) || !Object.values(value.files).every((sha) => typeof sha === "string") || typeof value.host !== "string" || !isStrings(value.plugins)) {
6369
6377
  throw new Error(`invalid Swift distribution ${SWIFT_DISTRIBUTION_MANIFEST}`);
6370
6378
  }
6371
6379
  const host2 = SWIFT_DISTRIBUTION_HOSTS.find((candidate) => candidate === value.host);
@@ -6387,13 +6395,13 @@ function parseSwiftDistributionManifest(value) {
6387
6395
  };
6388
6396
  }
6389
6397
  function parseSwiftDistributionLock(value) {
6390
- if (!isRecord2(value) || typeof value.id !== "string" || !/^[a-f0-9]{16}$/.test(value.id) || typeof value.release !== "string" || typeof value.wasmSdkId !== "string" || typeof value.wasmSdkUrl !== "string" || typeof value.wasmSdkChecksum !== "string" || typeof value.source !== "string" || !isRecord2(value.hosts)) {
6398
+ if (!isRecord(value) || typeof value.id !== "string" || !/^[a-f0-9]{16}$/.test(value.id) || typeof value.release !== "string" || typeof value.wasmSdkId !== "string" || typeof value.wasmSdkUrl !== "string" || typeof value.wasmSdkChecksum !== "string" || typeof value.source !== "string" || !isRecord(value.hosts)) {
6391
6399
  throw new Error("invalid Swift distribution lock");
6392
6400
  }
6393
6401
  const hosts = value.hosts;
6394
6402
  const entry = (host2) => {
6395
6403
  const item = hosts[host2];
6396
- if (!isRecord2(item) || typeof item.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(item.sha256) || typeof item.size !== "number") {
6404
+ if (!isRecord(item) || typeof item.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(item.sha256) || typeof item.size !== "number") {
6397
6405
  throw new Error(`invalid Swift distribution lock entry for ${host2}`);
6398
6406
  }
6399
6407
  return { sha256: item.sha256, size: item.size };
@@ -6859,7 +6867,11 @@ var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
6859
6867
  DatadogCore: [],
6860
6868
  DatadogLogs: ["DatadogCore"],
6861
6869
  DatadogRUM: ["DatadogCore"],
6862
- DatadogTrace: ["DatadogCore"]
6870
+ DatadogTrace: ["DatadogCore"],
6871
+ AppLovinSDK: [],
6872
+ AppsFlyerLib: [],
6873
+ FBSDKCoreKit: [],
6874
+ FBAudienceNetwork: []
6863
6875
  };
6864
6876
  var OPTIONAL_FRAMEWORKS = new Set(Object.keys(OPTIONAL_FRAMEWORK_DEPENDENCIES));
6865
6877
  var SWIFT_IMPORT = /^\s*(?:@\w+(?:\([^)]*\))?\s+)*import\s+(?:(?:typealias|struct|class|enum|protocol|let|var|func)\s+)?([A-Za-z_][A-Za-z0-9_]*)/;
@@ -8033,9 +8045,6 @@ var import_promises3 = require("node:stream/promises");
8033
8045
  // ../contrast-runtime-delivery/src/product.ts
8034
8046
  var import_node_fs8 = __toESM(require("node:fs"), 1);
8035
8047
  var import_node_path8 = __toESM(require("node:path"), 1);
8036
- function isValidRuntimeVersion(value) {
8037
- return value.length <= 100 && /^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(value);
8038
- }
8039
8048
  function listInstalledRuntimes(product) {
8040
8049
  try {
8041
8050
  return import_node_fs8.default.readdirSync(product.runtimesDir(), { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort(compareSemver);
@@ -12188,9 +12197,9 @@ var AgentHost = class {
12188
12197
  if (sockets.has(sessionId)) {
12189
12198
  return { ok: true, refCount: this.subscriptions.get(sessionId)?.refCount ?? 1 };
12190
12199
  }
12191
- sockets.add(sessionId);
12192
12200
  const existing = this.subscriptions.get(sessionId);
12193
12201
  if (existing) {
12202
+ sockets.add(sessionId);
12194
12203
  existing.refCount++;
12195
12204
  return { ok: true, refCount: existing.refCount };
12196
12205
  }
@@ -12217,6 +12226,7 @@ var AgentHost = class {
12217
12226
  }
12218
12227
  }
12219
12228
  });
12229
+ sockets.add(sessionId);
12220
12230
  this.subscriptions.set(sessionId, { unsubscribe, refCount: 1 });
12221
12231
  return { ok: true, refCount: 1 };
12222
12232
  }
@@ -13571,6 +13581,7 @@ function compileReplacementModule(input) {
13571
13581
  return code.slice(token.start + 1, token.end - 1);
13572
13582
  };
13573
13583
  const bridgeNames = /* @__PURE__ */ new Map();
13584
+ const bareSpecifiers = /* @__PURE__ */ new Set();
13574
13585
  const declarations = [];
13575
13586
  let needsDefaultInterop = false;
13576
13587
  const bridgeFor = (specifier) => {
@@ -13671,6 +13682,7 @@ function compileReplacementModule(input) {
13671
13682
  if (specifier !== "react" && specifier !== "react-native" && !JSX_RUNTIME_SPECIFIERS.has(specifier) && !isPeachKitSpecifier(specifier) && !input.runtimePackages.has(specifier)) {
13672
13683
  throw unsupportedSpecifier(specifier);
13673
13684
  }
13685
+ bareSpecifiers.add(specifier);
13674
13686
  const bridge = bindings.length > 0 ? bridgeFor(specifier) : null;
13675
13687
  const replacement = bindings.map((binding) => {
13676
13688
  if (binding.imported === null) return `const ${binding.local} = ${bridge};`;
@@ -13693,6 +13705,7 @@ function compileReplacementModule(input) {
13693
13705
  const preamble = declarations.join(" ");
13694
13706
  return {
13695
13707
  code: preamble ? `${preamble} ${out}` : out,
13708
+ bareSpecifiers: [...bareSpecifiers],
13696
13709
  sourceMap: { ...sourceMap, sourcesContent: [input.source] }
13697
13710
  };
13698
13711
  }
@@ -13716,7 +13729,7 @@ function sendJavaScript(req, res, source) {
13716
13729
  });
13717
13730
  res.end(req.method === "HEAD" ? void 0 : source);
13718
13731
  }
13719
- function resolveLocalImport(fromFile, specifier) {
13732
+ function resolveReplacementModuleFile(fromFile, specifier) {
13720
13733
  const base = import_node_path23.default.resolve(import_node_path23.default.dirname(fromFile), specifier);
13721
13734
  const candidates = [
13722
13735
  ...REPLACEMENT_MODULE_EXTENSIONS.some(
@@ -13830,7 +13843,10 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
13830
13843
  // so the token, cache key and runtime packages carry over.
13831
13844
  localModuleUrl: (specifier) => {
13832
13845
  const local = new URL(url.href);
13833
- local.searchParams.set("path", resolveLocalImport(targetPath, specifier));
13846
+ local.searchParams.set(
13847
+ "path",
13848
+ resolveReplacementModuleFile(targetPath, specifier)
13849
+ );
13834
13850
  return `${local.pathname}${local.search}`;
13835
13851
  }
13836
13852
  });
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.754 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.756 | (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;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.754 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.756 | (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 __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.754 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.756 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/host/fetch-proxy-overrides.ts
4
4
  var FETCH_PROXY_NATIVE_USER_AGENT_HEADER = "x-sootsim-native-user-agent";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.754 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.756 | (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;
@@ -34,7 +34,8 @@ var replacement_module_handler_exports = {};
34
34
  __export(replacement_module_handler_exports, {
35
35
  REPLACEMENT_MODULE_ROUTE: () => REPLACEMENT_MODULE_ROUTE,
36
36
  handleReplacementModuleRequest: () => handleReplacementModuleRequest,
37
- isReplacementModuleRequestUrl: () => isReplacementModuleRequestUrl
37
+ isReplacementModuleRequestUrl: () => isReplacementModuleRequestUrl,
38
+ resolveReplacementModuleFile: () => resolveReplacementModuleFile
38
39
  });
39
40
  module.exports = __toCommonJS(replacement_module_handler_exports);
40
41
  var import_node_fs = require("node:fs");
@@ -218,6 +219,7 @@ function compileReplacementModule(input) {
218
219
  return code.slice(token.start + 1, token.end - 1);
219
220
  };
220
221
  const bridgeNames = /* @__PURE__ */ new Map();
222
+ const bareSpecifiers = /* @__PURE__ */ new Set();
221
223
  const declarations = [];
222
224
  let needsDefaultInterop = false;
223
225
  const bridgeFor = (specifier) => {
@@ -318,6 +320,7 @@ function compileReplacementModule(input) {
318
320
  if (specifier !== "react" && specifier !== "react-native" && !JSX_RUNTIME_SPECIFIERS.has(specifier) && !isPeachKitSpecifier(specifier) && !input.runtimePackages.has(specifier)) {
319
321
  throw unsupportedSpecifier(specifier);
320
322
  }
323
+ bareSpecifiers.add(specifier);
321
324
  const bridge = bindings.length > 0 ? bridgeFor(specifier) : null;
322
325
  const replacement = bindings.map((binding) => {
323
326
  if (binding.imported === null) return `const ${binding.local} = ${bridge};`;
@@ -340,6 +343,7 @@ function compileReplacementModule(input) {
340
343
  const preamble = declarations.join(" ");
341
344
  return {
342
345
  code: preamble ? `${preamble} ${out}` : out,
346
+ bareSpecifiers: [...bareSpecifiers],
343
347
  sourceMap: { ...sourceMap, sourcesContent: [input.source] }
344
348
  };
345
349
  }
@@ -371,7 +375,7 @@ function sendJavaScript(req, res, source) {
371
375
  });
372
376
  res.end(req.method === "HEAD" ? void 0 : source);
373
377
  }
374
- function resolveLocalImport(fromFile, specifier) {
378
+ function resolveReplacementModuleFile(fromFile, specifier) {
375
379
  const base = import_node_path.default.resolve(import_node_path.default.dirname(fromFile), specifier);
376
380
  const candidates = [
377
381
  ...REPLACEMENT_MODULE_EXTENSIONS.some(
@@ -485,7 +489,10 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
485
489
  // so the token, cache key and runtime packages carry over.
486
490
  localModuleUrl: (specifier) => {
487
491
  const local = new URL(url.href);
488
- local.searchParams.set("path", resolveLocalImport(targetPath, specifier));
492
+ local.searchParams.set(
493
+ "path",
494
+ resolveReplacementModuleFile(targetPath, specifier)
495
+ );
489
496
  return `${local.pathname}${local.search}`;
490
497
  }
491
498
  });
@@ -508,5 +515,6 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
508
515
  0 && (module.exports = {
509
516
  REPLACEMENT_MODULE_ROUTE,
510
517
  handleReplacementModuleRequest,
511
- isReplacementModuleRequestUrl
518
+ isReplacementModuleRequestUrl,
519
+ resolveReplacementModuleFile
512
520
  });
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.754 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.756 | (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 __defProp = Object.defineProperty;