peachsim 0.1.673 → 0.1.674

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 (71) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/agent-identity.cjs +1 -1
  4. package/dist-lib/agent-sessions.cjs +1 -1
  5. package/dist-lib/attached-projects.cjs +1 -1
  6. package/dist-lib/auth/shared-session.cjs +1 -1
  7. package/dist-lib/backend-origin.cjs +1 -1
  8. package/dist-lib/beta.cjs +1 -1
  9. package/dist-lib/beta.mjs +1 -1
  10. package/dist-lib/bridge-constants.cjs +1 -1
  11. package/dist-lib/bridge-contract-input.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.mjs +1 -1
  13. package/dist-lib/bridge-contract.cjs +1 -1
  14. package/dist-lib/bridge-contract.mjs +1 -1
  15. package/dist-lib/capture-contract.cjs +1 -1
  16. package/dist-lib/capture-contract.mjs +1 -1
  17. package/dist-lib/cli-constants.cjs +1 -1
  18. package/dist-lib/cloud-contract.cjs +1 -1
  19. package/dist-lib/cloud-contract.mjs +1 -1
  20. package/dist-lib/cloud-test-args.cjs +1 -1
  21. package/dist-lib/cloud-test-args.mjs +1 -1
  22. package/dist-lib/cloud.cjs +1 -1
  23. package/dist-lib/cloud.mjs +1 -1
  24. package/dist-lib/config.cjs +1 -1
  25. package/dist-lib/detox/index.cjs +1 -1
  26. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  27. package/dist-lib/home-paths.cjs +1 -1
  28. package/dist-lib/host/bridge-host.cjs +257 -236
  29. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  30. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  31. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  32. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  33. package/dist-lib/host/websocket-proxy.cjs +1 -1
  34. package/dist-lib/index.cjs +1 -1
  35. package/dist-lib/jump-to-source-babel.cjs +1 -1
  36. package/dist-lib/jump-to-source-native.cjs +1 -1
  37. package/dist-lib/kotlin-host.cjs +1 -1
  38. package/dist-lib/menu.cjs +1 -1
  39. package/dist-lib/menu.mjs +1 -1
  40. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  41. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  42. package/dist-lib/metro-production-bundle.cjs +1 -1
  43. package/dist-lib/metro-production-bundle.mjs +1 -1
  44. package/dist-lib/metro.cjs +1 -1
  45. package/dist-lib/native-app-identity.cjs +1 -1
  46. package/dist-lib/native-app-identity.mjs +1 -1
  47. package/dist-lib/native-firebase-metadata.cjs +1 -1
  48. package/dist-lib/native-firebase-metadata.mjs +1 -1
  49. package/dist-lib/plist.cjs +1 -1
  50. package/dist-lib/plist.mjs +1 -1
  51. package/dist-lib/profiles.cjs +1 -1
  52. package/dist-lib/public-brand.cjs +1 -1
  53. package/dist-lib/react-native-host-modules.cjs +1 -1
  54. package/dist-lib/react-native-host-modules.mjs +1 -1
  55. package/dist-lib/render-mode.cjs +1 -1
  56. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  57. package/dist-lib/sdk.cjs +1 -1
  58. package/dist-lib/sdk.mjs +1 -1
  59. package/dist-lib/skills.cjs +434 -406
  60. package/dist-lib/swift-compile.cjs +21 -7
  61. package/dist-lib/swift-compile.mjs +21 -7
  62. package/dist-lib/swift-package.cjs +1 -1
  63. package/dist-lib/swift-package.mjs +1 -1
  64. package/dist-lib/swift-submit.cjs +1 -1
  65. package/dist-lib/swift-submit.mjs +1 -1
  66. package/dist-lib/swift.cjs +1 -1
  67. package/dist-lib/vite-swift.cjs +109 -88
  68. package/dist-lib/vite.cjs +1 -1
  69. package/package.json +1 -1
  70. package/src/swift-compile.ts +31 -10
  71. package/src/swift-host.ts +2 -4
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.673 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.674 | (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;
@@ -19487,9 +19487,9 @@ function safeChildPlistName(value) {
19487
19487
  name: file.toLowerCase().endsWith(".plist") ? file : `${file}.plist`
19488
19488
  };
19489
19489
  }
