peachsim 0.1.672 → 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 (75) hide show
  1. package/cli/commands/kotlin.ts +1 -0
  2. package/dist-lib/agent-daemon-client.cjs +1 -1
  3. package/dist-lib/agent-events.cjs +1 -1
  4. package/dist-lib/agent-identity.cjs +1 -1
  5. package/dist-lib/agent-sessions.cjs +1 -1
  6. package/dist-lib/attached-projects.cjs +1 -1
  7. package/dist-lib/auth/shared-session.cjs +1 -1
  8. package/dist-lib/backend-origin.cjs +1 -1
  9. package/dist-lib/beta.cjs +1 -1
  10. package/dist-lib/beta.mjs +1 -1
  11. package/dist-lib/bridge-constants.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.mjs +1 -1
  14. package/dist-lib/bridge-contract.cjs +1 -1
  15. package/dist-lib/bridge-contract.mjs +1 -1
  16. package/dist-lib/capture-contract.cjs +1 -1
  17. package/dist-lib/capture-contract.mjs +1 -1
  18. package/dist-lib/cli-constants.cjs +1 -1
  19. package/dist-lib/cloud-contract.cjs +1 -1
  20. package/dist-lib/cloud-contract.mjs +1 -1
  21. package/dist-lib/cloud-test-args.cjs +1 -1
  22. package/dist-lib/cloud-test-args.mjs +1 -1
  23. package/dist-lib/cloud.cjs +1 -1
  24. package/dist-lib/cloud.mjs +1 -1
  25. package/dist-lib/config.cjs +1 -1
  26. package/dist-lib/detox/index.cjs +1 -1
  27. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  28. package/dist-lib/home-paths.cjs +1 -1
  29. package/dist-lib/host/bridge-host.cjs +257 -236
  30. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  31. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  32. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  33. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  34. package/dist-lib/host/websocket-proxy.cjs +1 -1
  35. package/dist-lib/index.cjs +1 -1
  36. package/dist-lib/jump-to-source-babel.cjs +1 -1
  37. package/dist-lib/jump-to-source-native.cjs +1 -1
  38. package/dist-lib/kotlin-host.cjs +1 -1
  39. package/dist-lib/menu.cjs +1 -1
  40. package/dist-lib/menu.mjs +1 -1
  41. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  43. package/dist-lib/metro-production-bundle.cjs +1 -1
  44. package/dist-lib/metro-production-bundle.mjs +1 -1
  45. package/dist-lib/metro.cjs +1 -1
  46. package/dist-lib/native-app-identity.cjs +1 -1
  47. package/dist-lib/native-app-identity.mjs +1 -1
  48. package/dist-lib/native-firebase-metadata.cjs +1 -1
  49. package/dist-lib/native-firebase-metadata.mjs +1 -1
  50. package/dist-lib/plist.cjs +1 -1
  51. package/dist-lib/plist.mjs +1 -1
  52. package/dist-lib/profiles.cjs +1 -1
  53. package/dist-lib/public-brand.cjs +1 -1
  54. package/dist-lib/react-native-host-modules.cjs +1 -1
  55. package/dist-lib/react-native-host-modules.mjs +1 -1
  56. package/dist-lib/render-mode.cjs +1 -1
  57. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  58. package/dist-lib/sdk.cjs +1 -1
  59. package/dist-lib/sdk.mjs +1 -1
  60. package/dist-lib/skills.cjs +445 -410
  61. package/dist-lib/swift-compile.cjs +21 -7
  62. package/dist-lib/swift-compile.mjs +21 -7
  63. package/dist-lib/swift-package.cjs +1 -1
  64. package/dist-lib/swift-package.mjs +1 -1
  65. package/dist-lib/swift-submit.cjs +1 -1
  66. package/dist-lib/swift-submit.mjs +1 -1
  67. package/dist-lib/swift.cjs +1 -1
  68. package/dist-lib/vite-swift.cjs +109 -88
  69. package/dist-lib/vite.cjs +1 -1
  70. package/kotlin/fixtures/kotlin-app-variants/Icons.kt +59 -0
  71. package/kotlin/toolchain.json +9 -2
  72. package/package.json +1 -1
  73. package/src/kotlin-app.ts +5 -1
  74. package/src/swift-compile.ts +31 -10
  75. package/src/swift-host.ts +2 -4
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.672 | (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;
@@ -8386,11 +8386,18 @@ var init_registry = __esm({
8386
8386
  stubType: "native",
8387
8387
  versions: [
8388
8388
  {
8389
- range: ">=4.6.1",
8389
+ range: ">=6.0.0 <7.0.0",
8390
8390
  coverage: 0.7,
8391
- note: "CanvasKit backdrop-blur + engine liquid-glass material for the full latest component surface; 40-material iOS color table drives per-blurType overlay tint",
8392
- working: "BlurView/VibrancyView/ProgressiveBlurView render real backdropFilter (sigma from blurAmount) over a per-material rgba overlay from the full iOS material constant table (xlight\u2026systemChromeMaterialDark); LiquidGlassView/LiquidGlassContainer drive the calibrated glassEffect materials (glassType, glassTintColor as the material glassTint, glassOpacity scaling the calibrated body opacity, isInteractive, cornerRadius); BlurSwitch is a real interactive switch (value/onValueChange/disabled, switch a11y role+state, track color); all native component export aliases",
8393
- missing: "progressive gradient direction (direction/startOffset accepted but ignored \u2014 renders uniform blur), exact iOS 26 liquid glass behavior, Android QmBlurView behavior, reduced-transparency system-setting fallback color"
8391
+ note: "the progressive native view delegates to the kit variable-radius pass with the cubic CGGradient first shipped in 6.0.0; iOS 27 full-region comparisons cover top, bottom and center, radii 10/30, offsets 0/0.25, and light/dark",
8392
+ working: "BlurView backdrop materials; ProgressiveBlurView variable radius, direction and startOffset, with the current opaque-edge plateau and center ramps; native blur style aliases; LiquidGlassView and LiquidGlassContainer calibrated glass materials; interactive BlurSwitch; native component export aliases",
8393
+ missing: "general vibrant-content composition, liquid glass container merging, Android QmBlurView behavior, reduced-transparency system-setting fallback color"
8394
+ },
8395
+ {
8396
+ range: ">=4.6.1 <6.0.0",
8397
+ coverage: 0.7,
8398
+ note: "partial: the older progressive native view uses CIFilter.smoothLinearGradient; the kit retains one current cubic mask, differing from the older iOS 27 oracle by 3.47\u201336.72% of pixels at the unchanged conformance threshold",
8399
+ working: "BlurView backdrop materials; progressive direction and radius vary spatially; calibrated liquid glass materials, interactive BlurSwitch and native component export aliases",
8400
+ missing: "the pre-6 progressive gradient profile and clear-edge offset; general vibrant-content composition, liquid glass container merging, Android QmBlurView behavior, reduced-transparency system-setting fallback color"
8394
8401
  }
8395
8402
  ]
8396
8403
  },
@@ -19480,9 +19487,9 @@ function safeChildPlistName(value) {
19480
19487
  name: file.toLowerCase().endsWith(".plist") ? file : `${file}.plist`
19481
19488
  };
19482
19489
  }
19483
- async function readableSettingsBundle(path28) {
19490
+ async function readableSettingsBundle(path29) {
19484
19491
  try {
19485
- 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"));
19486
19493
  return root.isFile() && root.size <= MAX_PLIST_BYTES;
19487
19494
  } catch {
19488
19495
  return false;
@@ -19527,11 +19534,11 @@ async function settingsBundleFingerprint(bundlePath) {
19527
19534
  return null;
19528
19535
  }
19529
19536
  }
19530
- async function parsePlistRecord(path28) {
19537
+ async function parsePlistRecord(path29) {
19531
19538
  try {
19532
- const metadata = await (0, import_promises.stat)(path28);
19539
+ const metadata = await (0, import_promises.stat)(path29);
19533
19540
  if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
19534
- const source = await (0, import_promises.readFile)(path28, "utf8");
19541
+ const source = await (0, import_promises.readFile)(path29, "utf8");
19535
19542
  const parsed = parsePlistSource(source);
19536
19543
  return isRecord2(parsed) ? parsed : null;
19537
19544
  } catch {
@@ -19855,7 +19862,7 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
19855
19862
  return null;
19856
19863
  }
19857
19864
  }
19858
- function httpGet(hostname, port, path28, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
19865
+ function httpGet(hostname, port, path29, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
19859
19866
  return new Promise((resolve10) => {
19860
19867
  let settled = false;
19861
19868
  let killing = false;
@@ -19864,7 +19871,7 @@ function httpGet(hostname, port, path28, method = "GET", timeout = TIMEOUT_MS, h
19864
19871
  settled = true;
19865
19872
  resolve10(value);
19866
19873
  };
19867
- 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) => {
19868
19875
  let body = "";
19869
19876
  res.on("data", (c) => body += c.toString());
19870
19877
  const contentType = (() => {
@@ -21159,6 +21166,22 @@ var init_internal_child = __esm({
21159
21166
  }
21160
21167
  });
21161
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
+
21162
21185
  // ../sootsim-swift/src/bundleAssets.ts
21163
21186
  function extOf(file) {
21164
21187
  const dot = file.lastIndexOf(".");
@@ -21180,8 +21203,8 @@ function pickImagesetFile(images) {
21180
21203
  scale: pick.scale === "2x" ? 2 : pick.scale === "3x" ? 3 : 1
21181
21204
  };
21182
21205
  }
21183
- function flatScale(path28) {
21184
- const match = /@([23])x\.[^./]+$/.exec(path28);
21206
+ function flatScale(path29) {
21207
+ const match = /@([23])x\.[^./]+$/.exec(path29);
21185
21208
  return match ? Number(match[1]) : 1;
21186
21209
  }
21187
21210
  function providesNamespace(text) {
@@ -21208,13 +21231,13 @@ function catalogEntryName(contentsPath, kind, readText2) {
21208
21231
  }
21209
21232
  return segments.join("/");
21210
21233
  }
21211
- function isFlatResourceImage(path28) {
21212
- 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));
21213
21236
  }
21214
21237
  function enumerateBundleImages(paths, readText2) {
21215
21238
  const table = [];
21216
21239
  const seen = /* @__PURE__ */ new Set();
21217
- const catalogs = paths.filter((path28) => baseOf(path28) === "Contents.json");
21240
+ const catalogs = paths.filter((path29) => baseOf(path29) === "Contents.json");
21218
21241
  for (const contentsPath of catalogs) {
21219
21242
  const name2 = catalogEntryName(contentsPath, ".imageset", readText2);
21220
21243
  if (name2 === null || seen.has(name2)) continue;
@@ -21235,12 +21258,12 @@ function enumerateBundleImages(paths, readText2) {
21235
21258
  seen.add(name2);
21236
21259
  table.push({ name: name2, file: `${dir}/${pick.filename}`, scale: pick.scale });
21237
21260
  }
21238
- for (const path28 of paths) {
21239
- if (!isFlatResourceImage(path28)) continue;
21240
- 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);
21241
21264
  if (name2 === "" || seen.has(name2)) continue;
21242
21265
  seen.add(name2);
21243
- table.push({ name: name2, file: path28, scale: flatScale(path28) });
21266
+ table.push({ name: name2, file: path29, scale: flatScale(path29) });
21244
21267
  }
21245
21268
  return table;
21246
21269
  }
@@ -21269,7 +21292,7 @@ function colorsetValue(color) {
21269
21292
  }
21270
21293
  function enumerateBundleColors(paths, readText2) {
21271
21294
  const table = {};
21272
- for (const contentsPath of paths.filter((path28) => baseOf(path28) === "Contents.json")) {
21295
+ for (const contentsPath of paths.filter((path29) => baseOf(path29) === "Contents.json")) {
21273
21296
  const name2 = catalogEntryName(contentsPath, ".colorset", readText2);
21274
21297
  if (name2 === null || name2 in table) continue;
21275
21298
  let colors;
@@ -21333,8 +21356,8 @@ function axisExtremes(points) {
21333
21356
  function pathBounds(d) {
21334
21357
  const xs = [];
21335
21358
  const ys = [];
21336
- for (const path28 of d)
21337
- (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) => {
21338
21361
  const [command, ...args] = segment;
21339
21362
  if (command === "M" || command === "L") {
21340
21363
  xs.push(Number(args[0]));
@@ -21361,7 +21384,7 @@ function guide(svg, id, axis) {
21361
21384
  }
21362
21385
  function enumerateBundleSymbols(paths, readText2) {
21363
21386
  const table = {};
21364
- for (const contentsPath of paths.filter((path28) => baseOf(path28) === "Contents.json")) {
21387
+ for (const contentsPath of paths.filter((path29) => baseOf(path29) === "Contents.json")) {
21365
21388
  const name2 = catalogEntryName(contentsPath, ".symbolset", readText2);
21366
21389
  if (name2 === null || name2 in table) continue;
21367
21390
  let symbols;
@@ -21394,8 +21417,8 @@ function enumerateBundleSymbols(paths, readText2) {
21394
21417
  viewBox: "0 0 24 24",
21395
21418
  advance,
21396
21419
  box: [12 - advance / 2, 12 - tall / 2, advance, tall],
21397
- layers: d.map((path28) => ({
21398
- 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()
21399
21422
  }))
21400
21423
  };
21401
21424
  }
@@ -21405,7 +21428,7 @@ function enumerateBundleJson(paths) {
21405
21428
  const found = [];
21406
21429
  const seen = /* @__PURE__ */ new Set();
21407
21430
  const ordered = [...paths].filter(
21408
- (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")
21409
21432
  ).sort((a, b) => {
21410
21433
  const aDepth = a.split("/").length;
21411
21434
  const bDepth = b.split("/").length;
@@ -21448,14 +21471,14 @@ function sharedDesktopAuthAccounts(user) {
21448
21471
  function getBaseDir() {
21449
21472
  const explicit = process.env[SESSION_FILE_ENV];
21450
21473
  if (explicit?.trim()) {
21451
- 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));
21452
21475
  }
21453
21476
  return electronUserDataDir();
21454
21477
  }
21455
21478
  function getSharedDesktopAuthFilePath() {
21456
21479
  const explicit = process.env[SESSION_FILE_ENV];
21457
- if (explicit?.trim()) return (0, import_node_path6.resolve)(explicit);
21458
- 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");
21459
21482
  }
21460
21483
  function normalizeUser(input) {
21461
21484
  if (!input || typeof input !== "object") return null;
@@ -21519,12 +21542,12 @@ function readSharedDesktopAuthSession() {
21519
21542
  return null;
21520
21543
  }
21521
21544
  }
21522
- 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;
21523
21546
  var init_shared_session = __esm({
21524
21547
  "src/auth/shared-session.ts"() {
21525
21548
  "use strict";
21526
21549
  import_node_fs6 = require("node:fs");
21527
- import_node_path6 = require("node:path");
21550
+ import_node_path7 = require("node:path");
21528
21551
  init_home_paths();
21529
21552
  SESSION_VERSION = 1;
21530
21553
  SESSION_FILE_ENV = "SOOTSIM_SHARED_AUTH_FILE";
@@ -21694,7 +21717,7 @@ function swiftIcuAsset(toolchainBin, release) {
21694
21717
  });
21695
21718
  }
21696
21719
  async function load(toolchainBin, release) {
21697
- const { stdout } = await run(import_node_path7.default.join(toolchainBin, "swift"), [
21720
+ const { stdout } = await run(import_node_path8.default.join(toolchainBin, "swift"), [
21698
21721
  "sdk",
21699
21722
  "configure",
21700
21723
  "--show-configuration",
@@ -21704,7 +21727,7 @@ async function load(toolchainBin, release) {
21704
21727
  const resources = /^swiftStaticResourcesPath: (.+)$/m.exec(stdout)?.[1]?.trim();
21705
21728
  if (!resources) throw new Error(`swift-icu: ${release}_wasm names no static resources`);
21706
21729
  return Buffer.from(
21707
- 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))
21708
21731
  );
21709
21732
  }
21710
21733
  function archiveMember(archive, name2) {
@@ -21758,14 +21781,14 @@ function icuSegment(object) {
21758
21781
  throw new Error(`swift-icu: expected one icu data segment, found ${found.length}`);
21759
21782
  return found[0];
21760
21783
  }
21761
- 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;
21762
21785
  var init_swift_icu = __esm({
21763
21786
  "src/swift-icu.ts"() {
21764
21787
  "use strict";
21765
21788
  import_node_child_process3 = require("node:child_process");
21766
21789
  import_node_crypto2 = require("node:crypto");
21767
21790
  import_node_fs7 = require("node:fs");
21768
- import_node_path7 = __toESM(require("node:path"), 1);
21791
+ import_node_path8 = __toESM(require("node:path"), 1);
21769
21792
  import_node_util = require("node:util");
21770
21793
  import_node_zlib = require("node:zlib");
21771
21794
  run = (0, import_node_util.promisify)(import_node_child_process3.execFile);
@@ -21851,7 +21874,7 @@ function swiftModuleInputFiles(root) {
21851
21874
  "toolchain.json"
21852
21875
  ];
21853
21876
  const walk = (dir) => {
21854
- 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 })) {
21855
21878
  const relative2 = `${dir}/${entry.name}`;
21856
21879
  if (entry.isDirectory()) walk(relative2);
21857
21880
  else if (/\.(swift|c|h)$/.test(entry.name)) files.push(relative2);
@@ -21861,16 +21884,16 @@ function swiftModuleInputFiles(root) {
21861
21884
  return files.sort();
21862
21885
  }
21863
21886
  async function ensureMacroPlugins(moduleRoot, toolchainBin) {
21864
- const dir = import_node_path8.default.join(moduleRoot, ".build/host/RnxPreviewMacros");
21887
+ const dir = import_node_path9.default.join(moduleRoot, ".build/host/RnxPreviewMacros");
21865
21888
  const ext = process.platform === "darwin" ? "dylib" : "so";
21866
21889
  const plugins = [
21867
21890
  {
21868
- library: import_node_path8.default.join(dir, `libRnxPreviewMacros.${ext}`),
21869
- 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")
21870
21893
  },
21871
21894
  {
21872
- library: import_node_path8.default.join(dir, `libFoundationMacros.${ext}`),
21873
- 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")
21874
21897
  }
21875
21898
  ];
21876
21899
  const stale = plugins.some(
@@ -21878,7 +21901,7 @@ async function ensureMacroPlugins(moduleRoot, toolchainBin) {
21878
21901
  );
21879
21902
  if (stale) {
21880
21903
  await run2("sh", [
21881
- import_node_path8.default.join(moduleRoot, "scripts/build-preview-plugin.sh"),
21904
+ import_node_path9.default.join(moduleRoot, "scripts/build-preview-plugin.sh"),
21882
21905
  toolchainBin,
21883
21906
  plugins[0].library
21884
21907
  ]);
@@ -21889,7 +21912,7 @@ function linkedModuleDigest(root) {
21889
21912
  const files = swiftModuleInputFiles(root);
21890
21913
  const stampHash = (0, import_node_crypto3.createHash)("sha256");
21891
21914
  for (const file of files) {
21892
- 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 });
21893
21916
  stampHash.update(file);
21894
21917
  stampHash.update(
21895
21918
  `${stat2.dev}:${stat2.ino}:${stat2.size}:${stat2.mtimeNs}:${stat2.ctimeNs}
@@ -21903,7 +21926,7 @@ function linkedModuleDigest(root) {
21903
21926
  for (const file of files) {
21904
21927
  hash.update((0, import_node_crypto3.createHash)("sha256").update(file).digest());
21905
21928
  hash.update(
21906
- (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()
21907
21930
  );
21908
21931
  }
21909
21932
  const digest = hash.digest();
@@ -21924,7 +21947,7 @@ function withNativeSourceGlue(input, glue) {
21924
21947
  ...input,
21925
21948
  files: {
21926
21949
  ...input.files,
21927
- [import_node_path8.default.posix.join(targetPath, "OneNativeSource.generated.swift")]: glue
21950
+ [import_node_path9.default.posix.join(targetPath, "OneNativeSource.generated.swift")]: glue
21928
21951
  },
21929
21952
  oneModule: true
21930
21953
  };
@@ -21949,7 +21972,7 @@ function swiftSiblingDependencies(files, targets) {
21949
21972
  }
21950
21973
  function swiftArtifactHash(input, release, moduleRoot) {
21951
21974
  const hash = (0, import_node_crypto3.createHash)("sha256");
21952
- hash.update(`swift-compile/v6
21975
+ hash.update(`swift-compile/v7
21953
21976
  ${release}
21954
21977
  `);
21955
21978
  if (input.oneModule) hash.update("one-module\n");
@@ -22036,7 +22059,7 @@ function syncSwiftTree(base, files) {
22036
22059
  (0, import_node_fs8.mkdirSync)(base, { recursive: true });
22037
22060
  const walk = (dir) => {
22038
22061
  for (const entry of (0, import_node_fs8.readdirSync)(dir, { withFileTypes: true })) {
22039
- const full = import_node_path8.default.join(dir, entry.name);
22062
+ const full = import_node_path9.default.join(dir, entry.name);
22040
22063
  if (dir === base && entry.name === ".build") continue;
22041
22064
  if (entry.isDirectory()) walk(full);
22042
22065
  else if (!files.has(full)) (0, import_node_fs8.rmSync)(full, { force: true });
@@ -22045,7 +22068,7 @@ function syncSwiftTree(base, files) {
22045
22068
  walk(base);
22046
22069
  for (const [full, contents] of files) {
22047
22070
  if ((0, import_node_fs8.existsSync)(full) && (0, import_node_fs8.readFileSync)(full, "utf8") === contents) continue;
22048
- (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 });
22049
22072
  (0, import_node_fs8.writeFileSync)(full, contents, "utf8");
22050
22073
  }
22051
22074
  }
@@ -22062,6 +22085,17 @@ function swiftSourceAsIOS(source) {
22062
22085
  let copied = 0;
22063
22086
  for (const at of tokens) {
22064
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
+ }
22065
22099
  if (rest.startsWith("class")) {
22066
22100
  const modifiers = conditioned.slice(conditioned.lastIndexOf("\n", at - 1) + 1, at);
22067
22101
  if (DELEGATE_CLASS.test(rest) && !/\b(?:final|open)\b/.test(modifiers)) {
@@ -22162,12 +22196,15 @@ function swiftCodeScan(source) {
22162
22196
  if (top.parens === 0 && stack.length > 1) stack.pop();
22163
22197
  else top.parens--;
22164
22198
  i++;
22165
- } else if (source.startsWith("class", i) && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + 5] ?? "")) {
22166
- tokens.push(i);
22167
- i += 5;
22168
22199
  } else {
22169
- if (char === "@") tokens.push(i);
22170
- 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
+ }
22171
22208
  }
22172
22209
  }
22173
22210
  return { lineStarts: starts, tokens };
@@ -22181,10 +22218,10 @@ function writeSwiftProject(layout, input, moduleRoot) {
22181
22218
  if (targets.length === 0) {
22182
22219
  for (const [file, contents] of Object.entries(input.files)) {
22183
22220
  if (file === "Package.swift") continue;
22184
- 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));
22185
22222
  }
22186
22223
  let manifest = (0, import_node_fs8.readFileSync)(
22187
- import_node_path8.default.join(moduleRoot, "scripts/contrast-app-Package.swift"),
22224
+ import_node_path9.default.join(moduleRoot, "scripts/contrast-app-Package.swift"),
22188
22225
  "utf8"
22189
22226
  ).replaceAll("__SOOTSIM_SWIFT_PACKAGE__", moduleRoot);
22190
22227
  if (input.oneModule) {
@@ -22198,16 +22235,16 @@ function writeSwiftProject(layout, input, moduleRoot) {
22198
22235
  manifest = manifest.replace(product, `${product}
22199
22236
  ${ONE_PRODUCT},`).replace(flags, `${flags}${ONE_IMPLICIT_FLAGS}`);
22200
22237
  }
22201
- 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);
22202
22239
  } else {
22203
22240
  for (const [file, contents] of Object.entries(input.files)) {
22204
22241
  if (file === "Package.swift") continue;
22205
- 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));
22206
22243
  }
22207
22244
  for (const target of targets) {
22208
22245
  if (!target.resources) continue;
22209
22246
  files.set(
22210
- 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"),
22211
22248
  [
22212
22249
  "import Foundation",
22213
22250
  "",
@@ -22219,7 +22256,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
22219
22256
  );
22220
22257
  }
22221
22258
  files.set(
22222
- import_node_path8.default.join(layout.root, "Package.swift"),
22259
+ import_node_path9.default.join(layout.root, "Package.swift"),
22223
22260
  emitSwiftPackageManifest({
22224
22261
  targets,
22225
22262
  siblings: swiftSiblingDependencies(input.files, targets),
@@ -22246,13 +22283,13 @@ function outputOf(error) {
22246
22283
  return error instanceof Error ? error.message : String(error);
22247
22284
  }
22248
22285
  function builtArtifact(layout) {
22249
- const binDir = import_node_path8.default.join(layout.root, ".build", WASM_TRIPLE, "release");
22250
- 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");
22251
22288
  const executable = swiftManifestTargets(manifest).find((target) => target.executable);
22252
22289
  if (executable === void 0) {
22253
22290
  throw new Error("swift-compile: the written manifest names no executable target");
22254
22291
  }
22255
- const file = import_node_path8.default.join(binDir, `${executable.name}.wasm`);
22292
+ const file = import_node_path9.default.join(binDir, `${executable.name}.wasm`);
22256
22293
  if (!(0, import_node_fs8.existsSync)(file)) {
22257
22294
  const found = (0, import_node_fs8.existsSync)(binDir) ? (0, import_node_fs8.readdirSync)(binDir).filter((name2) => name2.endsWith(".wasm")).sort() : [];
22258
22295
  throw new Error(
@@ -22263,7 +22300,7 @@ function builtArtifact(layout) {
22263
22300
  }
22264
22301
  function projectDiagnostic(output, layout) {
22265
22302
  const base = layout.multi ? layout.root : layout.sources;
22266
- const prefix = `${base}${import_node_path8.default.sep}`;
22303
+ const prefix = `${base}${import_node_path9.default.sep}`;
22267
22304
  return output.split("\n").map((line) => line.startsWith(prefix) ? line.slice(prefix.length) : line).join("\n").trim();
22268
22305
  }
22269
22306
  function serialize(root, work) {
@@ -22279,16 +22316,16 @@ function serialize(root, work) {
22279
22316
  function compileSwiftProjectUnit(input, options) {
22280
22317
  (0, import_node_fs8.mkdirSync)(options.buildRoot, { recursive: true });
22281
22318
  const root = (0, import_node_fs8.realpathSync)(options.buildRoot);
22282
- const moduleRoot = import_node_path8.default.resolve(options.moduleRoot);
22319
+ const moduleRoot = import_node_path9.default.resolve(options.moduleRoot);
22283
22320
  const layout = {
22284
22321
  root,
22285
- sources: import_node_path8.default.join(root, "Sources", "App"),
22322
+ sources: import_node_path9.default.join(root, "Sources", "App"),
22286
22323
  multi: compileTargets(input).length > 0
22287
22324
  };
22288
22325
  const hash = swiftArtifactHash(input, options.release, moduleRoot);
22289
22326
  return serialize(root, async () => {
22290
22327
  writeSwiftProject(layout, input, moduleRoot);
22291
- const swift = import_node_path8.default.join(options.toolchainBin, "swift");
22328
+ const swift = import_node_path9.default.join(options.toolchainBin, "swift");
22292
22329
  if (!(0, import_node_fs8.existsSync)(swift)) {
22293
22330
  throw new Error(
22294
22331
  `swift-compile: no swift.org toolchain at ${options.toolchainBin}; install ${options.release} and its matching wasm sdk`
@@ -22330,21 +22367,21 @@ function compileSwiftProjectUnit(input, options) {
22330
22367
  };
22331
22368
  });
22332
22369
  }
22333
- 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;
22334
22371
  var init_swift_compile = __esm({
22335
22372
  "src/swift-compile.ts"() {
22336
22373
  "use strict";
22337
22374
  import_node_child_process4 = require("node:child_process");
22338
22375
  import_node_crypto3 = require("node:crypto");
22339
22376
  import_node_fs8 = require("node:fs");
22340
- import_node_os2 = __toESM(require("node:os"), 1);
22341
- 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);
22342
22379
  import_node_util2 = require("node:util");
22343
22380
  init_swift_icu();
22344
22381
  init_swift_package();
22345
22382
  run2 = (0, import_node_util2.promisify)(import_node_child_process4.execFile);
22346
22383
  WASM_TRIPLE = "wasm32-unknown-wasip1";
22347
- cores = import_node_os2.default.availableParallelism();
22384
+ cores = import_node_os3.default.availableParallelism();
22348
22385
  BUILD_ENV = { ...process.env, BINARYEN_CORES: String(Math.min(4, cores)) };
22349
22386
  BUILD_JOBS = String(Math.max(1, Math.floor(cores / 2)));
22350
22387
  linkedModuleDigests = /* @__PURE__ */ new Map();
@@ -22498,17 +22535,17 @@ var init_swift_submit = __esm({
22498
22535
 
22499
22536
  // src/swift-host.ts
22500
22537
  function swiftPackageId(packagePath) {
22501
- 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");
22502
22539
  }
22503
22540
  function nativeSourceDescriptor(packagePath) {
22504
22541
  packagePath = import_node_fs9.default.realpathSync(packagePath);
22505
- const file = import_node_path9.default.join(packagePath, NATIVE_DESCRIPTOR);
22542
+ const file = import_node_path10.default.join(packagePath, NATIVE_DESCRIPTOR);
22506
22543
  if (!import_node_fs9.default.existsSync(file)) return null;
22507
22544
  const value = JSON.parse(
22508
22545
  readPackageFile(packagePath, file, MAX_SWIFT_COMPILE_SOURCE_BYTES).toString("utf8")
22509
22546
  );
22510
22547
  const invalid = () => new Error(`${file}: invalid One native source descriptor; run one typegen`);
22511
- 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))) {
22512
22549
  throw invalid();
22513
22550
  }
22514
22551
  if (!isSwiftNativeModules(value) || value.packageId !== swiftPackageId(packagePath)) {
@@ -22544,15 +22581,15 @@ function packageFiles(root) {
22544
22581
  for (const entry of import_node_fs9.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
22545
22582
  if (entry.name.startsWith(".") && entry.name !== NATIVE_DESCRIPTOR && entry.name !== NATIVE_GLUE || SKIP_SOURCE_DIRS.has(entry.name))
22546
22583
  continue;
22547
- const full = import_node_path9.default.join(dir, entry.name);
22584
+ const full = import_node_path10.default.join(dir, entry.name);
22548
22585
  if (entry.isSymbolicLink()) throw new Error(`swift input is a symlink: ${full}`);
22549
22586
  const real = import_node_fs9.default.realpathSync(full);
22550
- const relative2 = import_node_path9.default.relative(canonicalRoot, real);
22551
- 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)) {
22552
22589
  throw new Error(`swift input escapes the selected package: ${full}`);
22553
22590
  }
22554
22591
  if (entry.isDirectory()) {
22555
- 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;
22556
22593
  walk(full);
22557
22594
  } else if (entry.isFile()) {
22558
22595
  found.push(full);
@@ -22565,16 +22602,16 @@ function packageFiles(root) {
22565
22602
  }
22566
22603
  function readPackageFile(root, file, maxBytes) {
22567
22604
  const canonicalRoot = import_node_fs9.default.realpathSync(root);
22568
- const relative2 = import_node_path9.default.relative(canonicalRoot, import_node_fs9.default.realpathSync(file));
22569
- 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)) {
22570
22607
  throw new Error(`swift input escapes the selected package: ${file}`);
22571
22608
  }
22572
- let ancestor = import_node_path9.default.resolve(file);
22609
+ let ancestor = import_node_path10.default.resolve(file);
22573
22610
  while (ancestor !== canonicalRoot) {
22574
22611
  if (import_node_fs9.default.lstatSync(ancestor).isSymbolicLink()) {
22575
22612
  throw new Error(`swift input is a symlink: ${ancestor}`);
22576
22613
  }
22577
- const parent = import_node_path9.default.dirname(ancestor);
22614
+ const parent = import_node_path10.default.dirname(ancestor);
22578
22615
  if (parent === ancestor)
22579
22616
  throw new Error(`swift input escapes the selected package: ${file}`);
22580
22617
  ancestor = parent;
@@ -22617,7 +22654,7 @@ function resourceCandidateFiles(root) {
22617
22654
  function buildSwiftResourceTable(project, baseUrl) {
22618
22655
  const absolute = resourceCandidateFiles(project.packagePath);
22619
22656
  const relative2 = absolute.map(
22620
- (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)
22621
22658
  );
22622
22659
  const byRelative = new Map(absolute.map((file, index) => [relative2[index], file]));
22623
22660
  const readContents = (candidate) => {
@@ -22651,10 +22688,10 @@ function buildSwiftResourceTable(project, baseUrl) {
22651
22688
  );
22652
22689
  imageBytes += bytes.length;
22653
22690
  const hash = (0, import_node_crypto4.createHash)("sha256").update(bytes).digest("hex").slice(0, 16);
22654
- const ext = import_node_path9.default.posix.extname(file).toLowerCase();
22691
+ const ext = import_node_path10.default.posix.extname(file).toLowerCase();
22655
22692
  table[name2] = { uri: `${baseUrl}${RESOURCE_PATH}${hash}${ext}`, scale };
22656
22693
  images[name2] = {
22657
- file: import_node_path9.default.posix.basename(file),
22694
+ file: import_node_path10.default.posix.basename(file),
22658
22695
  data: bytes.toString("base64")
22659
22696
  };
22660
22697
  watched.push(file);
@@ -22680,14 +22717,14 @@ function buildSwiftResourceTable(project, baseUrl) {
22680
22717
  function buildSwiftBundleFiles(packagePath) {
22681
22718
  packagePath = import_node_fs9.default.realpathSync(packagePath);
22682
22719
  const relative2 = resourceCandidateFiles(packagePath).map(
22683
- (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)
22684
22721
  );
22685
22722
  const files = {};
22686
22723
  const watched = [];
22687
22724
  let total = 0;
22688
22725
  for (const { base, file } of enumerateBundleJson(relative2)) {
22689
22726
  watched.push(file);
22690
- const disk = import_node_path9.default.join(packagePath, ...file.split("/"));
22727
+ const disk = import_node_path10.default.join(packagePath, ...file.split("/"));
22691
22728
  if (Object.keys(files).length >= BUNDLE_MAX_FILES || total + import_node_fs9.default.statSync(disk).size > BUNDLE_MAX_TOTAL_BYTES) {
22692
22729
  throw new Error(
22693
22730
  `swift bundle pack exceeds ${BUNDLE_MAX_FILES} files / ${BUNDLE_MAX_TOTAL_BYTES} bytes`
@@ -22708,7 +22745,7 @@ function linkedModuleRoots(packagePath) {
22708
22745
  try {
22709
22746
  manifest = readPackageFile(
22710
22747
  packagePath,
22711
- import_node_path9.default.join(packagePath, "Package.swift"),
22748
+ import_node_path10.default.join(packagePath, "Package.swift"),
22712
22749
  MAX_SWIFT_COMPILE_SOURCE_BYTES
22713
22750
  ).toString("utf8");
22714
22751
  } catch {
@@ -22717,8 +22754,8 @@ function linkedModuleRoots(packagePath) {
22717
22754
  const roots = /* @__PURE__ */ new Set();
22718
22755
  const dependency = /\.package\(\s*path:\s*"([^"]+)"\s*\)/g;
22719
22756
  for (const match of manifest.replace(/^\s*\/\/.*$/gm, "").matchAll(dependency)) {
22720
- const root = import_node_path9.default.resolve(packagePath, match[1]);
22721
- 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);
22722
22759
  }
22723
22760
  return [...roots].sort();
22724
22761
  }
@@ -22727,18 +22764,18 @@ function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
22727
22764
  hash.update(packagePath);
22728
22765
  const projectInputs = new Set(packageFiles(packagePath));
22729
22766
  for (const file of [...projectInputs].sort()) {
22730
- hash.update(import_node_path9.default.relative(packagePath, file));
22767
+ hash.update(import_node_path10.default.relative(packagePath, file));
22731
22768
  const stat2 = import_node_fs9.default.statSync(file);
22732
22769
  hash.update(`${stat2.mtimeMs}/${stat2.ctimeMs}/${stat2.size}`);
22733
22770
  }
22734
22771
  const moduleRoot = hosted ? void 0 : moduleRootOverride ?? linkedModuleRoots(packagePath).find(
22735
- (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"))
22736
22773
  );
22737
22774
  if (moduleRoot) {
22738
22775
  hash.update(moduleRoot);
22739
22776
  for (const relative2 of swiftModuleInputFiles(moduleRoot)) {
22740
22777
  hash.update(relative2);
22741
- 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));
22742
22779
  }
22743
22780
  }
22744
22781
  return hash.digest("hex").slice(0, 16);
@@ -22756,7 +22793,7 @@ function packageSources(packagePath) {
22756
22793
  throw new Error("swift source byte cap exceeded");
22757
22794
  const files = {};
22758
22795
  for (const file of sources) {
22759
- 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);
22760
22797
  files[relative2] = readPackageFile(
22761
22798
  packagePath,
22762
22799
  file,
@@ -22776,7 +22813,7 @@ function packageSnapshot(project) {
22776
22813
  ...native ? {
22777
22814
  glue: readPackageFile(
22778
22815
  project.packagePath,
22779
- import_node_path9.default.join(project.packagePath, NATIVE_GLUE),
22816
+ import_node_path10.default.join(project.packagePath, NATIVE_GLUE),
22780
22817
  MAX_SWIFT_COMPILE_SOURCE_BYTES
22781
22818
  ).toString("utf8")
22782
22819
  } : {}
@@ -22811,7 +22848,7 @@ async function compile(packagePath, entry, stamp, moduleRootOverride, hosted, sn
22811
22848
  package: content
22812
22849
  };
22813
22850
  const moduleRoot = moduleRootOverride ?? linkedModuleRoots(packagePath).find(
22814
- (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"))
22815
22852
  );
22816
22853
  if (!moduleRoot)
22817
22854
  return {
@@ -22830,10 +22867,10 @@ async function compile(packagePath, entry, stamp, moduleRootOverride, hosted, sn
22830
22867
  // server and a capture, or two checkouts) build each other's sources. so
22831
22868
  // each app and module checkout gets its own root, which keeps the same
22832
22869
  // app's incremental build across restarts.
22833
- buildRoot: process.env.CONTRAST_SWIFT_BUILD_ROOT ?? import_node_path9.default.join(
22834
- import_node_os3.default.tmpdir(),
22870
+ buildRoot: process.env.CONTRAST_SWIFT_BUILD_ROOT ?? import_node_path10.default.join(
22871
+ import_node_os4.default.tmpdir(),
22835
22872
  "contrast-swift-build",
22836
- (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)
22837
22874
  ),
22838
22875
  moduleRoot,
22839
22876
  ...toolchain
@@ -22841,24 +22878,21 @@ async function compile(packagePath, entry, stamp, moduleRootOverride, hosted, sn
22841
22878
  return { ...artifact, stamp, package: content };
22842
22879
  }
22843
22880
  function localSwiftToolchain(moduleRoot) {
22844
- const manifest = import_node_path9.default.join(moduleRoot, "toolchain.json");
22881
+ const manifest = import_node_path10.default.join(moduleRoot, "toolchain.json");
22845
22882
  if (!import_node_fs9.default.existsSync(manifest)) return null;
22846
22883
  const toolchain = JSON.parse(import_node_fs9.default.readFileSync(manifest, "utf8"));
22847
22884
  const release = toolchain && typeof toolchain === "object" ? Reflect.get(toolchain, "release") : void 0;
22848
22885
  if (typeof release !== "string") {
22849
22886
  throw new Error(`swift toolchain manifest at ${moduleRoot} has no release`);
22850
22887
  }
22851
- const toolchainBin = import_node_path9.default.join(
22852
- import_node_os3.default.homedir(),
22853
- `Library/Developer/Toolchains/${release}.xctoolchain/usr/bin`
22854
- );
22855
- 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;
22856
22890
  }
22857
22891
  async function compileRemote(packagePath, entry, snapshot, hosted) {
22858
22892
  const auth = hosted ? null : resolveCliAuth();
22859
22893
  if (!hosted && (!auth || auth.kind === "github")) {
22860
22894
  throw new Error(
22861
- `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`
22862
22896
  );
22863
22897
  }
22864
22898
  const origin = hosted?.origin ?? resolveContrastBackendOrigin(auth?.kind === "session" ? auth.origin : null);
@@ -22888,7 +22922,7 @@ async function compileRemote(packagePath, entry, snapshot, hosted) {
22888
22922
  );
22889
22923
  if (descriptor && address.native?.hash !== descriptor.hash) {
22890
22924
  throw new Error(
22891
- `${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`
22892
22926
  );
22893
22927
  }
22894
22928
  const response = await fetch(address.url, { signal });
@@ -23005,14 +23039,15 @@ function serveSwiftPackageAsset(pathname, res) {
23005
23039
  res.end("swift artifact is stale");
23006
23040
  return true;
23007
23041
  }
23008
- 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;
23009
23043
  var init_swift_host = __esm({
23010
23044
  "src/swift-host.ts"() {
23011
23045
  "use strict";
23012
23046
  import_node_crypto4 = require("node:crypto");
23013
23047
  import_node_fs9 = __toESM(require("node:fs"), 1);
23014
- import_node_os3 = __toESM(require("node:os"), 1);
23015
- 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();
23016
23051
  init_bundleAssets();
23017
23052
  init_auth();
23018
23053
  init_backend_origin();
@@ -23051,7 +23086,7 @@ var init_swift_host = __esm({
23051
23086
  // src/expo-swift-host.ts
23052
23087
  async function collectExpoSwiftSources(appRoot) {
23053
23088
  appRoot = import_node_fs10.default.realpathSync(appRoot);
23054
- 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"));
23055
23090
  let autolinker;
23056
23091
  try {
23057
23092
  autolinker = appRequire.resolve("expo-modules-autolinking/package.json");
@@ -23063,7 +23098,7 @@ async function collectExpoSwiftSources(appRoot) {
23063
23098
  const { stdout } = await run3(
23064
23099
  process.execPath,
23065
23100
  [
23066
- 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"),
23067
23102
  "search",
23068
23103
  "--platform",
23069
23104
  "apple",
@@ -23079,7 +23114,7 @@ async function collectExpoSwiftSources(appRoot) {
23079
23114
  const { stdout: resolvedText } = await run3(
23080
23115
  process.execPath,
23081
23116
  [
23082
- 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"),
23083
23118
  "resolve",
23084
23119
  "--platform",
23085
23120
  "apple",
@@ -23103,7 +23138,7 @@ async function collectExpoSwiftSources(appRoot) {
23103
23138
  if (typeof sourceRoot !== "string")
23104
23139
  throw new Error("Expo autolinking entry has no path");
23105
23140
  const canonical = import_node_fs10.default.realpathSync(sourceRoot);
23106
- 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;
23107
23142
  const resolution = resolutions.find(
23108
23143
  (candidate) => candidate && typeof candidate === "object" && Reflect.get(candidate, "packageName") === Reflect.get(entry, "name")
23109
23144
  );
@@ -23127,12 +23162,12 @@ async function collectExpoSwiftSources(appRoot) {
23127
23162
  `(${className.includes(".") ? className : `${namespace}.${className}`}.self, ${name2 === null ? "nil" : JSON.stringify(name2)})`
23128
23163
  );
23129
23164
  }
23130
- const ios = import_node_path10.default.join(canonical, "ios");
23165
+ const ios = import_node_path11.default.join(canonical, "ios");
23131
23166
  if (import_node_fs10.default.lstatSync(ios).isSymbolicLink())
23132
23167
  throw new Error(`Expo Swift source directory is a symlink: ${ios}`);
23133
23168
  const walk = (dir) => {
23134
23169
  for (const child of import_node_fs10.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
23135
- const file = import_node_path10.default.join(dir, child.name);
23170
+ const file = import_node_path11.default.join(dir, child.name);
23136
23171
  if (child.isSymbolicLink())
23137
23172
  throw new Error(`Expo Swift source is a symlink: ${file}`);
23138
23173
  if (child.isDirectory()) {
@@ -23144,7 +23179,7 @@ async function collectExpoSwiftSources(appRoot) {
23144
23179
  bytes += size;
23145
23180
  if (Object.keys(files).length + 1 > MAX_SWIFT_COMPILE_FILES - 2 || bytes > MAX_SWIFT_COMPILE_SOURCE_BYTES)
23146
23181
  throw new Error("Expo Swift sources exceed compile service caps");
23147
- 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)
23148
23183
  ${import_node_fs10.default.readFileSync(file, "utf8")}`;
23149
23184
  }
23150
23185
  };
@@ -23194,7 +23229,7 @@ async function handleExpoSwiftRequest(req, res) {
23194
23229
  return true;
23195
23230
  }
23196
23231
  const root = url.searchParams.get("root");
23197
- if (!root || !import_node_path10.default.isAbsolute(root)) {
23232
+ if (!root || !import_node_path11.default.isAbsolute(root)) {
23198
23233
  res.writeHead(400);
23199
23234
  res.end("missing absolute app root");
23200
23235
  return true;
@@ -23205,16 +23240,16 @@ async function handleExpoSwiftRequest(req, res) {
23205
23240
  pending = (async () => {
23206
23241
  const files = await collectExpoSwiftSources(root);
23207
23242
  if (!files) return null;
23208
- 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");
23209
23244
  if (!localSwiftToolchain(moduleRoot)) return null;
23210
23245
  const key = (0, import_node_crypto5.createHash)("sha256").update(import_node_fs10.default.realpathSync(root)).digest("hex");
23211
- const packagePath = import_node_path10.default.join(import_node_os4.default.tmpdir(), "peach-expo-swift", key);
23212
- 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");
23213
23248
  import_node_fs10.default.rmSync(sources, { recursive: true, force: true });
23214
23249
  import_node_fs10.default.mkdirSync(sources, { recursive: true });
23215
23250
  for (const [name2, content] of Object.entries(files)) {
23216
- const target = import_node_path10.default.join(packagePath, name2);
23217
- 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 });
23218
23253
  import_node_fs10.default.writeFileSync(target, content);
23219
23254
  }
23220
23255
  const artifact = await artifactFor(
@@ -23248,7 +23283,7 @@ async function handleExpoSwiftRequest(req, res) {
23248
23283
  }
23249
23284
  return true;
23250
23285
  }
23251
- 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;
23252
23287
  var init_expo_swift_host = __esm({
23253
23288
  "src/expo-swift-host.ts"() {
23254
23289
  "use strict";
@@ -23256,8 +23291,8 @@ var init_expo_swift_host = __esm({
23256
23291
  import_node_crypto5 = require("node:crypto");
23257
23292
  import_node_fs10 = __toESM(require("node:fs"), 1);
23258
23293
  import_node_module = require("node:module");
23259
- import_node_os4 = __toESM(require("node:os"), 1);
23260
- 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);
23261
23296
  import_node_util3 = require("node:util");
23262
23297
  init_internal_child();
23263
23298
  init_backend_origin();
@@ -23284,7 +23319,7 @@ function listInstalledRuntimes(product) {
23284
23319
  }
23285
23320
  }
23286
23321
  function runtimeTarballCacheName(product, version) {
23287
- return import_node_path11.default.posix.basename(product.tarballPath(version));
23322
+ return import_node_path12.default.posix.basename(product.tarballPath(version));
23288
23323
  }
23289
23324
  function compareSemver(a, b) {
23290
23325
  const parse2 = (v) => {
@@ -23307,12 +23342,12 @@ function compareSemver(a, b) {
23307
23342
  if (!bp) return -1;
23308
23343
  return ap < bp ? -1 : 1;
23309
23344
  }
23310
- var import_node_fs11, import_node_path11;
23345
+ var import_node_fs11, import_node_path12;
23311
23346
  var init_product = __esm({
23312
23347
  "../contrast-runtime-delivery/src/product.ts"() {
23313
23348
  "use strict";
23314
23349
  import_node_fs11 = __toESM(require("node:fs"), 1);
23315
- import_node_path11 = __toESM(require("node:path"), 1);
23350
+ import_node_path12 = __toESM(require("node:path"), 1);
23316
23351
  }
23317
23352
  });
23318
23353
 
@@ -23394,7 +23429,7 @@ function createRuntimeDelivery(product) {
23394
23429
  const setActive = opts.setActive !== false;
23395
23430
  const protectVersions = [version, ...opts.protectVersions ?? []];
23396
23431
  pruneLocalRetention({ protectVersions });
23397
- 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))) {
23398
23433
  if (setActive) product.writeActiveRuntime(version);
23399
23434
  pruneLocalRetention({ protectVersions });
23400
23435
  return {
@@ -23438,7 +23473,7 @@ function createRuntimeDelivery(product) {
23438
23473
  if (pin) {
23439
23474
  const activeVersion2 = product.readActiveRuntime();
23440
23475
  const pinInstalled = import_node_fs12.default.existsSync(
23441
- import_node_path12.default.join(product.runtimeDir(pin), product.installedMarker)
23476
+ import_node_path13.default.join(product.runtimeDir(pin), product.installedMarker)
23442
23477
  );
23443
23478
  if (activeVersion2 === pin && pinInstalled) {
23444
23479
  return {
@@ -23487,7 +23522,7 @@ function createRuntimeDelivery(product) {
23487
23522
  }
23488
23523
  const activeVersion = product.readActiveRuntime();
23489
23524
  const activeDir = activeVersion ? product.runtimeDir(activeVersion) : null;
23490
- 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;
23491
23526
  const shouldInstall = !activeVersion || !activeInstalled || compareSemver(latestVersion, activeVersion) > 0;
23492
23527
  if (!shouldInstall) {
23493
23528
  return {
@@ -23567,7 +23602,7 @@ function createRuntimeDelivery(product) {
23567
23602
  const complete = entry.name.startsWith(cachePrefix) && entry.name.endsWith(cacheSuffix);
23568
23603
  const partial = entry.name.startsWith(cachePrefix) && entry.name.endsWith(`${cacheSuffix}.partial`);
23569
23604
  return complete || partial;
23570
- }).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();
23571
23606
  } catch {
23572
23607
  }
23573
23608
  }
@@ -23608,11 +23643,11 @@ function createRuntimeDelivery(product) {
23608
23643
  }
23609
23644
  async function installVerifiedTarball(tarball) {
23610
23645
  const { url, digest, destDir, installedMarker, label } = tarball;
23611
- const downloadDir = import_node_fs12.default.mkdtempSync(import_node_path12.default.join(import_node_os5.default.tmpdir(), "runtime-delivery-download-"));
23612
- const archivePath = import_node_path12.default.join(downloadDir, "archive.tar.gz");
23613
- 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 });
23614
23649
  const tmpDir = import_node_fs12.default.mkdtempSync(
23615
- 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)}-`)
23616
23651
  );
23617
23652
  try {
23618
23653
  await downloadToFile(url, archivePath);
@@ -23623,7 +23658,7 @@ async function installVerifiedTarball(tarball) {
23623
23658
  );
23624
23659
  }
23625
23660
  await extractTarball(archivePath, tmpDir, tarball.stripComponents ?? 0);
23626
- 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))) {
23627
23662
  throw new Error(`extracted tarball for ${label} is missing ${installedMarker}`);
23628
23663
  }
23629
23664
  try {
@@ -23639,7 +23674,7 @@ async function installVerifiedTarball(tarball) {
23639
23674
  try {
23640
23675
  import_node_fs12.default.renameSync(tmpDir, destDir);
23641
23676
  } catch (landErr) {
23642
- 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))) {
23643
23678
  throw landErr;
23644
23679
  }
23645
23680
  } finally {
@@ -23659,7 +23694,7 @@ async function downloadToFile(url, destPath) {
23659
23694
  if (!res.ok || !res.body) {
23660
23695
  throw new Error(`download failed: ${res.status} ${res.statusText} (${url})`);
23661
23696
  }
23662
- 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 });
23663
23698
  const tmp = `${destPath}.partial`;
23664
23699
  try {
23665
23700
  await (0, import_promises3.pipeline)(
@@ -23698,15 +23733,15 @@ function extractTarball(tarPath, destDir, stripComponents) {
23698
23733
  });
23699
23734
  });
23700
23735
  }
23701
- 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;
23702
23737
  var init_src = __esm({
23703
23738
  "../contrast-runtime-delivery/src/index.ts"() {
23704
23739
  "use strict";
23705
23740
  import_node_child_process6 = require("node:child_process");
23706
23741
  import_node_crypto6 = __toESM(require("node:crypto"), 1);
23707
23742
  import_node_fs12 = __toESM(require("node:fs"), 1);
23708
- import_node_os5 = __toESM(require("node:os"), 1);
23709
- 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);
23710
23745
  import_node_stream = require("node:stream");
23711
23746
  import_promises3 = require("node:stream/promises");
23712
23747
  init_product();
@@ -23882,14 +23917,14 @@ var init_standalone = __esm({
23882
23917
  // cli/self-invocation.ts
23883
23918
  function sourceEntryPath() {
23884
23919
  try {
23885
- 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");
23886
23921
  return (0, import_node_fs13.existsSync)(candidate) ? candidate : null;
23887
23922
  } catch {
23888
23923
  return null;
23889
23924
  }
23890
23925
  }
23891
- function isCliEntry(path28) {
23892
- const name2 = (0, import_node_path13.basename)(path28);
23926
+ function isCliEntry(path29) {
23927
+ const name2 = (0, import_node_path14.basename)(path29);
23893
23928
  return name2 === "bin.ts" || name2 === "bin.js";
23894
23929
  }
23895
23930
  function rnxSelfInvocation() {
@@ -23907,12 +23942,12 @@ function rnxSelfInvocation() {
23907
23942
  }
23908
23943
  return { executable: process.execPath, prefixArgs: [entry] };
23909
23944
  }
23910
- var import_node_fs13, import_node_path13, import_node_url3;
23945
+ var import_node_fs13, import_node_path14, import_node_url3;
23911
23946
  var init_self_invocation = __esm({
23912
23947
  "cli/self-invocation.ts"() {
23913
23948
  "use strict";
23914
23949
  import_node_fs13 = require("node:fs");
23915
- import_node_path13 = require("node:path");
23950
+ import_node_path14 = require("node:path");
23916
23951
  import_node_url3 = require("node:url");
23917
23952
  init_public_brand();
23918
23953
  init_standalone();
@@ -23980,7 +24015,7 @@ function getUserDataDir() {
23980
24015
  return userDataDir();
23981
24016
  }
23982
24017
  function storeFile() {
23983
- return import_node_path14.default.join(userDataDir(), "attached-projects.json");
24018
+ return import_node_path15.default.join(userDataDir(), "attached-projects.json");
23984
24019
  }
23985
24020
  function cloneEmpty() {
23986
24021
  return {
@@ -24022,7 +24057,7 @@ function loadStore() {
24022
24057
  }
24023
24058
  function writeStore(store) {
24024
24059
  const file = storeFile();
24025
- 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 });
24026
24061
  const tmp = `${file}.tmp-${process.pid}-${Date.now()}`;
24027
24062
  const fd = import_node_fs14.default.openSync(tmp, "w", 384);
24028
24063
  try {
@@ -24040,13 +24075,13 @@ function mutateStore(fn) {
24040
24075
  return store;
24041
24076
  }
24042
24077
  function projectIdForCwd(cwd) {
24043
- 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);
24044
24079
  }
24045
24080
  function newSessionId() {
24046
24081
  return `s_${(0, import_node_crypto7.randomBytes)(10).toString("hex")}`;
24047
24082
  }
24048
24083
  function upsertProject(input) {
24049
- const cwd = import_node_path14.default.resolve(input.cwd);
24084
+ const cwd = import_node_path15.default.resolve(input.cwd);
24050
24085
  const id = projectIdForCwd(cwd);
24051
24086
  let result;
24052
24087
  mutateStore((store) => {
@@ -24072,7 +24107,7 @@ function upsertProject(input) {
24072
24107
  const now = Date.now();
24073
24108
  const created = {
24074
24109
  id,
24075
- name: input.name ?? import_node_path14.default.basename(cwd),
24110
+ name: input.name ?? import_node_path15.default.basename(cwd),
24076
24111
  cwd,
24077
24112
  repoRoot: input.repoRoot,
24078
24113
  sourceRoots: input.sourceRoots ?? [cwd],
@@ -24218,7 +24253,7 @@ async function seedFromDemoAppRegistry() {
24218
24253
  mutateStore((store) => {
24219
24254
  for (const app of apps) {
24220
24255
  if (!import_node_fs14.default.existsSync(app.dir)) continue;
24221
- const cwd = import_node_path14.default.resolve(app.dir);
24256
+ const cwd = import_node_path15.default.resolve(app.dir);
24222
24257
  const id = projectIdForCwd(cwd);
24223
24258
  if (store.attachedProjects.some((p) => p.id === id)) continue;
24224
24259
  const now = Date.now();
@@ -24239,13 +24274,13 @@ async function seedFromDemoAppRegistry() {
24239
24274
  }
24240
24275
  });
24241
24276
  }
24242
- 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;
24243
24278
  var init_attached_projects = __esm({
24244
24279
  "src/attached-projects.ts"() {
24245
24280
  "use strict";
24246
24281
  import_node_crypto7 = require("node:crypto");
24247
24282
  import_node_fs14 = __toESM(require("node:fs"), 1);
24248
- import_node_path14 = __toESM(require("node:path"), 1);
24283
+ import_node_path15 = __toESM(require("node:path"), 1);
24249
24284
  init_home_paths();
24250
24285
  overrideDir = null;
24251
24286
  COST_HISTORY_MAX_AGE_MS = 14 * 24 * 60 * 60 * 1e3;
@@ -24254,16 +24289,16 @@ var init_attached_projects = __esm({
24254
24289
 
24255
24290
  // src/agent-sessions.ts
24256
24291
  function sessionDir(sessionId) {
24257
- return import_node_path15.default.join(getUserDataDir(), "sessions", sessionId);
24292
+ return import_node_path16.default.join(getUserDataDir(), "sessions", sessionId);
24258
24293
  }
24259
24294
  function promptFifoPath(sessionId) {
24260
- return import_node_path15.default.join(sessionDir(sessionId), "prompt.in");
24295
+ return import_node_path16.default.join(sessionDir(sessionId), "prompt.in");
24261
24296
  }
24262
24297
  function eventsFifoPath(sessionId) {
24263
- return import_node_path15.default.join(sessionDir(sessionId), "events.out");
24298
+ return import_node_path16.default.join(sessionDir(sessionId), "events.out");
24264
24299
  }
24265
24300
  function transcriptPath(sessionId) {
24266
- return import_node_path15.default.join(getUserDataDir(), "transcripts", `${sessionId}.log`);
24301
+ return import_node_path16.default.join(getUserDataDir(), "transcripts", `${sessionId}.log`);
24267
24302
  }
24268
24303
  function pidIsAlive(pid, sessionId) {
24269
24304
  if (!pid) return false;
@@ -24286,8 +24321,8 @@ function resolveSootsimInvocation() {
24286
24321
  const resourcesPath = process.resourcesPath;
24287
24322
  if (resourcesPath) {
24288
24323
  const candidates = [
24289
- import_node_path15.default.join(resourcesPath, "bin", "sootsim"),
24290
- 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}`)
24291
24326
  ];
24292
24327
  for (const c of candidates) {
24293
24328
  if (import_node_fs15.default.existsSync(c)) return { executable: c, prefixArgs: [] };
@@ -24309,12 +24344,12 @@ function tryWorkspaceSootsim() {
24309
24344
  const sootsimDir = resolveSootsimPackageDir();
24310
24345
  if (!sootsimDir) return null;
24311
24346
  const binaryName = `peach-${process.platform === "win32" ? "windows" : process.platform}-${process.arch}${process.platform === "win32" ? ".exe" : ""}`;
24312
- const distBinary = import_node_path15.default.join(sootsimDir, "dist-bin", binaryName);
24347
+ const distBinary = import_node_path16.default.join(sootsimDir, "dist-bin", binaryName);
24313
24348
  if (import_node_fs15.default.existsSync(distBinary)) return { executable: distBinary, prefixArgs: [] };
24314
- 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");
24315
24350
  if (import_node_fs15.default.existsSync(distBin)) {
24316
24351
  try {
24317
- 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");
24318
24353
  if (import_node_fs15.default.existsSync(src)) {
24319
24354
  const srcMtime = import_node_fs15.default.statSync(src).mtimeMs;
24320
24355
  const buildMtime = import_node_fs15.default.statSync(distBin).mtimeMs;
@@ -24336,14 +24371,14 @@ function tryWorkspaceSootsim() {
24336
24371
  function resolveSootsimPackageDir() {
24337
24372
  try {
24338
24373
  const resolved = require.resolve(`${rnxPublicBrand.packageName}/package.json`);
24339
- return import_node_path15.default.dirname(resolved);
24374
+ return import_node_path16.default.dirname(resolved);
24340
24375
  } catch {
24341
24376
  }
24342
24377
  const here = fileFromImportMeta();
24343
24378
  if (!here) return null;
24344
- let cur = import_node_path15.default.dirname(here);
24379
+ let cur = import_node_path16.default.dirname(here);
24345
24380
  for (let i = 0; i < 8; i++) {
24346
- const pkg = import_node_path15.default.join(cur, "package.json");
24381
+ const pkg = import_node_path16.default.join(cur, "package.json");
24347
24382
  try {
24348
24383
  if (import_node_fs15.default.existsSync(pkg)) {
24349
24384
  const parsed = JSON.parse(import_node_fs15.default.readFileSync(pkg, "utf8"));
@@ -24351,7 +24386,7 @@ function resolveSootsimPackageDir() {
24351
24386
  }
24352
24387
  } catch {
24353
24388
  }
24354
- const parent = import_node_path15.default.dirname(cur);
24389
+ const parent = import_node_path16.default.dirname(cur);
24355
24390
  if (parent === cur) break;
24356
24391
  cur = parent;
24357
24392
  }
@@ -24367,13 +24402,13 @@ function fileFromImportMeta() {
24367
24402
  }
24368
24403
  }
24369
24404
  async function withStartLock(projectId, provider, fn) {
24370
- const lockDir = import_node_path15.default.join(getUserDataDir(), "locks");
24405
+ const lockDir = import_node_path16.default.join(getUserDataDir(), "locks");
24371
24406
  import_node_fs15.default.mkdirSync(lockDir, { recursive: true });
24372
24407
  try {
24373
24408
  import_node_fs15.default.chmodSync(lockDir, 448);
24374
24409
  } catch {
24375
24410
  }
24376
- 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`);
24377
24412
  const deadline = Date.now() + 4e3;
24378
24413
  let fd = null;
24379
24414
  while (fd === null) {
@@ -24424,7 +24459,7 @@ function isProcessAlive(pid) {
24424
24459
  }
24425
24460
  }
24426
24461
  function mkfifoSync(p) {
24427
- const parent = import_node_path15.default.dirname(p);
24462
+ const parent = import_node_path16.default.dirname(p);
24428
24463
  import_node_fs15.default.mkdirSync(parent, { recursive: true });
24429
24464
  try {
24430
24465
  import_node_fs15.default.chmodSync(parent, 448);
@@ -24482,7 +24517,7 @@ async function startSession(opts) {
24482
24517
  const transcript = transcriptPath(session.id);
24483
24518
  mkfifoSync(promptIn);
24484
24519
  mkfifoSync(eventsOut);
24485
- const transcriptDir = import_node_path15.default.dirname(transcript);
24520
+ const transcriptDir = import_node_path16.default.dirname(transcript);
24486
24521
  import_node_fs15.default.mkdirSync(transcriptDir, { recursive: true });
24487
24522
  try {
24488
24523
  import_node_fs15.default.chmodSync(transcriptDir, 448);
@@ -24665,14 +24700,14 @@ async function waitForFirstEvent(fifo, predicate, timeoutMs) {
24665
24700
  import_node_fs15.default.closeSync(fd);
24666
24701
  }
24667
24702
  }
24668
- 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;
24669
24704
  var init_agent_sessions = __esm({
24670
24705
  "src/agent-sessions.ts"() {
24671
24706
  "use strict";
24672
24707
  import_node_child_process7 = require("node:child_process");
24673
24708
  import_node_crypto8 = require("node:crypto");
24674
24709
  import_node_fs15 = __toESM(require("node:fs"), 1);
24675
- import_node_path15 = __toESM(require("node:path"), 1);
24710
+ import_node_path16 = __toESM(require("node:path"), 1);
24676
24711
  import_node_readline = __toESM(require("node:readline"), 1);
24677
24712
  init_self_invocation();
24678
24713
  init_standalone();
@@ -24703,13 +24738,13 @@ function mapFrameworkToProjectFramework(fw) {
24703
24738
  if (fw === "one" || fw === "vxrn") return "one";
24704
24739
  return "unknown";
24705
24740
  }
24706
- 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;
24707
24742
  var init_agent_host = __esm({
24708
24743
  "src/host/agent-host.ts"() {
24709
24744
  "use strict";
24710
24745
  import_node_crypto9 = require("node:crypto");
24711
24746
  import_node_fs16 = __toESM(require("node:fs"), 1);
24712
- import_node_path16 = __toESM(require("node:path"), 1);
24747
+ import_node_path17 = __toESM(require("node:path"), 1);
24713
24748
  init_dev_server_scanner();
24714
24749
  init_agent_sessions();
24715
24750
  init_attached_projects();
@@ -24955,7 +24990,7 @@ var init_agent_host = __esm({
24955
24990
  );
24956
24991
  const project = upsertProject({
24957
24992
  cwd: match.cwd,
24958
- name: match.projectName ?? import_node_path16.default.basename(match.cwd),
24993
+ name: match.projectName ?? import_node_path17.default.basename(match.cwd),
24959
24994
  preferredProvider: input.provider ?? existing?.preferredProvider,
24960
24995
  sourceRoots: existing?.sourceRoots ?? [match.cwd],
24961
24996
  knownBundleUrls,
@@ -24975,9 +25010,9 @@ var init_agent_host = __esm({
24975
25010
  const dir = getUserDataDir();
24976
25011
  return {
24977
25012
  userDataDir: dir,
24978
- storeFile: import_node_path16.default.join(dir, "attached-projects.json"),
24979
- sessionsDir: import_node_path16.default.join(dir, "sessions"),
24980
- 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")
24981
25016
  };
24982
25017
  }
24983
25018
  // --- subscription management ---
@@ -25837,13 +25872,13 @@ function looksBinary(filePath, size) {
25837
25872
  if (fd !== void 0) import_node_fs17.default.closeSync(fd);
25838
25873
  }
25839
25874
  }
25840
- 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;
25841
25876
  var init_checkout_plane = __esm({
25842
25877
  "cli/commands/box/checkout-plane.ts"() {
25843
25878
  "use strict";
25844
25879
  import_node_child_process8 = require("node:child_process");
25845
25880
  import_node_fs17 = __toESM(require("node:fs"), 1);
25846
- import_node_path17 = __toESM(require("node:path"), 1);
25881
+ import_node_path18 = __toESM(require("node:path"), 1);
25847
25882
  CheckoutRequiresGitError = class extends Error {
25848
25883
  };
25849
25884
  BINARY_SNIFF_BYTES = 8192;
@@ -25860,7 +25895,7 @@ var init_checkout_plane = __esm({
25860
25895
  listTimeoutMs;
25861
25896
  trackedOnly;
25862
25897
  constructor(root, options = {}) {
25863
- this.root = import_node_path17.default.resolve(root);
25898
+ this.root = import_node_path18.default.resolve(root);
25864
25899
  this.listTimeoutMs = options.listTimeoutMs ?? LIST_FILES_TIMEOUT_MS;
25865
25900
  this.trackedOnly = options.trackedOnly ?? false;
25866
25901
  }
@@ -25922,13 +25957,13 @@ var init_checkout_plane = __esm({
25922
25957
  if (!relative2) continue;
25923
25958
  let stat2;
25924
25959
  try {
25925
- 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));
25926
25961
  } catch {
25927
25962
  continue;
25928
25963
  }
25929
25964
  if (!stat2.isFile()) continue;
25930
25965
  const seen = this.sniffed.get(relative2);
25931
- 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);
25932
25967
  nextSniffed.set(relative2, { size: stat2.size, mtimeMs: stat2.mtimeMs, binary });
25933
25968
  next.set(relative2, {
25934
25969
  size: stat2.size,
@@ -25942,8 +25977,8 @@ var init_checkout_plane = __esm({
25942
25977
  this.sniffed = nextSniffed;
25943
25978
  }
25944
25979
  absolute(planePath) {
25945
- const resolved = import_node_path17.default.resolve(this.root, planePath);
25946
- 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}`)) {
25947
25982
  throw new Error(`path escapes the project: ${planePath}`);
25948
25983
  }
25949
25984
  return resolved;
@@ -25956,7 +25991,7 @@ var init_checkout_plane = __esm({
25956
25991
  }
25957
25992
  async write(planePath, content) {
25958
25993
  const absolute = this.absolute(planePath);
25959
- 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 });
25960
25995
  await import_node_fs17.default.promises.writeFile(absolute, content);
25961
25996
  this.entries.set(planePath, {
25962
25997
  size: content.byteLength,
@@ -25974,12 +26009,12 @@ var init_checkout_plane = __esm({
25974
26009
  });
25975
26010
 
25976
26011
  // src/host/plane-host.ts
25977
- var import_node_fs18, import_node_path18, WS_OPEN2, PlaneNotRegisteredError, PlaneHost;
26012
+ var import_node_fs18, import_node_path19, WS_OPEN2, PlaneNotRegisteredError, PlaneHost;
25978
26013
  var init_plane_host = __esm({
25979
26014
  "src/host/plane-host.ts"() {
25980
26015
  "use strict";
25981
26016
  import_node_fs18 = __toESM(require("node:fs"), 1);
25982
- import_node_path18 = __toESM(require("node:path"), 1);
26017
+ import_node_path19 = __toESM(require("node:path"), 1);
25983
26018
  init_plane();
25984
26019
  init_checkout_plane();
25985
26020
  WS_OPEN2 = 1;
@@ -26102,7 +26137,7 @@ var init_plane_host = __esm({
26102
26137
  // root and an opened one cannot disagree about the same directory.
26103
26138
  realRoot(root) {
26104
26139
  if (!root) throw new Error("root is required");
26105
- const resolved = import_node_path18.default.resolve(root);
26140
+ const resolved = import_node_path19.default.resolve(root);
26106
26141
  let real;
26107
26142
  try {
26108
26143
  real = import_node_fs18.default.realpathSync(resolved);
@@ -26462,13 +26497,13 @@ function sendJavaScript(req, res, source) {
26462
26497
  res.end(req.method === "HEAD" ? void 0 : source);
26463
26498
  }
26464
26499
  function resolveLocalImport(fromFile, specifier) {
26465
- 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);
26466
26501
  const candidates = [
26467
26502
  ...REPLACEMENT_MODULE_EXTENSIONS.some(
26468
- (ext) => ext === import_node_path19.default.extname(base).toLowerCase()
26503
+ (ext) => ext === import_node_path20.default.extname(base).toLowerCase()
26469
26504
  ) ? [base] : [],
26470
26505
  ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base + ext),
26471
- ...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}`))
26472
26507
  ];
26473
26508
  const found = candidates.find(
26474
26509
  (candidate) => (0, import_node_fs19.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
@@ -26526,13 +26561,13 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
26526
26561
  res.end("missing path param");
26527
26562
  return true;
26528
26563
  }
26529
- const extension = import_node_path19.default.extname(targetPath).toLowerCase();
26564
+ const extension = import_node_path20.default.extname(targetPath).toLowerCase();
26530
26565
  if (!REPLACEMENT_MODULE_EXTENSIONS.some((allowed) => allowed === extension)) {
26531
26566
  res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
26532
26567
  res.end(`replacement files must be ${REPLACEMENT_MODULE_EXTENSIONS.join(", ")}`);
26533
26568
  return true;
26534
26569
  }
26535
- if (!import_node_path19.default.isAbsolute(targetPath)) {
26570
+ if (!import_node_path20.default.isAbsolute(targetPath)) {
26536
26571
  res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
26537
26572
  res.end("replacement file path must be absolute");
26538
26573
  return true;
@@ -26540,10 +26575,10 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
26540
26575
  const runtimePackages = new Set(url.searchParams.getAll("runtimePackage"));
26541
26576
  let resolvedProjectRoot;
26542
26577
  if (options.projectRoot) {
26543
- const lexicalProjectRoot = import_node_path19.default.resolve(options.projectRoot);
26578
+ const lexicalProjectRoot = import_node_path20.default.resolve(options.projectRoot);
26544
26579
  resolvedProjectRoot = await import_promises5.default.realpath(options.projectRoot);
26545
- const lexicalTarget = import_node_path19.default.relative(lexicalProjectRoot, targetPath);
26546
- 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)) {
26547
26582
  res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
26548
26583
  res.end("replacement file must be inside the project root");
26549
26584
  return true;
@@ -26559,8 +26594,8 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
26559
26594
  return true;
26560
26595
  }
26561
26596
  if (resolvedProjectRoot) {
26562
- const relativeTarget = import_node_path19.default.relative(resolvedProjectRoot, resolvedTargetPath);
26563
- 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)) {
26564
26599
  res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
26565
26600
  res.end("replacement file must be inside the project root");
26566
26601
  return true;
@@ -26594,13 +26629,13 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
26594
26629
  }
26595
26630
  return true;
26596
26631
  }
26597
- 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;
26598
26633
  var init_replacement_module_handler = __esm({
26599
26634
  "src/host/replacement-module-handler.ts"() {
26600
26635
  "use strict";
26601
26636
  import_node_fs19 = require("node:fs");
26602
26637
  import_promises5 = __toESM(require("node:fs/promises"), 1);
26603
- import_node_path19 = __toESM(require("node:path"), 1);
26638
+ import_node_path20 = __toESM(require("node:path"), 1);
26604
26639
  init_replacementModule();
26605
26640
  init_backend_origin();
26606
26641
  REPLACEMENT_MODULE_ROUTE = "/__sootsim-replacement-module";
@@ -28534,8 +28569,8 @@ function metroIosAssetDestRelatives(httpServerLocation, filename) {
28534
28569
  }
28535
28570
  const out = [];
28536
28571
  for (const dir of dirs) {
28537
- const path28 = `${dir}/${filename}`;
28538
- if (!out.includes(path28)) out.push(path28);
28572
+ const path29 = `${dir}/${filename}`;
28573
+ if (!out.includes(path29)) out.push(path29);
28539
28574
  }
28540
28575
  if (!out.includes(filename)) out.push(filename);
28541
28576
  return out;
@@ -29487,13 +29522,13 @@ function readFactoryStringLiterals(factory) {
29487
29522
  return literals;
29488
29523
  }
29489
29524
  function normalizeFingerprintLiteral(literal) {
29490
- const path28 = literal.replaceAll("\\\\", "/").replaceAll("\\/", "/");
29525
+ const path29 = literal.replaceAll("\\\\", "/").replaceAll("\\/", "/");
29491
29526
  const nodeModulesMarker = "/node_modules/";
29492
- const nodeModulesIndex = path28.lastIndexOf(nodeModulesMarker);
29527
+ const nodeModulesIndex = path29.lastIndexOf(nodeModulesMarker);
29493
29528
  if (nodeModulesIndex >= 0) {
29494
- return `node_modules/${path28.slice(nodeModulesIndex + nodeModulesMarker.length)}`;
29529
+ return `node_modules/${path29.slice(nodeModulesIndex + nodeModulesMarker.length)}`;
29495
29530
  }
29496
- 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)) {
29497
29532
  return null;
29498
29533
  }
29499
29534
  return literal;
@@ -29731,10 +29766,10 @@ function templateAssignment(template, embeddings) {
29731
29766
  if (existingNode !== void 0 && existingNode !== nodeIndex) return null;
29732
29767
  nodesByModuleId.set(moduleId, nodeIndex);
29733
29768
  const node = template.nodes[nodeIndex];
29734
- 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`;
29735
29770
  const existingPath = pathsByModuleId.get(moduleId);
29736
- if (existingPath !== void 0 && existingPath !== path28) return null;
29737
- pathsByModuleId.set(moduleId, path28);
29771
+ if (existingPath !== void 0 && existingPath !== path29) return null;
29772
+ pathsByModuleId.set(moduleId, path29);
29738
29773
  }
29739
29774
  }
29740
29775
  return {
@@ -29896,14 +29931,14 @@ async function inferMetroModuleIdentity(args) {
29896
29931
  const packageClaims = claimsByPackage.values().next().value;
29897
29932
  if (!packageClaims) continue;
29898
29933
  const exactClaims = packageClaims.filter((assignment2) => {
29899
- const path28 = assignment2.pathsByModuleId.get(moduleId);
29900
- return path28 !== void 0 && !path28.includes("/__rnx_inferred__/");
29934
+ const path29 = assignment2.pathsByModuleId.get(moduleId);
29935
+ return path29 !== void 0 && !path29.includes("/__rnx_inferred__/");
29901
29936
  });
29902
29937
  const preferredClaims = exactClaims.length > 0 ? exactClaims : packageClaims;
29903
29938
  const routes = new Set(
29904
29939
  preferredClaims.flatMap((assignment2) => {
29905
- const path28 = assignment2.pathsByModuleId.get(moduleId);
29906
- return path28 ? [metroFingerprintModuleClaimRoute(assignment2.packageName, path28)] : [];
29940
+ const path29 = assignment2.pathsByModuleId.get(moduleId);
29941
+ return path29 ? [metroFingerprintModuleClaimRoute(assignment2.packageName, path29)] : [];
29907
29942
  })
29908
29943
  );
29909
29944
  if (routes.size !== 1) continue;
@@ -30197,7 +30232,7 @@ function detectFramework2(deps) {
30197
30232
  return "unknown";
30198
30233
  }
30199
30234
  function detectProject(dir) {
30200
- const pkgPath = (0, import_node_path20.join)(dir, "package.json");
30235
+ const pkgPath = (0, import_node_path21.join)(dir, "package.json");
30201
30236
  if (!(0, import_node_fs20.existsSync)(pkgPath)) return null;
30202
30237
  const pkg = readProjectManifest(dir);
30203
30238
  if (!pkg) return null;
@@ -30210,25 +30245,25 @@ function detectProject(dir) {
30210
30245
  if (framework === "unknown") return null;
30211
30246
  return {
30212
30247
  dir,
30213
- name: pkg.name || (0, import_node_path20.basename)(dir),
30248
+ name: pkg.name || (0, import_node_path21.basename)(dir),
30214
30249
  framework,
30215
30250
  // a config file is a config file whatever module system it declares. real
30216
30251
  // apps write .cjs as often as .js, and missing one reads as "this project
30217
30252
  // has no bundler config" and sends the user to create a second one.
30218
30253
  hasViteConfig: CONFIG_EXTENSIONS.some(
30219
- (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}`))
30220
30255
  ),
30221
30256
  hasMetroConfig: CONFIG_EXTENSIONS.some(
30222
- (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}`))
30223
30258
  ),
30224
30259
  devCommand: typeof devCommand === "string" ? devCommand : null
30225
30260
  };
30226
30261
  }
30227
- function readProjectMetadata(path28) {
30262
+ function readProjectMetadata(path29) {
30228
30263
  try {
30229
- const info = (0, import_node_fs20.lstatSync)(path28);
30264
+ const info = (0, import_node_fs20.lstatSync)(path29);
30230
30265
  if (!info.isFile() || info.size > 4 * 1024 * 1024) return null;
30231
- return (0, import_node_fs20.readFileSync)(path28, "utf8");
30266
+ return (0, import_node_fs20.readFileSync)(path29, "utf8");
30232
30267
  } catch {
30233
30268
  return null;
30234
30269
  }
@@ -30237,8 +30272,8 @@ function metadataValue(value, key) {
30237
30272
  if (!value || typeof value !== "object") return void 0;
30238
30273
  return Object.getOwnPropertyDescriptor(value, key)?.value;
30239
30274
  }
30240
- function readProjectJson(path28) {
30241
- const text = readProjectMetadata(path28);
30275
+ function readProjectJson(path29) {
30276
+ const text = readProjectMetadata(path29);
30242
30277
  if (text === null) return null;
30243
30278
  try {
30244
30279
  const value = JSON.parse(text);
@@ -30248,7 +30283,7 @@ function readProjectJson(path28) {
30248
30283
  }
30249
30284
  }
30250
30285
  function readProjectManifest(dir) {
30251
- const parsed = readProjectJson((0, import_node_path20.join)(dir, "package.json"));
30286
+ const parsed = readProjectJson((0, import_node_path21.join)(dir, "package.json"));
30252
30287
  if (!parsed || typeof parsed !== "object") return null;
30253
30288
  const record = (value) => {
30254
30289
  if (!value || typeof value !== "object") return {};
@@ -30265,12 +30300,12 @@ function readProjectManifest(dir) {
30265
30300
  devDependencies: record(metadataValue(parsed, "devDependencies"))
30266
30301
  };
30267
30302
  }
30268
- 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;
30269
30304
  var init_detect = __esm({
30270
30305
  "cli/commands/detect.ts"() {
30271
30306
  "use strict";
30272
30307
  import_node_fs20 = require("node:fs");
30273
- import_node_path20 = require("node:path");
30308
+ import_node_path21 = require("node:path");
30274
30309
  import_json5 = __toESM(require("json5"), 1);
30275
30310
  import_yaml = require("yaml");
30276
30311
  CONFIG_EXTENSIONS = ["ts", "js", "cjs", "mjs", "mts", "cts"];
@@ -30307,8 +30342,8 @@ function resolveCloudOrigin(value) {
30307
30342
  return normalizeCloudOrigin(source);
30308
30343
  }
30309
30344
  function readImmutableBundleSource(bundlePath) {
30310
- const filepath = (0, import_node_path21.resolve)(bundlePath);
30311
- 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") {
30312
30347
  throw new Error(`${REMOTE_COMMAND} requires one local Metro .js bundle`);
30313
30348
  }
30314
30349
  const descriptor = (0, import_node_fs21.openSync)(filepath, "r");
@@ -30383,9 +30418,9 @@ async function loadBundleSource(bundleInput) {
30383
30418
  return readImmutableBundleSource(bundleInput);
30384
30419
  }
30385
30420
  function listMetroAssetDest(assetsPath) {
30386
- const directory = (0, import_node_path21.resolve)(assetsPath);
30421
+ const directory = (0, import_node_path22.resolve)(assetsPath);
30387
30422
  if (!(0, import_node_fs21.existsSync)(directory)) return { directory, files: [], truncated: false };
30388
- 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"));
30389
30424
  const files = [];
30390
30425
  let truncated = false;
30391
30426
  const walk = (dir, prefix) => {
@@ -30403,7 +30438,7 @@ function listMetroAssetDest(assetsPath) {
30403
30438
  if (entry.isDirectory()) {
30404
30439
  if (entry.name === ".git") continue;
30405
30440
  if (skipNested && PROJECT_ONLY_DIRECTORIES.has(entry.name)) continue;
30406
- 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);
30407
30442
  } else if (entry.isFile()) {
30408
30443
  files.push(prefix ? `${prefix}/${entry.name}` : entry.name);
30409
30444
  }
@@ -30438,7 +30473,7 @@ function distinctByContent(directory, options) {
30438
30473
  for (const relative2 of options) {
30439
30474
  let bytes;
30440
30475
  try {
30441
- 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));
30442
30477
  } catch {
30443
30478
  continue;
30444
30479
  }
@@ -30470,7 +30505,7 @@ function placeMetroDescriptor(listing, descriptor) {
30470
30505
  let bytes;
30471
30506
  try {
30472
30507
  bytes = combination.map(
30473
- (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))
30474
30509
  );
30475
30510
  } catch {
30476
30511
  continue;
@@ -30496,26 +30531,26 @@ function placeMetroDescriptor(listing, descriptor) {
30496
30531
  }
30497
30532
  function unverifiedFileKey(dest) {
30498
30533
  return dest.placements.filter((placement) => !placement.verified).flatMap(
30499
- (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))
30500
30535
  ).sort().join("\n");
30501
30536
  }
30502
30537
  function searchMetroAssetDest(bundlePath, descriptors) {
30503
- 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));
30504
30539
  const candidates = [
30505
- (0, import_node_path21.join)(bundleDirectory, "assets"),
30540
+ (0, import_node_path22.join)(bundleDirectory, "assets"),
30506
30541
  bundleDirectory,
30507
- (0, import_node_path21.resolve)(bundleDirectory, "..", "assets")
30542
+ (0, import_node_path22.resolve)(bundleDirectory, "..", "assets")
30508
30543
  ];
30509
30544
  const cwd = process.cwd();
30510
30545
  let projectDirectory = null;
30511
30546
  for (const start of [bundleDirectory, cwd]) {
30512
- let directory = (0, import_node_path21.resolve)(start);
30547
+ let directory = (0, import_node_path22.resolve)(start);
30513
30548
  while (true) {
30514
30549
  if (detectProject(directory)?.hasMetroConfig) {
30515
30550
  projectDirectory = directory;
30516
30551
  break;
30517
30552
  }
30518
- const parent = (0, import_node_path21.dirname)(directory);
30553
+ const parent = (0, import_node_path22.dirname)(directory);
30519
30554
  if (parent === directory) break;
30520
30555
  directory = parent;
30521
30556
  }
@@ -30523,11 +30558,11 @@ function searchMetroAssetDest(bundlePath, descriptors) {
30523
30558
  }
30524
30559
  if (projectDirectory) {
30525
30560
  candidates.push(
30526
- (0, import_node_path21.join)(projectDirectory, "assets"),
30527
- (0, import_node_path21.join)(projectDirectory, "dist"),
30528
- (0, import_node_path21.join)(projectDirectory, "dist", "assets"),
30529
- (0, import_node_path21.join)(projectDirectory, "build"),
30530
- (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")
30531
30566
  );
30532
30567
  }
30533
30568
  const searched = [];
@@ -30535,7 +30570,7 @@ function searchMetroAssetDest(bundlePath, descriptors) {
30535
30570
  const stale = [];
30536
30571
  let truncated = false;
30537
30572
  for (const candidate of candidates) {
30538
- const directory = (0, import_node_path21.resolve)(candidate);
30573
+ const directory = (0, import_node_path22.resolve)(candidate);
30539
30574
  if (searched.includes(directory)) continue;
30540
30575
  searched.push(directory);
30541
30576
  const listing = listMetroAssetDest(directory);
@@ -30641,7 +30676,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy) {
30641
30676
  );
30642
30677
  }
30643
30678
  const relative2 = placement?.files.get(variant.scale);
30644
- 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));
30645
30680
  if (placement && placement.files.size > 0) return null;
30646
30681
  if (placement && placement.ambiguous.length > 0 && dest) {
30647
30682
  throw new Error(
@@ -30670,7 +30705,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy) {
30670
30705
  );
30671
30706
  const classic = metroIosAssetDestRelatives(variant.descriptor.httpServerLocation, filename)[0] ?? filename;
30672
30707
  throw new Error(
30673
- `${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\`.`
30674
30709
  );
30675
30710
  });
30676
30711
  return {
@@ -30856,13 +30891,13 @@ function createCloudBridgeForParsed(parsed) {
30856
30891
  if (!session) return null;
30857
30892
  return session.service === "box" ? new CloudBoxBridge(session) : new CloudBridge(session);
30858
30893
  }
30859
- 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;
30860
30895
  var init_cloud_client = __esm({
30861
30896
  "cli/cloud-client.ts"() {
30862
30897
  "use strict";
30863
30898
  import_node_crypto10 = require("node:crypto");
30864
30899
  import_node_fs21 = require("node:fs");
30865
- import_node_path21 = require("node:path");
30900
+ import_node_path22 = require("node:path");
30866
30901
  init_metroAssetArtifact();
30867
30902
  init_metroCloudArtifact();
30868
30903
  init_metro_fingerprint_registry_client();
@@ -33272,7 +33307,7 @@ var init_parent_pid = __esm({
33272
33307
 
33273
33308
  // cli/secure-file.ts
33274
33309
  function writeSecureJsonAtomic(filepath, value) {
33275
- (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 });
33276
33311
  const temporary = `${filepath}.tmp-${process.pid}-${(0, import_node_crypto11.randomUUID)()}`;
33277
33312
  let descriptor = null;
33278
33313
  try {
@@ -33290,13 +33325,13 @@ function writeSecureJsonAtomic(filepath, value) {
33290
33325
  throw error;
33291
33326
  }
33292
33327
  }
33293
- var import_node_crypto11, import_node_fs22, import_node_path22;
33328
+ var import_node_crypto11, import_node_fs22, import_node_path23;
33294
33329
  var init_secure_file = __esm({
33295
33330
  "cli/secure-file.ts"() {
33296
33331
  "use strict";
33297
33332
  import_node_crypto11 = require("node:crypto");
33298
33333
  import_node_fs22 = require("node:fs");
33299
- import_node_path22 = require("node:path");
33334
+ import_node_path23 = require("node:path");
33300
33335
  }
33301
33336
  });
33302
33337
 
@@ -33475,17 +33510,17 @@ function liveDevBridgeLockfiles() {
33475
33510
  return readDevBridgeLockfiles().filter((lockfile) => isDevBridgeLockfileFresh(lockfile));
33476
33511
  }
33477
33512
  function checkoutRoot(cwd) {
33478
- let current = import_node_path23.default.resolve(cwd);
33513
+ let current = import_node_path24.default.resolve(cwd);
33479
33514
  while (true) {
33480
- if (import_node_fs23.default.existsSync(import_node_path23.default.join(current, ".git"))) return current;
33481
- 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);
33482
33517
  if (parent === current) return null;
33483
33518
  current = parent;
33484
33519
  }
33485
33520
  }
33486
33521
  function pathContains(parent, child) {
33487
- const relative2 = import_node_path23.default.relative(parent, child);
33488
- 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);
33489
33524
  }
33490
33525
  function resolveDefaultDevBridgeLockfile() {
33491
33526
  const lockfiles = liveDevBridgeLockfiles();
@@ -33981,18 +34016,18 @@ async function evalInBridge(bridge, code, opts = {}) {
33981
34016
  if (opts.acquireLock) payload.acquireLock = true;
33982
34017
  return bridge.send(payload);
33983
34018
  }
33984
- async function callInBridge(bridge, path28, ...args) {
33985
- return bridge.send({ type: "call", path: path28, args });
34019
+ async function callInBridge(bridge, path29, ...args) {
34020
+ return bridge.send({ type: "call", path: path29, args });
33986
34021
  }
33987
- async function callInBridgeWrite(bridge, path28, ...args) {
33988
- 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 });
33989
34024
  }
33990
- 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;
33991
34026
  var init_ws_bridge = __esm({
33992
34027
  "cli/ws-bridge.ts"() {
33993
34028
  "use strict";
33994
34029
  import_node_fs23 = __toESM(require("node:fs"), 1);
33995
- import_node_path23 = __toESM(require("node:path"), 1);
34030
+ import_node_path24 = __toESM(require("node:path"), 1);
33996
34031
  import_ws2 = require("ws");
33997
34032
  init_bridge_constants();
33998
34033
  init_cli_constants();
@@ -34120,8 +34155,8 @@ function getDefaultPortForProtocol(protocol) {
34120
34155
  return protocol === "https:" ? 443 : 80;
34121
34156
  }
34122
34157
  function isBaseServerUrl(url) {
34123
- const path28 = url.pathname || "/";
34124
- return (path28 === "/" || path28 === "") && !url.search && !url.hash;
34158
+ const path29 = url.pathname || "/";
34159
+ return (path29 === "/" || path29 === "") && !url.search && !url.hash;
34125
34160
  }
34126
34161
  async function resolvePortViaServerScan(port) {
34127
34162
  try {
@@ -34349,14 +34384,14 @@ function readProjectDotEnv(envsRoot, env = process.env) {
34349
34384
  const notices = [];
34350
34385
  const selection = selectEnvFile(env, notices);
34351
34386
  const requestedPaths = [
34352
- import_node_path24.default.resolve(import_node_path24.default.join(envsRoot, selection.name)),
34353
- 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)
34354
34389
  ];
34355
34390
  const candidates = [
34356
34391
  ...requestedPaths,
34357
- 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))
34358
34393
  ];
34359
- 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));
34360
34395
  const tried = [...new Set(candidates)];
34361
34396
  const resolved = tried.find((candidate) => import_node_fs24.default.existsSync(candidate));
34362
34397
  if (!resolved) {
@@ -34388,12 +34423,12 @@ function readProjectDotEnv(envsRoot, env = process.env) {
34388
34423
  }
34389
34424
  return { config, notices };
34390
34425
  }
34391
- 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;
34392
34427
  var init_dot_env = __esm({
34393
34428
  "src/dot-env.ts"() {
34394
34429
  "use strict";
34395
34430
  import_node_fs24 = __toESM(require("node:fs"), 1);
34396
- import_node_path24 = __toESM(require("node:path"), 1);
34431
+ import_node_path25 = __toESM(require("node:path"), 1);
34397
34432
  DEFAULT_ENV_FILE = ".env";
34398
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;
34399
34434
  BUILD_SETTING_PATTERN = /\$[({]([A-Za-z_][A-Za-z0-9_]*)[)}]|\$([A-Za-z_][A-Za-z0-9_]*)/g;
@@ -34417,7 +34452,7 @@ var init_flow_timeout_scale = __esm({
34417
34452
  function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34418
34453
  const result = {};
34419
34454
  let config = {};
34420
- const appJsonPath = import_node_path25.default.join(projectRoot, "app.json");
34455
+ const appJsonPath = import_node_path26.default.join(projectRoot, "app.json");
34421
34456
  const appJson = import_node_fs25.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs25.default.readFileSync(appJsonPath, "utf8")) : null;
34422
34457
  const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
34423
34458
  (value) => isRecord(value) && typeof value.googleServicesFile === "string"
@@ -34427,9 +34462,9 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34427
34462
  "app.config.ts",
34428
34463
  "app.config.cjs",
34429
34464
  "app.config.mjs"
34430
- ].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)));
34431
34466
  if (staticExpo || dynamicExpo) {
34432
- 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"));
34433
34468
  const configModule = require5("@expo/config");
34434
34469
  if (!isRecord(configModule) || typeof configModule.getConfig !== "function")
34435
34470
  throw new Error("Expo native configuration is unavailable.");
@@ -34441,18 +34476,18 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34441
34476
  }
34442
34477
  const ios = config.ios;
34443
34478
  if (platforms.includes("ios") && (!isRecord(ios) || typeof ios.googleServicesFile !== "string")) {
34444
- const iosRoot = import_node_path25.default.join(projectRoot, "ios");
34479
+ const iosRoot = import_node_path26.default.join(projectRoot, "ios");
34445
34480
  if (import_node_fs25.default.existsSync(iosRoot)) {
34446
34481
  const projects2 = import_node_fs25.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
34447
34482
  if (projects2.length > 1)
34448
34483
  throw new Error("native Firebase configuration requires a selected Xcode project");
34449
34484
  if (projects2.length === 1) {
34450
- 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"));
34451
34486
  const xcode = require5("xcode");
34452
34487
  if (!isRecord(xcode) || typeof xcode.project !== "function")
34453
34488
  throw new Error("native Xcode project parser is unavailable");
34454
34489
  const project = Reflect.apply(xcode.project, xcode, [
34455
- import_node_path25.default.join(iosRoot, projects2[0].name, "project.pbxproj")
34490
+ import_node_path26.default.join(iosRoot, projects2[0].name, "project.pbxproj")
34456
34491
  ]);
34457
34492
  if (!isRecord(project) || typeof project.parseSync !== "function")
34458
34493
  throw new Error("native Xcode project is malformed");
@@ -34492,7 +34527,7 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34492
34527
  const sourceTree = unquote(group.sourceTree);
34493
34528
  if (sourceTree && sourceTree !== "<group>" && sourceTree !== "SOURCE_ROOT")
34494
34529
  continue;
34495
- const directory = import_node_path25.default.resolve(
34530
+ const directory = import_node_path26.default.resolve(
34496
34531
  sourceTree === "SOURCE_ROOT" ? iosRoot : item.base,
34497
34532
  unquote(group.path)
34498
34533
  );
@@ -34506,7 +34541,7 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34506
34541
  if (!isRecord(file)) continue;
34507
34542
  const tree = unquote(file.sourceTree);
34508
34543
  if (tree !== "<group>" && tree !== "SOURCE_ROOT") continue;
34509
- const filePath = import_node_path25.default.resolve(
34544
+ const filePath = import_node_path26.default.resolve(
34510
34545
  tree === "SOURCE_ROOT" ? iosRoot : directory,
34511
34546
  unquote(file.path)
34512
34547
  );
@@ -34528,7 +34563,7 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34528
34563
  const file = buildFiles[entry.value];
34529
34564
  if (!isRecord(file) || typeof file.fileRef !== "string") continue;
34530
34565
  const reference = references[file.fileRef];
34531
- 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))))
34532
34567
  continue;
34533
34568
  const candidates = filePaths.get(file.fileRef);
34534
34569
  if (!candidates || candidates.size !== 1)
@@ -34578,7 +34613,7 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34578
34613
  throw new Error(
34579
34614
  "native Firebase default initialization requires one GoogleService-Info.plist build resource"
34580
34615
  );
34581
- config.ios = { googleServicesFile: import_node_path25.default.relative(projectRoot, resources[0]) };
34616
+ config.ios = { googleServicesFile: import_node_path26.default.relative(projectRoot, resources[0]) };
34582
34617
  }
34583
34618
  }
34584
34619
  }
@@ -34589,7 +34624,7 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34589
34624
  if (!isRecord(native) || typeof native.googleServicesFile !== "string") continue;
34590
34625
  try {
34591
34626
  const source = import_node_fs25.default.readFileSync(
34592
- import_node_path25.default.resolve(projectRoot, native.googleServicesFile),
34627
+ import_node_path26.default.resolve(projectRoot, native.googleServicesFile),
34593
34628
  "utf8"
34594
34629
  );
34595
34630
  const parsed = platform === "ios" ? parsePlistSource(source) : JSON.parse(source);
@@ -34641,13 +34676,13 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
34641
34676
  }
34642
34677
  return result;
34643
34678
  }
34644
- var import_node_fs25, import_node_module2, import_node_path25;
34679
+ var import_node_fs25, import_node_module2, import_node_path26;
34645
34680
  var init_native_firebase_config = __esm({
34646
34681
  "src/native-firebase-config.ts"() {
34647
34682
  "use strict";
34648
34683
  import_node_fs25 = __toESM(require("node:fs"), 1);
34649
34684
  import_node_module2 = require("node:module");
34650
- import_node_path25 = __toESM(require("node:path"), 1);
34685
+ import_node_path26 = __toESM(require("node:path"), 1);
34651
34686
  init_is_record();
34652
34687
  init_plist();
34653
34688
  }
@@ -34774,45 +34809,45 @@ function readText(file) {
34774
34809
  }
34775
34810
  function catalogFiles(dir, found) {
34776
34811
  for (const entry of listDir(dir)) {
34777
- const full = import_node_path26.default.join(dir, entry.name);
34812
+ const full = import_node_path27.default.join(dir, entry.name);
34778
34813
  if (entry.isDirectory()) catalogFiles(full, found);
34779
34814
  else if (entry.name === "Contents.json") found.push(full);
34780
34815
  }
34781
34816
  }
34782
34817
  function discoverAppCatalog(appDir) {
34783
- const iosDir = import_node_path26.default.join(appDir, "ios");
34818
+ const iosDir = import_node_path27.default.join(appDir, "ios");
34784
34819
  const target = listDir(iosDir).find(
34785
- (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(
34786
34821
  (file) => /^AppDelegate\.(swift|mm|m)$/.test(file.name)
34787
34822
  )
34788
34823
  );
34789
34824
  if (!target) return null;
34790
- const targetDir = import_node_path26.default.join(iosDir, target.name);
34825
+ const targetDir = import_node_path27.default.join(iosDir, target.name);
34791
34826
  const files = [];
34792
34827
  for (const entry of listDir(targetDir)) {
34793
34828
  if (entry.isDirectory() && entry.name.endsWith(".xcassets"))
34794
- catalogFiles(import_node_path26.default.join(targetDir, entry.name), files);
34829
+ catalogFiles(import_node_path27.default.join(targetDir, entry.name), files);
34795
34830
  }
34796
34831
  const relative2 = files.map(
34797
- (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)
34798
34833
  );
34799
34834
  const colors = enumerateBundleColors(
34800
34835
  relative2,
34801
- (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
34802
34837
  );
34803
34838
  const pbxproj = listDir(iosDir).find((entry) => entry.name.endsWith(".xcodeproj"));
34804
- 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(
34805
34840
  ACCENT_BUILD_SETTING
34806
34841
  )?.[1] : void 0) ?? null;
34807
34842
  if (accentName === null && Object.keys(colors).length === 0) return null;
34808
34843
  return { colors, accentName };
34809
34844
  }
34810
- 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;
34811
34846
  var init_app_catalog = __esm({
34812
34847
  "cli/app-catalog.ts"() {
34813
34848
  "use strict";
34814
34849
  import_node_fs26 = __toESM(require("node:fs"), 1);
34815
- import_node_path26 = __toESM(require("node:path"), 1);
34850
+ import_node_path27 = __toESM(require("node:path"), 1);
34816
34851
  init_bundleAssets();
34817
34852
  ACCENT_BUILD_SETTING = /ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "?([^";]+)"?;/;
34818
34853
  PLIST_ACCENT = /<key>NSAccentColorName<\/key>\s*<string>([^<]+)<\/string>/;
@@ -34822,7 +34857,7 @@ var init_app_catalog = __esm({
34822
34857
  // cli/app-project.ts
34823
34858
  function firstNamedFile(dir, names) {
34824
34859
  for (const name2 of names) {
34825
- const candidate = import_node_path27.default.join(dir, name2);
34860
+ const candidate = import_node_path28.default.join(dir, name2);
34826
34861
  try {
34827
34862
  if (import_node_fs27.default.statSync(candidate).isFile()) return candidate;
34828
34863
  } catch {
@@ -34837,24 +34872,24 @@ function findRNXAppConfig(dir) {
34837
34872
  return firstNamedFile(dir, PEACH_APP_CONFIG_NAMES);
34838
34873
  }
34839
34874
  function resolveAppProject(projectRoot) {
34840
- const appDir = import_node_path27.default.resolve(projectRoot);
34875
+ const appDir = import_node_path28.default.resolve(projectRoot);
34841
34876
  try {
34842
34877
  if (!import_node_fs27.default.statSync(appDir).isDirectory()) return null;
34843
34878
  } catch {
34844
34879
  return null;
34845
34880
  }
34846
34881
  const configPath = findRNXAppConfig(appDir);
34847
- 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"))) {
34848
34883
  return null;
34849
34884
  }
34850
34885
  return { appDir, configPath };
34851
34886
  }
34852
- 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;
34853
34888
  var init_app_project = __esm({
34854
34889
  "cli/app-project.ts"() {
34855
34890
  "use strict";
34856
34891
  import_node_fs27 = __toESM(require("node:fs"), 1);
34857
- import_node_path27 = __toESM(require("node:path"), 1);
34892
+ import_node_path28 = __toESM(require("node:path"), 1);
34858
34893
  EXPO_APP_CONFIG_NAMES = [
34859
34894
  "app.config.js",
34860
34895
  "app.config.ts",
@@ -34886,12 +34921,12 @@ function resolveFileEntries(entries, configDir) {
34886
34921
  return Object.fromEntries(
34887
34922
  Object.entries(entries).map(([name2, resolution]) => [
34888
34923
  name2,
34889
- 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
34890
34925
  ])
34891
34926
  );
34892
34927
  }
34893
34928
  function resolveConfigReplacementFiles(config, configPath) {
34894
- const configDir = import_node_path28.default.dirname(configPath);
34929
+ const configDir = import_node_path29.default.dirname(configPath);
34895
34930
  return {
34896
34931
  ...config,
34897
34932
  modules: resolveFileEntries(config.modules, configDir),
@@ -34925,12 +34960,12 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
34925
34960
  const project = resolveAppProject(startDir);
34926
34961
  return { project, config: await loadRNXAppConfig(project) };
34927
34962
  }
34928
- var import_node_module3, import_node_path28, import_jiti, require2;
34963
+ var import_node_module3, import_node_path29, import_jiti, require2;
34929
34964
  var init_app_config = __esm({
34930
34965
  "cli/app-config.ts"() {
34931
34966
  "use strict";
34932
34967
  import_node_module3 = require("node:module");
34933
- import_node_path28 = __toESM(require("node:path"), 1);
34968
+ import_node_path29 = __toESM(require("node:path"), 1);
34934
34969
  init_src();
34935
34970
  import_jiti = require("jiti");
34936
34971
  init_public_brand();
@@ -34993,7 +35028,7 @@ function discoverNativeLinkedAppFonts(opts) {
34993
35028
  }
34994
35029
  for (const entry of entries) {
34995
35030
  if (entry.isSymbolicLink()) continue;
34996
- const fullPath = import_node_path29.default.join(current.dir, entry.name);
35031
+ const fullPath = import_node_path30.default.join(current.dir, entry.name);
34997
35032
  if (entry.isDirectory()) {
34998
35033
  if (current.depth < 4 && pending.length < 64 && !entry.name.startsWith(".")) {
34999
35034
  pending.push({ dir: fullPath, depth: current.depth + 1 });
@@ -35001,15 +35036,15 @@ function discoverNativeLinkedAppFonts(opts) {
35001
35036
  continue;
35002
35037
  }
35003
35038
  if (!entry.isFile() || !/\.(ttf|otf|woff|woff2)$/i.test(entry.name)) continue;
35004
- const relative2 = import_node_path29.default.relative(root, fullPath).split(import_node_path29.default.sep).join("/");
35005
- 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));
35006
35041
  if (fontPaths.length >= 256) break;
35007
35042
  }
35008
35043
  }
35009
35044
  };
35010
35045
  try {
35011
35046
  const packageJson = JSON.parse(
35012
- 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")
35013
35048
  );
35014
35049
  const dependencyNames = /* @__PURE__ */ new Set();
35015
35050
  for (const field of ["dependencies", "devDependencies", "optionalDependencies"]) {
@@ -35024,32 +35059,32 @@ function discoverNativeLinkedAppFonts(opts) {
35024
35059
  const config = Reflect.get(packageJson, "reactNativeVectorIcons");
35025
35060
  const configuredFontDir = config && typeof config === "object" ? Reflect.get(config, "fontDir") : null;
35026
35061
  const configuredDir = typeof configuredFontDir === "string" ? configuredFontDir : "rnvi-fonts";
35027
- const root = import_node_path29.default.resolve(selectedAppDir, configuredDir);
35028
- const relativeRoot = import_node_path29.default.relative(selectedAppDir, root);
35029
- if (!relativeRoot.startsWith("..") && !import_node_path29.default.isAbsolute(relativeRoot)) {
35030
- 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("/"));
35031
35066
  }
35032
- const bundleDir = import_node_path29.default.posix.dirname(new URL(opts.bundleUrl).pathname).replace(/^\/+/, "");
35033
- 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);
35034
35069
  const metroRootCandidates = [selectedAppDir];
35035
- if (bundleDir && selectedAppDir.endsWith(import_node_path29.default.sep + appRelativeDir)) {
35070
+ if (bundleDir && selectedAppDir.endsWith(import_node_path30.default.sep + appRelativeDir)) {
35036
35071
  metroRootCandidates.push(selectedAppDir.slice(0, -appRelativeDir.length - 1));
35037
35072
  }
35038
- 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"));
35039
35074
  for (const dependencyName of vectorIconDependencies) {
35040
35075
  try {
35041
35076
  const entryPath = vectorIconRequire.resolve(dependencyName);
35042
- const dependencyPath = dependencyName.split("/").join(import_node_path29.default.sep);
35043
- 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}`;
35044
35079
  const markerIndex = entryPath.lastIndexOf(marker);
35045
35080
  if (markerIndex === -1) continue;
35046
35081
  const packageRoot = entryPath.slice(0, markerIndex + marker.length - 1);
35047
35082
  const fontsDir = dependencyName === "react-native-vector-icons" ? "Fonts" : "fonts";
35048
- const fontsRoot = import_node_path29.default.join(packageRoot, fontsDir);
35083
+ const fontsRoot = import_node_path30.default.join(packageRoot, fontsDir);
35049
35084
  for (const metroRoot of metroRootCandidates) {
35050
35085
  collectFontFiles(
35051
35086
  fontsRoot,
35052
- 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("/")
35053
35088
  );
35054
35089
  }
35055
35090
  } catch {
@@ -35059,32 +35094,32 @@ function discoverNativeLinkedAppFonts(opts) {
35059
35094
  } catch {
35060
35095
  }
35061
35096
  try {
35062
- 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");
35063
35098
  if (import_node_fs28.default.statSync(configPath).isFile()) {
35064
- 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"));
35065
35100
  const rnConfig = appConfigRequire(configPath);
35066
35101
  const assets2 = rnConfig && typeof rnConfig === "object" ? Reflect.get(rnConfig, "assets") : null;
35067
35102
  if (Array.isArray(assets2)) {
35068
35103
  for (const assetDir of assets2) {
35069
35104
  if (typeof assetDir !== "string") continue;
35070
- const root = import_node_path29.default.resolve(selectedAppDir, assetDir);
35071
- const relativeRoot = import_node_path29.default.relative(selectedAppDir, root);
35072
- if (relativeRoot.startsWith("..") || import_node_path29.default.isAbsolute(relativeRoot)) continue;
35073
- 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("/"));
35074
35109
  }
35075
35110
  }
35076
35111
  }
35077
35112
  } catch {
35078
35113
  }
35079
35114
  if (platform === "ios") {
35080
- const iosDir = import_node_path29.default.join(selectedAppDir, "ios");
35115
+ const iosDir = import_node_path30.default.join(selectedAppDir, "ios");
35081
35116
  try {
35082
35117
  const targetDirs = import_node_fs28.default.readdirSync(iosDir, { withFileTypes: true }).filter(
35083
35118
  (entry) => entry.isDirectory() && !entry.isSymbolicLink() && entry.name !== "Pods" && entry.name !== "build" && !entry.name.startsWith(".")
35084
35119
  ).slice(0, 64);
35085
- const plistPaths = [import_node_path29.default.join(iosDir, "Info.plist")];
35120
+ const plistPaths = [import_node_path30.default.join(iosDir, "Info.plist")];
35086
35121
  for (const entry of targetDirs) {
35087
- 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"));
35088
35123
  }
35089
35124
  for (const plistPath of plistPaths) {
35090
35125
  let parsed;
@@ -35099,12 +35134,12 @@ function discoverNativeLinkedAppFonts(opts) {
35099
35134
  for (const declaredFont of declaredFonts) {
35100
35135
  if (typeof declaredFont !== "string") continue;
35101
35136
  const candidates = [
35102
- import_node_path29.default.resolve(import_node_path29.default.dirname(plistPath), declaredFont),
35103
- 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)
35104
35139
  ];
35105
35140
  const fontPath = candidates.find((candidate) => {
35106
- const relative2 = import_node_path29.default.relative(selectedAppDir, candidate);
35107
- 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;
35108
35143
  try {
35109
35144
  return import_node_fs28.default.statSync(candidate).isFile();
35110
35145
  } catch {
@@ -35113,7 +35148,7 @@ function discoverNativeLinkedAppFonts(opts) {
35113
35148
  });
35114
35149
  if (!fontPath) continue;
35115
35150
  fontPaths.push(
35116
- 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("/")
35117
35152
  );
35118
35153
  }
35119
35154
  }
@@ -35155,13 +35190,13 @@ async function resolveMetroProjectRoot(bundleUrl, opts) {
35155
35190
  function encodeAppFontsWire(specs) {
35156
35191
  return specs.map((spec) => `${encodeURIComponent(spec.url)}::${encodeURIComponent(spec.family)}`).join(",");
35157
35192
  }
35158
- 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;
35159
35194
  var init_app_fonts = __esm({
35160
35195
  "cli/app-fonts.ts"() {
35161
35196
  "use strict";
35162
35197
  import_node_fs28 = __toESM(require("node:fs"), 1);
35163
35198
  import_node_module4 = require("node:module");
35164
- import_node_path29 = __toESM(require("node:path"), 1);
35199
+ import_node_path30 = __toESM(require("node:path"), 1);
35165
35200
  import_config_plugin_fonts = require("peach-engine/engine/config-plugin-fonts");
35166
35201
  init_dev_server_scanner();
35167
35202
  init_backend_origin();
@@ -37601,8 +37636,8 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
37601
37636
  };
37602
37637
  }
37603
37638
  const lock = parseLinuxBrowserLibsLock(linux_browser_libs_lock_default);
37604
- const dir = (0, import_node_path30.join)(rnxHomeDir(), "linux-libs", `${lock.id}-${arch}`);
37605
- 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))) {
37606
37641
  const url = `${DEFAULT_CLI_RELEASE_ORIGIN}/${linuxBrowserLibsKey(lock.id, arch)}`;
37607
37642
  process.stderr.write(
37608
37643
  `peach: this system lacks ${missing.length} shared libraries ${browser} links; downloading them\u2026
@@ -37630,7 +37665,7 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
37630
37665
  };
37631
37666
  }
37632
37667
  }
37633
- 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(":");
37634
37669
  const stillMissing = missingLibraries(executablePath, libraryPath);
37635
37670
  if (stillMissing.length) {
37636
37671
  return {
@@ -37640,13 +37675,13 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
37640
37675
  }
37641
37676
  return { ok: true, libraryPath };
37642
37677
  }
37643
- 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;
37644
37679
  var init_linux_browser_libs = __esm({
37645
37680
  "cli/drivers/linux-browser-libs.ts"() {
37646
37681
  "use strict";
37647
37682
  import_node_child_process9 = require("node:child_process");
37648
37683
  import_node_fs29 = require("node:fs");
37649
- import_node_path30 = require("node:path");
37684
+ import_node_path31 = require("node:path");
37650
37685
  init_src();
37651
37686
  init_home_paths();
37652
37687
  init_is_record();
@@ -37675,7 +37710,7 @@ function resolvePlaywright() {
37675
37710
  const corePackagePath = (0, import_node_module6.createRequire)(modulePath).resolve(
37676
37711
  "playwright-core/package.json"
37677
37712
  );
37678
- 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");
37679
37714
  if (!(0, import_node_fs30.existsSync)(cliPath)) continue;
37680
37715
  return {
37681
37716
  spec,
@@ -37704,7 +37739,7 @@ async function provisionPlaywright() {
37704
37739
  await installVerifiedTarball({
37705
37740
  url: `https://registry.npmjs.org/playwright-core/-/playwright-core-${version}.tgz`,
37706
37741
  digest: { algorithm, encoding: "base64", value: digest },
37707
- 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"),
37708
37743
  installedMarker: "package.json",
37709
37744
  // npm tarballs hold the package under a leading `package/`
37710
37745
  stripComponents: 1,
@@ -37815,14 +37850,14 @@ ${detail}` : ""}`
37815
37850
  libraryPath: libraries.libraryPath
37816
37851
  };
37817
37852
  }
37818
- 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;
37819
37854
  var init_playwright_provisioning = __esm({
37820
37855
  "cli/drivers/playwright-provisioning.ts"() {
37821
37856
  "use strict";
37822
37857
  import_node_child_process10 = require("node:child_process");
37823
37858
  import_node_fs30 = require("node:fs");
37824
37859
  import_node_module6 = require("node:module");
37825
- import_node_path31 = require("node:path");
37860
+ import_node_path32 = require("node:path");
37826
37861
  init_src();
37827
37862
  init_home_paths();
37828
37863
  init_is_record();
@@ -38166,7 +38201,7 @@ var init_parse_args = __esm({
38166
38201
  // cli/telemetry.ts
38167
38202
  function sanitizeDiagnosticMessage(value) {
38168
38203
  const firstLine = value.slice(0, 2048).split(/[\r\n\u2028\u2029]/, 1)[0] ?? "";
38169
- return firstLine.split((0, import_node_os6.homedir)()).join("<home>").replace(
38204
+ return firstLine.split((0, import_node_os7.homedir)()).join("<home>").replace(
38170
38205
  /<package:(?:@[\w.-]+\/)?[\w.-]+>|(?:https?:\/\/|file:\/\/|[A-Za-z]:[\\/]|<home>[\\/]|\/|\.{1,2}[\\/]|\b[\w.-]+[\\/])(?:[^\s"'<>]|\s(?=[^"'<>]*[\\/]))+/g,
38171
38206
  (location2) => {
38172
38207
  if (location2.startsWith("<package:")) return location2;
@@ -38193,11 +38228,11 @@ function trackCliDiagnostic(diagnostic) {
38193
38228
  if (queue.some((queued) => JSON.stringify(queued) === JSON.stringify(entry))) return;
38194
38229
  queue.push(entry);
38195
38230
  }
38196
- 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;
38197
38232
  var init_telemetry = __esm({
38198
38233
  "cli/telemetry.ts"() {
38199
38234
  "use strict";
38200
- import_node_os6 = require("node:os");
38235
+ import_node_os7 = require("node:os");
38201
38236
  import_crash_fingerprint = require("peach-engine/crash-fingerprint");
38202
38237
  init_cli_version();
38203
38238
  init_home_paths();
@@ -38263,11 +38298,11 @@ var init_runtime_diagnostics = __esm({
38263
38298
  // cli/commands/skills.ts
38264
38299
  function getSkillsDir() {
38265
38300
  if (typeof __PEACH_BUNDLED_SKILLS__ !== "undefined") {
38266
- const dir = path24.join(rnxHomeDir(), "skills", getCliVersion());
38301
+ const dir = path25.join(rnxHomeDir(), "skills", getCliVersion());
38267
38302
  for (const [file, body] of Object.entries(__PEACH_BUNDLED_SKILLS__)) {
38268
- const target = path24.join(dir, file);
38303
+ const target = path25.join(dir, file);
38269
38304
  if (fs21.existsSync(target)) continue;
38270
- fs21.mkdirSync(path24.dirname(target), { recursive: true });
38305
+ fs21.mkdirSync(path25.dirname(target), { recursive: true });
38271
38306
  fs21.writeFileSync(target, body);
38272
38307
  }
38273
38308
  return dir;
@@ -38276,10 +38311,10 @@ function getSkillsDir() {
38276
38311
  const pkgPath = (0, import_url3.fileURLToPath)(
38277
38312
  import_meta4.resolve(`${rnxPublicBrand.packageName}/package.json`)
38278
38313
  );
38279
- return path24.join(path24.dirname(pkgPath), "skills");
38314
+ return path25.join(path25.dirname(pkgPath), "skills");
38280
38315
  } catch {
38281
- const __dirname = path24.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
38282
- return path24.resolve(__dirname, "../../skills");
38316
+ const __dirname = path25.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
38317
+ return path25.resolve(__dirname, "../../skills");
38283
38318
  }
38284
38319
  }
38285
38320
  function skillsDir() {
@@ -38287,8 +38322,8 @@ function skillsDir() {
38287
38322
  return skillsDirPath;
38288
38323
  }
38289
38324
  function targetFromHome(envName, fallbackDir) {
38290
- const home = process.env[envName] || path24.join(os5.homedir(), fallbackDir);
38291
- return path24.join(home, "skills");
38325
+ const home = process.env[envName] || path25.join(os6.homedir(), fallbackDir);
38326
+ return path25.join(home, "skills");
38292
38327
  }
38293
38328
  function defaultAgentTargets() {
38294
38329
  return [
@@ -38301,7 +38336,7 @@ function hasInstalledPeachSkills() {
38301
38336
  (file) => /^([^/]+)\/SKILL\.md$/.exec(file)?.[1] ?? []
38302
38337
  ) : listSkills().map((skill7) => skill7.name);
38303
38338
  return defaultAgentTargets().some(
38304
- ({ 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")))
38305
38340
  );
38306
38341
  }
38307
38342
  function parseSkillFrontmatter(content) {
@@ -38347,7 +38382,7 @@ function listSkills() {
38347
38382
  if (!fs21.existsSync(skillsDir())) return [];
38348
38383
  const skills = [];
38349
38384
  for (const entry of fs21.readdirSync(skillsDir())) {
38350
- const skillMd = path24.join(skillsDir(), entry, "SKILL.md");
38385
+ const skillMd = path25.join(skillsDir(), entry, "SKILL.md");
38351
38386
  if (!fs21.existsSync(skillMd)) continue;
38352
38387
  const meta = parseSkillFrontmatter(fs21.readFileSync(skillMd, "utf8"));
38353
38388
  if (meta) {
@@ -38356,13 +38391,13 @@ function listSkills() {
38356
38391
  }
38357
38392
  return skills.sort((a, b) => a.name.localeCompare(b.name));
38358
38393
  }
38359
- var fs21, os5, path24, import_url3, import_meta4, skillsDirPath;
38394
+ var fs21, os6, path25, import_url3, import_meta4, skillsDirPath;
38360
38395
  var init_skills = __esm({
38361
38396
  "cli/commands/skills.ts"() {
38362
38397
  "use strict";
38363
38398
  fs21 = __toESM(require("fs"), 1);
38364
- os5 = __toESM(require("os"), 1);
38365
- path24 = __toESM(require("path"), 1);
38399
+ os6 = __toESM(require("os"), 1);
38400
+ path25 = __toESM(require("path"), 1);
38366
38401
  import_url3 = require("url");
38367
38402
  init_cli_version();
38368
38403
  init_home_paths();
@@ -38996,10 +39031,10 @@ async function buildResolvedBundleOpenUrl(target, baseUrl, opts = {}) {
38996
39031
  }
38997
39032
  function normalizeReplacementPath(filePath) {
38998
39033
  if (filePath.startsWith("~/")) {
38999
- 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));
39000
39035
  }
39001
- if (import_node_path32.default.isAbsolute(filePath)) return filePath;
39002
- 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);
39003
39038
  }
39004
39039
  function parseOpenRuntimeConfig(args) {
39005
39040
  const modules = {};
@@ -39049,7 +39084,7 @@ async function resolveAppProjectForBundleUrl(bundleUrl) {
39049
39084
  return advertisedRoot ? resolveAppProject(advertisedRoot) : null;
39050
39085
  }
39051
39086
  async function ensureConfiguredRuntime(version) {
39052
- 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;
39053
39088
  console.error(` installing configured engine runtime ${version}...`);
39054
39089
  const result = await rnxRuntime.install({
39055
39090
  version,
@@ -39398,17 +39433,17 @@ function printDriverDiagnosticLogTail(result) {
39398
39433
  try {
39399
39434
  const detail = import_node_fs31.default.readFileSync(result.diagnosticLogPath, "utf8").trim();
39400
39435
  if (!detail) {
39401
- console.error(` ${import_node_path32.default.basename(result.diagnosticLogPath)} was empty`);
39436
+ console.error(` ${import_node_path33.default.basename(result.diagnosticLogPath)} was empty`);
39402
39437
  return;
39403
39438
  }
39404
39439
  const shown = detail.length > 4e3 ? `\u2026
39405
39440
  ${detail.slice(-4e3)}` : detail;
39406
- console.error(` ${import_node_path32.default.basename(result.diagnosticLogPath)}:`);
39441
+ console.error(` ${import_node_path33.default.basename(result.diagnosticLogPath)}:`);
39407
39442
  console.error(shown);
39408
39443
  } catch (err) {
39409
39444
  const message = err instanceof Error ? err.message : String(err);
39410
39445
  console.error(
39411
- ` failed to read ${import_node_path32.default.basename(result.diagnosticLogPath)}: ${message}`
39446
+ ` failed to read ${import_node_path33.default.basename(result.diagnosticLogPath)}: ${message}`
39412
39447
  );
39413
39448
  }
39414
39449
  }
@@ -40386,14 +40421,14 @@ async function runCloseCommand(args, opts = {}) {
40386
40421
  bridge.close();
40387
40422
  }
40388
40423
  }
40389
- 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;
40390
40425
  var init_control = __esm({
40391
40426
  "cli/commands/control.ts"() {
40392
40427
  "use strict";
40393
40428
  import_node_child_process11 = require("node:child_process");
40394
40429
  import_node_fs31 = __toESM(require("node:fs"), 1);
40395
- import_node_os7 = __toESM(require("node:os"), 1);
40396
- 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);
40397
40432
  import_app_catalog_wire = require("peach-engine/engine/app-catalog-wire");
40398
40433
  import_devices2 = require("peach-engine/settings/devices");
40399
40434
  import_ws4 = require("ws");
@@ -41741,16 +41776,16 @@ function readRecentShellAppId(state) {
41741
41776
  }
41742
41777
  function resolveProjectRelativeFlowBase(flowDir) {
41743
41778
  if (!flowDir) return process.cwd();
41744
- return path26.basename(flowDir) === ".maestro" ? path26.dirname(flowDir) : flowDir;
41779
+ return path27.basename(flowDir) === ".maestro" ? path27.dirname(flowDir) : flowDir;
41745
41780
  }
41746
41781
  function resolveFlowScreenshotPathWithMode(screenshotDir, name2, opts) {
41747
41782
  const normalizedName = name2.endsWith(".png") ? name2 : `${name2}.png`;
41748
- if (path26.isAbsolute(normalizedName)) return normalizedName;
41783
+ if (path27.isAbsolute(normalizedName)) return normalizedName;
41749
41784
  if (opts.mode === "flow" && /[\\/]/.test(normalizedName)) {
41750
41785
  const baseDir = normalizedName.startsWith("./") || normalizedName.startsWith("../") ? opts.flowDir ?? process.cwd() : resolveProjectRelativeFlowBase(opts.flowDir);
41751
- return path26.resolve(baseDir, normalizedName);
41786
+ return path27.resolve(baseDir, normalizedName);
41752
41787
  }
41753
- return path26.join(screenshotDir, normalizedName);
41788
+ return path27.join(screenshotDir, normalizedName);
41754
41789
  }
41755
41790
  function normalizeFlowScreenshotSpec(step) {
41756
41791
  if (typeof step === "string") {
@@ -41807,12 +41842,12 @@ function parseFlowSteps(content) {
41807
41842
  const parsed = import_yaml2.default.parse(candidate);
41808
41843
  return Array.isArray(parsed) ? parsed : [];
41809
41844
  }
41810
- 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;
41811
41846
  var init_bridge_flow_runner = __esm({
41812
41847
  "cli/bridge-flow-runner.ts"() {
41813
41848
  "use strict";
41814
41849
  fs24 = __toESM(require("fs"), 1);
41815
- path26 = __toESM(require("path"), 1);
41850
+ path27 = __toESM(require("path"), 1);
41816
41851
  import_devices4 = require("peach-engine/settings/devices");
41817
41852
  import_yaml2 = __toESM(require("yaml"), 1);
41818
41853
  import_proof_frame = __toESM(require_proof_frame(), 1);
@@ -42140,7 +42175,7 @@ var init_bridge_flow_runner = __esm({
42140
42175
  fs24.mkdirSync(this.opts.recordingOutputDir, { recursive: true });
42141
42176
  const videoMime = stopped.mime || this.opts.recordingFormat || "video/webm";
42142
42177
  const extension = videoMime.includes("mp4") ? "mp4" : "webm";
42143
- const outputPath = path26.join(
42178
+ const outputPath = path27.join(
42144
42179
  this.opts.recordingOutputDir,
42145
42180
  `peach-${Date.now()}.${extension}`
42146
42181
  );
@@ -42820,7 +42855,7 @@ var init_bridge_flow_runner = __esm({
42820
42855
  flowDir: this.opts.flowDir
42821
42856
  }
42822
42857
  );
42823
- fs24.mkdirSync(path26.dirname(outputPath), { recursive: true });
42858
+ fs24.mkdirSync(path27.dirname(outputPath), { recursive: true });
42824
42859
  const layers = spec.layers ?? this.opts.screenshotLayers;
42825
42860
  const screenshotRequest = {
42826
42861
  type: "screenshot",
@@ -42884,7 +42919,7 @@ var init_bridge_flow_runner = __esm({
42884
42919
  fs24.mkdirSync(outputDir, { recursive: true });
42885
42920
  const write = (name2, content) => {
42886
42921
  try {
42887
- fs24.writeFileSync(path26.join(outputDir, name2), content);
42922
+ fs24.writeFileSync(path27.join(outputDir, name2), content);
42888
42923
  } catch {
42889
42924
  }
42890
42925
  };
@@ -43476,7 +43511,7 @@ var init_bridge_flow_runner = __esm({
43476
43511
  runScript(target) {
43477
43512
  const spec = typeof target === "string" ? { file: target } : target;
43478
43513
  if (!spec.file) throw new Error("runScript requires a file");
43479
- const scriptPath = path26.resolve(this.opts.flowDir, spec.file);
43514
+ const scriptPath = path27.resolve(this.opts.flowDir, spec.file);
43480
43515
  const source = fs24.readFileSync(scriptPath, "utf8");
43481
43516
  this.js.evaluate(source, { env: spec.env });
43482
43517
  console.log(`[flow] runScript: ${spec.file} done`);
@@ -43837,10 +43872,10 @@ var init_bridge_flow_runner = __esm({
43837
43872
  for (const [k, v] of Object.entries(env)) this.js.putEnv(k, v);
43838
43873
  }
43839
43874
  if (file) {
43840
- const flowPath = path26.resolve(this.opts.flowDir, file);
43875
+ const flowPath = path27.resolve(this.opts.flowDir, file);
43841
43876
  const flowContent = fs24.readFileSync(flowPath, "utf8");
43842
43877
  const previousDir = this.opts.flowDir;
43843
- this.opts.flowDir = path26.dirname(flowPath);
43878
+ this.opts.flowDir = path27.dirname(flowPath);
43844
43879
  try {
43845
43880
  await this.runFlow(parseFlowSteps(flowContent));
43846
43881
  } finally {
@@ -44012,7 +44047,7 @@ __export(registry_exports, {
44012
44047
  });
44013
44048
  module.exports = __toCommonJS(registry_exports);
44014
44049
  var fs25 = __toESM(require("fs"), 1);
44015
- var path27 = __toESM(require("path"), 1);
44050
+ var path28 = __toESM(require("path"), 1);
44016
44051
 
44017
44052
  // src/skills/builtin/a11y-review.ts
44018
44053
  init_reap_browser();
@@ -44031,7 +44066,7 @@ var skill = {
44031
44066
  },
44032
44067
  async execute(params, context) {
44033
44068
  const { chromium } = await import("playwright");
44034
- const path28 = await import("path");
44069
+ const path29 = await import("path");
44035
44070
  const fs26 = await import("fs");
44036
44071
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
44037
44072
  headless: true
@@ -44089,8 +44124,8 @@ var skill = {
44089
44124
  warnings: issues.filter((i) => i.severity === "warning").length,
44090
44125
  tree: typeof tree === "string" ? tree : JSON.stringify(tree)
44091
44126
  };
44092
- const reportPath = path28.join(context.outputDir, "a11y-report.json");
44093
- 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 });
44094
44129
  fs26.writeFileSync(reportPath, JSON.stringify(report, null, 2));
44095
44130
  return {
44096
44131
  success: issues.filter((i) => i.severity === "error").length === 0,
@@ -44125,9 +44160,9 @@ var skill2 = {
44125
44160
  },
44126
44161
  async execute(params, context) {
44127
44162
  const fs26 = await import("node:fs");
44128
- const path28 = await import("node:path");
44163
+ const path29 = await import("node:path");
44129
44164
  const { COMPAT_RESULT_CAVEAT: COMPAT_RESULT_CAVEAT2, formatPackageStatus: formatPackageStatus2, formatScanCounts: formatScanCounts2, scanDeps: scanDeps2 } = await Promise.resolve().then(() => (init_web(), web_exports));
44130
- const packagePath = path28.join(context.projectDir, "package.json");
44165
+ const packagePath = path29.join(context.projectDir, "package.json");
44131
44166
  if (!fs26.existsSync(packagePath)) {
44132
44167
  return { success: false, message: "No package.json found" };
44133
44168
  }
@@ -44143,8 +44178,8 @@ var skill2 = {
44143
44178
  }) : scanDeps2(parsed);
44144
44179
  const packageResult = params.packageName ? scan.packages[0] : void 0;
44145
44180
  const message = packageResult ? `${params.packageName}: ${formatPackageStatus2(packageResult)}. ${COMPAT_RESULT_CAVEAT2}` : `${formatScanCounts2(scan)}. ${COMPAT_RESULT_CAVEAT2}`;
44146
- const reportPath = path28.join(context.outputDir, "compat-report.json");
44147
- 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 });
44148
44183
  fs26.writeFileSync(reportPath, `${JSON.stringify(scan, null, 2)}
44149
44184
  `);
44150
44185
  return {
@@ -44188,7 +44223,7 @@ var skill3 = {
44188
44223
  },
44189
44224
  async execute(params, context) {
44190
44225
  const fs26 = await import("fs");
44191
- const path28 = await import("path");
44226
+ const path29 = await import("path");
44192
44227
  const yaml2 = await import("yaml");
44193
44228
  const { DEFAULT_SOOTSIM_BRIDGE_PORT: DEFAULT_SOOTSIM_BRIDGE_PORT3 } = await Promise.resolve().then(() => (init_bridge_constants(), bridge_constants_exports));
44194
44229
  const { SootSimBridgeHost: SootSimBridgeHost2 } = await Promise.resolve().then(() => (init_bridge_host(), bridge_host_exports));
@@ -44225,7 +44260,7 @@ var skill3 = {
44225
44260
  });
44226
44261
  const driver = new SootSimBridgeFlowRunner2(bridge, {
44227
44262
  screenshotDir: context.outputDir,
44228
- flowDir: path28.dirname(path28.resolve(params.flowPath)),
44263
+ flowDir: path29.dirname(path29.resolve(params.flowPath)),
44229
44264
  simId,
44230
44265
  recordingOutputDir: params.record ? context.outputDir : void 0
44231
44266
  });
@@ -44247,7 +44282,7 @@ var skill3 = {
44247
44282
  simId,
44248
44283
  videoPath: videoPath || void 0
44249
44284
  },
44250
- 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
44251
44286
  };
44252
44287
  } finally {
44253
44288
  try {
@@ -44294,7 +44329,7 @@ var skill4 = {
44294
44329
  },
44295
44330
  async execute(params, context) {
44296
44331
  const { chromium } = await import("playwright");
44297
- const path28 = await import("path");
44332
+ const path29 = await import("path");
44298
44333
  const fs26 = await import("fs");
44299
44334
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
44300
44335
  headless: true
@@ -44323,8 +44358,8 @@ var skill4 = {
44323
44358
  ...profile,
44324
44359
  fps: syncCount > 0 ? (syncCount / (duration / 1e3)).toFixed(1) : "0"
44325
44360
  };
44326
- const reportPath = path28.join(context.outputDir, "perf-report.json");
44327
- 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 });
44328
44363
  fs26.writeFileSync(reportPath, JSON.stringify(report, null, 2));
44329
44364
  return {
44330
44365
  success: true,
@@ -44358,7 +44393,7 @@ var skill5 = {
44358
44393
  },
44359
44394
  async execute(params, context) {
44360
44395
  const { chromium } = await import("playwright");
44361
- const path28 = await import("path");
44396
+ const path29 = await import("path");
44362
44397
  const fs26 = await import("fs");
44363
44398
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
44364
44399
  headless: true
@@ -44367,8 +44402,8 @@ var skill5 = {
44367
44402
  try {
44368
44403
  await page.goto(context.url, { waitUntil: "networkidle" });
44369
44404
  await page.waitForTimeout(2e3);
44370
- const outputPath = path28.join(context.outputDir, `${params.name}.png`);
44371
- 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 });
44372
44407
  await page.screenshot({ path: outputPath });
44373
44408
  return {
44374
44409
  success: true,
@@ -44409,7 +44444,7 @@ var skill6 = {
44409
44444
  },
44410
44445
  async execute(params, context) {
44411
44446
  const { chromium } = await import("playwright");
44412
- const path28 = await import("path");
44447
+ const path29 = await import("path");
44413
44448
  const fs26 = await import("fs");
44414
44449
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
44415
44450
  headless: true
@@ -44418,8 +44453,8 @@ var skill6 = {
44418
44453
  try {
44419
44454
  await page.goto(context.url, { waitUntil: "networkidle" });
44420
44455
  await page.waitForTimeout(2e3);
44421
- const currentPath = path28.join(context.outputDir, `${params.name}-current.png`);
44422
- 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 });
44423
44458
  await page.screenshot({ path: currentPath });
44424
44459
  try {
44425
44460
  const { PNG } = await import("pngjs");
@@ -44436,7 +44471,7 @@ var skill6 = {
44436
44471
  height,
44437
44472
  { threshold: params.threshold || 0.1 }
44438
44473
  );
44439
- const diffPath = path28.join(context.outputDir, `${params.name}-diff.png`);
44474
+ const diffPath = path29.join(context.outputDir, `${params.name}-diff.png`);
44440
44475
  fs26.writeFileSync(diffPath, PNG.sync.write(diff));
44441
44476
  const totalPixels = width * height;
44442
44477
  const diffPercent = (numDiffPixels / totalPixels * 100).toFixed(2);
@@ -44501,7 +44536,7 @@ var skillRegistry = {
44501
44536
  },
44502
44537
  // load skills from a project manifest (rnx-skills.json)
44503
44538
  async loadFromManifest(projectDir) {
44504
- const manifestPath = path27.join(projectDir, "rnx-skills.json");
44539
+ const manifestPath = path28.join(projectDir, "rnx-skills.json");
44505
44540
  if (!fs25.existsSync(manifestPath)) return;
44506
44541
  try {
44507
44542
  const manifest = JSON.parse(fs25.readFileSync(manifestPath, "utf8"));
@@ -44515,7 +44550,7 @@ var skillRegistry = {
44515
44550
  }
44516
44551
  } else if (entry.file) {
44517
44552
  try {
44518
- const mod = await import(path27.resolve(projectDir, entry.file));
44553
+ const mod = await import(path28.resolve(projectDir, entry.file));
44519
44554
  if (mod.skill) this.register(mod.skill);
44520
44555
  } catch {
44521
44556
  }
@@ -44528,7 +44563,7 @@ var skillRegistry = {
44528
44563
  // auto-discover skills based on project dependencies
44529
44564
  suggestSkills(projectDir) {
44530
44565
  const suggestions = [];
44531
- const pkgPath = path27.join(projectDir, "package.json");
44566
+ const pkgPath = path28.join(projectDir, "package.json");
44532
44567
  if (!fs25.existsSync(pkgPath)) return suggestions;
44533
44568
  try {
44534
44569
  const pkg = JSON.parse(fs25.readFileSync(pkgPath, "utf8"));