19490
- async function readableSettingsBundle(path28) {
19490
+ async function readableSettingsBundle(path29) {
19491
19491
  try {
19492
- const root = await (0, import_promises.stat)((0, import_node_path.join)(path28, "Root.plist"));
19492
+ const root = await (0, import_promises.stat)((0, import_node_path.join)(path29, "Root.plist"));
19493
19493
  return root.isFile() && root.size <= MAX_PLIST_BYTES;
19494
19494
  } catch {
19495
19495
  return false;
@@ -19534,11 +19534,11 @@ async function settingsBundleFingerprint(bundlePath) {
19534
19534
  return null;
19535
19535
  }
19536
19536
  }
19537
- async function parsePlistRecord(path28) {
19537
+ async function parsePlistRecord(path29) {
19538
19538
  try {
19539
- const metadata = await (0, import_promises.stat)(path28);
19539
+ const metadata = await (0, import_promises.stat)(path29);
19540
19540
  if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
19541
- const source = await (0, import_promises.readFile)(path28, "utf8");
19541
+ const source = await (0, import_promises.readFile)(path29, "utf8");
19542
19542
  const parsed = parsePlistSource(source);
19543
19543
  return isRecord2(parsed) ? parsed : null;
19544
19544
  } catch {
@@ -19862,7 +19862,7 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
19862
19862
  return null;
19863
19863
  }
19864
19864
  }
19865
- function httpGet(hostname, port, path28, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
19865
+ function httpGet(hostname, port, path29, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
19866
19866
  return new Promise((resolve10) => {
19867
19867
  let settled = false;
19868
19868
  let killing = false;
@@ -19871,7 +19871,7 @@ function httpGet(hostname, port, path28, method = "GET", timeout = TIMEOUT_MS, h
19871
19871
  settled = true;
19872
19872
  resolve10(value);
19873
19873
  };
19874
- const req = import_http.default.request({ hostname, port, path: path28, method, headers }, (res) => {
19874
+ const req = import_http.default.request({ hostname, port, path: path29, method, headers }, (res) => {
19875
19875
  let body = "";
19876
19876
  res.on("data", (c) => body += c.toString());
19877
19877
  const contentType = (() => {
@@ -21166,6 +21166,22 @@ var init_internal_child = __esm({
21166
21166
  }
21167
21167
  });
21168
21168
 
21169
+ // ../../src/compile/swiftToolchain.ts
21170
+ function swiftToolchainBin(release) {
21171
+ return process.platform === "darwin" ? import_node_path6.default.join(
21172
+ import_node_os2.default.homedir(),
21173
+ `Library/Developer/Toolchains/${release}.xctoolchain/usr/bin`
21174
+ ) : import_node_path6.default.join(process.env.CONTRAST_SWIFT_TOOLCHAINS ?? "/opt/swift", release, "usr/bin");
21175
+ }
21176
+ var import_node_os2, import_node_path6;
21177
+ var init_swiftToolchain = __esm({
21178
+ "../../src/compile/swiftToolchain.ts"() {
21179
+ "use strict";
21180
+ import_node_os2 = __toESM(require("node:os"), 1);
21181
+ import_node_path6 = __toESM(require("node:path"), 1);
21182
+ }
21183
+ });
21184
+
21169
21185
  // ../sootsim-swift/src/bundleAssets.ts
21170
21186
  function extOf(file) {
21171
21187
  const dot = file.lastIndexOf(".");
@@ -21187,8 +21203,8 @@ function pickImagesetFile(images) {
21187
21203
  scale: pick.scale === "2x" ? 2 : pick.scale === "3x" ? 3 : 1
21188
21204
  };
21189
21205
  }
21190
- function flatScale(path28) {
21191
- const match = /@([23])x\.[^./]+$/.exec(path28);
21206
+ function flatScale(path29) {
21207
+ const match = /@([23])x\.[^./]+$/.exec(path29);
21192
21208
  return match ? Number(match[1]) : 1;
21193
21209
  }
21194
21210
  function providesNamespace(text) {
@@ -21215,13 +21231,13 @@ function catalogEntryName(contentsPath, kind, readText2) {
21215
21231
  }
21216
21232
  return segments.join("/");
21217
21233
  }
21218
- function isFlatResourceImage(path28) {
21219
- return path28.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path28));
21234
+ function isFlatResourceImage(path29) {
21235
+ return path29.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path29));
21220
21236
  }
21221
21237
  function enumerateBundleImages(paths, readText2) {
21222
21238
  const table = [];
21223
21239
  const seen = /* @__PURE__ */ new Set();
21224
- const catalogs = paths.filter((path28) => baseOf(path28) === "Contents.json");
21240
+ const catalogs = paths.filter((path29) => baseOf(path29) === "Contents.json");
21225
21241
  for (const contentsPath of catalogs) {
21226
21242
  const name2 = catalogEntryName(contentsPath, ".imageset", readText2);
21227
21243
  if (name2 === null || seen.has(name2)) continue;
@@ -21242,12 +21258,12 @@ function enumerateBundleImages(paths, readText2) {
21242
21258
  seen.add(name2);
21243
21259
  table.push({ name: name2, file: `${dir}/${pick.filename}`, scale: pick.scale });
21244
21260
  }
21245
- for (const path28 of paths) {
21246
- if (!isFlatResourceImage(path28)) continue;
21247
- const name2 = baseOf(path28).slice(0, -extOf(path28).length);
21261
+ for (const path29 of paths) {
21262
+ if (!isFlatResourceImage(path29)) continue;
21263
+ const name2 = baseOf(path29).slice(0, -extOf(path29).length);
21248
21264
  if (name2 === "" || seen.has(name2)) continue;
21249
21265
  seen.add(name2);
21250
- table.push({ name: name2, file: path28, scale: flatScale(path28) });
21266
+ table.push({ name: name2, file: path29, scale: flatScale(path29) });
21251
21267
  }
21252
21268
  return table;
21253
21269
  }
@@ -21276,7 +21292,7 @@ function colorsetValue(color) {
21276
21292
  }
21277
21293
  function enumerateBundleColors(paths, readText2) {
21278
21294
  const table = {};
21279
- for (const contentsPath of paths.filter((path28) => baseOf(path28) === "Contents.json")) {
21295
+ for (const contentsPath of paths.filter((path29) => baseOf(path29) === "Contents.json")) {
21280
21296
  const name2 = catalogEntryName(contentsPath, ".colorset", readText2);
21281
21297
  if (name2 === null || name2 in table) continue;
21282
21298
  let colors;
@@ -21340,8 +21356,8 @@ function axisExtremes(points) {
21340
21356
  function pathBounds(d) {
21341
21357
  const xs = [];
21342
21358
  const ys = [];
21343
- for (const path28 of d)
21344
- (0, import_svgpath.default)(path28).abs().unshort().unarc().iterate((segment, _index, x, y) => {
21359
+ for (const path29 of d)
21360
+ (0, import_svgpath.default)(path29).abs().unshort().unarc().iterate((segment, _index, x, y) => {
21345
21361
  const [command, ...args] = segment;
21346
21362
  if (command === "M" || command === "L") {
21347
21363
  xs.push(Number(args[0]));
@@ -21368,7 +21384,7 @@ function guide(svg, id, axis) {
21368
21384
  }
21369
21385
  function enumerateBundleSymbols(paths, readText2) {
21370
21386
  const table = {};
21371
- for (const contentsPath of paths.filter((path28) => baseOf(path28) === "Contents.json")) {
21387
+ for (const contentsPath of paths.filter((path29) => baseOf(path29) === "Contents.json")) {
21372
21388
  const name2 = catalogEntryName(contentsPath, ".symbolset", readText2);
21373
21389
  if (name2 === null || name2 in table) continue;
21374
21390
  let symbols;
@@ -21401,8 +21417,8 @@ function enumerateBundleSymbols(paths, readText2) {
21401
21417
  viewBox: "0 0 24 24",
21402
21418
  advance,
21403
21419
  box: [12 - advance / 2, 12 - tall / 2, advance, tall],
21404
- layers: d.map((path28) => ({
21405
- d: (0, import_svgpath.default)(path28).abs().scale(scale).translate(translateX, translateY).round(3).toString()
21420
+ layers: d.map((path29) => ({
21421
+ d: (0, import_svgpath.default)(path29).abs().scale(scale).translate(translateX, translateY).round(3).toString()
21406
21422
  }))
21407
21423
  };
21408
21424
  }
@@ -21412,7 +21428,7 @@ function enumerateBundleJson(paths) {
21412
21428
  const found = [];
21413
21429
  const seen = /* @__PURE__ */ new Set();
21414
21430
  const ordered = [...paths].filter(
21415
- (path28) => path28.split("/").includes("Resources") && path28.split("/").every((segment) => segment !== "" && segment !== "..") && (extOf(path28) === ".json" || extOf(path28) === ".xcstrings")
21431
+ (path29) => path29.split("/").includes("Resources") && path29.split("/").every((segment) => segment !== "" && segment !== "..") && (extOf(path29) === ".json" || extOf(path29) === ".xcstrings")
21416
21432
  ).sort((a, b) => {
21417
21433
  const aDepth = a.split("/").length;
21418
21434
  const bDepth = b.split("/").length;
@@ -21455,14 +21471,14 @@ function sharedDesktopAuthAccounts(user) {
21455
21471
  function getBaseDir() {
21456
21472
  const explicit = process.env[SESSION_FILE_ENV];
21457
21473
  if (explicit?.trim()) {
21458
- return (0, import_node_path6.dirname)((0, import_node_path6.resolve)(explicit));
21474
+ return (0, import_node_path7.dirname)((0, import_node_path7.resolve)(explicit));
21459
21475
  }
21460
21476
  return electronUserDataDir();
21461
21477
  }
21462
21478
  function getSharedDesktopAuthFilePath() {
21463
21479
  const explicit = process.env[SESSION_FILE_ENV];
21464
- if (explicit?.trim()) return (0, import_node_path6.resolve)(explicit);
21465
- return (0, import_node_path6.join)(getBaseDir(), "desktop-auth.json");
21480
+ if (explicit?.trim()) return (0, import_node_path7.resolve)(explicit);
21481
+ return (0, import_node_path7.join)(getBaseDir(), "desktop-auth.json");
21466
21482
  }
21467
21483
  function normalizeUser(input) {
21468
21484
  if (!input || typeof input !== "object") return null;
@@ -21526,12 +21542,12 @@ function readSharedDesktopAuthSession() {
21526
21542
  return null;
21527
21543
  }
21528
21544
  }
21529
- var import_node_fs6, import_node_path6, SESSION_VERSION, SESSION_FILE_ENV, DEFAULT_ORIGIN;
21545
+ var import_node_fs6, import_node_path7, SESSION_VERSION, SESSION_FILE_ENV, DEFAULT_ORIGIN;
21530
21546
  var init_shared_session = __esm({
21531
21547
  "src/auth/shared-session.ts"() {
21532
21548
  "use strict";
21533
21549
  import_node_fs6 = require("node:fs");
21534
- import_node_path6 = require("node:path");
21550
+ import_node_path7 = require("node:path");
21535
21551
  init_home_paths();
21536
21552
  SESSION_VERSION = 1;
21537
21553
  SESSION_FILE_ENV = "SOOTSIM_SHARED_AUTH_FILE";
@@ -21701,7 +21717,7 @@ function swiftIcuAsset(toolchainBin, release) {
21701
21717
  });
21702
21718
  }
21703
21719
  async function load(toolchainBin, release) {
21704
- const { stdout } = await run(import_node_path7.default.join(toolchainBin, "swift"), [
21720
+ const { stdout } = await run(import_node_path8.default.join(toolchainBin, "swift"), [
21705
21721
  "sdk",
21706
21722
  "configure",
21707
21723
  "--show-configuration",
@@ -21711,7 +21727,7 @@ async function load(toolchainBin, release) {
21711
21727
  const resources = /^swiftStaticResourcesPath: (.+)$/m.exec(stdout)?.[1]?.trim();
21712
21728
  if (!resources) throw new Error(`swift-icu: ${release}_wasm names no static resources`);
21713
21729
  return Buffer.from(
21714
- icuSegment(archiveMember((0, import_node_fs7.readFileSync)(import_node_path7.default.join(resources, ARCHIVE)), MEMBER))
21730
+ icuSegment(archiveMember((0, import_node_fs7.readFileSync)(import_node_path8.default.join(resources, ARCHIVE)), MEMBER))
21715
21731
  );
21716
21732
  }
21717
21733
  function archiveMember(archive, name2) {
@@ -21765,14 +21781,14 @@ function icuSegment(object) {
21765
21781
  throw new Error(`swift-icu: expected one icu data segment, found ${found.length}`);
21766
21782
  return found[0];
21767
21783
  }
21768
- var import_node_child_process3, import_node_crypto2, import_node_fs7, import_node_path7, import_node_util, import_node_zlib, run, deflate, ARCHIVE, MEMBER, raw, assets;
21784
+ var import_node_child_process3, import_node_crypto2, import_node_fs7, import_node_path8, import_node_util, import_node_zlib, run, deflate, ARCHIVE, MEMBER, raw, assets;
21769
21785
  var init_swift_icu = __esm({
21770
21786
  "src/swift-icu.ts"() {
21771
21787
  "use strict";
21772
21788
  import_node_child_process3 = require("node:child_process");
21773
21789
  import_node_crypto2 = require("node:crypto");
21774
21790
  import_node_fs7 = require("node:fs");
21775
- import_node_path7 = __toESM(require("node:path"), 1);
21791
+ import_node_path8 = __toESM(require("node:path"), 1);
21776
21792
  import_node_util = require("node:util");
21777
21793
  import_node_zlib = require("node:zlib");
21778
21794
  run = (0, import_node_util.promisify)(import_node_child_process3.execFile);
@@ -21858,7 +21874,7 @@ function swiftModuleInputFiles(root) {
21858
21874
  "toolchain.json"
21859
21875
  ];
21860
21876
  const walk = (dir) => {
21861
- for (const entry of (0, import_node_fs8.readdirSync)(import_node_path8.default.join(root, dir), { withFileTypes: true })) {
21877
+ for (const entry of (0, import_node_fs8.readdirSync)(import_node_path9.default.join(root, dir), { withFileTypes: true })) {
21862
21878
  const relative2 = `${dir}/${entry.name}`;
21863
21879
  if (entry.isDirectory()) walk(relative2);
21864
21880
  else if (/\.(swift|c|h)$/.test(entry.name)) files.push(relative2);
@@ -21868,16 +21884,16 @@ function swiftModuleInputFiles(root) {
21868
21884
  return files.sort();
21869
21885
  }
21870
21886
  async function ensureMacroPlugins(moduleRoot, toolchainBin) {
21871
- const dir = import_node_path8.default.join(moduleRoot, ".build/host/RnxPreviewMacros");
21887
+ const dir = import_node_path9.default.join(moduleRoot, ".build/host/RnxPreviewMacros");
21872
21888
  const ext = process.platform === "darwin" ? "dylib" : "so";
21873
21889
  const plugins = [
21874
21890
  {
21875
- library: import_node_path8.default.join(dir, `libRnxPreviewMacros.${ext}`),
21876
- source: import_node_path8.default.join(moduleRoot, "Sources/RnxPreviewMacros/PreviewMacro.swift")
21891
+ library: import_node_path9.default.join(dir, `libRnxPreviewMacros.${ext}`),
21892
+ source: import_node_path9.default.join(moduleRoot, "Sources/RnxPreviewMacros/PreviewMacro.swift")
21877
21893
  },
21878
21894
  {
21879
- library: import_node_path8.default.join(dir, `libFoundationMacros.${ext}`),
21880
- source: import_node_path8.default.join(moduleRoot, "Sources/FoundationMacros/PredicateMacro.swift")
21895
+ library: import_node_path9.default.join(dir, `libFoundationMacros.${ext}`),
21896
+ source: import_node_path9.default.join(moduleRoot, "Sources/FoundationMacros/PredicateMacro.swift")
21881
21897
  }
21882
21898
  ];
21883
21899
  const stale = plugins.some(
@@ -21885,7 +21901,7 @@ async function ensureMacroPlugins(moduleRoot, toolchainBin) {
21885
21901
  );
21886
21902
  if (stale) {
21887
21903
  await run2("sh", [
21888
- import_node_path8.default.join(moduleRoot, "scripts/build-preview-plugin.sh"),
21904
+ import_node_path9.default.join(moduleRoot, "scripts/build-preview-plugin.sh"),
21889
21905
  toolchainBin,
21890
21906
  plugins[0].library
21891
21907
  ]);
@@ -21896,7 +21912,7 @@ function linkedModuleDigest(root) {
21896
21912
  const files = swiftModuleInputFiles(root);
21897
21913
  const stampHash = (0, import_node_crypto3.createHash)("sha256");
21898
21914
  for (const file of files) {
21899
- const stat2 = (0, import_node_fs8.statSync)(import_node_path8.default.join(root, file), { bigint: true });
21915
+ const stat2 = (0, import_node_fs8.statSync)(import_node_path9.default.join(root, file), { bigint: true });
21900
21916
  stampHash.update(file);
21901
21917
  stampHash.update(
21902
21918
  `${stat2.dev}:${stat2.ino}:${stat2.size}:${stat2.mtimeNs}:${stat2.ctimeNs}
@@ -21910,7 +21926,7 @@ function linkedModuleDigest(root) {
21910
21926
  for (const file of files) {
21911
21927
  hash.update((0, import_node_crypto3.createHash)("sha256").update(file).digest());
21912
21928
  hash.update(
21913
- (0, import_node_crypto3.createHash)("sha256").update((0, import_node_fs8.readFileSync)(import_node_path8.default.join(root, file))).digest()
21929
+ (0, import_node_crypto3.createHash)("sha256").update((0, import_node_fs8.readFileSync)(import_node_path9.default.join(root, file))).digest()
21914
21930
  );
21915
21931
  }
21916
21932
  const digest = hash.digest();
@@ -21931,7 +21947,7 @@ function withNativeSourceGlue(input, glue) {
21931
21947
  ...input,
21932
21948
  files: {
21933
21949
  ...input.files,
21934
- [import_node_path8.default.posix.join(targetPath, "OneNativeSource.generated.swift")]: glue
21950
+ [import_node_path9.default.posix.join(targetPath, "OneNativeSource.generated.swift")]: glue
21935
21951
  },
21936
21952
  oneModule: true
21937
21953
  };
@@ -21956,7 +21972,7 @@ function swiftSiblingDependencies(files, targets) {
21956
21972
  }
21957
21973
  function swiftArtifactHash(input, release, moduleRoot) {
21958
21974
  const hash = (0, import_node_crypto3.createHash)("sha256");
21959
- hash.update(`swift-compile/v6
21975
+ hash.update(`swift-compile/v7
21960
21976
  ${release}
21961
21977
  `);
21962
21978
  if (input.oneModule) hash.update("one-module\n");
@@ -22043,7 +22059,7 @@ function syncSwiftTree(base, files) {
22043
22059
  (0, import_node_fs8.mkdirSync)(base, { recursive: true });
22044
22060
  const walk = (dir) => {
22045
22061
  for (const entry of (0, import_node_fs8.readdirSync)(dir, { withFileTypes: true })) {
22046
- const full = import_node_path8.default.join(dir, entry.name);
22062
+ const full = import_node_path9.default.join(dir, entry.name);
22047
22063
  if (dir === base && entry.name === ".build") continue;
22048
22064
  if (entry.isDirectory()) walk(full);
22049
22065
  else if (!files.has(full)) (0, import_node_fs8.rmSync)(full, { force: true });
@@ -22052,7 +22068,7 @@ function syncSwiftTree(base, files) {
22052
22068
  walk(base);
22053
22069
  for (const [full, contents] of files) {
22054
22070
  if ((0, import_node_fs8.existsSync)(full) && (0, import_node_fs8.readFileSync)(full, "utf8") === contents) continue;
22055
- (0, import_node_fs8.mkdirSync)(import_node_path8.default.dirname(full), { recursive: true });
22071
+ (0, import_node_fs8.mkdirSync)(import_node_path9.default.dirname(full), { recursive: true });
22056
22072
  (0, import_node_fs8.writeFileSync)(full, contents, "utf8");
22057
22073
  }
22058
22074
  }
@@ -22069,6 +22085,17 @@ function swiftSourceAsIOS(source) {
22069
22085
  let copied = 0;
22070
22086
  for (const at of tokens) {
22071
22087
  const rest = conditioned.slice(at, at + 400);
22088
+ const imported = /^import\s+CoreImage\.CIFilterBuiltins\b/.exec(rest);
22089
+ if (imported) {
22090
+ out += conditioned.slice(copied, at) + "import CoreImage".padEnd(imported[0].length);
22091
+ copied = at + imported[0].length;
22092
+ continue;
22093
+ }
22094
+ if (/^NSClassFromString\b/.test(rest)) {
22095
+ out += conditioned.slice(copied, at) + "_peachClassFromString";
22096
+ copied = at + "NSClassFromString".length;
22097
+ continue;
22098
+ }
22072
22099
  if (rest.startsWith("class")) {
22073
22100
  const modifiers = conditioned.slice(conditioned.lastIndexOf("\n", at - 1) + 1, at);
22074
22101
  if (DELEGATE_CLASS.test(rest) && !/\b(?:final|open)\b/.test(modifiers)) {
@@ -22169,12 +22196,15 @@ function swiftCodeScan(source) {
22169
22196
  if (top.parens === 0 && stack.length > 1) stack.pop();
22170
22197
  else top.parens--;
22171
22198
  i++;
22172
- } else if (source.startsWith("class", i) && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + 5] ?? "")) {
22173
- tokens.push(i);
22174
- i += 5;
22175
22199
  } else {
22176
- if (char === "@") tokens.push(i);
22177
- i++;
22200
+ const keyword = source.startsWith("class", i) ? "class" : source.startsWith("import", i) ? "import" : source.startsWith("NSClassFromString", i) ? "NSClassFromString" : null;
22201
+ if (keyword && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + keyword.length] ?? "")) {
22202
+ tokens.push(i);
22203
+ i += keyword.length;
22204
+ } else {
22205
+ if (char === "@") tokens.push(i);
22206
+ i++;
22207
+ }
22178
22208
  }
22179
22209
  }
22180
22210
  return { lineStarts: starts, tokens };
@@ -22188,10 +22218,10 @@ function writeSwiftProject(layout, input, moduleRoot) {
22188
22218
  if (targets.length === 0) {
22189
22219
  for (const [file, contents] of Object.entries(input.files)) {
22190
22220
  if (file === "Package.swift") continue;
22191
- files.set(import_node_path8.default.join(layout.sources, file), compiledSource(file, contents));
22221
+ files.set(import_node_path9.default.join(layout.sources, file), compiledSource(file, contents));
22192
22222
  }
22193
22223
  let manifest = (0, import_node_fs8.readFileSync)(
22194
- import_node_path8.default.join(moduleRoot, "scripts/contrast-app-Package.swift"),
22224
+ import_node_path9.default.join(moduleRoot, "scripts/contrast-app-Package.swift"),
22195
22225
  "utf8"
22196
22226
  ).replaceAll("__SOOTSIM_SWIFT_PACKAGE__", moduleRoot);
22197
22227
  if (input.oneModule) {
@@ -22205,16 +22235,16 @@ function writeSwiftProject(layout, input, moduleRoot) {
22205
22235
  manifest = manifest.replace(product, `${product}
22206
22236
  ${ONE_PRODUCT},`).replace(flags, `${flags}${ONE_IMPLICIT_FLAGS}`);
22207
22237
  }
22208
- files.set(import_node_path8.default.join(layout.root, "Package.swift"), manifest + moduleFiles);
22238
+ files.set(import_node_path9.default.join(layout.root, "Package.swift"), manifest + moduleFiles);
22209
22239
  } else {
22210
22240
  for (const [file, contents] of Object.entries(input.files)) {
22211
22241
  if (file === "Package.swift") continue;
22212
- files.set(import_node_path8.default.join(layout.root, file), compiledSource(file, contents));
22242
+ files.set(import_node_path9.default.join(layout.root, file), compiledSource(file, contents));
22213
22243
  }
22214
22244
  for (const target of targets) {
22215
22245
  if (!target.resources) continue;
22216
22246
  files.set(
22217
- import_node_path8.default.join(layout.root, target.path, "ResourceBundleAccessor.generated.swift"),
22247
+ import_node_path9.default.join(layout.root, target.path, "ResourceBundleAccessor.generated.swift"),
22218
22248
  [
22219
22249
  "import Foundation",
22220
22250
  "",
@@ -22226,7 +22256,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
22226
22256
  );
22227
22257
  }
22228
22258
  files.set(
22229
- import_node_path8.default.join(layout.root, "Package.swift"),
22259
+ import_node_path9.default.join(layout.root, "Package.swift"),
22230
22260
  emitSwiftPackageManifest({
22231
22261
  targets,
22232
22262
  siblings: swiftSiblingDependencies(input.files, targets),
@@ -22253,13 +22283,13 @@ function outputOf(error) {
22253
22283
  return error instanceof Error ? error.message : String(error);
22254
22284
  }
22255
22285
  function builtArtifact(layout) {
22256
- const binDir = import_node_path8.default.join(layout.root, ".build", WASM_TRIPLE, "release");
22257
- const manifest = (0, import_node_fs8.readFileSync)(import_node_path8.default.join(layout.root, "Package.swift"), "utf8");
22286
+ const binDir = import_node_path9.default.join(layout.root, ".build", WASM_TRIPLE, "release");
22287
+ const manifest = (0, import_node_fs8.readFileSync)(import_node_path9.default.join(layout.root, "Package.swift"), "utf8");
22258
22288
  const executable = swiftManifestTargets(manifest).find((target) => target.executable);
22259
22289
  if (executable === void 0) {
22260
22290
  throw new Error("swift-compile: the written manifest names no executable target");
22261
22291
  }
22262
- const file = import_node_path8.default.join(binDir, `${executable.name}.wasm`);
22292
+ const file = import_node_path9.default.join(binDir, `${executable.name}.wasm`);
22263
22293
  if (!(0, import_node_fs8.existsSync)(file)) {
22264
22294
  const found = (0, import_node_fs8.existsSync)(binDir) ? (0, import_node_fs8.readdirSync)(binDir).filter((name2) => name2.endsWith(".wasm")).sort() : [];
22265
22295
  throw new Error(
@@ -22270,7 +22300,7 @@ function builtArtifact(layout) {
22270
22300
  }
22271
22301
  function projectDiagnostic(output, layout) {
22272
22302
  const base = layout.multi ? layout.root : layout.sources;
22273
- const prefix = `${base}${import_node_path8.default.sep}`;
22303
+ const prefix = `${base}${import_node_path9.default.sep}`;
22274
22304
  return output.split("\n").map((line) => line.startsWith(prefix) ? line.slice(prefix.length) : line).join("\n").trim();
22275
22305
  }
22276
22306
  function serialize(root, work) {
@@ -22286,16 +22316,16 @@ function serialize(root, work) {
22286
22316
  function compileSwiftProjectUnit(input, options) {
22287
22317
  (0, import_node_fs8.mkdirSync)(options.buildRoot, { recursive: true });
22288
22318
  const root = (0, import_node_fs8.realpathSync)(options.buildRoot);
22289
- const moduleRoot = import_node_path8.default.resolve(options.moduleRoot);
22319
+ const moduleRoot = import_node_path9.default.resolve(options.moduleRoot);
22290
22320
  const layout = {
22291
22321
  root,
22292
- sources: import_node_path8.default.join(root, "Sources", "App"),
22322
+ sources: import_node_path9.default.join(root, "Sources", "App"),
22293
22323
  multi: compileTargets(input).length > 0
22294
22324
  };
22295
22325
  const hash = swiftArtifactHash(input, options.release, moduleRoot);
22296
22326
  return serialize(root, async () => {
22297
22327
  writeSwiftProject(layout, input, moduleRoot);
22298
- const swift = import_node_path8.default.join(options.toolchainBin, "swift");
22328
+ const swift = import_node_path9.default.join(options.toolchainBin, "swift");
22299
22329
  if (!(0, import_node_fs8.existsSync)(swift)) {
22300
22330
  throw new Error(
22301
22331
  `swift-compile: no swift.org toolchain at ${options.toolchainBin}; install ${options.release} and its matching wasm sdk`
@@ -22337,21 +22367,21 @@ function compileSwiftProjectUnit(input, options) {
22337
22367
  };
22338
22368
  });
22339
22369
  }
22340
- var import_node_child_process4, import_node_crypto3, import_node_fs8, import_node_os2, import_node_path8, import_node_util2, run2, WASM_TRIPLE, cores, BUILD_ENV, BUILD_JOBS, linkedModuleDigests, ONE_PRODUCT, OBJC_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, MULTI_MANIFEST_VERSION, DIRECTIVE, OS_IOS, OBJC_ATTRIBUTE, SELECTOR, DELEGATE_CLASS, compiledSource, ROOT_LOCKS, host, rootLocks;
22370
+ var import_node_child_process4, import_node_crypto3, import_node_fs8, import_node_os3, import_node_path9, import_node_util2, run2, WASM_TRIPLE, cores, BUILD_ENV, BUILD_JOBS, linkedModuleDigests, ONE_PRODUCT, OBJC_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, MULTI_MANIFEST_VERSION, DIRECTIVE, OS_IOS, OBJC_ATTRIBUTE, SELECTOR, DELEGATE_CLASS, compiledSource, ROOT_LOCKS, host, rootLocks;
22341
22371
  var init_swift_compile = __esm({
22342
22372
  "src/swift-compile.ts"() {
22343
22373
  "use strict";
22344
22374
  import_node_child_process4 = require("node:child_process");
22345
22375
  import_node_crypto3 = require("node:crypto");
22346
22376
  import_node_fs8 = require("node:fs");
22347
- import_node_os2 = __toESM(require("node:os"), 1);
22348
- import_node_path8 = __toESM(require("node:path"), 1);
22377
+ import_node_os3 = __toESM(require("node:os"), 1);
22378
+ import_node_path9 = __toESM(require("node:path"), 1);
22349
22379
  import_node_util2 = require("node:util");
22350
22380
  init_swift_icu();
22351
22381
  init_swift_package();
22352
22382
  run2 = (0, import_node_util2.promisify)(import_node_child_process4.execFile);
22353
22383
  WASM_TRIPLE = "wasm32-unknown-wasip1";
22354
- cores = import_node_os2.default.availableParallelism();
22384
+ cores = import_node_os3.default.availableParallelism();
22355
22385
  BUILD_ENV = { ...process.env, BINARYEN_CORES: String(Math.min(4, cores)) };
22356
22386
  BUILD_JOBS = String(Math.max(1, Math.floor(cores / 2)));
22357
22387
  linkedModuleDigests = /* @__PURE__ */ new Map();
@@ -22505,17 +22535,17 @@ var init_swift_submit = __esm({
22505
22535
 
22506
22536
  // src/swift-host.ts
22507
22537
  function swiftPackageId(packagePath) {
22508
- return import_node_path9.default.basename(packagePath).replace(/[^A-Za-z0-9_]/g, "_").replace(/^(\d)/, "_$1");
22538
+ return import_node_path10.default.basename(packagePath).replace(/[^A-Za-z0-9_]/g, "_").replace(/^(\d)/, "_$1");
22509
22539
  }
22510
22540
  function nativeSourceDescriptor(packagePath) {
22511
22541
  packagePath = import_node_fs9.default.realpathSync(packagePath);
22512
- const file = import_node_path9.default.join(packagePath, NATIVE_DESCRIPTOR);
22542
+ const file = import_node_path10.default.join(packagePath, NATIVE_DESCRIPTOR);
22513
22543
  if (!import_node_fs9.default.existsSync(file)) return null;
22514
22544
  const value = JSON.parse(
22515
22545
  readPackageFile(packagePath, file, MAX_SWIFT_COMPILE_SOURCE_BYTES).toString("utf8")
22516
22546
  );
22517
22547
  const invalid = () => new Error(`${file}: invalid One native source descriptor; run one typegen`);
22518
- if (!value || typeof value !== "object" || Reflect.get(value, "generatedBy") !== "one typegen" || !import_node_fs9.default.existsSync(import_node_path9.default.join(packagePath, NATIVE_GLUE))) {
22548
+ if (!value || typeof value !== "object" || Reflect.get(value, "generatedBy") !== "one typegen" || !import_node_fs9.default.existsSync(import_node_path10.default.join(packagePath, NATIVE_GLUE))) {
22519
22549
  throw invalid();
22520
22550
  }
22521
22551
  if (!isSwiftNativeModules(value) || value.packageId !== swiftPackageId(packagePath)) {
@@ -22551,15 +22581,15 @@ function packageFiles(root) {
22551
22581
  for (const entry of import_node_fs9.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
22552
22582
  if (entry.name.startsWith(".") && entry.name !== NATIVE_DESCRIPTOR && entry.name !== NATIVE_GLUE || SKIP_SOURCE_DIRS.has(entry.name))
22553
22583
  continue;
22554
- const full = import_node_path9.default.join(dir, entry.name);
22584
+ const full = import_node_path10.default.join(dir, entry.name);
22555
22585
  if (entry.isSymbolicLink()) throw new Error(`swift input is a symlink: ${full}`);
22556
22586
  const real = import_node_fs9.default.realpathSync(full);
22557
- const relative2 = import_node_path9.default.relative(canonicalRoot, real);
22558
- if (relative2.startsWith(`..${import_node_path9.default.sep}`) || relative2 === ".." || import_node_path9.default.isAbsolute(relative2)) {
22587
+ const relative2 = import_node_path10.default.relative(canonicalRoot, real);
22588
+ if (relative2.startsWith(`..${import_node_path10.default.sep}`) || relative2 === ".." || import_node_path10.default.isAbsolute(relative2)) {
22559
22589
  throw new Error(`swift input escapes the selected package: ${full}`);
22560
22590
  }
22561
22591
  if (entry.isDirectory()) {
22562
- if (import_node_fs9.default.existsSync(import_node_path9.default.join(full, "Package.swift"))) continue;
22592
+ if (import_node_fs9.default.existsSync(import_node_path10.default.join(full, "Package.swift"))) continue;
22563
22593
  walk(full);
22564
22594
  } else if (entry.isFile()) {
22565
22595
  found.push(full);
@@ -22572,16 +22602,16 @@ function packageFiles(root) {
22572
22602
  }
22573
22603
  function readPackageFile(root, file, maxBytes) {
22574
22604
  const canonicalRoot = import_node_fs9.default.realpathSync(root);
22575
- const relative2 = import_node_path9.default.relative(canonicalRoot, import_node_fs9.default.realpathSync(file));
22576
- if (relative2 === ".." || relative2.startsWith(`..${import_node_path9.default.sep}`) || import_node_path9.default.isAbsolute(relative2)) {
22605
+ const relative2 = import_node_path10.default.relative(canonicalRoot, import_node_fs9.default.realpathSync(file));
22606
+ if (relative2 === ".." || relative2.startsWith(`..${import_node_path10.default.sep}`) || import_node_path10.default.isAbsolute(relative2)) {
22577
22607
  throw new Error(`swift input escapes the selected package: ${file}`);
22578
22608
  }
22579
- let ancestor = import_node_path9.default.resolve(file);
22609
+ let ancestor = import_node_path10.default.resolve(file);
22580
22610
  while (ancestor !== canonicalRoot) {
22581
22611
  if (import_node_fs9.default.lstatSync(ancestor).isSymbolicLink()) {
22582
22612
  throw new Error(`swift input is a symlink: ${ancestor}`);
22583
22613
  }
22584
- const parent = import_node_path9.default.dirname(ancestor);
22614
+ const parent = import_node_path10.default.dirname(ancestor);
22585
22615
  if (parent === ancestor)
22586
22616
  throw new Error(`swift input escapes the selected package: ${file}`);
22587
22617
  ancestor = parent;
@@ -22624,7 +22654,7 @@ function resourceCandidateFiles(root) {
22624
22654
  function buildSwiftResourceTable(project, baseUrl) {
22625
22655
  const absolute = resourceCandidateFiles(project.packagePath);
22626
22656
  const relative2 = absolute.map(
22627
- (file) => import_node_path9.default.relative(project.packagePath, file).split(import_node_path9.default.sep).join(import_node_path9.default.posix.sep)
22657
+ (file) => import_node_path10.default.relative(project.packagePath, file).split(import_node_path10.default.sep).join(import_node_path10.default.posix.sep)
22628
22658
  );
22629
22659
  const byRelative = new Map(absolute.map((file, index) => [relative2[index], file]));
22630
22660
  const readContents = (candidate) => {
@@ -22658,10 +22688,10 @@ function buildSwiftResourceTable(project, baseUrl) {
22658
22688
  );
22659
22689
  imageBytes += bytes.length;
22660
22690
  const hash = (0, import_node_crypto4.createHash)("sha256").update(bytes).digest("hex").slice(0, 16);
22661
- const ext = import_node_path9.default.posix.extname(file).toLowerCase();
22691
+ const ext = import_node_path10.default.posix.extname(file).toLowerCase();
22662
22692
  table[name2] = { uri: `${baseUrl}${RESOURCE_PATH}${hash}${ext}`, scale };
22663
22693
  images[name2] = {
22664
- file: import_node_path9.default.posix.basename(file),
22694
+ file: import_node_path10.default.posix.basename(file),
22665
22695
  data: bytes.toString("base64")
22666
22696
  };
22667
22697
  watched.push(file);
@@ -22687,14 +22717,14 @@ function buildSwiftResourceTable(project, baseUrl) {
22687
22717
  function buildSwiftBundleFiles(packagePath) {
22688
22718
  packagePath = import_node_fs9.default.realpathSync(packagePath);
22689
22719
  const relative2 = resourceCandidateFiles(packagePath).map(
22690
- (file) => import_node_path9.default.relative(packagePath, file).split(import_node_path9.default.sep).join(import_node_path9.default.posix.sep)
22720
+ (file) => import_node_path10.default.relative(packagePath, file).split(import_node_path10.default.sep).join(import_node_path10.default.posix.sep)
22691
22721
  );
22692
22722
  const files = {};
22693
22723
  const watched = [];
22694
22724
  let total = 0;
22695
22725
  for (const { base, file } of enumerateBundleJson(relative2)) {
22696
22726
  watched.push(file);
22697
- const disk = import_node_path9.default.join(packagePath, ...file.split("/"));
22727
+ const disk = import_node_path10.default.join(packagePath, ...file.split("/"));
22698
22728
  if (Object.keys(files).length >= BUNDLE_MAX_FILES || total + import_node_fs9.default.statSync(disk).size > BUNDLE_MAX_TOTAL_BYTES) {
22699
22729
  throw new Error(
22700
22730
  `swift bundle pack exceeds ${BUNDLE_MAX_FILES} files / ${BUNDLE_MAX_TOTAL_BYTES} bytes`
@@ -22715,7 +22745,7 @@ function linkedModuleRoots(packagePath) {
22715
22745
  try {
22716
22746
  manifest = readPackageFile(
22717
22747
  packagePath,
22718
- import_node_path9.default.join(packagePath, "Package.swift"),
22748
+ import_node_path10.default.join(packagePath, "Package.swift"),
22719
22749
  MAX_SWIFT_COMPILE_SOURCE_BYTES
22720
22750
  ).toString("utf8");
22721
22751
  } catch {
@@ -22724,8 +22754,8 @@ function linkedModuleRoots(packagePath) {
22724
22754
  const roots = /* @__PURE__ */ new Set();
22725
22755
  const dependency = /\.package\(\s*path:\s*"([^"]+)"\s*\)/g;
22726
22756
  for (const match of manifest.replace(/^\s*\/\/.*$/gm, "").matchAll(dependency)) {
22727
- const root = import_node_path9.default.resolve(packagePath, match[1]);
22728
- if (import_node_fs9.default.existsSync(import_node_path9.default.join(root, "Package.swift"))) roots.add(root);
22757
+ const root = import_node_path10.default.resolve(packagePath, match[1]);
22758
+ if (import_node_fs9.default.existsSync(import_node_path10.default.join(root, "Package.swift"))) roots.add(root);
22729
22759
  }
22730
22760
  return [...roots].sort();
22731
22761
  }
@@ -22734,18 +22764,18 @@ function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
22734
22764
  hash.update(packagePath);
22735
22765
  const projectInputs = new Set(packageFiles(packagePath));
22736
22766
  for (const file of [...projectInputs].sort()) {
22737
- hash.update(import_node_path9.default.relative(packagePath, file));
22767
+ hash.update(import_node_path10.default.relative(packagePath, file));
22738
22768
  const stat2 = import_node_fs9.default.statSync(file);
22739
22769
  hash.update(`${stat2.mtimeMs}/${stat2.ctimeMs}/${stat2.size}`);
22740
22770
  }
22741
22771
  const moduleRoot = hosted ? void 0 : moduleRootOverride ?? linkedModuleRoots(packagePath).find(
22742
- (root) => import_node_fs9.default.existsSync(import_node_path9.default.join(root, "toolchain.json"))
22772
+ (root) => import_node_fs9.default.existsSync(import_node_path10.default.join(root, "toolchain.json"))
22743
22773
  );
22744
22774
  if (moduleRoot) {
22745
22775
  hash.update(moduleRoot);
22746
22776
  for (const relative2 of swiftModuleInputFiles(moduleRoot)) {
22747
22777
  hash.update(relative2);
22748
- hash.update(String(import_node_fs9.default.statSync(import_node_path9.default.join(moduleRoot, relative2)).mtimeMs));
22778
+ hash.update(String(import_node_fs9.default.statSync(import_node_path10.default.join(moduleRoot, relative2)).mtimeMs));
22749
22779
  }
22750
22780
  }
22751
22781
  return hash.digest("hex").slice(0, 16);
@@ -22763,7 +22793,7 @@ function packageSources(packagePath) {
22763
22793
  throw new Error("swift source byte cap exceeded");
22764
22794
  const files = {};
22765
22795
  for (const file of sources) {
22766
- const relative2 = import_node_path9.default.relative(packagePath, file).split(import_node_path9.default.sep).join(import_node_path9.default.posix.sep);
22796
+ const relative2 = import_node_path10.default.relative(packagePath, file).split(import_node_path10.default.sep).join(import_node_path10.default.posix.sep);
22767
22797
  files[relative2] = readPackageFile(
22768
22798
  packagePath,
22769
22799
  file,
@@ -22783,7 +22813,7 @@ function packageSnapshot(project) {
22783
22813
  ...native ? {
22784
22814
  glue: readPackageFile(
22785
22815
  project.packagePath,
22786
- import_node_path9.default.join(project.packagePath, NATIVE_GLUE),
22816
+ import_node_path10.default.join(project.packagePath, NATIVE_GLUE),
22787
22817
  MAX_SWIFT_COMPILE_SOURCE_BYTES
22788
22818
  ).toString("utf8")
22789
22819
  } : {}
@@ -22818,7 +22848,7 @@ async function compile(packagePath, entry, stamp, moduleRootOverride, hosted, sn
22818
22848
  package: content
22819
22849
  };
22820
22850
  const moduleRoot = moduleRootOverride ?? linkedModuleRoots(packagePath).find(
22821
- (root) => import_node_fs9.default.existsSync(import_node_path9.default.join(root, "toolchain.json"))
22851
+ (root) => import_node_fs9.default.existsSync(import_node_path10.default.join(root, "toolchain.json"))
22822
22852
  );
22823
22853
  if (!moduleRoot)
22824
22854
  return {
@@ -22837,10 +22867,10 @@ async function compile(packagePath, entry, stamp, moduleRootOverride, hosted, sn
22837
22867
  // server and a capture, or two checkouts) build each other's sources. so
22838
22868
  // each app and module checkout gets its own root, which keeps the same
22839
22869
  // app's incremental build across restarts.
22840
- buildRoot: process.env.CONTRAST_SWIFT_BUILD_ROOT ?? import_node_path9.default.join(
22841
- import_node_os3.default.tmpdir(),
22870
+ buildRoot: process.env.CONTRAST_SWIFT_BUILD_ROOT ?? import_node_path10.default.join(
22871
+ import_node_os4.default.tmpdir(),
22842
22872
  "contrast-swift-build",
22843
- (0, import_node_crypto4.createHash)("sha256").update(`${moduleRoot}\0${import_node_path9.default.resolve(packagePath)}`).digest("hex").slice(0, 16)
22873
+ (0, import_node_crypto4.createHash)("sha256").update(`${moduleRoot}\0${import_node_path10.default.resolve(packagePath)}`).digest("hex").slice(0, 16)
22844
22874
  ),
22845
22875
  moduleRoot,
22846
22876
  ...toolchain
@@ -22848,24 +22878,21 @@ async function compile(packagePath, entry, stamp, moduleRootOverride, hosted, sn
22848
22878
  return { ...artifact, stamp, package: content };
22849
22879
  }
22850
22880
  function localSwiftToolchain(moduleRoot) {
22851
- const manifest = import_node_path9.default.join(moduleRoot, "toolchain.json");
22881
+ const manifest = import_node_path10.default.join(moduleRoot, "toolchain.json");
22852
22882
  if (!import_node_fs9.default.existsSync(manifest)) return null;
22853
22883
  const toolchain = JSON.parse(import_node_fs9.default.readFileSync(manifest, "utf8"));
22854
22884
  const release = toolchain && typeof toolchain === "object" ? Reflect.get(toolchain, "release") : void 0;
22855
22885
  if (typeof release !== "string") {
22856
22886
  throw new Error(`swift toolchain manifest at ${moduleRoot} has no release`);
22857
22887
  }
22858
- const toolchainBin = import_node_path9.default.join(
22859
- import_node_os3.default.homedir(),
22860
- `Library/Developer/Toolchains/${release}.xctoolchain/usr/bin`
22861
- );
22862
- return import_node_fs9.default.existsSync(import_node_path9.default.join(toolchainBin, "swift")) ? { release, toolchainBin } : null;
22888
+ const toolchainBin = swiftToolchainBin(release);
22889
+ return import_node_fs9.default.existsSync(import_node_path10.default.join(toolchainBin, "swift")) ? { release, toolchainBin } : null;
22863
22890
  }
22864
22891
  async function compileRemote(packagePath, entry, snapshot, hosted) {
22865
22892
  const auth = hosted ? null : resolveCliAuth();
22866
22893
  if (!hosted && (!auth || auth.kind === "github")) {
22867
22894
  throw new Error(
22868
- `compiling ${import_node_path9.default.basename(packagePath)} for Peach needs \`peach login\` or PEACH_API_KEY: this peachsim has no local SwiftUI module, so Contrast compiles it`
22895
+ `compiling ${import_node_path10.default.basename(packagePath)} for Peach needs \`peach login\` or PEACH_API_KEY: this peachsim has no local SwiftUI module, so Contrast compiles it`
22869
22896
  );
22870
22897
  }
22871
22898
  const origin = hosted?.origin ?? resolveContrastBackendOrigin(auth?.kind === "session" ? auth.origin : null);
@@ -22895,7 +22922,7 @@ async function compileRemote(packagePath, entry, snapshot, hosted) {
22895
22922
  );
22896
22923
  if (descriptor && address.native?.hash !== descriptor.hash) {
22897
22924
  throw new Error(
22898
- `${import_node_path9.default.basename(packagePath)}: Contrast compiled native contract ${address.native?.hash ?? "none"} but one typegen wrote ${descriptor.hash}; the app's One and the compile host's differ, or the compile host is older than this peachsim`
22925
+ `${import_node_path10.default.basename(packagePath)}: Contrast compiled native contract ${address.native?.hash ?? "none"} but one typegen wrote ${descriptor.hash}; the app's One and the compile host's differ, or the compile host is older than this peachsim`
22899
22926
  );
22900
22927
  }
22901
22928
  const response = await fetch(address.url, { signal });
@@ -23012,14 +23039,15 @@ function serveSwiftPackageAsset(pathname, res) {
23012
23039
  res.end("swift artifact is stale");
23013
23040
  return true;
23014
23041
  }
23015
- var import_node_crypto4, import_node_fs9, import_node_os3, import_node_path9, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SKIP_SOURCE_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, projects, RESOURCE_CONTENT_TYPES, BUNDLE_MAX_FILES, BUNDLE_MAX_FILE_BYTES, BUNDLE_MAX_TOTAL_BYTES;
23042
+ var import_node_crypto4, import_node_fs9, import_node_os4, import_node_path10, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SKIP_SOURCE_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, projects, RESOURCE_CONTENT_TYPES, BUNDLE_MAX_FILES, BUNDLE_MAX_FILE_BYTES, BUNDLE_MAX_TOTAL_BYTES;
23016
23043
  var init_swift_host = __esm({
23017
23044
  "src/swift-host.ts"() {
23018
23045
  "use strict";
23019
23046
  import_node_crypto4 = require("node:crypto");
23020
23047
  import_node_fs9 = __toESM(require("node:fs"), 1);
23021
- import_node_os3 = __toESM(require("node:os"), 1);
23022
- import_node_path9 = __toESM(require("node:path"), 1);
23048
+ import_node_os4 = __toESM(require("node:os"), 1);
23049
+ import_node_path10 = __toESM(require("node:path"), 1);
23050
+ init_swiftToolchain();
23023
23051
  init_bundleAssets();
23024
23052
  init_auth();
23025
23053
  init_backend_origin();
@@ -23058,7 +23086,7 @@ var init_swift_host = __esm({
23058
23086
  // src/expo-swift-host.ts
23059
23087
  async function collectExpoSwiftSources(appRoot) {
23060
23088
  appRoot = import_node_fs10.default.realpathSync(appRoot);
23061
- const appRequire = (0, import_node_module.createRequire)(import_node_path10.default.join(appRoot, "package.json"));
23089
+ const appRequire = (0, import_node_module.createRequire)(import_node_path11.default.join(appRoot, "package.json"));
23062
23090
  let autolinker;
23063
23091
  try {
23064
23092
  autolinker = appRequire.resolve("expo-modules-autolinking/package.json");
@@ -23070,7 +23098,7 @@ async function collectExpoSwiftSources(appRoot) {
23070
23098
  const { stdout } = await run3(
23071
23099
  process.execPath,
23072
23100
  [
23073
- import_node_path10.default.join(import_node_path10.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
23101
+ import_node_path11.default.join(import_node_path11.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
23074
23102
  "search",
23075
23103
  "--platform",
23076
23104
  "apple",
@@ -23086,7 +23114,7 @@ async function collectExpoSwiftSources(appRoot) {
23086
23114
  const { stdout: resolvedText } = await run3(
23087
23115
  process.execPath,
23088
23116
  [
23089
- import_node_path10.default.join(import_node_path10.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
23117
+ import_node_path11.default.join(import_node_path11.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
23090
23118
  "resolve",
23091
23119
  "--platform",
23092
23120
  "apple",
@@ -23110,7 +23138,7 @@ async function collectExpoSwiftSources(appRoot) {
23110
23138
  if (typeof sourceRoot !== "string")
23111
23139
  throw new Error("Expo autolinking entry has no path");
23112
23140
  const canonical = import_node_fs10.default.realpathSync(sourceRoot);
23113
- if (canonical.split(import_node_path10.default.sep).includes("node_modules")) continue;
23141
+ if (canonical.split(import_node_path11.default.sep).includes("node_modules")) continue;
23114
23142
  const resolution = resolutions.find(
23115
23143
  (candidate) => candidate && typeof candidate === "object" && Reflect.get(candidate, "packageName") === Reflect.get(entry, "name")
23116
23144
  );
@@ -23134,12 +23162,12 @@ async function collectExpoSwiftSources(appRoot) {
23134
23162
  `(${className.includes(".") ? className : `${namespace}.${className}`}.self, ${name2 === null ? "nil" : JSON.stringify(name2)})`
23135
23163
  );
23136
23164
  }
23137
- const ios = import_node_path10.default.join(canonical, "ios");
23165
+ const ios = import_node_path11.default.join(canonical, "ios");
23138
23166
  if (import_node_fs10.default.lstatSync(ios).isSymbolicLink())
23139
23167
  throw new Error(`Expo Swift source directory is a symlink: ${ios}`);
23140
23168
  const walk = (dir) => {
23141
23169
  for (const child of import_node_fs10.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
23142
- const file = import_node_path10.default.join(dir, child.name);
23170
+ const file = import_node_path11.default.join(dir, child.name);
23143
23171
  if (child.isSymbolicLink())
23144
23172
  throw new Error(`Expo Swift source is a symlink: ${file}`);
23145
23173
  if (child.isDirectory()) {
@@ -23151,7 +23179,7 @@ async function collectExpoSwiftSources(appRoot) {
23151
23179
  bytes += size;
23152
23180
  if (Object.keys(files).length + 1 > MAX_SWIFT_COMPILE_FILES - 2 || bytes > MAX_SWIFT_COMPILE_SOURCE_BYTES)
23153
23181
  throw new Error("Expo Swift sources exceed compile service caps");
23154
- files[`Sources/${namespace}/${import_node_path10.default.relative(ios, file).split(import_node_path10.default.sep).join("/")}`] = `#sourceLocation(file: ${JSON.stringify(file)}, line: 1)
23182
+ files[`Sources/${namespace}/${import_node_path11.default.relative(ios, file).split(import_node_path11.default.sep).join("/")}`] = `#sourceLocation(file: ${JSON.stringify(file)}, line: 1)
23155
23183
  ${import_node_fs10.default.readFileSync(file, "utf8")}`;
23156
23184
  }
23157
23185
  };
@@ -23201,7 +23229,7 @@ async function handleExpoSwiftRequest(req, res) {
23201
23229
  return true;
23202
23230
  }
23203
23231
  const root = url.searchParams.get("root");
23204
- if (!root || !import_node_path10.default.isAbsolute(root)) {
23232
+ if (!root || !import_node_path11.default.isAbsolute(root)) {
23205
23233
  res.writeHead(400);
23206
23234
  res.end("missing absolute app root");
23207
23235
  return true;
@@ -23212,16 +23240,16 @@ async function handleExpoSwiftRequest(req, res) {
23212
23240
  pending = (async () => {
23213
23241
  const files = await collectExpoSwiftSources(root);
23214
23242
  if (!files) return null;
23215
- const moduleRoot = import_node_path10.default.resolve(import_meta2.dirname, "../../sootsim-swift");
23243
+ const moduleRoot = import_node_path11.default.resolve(import_meta2.dirname, "../../sootsim-swift");
23216
23244
  if (!localSwiftToolchain(moduleRoot)) return null;
23217
23245
  const key = (0, import_node_crypto5.createHash)("sha256").update(import_node_fs10.default.realpathSync(root)).digest("hex");
23218
- const packagePath = import_node_path10.default.join(import_node_os4.default.tmpdir(), "peach-expo-swift", key);
23219
- const sources = import_node_path10.default.join(packagePath, "Sources");
23246
+ const packagePath = import_node_path11.default.join(import_node_os5.default.tmpdir(), "peach-expo-swift", key);
23247
+ const sources = import_node_path11.default.join(packagePath, "Sources");
23220
23248
  import_node_fs10.default.rmSync(sources, { recursive: true, force: true });
23221
23249
  import_node_fs10.default.mkdirSync(sources, { recursive: true });
23222
23250
  for (const [name2, content] of Object.entries(files)) {
23223
- const target = import_node_path10.default.join(packagePath, name2);
23224
- import_node_fs10.default.mkdirSync(import_node_path10.default.dirname(target), { recursive: true });
23251
+ const target = import_node_path11.default.join(packagePath, name2);
23252
+ import_node_fs10.default.mkdirSync(import_node_path11.default.dirname(target), { recursive: true });
23225
23253
  import_node_fs10.default.writeFileSync(target, content);
23226
23254
  }
23227
23255
  const artifact = await artifactFor(
@@ -23255,7 +23283,7 @@ async function handleExpoSwiftRequest(req, res) {
23255
23283
  }
23256
23284
  return true;
23257
23285
  }
23258
- var import_node_child_process5, import_node_crypto5, import_node_fs10, import_node_module, import_node_os4, import_node_path10, import_node_util3, import_meta2, run3, scriptEnv, EXPO_SWIFT_ROUTE, EXPO_SWIFT_ENTRY, compiling;
23286
+ var import_node_child_process5, import_node_crypto5, import_node_fs10, import_node_module, import_node_os5, import_node_path11, import_node_util3, import_meta2, run3, scriptEnv, EXPO_SWIFT_ROUTE, EXPO_SWIFT_ENTRY, compiling;
23259
23287
  var init_expo_swift_host = __esm({
23260
23288
  "src/expo-swift-host.ts"() {
23261
23289
  "use strict";
@@ -23263,8 +23291,8 @@ var init_expo_swift_host = __esm({
23263
23291
  import_node_crypto5 = require("node:crypto");
23264
23292
  import_node_fs10 = __toESM(require("node:fs"), 1);
23265
23293
  import_node_module = require("node:module");
23266
- import_node_os4 = __toESM(require("node:os"), 1);
23267
- import_node_path10 = __toESM(require("node:path"), 1);
23294
+ import_node_os5 = __toESM(require("node:os"), 1);
23295
+ import_node_path11 = __toESM(require("node:path"), 1);
23268
23296
  import_node_util3 = require("node:util");
23269
23297
  init_internal_child();
23270
23298
  init_backend_origin();
@@ -23291,7 +23319,7 @@ function listInstalledRuntimes(product) {
23291
23319
  }
23292
23320
  }
23293
23321
  function runtimeTarballCacheName(product, version) {
23294
- return import_node_path11.default.posix.basename(product.tarballPath(version));
23322
+ return import_node_path12.default.posix.basename(product.tarballPath(version));
23295
23323
  }
23296
23324
  function compareSemver(a, b) {
23297
23325
  const parse2 = (v) => {
@@ -23314,12 +23342,12 @@ function compareSemver(a, b) {
23314
23342
  if (!bp) return -1;
23315
23343
  return ap < bp ? -1 : 1;
23316
23344
  }
23317
- var import_node_fs11, import_node_path11;
23345
+ var import_node_fs11, import_node_path12;
23318
23346
  var init_product = __esm({
23319
23347
  "../contrast-runtime-delivery/src/product.ts"() {
23320
23348
  "use strict";
23321
23349
  import_node_fs11 = __toESM(require("node:fs"), 1);
23322
- import_node_path11 = __toESM(require("node:path"), 1);
23350
+ import_node_path12 = __toESM(require("node:path"), 1);
23323
23351
  }
23324
23352
  });
23325
23353
 
@@ -23401,7 +23429,7 @@ function createRuntimeDelivery(product) {
23401
23429
  const setActive = opts.setActive !== false;
23402
23430
  const protectVersions = [version, ...opts.protectVersions ?? []];
23403
23431
  pruneLocalRetention({ protectVersions });
23404
- if (!opts.force && import_node_fs12.default.existsSync(import_node_path12.default.join(destDir, product.installedMarker))) {
23432
+ if (!opts.force && import_node_fs12.default.existsSync(import_node_path13.default.join(destDir, product.installedMarker))) {
23405
23433
  if (setActive) product.writeActiveRuntime(version);
23406
23434
  pruneLocalRetention({ protectVersions });
23407
23435
  return {
@@ -23445,7 +23473,7 @@ function createRuntimeDelivery(product) {
23445
23473
  if (pin) {
23446
23474
  const activeVersion2 = product.readActiveRuntime();
23447
23475
  const pinInstalled = import_node_fs12.default.existsSync(
23448
- import_node_path12.default.join(product.runtimeDir(pin), product.installedMarker)
23476
+ import_node_path13.default.join(product.runtimeDir(pin), product.installedMarker)
23449
23477
  );
23450
23478
  if (activeVersion2 === pin && pinInstalled) {
23451
23479
  return {
@@ -23494,7 +23522,7 @@ function createRuntimeDelivery(product) {
23494
23522
  }
23495
23523
  const activeVersion = product.readActiveRuntime();
23496
23524
  const activeDir = activeVersion ? product.runtimeDir(activeVersion) : null;
23497
- const activeInstalled = activeDir ? import_node_fs12.default.existsSync(import_node_path12.default.join(activeDir, product.installedMarker)) : false;
23525
+ const activeInstalled = activeDir ? import_node_fs12.default.existsSync(import_node_path13.default.join(activeDir, product.installedMarker)) : false;
23498
23526
  const shouldInstall = !activeVersion || !activeInstalled || compareSemver(latestVersion, activeVersion) > 0;
23499
23527
  if (!shouldInstall) {
23500
23528
  return {
@@ -23574,7 +23602,7 @@ function createRuntimeDelivery(product) {
23574
23602
  const complete = entry.name.startsWith(cachePrefix) && entry.name.endsWith(cacheSuffix);
23575
23603
  const partial = entry.name.startsWith(cachePrefix) && entry.name.endsWith(`${cacheSuffix}.partial`);
23576
23604
  return complete || partial;
23577
- }).map((entry) => import_node_path12.default.join(product.cacheDir(), entry.name)).sort();
23605
+ }).map((entry) => import_node_path13.default.join(product.cacheDir(), entry.name)).sort();
23578
23606
  } catch {
23579
23607
  }
23580
23608
  }
@@ -23615,11 +23643,11 @@ function createRuntimeDelivery(product) {
23615
23643
  }
23616
23644
  async function installVerifiedTarball(tarball) {
23617
23645
  const { url, digest, destDir, installedMarker, label } = tarball;
23618
- const downloadDir = import_node_fs12.default.mkdtempSync(import_node_path12.default.join(import_node_os5.default.tmpdir(), "runtime-delivery-download-"));
23619
- const archivePath = import_node_path12.default.join(downloadDir, "archive.tar.gz");
23620
- import_node_fs12.default.mkdirSync(import_node_path12.default.dirname(destDir), { recursive: true });
23646
+ const downloadDir = import_node_fs12.default.mkdtempSync(import_node_path13.default.join(import_node_os6.default.tmpdir(), "runtime-delivery-download-"));
23647
+ const archivePath = import_node_path13.default.join(downloadDir, "archive.tar.gz");
23648
+ import_node_fs12.default.mkdirSync(import_node_path13.default.dirname(destDir), { recursive: true });
23621
23649
  const tmpDir = import_node_fs12.default.mkdtempSync(
23622
- import_node_path12.default.join(import_node_path12.default.dirname(destDir), `.installing-${import_node_path12.default.basename(destDir)}-`)
23650
+ import_node_path13.default.join(import_node_path13.default.dirname(destDir), `.installing-${import_node_path13.default.basename(destDir)}-`)
23623
23651
  );
23624
23652
  try {
23625
23653
  await downloadToFile(url, archivePath);
@@ -23630,7 +23658,7 @@ async function installVerifiedTarball(tarball) {
23630
23658
  );
23631
23659
  }
23632
23660
  await extractTarball(archivePath, tmpDir, tarball.stripComponents ?? 0);
23633
- if (!import_node_fs12.default.existsSync(import_node_path12.default.join(tmpDir, installedMarker))) {
23661
+ if (!import_node_fs12.default.existsSync(import_node_path13.default.join(tmpDir, installedMarker))) {
23634
23662
  throw new Error(`extracted tarball for ${label} is missing ${installedMarker}`);
23635
23663
  }
23636
23664
  try {
@@ -23646,7 +23674,7 @@ async function installVerifiedTarball(tarball) {
23646
23674
  try {
23647
23675
  import_node_fs12.default.renameSync(tmpDir, destDir);
23648
23676
  } catch (landErr) {
23649
- if (!isErrnoCode(landErr, "ENOTEMPTY", "EEXIST") || !import_node_fs12.default.existsSync(import_node_path12.default.join(destDir, installedMarker))) {
23677
+ if (!isErrnoCode(landErr, "ENOTEMPTY", "EEXIST") || !import_node_fs12.default.existsSync(import_node_path13.default.join(destDir, installedMarker))) {
23650
23678
  throw landErr;
23651
23679
  }
23652
23680
  } finally {
@@ -23666,7 +23694,7 @@ async function downloadToFile(url, destPath) {
23666
23694
  if (!res.ok || !res.body) {
23667
23695
  throw new Error(`download failed: ${res.status} ${res.statusText} (${url})`);
23668
23696
  }
23669
- import_node_fs12.default.mkdirSync(import_node_path12.default.dirname(destPath), { recursive: true });
23697
+ import_node_fs12.default.mkdirSync(import_node_path13.default.dirname(destPath), { recursive: true });
23670
23698
  const tmp = `${destPath}.partial`;
23671
23699
  try {
23672
23700
  await (0, import_promises3.pipeline)(
@@ -23705,15 +23733,15 @@ function extractTarball(tarPath, destDir, stripComponents) {
23705
23733
  });
23706
23734
  });
23707
23735
  }
23708
- var import_node_child_process6, import_node_crypto6, import_node_fs12, import_node_os5, import_node_path12, import_node_stream, import_promises3, DEFAULT_LOCAL_RUNTIME_RETENTION_COUNT;
23736
+ var import_node_child_process6, import_node_crypto6, import_node_fs12, import_node_os6, import_node_path13, import_node_stream, import_promises3, DEFAULT_LOCAL_RUNTIME_RETENTION_COUNT;
23709
23737
  var init_src = __esm({
23710
23738
  "../contrast-runtime-delivery/src/index.ts"() {
23711
23739
  "use strict";
23712
23740
  import_node_child_process6 = require("node:child_process");
23713
23741
  import_node_crypto6 = __toESM(require("node:crypto"), 1);
23714
23742
  import_node_fs12 = __toESM(require("node:fs"), 1);
23715
- import_node_os5 = __toESM(require("node:os"), 1);
23716
- import_node_path12 = __toESM(require("node:path"), 1);
23743
+ import_node_os6 = __toESM(require("node:os"), 1);
23744
+ import_node_path13 = __toESM(require("node:path"), 1);
23717
23745
  import_node_stream = require("node:stream");
23718
23746
  import_promises3 = require("node:stream/promises");
23719
23747
  init_product();
@@ -23889,14 +23917,14 @@ var init_standalone = __esm({
23889
23917
  // cli/self-invocation.ts
23890
23918
  function sourceEntryPath() {
23891
23919
  try {
23892
- const candidate = (0, import_node_path13.join)((0, import_node_path13.dirname)((0, import_node_url3.fileURLToPath)(__sootsim_import_meta_url)), "bin.ts");
23920
+ const candidate = (0, import_node_path14.join)((0, import_node_path14.dirname)((0, import_node_url3.fileURLToPath)(__sootsim_import_meta_url)), "bin.ts");
23893
23921
  return (0, import_node_fs13.existsSync)(candidate) ? candidate : null;
23894
23922
  } catch {
23895
23923
  return null;
23896
23924
  }
23897
23925
  }
23898
- function isCliEntry(path28) {
23899
- const name2 = (0, import_node_path13.basename)(path28);
23926
+ function isCliEntry(path29) {
23927
+ const name2 = (0, import_node_path14.basename)(path29);
23900
23928
  return name2 === "bin.ts" || name2 === "bin.js";
23901
23929
  }
23902
23930
  function rnxSelfInvocation() {
@@ -23914,12 +23942,12 @@ function rnxSelfInvocation() {
23914
23942
  }
23915
23943
  return { executable: process.execPath, prefixArgs: [entry] };
23916
23944
  }
23917
- var import_node_fs13, import_node_path13, import_node_url3;
23945
+ var import_node_fs13, import_node_path14, import_node_url3;
23918
23946
  var init_self_invocation = __esm({
23919
23947
  "cli/self-invocation.ts"() {
23920
23948
  "use strict";
23921
23949
  import_node_fs13 = require("node:fs");
23922
- import_node_path13 = require("node:path");
23950
+ import_node_path14 = require("node:path");
23923
23951
  import_node_url3 = require("node:url");
23924
23952
  init_public_brand();
23925
23953
  init_standalone();
@@ -23987,7 +24015,7 @@ function getUserDataDir() {
23987
24015
  return userDataDir();
23988
24016
  }
23989
24017
  function storeFile() {
23990
- return import_node_path14.default.join(userDataDir(), "attached-projects.json");
24018
+ return import_node_path15.default.join(userDataDir(), "attached-projects.json");
23991
24019
  }
23992
24020
  function cloneEmpty() {
23993
24021
  return {
@@ -24029,7 +24057,7 @@ function loadStore() {
24029
24057
  }
24030
24058
  function writeStore(store) {
24031
24059
  const file = storeFile();
24032
- import_node_fs14.default.mkdirSync(import_node_path14.default.dirname(file), { recursive: true });
24060
+ import_node_fs14.default.mkdirSync(import_node_path15.default.dirname(file), { recursive: true });
24033
24061
  const tmp = `${file}.tmp-${process.pid}-${Date.now()}`;
24034
24062
  const fd = import_node_fs14.default.openSync(tmp, "w", 384);
24035
24063
  try {
@@ -24047,13 +24075,13 @@ function mutateStore(fn) {
24047
24075
  return store;
24048
24076
  }
24049
24077
  function projectIdForCwd(cwd) {
24050
- return (0, import_node_crypto7.createHash)("sha256").update(import_node_path14.default.resolve(cwd)).digest("hex").slice(0, 16);
24078
+ return (0, import_node_crypto7.createHash)("sha256").update(import_node_path15.default.resolve(cwd)).digest("hex").slice(0, 16);
24051
24079
  }
24052
24080
  function newSessionId() {
24053
24081
  return `s_${(0, import_node_crypto7.randomBytes)(10).toString("hex")}`;
24054
24082
  }
24055
24083
  function upsertProject(input) {
24056
- const cwd = import_node_path14.default.resolve(input.cwd);
24084
+ const cwd = import_node_path15.default.resolve(input.cwd);
24057
24085
  const id = projectIdForCwd(cwd);
24058
24086
  let result;
24059
24087
  mutateStore((store) => {
@@ -24079,7 +24107,7 @@ function upsertProject(input) {
24079
24107
  const now = Date.now();
24080
24108
  const created = {
24081
24109
  id,
24082
- name: input.name ?? import_node_path14.default.basename(cwd),
24110
+ name: input.name ?? import_node_path15.default.basename(cwd),
24083
24111
  cwd,
24084
24112
  repoRoot: input.repoRoot,
24085
24113
  sourceRoots: input.sourceRoots ?? [cwd],
@@ -24225,7 +24253,7 @@ async function seedFromDemoAppRegistry() {
24225
24253
  mutateStore((store) => {
24226
24254
  for (const app of apps) {
24227
24255
  if (!import_node_fs14.default.existsSync(app.dir)) continue;
24228
- const cwd = import_node_path14.default.resolve(app.dir);
24256
+ const cwd = import_node_path15.default.resolve(app.dir);
24229
24257
  const id = projectIdForCwd(cwd);
24230
24258
  if (store.attachedProjects.some((p) => p.id === id)) continue;
24231
24259
  const now = Date.now();
@@ -24246,13 +24274,13 @@ async function seedFromDemoAppRegistry() {
24246
24274
  }
24247
24275
  });
24248
24276
  }
24249
- var import_node_crypto7, import_node_fs14, import_node_path14, overrideDir, COST_HISTORY_MAX_AGE_MS;
24277
+ var import_node_crypto7, import_node_fs14, import_node_path15, overrideDir, COST_HISTORY_MAX_AGE_MS;
24250
24278
  var init_attached_projects = __esm({
24251
24279
  "src/attached-projects.ts"() {
24252
24280
  "use strict";
24253
24281
  import_node_crypto7 = require("node:crypto");
24254
24282
  import_node_fs14 = __toESM(require("node:fs"), 1);
24255
- import_node_path14 = __toESM(require("node:path"), 1);
24283
+ import_node_path15 = __toESM(require("node:path"), 1);
24256
24284
  init_home_paths();
24257
24285
  overrideDir = null;
24258
24286
  COST_HISTORY_MAX_AGE_MS = 14 * 24 * 60 * 60 * 1e3;
@@ -24261,16 +24289,16 @@ var init_attached_projects = __esm({
24261
24289
 
24262
24290
  // src/agent-sessions.ts
24263
24291
  function sessionDir(sessionId) {
24264
- return import_node_path15.default.join(getUserDataDir(), "sessions", sessionId);
24292
+ return import_node_path16.default.join(getUserDataDir(), "sessions", sessionId);
24265
24293
  }
24266
24294
  function promptFifoPath(sessionId) {
24267
- return import_node_path15.default.join(sessionDir(sessionId), "prompt.in");
24295
+ return import_node_path16.default.join(sessionDir(sessionId), "prompt.in");
24268
24296
  }
24269
24297
  function eventsFifoPath(sessionId) {
24270
- return import_node_path15.default.join(sessionDir(sessionId), "events.out");
24298
+ return import_node_path16.default.join(sessionDir(sessionId), "events.out");
24271
24299
  }
24272
24300
  function transcriptPath(sessionId) {
24273
- return import_node_path15.default.join(getUserDataDir(), "transcripts", `${sessionId}.log`);
24301
+ return import_node_path16.default.join(getUserDataDir(), "transcripts", `${sessionId}.log`);
24274
24302
  }
24275
24303
  function pidIsAlive(pid, sessionId) {
24276
24304
  if (!pid) return false;
@@ -24293,8 +24321,8 @@ function resolveSootsimInvocation() {
24293
24321
  const resourcesPath = process.resourcesPath;
24294
24322
  if (resourcesPath) {
24295
24323
  const candidates = [
24296
- import_node_path15.default.join(resourcesPath, "bin", "sootsim"),
24297
- import_node_path15.default.join(resourcesPath, "bin", `sootsim-${process.platform}-${process.arch}`)
24324
+ import_node_path16.default.join(resourcesPath, "bin", "sootsim"),
24325
+ import_node_path16.default.join(resourcesPath, "bin", `sootsim-${process.platform}-${process.arch}`)
24298
24326
  ];
24299
24327
  for (const c of candidates) {
24300
24328
  if (import_node_fs15.default.existsSync(c)) return { executable: c, prefixArgs: [] };
@@ -24316,12 +24344,12 @@ function tryWorkspaceSootsim() {
24316
24344
  const sootsimDir = resolveSootsimPackageDir();
24317
24345
  if (!sootsimDir) return null;
24318
24346
  const binaryName = `peach-${process.platform === "win32" ? "windows" : process.platform}-${process.arch}${process.platform === "win32" ? ".exe" : ""}`;
24319
- const distBinary = import_node_path15.default.join(sootsimDir, "dist-bin", binaryName);
24347
+ const distBinary = import_node_path16.default.join(sootsimDir, "dist-bin", binaryName);
24320
24348
  if (import_node_fs15.default.existsSync(distBinary)) return { executable: distBinary, prefixArgs: [] };
24321
- const distBin = import_node_path15.default.join(sootsimDir, "dist-cli", "bin.js");
24349
+ const distBin = import_node_path16.default.join(sootsimDir, "dist-cli", "bin.js");
24322
24350
  if (import_node_fs15.default.existsSync(distBin)) {
24323
24351
  try {
24324
- const src = import_node_path15.default.join(sootsimDir, "cli", "commands", "agent-wrapper.ts");
24352
+ const src = import_node_path16.default.join(sootsimDir, "cli", "commands", "agent-wrapper.ts");
24325
24353
  if (import_node_fs15.default.existsSync(src)) {
24326
24354
  const srcMtime = import_node_fs15.default.statSync(src).mtimeMs;
24327
24355
  const buildMtime = import_node_fs15.default.statSync(distBin).mtimeMs;
@@ -24343,14 +24371,14 @@ function tryWorkspaceSootsim() {
24343
24371
  function resolveSootsimPackageDir() {
24344
24372
  try {
24345
24373
  const resolved = require.resolve(`${rnxPublicBrand.packageName}/package.json`);
24346
- return import_node_path15.default.dirname(resolved);
24374
+ return import_node_path16.default.dirname(resolved);
24347
24375
  } catch {
24348
24376
  }
24349
24377
  const here = fileFromImportMeta();
24350
24378
  if (!here) return null;
24351
- let cur = import_node_path15.default.dirname(here);
24379
+ let cur = import_node_path16.default.dirname(here);
24352
24380
  for (let i = 0; i < 8; i++) {
24353
- const pkg = import_node_path15.default.join(cur, "package.json");
24381
+ const pkg = import_node_path16.default.join(cur, "package.json");
24354
24382
  try {
24355
24383
  if (import_node_fs15.default.existsSync(pkg)) {
24356
24384
  const parsed = JSON.parse(import_node_fs15.default.readFileSync(pkg, "utf8"));
@@ -24358,7 +24386,7 @@ function resolveSootsimPackageDir() {
24358
24386
  }
24359
24387
  } catch {
24360
24388
  }
24361
- const parent = import_node_path15.default.dirname(cur);
24389
+ const parent = import_node_path16.default.dirname(cur);
24362
24390
  if (parent === cur) break;
24363
24391
  cur = parent;
24364
24392
  }
@@ -24374,13 +24402,13 @@ function fileFromImportMeta() {
24374
24402
  }
24375
24403
  }
24376
24404
  async function withStartLock(projectId, provider, fn) {
24377
- const lockDir = import_node_path15.default.join(getUserDataDir(), "locks");
24405
+ const lockDir = import_node_path16.default.join(getUserDataDir(), "locks");
24378
24406
  import_node_fs15.default.mkdirSync(lockDir, { recursive: true });
24379
24407
  try {
24380
24408
  import_node_fs15.default.chmodSync(lockDir, 448);
24381
24409
  } catch {
24382
24410
  }
24383
- const lockPath = import_node_path15.default.join(lockDir, `start-${projectId}-${provider}.lock`);
24411
+ const lockPath = import_node_path16.default.join(lockDir, `start-${projectId}-${provider}.lock`);
24384
24412
  const deadline = Date.now() + 4e3;
24385
24413
  let fd = null;
24386
24414
  while (fd === null) {
@@ -24431,7 +24459,7 @@ function isProcessAlive(pid) {
24431
24459
  }
24432
24460
  }
24433
24461
  function mkfifoSync(p) {
24434
- const parent = import_node_path15.default.dirname(p);
24462
+ const parent = import_node_path16.default.dirname(p);
24435
24463
  import_node_fs15.default.mkdirSync(parent, { recursive: true });
24436
24464
  try {
24437
24465
  import_node_fs15.default.chmodSync(parent, 448);
@@ -24489,7 +24517,7 @@ async function startSession(opts) {
24489
24517
  const transcript = transcriptPath(session.id);
24490
24518
  mkfifoSync(promptIn);
24491
24519
  mkfifoSync(eventsOut);
24492
- const transcriptDir = import_node_path15.default.dirname(transcript);
24520
+ const transcriptDir = import_node_path16.default.dirname(transcript);
24493
24521
  import_node_fs15.default.mkdirSync(transcriptDir, { recursive: true });
24494
24522
  try {
24495
24523
  import_node_fs15.default.chmodSync(transcriptDir, 448);
@@ -24672,14 +24700,14 @@ async function waitForFirstEvent(fifo, predicate, timeoutMs) {
24672
24700
  import_node_fs15.default.closeSync(fd);
24673
24701
  }
24674
24702
  }
24675
- var import_node_child_process7, import_node_crypto8, import_node_fs15, import_node_path15, import_node_readline, AgentSessionError;
24703
+ var import_node_child_process7, import_node_crypto8, import_node_fs15, import_node_path16, import_node_readline, AgentSessionError;
24676
24704
  var init_agent_sessions = __esm({
24677
24705
  "src/agent-sessions.ts"() {
24678
24706
  "use strict";
24679
24707
  import_node_child_process7 = require("node:child_process");
24680
24708
  import_node_crypto8 = require("node:crypto");
24681
24709
  import_node_fs15 = __toESM(require("node:fs"), 1);
24682
- import_node_path15 = __toESM(require("node:path"), 1);
24710
+ import_node_path16 = __toESM(require("node:path"), 1);
24683
24711
  import_node_readline = __toESM(require("node:readline"), 1);
24684
24712
  init_self_invocation();
24685
24713
  init_standalone();
@@ -24710,13 +24738,13 @@ function mapFrameworkToProjectFramework(fw) {
24710
24738
  if (fw === "one" || fw === "vxrn") return "one";
24711
24739
  return "unknown";
24712
24740
  }
24713
- var import_node_crypto9, import_node_fs16, import_node_path16, WS_OPEN, SESSION_STATUS_PERSIST_DELAY_MS, AgentHost;
24741
+ var import_node_crypto9, import_node_fs16, import_node_path17, WS_OPEN, SESSION_STATUS_PERSIST_DELAY_MS, AgentHost;
24714
24742
  var init_agent_host = __esm({
24715
24743
  "src/host/agent-host.ts"() {
24716
24744
  "use strict";
24717
24745
  import_node_crypto9 = require("node:crypto");
24718
24746
  import_node_fs16 = __toESM(require("node:fs"), 1);
24719
- import_node_path16 = __toESM(require("node:path"), 1);
24747
+ import_node_path17 = __toESM(require("node:path"), 1);
24720
24748
  init_dev_server_scanner();
24721
24749
  init_agent_sessions();
24722
24750
  init_attached_projects();
@@ -24962,7 +24990,7 @@ var init_agent_host = __esm({
24962
24990
  );
24963
24991
  const project = upsertProject({
24964
24992
  cwd: match.cwd,
24965
- name: match.projectName ?? import_node_path16.default.basename(match.cwd),
24993
+ name: match.projectName ?? import_node_path17.default.basename(match.cwd),
24966
24994
  preferredProvider: input.provider ?? existing?.preferredProvider,
24967
24995
  sourceRoots: existing?.sourceRoots ?? [match.cwd],
24968
24996
  knownBundleUrls,
@@ -24982,9 +25010,9 @@ var init_agent_host = __esm({
24982
25010
  const dir = getUserDataDir();
24983
25011
  return {
24984
25012
  userDataDir: dir,
24985
- storeFile: import_node_path16.default.join(dir, "attached-projects.json"),
24986
- sessionsDir: import_node_path16.default.join(dir, "sessions"),
24987
- transcriptsDir: import_node_path16.default.join(dir, "transcripts")
25013
+ storeFile: import_node_path17.default.join(dir, "attached-projects.json"),
25014
+ sessionsDir: import_node_path17.default.join(dir, "sessions"),
25015
+ transcriptsDir: import_node_path17.default.join(dir, "transcripts")
24988
25016
  };
24989
25017
  }
24990
25018
  // --- subscription management ---
@@ -25844,13 +25872,13 @@ function looksBinary(filePath, size) {
25844
25872
  if (fd !== void 0) import_node_fs17.default.closeSync(fd);
25845
25873
  }
25846
25874
  }
25847
- var import_node_child_process8, import_node_fs17, import_node_path17, CheckoutRequiresGitError, BINARY_SNIFF_BYTES, LIST_FILES_TIMEOUT_MS, LIST_FILES_ATTEMPTS, LIST_FILES_RETRY_MS, CheckoutFilePlane;
25875
+ var import_node_child_process8, import_node_fs17, import_node_path18, CheckoutRequiresGitError, BINARY_SNIFF_BYTES, LIST_FILES_TIMEOUT_MS, LIST_FILES_ATTEMPTS, LIST_FILES_RETRY_MS, CheckoutFilePlane;
25848
25876
  var init_checkout_plane = __esm({
25849
25877
  "cli/commands/box/checkout-plane.ts"() {
25850
25878
  "use strict";
25851
25879
  import_node_child_process8 = require("node:child_process");
25852
25880
  import_node_fs17 = __toESM(require("node:fs"), 1);
25853
- import_node_path17 = __toESM(require("node:path"), 1);
25881
+ import_node_path18 = __toESM(require("node:path"), 1);
25854
25882
  CheckoutRequiresGitError = class extends Error {
25855
25883
  };
25856
25884
  BINARY_SNIFF_BYTES = 8192;
@@ -25867,7 +25895,7 @@ var init_checkout_plane = __esm({
25867
25895
  listTimeoutMs;
25868
25896
  trackedOnly;
25869
25897
  constructor(root, options = {}) {
25870
- this.root = import_node_path17.default.resolve(root);
25898
+ this.root = import_node_path18.default.resolve(root);
25871
25899
  this.listTimeoutMs = options.listTimeoutMs ?? LIST_FILES_TIMEOUT_MS;
25872
25900
  this.trackedOnly = options.trackedOnly ?? false;
25873
25901
  }
@@ -25929,13 +25957,13 @@ var init_checkout_plane = __esm({
25929
25957
  if (!relative2) continue;
25930
25958
  let stat2;
25931
25959
  try {
25932
- stat2 = import_node_fs17.default.statSync(import_node_path17.default.join(this.root, relative2));
25960
+ stat2 = import_node_fs17.default.statSync(import_node_path18.default.join(this.root, relative2));
25933
25961
  } catch {
25934
25962
  continue;
25935
25963
  }
25936
25964
  if (!stat2.isFile()) continue;
25937
25965
  const seen = this.sniffed.get(relative2);
25938
- const binary = seen && seen.size === stat2.size && seen.mtimeMs === stat2.mtimeMs ? seen.binary : looksBinary(import_node_path17.default.join(this.root, relative2), stat2.size);
25966
+ const binary = seen && seen.size === stat2.size && seen.mtimeMs === stat2.mtimeMs ? seen.binary : looksBinary(import_node_path18.default.join(this.root, relative2), stat2.size);
25939
25967
  nextSniffed.set(relative2, { size: stat2.size, mtimeMs: stat2.mtimeMs, binary });
25940
25968
  next.set(relative2, {
25941
25969
  size: stat2.size,
@@ -25949,8 +25977,8 @@ var init_checkout_plane = __esm({
25949
25977
  this.sniffed = nextSniffed;
25950
25978
  }
25951
25979
  absolute(planePath) {
25952
- const resolved = import_node_path17.default.resolve(this.root, planePath);
25953
- if (resolved !== this.root && !resolved.startsWith(`${this.root}${import_node_path17.default.sep}`)) {
25980
+ const resolved = import_node_path18.default.resolve(this.root, planePath);
25981
+ if (resolved !== this.root && !resolved.startsWith(`${this.root}${import_node_path18.default.sep}`)) {
25954
25982
  throw new Error(`path escapes the project: ${planePath}`);
25955
25983
  }
25956
25984
  return resolved;
@@ -25963,7 +25991,7 @@ var init_checkout_plane = __esm({
25963
25991
  }
25964
25992
  async write(planePath, content) {
25965
25993
  const absolute = this.absolute(planePath);
25966
- await import_node_fs17.default.promises.mkdir(import_node_path17.default.dirname(absolute), { recursive: true });
25994
+ await import_node_fs17.default.promises.mkdir(import_node_path18.default.dirname(absolute), { recursive: true });
25967
25995
  await import_node_fs17.default.promises.writeFile(absolute, content);
25968
25996
  this.entries.set(planePath, {
25969
25997
  size: content.byteLength,
@@ -25981,12 +26009,12 @@ var init_checkout_plane = __esm({
25981
26009
  });
25982
26010
 
25983
26011
  // src/host/plane-host.ts
25984
- var import_node_fs18, import_node_path18, WS_OPEN2, PlaneNotRegisteredError, PlaneHost;
26012
+ var import_node_fs18, import_node_path19, WS_OPEN2, PlaneNotRegisteredError, PlaneHost;
25985
26013
  var init_plane_host = __esm({
25986
26014
  "src/host/plane-host.ts"() {
25987
26015
  "use strict";
25988
26016
  import_node_fs18 = __toESM(require("node:fs"), 1);
25989
- import_node_path18 = __toESM(require("node:path"), 1);
26017
+ import_node_path19 = __toESM(require("node:path"), 1);
25990
26018
  init_plane();
25991
26019
  init_checkout_plane();
25992
26020
  WS_OPEN2 = 1;
@@ -26109,7 +26137,7 @@ var init_plane_host = __esm({
26109
26137
  // root and an opened one cannot disagree about the same directory.
26110
26138
  realRoot(root) {
26111
26139
  if (!root) throw new Error("root is required");
26112
- const resolved = import_node_path18.default.resolve(root);
26140
+ const resolved = import_node_path19.default.resolve(root);
26113
26141
  let real;
26114
26142
  try {
26115
26143
  real = import_node_fs18.default.realpathSync(resolved);
@@ -26469,13 +26497,13 @@ function sendJavaScript(req, res, source) {
26469
26497
  res.end(req.method === "HEAD" ? void 0 : source);
26470
26498
  }
26471
26499
  function resolveLocalImport(fromFile, specifier) {
26472
- const base = import_node_path19.default.resolve(import_node_path19.default.dirname(fromFile), specifier);
26500
+ const base = import_node_path20.default.resolve(import_node_path20.default.dirname(fromFile), specifier);
26473
26501
  const candidates = [
26474
26502
  ...REPLACEMENT_MODULE_EXTENSIONS.some(
26475
- (ext) => ext === import_node_path19.default.extname(base).toLowerCase()
26503
+ (ext) => ext === import_node_path20.default.extname(base).toLowerCase()
26476
26504
  ) ? [base] : [],
26477
26505
  ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base + ext),
26478
- ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path19.default.join(base, `index${ext}`))
26506
+ ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path20.default.join(base, `index${ext}`))
26479
26507
  ];
26480
26508
  const found = candidates.find(
26481
26509
  (candidate) => (0, import_node_fs19.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
@@ -26533,13 +26561,13 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
26533
26561
  res.end("missing path param");
26534
26562
  return true;
26535
26563
  }
26536
- const extension = import_node_path19.default.extname(targetPath).toLowerCase();
26564
+ const extension = import_node_path20.default.extname(targetPath).toLowerCase();
26537
26565
  if (!REPLACEMENT_MODULE_EXTENSIONS.some((allowed) => allowed === extension)) {
26538
26566
  res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
26539
26567
  res.end(`replacement files must be ${REPLACEMENT_MODULE_EXTENSIONS.join(", ")}`);
26540
26568
  return true;
26541
26569
  }
26542
- if (!import_node_path19.default.isAbsolute(targetPath)) {
26570
+ if (!import_node_path20.default.isAbsolute(targetPath)) {
26543
26571
  res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
26544
26572
  res.end("replacement file path must be absolute");
26545
26573
  return true;
@@ -26547,10 +26575,10 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
26547
26575
  const runtimePackages = new Set(url.searchParams.getAll("runtimePackage"));
26548
26576
  let resolvedProjectRoot;
26549
26577
  if (options.projectRoot) {
26550
- const lexicalProjectRoot = import_node_path19.default.resolve(options.projectRoot);
26578
+ const lexicalProjectRoot = import_node_path20.default.resolve(options.projectRoot);
26551
26579
  resolvedProjectRoot = await import_promises5.default.realpath(options.projectRoot);
26552
- const lexicalTarget = import_node_path19.default.relative(lexicalProjectRoot, targetPath);
26553
- if (lexicalTarget.startsWith("..") || import_node_path19.default.isAbsolute(lexicalTarget)) {
26580
+ const lexicalTarget = import_node_path20.default.relative(lexicalProjectRoot, targetPath);
26581
+ if (lexicalTarget.startsWith("..") || import_node_path20.default.isAbsolute(lexicalTarget)) {
26554
26582
  res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
26555
26583
  res.end("replacement file must be inside the project root");
26556
26584
  return true;
@@ -26566,8 +26594,8 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
26566
26594
  return true;
26567
26595
  }
26568
26596
  if (resolvedProjectRoot) {
26569
- const relativeTarget = import_node_path19.default.relative(resolvedProjectRoot, resolvedTargetPath);
26570
- if (relativeTarget.startsWith("..") || import_node_path19.default.isAbsolute(relativeTarget)) {
26597
+ const relativeTarget = import_node_path20.default.relative(resolvedProjectRoot, resolvedTargetPath);
26598
+ if (relativeTarget.startsWith("..") || import_node_path20.default.isAbsolute(relativeTarget)) {
26571
26599
  res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
26572
26600
  res.end("replacement file must be inside the project root");
26573
26601
  return true;
@@ -26601,13 +26629,13 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
26601
26629
  }
26602
26630
  return true;
26603
26631
  }
26604
- var import_node_fs19, import_promises5, import_node_path19, REPLACEMENT_MODULE_ROUTE;
26632
+ var import_node_fs19, import_promises5, import_node_path20, REPLACEMENT_MODULE_ROUTE;
26605
26633
  var init_replacement_module_handler = __esm({
26606
26634
  "src/host/replacement-module-handler.ts"() {
26607
26635
  "use strict";
26608
26636
  import_node_fs19 = require("node:fs");
26609
26637
  import_promises5 = __toESM(require("node:fs/promises"), 1);
26610
- import_node_path19 = __toESM(require("node:path"), 1);
26638
+ import_node_path20 = __toESM(require("node:path"), 1);
26611
26639
  init_replacementModule();
26612
26640
  init_backend_origin();
26613
26641
  REPLACEMENT_MODULE_ROUTE = "/__sootsim-replacement-module";
@@ -28541,8 +28569,8 @@ function metroIosAssetDestRelatives(httpServerLocation, filename) {
28541
28569
  }
28542
28570
  const out = [];
28543
28571
  for (const dir of dirs) {
28544
- const path28 = `${dir}/${filename}`;
28545
- if (!out.includes(path28)) out.push(path28);
28572
+ const path29 = `${dir}/${filename}`;
28573
+ if (!out.includes(path29)) out.push(path29);
28546
28574
  }
28547
28575
  if (!out.includes(filename)) out.push(filename);
28548
28576
  return out;
@@ -29494,13 +29522,13 @@ function readFactoryStringLiterals(factory) {
29494
29522
  return literals;
29495
29523
  }
29496
29524
  function normalizeFingerprintLiteral(literal) {
29497
- const path28 = literal.replaceAll("\\\\", "/").replaceAll("\\/", "/");
29525
+ const path29 = literal.replaceAll("\\\\", "/").replaceAll("\\/", "/");
29498
29526
  const nodeModulesMarker = "/node_modules/";
29499
- const nodeModulesIndex = path28.lastIndexOf(nodeModulesMarker);
29527
+ const nodeModulesIndex = path29.lastIndexOf(nodeModulesMarker);
29500
29528
  if (nodeModulesIndex >= 0) {
29501
- return `node_modules/${path28.slice(nodeModulesIndex + nodeModulesMarker.length)}`;
29529
+ return `node_modules/${path29.slice(nodeModulesIndex + nodeModulesMarker.length)}`;
29502
29530
  }
29503
- if ((path28.startsWith("/") || /^[A-Za-z]:\//.test(path28) || path28.startsWith("file:/")) && /\.[cm]?[jt]sx?(?::\d+(?::\d+)?)?$/.test(path28)) {
29531
+ if ((path29.startsWith("/") || /^[A-Za-z]:\//.test(path29) || path29.startsWith("file:/")) && /\.[cm]?[jt]sx?(?::\d+(?::\d+)?)?$/.test(path29)) {
29504
29532
  return null;
29505
29533
  }
29506
29534
  return literal;
@@ -29738,10 +29766,10 @@ function templateAssignment(template, embeddings) {
29738
29766
  if (existingNode !== void 0 && existingNode !== nodeIndex) return null;
29739
29767
  nodesByModuleId.set(moduleId, nodeIndex);
29740
29768
  const node = template.nodes[nodeIndex];
29741
- const path28 = node.landmarkPath ?? `node_modules/${template.packageName}/__rnx_inferred__/${moduleId}.js`;
29769
+ const path29 = node.landmarkPath ?? `node_modules/${template.packageName}/__rnx_inferred__/${moduleId}.js`;
29742
29770
  const existingPath = pathsByModuleId.get(moduleId);
29743
- if (existingPath !== void 0 && existingPath !== path28) return null;
29744
- pathsByModuleId.set(moduleId, path28);
29771
+ if (existingPath !== void 0 && existingPath !== path29) return null;
29772
+ pathsByModuleId.set(moduleId, path29);
29745
29773
  }
29746
29774
  }
29747
29775
  return {
@@ -29903,14 +29931,14 @@ async function inferMetroModuleIdentity(args) {
29903
29931
  const packageClaims = claimsByPackage.values().next().value;
29904
29932
  if (!packageClaims) continue;
29905
29933
  const exactClaims = packageClaims.filter((assignment2) => {
29906
- const path28 = assignment2.pathsByModuleId.get(moduleId);
29907
- return path28 !== void 0 && !path28.includes("/__rnx_inferred__/");
29934
+ const path29 = assignment2.pathsByModuleId.get(moduleId);
29935
+ return path29 !== void 0 && !path29.includes("/__rnx_inferred__/");
29908
29936
  });
29909
29937
  const preferredClaims = exactClaims.length > 0 ? exactClaims : packageClaims;
29910
29938
  const routes = new Set(
29911
29939
  preferredClaims.flatMap((assignment2) => {
29912
- const path28 = assignment2.pathsByModuleId.get(moduleId);
29913
- return path28 ? [metroFingerprintModuleClaimRoute(assignment2.packageName, path28)] : [];
29940
+ const path29 = assignment2.pathsByModuleId.get(moduleId);
29941
+ return path29 ? [metroFingerprintModuleClaimRoute(assignment2.packageName, path29)] : [];
29914
29942
  })
29915
29943
  );
29916
29944
  if (routes.size !== 1) continue;
@@ -30204,7 +30232,7 @@ function detectFramework2(deps) {
30204
30232
  return "unknown";
30205
30233
  }
30206
30234
  function detectProject(dir) {
30207
- const pkgPath = (0, import_node_path20.join)(dir, "package.json");
30235
+ const pkgPath = (0, import_node_path21.join)(dir, "package.json");
30208
30236
  if (!(0, import_node_fs20.existsSync)(pkgPath)) return null;
30209
30237
  const pkg = readProjectManifest(dir);
30210
30238
  if (!pkg) return null;
@@ -30217,25 +30245,25 @@ function detectProject(dir) {
30217
30245
  if (framework === "unknown") return null;
30218
30246
  return {
30219
30247
  dir,
30220
- name: pkg.name || (0, import_node_path20.basename)(dir),
30248
+ name: pkg.name || (0, import_node_path21.basename)(dir),
30221
30249
  framework,
30222
30250
  // a config file is a config file whatever module system it declares. real
30223
30251
  // apps write .cjs as often as .js, and missing one reads as "this project
30224
30252
  // has no bundler config" and sends the user to create a second one.
30225
30253
  hasViteConfig: CONFIG_EXTENSIONS.some(
30226
- (ext) => (0, import_node_fs20.existsSync)((0, import_node_path20.join)(dir, `vite.config.${ext}`))
30254
+ (ext) => (0, import_node_fs20.existsSync)((0, import_node_path21.join)(dir, `vite.config.${ext}`))
30227
30255
  ),
30228
30256
  hasMetroConfig: CONFIG_EXTENSIONS.some(
30229
- (ext) => (0, import_node_fs20.existsSync)((0, import_node_path20.join)(dir, `metro.config.${ext}`))
30257
+ (ext) => (0, import_node_fs20.existsSync)((0, import_node_path21.join)(dir, `metro.config.${ext}`))
30230
30258
  ),
30231
30259
  devCommand: typeof devCommand === "string" ? devCommand : null
30232
30260
  };
30233
30261
  }
30234
- function readProjectMetadata(path28) {
30262
+ function readProjectMetadata(path29) {
30235
30263
  try {
30236
- const info = (0, import_node_fs20.lstatSync)(path28);
30264
+ const info = (0, import_node_fs20.lstatSync)(path29);
30237
30265
  if (!info.isFile() || info.size > 4 * 1024 * 1024) return null;
30238
- return (0, import_node_fs20.readFileSync)(path28, "utf8");
30266
+ return (0, import_node_fs20.readFileSync)(path29, "utf8");
30239
30267
  } catch {
30240
30268
  return null;
30241
30269
  }
@@ -30244,8 +30272,8 @@ function metadataValue(value, key) {
30244
30272
  if (!value || typeof value !== "object") return void 0;
30245
30273
  return Object.getOwnPropertyDescriptor(value, key)?.value;
30246
30274
  }
30247
- function readProjectJson(path28) {
30248
- const text = readProjectMetadata(path28);
30275
+ function readProjectJson(path29) {
30276
+ const text = readProjectMetadata(path29);
30249
30277
  if (text === null) return null;
30250
30278
  try {
30251
30279
  const value = JSON.parse(text);
@@ -30255,7 +30283,7 @@ function readProjectJson(path28) {
30255
30283
  }
30256
30284
  }
30257
30285
  function readProjectManifest(dir) {
30258
- const parsed = readProjectJson((0, import_node_path20.join)(dir, "package.json"));
30286
+ const parsed = readProjectJson((0, import_node_path21.join)(dir, "package.json"));
30259
30287
  if (!parsed || typeof parsed !== "object") return null;
30260
30288
  const record = (value) => {
30261
30289
  if (!value || typeof value !== "object") return {};
@@ -30272,12 +30300,12 @@ function readProjectManifest(dir) {
30272
30300
  devDependencies: record(metadataValue(parsed, "devDependencies"))
30273
30301
  };
30274
30302
  }
30275
- var import_node_fs20, import_node_path20, import_json5, import_yaml, CONFIG_EXTENSIONS;
30303
+ var import_node_fs20, import_node_path21, import_json5, import_yaml, CONFIG_EXTENSIONS;
30276
30304
  var init_detect = __esm({
30277
30305
  "cli/commands/detect.ts"() {
30278
30306
  "use strict";
30279
30307
  import_node_fs20 = require("node:fs");
30280
- import_node_path20 = require("node:path");
30308
+ import_node_path21 = require("node:path");
30281
30309
  import_json5 = __toESM(require("json5"), 1);
30282
30310
  import_yaml = require("yaml");
30283
30311
  CONFIG_EXTENSIONS = ["ts", "js", "cjs", "mjs", "mts", "cts"];
@@ -30314,8 +30342,8 @@ function resolveCloudOrigin(value) {
30314
30342
  return normalizeCloudOrigin(source);
30315
30343
  }
30316
30344
  function readImmutableBundleSource(bundlePath) {
30317
- const filepath = (0, import_node_path21.resolve)(bundlePath);
30318
- if ((0, import_node_path21.extname)(filepath) !== ".js") {
30345
+ const filepath = (0, import_node_path22.resolve)(bundlePath);
30346
+ if ((0, import_node_path22.extname)(filepath) !== ".js") {
30319
30347
  throw new Error(`${REMOTE_COMMAND} requires one local Metro .js bundle`);
30320
30348
  }
30321
30349
  const descriptor = (0, import_node_fs21.openSync)(filepath, "r");
@@ -30390,9 +30418,9 @@ async function loadBundleSource(bundleInput) {
30390
30418
  return readImmutableBundleSource(bundleInput);
30391
30419
  }
30392
30420
  function listMetroAssetDest(assetsPath) {
30393
- const directory = (0, import_node_path21.resolve)(assetsPath);
30421
+ const directory = (0, import_node_path22.resolve)(assetsPath);
30394
30422
  if (!(0, import_node_fs21.existsSync)(directory)) return { directory, files: [], truncated: false };
30395
- const skipNested = (0, import_node_fs21.existsSync)((0, import_node_path21.join)(directory, "package.json"));
30423
+ const skipNested = (0, import_node_fs21.existsSync)((0, import_node_path22.join)(directory, "package.json"));
30396
30424
  const files = [];
30397
30425
  let truncated = false;
30398
30426
  const walk = (dir, prefix) => {
@@ -30410,7 +30438,7 @@ function listMetroAssetDest(assetsPath) {
30410
30438
  if (entry.isDirectory()) {
30411
30439
  if (entry.name === ".git") continue;
30412
30440
  if (skipNested && PROJECT_ONLY_DIRECTORIES.has(entry.name)) continue;
30413
- walk((0, import_node_path21.join)(dir, entry.name), prefix ? `${prefix}/${entry.name}` : entry.name);
30441
+ walk((0, import_node_path22.join)(dir, entry.name), prefix ? `${prefix}/${entry.name}` : entry.name);
30414
30442
  } else if (entry.isFile()) {
30415
30443
  files.push(prefix ? `${prefix}/${entry.name}` : entry.name);
30416
30444
  }
@@ -30445,7 +30473,7 @@ function distinctByContent(directory, options) {
30445
30473
  for (const relative2 of options) {
30446
30474
  let bytes;
30447
30475
  try {
30448
- bytes = (0, import_node_fs21.readFileSync)((0, import_node_path21.join)(directory, relative2));
30476
+ bytes = (0, import_node_fs21.readFileSync)((0, import_node_path22.join)(directory, relative2));
30449
30477
  } catch {
30450
30478
  continue;
30451
30479
  }
@@ -30477,7 +30505,7 @@ function placeMetroDescriptor(listing, descriptor) {
30477
30505
  let bytes;
30478
30506
  try {
30479
30507
  bytes = combination.map(
30480
- (relative2) => (0, import_node_fs21.readFileSync)((0, import_node_path21.join)(listing.directory, relative2))
30508
+ (relative2) => (0, import_node_fs21.readFileSync)((0, import_node_path22.join)(listing.directory, relative2))
30481
30509
  );
30482
30510
  } catch {
30483
30511
  continue;
@@ -30503,26 +30531,26 @@ function placeMetroDescriptor(listing, descriptor) {
30503
30531
  }
30504
30532
  function unverifiedFileKey(dest) {
30505
30533
  return dest.placements.filter((placement) => !placement.verified).flatMap(
30506
- (placement) => [...placement.files.values()].map((relative2) => (0, import_node_path21.join)(dest.directory, relative2))
30534
+ (placement) => [...placement.files.values()].map((relative2) => (0, import_node_path22.join)(dest.directory, relative2))
30507
30535
  ).sort().join("\n");
30508
30536
  }
30509
30537
  function searchMetroAssetDest(bundlePath, descriptors) {
30510
- const bundleDirectory = (0, import_node_path21.dirname)((0, import_node_path21.resolve)(bundlePath));
30538
+ const bundleDirectory = (0, import_node_path22.dirname)((0, import_node_path22.resolve)(bundlePath));
30511
30539
  const candidates = [
30512
- (0, import_node_path21.join)(bundleDirectory, "assets"),
30540
+ (0, import_node_path22.join)(bundleDirectory, "assets"),
30513
30541
  bundleDirectory,
30514
- (0, import_node_path21.resolve)(bundleDirectory, "..", "assets")
30542
+ (0, import_node_path22.resolve)(bundleDirectory, "..", "assets")
30515
30543
  ];
30516
30544
  const cwd = process.cwd();
30517
30545
  let projectDirectory = null;
30518
30546
  for (const start of [bundleDirectory, cwd]) {
30519
- let directory = (0, import_node_path21.resolve)(start);
30547
+ let directory = (0, import_node_path22.resolve)(start);
30520
30548
  while (true) {
30521
30549
  if (detectProject(directory)?.hasMetroConfig) {
30522
30550
  projectDirectory = directory;
30523
30551
  break;
30524
30552
  }
30525
- const parent = (0, import_node_path21.dirname)(directory);
30553
+ const parent = (0, import_node_path22.dirname)(directory);
30526
30554
  if (parent === directory) break;
30527
30555
  directory = parent;
30528
30556
  }
@@ -30530,11 +30558,11 @@ function searchMetroAssetDest(bundlePath, descriptors) {
30530
30558
  }
30531
30559
  if (projectDirectory) {
30532
30560
  candidates.push(
30533
- (0, import_node_path21.join)(projectDirectory, "assets"),
30534
- (0, import_node_path21.join)(projectDirectory, "dist"),
30535
- (0, import_node_path21.join)(projectDirectory, "dist", "assets"),
30536
- (0, import_node_path21.join)(projectDirectory, "build"),
30537
- (0, import_node_path21.join)(projectDirectory, "build", "assets")
30561
+ (0, import_node_path22.join)(projectDirectory, "assets"),
30562
+ (0, import_node_path22.join)(projectDirectory, "dist"),
30563
+ (0, import_node_path22.join)(projectDirectory, "dist", "assets"),
30564
+ (0, import_node_path22.join)(projectDirectory, "build"),
30565
+ (0, import_node_path22.join)(projectDirectory, "build", "assets")
30538
30566
  );
30539
30567
  }
30540
30568
  const searched = [];
@@ -30542,7 +30570,7 @@ function searchMetroAssetDest(bundlePath, descriptors) {
30542
30570
  const stale = [];
30543
30571
  let truncated = false;
30544
30572
  for (const candidate of candidates) {
30545
- const directory = (0, import_node_path21.resolve)(candidate);
30573
+ const directory = (0, import_node_path22.resolve)(candidate);
30546
30574
  if (searched.includes(directory)) continue;
30547
30575
  searched.push(directory);
30548
30576
  const listing = listMetroAssetDest(directory);
@@ -30648,7 +30676,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy) {
30648
30676
  );
30649
30677
  }
30650
30678
  const relative2 = placement?.files.get(variant.scale);
30651
- if (relative2 && dest) return (0, import_node_fs21.readFileSync)((0, import_node_path21.join)(dest.directory, relative2));
30679
+ if (relative2 && dest) return (0, import_node_fs21.readFileSync)((0, import_node_path22.join)(dest.directory, relative2));
30652
30680
  if (placement && placement.files.size > 0) return null;
30653
30681
  if (placement && placement.ambiguous.length > 0 && dest) {
30654
30682
  throw new Error(
@@ -30677,7 +30705,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy) {
30677
30705
  );
30678
30706
  const classic = metroIosAssetDestRelatives(variant.descriptor.httpServerLocation, filename)[0] ?? filename;
30679
30707
  throw new Error(
30680
- `${command} could not read ${(0, import_node_path21.join)(dest?.directory ?? ".", classic)} for ${variant.descriptor.name}.${variant.descriptor.type} at scale ${variant.scale}, and has no stand-in for a .${variant.descriptor.type} asset. Rebuild with \`react-native bundle --assets-dest\`.`
30708
+ `${command} could not read ${(0, import_node_path22.join)(dest?.directory ?? ".", classic)} for ${variant.descriptor.name}.${variant.descriptor.type} at scale ${variant.scale}, and has no stand-in for a .${variant.descriptor.type} asset. Rebuild with \`react-native bundle --assets-dest\`.`
30681
30709
  );
30682
30710
  });
30683
30711
  return {
@@ -30863,13 +30891,13 @@ function createCloudBridgeForParsed(parsed) {
30863
30891
  if (!session) return null;
30864
30892
  return session.service === "box" ? new CloudBoxBridge(session) : new CloudBridge(session);
30865
30893
  }
30866
- var import_node_crypto10, import_node_fs21, import_node_path21, DEFAULT_RNX_CLOUD_ORIGIN, MAX_RNX_CLOUD_BUNDLE_BYTES, REMOTE_COMMAND, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS, CloudBridge, CloudBoxBridge;
30894
+ var import_node_crypto10, import_node_fs21, import_node_path22, DEFAULT_RNX_CLOUD_ORIGIN, MAX_RNX_CLOUD_BUNDLE_BYTES, REMOTE_COMMAND, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS, CloudBridge, CloudBoxBridge;
30867
30895
  var init_cloud_client = __esm({
30868
30896
  "cli/cloud-client.ts"() {
30869
30897
  "use strict";
30870
30898
  import_node_crypto10 = require("node:crypto");
30871
30899
  import_node_fs21 = require("node:fs");
30872
- import_node_path21 = require("node:path");
30900
+ import_node_path22 = require("node:path");
30873
30901
  init_metroAssetArtifact();
30874
30902
  init_metroCloudArtifact();
30875
30903
  init_metro_fingerprint_registry_client();
@@ -33279,7 +33307,7 @@ var init_parent_pid = __esm({
33279
33307
 
33280
33308
  // cli/secure-file.ts
33281
33309
  function writeSecureJsonAtomic(filepath, value) {
33282
- (0, import_node_fs22.mkdirSync)((0, import_node_path22.dirname)(filepath), { recursive: true });
33310
+ (0, import_node_fs22.mkdirSync)((0, import_node_path23.dirname)(filepath), { recursive: true });
33283
33311
  const temporary = `${filepath}.tmp-${process.pid}-${(0, import_node_crypto11.randomUUID)()}`;
33284
33312
  let descriptor = null;
33285
33313
  try {
@@ -33297,13 +33325,13 @@ function writeSecureJsonAtomic(filepath, value) {
33297
33325
  throw error;
33298
33326
  }
33299
33327
  }
33300
- var import_node_crypto11, import_node_fs22, import_node_path22;
33328
+ var import_node_crypto11, import_node_fs22, import_node_path23;
33301
33329
  var init_secure_file = __esm({
33302
33330
  "cli/secure-file.ts"() {
33303
33331
  "use strict";
33304
33332
  import_node_crypto11 = require("node:crypto");
33305
33333
  import_node_fs22 = require("node:fs");
33306
- import_node_path22 = require("node:path");
33334
+ import_node_path23 = require("node:path");
33307
33335
  }
33308
33336
  });
33309
33337
 
@@ -33482,17 +33510,17 @@ function liveDevBridgeLockfiles() {
33482
33510
  return readDevBridgeLockfiles().filter((lockfile) => isDevBridgeLockfileFresh(lockfile));
33483
33511
  }
33484
33512
  function checkoutRoot(cwd) {
33485
- let current = import_node_path23.default.resolve(cwd);
33513
+ let current = import_node_path24.default.resolve(cwd);
33486
33514
  while (true) {
33487
- if (import_node_fs23.default.existsSync(import_node_path23.default.join(current, ".git"))) return current;
33488
- const parent = import_node_path23.default.dirname(current);
33515
+ if (import_node_fs23.default.existsSync(import_node_path24.default.join(current, ".git"))) return current;
33516
+ const parent = import_node_path24.default.dirname(current);
33489
33517
  if (parent === current) return null;
33490
33518
  current = parent;
33491
33519
  }
33492
33520
  }
33493
33521
  function pathContains(parent, child) {
33494
- const relative2 = import_node_path23.default.relative(parent, child);
33495
- return relative2 === "" || relative2 !== ".." && !relative2.startsWith(`..${import_node_path23.default.sep}`) && !import_node_path23.default.isAbsolute(relative2);
33522
+ const relative2 = import_node_path24.default.relative(parent, child);
33523
+ return relative2 === "" || relative2 !== ".." && !relative2.startsWith(`..${import_node_path24.default.sep}`) && !import_node_path24.default.isAbsolute(relative2);
33496
33524
  }
33497
33525
  function resolveDefaultDevBridgeLockfile() {
33498
33526
  const lockfiles = liveDevBridgeLockfiles();
@@ -33988,18 +34016,18 @@ async function evalInBridge(bridge, code, opts = {}) {
33988
34016
  if (opts.acquireLock) payload.acquireLock = true;
33989
34017
  return bridge.send(payload);
33990
34018
  }
33991
- async function callInBridge(bridge, path28, ...args) {
33992
- return bridge.send({ type: "call", path: path28, args });
34019
+ async function callInBridge(bridge, path29, ...args) {
34020
+ return bridge.send({ type: "call", path: path29, args });
33993
34021
  }
33994
- async function callInBridgeWrite(bridge, path28, ...args) {
33995
- return bridge.send({ type: "call", path: path28, args, acquireLock: true });
34022
+ async function callInBridgeWrite(bridge, path29, ...args) {
34023
+ return bridge.send({ type: "call", path: path29, args, acquireLock: true });
33996
34024
  }
33997
- var import_node_fs23, import_node_path23, import_ws2, PEACH_PLACEMENT_ENV, resolvedWorld, BridgeSimLockedError, BRIDGE_VALUE_FLAGS_TABLE, BRIDGE_VALUE_FLAGS;
34025
+ var import_node_fs23, import_node_path24, import_ws2, PEACH_PLACEMENT_ENV, resolvedWorld, BridgeSimLockedError, BRIDGE_VALUE_FLAGS_TABLE, BRIDGE_VALUE_FLAGS;
33998
34026
  var init_ws_bridge = __esm({
33999
34027
  "cli/ws-bridge.ts"() {
34000
34028
  "use strict";
34001
34029
  import_node_fs23 = __toESM(require("node:fs"), 1);
34002
- import_node_path23 = __toESM(require("node:path"), 1);
34030
+ import_node_path24 = __toESM(require("node:path"), 1);
34003
34031
  import_ws2 = require("ws");
34004
34032
  init_bridge_constants();
34005
34033
  init_cli_constants();
@@ -34127,8 +34155,8 @@ function getDefaultPortForProtocol(protocol) {
34127
34155
  return protocol === "https:" ? 443 : 80;
34128
34156
  }
34129
34157
  function isBaseServerUrl(url) {
34130
- const path28 = url.pathname || "/";
34131
- return (path28 === "/" || path28 === "") && !url.search && !url.hash;
34158
+ const path29 = url.pathname || "/";
34159
+ return (path29 === "/" || path29 === "") && !url.search && !url.hash;
34132
34160
  }
34133
34161
  async function resolvePortViaServerScan(port) {
34134
34162
  try {
@@ -34356,14 +34384,14 @@ function readProjectDotEnv(envsRoot, env = process.env) {
34356
34384
  const notices = [];
34357
34385
  const selection = selectEnvFile(env, notices);
34358
34386
  const requestedPaths = [
34359
- import_node_path24.default.resolve(import_node_path24.default.join(envsRoot, selection.name)),
34360
- import_node_path24.default.resolve(selection.name)
34387
+ import_node_path25.default.resolve(import_node_path25.default.join(envsRoot, selection.name)),
34388
+ import_node_path25.default.resolve(selection.name)
34361
34389
  ];
34362
34390
  const candidates = [
34363
34391
  ...requestedPaths,
34364
- import_node_path24.default.resolve(import_node_path24.default.join(envsRoot, DEFAULT_ENV_FILE))
34392
+ import_node_path25.default.resolve(import_node_path25.default.join(envsRoot, DEFAULT_ENV_FILE))
34365
34393
  ];
34366
- if (!import_node_fs24.default.existsSync(candidates[2])) candidates.push(import_node_path24.default.resolve(DEFAULT_ENV_FILE));
34394
+ if (!import_node_fs24.default.existsSync(candidates[2])) candidates.push(import_node_path25.default.resolve(DEFAULT_ENV_FILE));
34367
34395
  const tried = [...new Set(candidates)];
34368
34396
  const resolved = tried.find((candidate) => import_node_fs24.default.existsSync(candidate));
34369
34397
  if (!resolved) {
@@ -34395,12 +34423,12 @@ function readProjectDotEnv(envsRoot, env = process.env) {
34395
34423
  }
34396
34424
  return { config, notices };
34397
34425
  }
34398
- var import_node_fs24, import_node_path24, DEFAULT_ENV_FILE, DOTENV_PATTERN, BUILD_SETTING_PATTERN, INVALID_ENTRY;
34426
+ var import_node_fs24, import_node_path25, DEFAULT_ENV_FILE, DOTENV_PATTERN, BUILD_SETTING_PATTERN, INVALID_ENTRY;
34399
34427
  var init_dot_env = __esm({
34400
34428
  "src/dot-env.ts"() {
34401
34429
  "use strict";
34402
34430
  import_node_fs24 = __toESM(require("node:fs"), 1);
34403
- import_node_path24 = __toESM(require("node:path"), 1);
34431
+ import_node_path25 = __toESM(require("node:path"), 1);
34404
34432
  DEFAULT_ENV_FILE = ".env";
34405
34433
  DOTENV_PATTERN = /^(?:export[ \t\n\v\f\r]+|)(?<key>[\p{Alphabetic}\p{Nd}_]+)[ \t\n\v\f\r]*=[ \t\n\v\f\r]*((?<quote>["'])?(?<val>[^\n]*?[^\\\n])\k<quote>?|)$/u;
34406
34434
  BUILD_SETTING_PATTERN = /\$[({]([A-Za-z_][A-Za-z0-9_]*)[)}]|\$([A-Za-z_][A-Za-z0-9_]*)/g;
@@ -34424,7 +34452,7 @@ var init_flow_timeout_scale = __esm({
34424
34452
  function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34425
34453
  const result = {};
34426
34454
  let config = {};
34427
- const appJsonPath = import_node_path25.default.join(projectRoot, "app.json");
34455
+ const appJsonPath = import_node_path26.default.join(projectRoot, "app.json");
34428
34456
  const appJson = import_node_fs25.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs25.default.readFileSync(appJsonPath, "utf8")) : null;
34429
34457
  const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
34430
34458
  (value) => isRecord(value) && typeof value.googleServicesFile === "string"
@@ -34434,9 +34462,9 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34434
34462
  "app.config.ts",
34435
34463
  "app.config.cjs",
34436
34464
  "app.config.mjs"
34437
- ].some((name2) => import_node_fs25.default.existsSync(import_node_path25.default.join(projectRoot, name2)));
34465
+ ].some((name2) => import_node_fs25.default.existsSync(import_node_path26.default.join(projectRoot, name2)));
34438
34466
  if (staticExpo || dynamicExpo) {
34439
- const require5 = (0, import_node_module2.createRequire)(import_node_path25.default.join(projectRoot, "package.json"));
34467
+ const require5 = (0, import_node_module2.createRequire)(import_node_path26.default.join(projectRoot, "package.json"));
34440
34468
  const configModule = require5("@expo/config");
34441
34469
  if (!isRecord(configModule) || typeof configModule.getConfig !== "function")
34442
34470
  throw new Error("Expo native configuration is unavailable.");
@@ -34448,18 +34476,18 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34448
34476
  }
34449
34477
  const ios = config.ios;
34450
34478
  if (platforms.includes("ios") && (!isRecord(ios) || typeof ios.googleServicesFile !== "string")) {
34451
- const iosRoot = import_node_path25.default.join(projectRoot, "ios");
34479
+ const iosRoot = import_node_path26.default.join(projectRoot, "ios");
34452
34480
  if (import_node_fs25.default.existsSync(iosRoot)) {
34453
34481
  const projects2 = import_node_fs25.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
34454
34482
  if (projects2.length > 1)
34455
34483
  throw new Error("native Firebase configuration requires a selected Xcode project");
34456
34484
  if (projects2.length === 1) {
34457
- const require5 = (0, import_node_module2.createRequire)(import_node_path25.default.join(projectRoot, "package.json"));
34485
+ const require5 = (0, import_node_module2.createRequire)(import_node_path26.default.join(projectRoot, "package.json"));
34458
34486
  const xcode = require5("xcode");
34459
34487
  if (!isRecord(xcode) || typeof xcode.project !== "function")
34460
34488
  throw new Error("native Xcode project parser is unavailable");
34461
34489
  const project = Reflect.apply(xcode.project, xcode, [
34462
- import_node_path25.default.join(iosRoot, projects2[0].name, "project.pbxproj")
34490
+ import_node_path26.default.join(iosRoot, projects2[0].name, "project.pbxproj")
34463
34491
  ]);
34464
34492
  if (!isRecord(project) || typeof project.parseSync !== "function")
34465
34493
  throw new Error("native Xcode project is malformed");
@@ -34499,7 +34527,7 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34499
34527
  const sourceTree = unquote(group.sourceTree);
34500
34528
  if (sourceTree && sourceTree !== "<group>" && sourceTree !== "SOURCE_ROOT")
34501
34529
  continue;
34502
- const directory = import_node_path25.default.resolve(
34530
+ const directory = import_node_path26.default.resolve(
34503
34531
  sourceTree === "SOURCE_ROOT" ? iosRoot : item.base,
34504
34532
  unquote(group.path)
34505
34533
  );
@@ -34513,7 +34541,7 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34513
34541
  if (!isRecord(file)) continue;
34514
34542
  const tree = unquote(file.sourceTree);
34515
34543
  if (tree !== "<group>" && tree !== "SOURCE_ROOT") continue;
34516
- const filePath = import_node_path25.default.resolve(
34544
+ const filePath = import_node_path26.default.resolve(
34517
34545
  tree === "SOURCE_ROOT" ? iosRoot : directory,
34518
34546
  unquote(file.path)
34519
34547
  );
@@ -34535,7 +34563,7 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34535
34563
  const file = buildFiles[entry.value];
34536
34564
  if (!isRecord(file) || typeof file.fileRef !== "string") continue;
34537
34565
  const reference = references[file.fileRef];
34538
- if (!isRecord(reference) || !name2.test(import_node_path25.default.basename(unquote(reference.path))))
34566
+ if (!isRecord(reference) || !name2.test(import_node_path26.default.basename(unquote(reference.path))))
34539
34567
  continue;
34540
34568
  const candidates = filePaths.get(file.fileRef);
34541
34569
  if (!candidates || candidates.size !== 1)
@@ -34585,7 +34613,7 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34585
34613
  throw new Error(
34586
34614
  "native Firebase default initialization requires one GoogleService-Info.plist build resource"
34587
34615
  );
34588
- config.ios = { googleServicesFile: import_node_path25.default.relative(projectRoot, resources[0]) };
34616
+ config.ios = { googleServicesFile: import_node_path26.default.relative(projectRoot, resources[0]) };
34589
34617
  }
34590
34618
  }
34591
34619
  }
@@ -34596,7 +34624,7 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34596
34624
  if (!isRecord(native) || typeof native.googleServicesFile !== "string") continue;
34597
34625
  try {
34598
34626
  const source = import_node_fs25.default.readFileSync(
34599
- import_node_path25.default.resolve(projectRoot, native.googleServicesFile),
34627
+ import_node_path26.default.resolve(projectRoot, native.googleServicesFile),
34600
34628
  "utf8"
34601
34629
  );
34602
34630
  const parsed = platform === "ios" ? parsePlistSource(source) : JSON.parse(source);
@@ -34648,13 +34676,13 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34648
34676
  }
34649
34677
  return result;
34650
34678
  }
34651
- var import_node_fs25, import_node_module2, import_node_path25;
34679
+ var import_node_fs25, import_node_module2, import_node_path26;
34652
34680
  var init_native_firebase_config = __esm({
34653
34681
  "src/native-firebase-config.ts"() {
34654
34682
  "use strict";
34655
34683
  import_node_fs25 = __toESM(require("node:fs"), 1);
34656
34684
  import_node_module2 = require("node:module");
34657
- import_node_path25 = __toESM(require("node:path"), 1);
34685
+ import_node_path26 = __toESM(require("node:path"), 1);
34658
34686
  init_is_record();
34659
34687
  init_plist();
34660
34688
  }
@@ -34781,45 +34809,45 @@ function readText(file) {
34781
34809
  }
34782
34810
  function catalogFiles(dir, found) {
34783
34811
  for (const entry of listDir(dir)) {
34784
- const full = import_node_path26.default.join(dir, entry.name);
34812
+ const full = import_node_path27.default.join(dir, entry.name);
34785
34813
  if (entry.isDirectory()) catalogFiles(full, found);
34786
34814
  else if (entry.name === "Contents.json") found.push(full);
34787
34815
  }
34788
34816
  }
34789
34817
  function discoverAppCatalog(appDir) {
34790
- const iosDir = import_node_path26.default.join(appDir, "ios");
34818
+ const iosDir = import_node_path27.default.join(appDir, "ios");
34791
34819
  const target = listDir(iosDir).find(
34792
- (entry) => entry.isDirectory() && entry.name !== "Pods" && listDir(import_node_path26.default.join(iosDir, entry.name)).some(
34820
+ (entry) => entry.isDirectory() && entry.name !== "Pods" && listDir(import_node_path27.default.join(iosDir, entry.name)).some(
34793
34821
  (file) => /^AppDelegate\.(swift|mm|m)$/.test(file.name)
34794
34822
  )
34795
34823
  );
34796
34824
  if (!target) return null;
34797
- const targetDir = import_node_path26.default.join(iosDir, target.name);
34825
+ const targetDir = import_node_path27.default.join(iosDir, target.name);
34798
34826
  const files = [];
34799
34827
  for (const entry of listDir(targetDir)) {
34800
34828
  if (entry.isDirectory() && entry.name.endsWith(".xcassets"))
34801
- catalogFiles(import_node_path26.default.join(targetDir, entry.name), files);
34829
+ catalogFiles(import_node_path27.default.join(targetDir, entry.name), files);
34802
34830
  }
34803
34831
  const relative2 = files.map(
34804
- (file) => import_node_path26.default.relative(targetDir, file).split(import_node_path26.default.sep).join(import_node_path26.default.posix.sep)
34832
+ (file) => import_node_path27.default.relative(targetDir, file).split(import_node_path27.default.sep).join(import_node_path27.default.posix.sep)
34805
34833
  );
34806
34834
  const colors = enumerateBundleColors(
34807
34835
  relative2,
34808
- (candidate) => candidate.endsWith("Contents.json") ? readText(import_node_path26.default.join(targetDir, candidate)) : null
34836
+ (candidate) => candidate.endsWith("Contents.json") ? readText(import_node_path27.default.join(targetDir, candidate)) : null
34809
34837
  );
34810
34838
  const pbxproj = listDir(iosDir).find((entry) => entry.name.endsWith(".xcodeproj"));
34811
- const accentName = readText(import_node_path26.default.join(targetDir, "Info.plist"))?.match(PLIST_ACCENT)?.[1] ?? (pbxproj ? readText(import_node_path26.default.join(iosDir, pbxproj.name, "project.pbxproj"))?.match(
34839
+ const accentName = readText(import_node_path27.default.join(targetDir, "Info.plist"))?.match(PLIST_ACCENT)?.[1] ?? (pbxproj ? readText(import_node_path27.default.join(iosDir, pbxproj.name, "project.pbxproj"))?.match(
34812
34840
  ACCENT_BUILD_SETTING
34813
34841
  )?.[1] : void 0) ?? null;
34814
34842
  if (accentName === null && Object.keys(colors).length === 0) return null;
34815
34843
  return { colors, accentName };
34816
34844
  }
34817
- var import_node_fs26, import_node_path26, ACCENT_BUILD_SETTING, PLIST_ACCENT;
34845
+ var import_node_fs26, import_node_path27, ACCENT_BUILD_SETTING, PLIST_ACCENT;
34818
34846
  var init_app_catalog = __esm({
34819
34847
  "cli/app-catalog.ts"() {
34820
34848
  "use strict";
34821
34849
  import_node_fs26 = __toESM(require("node:fs"), 1);
34822
- import_node_path26 = __toESM(require("node:path"), 1);
34850
+ import_node_path27 = __toESM(require("node:path"), 1);
34823
34851
  init_bundleAssets();
34824
34852
  ACCENT_BUILD_SETTING = /ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "?([^";]+)"?;/;
34825
34853
  PLIST_ACCENT = /<key>NSAccentColorName<\/key>\s*<string>([^<]+)<\/string>/;
@@ -34829,7 +34857,7 @@ var init_app_catalog = __esm({
34829
34857
  // cli/app-project.ts
34830
34858
  function firstNamedFile(dir, names) {
34831
34859
  for (const name2 of names) {
34832
- const candidate = import_node_path27.default.join(dir, name2);
34860
+ const candidate = import_node_path28.default.join(dir, name2);
34833
34861
  try {
34834
34862
  if (import_node_fs27.default.statSync(candidate).isFile()) return candidate;
34835
34863
  } catch {
@@ -34844,24 +34872,24 @@ function findRNXAppConfig(dir) {
34844
34872
  return firstNamedFile(dir, PEACH_APP_CONFIG_NAMES);
34845
34873
  }
34846
34874
  function resolveAppProject(projectRoot) {
34847
- const appDir = import_node_path27.default.resolve(projectRoot);
34875
+ const appDir = import_node_path28.default.resolve(projectRoot);
34848
34876
  try {
34849
34877
  if (!import_node_fs27.default.statSync(appDir).isDirectory()) return null;
34850
34878
  } catch {
34851
34879
  return null;
34852
34880
  }
34853
34881
  const configPath = findRNXAppConfig(appDir);
34854
- if (!configPath && !findExpoAppConfig(appDir) && !import_node_fs27.default.existsSync(import_node_path27.default.join(appDir, "package.json"))) {
34882
+ if (!configPath && !findExpoAppConfig(appDir) && !import_node_fs27.default.existsSync(import_node_path28.default.join(appDir, "package.json"))) {
34855
34883
  return null;
34856
34884
  }
34857
34885
  return { appDir, configPath };
34858
34886
  }
34859
- var import_node_fs27, import_node_path27, EXPO_APP_CONFIG_NAMES, PEACH_APP_CONFIG_NAMES;
34887
+ var import_node_fs27, import_node_path28, EXPO_APP_CONFIG_NAMES, PEACH_APP_CONFIG_NAMES;
34860
34888
  var init_app_project = __esm({
34861
34889
  "cli/app-project.ts"() {
34862
34890
  "use strict";
34863
34891
  import_node_fs27 = __toESM(require("node:fs"), 1);
34864
- import_node_path27 = __toESM(require("node:path"), 1);
34892
+ import_node_path28 = __toESM(require("node:path"), 1);
34865
34893
  EXPO_APP_CONFIG_NAMES = [
34866
34894
  "app.config.js",
34867
34895
  "app.config.ts",
@@ -34893,12 +34921,12 @@ function resolveFileEntries(entries, configDir) {
34893
34921
  return Object.fromEntries(
34894
34922
  Object.entries(entries).map(([name2, resolution]) => [
34895
34923
  name2,
34896
- resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path28.default.resolve(configDir, resolution.file) } : resolution
34924
+ resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path29.default.resolve(configDir, resolution.file) } : resolution
34897
34925
  ])
34898
34926
  );
34899
34927
  }
34900
34928
  function resolveConfigReplacementFiles(config, configPath) {
34901
- const configDir = import_node_path28.default.dirname(configPath);
34929
+ const configDir = import_node_path29.default.dirname(configPath);
34902
34930
  return {
34903
34931
  ...config,
34904
34932
  modules: resolveFileEntries(config.modules, configDir),
@@ -34932,12 +34960,12 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
34932
34960
  const project = resolveAppProject(startDir);
34933
34961
  return { project, config: await loadRNXAppConfig(project) };
34934
34962
  }
34935
- var import_node_module3, import_node_path28, import_jiti, require2;
34963
+ var import_node_module3, import_node_path29, import_jiti, require2;
34936
34964
  var init_app_config = __esm({
34937
34965
  "cli/app-config.ts"() {
34938
34966
  "use strict";
34939
34967
  import_node_module3 = require("node:module");
34940
- import_node_path28 = __toESM(require("node:path"), 1);
34968
+ import_node_path29 = __toESM(require("node:path"), 1);
34941
34969
  init_src();
34942
34970
  import_jiti = require("jiti");
34943
34971
  init_public_brand();
@@ -35000,7 +35028,7 @@ function discoverNativeLinkedAppFonts(opts) {
35000
35028
  }
35001
35029
  for (const entry of entries) {
35002
35030
  if (entry.isSymbolicLink()) continue;
35003
- const fullPath = import_node_path29.default.join(current.dir, entry.name);
35031
+ const fullPath = import_node_path30.default.join(current.dir, entry.name);
35004
35032
  if (entry.isDirectory()) {
35005
35033
  if (current.depth < 4 && pending.length < 64 && !entry.name.startsWith(".")) {
35006
35034
  pending.push({ dir: fullPath, depth: current.depth + 1 });
@@ -35008,15 +35036,15 @@ function discoverNativeLinkedAppFonts(opts) {
35008
35036
  continue;
35009
35037
  }
35010
35038
  if (!entry.isFile() || !/\.(ttf|otf|woff|woff2)$/i.test(entry.name)) continue;
35011
- const relative2 = import_node_path29.default.relative(root, fullPath).split(import_node_path29.default.sep).join("/");
35012
- fontPaths.push(import_node_path29.default.posix.join(metroPathPrefix, relative2));
35039
+ const relative2 = import_node_path30.default.relative(root, fullPath).split(import_node_path30.default.sep).join("/");
35040
+ fontPaths.push(import_node_path30.default.posix.join(metroPathPrefix, relative2));
35013
35041
  if (fontPaths.length >= 256) break;
35014
35042
  }
35015
35043
  }
35016
35044
  };
35017
35045
  try {
35018
35046
  const packageJson = JSON.parse(
35019
- import_node_fs28.default.readFileSync(import_node_path29.default.join(selectedAppDir, "package.json"), "utf8")
35047
+ import_node_fs28.default.readFileSync(import_node_path30.default.join(selectedAppDir, "package.json"), "utf8")
35020
35048
  );
35021
35049
  const dependencyNames = /* @__PURE__ */ new Set();
35022
35050
  for (const field of ["dependencies", "devDependencies", "optionalDependencies"]) {
@@ -35031,32 +35059,32 @@ function discoverNativeLinkedAppFonts(opts) {
35031
35059
  const config = Reflect.get(packageJson, "reactNativeVectorIcons");
35032
35060
  const configuredFontDir = config && typeof config === "object" ? Reflect.get(config, "fontDir") : null;
35033
35061
  const configuredDir = typeof configuredFontDir === "string" ? configuredFontDir : "rnvi-fonts";
35034
- const root = import_node_path29.default.resolve(selectedAppDir, configuredDir);
35035
- const relativeRoot = import_node_path29.default.relative(selectedAppDir, root);
35036
- if (!relativeRoot.startsWith("..") && !import_node_path29.default.isAbsolute(relativeRoot)) {
35037
- collectFontFiles(root, relativeRoot.split(import_node_path29.default.sep).join("/"));
35062
+ const root = import_node_path30.default.resolve(selectedAppDir, configuredDir);
35063
+ const relativeRoot = import_node_path30.default.relative(selectedAppDir, root);
35064
+ if (!relativeRoot.startsWith("..") && !import_node_path30.default.isAbsolute(relativeRoot)) {
35065
+ collectFontFiles(root, relativeRoot.split(import_node_path30.default.sep).join("/"));
35038
35066
  }
35039
- const bundleDir = import_node_path29.default.posix.dirname(new URL(opts.bundleUrl).pathname).replace(/^\/+/, "");
35040
- const appRelativeDir = bundleDir.split("/").join(import_node_path29.default.sep);
35067
+ const bundleDir = import_node_path30.default.posix.dirname(new URL(opts.bundleUrl).pathname).replace(/^\/+/, "");
35068
+ const appRelativeDir = bundleDir.split("/").join(import_node_path30.default.sep);
35041
35069
  const metroRootCandidates = [selectedAppDir];
35042
- if (bundleDir && selectedAppDir.endsWith(import_node_path29.default.sep + appRelativeDir)) {
35070
+ if (bundleDir && selectedAppDir.endsWith(import_node_path30.default.sep + appRelativeDir)) {
35043
35071
  metroRootCandidates.push(selectedAppDir.slice(0, -appRelativeDir.length - 1));
35044
35072
  }
35045
- const vectorIconRequire = (0, import_node_module4.createRequire)(import_node_path29.default.join(selectedAppDir, "package.json"));
35073
+ const vectorIconRequire = (0, import_node_module4.createRequire)(import_node_path30.default.join(selectedAppDir, "package.json"));
35046
35074
  for (const dependencyName of vectorIconDependencies) {
35047
35075
  try {
35048
35076
  const entryPath = vectorIconRequire.resolve(dependencyName);
35049
- const dependencyPath = dependencyName.split("/").join(import_node_path29.default.sep);
35050
- const marker = `${import_node_path29.default.sep}node_modules${import_node_path29.default.sep}${dependencyPath}${import_node_path29.default.sep}`;
35077
+ const dependencyPath = dependencyName.split("/").join(import_node_path30.default.sep);
35078
+ const marker = `${import_node_path30.default.sep}node_modules${import_node_path30.default.sep}${dependencyPath}${import_node_path30.default.sep}`;
35051
35079
  const markerIndex = entryPath.lastIndexOf(marker);
35052
35080
  if (markerIndex === -1) continue;
35053
35081
  const packageRoot = entryPath.slice(0, markerIndex + marker.length - 1);
35054
35082
  const fontsDir = dependencyName === "react-native-vector-icons" ? "Fonts" : "fonts";
35055
- const fontsRoot = import_node_path29.default.join(packageRoot, fontsDir);
35083
+ const fontsRoot = import_node_path30.default.join(packageRoot, fontsDir);
35056
35084
  for (const metroRoot of metroRootCandidates) {
35057
35085
  collectFontFiles(
35058
35086
  fontsRoot,
35059
- import_node_path29.default.relative(metroRoot, fontsRoot).split(import_node_path29.default.sep).join("/")
35087
+ import_node_path30.default.relative(metroRoot, fontsRoot).split(import_node_path30.default.sep).join("/")
35060
35088
  );
35061
35089
  }
35062
35090
  } catch {
@@ -35066,32 +35094,32 @@ function discoverNativeLinkedAppFonts(opts) {
35066
35094
  } catch {
35067
35095
  }
35068
35096
  try {
35069
- const configPath = import_node_path29.default.join(selectedAppDir, "react-native.config.js");
35097
+ const configPath = import_node_path30.default.join(selectedAppDir, "react-native.config.js");
35070
35098
  if (import_node_fs28.default.statSync(configPath).isFile()) {
35071
- const appConfigRequire = (0, import_node_module4.createRequire)(import_node_path29.default.join(selectedAppDir, "package.json"));
35099
+ const appConfigRequire = (0, import_node_module4.createRequire)(import_node_path30.default.join(selectedAppDir, "package.json"));
35072
35100
  const rnConfig = appConfigRequire(configPath);
35073
35101
  const assets2 = rnConfig && typeof rnConfig === "object" ? Reflect.get(rnConfig, "assets") : null;
35074
35102
  if (Array.isArray(assets2)) {
35075
35103
  for (const assetDir of assets2) {
35076
35104
  if (typeof assetDir !== "string") continue;
35077
- const root = import_node_path29.default.resolve(selectedAppDir, assetDir);
35078
- const relativeRoot = import_node_path29.default.relative(selectedAppDir, root);
35079
- if (relativeRoot.startsWith("..") || import_node_path29.default.isAbsolute(relativeRoot)) continue;
35080
- collectFontFiles(root, relativeRoot.split(import_node_path29.default.sep).join("/"));
35105
+ const root = import_node_path30.default.resolve(selectedAppDir, assetDir);
35106
+ const relativeRoot = import_node_path30.default.relative(selectedAppDir, root);
35107
+ if (relativeRoot.startsWith("..") || import_node_path30.default.isAbsolute(relativeRoot)) continue;
35108
+ collectFontFiles(root, relativeRoot.split(import_node_path30.default.sep).join("/"));
35081
35109
  }
35082
35110
  }
35083
35111
  }
35084
35112
  } catch {
35085
35113
  }
35086
35114
  if (platform === "ios") {
35087
- const iosDir = import_node_path29.default.join(selectedAppDir, "ios");
35115
+ const iosDir = import_node_path30.default.join(selectedAppDir, "ios");
35088
35116
  try {
35089
35117
  const targetDirs = import_node_fs28.default.readdirSync(iosDir, { withFileTypes: true }).filter(
35090
35118
  (entry) => entry.isDirectory() && !entry.isSymbolicLink() && entry.name !== "Pods" && entry.name !== "build" && !entry.name.startsWith(".")
35091
35119
  ).slice(0, 64);
35092
- const plistPaths = [import_node_path29.default.join(iosDir, "Info.plist")];
35120
+ const plistPaths = [import_node_path30.default.join(iosDir, "Info.plist")];
35093
35121
  for (const entry of targetDirs) {
35094
- plistPaths.push(import_node_path29.default.join(iosDir, entry.name, "Info.plist"));
35122
+ plistPaths.push(import_node_path30.default.join(iosDir, entry.name, "Info.plist"));
35095
35123
  }
35096
35124
  for (const plistPath of plistPaths) {
35097
35125
  let parsed;
@@ -35106,12 +35134,12 @@ function discoverNativeLinkedAppFonts(opts) {
35106
35134
  for (const declaredFont of declaredFonts) {
35107
35135
  if (typeof declaredFont !== "string") continue;
35108
35136
  const candidates = [
35109
- import_node_path29.default.resolve(import_node_path29.default.dirname(plistPath), declaredFont),
35110
- import_node_path29.default.resolve(iosDir, declaredFont)
35137
+ import_node_path30.default.resolve(import_node_path30.default.dirname(plistPath), declaredFont),
35138
+ import_node_path30.default.resolve(iosDir, declaredFont)
35111
35139
  ];
35112
35140
  const fontPath = candidates.find((candidate) => {
35113
- const relative2 = import_node_path29.default.relative(selectedAppDir, candidate);
35114
- if (relative2.startsWith("..") || import_node_path29.default.isAbsolute(relative2)) return false;
35141
+ const relative2 = import_node_path30.default.relative(selectedAppDir, candidate);
35142
+ if (relative2.startsWith("..") || import_node_path30.default.isAbsolute(relative2)) return false;
35115
35143
  try {
35116
35144
  return import_node_fs28.default.statSync(candidate).isFile();
35117
35145
  } catch {
@@ -35120,7 +35148,7 @@ function discoverNativeLinkedAppFonts(opts) {
35120
35148
  });
35121
35149
  if (!fontPath) continue;
35122
35150
  fontPaths.push(
35123
- import_node_path29.default.relative(selectedAppDir, fontPath).split(import_node_path29.default.sep).join("/")
35151
+ import_node_path30.default.relative(selectedAppDir, fontPath).split(import_node_path30.default.sep).join("/")
35124
35152
  );
35125
35153
  }
35126
35154
  }
@@ -35162,13 +35190,13 @@ async function resolveMetroProjectRoot(bundleUrl, opts) {
35162
35190
  function encodeAppFontsWire(specs) {
35163
35191
  return specs.map((spec) => `${encodeURIComponent(spec.url)}::${encodeURIComponent(spec.family)}`).join(",");
35164
35192
  }
35165
- var import_node_fs28, import_node_module4, import_node_path29, import_config_plugin_fonts, require3;
35193
+ var import_node_fs28, import_node_module4, import_node_path30, import_config_plugin_fonts, require3;
35166
35194
  var init_app_fonts = __esm({
35167
35195
  "cli/app-fonts.ts"() {
35168
35196
  "use strict";
35169
35197
  import_node_fs28 = __toESM(require("node:fs"), 1);
35170
35198
  import_node_module4 = require("node:module");
35171
- import_node_path29 = __toESM(require("node:path"), 1);
35199
+ import_node_path30 = __toESM(require("node:path"), 1);
35172
35200
  import_config_plugin_fonts = require("peach-engine/engine/config-plugin-fonts");
35173
35201
  init_dev_server_scanner();
35174
35202
  init_backend_origin();
@@ -37608,8 +37636,8 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
37608
37636
  };
37609
37637
  }
37610
37638
  const lock = parseLinuxBrowserLibsLock(linux_browser_libs_lock_default);
37611
- const dir = (0, import_node_path30.join)(rnxHomeDir(), "linux-libs", `${lock.id}-${arch}`);
37612
- if (!(0, import_node_fs29.existsSync)((0, import_node_path30.join)(dir, LINUX_BROWSER_LIBS_MARKER))) {
37639
+ const dir = (0, import_node_path31.join)(rnxHomeDir(), "linux-libs", `${lock.id}-${arch}`);
37640
+ if (!(0, import_node_fs29.existsSync)((0, import_node_path31.join)(dir, LINUX_BROWSER_LIBS_MARKER))) {
37613
37641
  const url = `${DEFAULT_CLI_RELEASE_ORIGIN}/${linuxBrowserLibsKey(lock.id, arch)}`;
37614
37642
  process.stderr.write(
37615
37643
  `peach: this system lacks ${missing.length} shared libraries ${browser} links; downloading them\u2026
@@ -37637,7 +37665,7 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
37637
37665
  };
37638
37666
  }
37639
37667
  }
37640
- const libraryPath = [(0, import_node_path30.join)(dir, "lib"), (0, import_node_path30.join)(dir, "lib", "nss")].join(":");
37668
+ const libraryPath = [(0, import_node_path31.join)(dir, "lib"), (0, import_node_path31.join)(dir, "lib", "nss")].join(":");
37641
37669
  const stillMissing = missingLibraries(executablePath, libraryPath);
37642
37670
  if (stillMissing.length) {
37643
37671
  return {
@@ -37647,13 +37675,13 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
37647
37675
  }
37648
37676
  return { ok: true, libraryPath };
37649
37677
  }
37650
- var import_node_child_process9, import_node_fs29, import_node_path30, LINUX_BROWSER_LIBS_ARCHES, LINUX_BROWSER_LIBS_MARKER;
37678
+ var import_node_child_process9, import_node_fs29, import_node_path31, LINUX_BROWSER_LIBS_ARCHES, LINUX_BROWSER_LIBS_MARKER;
37651
37679
  var init_linux_browser_libs = __esm({
37652
37680
  "cli/drivers/linux-browser-libs.ts"() {
37653
37681
  "use strict";
37654
37682
  import_node_child_process9 = require("node:child_process");
37655
37683
  import_node_fs29 = require("node:fs");
37656
- import_node_path30 = require("node:path");
37684
+ import_node_path31 = require("node:path");
37657
37685
  init_src();
37658
37686
  init_home_paths();
37659
37687
  init_is_record();
@@ -37682,7 +37710,7 @@ function resolvePlaywright() {
37682
37710
  const corePackagePath = (0, import_node_module6.createRequire)(modulePath).resolve(
37683
37711
  "playwright-core/package.json"
37684
37712
  );
37685
- const cliPath = (0, import_node_path31.join)((0, import_node_path31.dirname)(corePackagePath), "cli.js");
37713
+ const cliPath = (0, import_node_path32.join)((0, import_node_path32.dirname)(corePackagePath), "cli.js");
37686
37714
  if (!(0, import_node_fs30.existsSync)(cliPath)) continue;
37687
37715
  return {
37688
37716
  spec,
@@ -37711,7 +37739,7 @@ async function provisionPlaywright() {
37711
37739
  await installVerifiedTarball({
37712
37740
  url: `https://registry.npmjs.org/playwright-core/-/playwright-core-${version}.tgz`,
37713
37741
  digest: { algorithm, encoding: "base64", value: digest },
37714
- destDir: (0, import_node_path31.join)(playwrightCoreDir(version), "node_modules", "playwright-core"),
37742
+ destDir: (0, import_node_path32.join)(playwrightCoreDir(version), "node_modules", "playwright-core"),
37715
37743
  installedMarker: "package.json",
37716
37744
  // npm tarballs hold the package under a leading `package/`
37717
37745
  stripComponents: 1,
@@ -37822,14 +37850,14 @@ ${detail}` : ""}`
37822
37850
  libraryPath: libraries.libraryPath
37823
37851
  };
37824
37852
  }
37825
- var import_node_child_process10, import_node_fs30, import_node_module6, import_node_path31;
37853
+ var import_node_child_process10, import_node_fs30, import_node_module6, import_node_path32;
37826
37854
  var init_playwright_provisioning = __esm({
37827
37855
  "cli/drivers/playwright-provisioning.ts"() {
37828
37856
  "use strict";
37829
37857
  import_node_child_process10 = require("node:child_process");
37830
37858
  import_node_fs30 = require("node:fs");
37831
37859
  import_node_module6 = require("node:module");
37832
- import_node_path31 = require("node:path");
37860
+ import_node_path32 = require("node:path");
37833
37861
  init_src();
37834
37862
  init_home_paths();
37835
37863
  init_is_record();
@@ -38173,7 +38201,7 @@ var init_parse_args = __esm({
38173
38201
  // cli/telemetry.ts
38174
38202
  function sanitizeDiagnosticMessage(value) {
38175
38203
  const firstLine = value.slice(0, 2048).split(/[\r\n\u2028\u2029]/, 1)[0] ?? "";
38176
- return firstLine.split((0, import_node_os6.homedir)()).join("<home>").replace(
38204
+ return firstLine.split((0, import_node_os7.homedir)()).join("<home>").replace(
38177
38205
  /<package:(?:@[\w.-]+\/)?[\w.-]+>|(?:https?:\/\/|file:\/\/|[A-Za-z]:[\\/]|<home>[\\/]|\/|\.{1,2}[\\/]|\b[\w.-]+[\\/])(?:[^\s"'<>]|\s(?=[^"'<>]*[\\/]))+/g,
38178
38206
  (location2) => {
38179
38207
  if (location2.startsWith("<package:")) return location2;
@@ -38200,11 +38228,11 @@ function trackCliDiagnostic(diagnostic) {
38200
38228
  if (queue.some((queued) => JSON.stringify(queued) === JSON.stringify(entry))) return;
38201
38229
  queue.push(entry);
38202
38230
  }
38203
- var import_node_os6, import_crash_fingerprint, observedRuntimeVersion, queue, CRASH_REPORT_EVERY_MS;
38231
+ var import_node_os7, import_crash_fingerprint, observedRuntimeVersion, queue, CRASH_REPORT_EVERY_MS;
38204
38232
  var init_telemetry = __esm({
38205
38233
  "cli/telemetry.ts"() {
38206
38234
  "use strict";
38207
- import_node_os6 = require("node:os");
38235
+ import_node_os7 = require("node:os");
38208
38236
  import_crash_fingerprint = require("peach-engine/crash-fingerprint");
38209
38237
  init_cli_version();
38210
38238
  init_home_paths();
@@ -38270,11 +38298,11 @@ var init_runtime_diagnostics = __esm({
38270
38298
  // cli/commands/skills.ts
38271
38299
  function getSkillsDir() {
38272
38300
  if (typeof __PEACH_BUNDLED_SKILLS__ !== "undefined") {
38273
- const dir = path24.join(rnxHomeDir(), "skills", getCliVersion());
38301
+ const dir = path25.join(rnxHomeDir(), "skills", getCliVersion());
38274
38302
  for (const [file, body] of Object.entries(__PEACH_BUNDLED_SKILLS__)) {
38275
- const target = path24.join(dir, file);
38303
+ const target = path25.join(dir, file);
38276
38304
  if (fs21.existsSync(target)) continue;
38277
- fs21.mkdirSync(path24.dirname(target), { recursive: true });
38305
+ fs21.mkdirSync(path25.dirname(target), { recursive: true });
38278
38306
  fs21.writeFileSync(target, body);
38279
38307
  }
38280
38308
  return dir;
@@ -38283,10 +38311,10 @@ function getSkillsDir() {
38283
38311
  const pkgPath = (0, import_url3.fileURLToPath)(
38284
38312
  import_meta4.resolve(`${rnxPublicBrand.packageName}/package.json`)
38285
38313
  );
38286
- return path24.join(path24.dirname(pkgPath), "skills");
38314
+ return path25.join(path25.dirname(pkgPath), "skills");
38287
38315
  } catch {
38288
- const __dirname = path24.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
38289
- return path24.resolve(__dirname, "../../skills");
38316
+ const __dirname = path25.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
38317
+ return path25.resolve(__dirname, "../../skills");
38290
38318
  }
38291
38319
  }
38292
38320
  function skillsDir() {
@@ -38294,8 +38322,8 @@ function skillsDir() {
38294
38322
  return skillsDirPath;
38295
38323
  }
38296
38324
  function targetFromHome(envName, fallbackDir) {
38297
- const home = process.env[envName] || path24.join(os5.homedir(), fallbackDir);
38298
- return path24.join(home, "skills");
38325
+ const home = process.env[envName] || path25.join(os6.homedir(), fallbackDir);
38326
+ return path25.join(home, "skills");
38299
38327
  }
38300
38328
  function defaultAgentTargets() {
38301
38329
  return [
@@ -38308,7 +38336,7 @@ function hasInstalledPeachSkills() {
38308
38336
  (file) => /^([^/]+)\/SKILL\.md$/.exec(file)?.[1] ?? []
38309
38337
  ) : listSkills().map((skill7) => skill7.name);
38310
38338
  return defaultAgentTargets().some(
38311
- ({ dir }) => names.some((name2) => fs21.existsSync(path24.join(dir, name2, "SKILL.md")))
38339
+ ({ dir }) => names.some((name2) => fs21.existsSync(path25.join(dir, name2, "SKILL.md")))
38312
38340
  );
38313
38341
  }
38314
38342
  function parseSkillFrontmatter(content) {
@@ -38354,7 +38382,7 @@ function listSkills() {
38354
38382
  if (!fs21.existsSync(skillsDir())) return [];
38355
38383
  const skills = [];
38356
38384
  for (const entry of fs21.readdirSync(skillsDir())) {
38357
- const skillMd = path24.join(skillsDir(), entry, "SKILL.md");
38385
+ const skillMd = path25.join(skillsDir(), entry, "SKILL.md");
38358
38386
  if (!fs21.existsSync(skillMd)) continue;
38359
38387
  const meta = parseSkillFrontmatter(fs21.readFileSync(skillMd, "utf8"));
38360
38388
  if (meta) {
@@ -38363,13 +38391,13 @@ function listSkills() {
38363
38391
  }
38364
38392
  return skills.sort((a, b) => a.name.localeCompare(b.name));
38365
38393
  }
38366
- var fs21, os5, path24, import_url3, import_meta4, skillsDirPath;
38394
+ var fs21, os6, path25, import_url3, import_meta4, skillsDirPath;
38367
38395
  var init_skills = __esm({
38368
38396
  "cli/commands/skills.ts"() {
38369
38397
  "use strict";
38370
38398
  fs21 = __toESM(require("fs"), 1);
38371
- os5 = __toESM(require("os"), 1);
38372
- path24 = __toESM(require("path"), 1);
38399
+ os6 = __toESM(require("os"), 1);
38400
+ path25 = __toESM(require("path"), 1);
38373
38401
  import_url3 = require("url");
38374
38402
  init_cli_version();
38375
38403
  init_home_paths();
@@ -39003,10 +39031,10 @@ async function buildResolvedBundleOpenUrl(target, baseUrl, opts = {}) {
39003
39031
  }
39004
39032
  function normalizeReplacementPath(filePath) {
39005
39033
  if (filePath.startsWith("~/")) {
39006
- return import_node_path32.default.join(import_node_os7.default.homedir(), filePath.slice(2));
39034
+ return import_node_path33.default.join(import_node_os8.default.homedir(), filePath.slice(2));
39007
39035
  }
39008
- if (import_node_path32.default.isAbsolute(filePath)) return filePath;
39009
- return import_node_path32.default.resolve(process.cwd(), filePath);
39036
+ if (import_node_path33.default.isAbsolute(filePath)) return filePath;
39037
+ return import_node_path33.default.resolve(process.cwd(), filePath);
39010
39038
  }
39011
39039
  function parseOpenRuntimeConfig(args) {
39012
39040
  const modules = {};
@@ -39056,7 +39084,7 @@ async function resolveAppProjectForBundleUrl(bundleUrl) {
39056
39084
  return advertisedRoot ? resolveAppProject(advertisedRoot) : null;
39057
39085
  }
39058
39086
  async function ensureConfiguredRuntime(version) {
39059
- if (import_node_fs31.default.existsSync(import_node_path32.default.join(runtimeDir(version), "index.html"))) return;
39087
+ if (import_node_fs31.default.existsSync(import_node_path33.default.join(runtimeDir(version), "index.html"))) return;
39060
39088
  console.error(` installing configured engine runtime ${version}...`);
39061
39089
  const result = await rnxRuntime.install({
39062
39090
  version,
@@ -39405,17 +39433,17 @@ function printDriverDiagnosticLogTail(result) {
39405
39433
  try {
39406
39434
  const detail = import_node_fs31.default.readFileSync(result.diagnosticLogPath, "utf8").trim();
39407
39435
  if (!detail) {
39408
- console.error(` ${import_node_path32.default.basename(result.diagnosticLogPath)} was empty`);
39436
+ console.error(` ${import_node_path33.default.basename(result.diagnosticLogPath)} was empty`);
39409
39437
  return;
39410
39438
  }
39411
39439
  const shown = detail.length > 4e3 ? `\u2026
39412
39440
  ${detail.slice(-4e3)}` : detail;
39413
- console.error(` ${import_node_path32.default.basename(result.diagnosticLogPath)}:`);
39441
+ console.error(` ${import_node_path33.default.basename(result.diagnosticLogPath)}:`);
39414
39442
  console.error(shown);
39415
39443
  } catch (err) {
39416
39444
  const message = err instanceof Error ? err.message : String(err);
39417
39445
  console.error(
39418
- ` failed to read ${import_node_path32.default.basename(result.diagnosticLogPath)}: ${message}`
39446
+ ` failed to read ${import_node_path33.default.basename(result.diagnosticLogPath)}: ${message}`
39419
39447
  );
39420
39448
  }
39421
39449
  }
@@ -40393,14 +40421,14 @@ async function runCloseCommand(args, opts = {}) {
40393
40421
  bridge.close();
40394
40422
  }
40395
40423
  }
40396
- var import_node_child_process11, import_node_fs31, import_node_os7, import_node_path32, import_app_catalog_wire, import_devices2, import_ws4, DEFAULT_DRIVER_CONNECT_TIMEOUT_MS, DRIVER_CONNECT_INTERVAL_MS, DRIVER_CONNECT_HOST_GRACE_MS, OPEN_BRIDGE_SPAWN_TIMEOUT_MS, SHELL_APPS, DEV_BUNDLE_RESOLVE_ATTEMPTS, DEV_BUNDLE_RESOLVE_INTERVAL_MS;
40424
+ var import_node_child_process11, import_node_fs31, import_node_os8, import_node_path33, import_app_catalog_wire, import_devices2, import_ws4, DEFAULT_DRIVER_CONNECT_TIMEOUT_MS, DRIVER_CONNECT_INTERVAL_MS, DRIVER_CONNECT_HOST_GRACE_MS, OPEN_BRIDGE_SPAWN_TIMEOUT_MS, SHELL_APPS, DEV_BUNDLE_RESOLVE_ATTEMPTS, DEV_BUNDLE_RESOLVE_INTERVAL_MS;
40397
40425
  var init_control = __esm({
40398
40426
  "cli/commands/control.ts"() {
40399
40427
  "use strict";
40400
40428
  import_node_child_process11 = require("node:child_process");
40401
40429
  import_node_fs31 = __toESM(require("node:fs"), 1);
40402
- import_node_os7 = __toESM(require("node:os"), 1);
40403
- import_node_path32 = __toESM(require("node:path"), 1);
40430
+ import_node_os8 = __toESM(require("node:os"), 1);
40431
+ import_node_path33 = __toESM(require("node:path"), 1);
40404
40432
  import_app_catalog_wire = require("peach-engine/engine/app-catalog-wire");
40405
40433
  import_devices2 = require("peach-engine/settings/devices");
40406
40434
  import_ws4 = require("ws");
@@ -41748,16 +41776,16 @@ function readRecentShellAppId(state) {
41748
41776
  }
41749
41777
  function resolveProjectRelativeFlowBase(flowDir) {
41750
41778
  if (!flowDir) return process.cwd();
41751
- return path26.basename(flowDir) === ".maestro" ? path26.dirname(flowDir) : flowDir;
41779
+ return path27.basename(flowDir) === ".maestro" ? path27.dirname(flowDir) : flowDir;
41752
41780
  }
41753
41781
  function resolveFlowScreenshotPathWithMode(screenshotDir, name2, opts) {
41754
41782
  const normalizedName = name2.endsWith(".png") ? name2 : `${name2}.png`;
41755
- if (path26.isAbsolute(normalizedName)) return normalizedName;
41783
+ if (path27.isAbsolute(normalizedName)) return normalizedName;
41756
41784
  if (opts.mode === "flow" && /[\\/]/.test(normalizedName)) {
41757
41785
  const baseDir = normalizedName.startsWith("./") || normalizedName.startsWith("../") ? opts.flowDir ?? process.cwd() : resolveProjectRelativeFlowBase(opts.flowDir);
41758
- return path26.resolve(baseDir, normalizedName);
41786
+ return path27.resolve(baseDir, normalizedName);
41759
41787
  }
41760
- return path26.join(screenshotDir, normalizedName);
41788
+ return path27.join(screenshotDir, normalizedName);
41761
41789
  }
41762
41790
  function normalizeFlowScreenshotSpec(step) {
41763
41791
  if (typeof step === "string") {
@@ -41814,12 +41842,12 @@ function parseFlowSteps(content) {
41814
41842
  const parsed = import_yaml2.default.parse(candidate);
41815
41843
  return Array.isArray(parsed) ? parsed : [];
41816
41844
  }
41817
- var fs24, path26, import_devices4, import_yaml2, import_proof_frame, DEFAULT_TIMEOUT, ASSERTION_LOOKUP_MS, FLOW_TIMEOUT_SCALE, scaledTimeout, MAESTRO_SELECTOR_KEYS, SELECTOR_FILTER_KEYS, UNSUPPORTED_SELECTOR_KEYS, ACCESSIBILITY_SELECTOR_KEYS, ACCESSIBILITY_TRAIT_FILTERS, MAESTRO_PERMISSION_KINDS, MAESTRO_PERMISSION_STATUS, SootSimBridgeFlowRunner;
41845
+ var fs24, path27, import_devices4, import_yaml2, import_proof_frame, DEFAULT_TIMEOUT, ASSERTION_LOOKUP_MS, FLOW_TIMEOUT_SCALE, scaledTimeout, MAESTRO_SELECTOR_KEYS, SELECTOR_FILTER_KEYS, UNSUPPORTED_SELECTOR_KEYS, ACCESSIBILITY_SELECTOR_KEYS, ACCESSIBILITY_TRAIT_FILTERS, MAESTRO_PERMISSION_KINDS, MAESTRO_PERMISSION_STATUS, SootSimBridgeFlowRunner;
41818
41846
  var init_bridge_flow_runner = __esm({
41819
41847
  "cli/bridge-flow-runner.ts"() {
41820
41848
  "use strict";
41821
41849
  fs24 = __toESM(require("fs"), 1);
41822
- path26 = __toESM(require("path"), 1);
41850
+ path27 = __toESM(require("path"), 1);
41823
41851
  import_devices4 = require("peach-engine/settings/devices");
41824
41852
  import_yaml2 = __toESM(require("yaml"), 1);
41825
41853
  import_proof_frame = __toESM(require_proof_frame(), 1);
@@ -42147,7 +42175,7 @@ var init_bridge_flow_runner = __esm({
42147
42175
  fs24.mkdirSync(this.opts.recordingOutputDir, { recursive: true });
42148
42176
  const videoMime = stopped.mime || this.opts.recordingFormat || "video/webm";
42149
42177
  const extension = videoMime.includes("mp4") ? "mp4" : "webm";
42150
- const outputPath = path26.join(
42178
+ const outputPath = path27.join(
42151
42179
  this.opts.recordingOutputDir,
42152
42180
  `peach-${Date.now()}.${extension}`
42153
42181
  );
@@ -42827,7 +42855,7 @@ var init_bridge_flow_runner = __esm({
42827
42855
  flowDir: this.opts.flowDir
42828
42856
  }
42829
42857
  );
42830
- fs24.mkdirSync(path26.dirname(outputPath), { recursive: true });
42858
+ fs24.mkdirSync(path27.dirname(outputPath), { recursive: true });
42831
42859
  const layers = spec.layers ?? this.opts.screenshotLayers;
42832
42860
  const screenshotRequest = {
42833
42861
  type: "screenshot",
@@ -42891,7 +42919,7 @@ var init_bridge_flow_runner = __esm({
42891
42919
  fs24.mkdirSync(outputDir, { recursive: true });
42892
42920
  const write = (name2, content) => {
42893
42921
  try {
42894
- fs24.writeFileSync(path26.join(outputDir, name2), content);
42922
+ fs24.writeFileSync(path27.join(outputDir, name2), content);
42895
42923
  } catch {
42896
42924
  }
42897
42925
  };
@@ -43483,7 +43511,7 @@ var init_bridge_flow_runner = __esm({
43483
43511
  runScript(target) {
43484
43512
  const spec = typeof target === "string" ? { file: target } : target;
43485
43513
  if (!spec.file) throw new Error("runScript requires a file");
43486
- const scriptPath = path26.resolve(this.opts.flowDir, spec.file);
43514
+ const scriptPath = path27.resolve(this.opts.flowDir, spec.file);
43487
43515
  const source = fs24.readFileSync(scriptPath, "utf8");
43488
43516
  this.js.evaluate(source, { env: spec.env });
43489
43517
  console.log(`[flow] runScript: ${spec.file} done`);
@@ -43844,10 +43872,10 @@ var init_bridge_flow_runner = __esm({
43844
43872
  for (const [k, v] of Object.entries(env)) this.js.putEnv(k, v);
43845
43873
  }
43846
43874
  if (file) {
43847
- const flowPath = path26.resolve(this.opts.flowDir, file);
43875
+ const flowPath = path27.resolve(this.opts.flowDir, file);
43848
43876
  const flowContent = fs24.readFileSync(flowPath, "utf8");
43849
43877
  const previousDir = this.opts.flowDir;
43850
- this.opts.flowDir = path26.dirname(flowPath);
43878
+ this.opts.flowDir = path27.dirname(flowPath);
43851
43879
  try {
43852
43880
  await this.runFlow(parseFlowSteps(flowContent));
43853
43881
  } finally {
@@ -44019,7 +44047,7 @@ __export(registry_exports, {
44019
44047
  });
44020
44048
  module.exports = __toCommonJS(registry_exports);
44021
44049
  var fs25 = __toESM(require("fs"), 1);
44022
- var path27 = __toESM(require("path"), 1);
44050
+ var path28 = __toESM(require("path"), 1);
44023
44051
 
44024
44052
  // src/skills/builtin/a11y-review.ts
44025
44053
  init_reap_browser();
@@ -44038,7 +44066,7 @@ var skill = {
44038
44066
  },
44039
44067
  async execute(params, context) {
44040
44068
  const { chromium } = await import("playwright");
44041
- const path28 = await import("path");
44069
+ const path29 = await import("path");
44042
44070
  const fs26 = await import("fs");
44043
44071
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
44044
44072
  headless: true
@@ -44096,8 +44124,8 @@ var skill = {
44096
44124
  warnings: issues.filter((i) => i.severity === "warning").length,
44097
44125
  tree: typeof tree === "string" ? tree : JSON.stringify(tree)
44098
44126
  };
44099
- const reportPath = path28.join(context.outputDir, "a11y-report.json");
44100
- fs26.mkdirSync(path28.dirname(reportPath), { recursive: true });
44127
+ const reportPath = path29.join(context.outputDir, "a11y-report.json");
44128
+ fs26.mkdirSync(path29.dirname(reportPath), { recursive: true });
44101
44129
  fs26.writeFileSync(reportPath, JSON.stringify(report, null, 2));
44102
44130
  return {
44103
44131
  success: issues.filter((i) => i.severity === "error").length === 0,
@@ -44132,9 +44160,9 @@ var skill2 = {
44132
44160
  },
44133
44161
  async execute(params, context) {
44134
44162
  const fs26 = await import("node:fs");
44135
- const path28 = await import("node:path");
44163
+ const path29 = await import("node:path");
44136
44164
  const { COMPAT_RESULT_CAVEAT: COMPAT_RESULT_CAVEAT2, formatPackageStatus: formatPackageStatus2, formatScanCounts: formatScanCounts2, scanDeps: scanDeps2 } = await Promise.resolve().then(() => (init_web(), web_exports));
44137
- const packagePath = path28.join(context.projectDir, "package.json");
44165
+ const packagePath = path29.join(context.projectDir, "package.json");
44138
44166
  if (!fs26.existsSync(packagePath)) {
44139
44167
  return { success: false, message: "No package.json found" };
44140
44168
  }
@@ -44150,8 +44178,8 @@ var skill2 = {
44150
44178
  }) : scanDeps2(parsed);
44151
44179
  const packageResult = params.packageName ? scan.packages[0] : void 0;
44152
44180
  const message = packageResult ? `${params.packageName}: ${formatPackageStatus2(packageResult)}. ${COMPAT_RESULT_CAVEAT2}` : `${formatScanCounts2(scan)}. ${COMPAT_RESULT_CAVEAT2}`;
44153
- const reportPath = path28.join(context.outputDir, "compat-report.json");
44154
- fs26.mkdirSync(path28.dirname(reportPath), { recursive: true });
44181
+ const reportPath = path29.join(context.outputDir, "compat-report.json");
44182
+ fs26.mkdirSync(path29.dirname(reportPath), { recursive: true });
44155
44183
  fs26.writeFileSync(reportPath, `${JSON.stringify(scan, null, 2)}
44156
44184
  `);
44157
44185
  return {
@@ -44195,7 +44223,7 @@ var skill3 = {
44195
44223
  },
44196
44224
  async execute(params, context) {
44197
44225
  const fs26 = await import("fs");
44198
- const path28 = await import("path");
44226
+ const path29 = await import("path");
44199
44227
  const yaml2 = await import("yaml");
44200
44228
  const { DEFAULT_SOOTSIM_BRIDGE_PORT: DEFAULT_SOOTSIM_BRIDGE_PORT3 } = await Promise.resolve().then(() => (init_bridge_constants(), bridge_constants_exports));
44201
44229
  const { SootSimBridgeHost: SootSimBridgeHost2 } = await Promise.resolve().then(() => (init_bridge_host(), bridge_host_exports));
@@ -44232,7 +44260,7 @@ var skill3 = {
44232
44260
  });
44233
44261
  const driver = new SootSimBridgeFlowRunner2(bridge, {
44234
44262
  screenshotDir: context.outputDir,
44235
- flowDir: path28.dirname(path28.resolve(params.flowPath)),
44263
+ flowDir: path29.dirname(path29.resolve(params.flowPath)),
44236
44264
  simId,
44237
44265
  recordingOutputDir: params.record ? context.outputDir : void 0
44238
44266
  });
@@ -44254,7 +44282,7 @@ var skill3 = {
44254
44282
  simId,
44255
44283
  videoPath: videoPath || void 0
44256
44284
  },
44257
- artifacts: videoPath ? [{ type: "video", name: path28.basename(videoPath), path: videoPath }] : void 0
44285
+ artifacts: videoPath ? [{ type: "video", name: path29.basename(videoPath), path: videoPath }] : void 0
44258
44286
  };
44259
44287
  } finally {
44260
44288
  try {
@@ -44301,7 +44329,7 @@ var skill4 = {
44301
44329
  },
44302
44330
  async execute(params, context) {
44303
44331
  const { chromium } = await import("playwright");
44304
- const path28 = await import("path");
44332
+ const path29 = await import("path");
44305
44333
  const fs26 = await import("fs");
44306
44334
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
44307
44335
  headless: true
@@ -44330,8 +44358,8 @@ var skill4 = {
44330
44358
  ...profile,
44331
44359
  fps: syncCount > 0 ? (syncCount / (duration / 1e3)).toFixed(1) : "0"
44332
44360
  };
44333
- const reportPath = path28.join(context.outputDir, "perf-report.json");
44334
- fs26.mkdirSync(path28.dirname(reportPath), { recursive: true });
44361
+ const reportPath = path29.join(context.outputDir, "perf-report.json");
44362
+ fs26.mkdirSync(path29.dirname(reportPath), { recursive: true });
44335
44363
  fs26.writeFileSync(reportPath, JSON.stringify(report, null, 2));
44336
44364
  return {
44337
44365
  success: true,
@@ -44365,7 +44393,7 @@ var skill5 = {
44365
44393
  },
44366
44394
  async execute(params, context) {
44367
44395
  const { chromium } = await import("playwright");
44368
- const path28 = await import("path");
44396
+ const path29 = await import("path");
44369
44397
  const fs26 = await import("fs");
44370
44398
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
44371
44399
  headless: true
@@ -44374,8 +44402,8 @@ var skill5 = {
44374
44402
  try {
44375
44403
  await page.goto(context.url, { waitUntil: "networkidle" });
44376
44404
  await page.waitForTimeout(2e3);
44377
- const outputPath = path28.join(context.outputDir, `${params.name}.png`);
44378
- fs26.mkdirSync(path28.dirname(outputPath), { recursive: true });
44405
+ const outputPath = path29.join(context.outputDir, `${params.name}.png`);
44406
+ fs26.mkdirSync(path29.dirname(outputPath), { recursive: true });
44379
44407
  await page.screenshot({ path: outputPath });
44380
44408
  return {
44381
44409
  success: true,
@@ -44416,7 +44444,7 @@ var skill6 = {
44416
44444
  },
44417
44445
  async execute(params, context) {
44418
44446
  const { chromium } = await import("playwright");
44419
- const path28 = await import("path");
44447
+ const path29 = await import("path");
44420
44448
  const fs26 = await import("fs");
44421
44449
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
44422
44450
  headless: true
@@ -44425,8 +44453,8 @@ var skill6 = {
44425
44453
  try {
44426
44454
  await page.goto(context.url, { waitUntil: "networkidle" });
44427
44455
  await page.waitForTimeout(2e3);
44428
- const currentPath = path28.join(context.outputDir, `${params.name}-current.png`);
44429
- fs26.mkdirSync(path28.dirname(currentPath), { recursive: true });
44456
+ const currentPath = path29.join(context.outputDir, `${params.name}-current.png`);
44457
+ fs26.mkdirSync(path29.dirname(currentPath), { recursive: true });
44430
44458
  await page.screenshot({ path: currentPath });
44431
44459
  try {
44432
44460
  const { PNG } = await import("pngjs");
@@ -44443,7 +44471,7 @@ var skill6 = {
44443
44471
  height,
44444
44472
  { threshold: params.threshold || 0.1 }
44445
44473
  );
44446
- const diffPath = path28.join(context.outputDir, `${params.name}-diff.png`);
44474
+ const diffPath = path29.join(context.outputDir, `${params.name}-diff.png`);
44447
44475
  fs26.writeFileSync(diffPath, PNG.sync.write(diff));
44448
44476
  const totalPixels = width * height;
44449
44477
  const diffPercent = (numDiffPixels / totalPixels * 100).toFixed(2);
@@ -44508,7 +44536,7 @@ var skillRegistry = {
44508
44536
  },
44509
44537
  // load skills from a project manifest (rnx-skills.json)
44510
44538
  async loadFromManifest(projectDir) {
44511
- const manifestPath = path27.join(projectDir, "rnx-skills.json");
44539
+ const manifestPath = path28.join(projectDir, "rnx-skills.json");
44512
44540
  if (!fs25.existsSync(manifestPath)) return;
44513
44541
  try {
44514
44542
  const manifest = JSON.parse(fs25.readFileSync(manifestPath, "utf8"));
@@ -44522,7 +44550,7 @@ var skillRegistry = {
44522
44550
  }
44523
44551
  } else if (entry.file) {
44524
44552
  try {
44525
- const mod = await import(path27.resolve(projectDir, entry.file));
44553
+ const mod = await import(path28.resolve(projectDir, entry.file));
44526
44554
  if (mod.skill) this.register(mod.skill);
44527
44555
  } catch {
44528
44556
  }
@@ -44535,7 +44563,7 @@ var skillRegistry = {
44535
44563
  // auto-discover skills based on project dependencies
44536
44564
  suggestSkills(projectDir) {
44537
44565
  const suggestions = [];
44538
- const pkgPath = path27.join(projectDir, "package.json");
44566
+ const pkgPath = path28.join(projectDir, "package.json");
44539
44567
  if (!fs25.existsSync(pkgPath)) return suggestions;
44540
44568
  try {
44541
44569
  const pkg = JSON.parse(fs25.readFileSync(pkgPath, "utf8"));