peachsim 0.1.2242 → 0.1.2244

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 (105) hide show
  1. package/cli/binary-sidecar.ts +89 -0
  2. package/cli/bridge-flow-runner.ts +2 -2
  3. package/cli/cloud-client.ts +2 -0
  4. package/cli/commands/control.ts +16 -0
  5. package/cli/commands/device.ts +1 -1
  6. package/cli/commands/flow.ts +6 -2
  7. package/cli/commands/inspect/core.ts +0 -20
  8. package/cli/commands/inspect/settling.ts +15 -2
  9. package/cli/commands/inspect.ts +5 -5
  10. package/cli/commands/preview.ts +12 -5
  11. package/cli/commands/shell-boolean-mode.ts +1 -1
  12. package/cli/commands/slides.ts +1 -1
  13. package/dist-lib/agent-daemon-client.cjs +1 -1
  14. package/dist-lib/agent-events.cjs +1 -1
  15. package/dist-lib/attached-projects.cjs +1 -1
  16. package/dist-lib/auth/shared-session.cjs +1 -1
  17. package/dist-lib/backend-origin.cjs +1 -1
  18. package/dist-lib/beta.cjs +1 -1
  19. package/dist-lib/beta.mjs +1 -1
  20. package/dist-lib/bridge-constants.cjs +1 -1
  21. package/dist-lib/bridge-contract-input.cjs +1 -1
  22. package/dist-lib/bridge-contract-input.mjs +1 -1
  23. package/dist-lib/bridge-contract.cjs +1 -1
  24. package/dist-lib/bridge-contract.mjs +1 -1
  25. package/dist-lib/bundle-channel.cjs +94 -15
  26. package/dist-lib/capture-contract.cjs +1 -1
  27. package/dist-lib/capture-contract.mjs +1 -1
  28. package/dist-lib/cloud-contract.cjs +1 -1
  29. package/dist-lib/cloud-contract.mjs +1 -1
  30. package/dist-lib/cloud-test-args.cjs +1 -1
  31. package/dist-lib/cloud-test-args.mjs +1 -1
  32. package/dist-lib/cloud.cjs +1 -1
  33. package/dist-lib/cloud.mjs +1 -1
  34. package/dist-lib/config.cjs +1 -1
  35. package/dist-lib/config.mjs +1 -1
  36. package/dist-lib/detox/index.cjs +16 -5
  37. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  38. package/dist-lib/expo-swift-bundle.cjs +93 -14
  39. package/dist-lib/expo-swift-metadata.cjs +1 -1
  40. package/dist-lib/expo-swift-metadata.mjs +1 -1
  41. package/dist-lib/home-paths.cjs +1 -1
  42. package/dist-lib/host/bridge-host.cjs +121 -28
  43. package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
  44. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  45. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  46. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  47. package/dist-lib/host/websocket-proxy.cjs +1 -1
  48. package/dist-lib/index.cjs +18 -7
  49. package/dist-lib/jump-to-source-babel.cjs +1 -1
  50. package/dist-lib/jump-to-source-native.cjs +1 -1
  51. package/dist-lib/kotlin-host.cjs +1 -1
  52. package/dist-lib/menu.cjs +11 -2
  53. package/dist-lib/menu.mjs +11 -2
  54. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  55. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  56. package/dist-lib/metro-production-bundle.cjs +1 -1
  57. package/dist-lib/metro-production-bundle.mjs +1 -1
  58. package/dist-lib/metro.cjs +3 -3
  59. package/dist-lib/native-app-identity-project.cjs +2 -2
  60. package/dist-lib/native-app-identity-project.mjs +2 -2
  61. package/dist-lib/native-app-identity.cjs +1 -1
  62. package/dist-lib/native-app-identity.mjs +1 -1
  63. package/dist-lib/native-firebase-metadata.cjs +1 -1
  64. package/dist-lib/native-firebase-metadata.mjs +1 -1
  65. package/dist-lib/pdfium-raster.cjs +1 -1
  66. package/dist-lib/pdfium-raster.mjs +1 -1
  67. package/dist-lib/plist.cjs +1 -1
  68. package/dist-lib/plist.mjs +1 -1
  69. package/dist-lib/profiles.cjs +1 -1
  70. package/dist-lib/public-brand.cjs +1 -1
  71. package/dist-lib/public-origins-lib-esm.json +24 -24
  72. package/dist-lib/public-origins-lib.json +55 -53
  73. package/dist-lib/react-native-host-modules.cjs +1 -1
  74. package/dist-lib/react-native-host-modules.mjs +1 -1
  75. package/dist-lib/reap-browser.cjs +1 -1
  76. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  77. package/dist-lib/sdk.cjs +16 -24
  78. package/dist-lib/sdk.mjs +16 -22
  79. package/dist-lib/skills.cjs +973 -755
  80. package/dist-lib/swift-compile.cjs +4 -3
  81. package/dist-lib/swift-compile.mjs +4 -3
  82. package/dist-lib/swift-package.cjs +1 -1
  83. package/dist-lib/swift-package.mjs +1 -1
  84. package/dist-lib/swift-submit.cjs +2 -2
  85. package/dist-lib/swift-submit.mjs +2 -2
  86. package/dist-lib/swift-toolchain.cjs +1 -1
  87. package/dist-lib/swift.cjs +1 -1
  88. package/dist-lib/vite-swift.cjs +485 -405
  89. package/dist-lib/vite.cjs +3 -3
  90. package/dist-lib/worklet-executable.cjs +1 -1
  91. package/dist-lib/worklet-executable.mjs +1 -1
  92. package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +1 -0
  93. package/dist-types/packages/peach-engine/src/engine/native-layout.d.ts +1 -1
  94. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -0
  95. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -1
  96. package/kotlin/sdk.tar.gz +0 -0
  97. package/package.json +1 -1
  98. package/src/binarySidecarContract.ts +45 -0
  99. package/src/host/bridge-host.ts +12 -13
  100. package/src/menu.ts +14 -0
  101. package/src/native-static-libraries.ts +82 -1
  102. package/src/swift-host.ts +6 -7
  103. package/src/swift-standins.ts +11 -4
  104. package/src/swift-submit.ts +3 -1
  105. package/src/swift-wasm-prune.ts +23 -0
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2242 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2244 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -45,12 +45,12 @@ var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
45
45
 
46
46
  // src/chromium-admission.ts
47
47
  function readChromiumQueue(deps, verified2, own) {
48
- const { fs: fs116, os: os24, path: path141, childProcess: childProcess3 } = deps;
49
- const dir = path141.join(
48
+ const { fs: fs117, os: os24, path: path142, childProcess: childProcess3 } = deps;
49
+ const dir = path142.join(
50
50
  process.platform === "win32" ? os24.tmpdir() : "/tmp",
51
51
  "chromium-admission"
52
52
  );
53
- fs116.mkdirSync(dir, { recursive: true });
53
+ fs117.mkdirSync(dir, { recursive: true });
54
54
  const limit = Math.max(2, Math.floor(os24.cpus().length / 2));
55
55
  const live = (entry) => {
56
56
  const match = /^(\d+)-(\d+)-/.exec(entry);
@@ -78,10 +78,10 @@ function readChromiumQueue(deps, verified2, own) {
78
78
  return same;
79
79
  };
80
80
  const tickets = [];
81
- for (const entry of fs116.readdirSync(dir)) {
81
+ for (const entry of fs117.readdirSync(dir)) {
82
82
  if (entry !== own && !live(entry)) {
83
83
  try {
84
- fs116.unlinkSync(path141.join(dir, entry));
84
+ fs117.unlinkSync(path142.join(dir, entry));
85
85
  } catch {
86
86
  }
87
87
  continue;
@@ -89,7 +89,7 @@ function readChromiumQueue(deps, verified2, own) {
89
89
  try {
90
90
  tickets.push({
91
91
  entry,
92
- created: fs116.statSync(path141.join(dir, entry), { bigint: true }).ctimeNs
92
+ created: fs117.statSync(path142.join(dir, entry), { bigint: true }).ctimeNs
93
93
  });
94
94
  } catch {
95
95
  }
@@ -100,21 +100,21 @@ function readChromiumQueue(deps, verified2, own) {
100
100
  return { dir, limit, tickets: tickets.map((t) => t.entry) };
101
101
  }
102
102
  async function acquireChromiumAdmission(deps) {
103
- const { fs: fs116, path: path141, label, readQueue, signal } = deps;
103
+ const { fs: fs117, path: path142, label, readQueue, signal } = deps;
104
104
  signal?.throwIfAborted();
105
105
  const queuedAt = Date.now();
106
106
  const verified2 = /* @__PURE__ */ new Map();
107
107
  const startedAt = Math.round(Date.now() / 1e3 - process.uptime());
108
108
  const name3 = `${process.pid}-${startedAt}-${Math.random().toString(36).slice(2, 10)}`;
109
- const ticket = path141.join(readQueue(deps, verified2, name3).dir, name3);
110
- fs116.closeSync(fs116.openSync(ticket, "wx"));
109
+ const ticket = path142.join(readQueue(deps, verified2, name3).dir, name3);
110
+ fs117.closeSync(fs117.openSync(ticket, "wx"));
111
111
  let released = false;
112
112
  const release = () => {
113
113
  if (released) return;
114
114
  released = true;
115
115
  process.removeListener("exit", release);
116
116
  try {
117
- fs116.unlinkSync(ticket);
117
+ fs117.unlinkSync(ticket);
118
118
  } catch {
119
119
  }
120
120
  };
@@ -20958,17 +20958,17 @@ function visit(node, visitor) {
20958
20958
  } else
20959
20959
  visit_(null, node, visitor_, Object.freeze([]));
20960
20960
  }
20961
- function visit_(key2, node, visitor, path141) {
20962
- const ctrl = callVisitor(key2, node, visitor, path141);
20961
+ function visit_(key2, node, visitor, path142) {
20962
+ const ctrl = callVisitor(key2, node, visitor, path142);
20963
20963
  if (isNode(ctrl) || isPair(ctrl)) {
20964
- replaceNode(key2, path141, ctrl);
20965
- return visit_(key2, ctrl, visitor, path141);
20964
+ replaceNode(key2, path142, ctrl);
20965
+ return visit_(key2, ctrl, visitor, path142);
20966
20966
  }
20967
20967
  if (typeof ctrl !== "symbol") {
20968
20968
  if (isCollection(node)) {
20969
- path141 = Object.freeze(path141.concat(node));
20969
+ path142 = Object.freeze(path142.concat(node));
20970
20970
  for (let i = 0; i < node.items.length; ++i) {
20971
- const ci = visit_(i, node.items[i], visitor, path141);
20971
+ const ci = visit_(i, node.items[i], visitor, path142);
20972
20972
  if (typeof ci === "number")
20973
20973
  i = ci - 1;
20974
20974
  else if (ci === BREAK)
@@ -20979,13 +20979,13 @@ function visit_(key2, node, visitor, path141) {
20979
20979
  }
20980
20980
  }
20981
20981
  } else if (isPair(node)) {
20982
- path141 = Object.freeze(path141.concat(node));
20983
- const ck = visit_("key", node.key, visitor, path141);
20982
+ path142 = Object.freeze(path142.concat(node));
20983
+ const ck = visit_("key", node.key, visitor, path142);
20984
20984
  if (ck === BREAK)
20985
20985
  return BREAK;
20986
20986
  else if (ck === REMOVE)
20987
20987
  node.key = null;
20988
- const cv = visit_("value", node.value, visitor, path141);
20988
+ const cv = visit_("value", node.value, visitor, path142);
20989
20989
  if (cv === BREAK)
20990
20990
  return BREAK;
20991
20991
  else if (cv === REMOVE)
@@ -21003,17 +21003,17 @@ async function visitAsync(node, visitor) {
21003
21003
  } else
21004
21004
  await visitAsync_(null, node, visitor_, Object.freeze([]));
21005
21005
  }
21006
- async function visitAsync_(key2, node, visitor, path141) {
21007
- const ctrl = await callVisitor(key2, node, visitor, path141);
21006
+ async function visitAsync_(key2, node, visitor, path142) {
21007
+ const ctrl = await callVisitor(key2, node, visitor, path142);
21008
21008
  if (isNode(ctrl) || isPair(ctrl)) {
21009
- replaceNode(key2, path141, ctrl);
21010
- return visitAsync_(key2, ctrl, visitor, path141);
21009
+ replaceNode(key2, path142, ctrl);
21010
+ return visitAsync_(key2, ctrl, visitor, path142);
21011
21011
  }
21012
21012
  if (typeof ctrl !== "symbol") {
21013
21013
  if (isCollection(node)) {
21014
- path141 = Object.freeze(path141.concat(node));
21014
+ path142 = Object.freeze(path142.concat(node));
21015
21015
  for (let i = 0; i < node.items.length; ++i) {
21016
- const ci = await visitAsync_(i, node.items[i], visitor, path141);
21016
+ const ci = await visitAsync_(i, node.items[i], visitor, path142);
21017
21017
  if (typeof ci === "number")
21018
21018
  i = ci - 1;
21019
21019
  else if (ci === BREAK)
@@ -21024,13 +21024,13 @@ async function visitAsync_(key2, node, visitor, path141) {
21024
21024
  }
21025
21025
  }
21026
21026
  } else if (isPair(node)) {
21027
- path141 = Object.freeze(path141.concat(node));
21028
- const ck = await visitAsync_("key", node.key, visitor, path141);
21027
+ path142 = Object.freeze(path142.concat(node));
21028
+ const ck = await visitAsync_("key", node.key, visitor, path142);
21029
21029
  if (ck === BREAK)
21030
21030
  return BREAK;
21031
21031
  else if (ck === REMOVE)
21032
21032
  node.key = null;
21033
- const cv = await visitAsync_("value", node.value, visitor, path141);
21033
+ const cv = await visitAsync_("value", node.value, visitor, path142);
21034
21034
  if (cv === BREAK)
21035
21035
  return BREAK;
21036
21036
  else if (cv === REMOVE)
@@ -21057,23 +21057,23 @@ function initVisitor(visitor) {
21057
21057
  }
21058
21058
  return visitor;
21059
21059
  }
21060
- function callVisitor(key2, node, visitor, path141) {
21060
+ function callVisitor(key2, node, visitor, path142) {
21061
21061
  if (typeof visitor === "function")
21062
- return visitor(key2, node, path141);
21062
+ return visitor(key2, node, path142);
21063
21063
  if (isMap(node))
21064
- return visitor.Map?.(key2, node, path141);
21064
+ return visitor.Map?.(key2, node, path142);
21065
21065
  if (isSeq(node))
21066
- return visitor.Seq?.(key2, node, path141);
21066
+ return visitor.Seq?.(key2, node, path142);
21067
21067
  if (isPair(node))
21068
- return visitor.Pair?.(key2, node, path141);
21068
+ return visitor.Pair?.(key2, node, path142);
21069
21069
  if (isScalar(node))
21070
- return visitor.Scalar?.(key2, node, path141);
21070
+ return visitor.Scalar?.(key2, node, path142);
21071
21071
  if (isAlias(node))
21072
- return visitor.Alias?.(key2, node, path141);
21072
+ return visitor.Alias?.(key2, node, path142);
21073
21073
  return void 0;
21074
21074
  }
21075
- function replaceNode(key2, path141, node) {
21076
- const parent = path141[path141.length - 1];
21075
+ function replaceNode(key2, path142, node) {
21076
+ const parent = path142[path142.length - 1];
21077
21077
  if (isCollection(parent)) {
21078
21078
  parent.items[key2] = node;
21079
21079
  } else if (isPair(parent)) {
@@ -21682,10 +21682,10 @@ var init_createNode = __esm({
21682
21682
  });
21683
21683
 
21684
21684
  // ../../node_modules/yaml/browser/dist/nodes/Collection.js
21685
- function collectionFromPath(schema4, path141, value) {
21685
+ function collectionFromPath(schema4, path142, value) {
21686
21686
  let v6 = value;
21687
- for (let i = path141.length - 1; i >= 0; --i) {
21688
- const k = path141[i];
21687
+ for (let i = path142.length - 1; i >= 0; --i) {
21688
+ const k = path142[i];
21689
21689
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
21690
21690
  const a = [];
21691
21691
  a[k] = v6;
@@ -21711,7 +21711,7 @@ var init_Collection = __esm({
21711
21711
  init_createNode();
21712
21712
  init_identity();
21713
21713
  init_Node();
21714
- isEmptyPath = (path141) => path141 == null || typeof path141 === "object" && !!path141[Symbol.iterator]().next().done;
21714
+ isEmptyPath = (path142) => path142 == null || typeof path142 === "object" && !!path142[Symbol.iterator]().next().done;
21715
21715
  Collection = class extends NodeBase {
21716
21716
  constructor(type, schema4) {
21717
21717
  super(type);
@@ -21741,11 +21741,11 @@ var init_Collection = __esm({
21741
21741
  * be a Pair instance or a `{ key, value }` object, which may not have a key
21742
21742
  * that already exists in the map.
21743
21743
  */
21744
- addIn(path141, value) {
21745
- if (isEmptyPath(path141))
21744
+ addIn(path142, value) {
21745
+ if (isEmptyPath(path142))
21746
21746
  this.add(value);
21747
21747
  else {
21748
- const [key2, ...rest] = path141;
21748
+ const [key2, ...rest] = path142;
21749
21749
  const node = this.get(key2, true);
21750
21750
  if (isCollection(node))
21751
21751
  node.addIn(rest, value);
@@ -21759,8 +21759,8 @@ var init_Collection = __esm({
21759
21759
  * Removes a value from the collection.
21760
21760
  * @returns `true` if the item was found and removed.
21761
21761
  */
21762
- deleteIn(path141) {
21763
- const [key2, ...rest] = path141;
21762
+ deleteIn(path142) {
21763
+ const [key2, ...rest] = path142;
21764
21764
  if (rest.length === 0)
21765
21765
  return this.delete(key2);
21766
21766
  const node = this.get(key2, true);
@@ -21774,8 +21774,8 @@ var init_Collection = __esm({
21774
21774
  * scalar values from their surrounding node; to disable set `keepScalar` to
21775
21775
  * `true` (collections are always returned intact).
21776
21776
  */
21777
- getIn(path141, keepScalar) {
21778
- const [key2, ...rest] = path141;
21777
+ getIn(path142, keepScalar) {
21778
+ const [key2, ...rest] = path142;
21779
21779
  const node = this.get(key2, true);
21780
21780
  if (rest.length === 0)
21781
21781
  return !keepScalar && isScalar(node) ? node.value : node;
@@ -21793,8 +21793,8 @@ var init_Collection = __esm({
21793
21793
  /**
21794
21794
  * Checks if the collection includes a value with the key `key`.
21795
21795
  */
21796
- hasIn(path141) {
21797
- const [key2, ...rest] = path141;
21796
+ hasIn(path142) {
21797
+ const [key2, ...rest] = path142;
21798
21798
  if (rest.length === 0)
21799
21799
  return this.has(key2);
21800
21800
  const node = this.get(key2, true);
@@ -21804,8 +21804,8 @@ var init_Collection = __esm({
21804
21804
  * Sets a value in this collection. For `!!set`, `value` needs to be a
21805
21805
  * boolean to add/remove the item from the set.
21806
21806
  */
21807
- setIn(path141, value) {
21808
- const [key2, ...rest] = path141;
21807
+ setIn(path142, value) {
21808
+ const [key2, ...rest] = path142;
21809
21809
  if (rest.length === 0) {
21810
21810
  this.set(key2, value);
21811
21811
  } else {
@@ -24274,9 +24274,9 @@ var init_Document = __esm({
24274
24274
  this.contents.add(value);
24275
24275
  }
24276
24276
  /** Adds a value to the document. */
24277
- addIn(path141, value) {
24277
+ addIn(path142, value) {
24278
24278
  if (assertCollection(this.contents))
24279
- this.contents.addIn(path141, value);
24279
+ this.contents.addIn(path142, value);
24280
24280
  }
24281
24281
  /**
24282
24282
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -24351,14 +24351,14 @@ var init_Document = __esm({
24351
24351
  * Removes a value from the document.
24352
24352
  * @returns `true` if the item was found and removed.
24353
24353
  */
24354
- deleteIn(path141) {
24355
- if (isEmptyPath(path141)) {
24354
+ deleteIn(path142) {
24355
+ if (isEmptyPath(path142)) {
24356
24356
  if (this.contents == null)
24357
24357
  return false;
24358
24358
  this.contents = null;
24359
24359
  return true;
24360
24360
  }
24361
- return assertCollection(this.contents) ? this.contents.deleteIn(path141) : false;
24361
+ return assertCollection(this.contents) ? this.contents.deleteIn(path142) : false;
24362
24362
  }
24363
24363
  /**
24364
24364
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -24373,10 +24373,10 @@ var init_Document = __esm({
24373
24373
  * scalar values from their surrounding node; to disable set `keepScalar` to
24374
24374
  * `true` (collections are always returned intact).
24375
24375
  */
24376
- getIn(path141, keepScalar) {
24377
- if (isEmptyPath(path141))
24376
+ getIn(path142, keepScalar) {
24377
+ if (isEmptyPath(path142))
24378
24378
  return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
24379
- return isCollection(this.contents) ? this.contents.getIn(path141, keepScalar) : void 0;
24379
+ return isCollection(this.contents) ? this.contents.getIn(path142, keepScalar) : void 0;
24380
24380
  }
24381
24381
  /**
24382
24382
  * Checks if the document includes a value with the key `key`.
@@ -24387,10 +24387,10 @@ var init_Document = __esm({
24387
24387
  /**
24388
24388
  * Checks if the document includes a value at `path`.
24389
24389
  */
24390
- hasIn(path141) {
24391
- if (isEmptyPath(path141))
24390
+ hasIn(path142) {
24391
+ if (isEmptyPath(path142))
24392
24392
  return this.contents !== void 0;
24393
- return isCollection(this.contents) ? this.contents.hasIn(path141) : false;
24393
+ return isCollection(this.contents) ? this.contents.hasIn(path142) : false;
24394
24394
  }
24395
24395
  /**
24396
24396
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -24407,13 +24407,13 @@ var init_Document = __esm({
24407
24407
  * Sets a value in this document. For `!!set`, `value` needs to be a
24408
24408
  * boolean to add/remove the item from the set.
24409
24409
  */
24410
- setIn(path141, value) {
24411
- if (isEmptyPath(path141)) {
24410
+ setIn(path142, value) {
24411
+ if (isEmptyPath(path142)) {
24412
24412
  this.contents = value;
24413
24413
  } else if (this.contents == null) {
24414
- this.contents = collectionFromPath(this.schema, Array.from(path141), value);
24414
+ this.contents = collectionFromPath(this.schema, Array.from(path142), value);
24415
24415
  } else if (assertCollection(this.contents)) {
24416
- this.contents.setIn(path141, value);
24416
+ this.contents.setIn(path142, value);
24417
24417
  }
24418
24418
  }
24419
24419
  /**
@@ -26337,15 +26337,15 @@ function visit2(cst, visitor) {
26337
26337
  cst = { start: cst.start, value: cst.value };
26338
26338
  _visit(Object.freeze([]), cst, visitor);
26339
26339
  }
26340
- function _visit(path141, item, visitor) {
26341
- let ctrl = visitor(item, path141);
26340
+ function _visit(path142, item, visitor) {
26341
+ let ctrl = visitor(item, path142);
26342
26342
  if (typeof ctrl === "symbol")
26343
26343
  return ctrl;
26344
26344
  for (const field2 of ["key", "value"]) {
26345
26345
  const token = item[field2];
26346
26346
  if (token && "items" in token) {
26347
26347
  for (let i = 0; i < token.items.length; ++i) {
26348
- const ci = _visit(Object.freeze(path141.concat([[field2, i]])), token.items[i], visitor);
26348
+ const ci = _visit(Object.freeze(path142.concat([[field2, i]])), token.items[i], visitor);
26349
26349
  if (typeof ci === "number")
26350
26350
  i = ci - 1;
26351
26351
  else if (ci === BREAK2)
@@ -26356,10 +26356,10 @@ function _visit(path141, item, visitor) {
26356
26356
  }
26357
26357
  }
26358
26358
  if (typeof ctrl === "function" && field2 === "key")
26359
- ctrl = ctrl(item, path141);
26359
+ ctrl = ctrl(item, path142);
26360
26360
  }
26361
26361
  }
26362
- return typeof ctrl === "function" ? ctrl(item, path141) : ctrl;
26362
+ return typeof ctrl === "function" ? ctrl(item, path142) : ctrl;
26363
26363
  }
26364
26364
  var BREAK2, SKIP2, REMOVE2;
26365
26365
  var init_cst_visit = __esm({
@@ -26371,9 +26371,9 @@ var init_cst_visit = __esm({
26371
26371
  visit2.BREAK = BREAK2;
26372
26372
  visit2.SKIP = SKIP2;
26373
26373
  visit2.REMOVE = REMOVE2;
26374
- visit2.itemAtPath = (cst, path141) => {
26374
+ visit2.itemAtPath = (cst, path142) => {
26375
26375
  let item = cst;
26376
- for (const [field2, index] of path141) {
26376
+ for (const [field2, index] of path142) {
26377
26377
  const tok = item?.[field2];
26378
26378
  if (tok && "items" in tok) {
26379
26379
  item = tok.items[index];
@@ -26382,9 +26382,9 @@ var init_cst_visit = __esm({
26382
26382
  }
26383
26383
  return item;
26384
26384
  };
26385
- visit2.parentCollection = (cst, path141) => {
26386
- const parent = visit2.itemAtPath(cst, path141.slice(0, -1));
26387
- const field2 = path141[path141.length - 1][0];
26385
+ visit2.parentCollection = (cst, path142) => {
26386
+ const parent = visit2.itemAtPath(cst, path142.slice(0, -1));
26387
+ const field2 = path142[path142.length - 1][0];
26388
26388
  const coll = parent?.[field2];
26389
26389
  if (coll && "items" in coll)
26390
26390
  return coll;
@@ -27691,14 +27691,14 @@ var init_parser = __esm({
27691
27691
  case "scalar":
27692
27692
  case "single-quoted-scalar":
27693
27693
  case "double-quoted-scalar": {
27694
- const fs116 = this.flowScalar(this.type);
27694
+ const fs117 = this.flowScalar(this.type);
27695
27695
  if (atNextItem || it.value) {
27696
- map2.items.push({ start, key: fs116, sep: [] });
27696
+ map2.items.push({ start, key: fs117, sep: [] });
27697
27697
  this.onKeyLine = true;
27698
27698
  } else if (it.sep) {
27699
- this.stack.push(fs116);
27699
+ this.stack.push(fs117);
27700
27700
  } else {
27701
- Object.assign(it, { key: fs116, sep: [] });
27701
+ Object.assign(it, { key: fs117, sep: [] });
27702
27702
  this.onKeyLine = true;
27703
27703
  }
27704
27704
  return;
@@ -27826,13 +27826,13 @@ var init_parser = __esm({
27826
27826
  case "scalar":
27827
27827
  case "single-quoted-scalar":
27828
27828
  case "double-quoted-scalar": {
27829
- const fs116 = this.flowScalar(this.type);
27829
+ const fs117 = this.flowScalar(this.type);
27830
27830
  if (!it || it.value)
27831
- fc.items.push({ start: [], key: fs116, sep: [] });
27831
+ fc.items.push({ start: [], key: fs117, sep: [] });
27832
27832
  else if (it.sep)
27833
- this.stack.push(fs116);
27833
+ this.stack.push(fs117);
27834
27834
  else
27835
- Object.assign(it, { key: fs116, sep: [] });
27835
+ Object.assign(it, { key: fs117, sep: [] });
27836
27836
  return;
27837
27837
  }
27838
27838
  case "flow-map-end":
@@ -30888,7 +30888,7 @@ var init_swift_submit = __esm({
30888
30888
  MAX_SWIFT_COMPILE_IMAGES = 256;
30889
30889
  MAX_SWIFT_COMPILE_IMAGE_BYTES = 4 * 1024 * 1024;
30890
30890
  MAX_SWIFT_COMPILE_IMAGE_TOTAL_BYTES = 16 * 1024 * 1024;
30891
- SWIFT_HOST_ABI = 71;
30891
+ SWIFT_HOST_ABI = 72;
30892
30892
  POLL_INTERVAL_MS = 1500;
30893
30893
  }
30894
30894
  });
@@ -33589,8 +33589,8 @@ function metadataValue(value, key2) {
33589
33589
  if (!value || typeof value !== "object") return void 0;
33590
33590
  return Object.getOwnPropertyDescriptor(value, key2)?.value;
33591
33591
  }
33592
- function readProjectJson(path141, files2 = nodeRepoFileReader) {
33593
- const text6 = readProjectMetadata(path141, files2);
33592
+ function readProjectJson(path142, files2 = nodeRepoFileReader) {
33593
+ const text6 = readProjectMetadata(path142, files2);
33594
33594
  if (text6 === null) return null;
33595
33595
  try {
33596
33596
  const value = JSON.parse(text6);
@@ -33680,17 +33680,17 @@ function readNativeProjectRenderer(dir, platform2, files2 = nodeRepoFileReader,
33680
33680
  declarations.push({ source, enabled: value === "true" });
33681
33681
  else throw new Error(`${source}: new architecture setting must be true or false`);
33682
33682
  };
33683
- const json = (path141) => {
33684
- const text6 = readProjectMetadata((0, import_node_path13.join)(dir, path141), files2);
33683
+ const json = (path142) => {
33684
+ const text6 = readProjectMetadata((0, import_node_path13.join)(dir, path142), files2);
33685
33685
  if (text6 === null) {
33686
- if (files2.exists((0, import_node_path13.join)(dir, path141)))
33687
- throw new Error(`${path141}: unreadable native metadata`);
33686
+ if (files2.exists((0, import_node_path13.join)(dir, path142)))
33687
+ throw new Error(`${path142}: unreadable native metadata`);
33688
33688
  return void 0;
33689
33689
  }
33690
33690
  try {
33691
33691
  return JSON.parse(text6);
33692
33692
  } catch {
33693
- throw new Error(`${path141}: malformed native metadata`);
33693
+ throw new Error(`${path142}: malformed native metadata`);
33694
33694
  }
33695
33695
  };
33696
33696
  if (appJson) {
@@ -34296,7 +34296,7 @@ function scanLocalNative(appDir, pkg, answered, platform2, knownPackages = /* @_
34296
34296
  expoModule: moduleDir ? (0, import_node_path14.relative)(appDir, moduleDir) || "." : null,
34297
34297
  optional: optional3,
34298
34298
  swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
34299
- (path141) => path141.endsWith(".swift") && [...(readSmallFile(path141) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
34299
+ (path142) => path142.endsWith(".swift") && [...(readSmallFile(path142) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
34300
34300
  (match) => match[1] === name3
34301
34301
  )
34302
34302
  ) : false,
@@ -36334,10 +36334,10 @@ function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
36334
36334
  }
36335
36335
  function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri) {
36336
36336
  const pbxprojPath = Object.keys(files2).find(
36337
- (path141) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path141)
36337
+ (path142) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path142)
36338
36338
  ) ?? Object.keys(files2).find(
36339
- (path141) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path141)
36340
- ) ?? Object.keys(files2).find((path141) => /(?:^|\/)project\.pbxproj$/.test(path141));
36339
+ (path142) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path142)
36340
+ ) ?? Object.keys(files2).find((path142) => /(?:^|\/)project\.pbxproj$/.test(path142));
36341
36341
  if (!pbxprojPath) return null;
36342
36342
  const pbxproj = files2[pbxprojPath];
36343
36343
  let objects = {};
@@ -36379,7 +36379,7 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
36379
36379
  } else if (applicationTargetNames.size === 1) {
36380
36380
  targetName = [...applicationTargetNames][0];
36381
36381
  } else if (applicationTargetNames.size > 1) {
36382
- const delegateTargets = Object.keys(files2).filter((path141) => !path141.includes("/Pods/")).map((path141) => path141.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
36382
+ const delegateTargets = Object.keys(files2).filter((path142) => !path142.includes("/Pods/")).map((path142) => path142.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
36383
36383
  (name3) => typeof name3 === "string" && applicationTargetNames.has(name3)
36384
36384
  );
36385
36385
  if (delegateTargets.length === 1) {
@@ -36620,7 +36620,7 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
36620
36620
  if (Object.hasOwn(files2, file)) return [file];
36621
36621
  const prefix = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
36622
36622
  return paths.filter(
36623
- (path141) => path141.startsWith(prefix) && !/(?:^|\/)\./.test(path141.slice(prefix.length))
36623
+ (path142) => path142.startsWith(prefix) && !/(?:^|\/)\./.test(path142.slice(prefix.length))
36624
36624
  );
36625
36625
  },
36626
36626
  join33,
@@ -36631,7 +36631,7 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
36631
36631
  }
36632
36632
  const rootModuleName = readRootModuleName(
36633
36633
  Object.entries(files2).filter(
36634
- ([path141]) => !path141.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path141) || path141.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
36634
+ ([path142]) => !path142.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path142) || path142.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
36635
36635
  ).map(([, source]) => source)
36636
36636
  );
36637
36637
  return {
@@ -37022,8 +37022,8 @@ export *
37022
37022
  }`;
37023
37023
  }
37024
37024
  function swiftPackageIdentity(url) {
37025
- const path141 = url.endsWith("/") ? url.slice(0, -1) : url;
37026
- return (path141.split("/").pop() ?? path141).replace(/\.git$/, "").toLowerCase();
37025
+ const path142 = url.endsWith("/") ? url.slice(0, -1) : url;
37026
+ return (path142.split("/").pop() ?? path142).replace(/\.git$/, "").toLowerCase();
37027
37027
  }
37028
37028
  function clangSettingEntries(settings, tool) {
37029
37029
  return (settings ?? []).flatMap(
@@ -37724,14 +37724,14 @@ function addAsset(into, asset) {
37724
37724
  function checkStack(dir, type, devices2) {
37725
37725
  const sets = (parent, allowed) => (0, import_node_fs29.readdirSync)(parent, { withFileTypes: true }).flatMap((entry) => {
37726
37726
  if (entry.name.startsWith(".") || entry.isFile()) return [];
37727
- const path141 = (0, import_node_path25.join)(parent, entry.name);
37727
+ const path142 = (0, import_node_path25.join)(parent, entry.name);
37728
37728
  const extension = (0, import_node_path25.extname)(entry.name);
37729
37729
  if (!entry.isDirectory() || !allowed.includes(extension))
37730
37730
  return refuse(
37731
- path141,
37731
+ path142,
37732
37732
  `image stack content other than ${allowed.join(", ")} is unproven`
37733
37733
  );
37734
- return [{ path: path141, extension }];
37734
+ return [{ path: path142, extension }];
37735
37735
  });
37736
37736
  for (const layer of sets(dir, [`.${type}layer`, ".imageset", ".colorset"])) {
37737
37737
  if (layer.extension !== `.${type}layer`) continue;
@@ -37743,37 +37743,37 @@ function checkStack(dir, type, devices2) {
37743
37743
  function walk(dir, into, devices2, extensions) {
37744
37744
  for (const entry of (0, import_node_fs29.readdirSync)(dir, { withFileTypes: true })) {
37745
37745
  if (entry.name.startsWith(".") || entry.isFile()) continue;
37746
- const path141 = (0, import_node_path25.join)(dir, entry.name);
37747
- if (!entry.isDirectory()) return refuse(path141, "it is neither a file nor a directory");
37746
+ const path142 = (0, import_node_path25.join)(dir, entry.name);
37747
+ if (!entry.isDirectory()) return refuse(path142, "it is neither a file nor a directory");
37748
37748
  const extension = (0, import_node_path25.extname)(entry.name).slice(1);
37749
37749
  const type = extension.toLowerCase();
37750
37750
  const base = entry.name.slice(0, entry.name.length - extension.length - 1);
37751
37751
  if (type !== extension && knownTypes.has(type))
37752
- return refuse(path141, "its type extension is not lowercase");
37752
+ return refuse(path142, "its type extension is not lowercase");
37753
37753
  if (type === "colorset" || type === "imageset" || type === "symbolset") {
37754
37754
  addAsset(into, {
37755
37755
  kind: type === "colorset" ? "color" : "image",
37756
37756
  name: base,
37757
- ...assetState(path141, type, devices2),
37757
+ ...assetState(path142, type, devices2),
37758
37758
  extensions,
37759
- source: path141
37759
+ source: path142
37760
37760
  });
37761
37761
  continue;
37762
37762
  }
37763
37763
  if (silentTypes.has(type)) continue;
37764
37764
  if (stackTypes.has(type)) {
37765
- checkStack(path141, type, devices2);
37765
+ checkStack(path142, type, devices2);
37766
37766
  continue;
37767
37767
  }
37768
- if (unprovenTypes.has(type)) return refuse(path141, `${type} assets are unproven`);
37768
+ if (unprovenTypes.has(type)) return refuse(path142, `${type} assets are unproven`);
37769
37769
  const name3 = type === "spriteatlas" ? base : entry.name;
37770
- if (!folderProperties((0, import_node_path25.join)(path141, "Contents.json")).namespace) {
37771
- walk(path141, into, devices2, extensions);
37770
+ if (!folderProperties((0, import_node_path25.join)(path142, "Contents.json")).namespace) {
37771
+ walk(path142, into, devices2, extensions);
37772
37772
  continue;
37773
37773
  }
37774
- const child = into.namespaces.get(name3) ?? scope(path141);
37774
+ const child = into.namespaces.get(name3) ?? scope(path142);
37775
37775
  into.namespaces.set(name3, child);
37776
- walk(path141, child, devices2, extensions);
37776
+ walk(path142, child, devices2, extensions);
37777
37777
  }
37778
37778
  }
37779
37779
  function words(name3) {
@@ -37820,11 +37820,11 @@ function members(into, kind, prefix, extensions) {
37820
37820
  const assets2 = /* @__PURE__ */ new Set();
37821
37821
  const out = [];
37822
37822
  for (const entry of entries) {
37823
- const path141 = `${prefix}${entry.name}`;
37823
+ const path142 = `${prefix}${entry.name}`;
37824
37824
  const source = entry.child ? entry.child.source : entry.asset.source;
37825
37825
  if (Array.from(entry.name).some((char) => char.charCodeAt(0) > 127))
37826
37826
  refuse(source, "its name is not ASCII");
37827
- const named = (text7) => `The \\"${escape(path141)}\\" ${text7}`;
37827
+ const named = (text7) => `The \\"${escape(path142)}\\" ${text7}`;
37828
37828
  if (entry.child) {
37829
37829
  const text7 = symbol(entry.name, true);
37830
37830
  if (!text7)
@@ -37847,9 +37847,9 @@ function members(into, kind, prefix, extensions) {
37847
37847
  namespaces.add(text7);
37848
37848
  out.push({
37849
37849
  type: "namespace",
37850
- path: path141,
37850
+ path: path142,
37851
37851
  symbol: spelled(text7),
37852
- members: members(entry.child, kind, `${path141}/`, extensions)
37852
+ members: members(entry.child, kind, `${path142}/`, extensions)
37853
37853
  });
37854
37854
  }
37855
37855
  continue;
@@ -37876,7 +37876,7 @@ function members(into, kind, prefix, extensions) {
37876
37876
  else if (!omitted)
37877
37877
  out.push({
37878
37878
  type: "asset",
37879
- path: path141,
37879
+ path: path142,
37880
37880
  name: entry.name,
37881
37881
  symbol: spelled(text6),
37882
37882
  thinnable: asset.thinnable,
@@ -38158,8 +38158,8 @@ var init_xcode_asset_symbols = __esm({
38158
38158
  import_node_path25 = require("node:path");
38159
38159
  Refusal = class extends Error {
38160
38160
  };
38161
- refuse = (path141, reason) => {
38162
- throw new Refusal(`Generated asset symbols are unproven for ${path141}: ${reason}`);
38161
+ refuse = (path142, reason) => {
38162
+ throw new Refusal(`Generated asset symbols are unproven for ${path142}: ${reason}`);
38163
38163
  };
38164
38164
  isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
38165
38165
  scope = (source) => ({
@@ -38605,11 +38605,11 @@ function catalogDigest(directory2) {
38605
38605
  for (const entry of (0, import_node_fs30.readdirSync)(dir, { withFileTypes: true }).sort(
38606
38606
  (a, b) => a.name.localeCompare(b.name)
38607
38607
  )) {
38608
- const path141 = (0, import_node_path26.join)(dir, entry.name);
38609
- if (entry.isDirectory()) walk3(path141);
38610
- else if (entry.isFile() && (0, import_node_fs30.statSync)(path141).size <= 64 * 1024 * 1024)
38611
- hashes.push([(0, import_node_path26.relative)(directory2, path141), sha2562((0, import_node_fs30.readFileSync)(path141))]);
38612
- else throw new Error(`Unsupported asset catalog entry: ${path141}`);
38608
+ const path142 = (0, import_node_path26.join)(dir, entry.name);
38609
+ if (entry.isDirectory()) walk3(path142);
38610
+ else if (entry.isFile() && (0, import_node_fs30.statSync)(path142).size <= 64 * 1024 * 1024)
38611
+ hashes.push([(0, import_node_path26.relative)(directory2, path142), sha2562((0, import_node_fs30.readFileSync)(path142))]);
38612
+ else throw new Error(`Unsupported asset catalog entry: ${path142}`);
38613
38613
  }
38614
38614
  };
38615
38615
  walk3(directory2);
@@ -38620,7 +38620,7 @@ function symbolSource(plan, root) {
38620
38620
  const known = symbolTexts.get(key2);
38621
38621
  if (known !== void 0) return { status: "source", text: known };
38622
38622
  const source = assetSymbolSource(
38623
- plan.catalogs.map(({ path: path141 }) => (0, import_node_path26.join)(root, path141)),
38623
+ plan.catalogs.map(({ path: path142 }) => (0, import_node_path26.join)(root, path142)),
38624
38624
  plan.settings
38625
38625
  );
38626
38626
  if (source.status === "source") symbolTexts.set(key2, source.text);
@@ -38679,9 +38679,9 @@ function planAssetSymbols(resources, root, settings) {
38679
38679
  `Generated asset symbols are proven only for TARGETED_DEVICE_FAMILY 1, 2, 1,2, 1,7, 1,3,7, 1,2,6 or 1,2,7; this target resolves to "${families}".`
38680
38680
  );
38681
38681
  const plan = {
38682
- catalogs: catalogs.map((path141) => ({
38683
- path: path141,
38684
- sha256: catalogDigest((0, import_node_path26.join)(root, path141))
38682
+ catalogs: catalogs.map((path142) => ({
38683
+ path: path142,
38684
+ sha256: catalogDigest((0, import_node_path26.join)(root, path142))
38685
38685
  })),
38686
38686
  settings: { deployment: target, devices: devices2, extensions: extensions === "YES" }
38687
38687
  };
@@ -43801,10 +43801,10 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
43801
43801
  const enclosing = scopes.length > 0 ? scopes[scopes.length - 1].prefix : [];
43802
43802
  if (scope2?.[3] === "enum" && opens > 0 && /(^|\s)(public|open)\s/.test(scope2[2] ?? "") && !/\bwhere\b/.test(first.masked) && first.masked[scope2.index + scope2[0].length] !== "<") {
43803
43803
  const name3 = scope2[4];
43804
- const path141 = scopeOf(name3, enclosing, false);
43805
- if (!byPath.has(path141.join(".")) && (path141.length === 1 || byPath.has(path141.slice(0, -1).join(".")))) {
43804
+ const path142 = scopeOf(name3, enclosing, false);
43805
+ if (!byPath.has(path142.join(".")) && (path142.length === 1 || byPath.has(path142.slice(0, -1).join(".")))) {
43806
43806
  const keptAttrs = [...(scope2[1] ?? "").matchAll(/@\w+(?:\([^)]*\))?/g)].map((attr) => attr[0]).filter((attr) => !attr.startsWith("@objc"));
43807
- const id = `s:peach-synthesized-${module2}-${path141.join(".")}`;
43807
+ const id = `s:peach-synthesized-${module2}-${path142.join(".")}`;
43808
43808
  const body = [];
43809
43809
  let inner = 1;
43810
43810
  let closed = false;
@@ -43859,15 +43859,15 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
43859
43859
  symbols.push({
43860
43860
  kind: { identifier: "swift.enum" },
43861
43861
  identifier: { precise: id },
43862
- pathComponents: path141,
43862
+ pathComponents: path142,
43863
43863
  declarationFragments: fragments,
43864
43864
  accessLevel: "public"
43865
43865
  });
43866
- if (path141.length > 1)
43866
+ if (path142.length > 1)
43867
43867
  relationships.push({
43868
43868
  kind: "memberOf",
43869
43869
  source: id,
43870
- target: byPath.get(path141.slice(0, -1).join("."))
43870
+ target: byPath.get(path142.slice(0, -1).join("."))
43871
43871
  });
43872
43872
  for (const kase of cases) {
43873
43873
  const memberId = `${id}-${kase.leaf}`;
@@ -43876,7 +43876,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
43876
43876
  symbols.push({
43877
43877
  kind: { identifier: "swift.enum.case" },
43878
43878
  identifier: { precise: memberId },
43879
- pathComponents: [...path141, kase.leaf],
43879
+ pathComponents: [...path142, kase.leaf],
43880
43880
  declarationFragments: [
43881
43881
  { kind: "keyword", spelling: "case" },
43882
43882
  { kind: "text", spelling: " " },
@@ -43892,7 +43892,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
43892
43892
  symbols.push({
43893
43893
  kind: { identifier: "swift.init" },
43894
43894
  identifier: { precise: initId },
43895
- pathComponents: [...path141, "init(rawValue:)"],
43895
+ pathComponents: [...path142, "init(rawValue:)"],
43896
43896
  declarationFragments: [
43897
43897
  { kind: "keyword", spelling: "init" },
43898
43898
  { kind: "text", spelling: "?(" },
@@ -43961,7 +43961,7 @@ function emitSwiftStandin(sourceGraphs, options) {
43961
43961
  })
43962
43962
  )
43963
43963
  );
43964
- const trap = (path141) => `fatalError("${path141} is ${options.placeholder === void 0 ? "a binary framework" : "a placeholder"} peach cannot run")`;
43964
+ const trap = (path142) => `fatalError("${path142} is ${options.placeholder === void 0 ? "a binary framework" : "a placeholder"} peach cannot run")`;
43965
43965
  const skipped = [];
43966
43966
  const behavior = options.behavior ?? /* @__PURE__ */ new Map();
43967
43967
  const used = /* @__PURE__ */ new Set();
@@ -44311,34 +44311,34 @@ function emitSwiftStandin(sourceGraphs, options) {
44311
44311
  lines.push(...physical);
44312
44312
  owners.push(...physical.map(() => current2));
44313
44313
  };
44314
- const emitAt = (path141, line) => {
44315
- if (omit.has(path141)) return;
44314
+ const emitAt = (path142, line) => {
44315
+ if (omit.has(path142)) return;
44316
44316
  const previous = current2;
44317
- current2 = path141;
44317
+ current2 = path142;
44318
44318
  emit(line);
44319
44319
  current2 = previous;
44320
44320
  };
44321
44321
  const emitInertState = (id, indent2, build2) => {
44322
- const path141 = pathOf(byId.get(id));
44322
+ const path142 = pathOf(byId.get(id));
44323
44323
  emitAt(hiddenInit(id), `${indent2}init(_peachInert: Void) { ${build2} }`);
44324
44324
  const list2 = conforms.get(id) ?? [];
44325
44325
  const has = (name3) => (children.get(id) ?? []).some((member) => leaf(member) === name3);
44326
44326
  if (list2.includes("Encodable") && !has("encode(to:)"))
44327
44327
  emitAt(
44328
- `${path141}.encode(to:)`,
44328
+ `${path142}.encode(to:)`,
44329
44329
  `${indent2}public func encode(to encoder: Encoder) throws {}`
44330
44330
  );
44331
44331
  if (list2.includes("Decodable") && !has("init(from:)"))
44332
44332
  emitAt(
44333
- `${path141}.init(from:)`,
44333
+ `${path142}.init(from:)`,
44334
44334
  `${indent2}public init(from decoder: Decoder) throws { self.init(_peachInert: ()) }`
44335
44335
  );
44336
44336
  };
44337
44337
  const scoped = (body) => (symbol2, ...rest) => {
44338
- const path141 = pathOf(symbol2);
44339
- if (omit.has(path141)) return void skipped.push({ path: path141, reason: omit.get(path141) });
44338
+ const path142 = pathOf(symbol2);
44339
+ if (omit.has(path142)) return void skipped.push({ path: path142, reason: omit.get(path142) });
44340
44340
  const previous = current2;
44341
- current2 = path141;
44341
+ current2 = path142;
44342
44342
  try {
44343
44343
  body(symbol2, ...rest);
44344
44344
  } finally {
@@ -44370,7 +44370,7 @@ function emitSwiftStandin(sourceGraphs, options) {
44370
44370
  };
44371
44371
  const emitMember = scoped(
44372
44372
  (member, indent2, context) => {
44373
- const path141 = pathOf(member);
44373
+ const path142 = pathOf(member);
44374
44374
  if (TYPE_KINDS.has(member.kind.identifier)) {
44375
44375
  const origin = origins.get(member.identifier.precise)?.split(".")[0];
44376
44376
  const parent = owner.get(member.identifier.precise);
@@ -44387,7 +44387,7 @@ function emitSwiftStandin(sourceGraphs, options) {
44387
44387
  ))
44388
44388
  return;
44389
44389
  if (!MEMBER_KINDS.has(member.kind.identifier)) {
44390
- skipped.push({ path: path141, reason: `unhandled ${member.kind.identifier}` });
44390
+ skipped.push({ path: path142, reason: `unhandled ${member.kind.identifier}` });
44391
44391
  return;
44392
44392
  }
44393
44393
  const { 1: spelledAttrs, 2: rest } = LEADING_ATTRS.exec(text(member));
@@ -44395,15 +44395,15 @@ function emitSwiftStandin(sourceGraphs, options) {
44395
44395
  /@(\w+)(?:\([^)]*\))?\s*/g,
44396
44396
  (attr, name3) => typeByPath.has(name3) ? "" : attr
44397
44397
  ) : spelledAttrs;
44398
- const attrs = options.unobjc?.has(path141) ? wrapped.replace(/@objc(?:\([^)]*\))?\s*/g, "") : wrapped;
44398
+ const attrs = options.unobjc?.has(path142) ? wrapped.replace(/@objc(?:\([^)]*\))?\s*/g, "") : wrapped;
44399
44399
  const modifiers = /^((?:(?:required|final|override|convenience|unowned(?:\(\w+\))?|weak|lazy|nonisolated|mutating|nonmutating) )*)(.*)$/s.exec(
44400
44400
  rest
44401
44401
  );
44402
44402
  const flags = new Set(
44403
44403
  modifiers[1].trim().split(/\s+/).filter(Boolean).map((flag) => flag.replace(/\(.*/, ""))
44404
44404
  );
44405
- const requiredInit = context.inClass && !!options.requiredInits?.has(path141);
44406
- const restatesRequired = context.inClass && path141.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
44405
+ const requiredInit = context.inClass && !!options.requiredInits?.has(path142);
44406
+ const restatesRequired = context.inClass && path142.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
44407
44407
  (at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
44408
44408
  );
44409
44409
  const protocolInit = member.kind.identifier === "swift.init" && /^c:objc\(pl\)\w+\(im\).*::SYNTHESIZED::c:objc\(cs\)/.test(
@@ -44413,12 +44413,12 @@ function emitSwiftStandin(sourceGraphs, options) {
44413
44413
  const final = context.inClass && flags.has("final") ? "final " : "";
44414
44414
  const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
44415
44415
  let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
44416
- const override = context.inClass && !options.plain?.has(path141) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path141) || isObjC(member) && path141.endsWith(".init()")) ? "override " : "";
44416
+ const override = context.inClass && !options.plain?.has(path142) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path142) || isObjC(member) && path142.endsWith(".init()")) ? "override " : "";
44417
44417
  const head = `${indent2}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
44418
- const measured = behavior.get(path141);
44419
- if (measured) used.add(path141);
44418
+ const measured = behavior.get(path142);
44419
+ if (measured) used.add(path142);
44420
44420
  const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
44421
- const body = overloadBody ?? measured?.body ?? (options.inert ? inertBody(member) : trap(path141));
44421
+ const body = overloadBody ?? measured?.body ?? (options.inert ? inertBody(member) : trap(path142));
44422
44422
  switch (member.kind.identifier) {
44423
44423
  case "swift.property":
44424
44424
  case "swift.type.property":
@@ -44431,13 +44431,13 @@ function emitSwiftStandin(sourceGraphs, options) {
44431
44431
  const parameter = !measured && !options.inert && !settable && /:\s*some\s/.test(decl) ? opaqueParameter(member) : void 0;
44432
44432
  const getter = parameter ? `return ({ () -> ${parameter} in ${body} })()` : body;
44433
44433
  const computed = decl.replace(/^((?:static |class )*)let /, "$1var ");
44434
- const wrapper = options.projections?.get(path141);
44434
+ const wrapper = options.projections?.get(path142);
44435
44435
  if (wrapper) {
44436
44436
  const type = /^var\s+`?\w+`?\s*:\s*(.+)$/s.exec(computed)?.[1];
44437
- const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [path141]);
44437
+ const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [path142]);
44438
44438
  if (!initial)
44439
44439
  return void skipped.push({
44440
- path: path141,
44440
+ path: path142,
44441
44441
  reason: `wrapped by ${wrapper} with no inert initial value`
44442
44442
  });
44443
44443
  const own = new RegExp(
@@ -44458,7 +44458,7 @@ function emitSwiftStandin(sourceGraphs, options) {
44458
44458
  return;
44459
44459
  }
44460
44460
  emit(
44461
- `${head}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options.inert ? "" : trap(path141))} }` : ""} }`
44461
+ `${head}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options.inert ? "" : trap(path142))} }` : ""} }`
44462
44462
  );
44463
44463
  return;
44464
44464
  }
@@ -44517,7 +44517,7 @@ function emitSwiftStandin(sourceGraphs, options) {
44517
44517
  };
44518
44518
  const emitType = scoped(
44519
44519
  (symbol2, indent2) => {
44520
- const path141 = pathOf(symbol2);
44520
+ const path142 = pathOf(symbol2);
44521
44521
  const id = symbol2.identifier.precise;
44522
44522
  const inner = `${indent2} `;
44523
44523
  switch (symbol2.kind.identifier) {
@@ -44534,10 +44534,10 @@ function emitSwiftStandin(sourceGraphs, options) {
44534
44534
  case "swift.class": {
44535
44535
  const shape = header(symbol2, "class", indent2);
44536
44536
  if (!shape)
44537
- return void skipped.push({ path: path141, reason: `unparsed class ${text(symbol2)}` });
44538
- const parent = options.superclasses?.get(path141) ?? superclass.get(id);
44537
+ return void skipped.push({ path: path142, reason: `unparsed class ${text(symbol2)}` });
44538
+ const parent = options.superclasses?.get(path142) ?? superclass.get(id);
44539
44539
  const blocked = classBlocked(id);
44540
- if (blocked) return void skipped.push({ path: path141, reason: blocked });
44540
+ if (blocked) return void skipped.push({ path: path142, reason: blocked });
44541
44541
  const ancestors = /* @__PURE__ */ new Set();
44542
44542
  const inherited = /* @__PURE__ */ new Set();
44543
44543
  for (let at = superId.get(id); at; at = superId.get(at)) {
@@ -44553,7 +44553,7 @@ function emitSwiftStandin(sourceGraphs, options) {
44553
44553
  "Equatable",
44554
44554
  "CustomStringConvertible",
44555
44555
  "CustomDebugStringConvertible"
44556
- ].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options.unconformed?.get(path141)?.has(name3.split(/::|\./).pop()) && !options.unconformed?.get(path141)?.has(name3)
44556
+ ].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options.unconformed?.get(path142)?.has(name3.split(/::|\./).pop()) && !options.unconformed?.get(path142)?.has(name3)
44557
44557
  )
44558
44558
  ].filter((name3, at, all2) => all2.indexOf(name3) === at);
44559
44559
  const parentSymbol = superId.has(id) ? byId.get(superId.get(id)) : void 0;
@@ -44565,9 +44565,9 @@ function emitSwiftStandin(sourceGraphs, options) {
44565
44565
  `${indent2}${shape.attrs}${objcName ? `@objc(${objcName}) ` : ""}${shape.final}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
44566
44566
  );
44567
44567
  const members2 = membersOf(id);
44568
- const extra = options.behavior?.get(path141)?.members;
44568
+ const extra = options.behavior?.get(path142)?.members;
44569
44569
  if (extra) {
44570
- used.add(path141);
44570
+ used.add(path142);
44571
44571
  emit(`${inner}${extra}`);
44572
44572
  }
44573
44573
  for (const member of members2)
@@ -44623,11 +44623,11 @@ function emitSwiftStandin(sourceGraphs, options) {
44623
44623
  if (protocol && member.kind.identifier === "swift.method" && leaf(member).endsWith("()") && have.has(`instance|leaf|${leaf(member).slice(0, -2)}`))
44624
44624
  propertyWitnesses.push({
44625
44625
  owner: current2,
44626
- head: `extension ${pathOf(protocol)} where Self: ${path141} {`,
44626
+ head: `extension ${pathOf(protocol)} where Self: ${path142} {`,
44627
44627
  member,
44628
- path: path141
44628
+ path: path142
44629
44629
  });
44630
- else emitWitness(member, inner, path141, open && isObjC(member));
44630
+ else emitWitness(member, inner, path142, open && isObjC(member));
44631
44631
  }
44632
44632
  }
44633
44633
  if (options.inert && designated2 && classBuild(id) === "hidden")
@@ -44635,13 +44635,13 @@ function emitSwiftStandin(sourceGraphs, options) {
44635
44635
  const coder = members2.some((member) => leaf(member) === "init(coder:)");
44636
44636
  if (designated2 && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
44637
44637
  emit(
44638
- `${inner}public required init${options.coderNonfailable?.has(path141) ? "" : "?"}(coder: NSCoder) { ${options.inert && !options.coderNonfailable?.has(path141) ? "return nil" : trap(`${path141}.init(coder:)`)} }`
44638
+ `${inner}public required init${options.coderNonfailable?.has(path142) ? "" : "?"}(coder: NSCoder) { ${options.inert && !options.coderNonfailable?.has(path142) ? "return nil" : trap(`${path142}.init(coder:)`)} }`
44639
44639
  );
44640
44640
  if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
44641
44641
  (at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
44642
44642
  ))
44643
44643
  emit(
44644
- `${inner}public required init() { ${options.inert ? superInit(id) : trap(`${path141}.init()`)} }`
44644
+ `${inner}public required init() { ${options.inert ? superInit(id) : trap(`${path142}.init()`)} }`
44645
44645
  );
44646
44646
  emit(`${indent2}}`);
44647
44647
  return;
@@ -44649,7 +44649,7 @@ function emitSwiftStandin(sourceGraphs, options) {
44649
44649
  case "swift.struct": {
44650
44650
  const shape = header(symbol2, "struct", indent2);
44651
44651
  if (!shape)
44652
- return void skipped.push({ path: path141, reason: `unparsed struct ${text(symbol2)}` });
44652
+ return void skipped.push({ path: path142, reason: `unparsed struct ${text(symbol2)}` });
44653
44653
  const members2 = membersOf(id);
44654
44654
  const raw2 = rawType(members2);
44655
44655
  const list2 = inheritance(id);
@@ -44689,7 +44689,7 @@ function emitSwiftStandin(sourceGraphs, options) {
44689
44689
  emitInertState(
44690
44690
  id,
44691
44691
  inner,
44692
- raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [path141]) ?? "0"}` : ""
44692
+ raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [path142]) ?? "0"}` : ""
44693
44693
  );
44694
44694
  emit(`${indent2}}`);
44695
44695
  return;
@@ -44697,7 +44697,7 @@ function emitSwiftStandin(sourceGraphs, options) {
44697
44697
  case "swift.enum": {
44698
44698
  const shape = header(symbol2, "enum", indent2);
44699
44699
  if (!shape)
44700
- return void skipped.push({ path: path141, reason: `unparsed enum ${text(symbol2)}` });
44700
+ return void skipped.push({ path: path142, reason: `unparsed enum ${text(symbol2)}` });
44701
44701
  const members2 = membersOf(id);
44702
44702
  const cases = members2.filter(
44703
44703
  (member) => member.kind.identifier === "swift.enum.case"
@@ -44707,7 +44707,7 @@ function emitSwiftStandin(sourceGraphs, options) {
44707
44707
  const missing2 = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
44708
44708
  if (raw2 && (isObjC(symbol2) || /^c:@C?M@[^@]+@E@/.test(id)) && missing2.length > 0)
44709
44709
  return void skipped.push({
44710
- path: path141,
44710
+ path: path142,
44711
44711
  reason: `no header value for ${missing2.map(leaf).join(", ")}`
44712
44712
  });
44713
44713
  const list2 = inheritance(id, raw2 ?? void 0).filter(
@@ -44746,8 +44746,8 @@ function emitSwiftStandin(sourceGraphs, options) {
44746
44746
  });
44747
44747
  }
44748
44748
  if (options.inert) {
44749
- const value = options.trapped?.has(hiddenInit(id)) ? null : inertValue(path141, /* @__PURE__ */ new Set(), []);
44750
- emitInertState(id, inner, value === null ? trap(path141) : `self = ${value}`);
44749
+ const value = options.trapped?.has(hiddenInit(id)) ? null : inertValue(path142, /* @__PURE__ */ new Set(), []);
44750
+ emitInertState(id, inner, value === null ? trap(path142) : `self = ${value}`);
44751
44751
  }
44752
44752
  emit(`${indent2}}`);
44753
44753
  return;
@@ -44756,14 +44756,14 @@ function emitSwiftStandin(sourceGraphs, options) {
44756
44756
  const shape = header(symbol2, "protocol", indent2);
44757
44757
  if (!shape)
44758
44758
  return void skipped.push({
44759
- path: path141,
44759
+ path: path142,
44760
44760
  reason: `unparsed protocol ${text(symbol2)}`
44761
44761
  });
44762
44762
  const native = nativeObjcProtocols.has(id);
44763
44763
  const objcName = native ? /^c:objc\(pl\)(\w+)$/.exec(id)?.[1] : void 0;
44764
44764
  if (native && !objcName)
44765
44765
  return void skipped.push({
44766
- path: path141,
44766
+ path: path142,
44767
44767
  reason: `unknown Objective-C protocol identity ${id}`
44768
44768
  });
44769
44769
  const list2 = [
@@ -44791,7 +44791,7 @@ function emitSwiftStandin(sourceGraphs, options) {
44791
44791
  }
44792
44792
  emit(`${indent2}}`);
44793
44793
  if (defaults.length > 0) {
44794
- emit(`${indent2}extension ${path141} {`);
44794
+ emit(`${indent2}extension ${path142} {`);
44795
44795
  for (const member of defaults) {
44796
44796
  const decl = text(member);
44797
44797
  if (optional3.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
@@ -44885,7 +44885,7 @@ function emitSwiftStandin(sourceGraphs, options) {
44885
44885
  return null;
44886
44886
  };
44887
44887
  const emitGlobal = scoped((symbol2) => {
44888
- const path141 = pathOf(symbol2);
44888
+ const path142 = pathOf(symbol2);
44889
44889
  const kind = symbol2.kind.identifier;
44890
44890
  if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
44891
44891
  const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(symbol2));
@@ -44894,20 +44894,20 @@ function emitSwiftStandin(sourceGraphs, options) {
44894
44894
  if (leaf(symbol2).endsWith("(_:)") && !/^(?:prefix|infix|postfix)\b/.test(spelled2))
44895
44895
  spelled2 = `prefix ${spelled2}`;
44896
44896
  }
44897
- const measured = behavior.get(path141);
44898
- if (measured) used.add(path141);
44897
+ const measured = behavior.get(path142);
44898
+ if (measured) used.add(path142);
44899
44899
  const overloadBody = /\basync\b/.test(spelled2) ? measured?.asyncBody : /\bResult</.test(spelled2) ? measured?.resultBody : void 0;
44900
44900
  emit(
44901
- `${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options.inert ? inertBody(symbol2) : trap(path141))} }`
44901
+ `${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options.inert ? inertBody(symbol2) : trap(path142))} }`
44902
44902
  );
44903
44903
  } else if (kind === "swift.var") {
44904
44904
  const parsed = splitAccessors(text(symbol2).replace(/^let /, "var "));
44905
- const measured = behavior.get(path141);
44906
- if (measured) used.add(path141);
44905
+ const measured = behavior.get(path142);
44906
+ if (measured) used.add(path142);
44907
44907
  emit(
44908
- `public ${parsed.decl} { ${measured?.body ?? (options.inert ? inertBody(symbol2) : trap(path141))} }`
44908
+ `public ${parsed.decl} { ${measured?.body ?? (options.inert ? inertBody(symbol2) : trap(path142))} }`
44909
44909
  );
44910
- } else skipped.push({ path: path141, reason: `unhandled top-level ${kind}` });
44910
+ } else skipped.push({ path: path142, reason: `unhandled top-level ${kind}` });
44911
44911
  });
44912
44912
  const cExports = new Set(
44913
44913
  [...byId.values()].flatMap((symbol2) => {
@@ -44924,7 +44924,7 @@ function emitSwiftStandin(sourceGraphs, options) {
44924
44924
  return !name3 || !cExports.has(`${name3}|${text(symbol2)}`);
44925
44925
  }).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
44926
44926
  for (const symbol2 of roots) {
44927
- const path141 = pathOf(symbol2);
44927
+ const path142 = pathOf(symbol2);
44928
44928
  if (TYPE_KINDS.has(symbol2.kind.identifier)) emitType(symbol2, "");
44929
44929
  else emitGlobal(symbol2);
44930
44930
  }
@@ -44985,9 +44985,9 @@ function emitSwiftStandin(sourceGraphs, options) {
44985
44985
  "#endif",
44986
44986
  ""
44987
44987
  ];
44988
- for (const path141 of behavior.keys())
44989
- if (!used.has(path141))
44990
- skipped.push({ path: path141, reason: "behavior names no emitted declaration" });
44988
+ for (const path142 of behavior.keys())
44989
+ if (!used.has(path142))
44990
+ skipped.push({ path: path142, reason: "behavior names no emitted declaration" });
44991
44991
  return {
44992
44992
  source: `${[...banner, ...lines].join("\n")}
44993
44993
  `,
@@ -47191,9 +47191,9 @@ function originalColumn(line, column) {
47191
47191
  }
47192
47192
  function designTimeDiagnostic(output2, files2) {
47193
47193
  const rewritten = /* @__PURE__ */ new Map();
47194
- const linesOf = (path141) => {
47194
+ const linesOf = (path142) => {
47195
47195
  const file = Object.keys(files2).find(
47196
- (name3) => name3.endsWith(".swift") && (path141 === name3 || path141.endsWith(`/${name3}`))
47196
+ (name3) => name3.endsWith(".swift") && (path142 === name3 || path142.endsWith(`/${name3}`))
47197
47197
  );
47198
47198
  if (file === void 0) return null;
47199
47199
  let lines = rewritten.get(file);
@@ -47668,7 +47668,7 @@ function patchSwiftrtObject(src) {
47668
47668
  }
47669
47669
  return buf;
47670
47670
  }
47671
- function parseWasmObjectBytes(file, buf, isDist) {
47671
+ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
47672
47672
  let pos = 8;
47673
47673
  let numImportFuncs = 0;
47674
47674
  const importFuncNames = [];
@@ -47824,6 +47824,7 @@ function parseWasmObjectBytes(file, buf, isDist) {
47824
47824
  let cur = p2;
47825
47825
  for (let i = 0; i < cnt; i++) {
47826
47826
  const kind = buf[cur++];
47827
+ if (symbolFlagOffsets) symbolFlagOffsets[i] = cur;
47827
47828
  const [fl, c2] = readULEB2(buf, cur);
47828
47829
  cur = c2;
47829
47830
  symKind[i] = kind;
@@ -48081,6 +48082,23 @@ function parseWasmObjectCached(file, isDist, useCache) {
48081
48082
  if (useCache) parsedObjectCache.set(key2, parsed);
48082
48083
  return parsed;
48083
48084
  }
48085
+ function localizeDefinedWasmSymbols(bytes, names) {
48086
+ const offsets = [];
48087
+ const object6 = parseWasmObjectBytes("", bytes, false, offsets);
48088
+ const output2 = Uint8Array.from(bytes);
48089
+ let changed = 0;
48090
+ for (let index = 0; index < object6.symNames.length; index++) {
48091
+ if (!names.has(object6.symNames[index])) continue;
48092
+ if ((object6.symFlags[index] & 3) === 2) continue;
48093
+ if (object6.symFlags[index] & 16)
48094
+ throw new Error("cannot localize an undefined symbol");
48095
+ const offset = offsets[index];
48096
+ output2[offset] = output2[offset] & ~35 | 2;
48097
+ changed++;
48098
+ }
48099
+ if (changed !== names.size) throw new Error("Wasm symbols to localize were not defined");
48100
+ return output2;
48101
+ }
48084
48102
  function guestWasmSymbols(bytes) {
48085
48103
  const object6 = parseWasmObjectBytes("", bytes, false);
48086
48104
  return {
@@ -59344,7 +59362,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
59344
59362
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
59345
59363
  MULTI_MANIFEST_VERSION = 68;
59346
59364
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
59347
- compilerSourceDigest = true ? "6ff3c88ff95ee93cffc6e832c96753820df284d9d2d9a99d405e2cb6be86ed65" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
59365
+ compilerSourceDigest = true ? "b60df189803fef5c8b8fd902ae0a694ffbefe056af8f5fc06f707750dc97f09b" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
59348
59366
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
59349
59367
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
59350
59368
  cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
@@ -65826,7 +65844,7 @@ var init_swift_standin_digest = __esm({
65826
65844
  STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
65827
65845
  SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
65828
65846
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
65829
- STANDIN_SOURCE_DIGEST = true ? "ae85ffec56f52b5fc73fd9519b221f33abfd4b67aec6d9c5695044b4b6b6ab32" : standinSourceDigest();
65847
+ STANDIN_SOURCE_DIGEST = true ? "9d24428078636d005cc1401363f5f50704e049f52802b0493da7eea674470942" : standinSourceDigest();
65830
65848
  }
65831
65849
  });
65832
65850
 
@@ -66258,9 +66276,9 @@ async function packageTreeDigest(root) {
66258
66276
  (a, b) => a.name.localeCompare(b.name)
66259
66277
  )) {
66260
66278
  if (entry.name === "node_modules") continue;
66261
- const path141 = `${relative6}${entry.name}`;
66262
- if (entry.isDirectory()) walk3((0, import_node_path66.join)(directory2, entry.name), `${path141}/`);
66263
- else if (entry.isFile()) files2.push(path141);
66279
+ const path142 = `${relative6}${entry.name}`;
66280
+ if (entry.isDirectory()) walk3((0, import_node_path66.join)(directory2, entry.name), `${path142}/`);
66281
+ else if (entry.isFile()) files2.push(path142);
66264
66282
  }
66265
66283
  };
66266
66284
  walk3(root, "");
@@ -66287,7 +66305,7 @@ var init_package_tree_digest = __esm({
66287
66305
 
66288
66306
  // src/expo-native-prebuilt.ts
66289
66307
  function expoNativeCompilerDigestValue() {
66290
- return true ? "dc252d5a10409138e535f8caed0879e77c0415ec62aed534eba68347d7b4fbc5" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
66308
+ return true ? "cf0557e09d89c8c6883a1e9ce3f3f57b9f43040a8f4e81e39c612c37d34d8430" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
66291
66309
  }
66292
66310
  function readSources(value) {
66293
66311
  const sources = isRecord(value) ? value.sources : null;
@@ -66649,7 +66667,63 @@ function nativeStaticLibrary(file, recipe2, moduleRoot) {
66649
66667
  throw new Error(
66650
66668
  `${file}: native WebAssembly archive ${entry.name}/${entry.key} is not built for this compiler and SDK`
66651
66669
  );
66652
- return import_node_path69.default.join(dir, recipe2.archive);
66670
+ const archive = import_node_path69.default.join(dir, recipe2.archive);
66671
+ return "runtime" in recipe2 ? rustStaticLibrary(archive, moduleRoot) : archive;
66672
+ }
66673
+ function isRustSymbol(name3, demangled) {
66674
+ return (name3.startsWith("_R") || /^_ZN.*17h[0-9a-f]{16}E$/.test(name3)) && demangled !== name3 || name3 === "rust_eh_personality" || name3 === "__getrandom_v03_custom";
66675
+ }
66676
+ function rustStaticLibrary(file, moduleRoot) {
66677
+ const toolchain = swiftModuleToolchain(moduleRoot);
66678
+ const key2 = (0, import_node_crypto37.createHash)("sha256").update("rust-c-abi-v2\0").update(toolchain.release).update("\0").update(import_node_fs71.default.readFileSync(file)).digest("hex");
66679
+ const directory2 = import_node_path69.default.join(cacheDir(), "native-archives", key2);
66680
+ const archive = import_node_path69.default.join(directory2, "library.a");
66681
+ if (import_node_fs71.default.existsSync(archive)) return archive;
66682
+ const flags = ["--no-sort", "--extern-only", "--defined-only", "--format=just-symbols"];
66683
+ const options = { encoding: "utf8", maxBuffer: 64 * 1024 * 1024 };
66684
+ const symbols = (input) => {
66685
+ const raw2 = (0, import_node_child_process38.execFileSync)(
66686
+ import_node_path69.default.join(toolchain.toolchainBin, "llvm-nm"),
66687
+ [...flags, input],
66688
+ options
66689
+ ).trim().split("\n");
66690
+ const demangled = (0, import_node_child_process38.execFileSync)(
66691
+ import_node_path69.default.join(toolchain.toolchainBin, "llvm-nm"),
66692
+ [...flags, "--demangle", input],
66693
+ options
66694
+ ).trim().split("\n");
66695
+ if (raw2.length !== demangled.length)
66696
+ throw new Error(`${file}: Rust symbol table changed during intake`);
66697
+ return raw2.map((name3, index) => ({ name: name3, demangled: demangled[index] }));
66698
+ };
66699
+ if (!symbols(file).some(({ name: name3, demangled }) => isRustSymbol(name3, demangled)))
66700
+ return file;
66701
+ import_node_fs71.default.mkdirSync(directory2, { recursive: true });
66702
+ const stage = import_node_fs71.default.mkdtempSync(import_node_path69.default.join(directory2, "build-"));
66703
+ try {
66704
+ const object6 = import_node_path69.default.join(stage, "library.o");
66705
+ (0, import_node_child_process38.execFileSync)(import_node_path69.default.join(toolchain.toolchainBin, "wasm-ld"), [
66706
+ "-mwasm64",
66707
+ "-r",
66708
+ "--whole-archive",
66709
+ file,
66710
+ "--no-whole-archive",
66711
+ "-o",
66712
+ object6
66713
+ ]);
66714
+ const names = new Set(
66715
+ symbols(object6).filter(
66716
+ ({ name: name3, demangled }) => isRustSymbol(name3, demangled) || name3.startsWith("anon.")
66717
+ ).map(({ name: name3 }) => name3)
66718
+ );
66719
+ import_node_fs71.default.writeFileSync(object6, localizeDefinedWasmSymbols(import_node_fs71.default.readFileSync(object6), names));
66720
+ const output2 = import_node_path69.default.join(stage, "library.a");
66721
+ (0, import_node_child_process38.execFileSync)(import_node_path69.default.join(toolchain.toolchainBin, "llvm-ar"), ["rcsD", output2, object6]);
66722
+ import_node_fs71.default.renameSync(output2, archive);
66723
+ } finally {
66724
+ import_node_fs71.default.rmSync(stage, { recursive: true, force: true });
66725
+ }
66726
+ return archive;
66653
66727
  }
66654
66728
  function combineNativeStaticLibraries(files2, moduleRoot) {
66655
66729
  if (files2.length === 1) return files2[0];
@@ -66687,6 +66761,7 @@ var init_native_static_libraries = __esm({
66687
66761
  init_native_prebuilt();
66688
66762
  init_swift_compile();
66689
66763
  init_swift_distribution();
66764
+ init_swift_wasm_prune();
66690
66765
  init_swift_xcframework();
66691
66766
  NATIVE_STATIC_LIBRARY_RECIPES = [
66692
66767
  // react-native-libsodium's minimal apple build of the 1.0.20 release
@@ -66715,6 +66790,7 @@ var init_native_static_libraries = __esm({
66715
66790
  },
66716
66791
  {
66717
66792
  name: "anydoc_mobile",
66793
+ runtime: "rust",
66718
66794
  nativeSha256: "03b721dd9e98ec2767f7952aa65cde57d0c33d7ec80c9aaf7ab5ba77e055a25c",
66719
66795
  upstream: "e41ad6375fd80b64c4183d1a3f901d1f640a7953",
66720
66796
  recipe: "c180538533a79fe1c8babda204170806abe80dd4a546689dcc34c109c9fbfcfc",
@@ -66722,6 +66798,7 @@ var init_native_static_libraries = __esm({
66722
66798
  },
66723
66799
  {
66724
66800
  name: "ratex_ffi",
66801
+ runtime: "rust",
66725
66802
  nativeSha256: "8c41abcd8dd4e562e65cf5b88467a3493089c359d0863360dc65a5b88149e837",
66726
66803
  upstream: "a4296fa21cd40a56543602511bcf417014f4fee7cf5e1eaab58e0ac9610e3f63",
66727
66804
  // the unchanged source build, pinned Rust release and committed Cargo.lock.
@@ -66730,6 +66807,7 @@ var init_native_static_libraries = __esm({
66730
66807
  },
66731
66808
  {
66732
66809
  name: "ratex_ffi_0_1_14",
66810
+ runtime: "rust",
66733
66811
  nativeSha256: "bdd2bf679fcc981d98d36733b3bd083225a7397bb82bbd462c89088c6e0580a8",
66734
66812
  upstream: "2da907eb5dfcb464c7eef3b4c657fbdee144e3c6633e81efb1e56dcf1c76e01b",
66735
66813
  recipe: "537054295b8230548b3959b38459af2606cae69b226e37f6a2e0c227a8ad3cb1",
@@ -67590,7 +67668,7 @@ function resolveSwiftPackages(options) {
67590
67668
  headers.set(name3, import_node_path71.default.relative(binary2.dir, dir));
67591
67669
  };
67592
67670
  visit3(pkg, binary2.target);
67593
- binary2.headerDependencies = [...headers].map(([module2, path141]) => ({ module: module2, path: path141 }));
67671
+ binary2.headerDependencies = [...headers].map(([module2, path142]) => ({ module: module2, path: path142 }));
67594
67672
  }
67595
67673
  for (const owner of options.owners ?? []) {
67596
67674
  const found = productClosure(owner.products);
@@ -68326,8 +68404,8 @@ function withBuiltinStandinBehavior(behavior) {
68326
68404
  for (const [module2, members2] of Object.entries(BUILTIN_STANDIN_BEHAVIOR))
68327
68405
  merged[module2] = {
68328
68406
  ...Object.fromEntries(
68329
- Object.entries(members2).map(([path141, entry]) => [
68330
- path141,
68407
+ Object.entries(members2).map(([path142, entry]) => [
68408
+ path142,
68331
68409
  { ...entry, builtin: true }
68332
68410
  ])
68333
68411
  ),
@@ -70176,7 +70254,8 @@ function standinLibrary(binary2, searchRoot, toolchain) {
70176
70254
  throw new Error(
70177
70255
  `${import_node_path75.default.relative(searchRoot, supplied)} holds no single static library${library ? ` named ${library}` : ""}`
70178
70256
  );
70179
- return import_node_path75.default.join(supplied, chosen);
70257
+ if (!toolchain) throw new Error("supplied native libraries need the Swift SDK");
70258
+ return rustStaticLibrary(import_node_path75.default.join(supplied, chosen), toolchain.moduleRoot);
70180
70259
  }
70181
70260
  if (native && toolchain && import_node_fs78.default.existsSync(native.file)) {
70182
70261
  const recipe2 = nativeStaticLibraryRecipe(import_node_fs78.default.readFileSync(native.file));
@@ -70201,8 +70280,8 @@ function standinLibrary(binary2, searchRoot, toolchain) {
70201
70280
  if (!toolchain) throw new Error("Rust native libraries need the Swift SDK");
70202
70281
  const entry = rustCrateEntry(manifest, library, toolchain.moduleRoot, searchRoot);
70203
70282
  const prebuilt = fetchNativeEntry("rust", entry.name, entry.key);
70204
- if (prebuilt) return import_node_path75.default.join(prebuilt, library);
70205
- return buildRustCrate(manifest, library, searchRoot, toolchain.moduleRoot, entry);
70283
+ const archive = prebuilt ? import_node_path75.default.join(prebuilt, library) : buildRustCrate(manifest, library, searchRoot, toolchain.moduleRoot, entry);
70284
+ return rustStaticLibrary(archive, toolchain.moduleRoot);
70206
70285
  }
70207
70286
  function buildRustCrate(manifest, library, searchRoot, moduleRoot, entry = rustCrateEntry(manifest, library, moduleRoot, searchRoot)) {
70208
70287
  const compiler = swiftModuleToolchain(moduleRoot);
@@ -73036,8 +73115,8 @@ function imagesetFiles(images) {
73036
73115
  ];
73037
73116
  }).sort((a, b) => a.scale - b.scale);
73038
73117
  }
73039
- function flatScale(path141) {
73040
- const match = /@([23])x\.[^./]+$/.exec(path141);
73118
+ function flatScale(path142) {
73119
+ const match = /@([23])x\.[^./]+$/.exec(path142);
73041
73120
  return match ? Number(match[1]) : 1;
73042
73121
  }
73043
73122
  function providesNamespace(text6) {
@@ -73064,8 +73143,8 @@ function catalogEntryName(contentsPath, kind, readText2) {
73064
73143
  }
73065
73144
  return segments.join("/");
73066
73145
  }
73067
- function isFlatResourceImage(path141) {
73068
- return path141.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path141));
73146
+ function isFlatResourceImage(path142) {
73147
+ return path142.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path142));
73069
73148
  }
73070
73149
  function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
73071
73150
  const table = [];
@@ -73078,7 +73157,7 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
73078
73157
  seen.set(bundlePath, names);
73079
73158
  return { bundlePath, names };
73080
73159
  };
73081
- const catalogs = paths.filter((path141) => baseOf(path141) === "Contents.json");
73160
+ const catalogs = paths.filter((path142) => baseOf(path142) === "Contents.json");
73082
73161
  for (const contentsPath of catalogs) {
73083
73162
  const name3 = catalogEntryName(contentsPath, ".imageset", readText2);
73084
73163
  if (name3 === null) continue;
@@ -73110,13 +73189,13 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
73110
73189
  ...intent === "template" || intent === "original" ? { renderingMode: intent } : {}
73111
73190
  });
73112
73191
  }
73113
- for (const path141 of paths) {
73114
- if (!isFlatResourceImage(path141)) continue;
73115
- const name3 = baseOf(path141).slice(0, -extOf(path141).length);
73116
- const { bundlePath, names } = namesFor(path141);
73192
+ for (const path142 of paths) {
73193
+ if (!isFlatResourceImage(path142)) continue;
73194
+ const name3 = baseOf(path142).slice(0, -extOf(path142).length);
73195
+ const { bundlePath, names } = namesFor(path142);
73117
73196
  if (name3 === "" || names.has(name3)) continue;
73118
73197
  names.add(name3);
73119
- table.push({ name: name3, file: path141, scale: flatScale(path141), bundlePath });
73198
+ table.push({ name: name3, file: path142, scale: flatScale(path142), bundlePath });
73120
73199
  }
73121
73200
  return table;
73122
73201
  }
@@ -73151,7 +73230,7 @@ function colorsetValue(color2) {
73151
73230
  }
73152
73231
  function enumerateBundleColors(paths, readText2) {
73153
73232
  const table = {};
73154
- for (const contentsPath of paths.filter((path141) => baseOf(path141) === "Contents.json")) {
73233
+ for (const contentsPath of paths.filter((path142) => baseOf(path142) === "Contents.json")) {
73155
73234
  const name3 = catalogEntryName(contentsPath, ".colorset", readText2);
73156
73235
  if (name3 === null || name3 in table) continue;
73157
73236
  let colors;
@@ -73215,8 +73294,8 @@ function axisExtremes(points) {
73215
73294
  function pathBounds(d) {
73216
73295
  const xs = [];
73217
73296
  const ys = [];
73218
- for (const path141 of d)
73219
- (0, import_svgpath.default)(path141).abs().unshort().unarc().iterate((segment, _index, x, y) => {
73297
+ for (const path142 of d)
73298
+ (0, import_svgpath.default)(path142).abs().unshort().unarc().iterate((segment, _index, x, y) => {
73220
73299
  const [command, ...args] = segment;
73221
73300
  if (command === "M" || command === "L") {
73222
73301
  xs.push(Number(args[0]));
@@ -73243,7 +73322,7 @@ function guide(svg, id, axis) {
73243
73322
  }
73244
73323
  function enumerateBundleSymbols(paths, readText2, bundleForFile) {
73245
73324
  const table = {};
73246
- for (const contentsPath of paths.filter((path141) => baseOf(path141) === "Contents.json")) {
73325
+ for (const contentsPath of paths.filter((path142) => baseOf(path142) === "Contents.json")) {
73247
73326
  const name3 = catalogEntryName(contentsPath, ".symbolset", readText2);
73248
73327
  if (name3 === null) continue;
73249
73328
  const bundle = bundleForFile(contentsPath);
@@ -73302,8 +73381,8 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
73302
73381
  advance,
73303
73382
  box: [12 - wide2 / 2, 12 - tall / 2, wide2, tall],
73304
73383
  ...customLayout ? { customLayout } : {},
73305
- layers: d.map((path141) => ({
73306
- d: (0, import_svgpath.default)(path141).abs().scale(em).translate(translateX, translateY).round(3).toString()
73384
+ layers: d.map((path142) => ({
73385
+ d: (0, import_svgpath.default)(path142).abs().scale(em).translate(translateX, translateY).round(3).toString()
73307
73386
  }))
73308
73387
  };
73309
73388
  table[vectorKey] = vector;
@@ -73314,18 +73393,18 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
73314
73393
  }
73315
73394
  return table;
73316
73395
  }
73317
- function isCopiedResource(path141, copiedBundle) {
73318
- if (copiedBundle || path141.split("/").some((segment) => /\.(atlasc|bundle|storyboardc|nib)$/.test(segment)))
73396
+ function isCopiedResource(path142, copiedBundle) {
73397
+ if (copiedBundle || path142.split("/").some((segment) => /\.(atlasc|bundle|storyboardc|nib)$/.test(segment)))
73319
73398
  return true;
73320
- const ext = extOf(path141);
73399
+ const ext = extOf(path142);
73321
73400
  if (ext === ".json" || ext === ".xcstrings") return true;
73322
- return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !path141.split("/").some((segment) => segment.endsWith(".xcassets"));
73401
+ return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !path142.split("/").some((segment) => segment.endsWith(".xcassets"));
73323
73402
  }
73324
73403
  function enumerateBundleResources(paths, copiedBundle = false) {
73325
73404
  const found = [];
73326
73405
  const seen = /* @__PURE__ */ new Set();
73327
73406
  const ordered = [...paths].filter(
73328
- (path141) => path141.split("/").includes("Resources") && path141.split("/").every((segment) => segment !== "" && segment !== "..") && isCopiedResource(path141, copiedBundle)
73407
+ (path142) => path142.split("/").includes("Resources") && path142.split("/").every((segment) => segment !== "" && segment !== "..") && isCopiedResource(path142, copiedBundle)
73329
73408
  ).sort((a, b) => {
73330
73409
  const aDepth = a.split("/").length;
73331
73410
  const bDepth = b.split("/").length;
@@ -73488,31 +73567,31 @@ function tokens(text6) {
73488
73567
  }
73489
73568
  return result;
73490
73569
  }
73491
- function qualified(language, key2, path141) {
73492
- return `(${language}: ${key2}${path141 === "" ? "" : "|==|" + path141})`;
73570
+ function qualified(language, key2, path142) {
73571
+ return `(${language}: ${key2}${path142 === "" ? "" : "|==|" + path142})`;
73493
73572
  }
73494
- function requiresNumber(language, key2, path141) {
73573
+ function requiresNumber(language, key2, path142) {
73495
73574
  return Error(
73496
- "Plural variation requires referencing the number in the string. To maintain grammatical correctness for strings that do not reference the number of items, use separate top-level strings for one and greater than one. " + qualified(language, key2, path141)
73575
+ "Plural variation requires referencing the number in the string. To maintain grammatical correctness for strings that do not reference the number of items, use separate top-level strings for one and greater than one. " + qualified(language, key2, path142)
73497
73576
  );
73498
73577
  }
73499
- function moreThanOne(language, key2, path141) {
73578
+ function moreThanOne(language, key2, path142) {
73500
73579
  return Error(
73501
- "Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2, path141)
73580
+ "Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2, path142)
73502
73581
  );
73503
73582
  }
73504
73583
  function schemaPath(segments) {
73505
73584
  return segments.map((segment) => `'${segment}'`).join(" -> ");
73506
73585
  }
73507
- function checkUnitShape(node, path141) {
73586
+ function checkUnitShape(node, path142) {
73508
73587
  const raw2 = node.stringUnit;
73509
73588
  if (raw2 === void 0)
73510
- throw Error(`Missing required key 'stringUnit' inside ${schemaPath(path141)}`);
73589
+ throw Error(`Missing required key 'stringUnit' inside ${schemaPath(path142)}`);
73511
73590
  if (raw2 === null)
73512
- throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(path141)}`);
73591
+ throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(path142)}`);
73513
73592
  if (!isRecord3(raw2))
73514
- throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(path141)}`);
73515
- const unitPath = [...path141, "stringUnit"];
73593
+ throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(path142)}`);
73594
+ const unitPath = [...path142, "stringUnit"];
73516
73595
  if (!Object.hasOwn(raw2, "state"))
73517
73596
  throw Error(`Missing required key 'state' inside ${schemaPath(unitPath)}`);
73518
73597
  const state = raw2.state;
@@ -73529,38 +73608,38 @@ function checkUnitShape(node, path141) {
73529
73608
  throw Error(`Expected string for key 'value' inside ${schemaPath(unitPath)}`);
73530
73609
  return value;
73531
73610
  }
73532
- function checkPluralShape(node, path141) {
73611
+ function checkPluralShape(node, path142) {
73533
73612
  for (const [category, raw2] of Object.entries(node)) {
73534
- const categoryPath = [...path141, category];
73613
+ const categoryPath = [...path142, category];
73535
73614
  if (raw2 === null)
73536
73615
  throw Error(
73537
- `Missing required value for key '${category}' inside ${schemaPath(path141)}`
73616
+ `Missing required value for key '${category}' inside ${schemaPath(path142)}`
73538
73617
  );
73539
73618
  if (!isRecord3(raw2))
73540
- throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(path141)}`);
73619
+ throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(path142)}`);
73541
73620
  checkUnitShape(raw2, categoryPath);
73542
73621
  }
73543
73622
  }
73544
- function checkLocalizationShape(node, path141, deviceValue = false) {
73623
+ function checkLocalizationShape(node, path142, deviceValue = false) {
73545
73624
  if (node === null)
73546
73625
  throw Error(
73547
- `Missing required value for key '${path141[path141.length - 1]}' inside ${schemaPath(path141.slice(0, -1))}`
73626
+ `Missing required value for key '${path142[path142.length - 1]}' inside ${schemaPath(path142.slice(0, -1))}`
73548
73627
  );
73549
73628
  if (!isRecord3(node))
73550
73629
  throw Error(
73551
- `Expected dictionary for key '${path141[path141.length - 1]}' inside ${schemaPath(path141.slice(0, -1))}`
73630
+ `Expected dictionary for key '${path142[path142.length - 1]}' inside ${schemaPath(path142.slice(0, -1))}`
73552
73631
  );
73553
- if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations, path141);
73632
+ if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations, path142);
73554
73633
  if (!deviceValue && Object.hasOwn(node, "substitutions"))
73555
- checkSubstitutionsShape(node.substitutions, path141);
73556
- if (!Object.hasOwn(node, "variations")) checkUnitShape(node, path141);
73634
+ checkSubstitutionsShape(node.substitutions, path142);
73635
+ if (!Object.hasOwn(node, "variations")) checkUnitShape(node, path142);
73557
73636
  }
73558
- function checkVariationsShape(variations, path141) {
73637
+ function checkVariationsShape(variations, path142) {
73559
73638
  if (variations === null)
73560
- throw Error(`Missing required value for key 'variations' inside ${schemaPath(path141)}`);
73639
+ throw Error(`Missing required value for key 'variations' inside ${schemaPath(path142)}`);
73561
73640
  if (!isRecord3(variations))
73562
- throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(path141)}`);
73563
- const variationsPath = [...path141, "variations"];
73641
+ throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(path142)}`);
73642
+ const variationsPath = [...path142, "variations"];
73564
73643
  for (const [type, raw2] of Object.entries(variations)) {
73565
73644
  if (raw2 === null)
73566
73645
  throw Error(
@@ -73586,11 +73665,11 @@ function checkVariationsShape(variations, path141) {
73586
73665
  }
73587
73666
  }
73588
73667
  }
73589
- function checkSubstitutionsShape(substitutions, path141) {
73668
+ function checkSubstitutionsShape(substitutions, path142) {
73590
73669
  if (substitutions === null) return;
73591
73670
  if (!isRecord3(substitutions))
73592
- throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(path141)}`);
73593
- const substitutionsPath = [...path141, "substitutions"];
73671
+ throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(path142)}`);
73672
+ const substitutionsPath = [...path142, "substitutions"];
73594
73673
  for (const [name3, raw2] of Object.entries(substitutions)) {
73595
73674
  const subPath = [...substitutionsPath, name3];
73596
73675
  if (raw2 === null)
@@ -73632,10 +73711,10 @@ function scanSpecs(forms) {
73632
73711
  }
73633
73712
  return specs;
73634
73713
  }
73635
- function inferPlural(forms, language, key2, path141) {
73714
+ function inferPlural(forms, language, key2, path142) {
73636
73715
  const specs = scanSpecs(forms);
73637
- if (specs.size === 0) throw requiresNumber(language, key2, path141);
73638
- if (specs.size > 1) throw moreThanOne(language, key2, path141);
73716
+ if (specs.size === 0) throw requiresNumber(language, key2, path142);
73717
+ if (specs.size > 1) throw moreThanOne(language, key2, path142);
73639
73718
  return [...specs.values()][0] ?? { specifier: "", argument: 0 };
73640
73719
  }
73641
73720
  function unit(value) {
@@ -74104,8 +74183,8 @@ function plist4(value, depth) {
74104
74183
  }
74105
74184
  function compileStringCatalog(source, name3) {
74106
74185
  return Object.fromEntries(
74107
- Object.entries(compileCatalogTables(source, name3)).map(([path141, table]) => [
74108
- path141,
74186
+ Object.entries(compileCatalogTables(source, name3)).map(([path142, table]) => [
74187
+ path142,
74109
74188
  '<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n' + plist4(table, 0) + "</plist>\n"
74110
74189
  ])
74111
74190
  );
@@ -75033,8 +75112,8 @@ function sourceEntryPath() {
75033
75112
  return null;
75034
75113
  }
75035
75114
  }
75036
- function isCliEntry(path141) {
75037
- const name3 = (0, import_node_path81.basename)(path141);
75115
+ function isCliEntry(path142) {
75116
+ const name3 = (0, import_node_path81.basename)(path142);
75038
75117
  return name3 === "bin.ts" || name3 === "bin.js";
75039
75118
  }
75040
75119
  function rnxSelfInvocation() {
@@ -76972,6 +77051,9 @@ function packageSources(packagePath, hosted = false, linked = /* @__PURE__ */ ne
76972
77051
  return files2;
76973
77052
  }
76974
77053
  function packageSnapshot(project2, entry, moduleRoot) {
77054
+ moduleRoot ??= xcodeProjects().get(project2.packagePath)?.moduleRoot ?? linkedModuleRoots(project2.packagePath).find(
77055
+ (root) => import_node_fs86.default.existsSync(import_node_path83.default.join(root, "toolchain.json"))
77056
+ );
76975
77057
  const layout2 = xcodeLayout(project2.packagePath);
76976
77058
  const pin2 = moduleRoot ? swiftDistributionAt(moduleRoot) ?? JSON.parse(import_node_fs86.default.readFileSync(import_node_path83.default.join(moduleRoot, "toolchain.json"), "utf8")) : null;
76977
77059
  const linked = layout2 ? standinLibraries(
@@ -77442,10 +77524,7 @@ function scopedArtifact(project2, entry, moduleRoot, signal) {
77442
77524
  queued.then(resolve14, reject).finally(() => signal.removeEventListener("abort", stop));
77443
77525
  });
77444
77526
  }
77445
- const snapshotRoot = moduleRoot ?? xcodeProjects().get(project2.packagePath)?.moduleRoot ?? linkedModuleRoots(project2.packagePath).find(
77446
- (root) => import_node_fs86.default.existsSync(import_node_path83.default.join(root, "toolchain.json"))
77447
- );
77448
- const snapshot = packageSnapshot(project2, entry, snapshotRoot);
77527
+ const snapshot = packageSnapshot(project2, entry, moduleRoot);
77449
77528
  const compiled = project2.artifact?.compiled;
77450
77529
  if (project2.artifact && compiled && compiled.module === moduleStamp(project2.packagePath, moduleRoot, false)) {
77451
77530
  const input = snapshotCompileInput(snapshot);
@@ -80342,11 +80421,11 @@ function stringList(value) {
80342
80421
  function externalSpecMembers(root, requested) {
80343
80422
  const children = (spec) => Array.isArray(spec.subspecs) ? spec.subspecs.filter(object5) : [];
80344
80423
  const chains = /* @__PURE__ */ new Map();
80345
- const select = (path141) => {
80346
- const key2 = path141.join("/");
80424
+ const select = (path142) => {
80425
+ const key2 = path142.join("/");
80347
80426
  if (chains.has(key2)) return;
80348
80427
  const chain = [root];
80349
- for (const part of path141) {
80428
+ for (const part of path142) {
80350
80429
  const child = children(chain.at(-1)).find((sub) => sub.name === part);
80351
80430
  if (!child) throw new Error(`${String(root.name)} has no subspec ${key2}`);
80352
80431
  chain.push(child);
@@ -80355,7 +80434,7 @@ function externalSpecMembers(root, requested) {
80355
80434
  const spec = chain.at(-1);
80356
80435
  const defaults = stringList(spec.default_subspecs ?? spec.default_subspec);
80357
80436
  const activated2 = defaults[0] === "none" ? [] : defaults.length > 0 ? defaults : children(spec).map((sub) => String(sub.name));
80358
- for (const name3 of activated2) select([...path141, ...name3.split("/")]);
80437
+ for (const name3 of activated2) select([...path142, ...name3.split("/")]);
80359
80438
  for (const member of chain)
80360
80439
  for (const dependencies of [member.dependencies, iosOf(member)?.dependencies])
80361
80440
  for (const dependency of object5(dependencies) ? Object.keys(dependencies) : []) {
@@ -85648,8 +85727,8 @@ var init_expo_swift_host = __esm({
85648
85727
  });
85649
85728
 
85650
85729
  // ../peach-kit/src/uttype-mime.ts
85651
- function preferredMimeType(path141) {
85652
- const name3 = path141.split(/[?#]/, 1)[0].replace(/\/+$/, "").split("/").pop() ?? "";
85730
+ function preferredMimeType(path142) {
85731
+ const name3 = path142.split(/[?#]/, 1)[0].replace(/\/+$/, "").split("/").pop() ?? "";
85653
85732
  const dot = name3.lastIndexOf(".");
85654
85733
  if (dot <= 0) return null;
85655
85734
  return preferredMimeTypeForExtension(name3.slice(dot + 1));
@@ -87028,7 +87107,7 @@ var init_nitro_superset = __esm({
87028
87107
  init_nitroContract();
87029
87108
  init_swift_standin_digest();
87030
87109
  NITRO_SUPERSET_ENTRY_NAME = "superset";
87031
- NITRO_COMPILER_DIGEST = true ? "79e76dd976a0ac6066a5ba0856e458310ebf221339008ce724a8535efc7c2488" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
87110
+ NITRO_COMPILER_DIGEST = true ? "6a6f80ad2d874ad53a058d4aa8764ae971a237caf160c09603cebe64e1b6bbf6" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
87032
87111
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
87033
87112
  nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
87034
87113
  published2 = /* @__PURE__ */ new Map();
@@ -88365,8 +88444,8 @@ function getDefaultPortForProtocol(protocol) {
88365
88444
  return protocol === "https:" ? 443 : 80;
88366
88445
  }
88367
88446
  function isBaseServerUrl(url) {
88368
- const path141 = url.pathname || "/";
88369
- return (path141 === "/" || path141 === "") && !url.search && !url.hash;
88447
+ const path142 = url.pathname || "/";
88448
+ return (path142 === "/" || path142 === "") && !url.search && !url.hash;
88370
88449
  }
88371
88450
  async function resolvePortViaServerScan(port) {
88372
88451
  try {
@@ -88788,9 +88867,9 @@ function safeChildPlistName(value) {
88788
88867
  name: file.toLowerCase().endsWith(".plist") ? file : `${file}.plist`
88789
88868
  };
88790
88869
  }
88791
- async function readableSettingsBundle(path141) {
88870
+ async function readableSettingsBundle(path142) {
88792
88871
  try {
88793
- const root = await (0, import_promises10.stat)((0, import_node_path106.join)(path141, "Root.plist"));
88872
+ const root = await (0, import_promises10.stat)((0, import_node_path106.join)(path142, "Root.plist"));
88794
88873
  return root.isFile() && root.size <= MAX_PLIST_BYTES;
88795
88874
  } catch {
88796
88875
  return false;
@@ -88835,11 +88914,11 @@ async function settingsBundleFingerprint(bundlePath) {
88835
88914
  return null;
88836
88915
  }
88837
88916
  }
88838
- async function parsePlistRecord(path141) {
88917
+ async function parsePlistRecord(path142) {
88839
88918
  try {
88840
- const metadata = await (0, import_promises10.stat)(path141);
88919
+ const metadata = await (0, import_promises10.stat)(path142);
88841
88920
  if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
88842
- const source = await (0, import_promises10.readFile)(path141, "utf8");
88921
+ const source = await (0, import_promises10.readFile)(path142, "utf8");
88843
88922
  const parsed = parsePlistSource(source);
88844
88923
  return isRecord(parsed) ? parsed : null;
88845
88924
  } catch {
@@ -89344,7 +89423,7 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
89344
89423
  return null;
89345
89424
  }
89346
89425
  }
89347
- function httpGet(hostname, port, path141, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
89426
+ function httpGet(hostname, port, path142, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
89348
89427
  return new Promise((resolve14) => {
89349
89428
  let settled = false;
89350
89429
  let killing = false;
@@ -89353,7 +89432,7 @@ function httpGet(hostname, port, path141, method = "GET", timeout = TIMEOUT_MS,
89353
89432
  settled = true;
89354
89433
  resolve14(value);
89355
89434
  };
89356
- const req = import_http.default.request({ hostname, port, path: path141, method, headers }, (res) => {
89435
+ const req = import_http.default.request({ hostname, port, path: path142, method, headers }, (res) => {
89357
89436
  let body = "";
89358
89437
  res.on("data", (c) => body += c.toString());
89359
89438
  const contentType2 = (() => {
@@ -101709,8 +101788,8 @@ function metroIosAssetDestRelatives(httpServerLocation, filename) {
101709
101788
  }
101710
101789
  const out = [];
101711
101790
  for (const dir of dirs) {
101712
- const path141 = `${dir}/${filename}`;
101713
- if (!out.includes(path141)) out.push(path141);
101791
+ const path142 = `${dir}/${filename}`;
101792
+ if (!out.includes(path142)) out.push(path142);
101714
101793
  }
101715
101794
  if (!out.includes(filename)) out.push(filename);
101716
101795
  return out;
@@ -101752,6 +101831,15 @@ function resolveMetroIosAssetDestFiles(destFiles, descriptor, scale) {
101752
101831
  (file) => destFileMatchesLocation(file, descriptor.httpServerLocation, filename)
101753
101832
  ).sort();
101754
101833
  }
101834
+ function resolveMetroAndroidAssetDestFiles(destFiles, descriptor, scale) {
101835
+ const location = descriptor.httpServerLocation.replace(/^\//, "");
101836
+ const identifier2 = `${location}/${descriptor.name}`.toLowerCase().replace(/\//g, "_").replace(/[^a-z0-9_]/g, "").replace(/^(?:assets|assetsunstable_path)_/, "");
101837
+ const density = androidDensities.get(scale);
101838
+ const folder = !androidDrawableTypes.has(descriptor.type) ? "raw" : density && `drawable-${density}`;
101839
+ if (!folder) return [];
101840
+ const relative6 = `${folder}/${identifier2}.${descriptor.type}`;
101841
+ return destFiles.some((file) => file.replaceAll("\\", "/") === relative6) ? [relative6] : [];
101842
+ }
101755
101843
  async function embedMetroAssetFiles(bundle, read) {
101756
101844
  const sites = scanAssetDescriptorSites(bundle);
101757
101845
  const embedded = /* @__PURE__ */ new Map();
@@ -101872,7 +101960,7 @@ function rewriteDescriptorObject(bundle, site, entry) {
101872
101960
  const missing2 = countNewlines(bundle.slice(site.start, site.end)) - countNewlines(rewritten);
101873
101961
  return missing2 > 0 ? `${rewritten.slice(0, -1)}${"\n".repeat(missing2)}}` : rewritten;
101874
101962
  }
101875
- var EXPRESSION_KEYWORDS, PLACEHOLDER_JPEG, METRO_ASSET_PLACEHOLDERS;
101963
+ var EXPRESSION_KEYWORDS, PLACEHOLDER_JPEG, METRO_ASSET_PLACEHOLDERS, androidDrawableTypes, androidDensities;
101876
101964
  var init_metroAssetArtifact = __esm({
101877
101965
  "../contrast-bundler/src/metroAssetArtifact.ts"() {
101878
101966
  "use strict";
@@ -101903,6 +101991,15 @@ var init_metroAssetArtifact = __esm({
101903
101991
  ["gif", "R0lGODlhCAAIAPAAACYmK/8A/yH5BAAAAAAALAAAAAAIAAgAAAINjAMJh8q6DoTPSWvoKQA7"],
101904
101992
  ["webp", "UklGRiQAAABXRUJQVlA4TBcAAAAvB8ABAA8wJj/5P8v//IcH/gAf0f94AAA="]
101905
101993
  ]);
101994
+ androidDrawableTypes = /* @__PURE__ */ new Set(["gif", "jpeg", "jpg", "ktx", "png", "webp", "xml"]);
101995
+ androidDensities = /* @__PURE__ */ new Map([
101996
+ [0.75, "ldpi"],
101997
+ [1, "mdpi"],
101998
+ [1.5, "hdpi"],
101999
+ [2, "xhdpi"],
102000
+ [3, "xxhdpi"],
102001
+ [4, "xxxhdpi"]
102002
+ ]);
101906
102003
  }
101907
102004
  });
101908
102005
 
@@ -102756,6 +102853,7 @@ function placeMetroDescriptor(listing, descriptor) {
102756
102853
  (scale) => distinctByContent(listing.directory, [
102757
102854
  .../* @__PURE__ */ new Set([
102758
102855
  ...resolveMetroIosAssetDestFiles(listing.files, descriptor, scale),
102856
+ ...resolveMetroAndroidAssetDestFiles(listing.files, descriptor, scale),
102759
102857
  ...resolveExpoHashedAssetFiles(listing.files, descriptor, scale)
102760
102858
  ])
102761
102859
  ])
@@ -105380,20 +105478,17 @@ var init_bridge_host = __esm({
105380
105478
  })
105381
105479
  );
105382
105480
  }
105481
+ cliHasPendingCommand(ws) {
105482
+ for (const entry of this.cliBySentId.values()) if (entry.ws === ws) return true;
105483
+ return false;
105484
+ }
105383
105485
  sweepIdleCliClients() {
105384
105486
  const now = Date.now();
105385
105487
  let swept = false;
105386
105488
  for (const [ws, simId] of this.cliSimBySocket) {
105387
105489
  const lastCommand = this.cliLastCommandAt.get(ws) ?? 0;
105388
105490
  if (now - lastCommand < _SootSimBridgeHost.CLI_IDLE_TIMEOUT_MS) continue;
105389
- let hasPendingCommand = false;
105390
- for (const entry of this.cliBySentId.values()) {
105391
- if (entry.ws === ws) {
105392
- hasPendingCommand = true;
105393
- break;
105394
- }
105395
- }
105396
- if (hasPendingCommand) continue;
105491
+ if (this.cliHasPendingCommand(ws)) continue;
105397
105492
  this.cliSimBySocket.delete(ws);
105398
105493
  this.cliLastCommandAt.delete(ws);
105399
105494
  for (const [sentId, entry] of this.cliBySentId) {
@@ -105740,11 +105835,9 @@ var init_bridge_host = __esm({
105740
105835
  const otherKey = this.cliIdentityKeyBySocket.get(cliWs);
105741
105836
  if (otherKey && otherKey !== cliIdentityKey) {
105742
105837
  this.cliSimBySocket.delete(cliWs);
105743
- try {
105744
- cliWs.close(1e3, "lease claimed by another cli");
105745
- } catch {
105746
- }
105747
105838
  bootedCount++;
105839
+ if (this.cliHasPendingCommand(cliWs)) continue;
105840
+ cliWs.close(1e3, "lease claimed by another cli");
105748
105841
  }
105749
105842
  }
105750
105843
  }
@@ -107384,11 +107477,11 @@ function explainMissingCallTarget(error) {
107384
107477
  }
107385
107478
  throw error;
107386
107479
  }
107387
- async function callInBridge(bridge, path141, ...args) {
107388
- return bridge.send({ type: "call", path: path141, args }).catch(explainMissingCallTarget);
107480
+ async function callInBridge(bridge, path142, ...args) {
107481
+ return bridge.send({ type: "call", path: path142, args }).catch(explainMissingCallTarget);
107389
107482
  }
107390
- async function callInBridgeWrite(bridge, path141, ...args) {
107391
- return bridge.send({ type: "call", path: path141, args, acquireLock: true }).catch(explainMissingCallTarget);
107483
+ async function callInBridgeWrite(bridge, path142, ...args) {
107484
+ return bridge.send({ type: "call", path: path142, args, acquireLock: true }).catch(explainMissingCallTarget);
107392
107485
  }
107393
107486
  var import_node_fs132, import_node_path134, import_ws3, PEACH_PLACEMENT_ENV, resolvedWorld, refusedBridges, BridgeSimLockedError, BridgeHandshakeTimeoutError, noticedTargets, DisconnectedSimError, TIMEOUT_UNIT_MS, BRIDGE_VALUE_FLAGS_TABLE, BRIDGE_VALUE_FLAGS;
107394
107487
  var init_ws_bridge = __esm({
@@ -108050,6 +108143,105 @@ var init_app_splash = __esm({
108050
108143
  }
108051
108144
  });
108052
108145
 
108146
+ // src/binarySidecarContract.ts
108147
+ function readPeachSidecarManifest(value) {
108148
+ if (typeof value !== "object" || value === null || !("format" in value) || value.format !== 1 || !("platform" in value) || value.platform !== "ios" && value.platform !== "android" || !("bundleSha256" in value) || typeof value.bundleSha256 !== "string" || !/^[a-f0-9]{64}$/.test(value.bundleSha256) || !("nativePackages" in value))
108149
+ throw new Error("invalid peach sidecar manifest");
108150
+ return {
108151
+ format: 1,
108152
+ platform: value.platform,
108153
+ bundleSha256: value.bundleSha256,
108154
+ nativePackages: readPackageVersions(value.nativePackages)
108155
+ };
108156
+ }
108157
+ var PEACH_SIDECAR_DIR, PEACH_SIDECAR_BUNDLE, PEACH_SIDECAR_MANIFEST, PEACH_SIDECAR_ASSETS;
108158
+ var init_binarySidecarContract = __esm({
108159
+ "src/binarySidecarContract.ts"() {
108160
+ "use strict";
108161
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
108162
+ init_package_versions();
108163
+ PEACH_SIDECAR_DIR = "peach";
108164
+ PEACH_SIDECAR_BUNDLE = "main.js.br";
108165
+ PEACH_SIDECAR_MANIFEST = "app.json";
108166
+ PEACH_SIDECAR_ASSETS = "assets";
108167
+ }
108168
+ });
108169
+
108170
+ // cli/binary-sidecar.ts
108171
+ function isAppBinaryPath(target) {
108172
+ return /\.(ipa|apk)$/i.test(target) && import_node_fs135.default.statSync(target, { throwIfNoEntry: false })?.isFile() === true;
108173
+ }
108174
+ function extractAppBinaryBundle(binary2) {
108175
+ const file = import_node_path137.default.resolve(binary2);
108176
+ const entries = (0, import_node_child_process61.execFileSync)("unzip", ["-Z1", file], {
108177
+ encoding: "utf8",
108178
+ maxBuffer: 256 * 1024 * 1024
108179
+ }).split("\n");
108180
+ const manifestEntry = entries.find(
108181
+ (entry) => new RegExp(
108182
+ `^(Payload/[^/]+\\.app|assets)/${PEACH_SIDECAR_DIR}/${PEACH_SIDECAR_MANIFEST.replace(".", "\\.")}$`
108183
+ ).test(entry)
108184
+ );
108185
+ if (!manifestEntry)
108186
+ throw new Error(
108187
+ `${binary2} carries no peach sidecar; only apps built by Contrast include the plain javascript peach runs`
108188
+ );
108189
+ const sidecar = import_node_path137.default.posix.dirname(manifestEntry);
108190
+ const appRoot = import_node_path137.default.posix.dirname(sidecar);
108191
+ const digest3 = (0, import_node_crypto69.createHash)("sha256").update(import_node_fs135.default.readFileSync(file)).digest("hex");
108192
+ const out = import_node_path137.default.join(cacheDir(), "app-binaries", digest3);
108193
+ const bundlePath = import_node_path137.default.join(out, "main.js");
108194
+ const extracted = import_node_path137.default.join(out, "extracted");
108195
+ if (!import_node_fs135.default.existsSync(bundlePath)) {
108196
+ import_node_fs135.default.rmSync(out, { recursive: true, force: true });
108197
+ import_node_fs135.default.mkdirSync(extracted, { recursive: true });
108198
+ const patterns = [`${sidecar}/*`];
108199
+ const iosAssets = `${appRoot}/assets/`;
108200
+ if (appRoot.startsWith("Payload/") && entries.some((entry) => entry.startsWith(iosAssets)))
108201
+ patterns.push(`${iosAssets}*`);
108202
+ (0, import_node_child_process61.execFileSync)("unzip", ["-q", "-o", file, ...patterns, "-d", extracted]);
108203
+ const manifest = readPeachSidecarManifest(
108204
+ JSON.parse(import_node_fs135.default.readFileSync(import_node_path137.default.join(extracted, manifestEntry), "utf8"))
108205
+ );
108206
+ const bundle = (0, import_node_zlib4.brotliDecompressSync)(
108207
+ import_node_fs135.default.readFileSync(import_node_path137.default.join(extracted, sidecar, PEACH_SIDECAR_BUNDLE))
108208
+ );
108209
+ if ((0, import_node_crypto69.createHash)("sha256").update(bundle).digest("hex") !== manifest.bundleSha256)
108210
+ throw new Error(`${binary2}: the peach sidecar bundle does not match its manifest`);
108211
+ const assets2 = manifest.platform === "ios" ? import_node_path137.default.join(extracted, appRoot, "assets") : import_node_path137.default.join(extracted, sidecar, PEACH_SIDECAR_ASSETS);
108212
+ if (import_node_fs135.default.existsSync(assets2)) import_node_fs135.default.renameSync(assets2, import_node_path137.default.join(out, "assets"));
108213
+ import_node_fs135.default.copyFileSync(
108214
+ import_node_path137.default.join(extracted, manifestEntry),
108215
+ import_node_path137.default.join(out, PEACH_SIDECAR_MANIFEST)
108216
+ );
108217
+ import_node_fs135.default.writeFileSync(
108218
+ `${bundlePath}.partial`,
108219
+ insertPackageVersionsFooter(bundle.toString("utf8"), manifest.nativePackages)
108220
+ );
108221
+ import_node_fs135.default.renameSync(`${bundlePath}.partial`, bundlePath);
108222
+ import_node_fs135.default.rmSync(extracted, { recursive: true, force: true });
108223
+ }
108224
+ const { platform: platform2 } = readPeachSidecarManifest(
108225
+ JSON.parse(import_node_fs135.default.readFileSync(import_node_path137.default.join(out, PEACH_SIDECAR_MANIFEST), "utf8"))
108226
+ );
108227
+ return { bundlePath, platform: platform2 };
108228
+ }
108229
+ var import_node_child_process61, import_node_crypto69, import_node_fs135, import_node_path137, import_node_zlib4;
108230
+ var init_binary_sidecar = __esm({
108231
+ "cli/binary-sidecar.ts"() {
108232
+ "use strict";
108233
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
108234
+ import_node_child_process61 = require("node:child_process");
108235
+ import_node_crypto69 = require("node:crypto");
108236
+ import_node_fs135 = __toESM(require("node:fs"), 1);
108237
+ import_node_path137 = __toESM(require("node:path"), 1);
108238
+ import_node_zlib4 = require("node:zlib");
108239
+ init_package_versions();
108240
+ init_binarySidecarContract();
108241
+ init_home_paths();
108242
+ }
108243
+ });
108244
+
108053
108245
  // src/bridge-contract-input.ts
108054
108246
  var SEMANTIC_WAIT_MAX_TIMEOUT_MS;
108055
108247
  var init_bridge_contract_input = __esm({
@@ -108864,7 +109056,7 @@ var init_core = __esm({
108864
109056
  // cli/output-redaction.ts
108865
109057
  function mask(value) {
108866
109058
  if (MASKED.test(value)) return value;
108867
- return `<redacted:${(0, import_node_crypto69.createHash)("sha256").update(value).digest("hex").slice(0, 4)}>`;
109059
+ return `<redacted:${(0, import_node_crypto70.createHash)("sha256").update(value).digest("hex").slice(0, 4)}>`;
108868
109060
  }
108869
109061
  function maskQuoted(quoted2) {
108870
109062
  return `${quoted2[0]}${mask(quoted2.slice(1, -1))}${quoted2[0]}`;
@@ -108986,12 +109178,12 @@ function redactText(text6, configurationOnly, decodedString = false) {
108986
109178
  (line, prefix, name3, value) => SECRET_NAME.test(name3) ? `${prefix}${mask(value)}` : line
108987
109179
  ).replace(EMAIL, mask).replace(OPAQUE_ID, mask);
108988
109180
  }
108989
- var import_node_crypto69, SECRET_NAME, JWT, GOOGLE_API_KEY, BEARER, EMAIL, OPAQUE_ID, STRING, NUMBER, PAIR2, STRING_TOKEN, QUERY_PAIR, HEADER_LINE, MASKED, CONFIG_CONTAINER, utf8;
109181
+ var import_node_crypto70, SECRET_NAME, JWT, GOOGLE_API_KEY, BEARER, EMAIL, OPAQUE_ID, STRING, NUMBER, PAIR2, STRING_TOKEN, QUERY_PAIR, HEADER_LINE, MASKED, CONFIG_CONTAINER, utf8;
108990
109182
  var init_output_redaction = __esm({
108991
109183
  "cli/output-redaction.ts"() {
108992
109184
  "use strict";
108993
109185
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
108994
- import_node_crypto69 = require("node:crypto");
109186
+ import_node_crypto70 = require("node:crypto");
108995
109187
  init_config();
108996
109188
  SECRET_NAME = /^(?:[\w-]*(?:api[-_]?key|token|secret|password|passwd|authorization|cookie|signature|credential)s?|auth|sig|email|uid|[\w-]*(?:user|account|local|device|installation|client|app|project|sender|measurement|tenant)[-_]?id)$/i;
108997
109189
  JWT = /\beyJ[\w-]{6,}\.[\w-]{6,}\.[\w-]{6,}/g;
@@ -109492,7 +109684,7 @@ function macDesktopLaunchHome(bridgePort) {
109492
109684
  const dev = readDevBridgeLockfiles().find(
109493
109685
  (lock) => lock.bridgePort === bridgePort && isDevBridgeLockfileFresh(lock)
109494
109686
  );
109495
- const homeKey = (0, import_node_crypto70.createHash)("sha256").update(home).digest("hex");
109687
+ const homeKey = (0, import_node_crypto71.createHash)("sha256").update(home).digest("hex");
109496
109688
  const dir = (0, import_path7.join)((0, import_os3.tmpdir)(), "peach-desktop-launch", homeKey, String(bridgePort));
109497
109689
  (0, import_fs8.mkdirSync)(dir, { recursive: true });
109498
109690
  if ((0, import_fs8.existsSync)(home)) {
@@ -109598,14 +109790,14 @@ function buildMacLaunchUrl(url, opts, nativeApp = false) {
109598
109790
  }
109599
109791
  return deepLink.toString();
109600
109792
  }
109601
- var import_child_process5, import_fs8, import_node_crypto70, import_os3, import_path7, import_url2, import_meta2, _sootsimRoot;
109793
+ var import_child_process5, import_fs8, import_node_crypto71, import_os3, import_path7, import_url2, import_meta2, _sootsimRoot;
109602
109794
  var init_desktop_companion = __esm({
109603
109795
  "cli/desktop-companion.ts"() {
109604
109796
  "use strict";
109605
109797
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
109606
109798
  import_child_process5 = require("child_process");
109607
109799
  import_fs8 = require("fs");
109608
- import_node_crypto70 = require("node:crypto");
109800
+ import_node_crypto71 = require("node:crypto");
109609
109801
  import_os3 = require("os");
109610
109802
  import_path7 = require("path");
109611
109803
  import_url2 = require("url");
@@ -109753,13 +109945,13 @@ function resolvePlaywright() {
109753
109945
  try {
109754
109946
  const modulePath = requireFromRoot.resolve(spec);
109755
109947
  const packageJsonPath = requireFromRoot.resolve(`${spec}/package.json`);
109756
- const parsed = JSON.parse((0, import_node_fs135.readFileSync)(packageJsonPath, "utf8"));
109948
+ const parsed = JSON.parse((0, import_node_fs136.readFileSync)(packageJsonPath, "utf8"));
109757
109949
  if (!isRecord(parsed) || typeof parsed.version !== "string") continue;
109758
109950
  const corePackagePath = (0, import_node_module23.createRequire)(modulePath).resolve(
109759
109951
  "playwright-core/package.json"
109760
109952
  );
109761
- const cliPath = (0, import_node_path137.join)((0, import_node_path137.dirname)(corePackagePath), "cli.js");
109762
- if (!(0, import_node_fs135.existsSync)(cliPath)) continue;
109953
+ const cliPath = (0, import_node_path138.join)((0, import_node_path138.dirname)(corePackagePath), "cli.js");
109954
+ if (!(0, import_node_fs136.existsSync)(cliPath)) continue;
109763
109955
  return {
109764
109956
  spec,
109765
109957
  modulePath,
@@ -109787,7 +109979,7 @@ async function provisionPlaywright() {
109787
109979
  await installVerifiedTarball({
109788
109980
  url: `https://registry.npmjs.org/playwright-core/-/playwright-core-${version2}.tgz`,
109789
109981
  digest: { algorithm, encoding: "base64", value: digest3 },
109790
- destDir: (0, import_node_path137.join)(playwrightCoreDir(version2), "node_modules", "playwright-core"),
109982
+ destDir: (0, import_node_path138.join)(playwrightCoreDir(version2), "node_modules", "playwright-core"),
109791
109983
  installedMarker: "package.json",
109792
109984
  // npm tarballs hold the package under a leading `package/`
109793
109985
  stripComponents: 1,
@@ -109802,12 +109994,12 @@ async function provisionPlaywright() {
109802
109994
  return installed2;
109803
109995
  }
109804
109996
  function chromiumPathsFile() {
109805
- return (0, import_node_path137.join)(cacheDir(), "playwright-chromium-paths.json");
109997
+ return (0, import_node_path138.join)(cacheDir(), "playwright-chromium-paths.json");
109806
109998
  }
109807
109999
  function readChromiumPaths() {
109808
110000
  let parsed;
109809
110001
  try {
109810
- parsed = JSON.parse((0, import_node_fs135.readFileSync)(chromiumPathsFile(), "utf8"));
110002
+ parsed = JSON.parse((0, import_node_fs136.readFileSync)(chromiumPathsFile(), "utf8"));
109811
110003
  } catch {
109812
110004
  return {};
109813
110005
  }
@@ -109831,7 +110023,7 @@ function packageChromiumPath(resolved, env) {
109831
110023
  const cached4 = known[key2];
109832
110024
  if (cached4) return { ok: true, path: cached4 };
109833
110025
  const self = rnxSelfInvocation();
109834
- const probe2 = (0, import_node_child_process61.spawnSync)(
110026
+ const probe2 = (0, import_node_child_process62.spawnSync)(
109835
110027
  self.executable,
109836
110028
  [...self.prefixArgs, RNX_INTERNAL_COMMAND, RNX_INTERNAL_CHILDREN.playwrightProbe],
109837
110029
  {
@@ -109859,15 +110051,15 @@ function packageChromiumPath(resolved, env) {
109859
110051
  const keys = Object.keys(known);
109860
110052
  for (const old of keys.slice(0, Math.max(0, keys.length - CHROMIUM_PATHS_KEPT)))
109861
110053
  delete known[old];
109862
- (0, import_node_fs135.mkdirSync)(cacheDir(), { recursive: true });
110054
+ (0, import_node_fs136.mkdirSync)(cacheDir(), { recursive: true });
109863
110055
  const staged = `${chromiumPathsFile()}.${process.pid}`;
109864
- (0, import_node_fs135.writeFileSync)(staged, JSON.stringify(known));
109865
- (0, import_node_fs135.renameSync)(staged, chromiumPathsFile());
110056
+ (0, import_node_fs136.writeFileSync)(staged, JSON.stringify(known));
110057
+ (0, import_node_fs136.renameSync)(staged, chromiumPathsFile());
109866
110058
  return { ok: true, path: parsed.expectedPath };
109867
110059
  }
109868
- function isExecutable(path141) {
110060
+ function isExecutable(path142) {
109869
110061
  try {
109870
- (0, import_node_fs135.accessSync)(path141, import_node_fs135.constants.X_OK);
110062
+ (0, import_node_fs136.accessSync)(path142, import_node_fs136.constants.X_OK);
109871
110063
  return true;
109872
110064
  } catch {
109873
110065
  return false;
@@ -109876,7 +110068,7 @@ function isExecutable(path141) {
109876
110068
  function probeBrowser(resolved, env, shell) {
109877
110069
  const override = env.PEACH_CHROMIUM_EXECUTABLE;
109878
110070
  if (override) {
109879
- const executablePath2 = (0, import_node_path137.resolve)(override);
110071
+ const executablePath2 = (0, import_node_path138.resolve)(override);
109880
110072
  if (!isExecutable(executablePath2))
109881
110073
  return {
109882
110074
  ok: false,
@@ -109887,9 +110079,9 @@ function probeBrowser(resolved, env, shell) {
109887
110079
  const expected = packageChromiumPath(resolved, env);
109888
110080
  if (!expected.ok) return expected;
109889
110081
  const expectedPath = expected.path;
109890
- let browserDir = (0, import_node_path137.dirname)(expectedPath);
109891
- while (!/^chromium-\d+$/.test((0, import_node_path137.basename)(browserDir))) {
109892
- const parent = (0, import_node_path137.dirname)(browserDir);
110082
+ let browserDir = (0, import_node_path138.dirname)(expectedPath);
110083
+ while (!/^chromium-\d+$/.test((0, import_node_path138.basename)(browserDir))) {
110084
+ const parent = (0, import_node_path138.dirname)(browserDir);
109893
110085
  if (parent === browserDir)
109894
110086
  return {
109895
110087
  ok: false,
@@ -109897,28 +110089,28 @@ function probeBrowser(resolved, env, shell) {
109897
110089
  };
109898
110090
  browserDir = parent;
109899
110091
  }
109900
- const browsersDir = (0, import_node_path137.dirname)(browserDir);
110092
+ const browsersDir = (0, import_node_path138.dirname)(browserDir);
109901
110093
  const prefix = shell ? "chromium_headless_shell-" : "chromium-";
109902
110094
  const paths = shell ? process.platform === "win32" ? ["chrome-headless-shell-win64/chrome-headless-shell.exe"] : [
109903
110095
  process.arch === "arm64" ? "chrome-headless-shell-linux-arm64/chrome-headless-shell" : "chrome-headless-shell-linux64/chrome-headless-shell",
109904
110096
  "chrome-linux/headless_shell"
109905
- ] : process.platform === "linux" ? [(0, import_node_path137.relative)(browserDir, expectedPath), "chrome-linux/chrome"] : [(0, import_node_path137.relative)(browserDir, expectedPath)];
109906
- let executablePath = shell ? (0, import_node_path137.join)(
110097
+ ] : process.platform === "linux" ? [(0, import_node_path138.relative)(browserDir, expectedPath), "chrome-linux/chrome"] : [(0, import_node_path138.relative)(browserDir, expectedPath)];
110098
+ let executablePath = shell ? (0, import_node_path138.join)(
109907
110099
  browsersDir,
109908
- `${prefix}${(0, import_node_path137.basename)(browserDir).slice("chromium-".length)}`,
110100
+ `${prefix}${(0, import_node_path138.basename)(browserDir).slice("chromium-".length)}`,
109909
110101
  paths[0]
109910
110102
  ) : expectedPath;
109911
- const revisions = (0, import_node_fs135.existsSync)(browsersDir) ? (0, import_node_fs135.readdirSync)(browsersDir).filter(
110103
+ const revisions = (0, import_node_fs136.existsSync)(browsersDir) ? (0, import_node_fs136.readdirSync)(browsersDir).filter(
109912
110104
  (name3) => name3.startsWith(prefix) && /^\d+$/.test(name3.slice(prefix.length))
109913
110105
  ).sort((a, b) => Number(b.slice(prefix.length)) - Number(a.slice(prefix.length))) : [];
109914
110106
  for (const revision of revisions) {
109915
- const installed2 = paths.map((path141) => (0, import_node_path137.join)(browsersDir, revision, path141)).find(isExecutable);
110107
+ const installed2 = paths.map((path142) => (0, import_node_path138.join)(browsersDir, revision, path142)).find(isExecutable);
109916
110108
  if (installed2) {
109917
110109
  executablePath = installed2;
109918
110110
  break;
109919
110111
  }
109920
110112
  }
109921
- return { ok: true, executablePath, exists: (0, import_node_fs135.existsSync)(executablePath) };
110113
+ return { ok: true, executablePath, exists: (0, import_node_fs136.existsSync)(executablePath) };
109922
110114
  }
109923
110115
  async function ensurePlaywrightBrowser(resolved, headless, env = process.env) {
109924
110116
  const headlessShell = headless && process.platform !== "darwin";
@@ -109936,7 +110128,7 @@ async function ensurePlaywrightBrowser(resolved, headless, env = process.env) {
109936
110128
  };
109937
110129
  }
109938
110130
  const installer = rnxSelfInvocation();
109939
- const install = (0, import_node_child_process61.spawnSync)(
110131
+ const install = (0, import_node_child_process62.spawnSync)(
109940
110132
  installer.executable,
109941
110133
  [
109942
110134
  ...installer.prefixArgs,
@@ -109995,15 +110187,15 @@ async function launchProvisionedPlaywright() {
109995
110187
  { headless: true }
109996
110188
  );
109997
110189
  }
109998
- var import_node_child_process61, import_node_fs135, import_node_module23, import_node_path137, CHROMIUM_PATHS_KEPT;
110190
+ var import_node_child_process62, import_node_fs136, import_node_module23, import_node_path138, CHROMIUM_PATHS_KEPT;
109999
110191
  var init_playwright_provisioning = __esm({
110000
110192
  "cli/drivers/playwright-provisioning.ts"() {
110001
110193
  "use strict";
110002
110194
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
110003
- import_node_child_process61 = require("node:child_process");
110004
- import_node_fs135 = require("node:fs");
110195
+ import_node_child_process62 = require("node:child_process");
110196
+ import_node_fs136 = require("node:fs");
110005
110197
  import_node_module23 = require("node:module");
110006
- import_node_path137 = require("node:path");
110198
+ import_node_path138 = require("node:path");
110007
110199
  init_src();
110008
110200
  init_home_paths();
110009
110201
  init_is_record();
@@ -114432,12 +114624,12 @@ function linuxUnitPath() {
114432
114624
  function getDaemonServiceStatus() {
114433
114625
  if (shouldSkipPersistentDaemon()) return { supported: false, installed: false };
114434
114626
  if (process.platform === "darwin") {
114435
- const path141 = macPlistPath();
114436
- return { supported: true, installed: (0, import_fs10.existsSync)(path141), path: path141 };
114627
+ const path142 = macPlistPath();
114628
+ return { supported: true, installed: (0, import_fs10.existsSync)(path142), path: path142 };
114437
114629
  }
114438
114630
  if (process.platform === "linux") {
114439
- const path141 = linuxUnitPath();
114440
- return { supported: linuxUserManagerReachable(), installed: (0, import_fs10.existsSync)(path141), path: path141 };
114631
+ const path142 = linuxUnitPath();
114632
+ return { supported: linuxUserManagerReachable(), installed: (0, import_fs10.existsSync)(path142), path: path142 };
114441
114633
  }
114442
114634
  return { supported: false, installed: false };
114443
114635
  }
@@ -114482,9 +114674,9 @@ function macBridgeHasListener(pid, port) {
114482
114674
  }
114483
114675
  return result.stdout.trim() === String(pid);
114484
114676
  }
114485
- function sameFile(path141, device, inode) {
114677
+ function sameFile(path142, device, inode) {
114486
114678
  try {
114487
- const stats = (0, import_fs10.statSync)(path141, { bigint: true });
114679
+ const stats = (0, import_fs10.statSync)(path142, { bigint: true });
114488
114680
  return stats.dev === device && stats.ino === inode;
114489
114681
  } catch {
114490
114682
  return false;
@@ -114566,13 +114758,13 @@ async function stopMacDaemonBridge(invocation, target = macServiceTarget()) {
114566
114758
  }
114567
114759
  throw new Error(`bridge pid ${lock.pid} did not release port ${lock.bridgePort}`);
114568
114760
  }
114569
- async function startMacDaemon(path141, invocation = resolveDaemonInvocation(), target = macServiceTarget()) {
114761
+ async function startMacDaemon(path142, invocation = resolveDaemonInvocation(), target = macServiceTarget()) {
114570
114762
  const service = readMacDaemonState(target);
114571
114763
  const lock = readDaemonLockfile();
114572
114764
  if (service?.state === "running" && service.pid !== null && isDaemonLockfileFresh(lock) && lock.pid === service.pid && macBridgeHasListener(lock.pid, lock.bridgePort))
114573
114765
  return service.pid;
114574
114766
  await stopMacDaemonBridge(invocation, target);
114575
- runLaunchctl(["bootstrap", target.slice(0, target.lastIndexOf("/")), path141]);
114767
+ runLaunchctl(["bootstrap", target.slice(0, target.lastIndexOf("/")), path142]);
114576
114768
  const deadline = Date.now() + 4e3;
114577
114769
  while (Date.now() < deadline) {
114578
114770
  const service2 = readMacDaemonState(target);
@@ -114650,19 +114842,19 @@ async function waitForBridgeRelease(hasListener, lock) {
114650
114842
  }
114651
114843
  async function daemonRestart() {
114652
114844
  if (process.platform === "darwin") {
114653
- const path141 = macPlistPath();
114654
- if (!(0, import_fs10.existsSync)(path141)) {
114845
+ const path142 = macPlistPath();
114846
+ if (!(0, import_fs10.existsSync)(path142)) {
114655
114847
  console.error(" daemon not registered. run `peach daemon install`");
114656
114848
  peachExit(1);
114657
114849
  }
114658
114850
  await stopMacDaemonBridge(resolveDaemonInvocation());
114659
- await startMacDaemon(path141);
114851
+ await startMacDaemon(path142);
114660
114852
  console.log(" restarted");
114661
114853
  return;
114662
114854
  }
114663
114855
  if (process.platform === "linux") {
114664
- const path141 = linuxUnitPath();
114665
- if (!(0, import_fs10.existsSync)(path141)) {
114856
+ const path142 = linuxUnitPath();
114857
+ if (!(0, import_fs10.existsSync)(path142)) {
114666
114858
  console.error(" daemon not registered. run `peach daemon install`");
114667
114859
  peachExit(1);
114668
114860
  }
@@ -115275,9 +115467,9 @@ function property(object6, key2) {
115275
115467
  function oneNativeAppIdentity(source, platform2 = "ios") {
115276
115468
  if (source === void 0) return null;
115277
115469
  const app = property(property(readSource(source).oneOptions(), "native"), "app");
115278
- const text6 = (...path141) => {
115470
+ const text6 = (...path142) => {
115279
115471
  let at = app;
115280
- for (const key2 of path141) at = property(at, key2);
115472
+ for (const key2 of path142) at = property(at, key2);
115281
115473
  return at?.kind === "string" ? at.value : void 0;
115282
115474
  };
115283
115475
  const name3 = text6("displayName") ?? text6("name");
@@ -115323,8 +115515,8 @@ function oneNativeAppIdentity(source, platform2 = "ios") {
115323
115515
  if (key2 !== null && value.kind === "boolean") infoPlistBooleans[key2] = value.value;
115324
115516
  }
115325
115517
  }
115326
- for (const [key2, ...path141] of IOS_PURPOSE_STRINGS) {
115327
- const purpose = text6(...path141);
115518
+ for (const [key2, ...path142] of IOS_PURPOSE_STRINGS) {
115519
+ const purpose = text6(...path142);
115328
115520
  if (purpose !== void 0) infoPlistStrings[key2] = purpose;
115329
115521
  }
115330
115522
  const permissionUsageDescriptions = Object.fromEntries(
@@ -115433,29 +115625,29 @@ function launcherActivities(application) {
115433
115625
  function readModuleNamespace(moduleRoot, manifest) {
115434
115626
  if (manifest.attributes.package) return manifest.attributes.package;
115435
115627
  for (const name3 of ["build.gradle", "build.gradle.kts"]) {
115436
- const file = import_node_path138.default.join(moduleRoot, name3);
115437
- if (!import_node_fs136.default.existsSync(file)) continue;
115628
+ const file = import_node_path139.default.join(moduleRoot, name3);
115629
+ if (!import_node_fs137.default.existsSync(file)) continue;
115438
115630
  const match = /\bnamespace\s*=?\s*["']([\w.]+)["']/.exec(
115439
- import_node_fs136.default.readFileSync(file, "utf8")
115631
+ import_node_fs137.default.readFileSync(file, "utf8")
115440
115632
  );
115441
115633
  if (match) return match[1];
115442
115634
  }
115443
115635
  return void 0;
115444
115636
  }
115445
115637
  function readModuleRootModuleName(moduleRoot) {
115446
- const sourceSets = import_node_path138.default.join(moduleRoot, "src");
115447
- const manifestFile = import_node_path138.default.join(sourceSets, "main/AndroidManifest.xml");
115448
- if (!import_node_fs136.default.existsSync(manifestFile)) return null;
115449
- const document = parseXml(import_node_fs136.default.readFileSync(manifestFile, "utf8"), manifestFile);
115638
+ const sourceSets = import_node_path139.default.join(moduleRoot, "src");
115639
+ const manifestFile = import_node_path139.default.join(sourceSets, "main/AndroidManifest.xml");
115640
+ if (!import_node_fs137.default.existsSync(manifestFile)) return null;
115641
+ const document = parseXml(import_node_fs137.default.readFileSync(manifestFile, "utf8"), manifestFile);
115450
115642
  const manifest = document.children[0];
115451
115643
  const application = manifest?.children.find((child) => child.name === "application");
115452
115644
  if (manifest?.name !== "manifest" || !application) return null;
115453
115645
  const launchers = launcherActivities(application);
115454
115646
  if (launchers.length === 0) return null;
115455
- for (const set2 of import_node_fs136.default.readdirSync(sourceSets, { withFileTypes: true })) {
115456
- const file = import_node_path138.default.join(sourceSets, set2.name, "AndroidManifest.xml");
115457
- if (!set2.isDirectory() || set2.name === "main" || !import_node_fs136.default.existsSync(file)) continue;
115458
- if (import_node_fs136.default.readFileSync(file, "utf8").includes("<activity")) return void 0;
115647
+ for (const set2 of import_node_fs137.default.readdirSync(sourceSets, { withFileTypes: true })) {
115648
+ const file = import_node_path139.default.join(sourceSets, set2.name, "AndroidManifest.xml");
115649
+ if (!set2.isDirectory() || set2.name === "main" || !import_node_fs137.default.existsSync(file)) continue;
115650
+ if (import_node_fs137.default.readFileSync(file, "utf8").includes("<activity")) return void 0;
115459
115651
  }
115460
115652
  const launcher = launchers[0];
115461
115653
  const enabled2 = launcher.attributes["android:enabled"];
@@ -115467,32 +115659,32 @@ function readModuleRootModuleName(moduleRoot) {
115467
115659
  const qualified3 = declared.startsWith(".") ? namespace && `${namespace}${declared}` : declared.includes(".") ? declared : namespace && `${namespace}.${declared}`;
115468
115660
  if (!qualified3 || qualified3.includes("$")) return void 0;
115469
115661
  const relative6 = qualified3.split(".").join("/");
115470
- const files2 = import_node_fs136.default.readdirSync(sourceSets, { withFileTypes: true }).filter((set2) => set2.isDirectory()).flatMap(
115662
+ const files2 = import_node_fs137.default.readdirSync(sourceSets, { withFileTypes: true }).filter((set2) => set2.isDirectory()).flatMap(
115471
115663
  (set2) => ["java", "kotlin"].flatMap(
115472
115664
  (language) => ["kt", "java"].map(
115473
- (extension) => import_node_path138.default.join(sourceSets, set2.name, language, `${relative6}.${extension}`)
115665
+ (extension) => import_node_path139.default.join(sourceSets, set2.name, language, `${relative6}.${extension}`)
115474
115666
  )
115475
115667
  )
115476
- ).filter((file) => import_node_fs136.default.existsSync(file));
115668
+ ).filter((file) => import_node_fs137.default.existsSync(file));
115477
115669
  if (files2.length !== 1) return void 0;
115478
115670
  return readAndroidRootModuleFromActivitySource(
115479
- import_node_fs136.default.readFileSync(files2[0], "utf8"),
115671
+ import_node_fs137.default.readFileSync(files2[0], "utf8"),
115480
115672
  qualified3.slice(qualified3.lastIndexOf(".") + 1)
115481
115673
  );
115482
115674
  }
115483
115675
  function readAndroidLauncherRootModuleName(projectRoot) {
115484
- const androidRoot = import_node_path138.default.join(projectRoot, "android");
115485
- if (!import_node_fs136.default.existsSync(androidRoot)) return void 0;
115486
- const names = import_node_fs136.default.readdirSync(androidRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => readModuleRootModuleName(import_node_path138.default.join(androidRoot, entry.name))).filter((name3) => name3 !== null);
115676
+ const androidRoot = import_node_path139.default.join(projectRoot, "android");
115677
+ if (!import_node_fs137.default.existsSync(androidRoot)) return void 0;
115678
+ const names = import_node_fs137.default.readdirSync(androidRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => readModuleRootModuleName(import_node_path139.default.join(androidRoot, entry.name))).filter((name3) => name3 !== null);
115487
115679
  return names.length === 1 ? names[0] : void 0;
115488
115680
  }
115489
- var import_node_fs136, import_node_path138, STRINGS_AND_COMMENTS, DECLARATION, KOTLIN_LITERAL, JAVA_LITERAL;
115681
+ var import_node_fs137, import_node_path139, STRINGS_AND_COMMENTS, DECLARATION, KOTLIN_LITERAL, JAVA_LITERAL;
115490
115682
  var init_android_root_module = __esm({
115491
115683
  "src/android-root-module.ts"() {
115492
115684
  "use strict";
115493
115685
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
115494
- import_node_fs136 = __toESM(require("node:fs"), 1);
115495
- import_node_path138 = __toESM(require("node:path"), 1);
115686
+ import_node_fs137 = __toESM(require("node:fs"), 1);
115687
+ import_node_path139 = __toESM(require("node:path"), 1);
115496
115688
  init_android_xml();
115497
115689
  STRINGS_AND_COMMENTS = /"(?:\\.|[^"\\])*"|\/\/[^\n]*|\/\*[\s\S]*?\*\//g;
115498
115690
  DECLARATION = /\b(?:fun|String)\s+getMainComponentName\s*\(/g;
@@ -115502,8 +115694,8 @@ var init_android_root_module = __esm({
115502
115694
  });
115503
115695
 
115504
115696
  // src/appBundleResourcesContract.ts
115505
- function isAppBundleResourcePath(path141) {
115506
- return path141.length > 0 && !path141.includes("\0") && !/[\\?#]/.test(path141) && path141.split("/").every((part) => part !== "" && part !== "." && part !== "..");
115697
+ function isAppBundleResourcePath(path142) {
115698
+ return path142.length > 0 && !path142.includes("\0") && !/[\\?#]/.test(path142) && path142.split("/").every((part) => part !== "" && part !== "." && part !== "..");
115507
115699
  }
115508
115700
  var init_appBundleResourcesContract = __esm({
115509
115701
  "src/appBundleResourcesContract.ts"() {
@@ -115516,27 +115708,27 @@ var init_appBundleResourcesContract = __esm({
115516
115708
  function stageAppBundleResources(appDir, origin, iosTarget, environment) {
115517
115709
  const app = readIosAppTarget(appDir, iosTarget, environment);
115518
115710
  if (!app) return {};
115519
- let root = import_node_fs137.default.realpathSync(findWorkspaceRoot(appDir));
115711
+ let root = import_node_fs138.default.realpathSync(findWorkspaceRoot(appDir));
115520
115712
  for (; ; ) {
115521
115713
  const escaped = app.resources.some((file) => {
115522
- const relative6 = import_node_path139.default.relative(root, import_node_fs137.default.realpathSync(file));
115523
- return relative6.startsWith(`..${import_node_path139.default.sep}`) || import_node_path139.default.isAbsolute(relative6);
115714
+ const relative6 = import_node_path140.default.relative(root, import_node_fs138.default.realpathSync(file));
115715
+ return relative6.startsWith(`..${import_node_path140.default.sep}`) || import_node_path140.default.isAbsolute(relative6);
115524
115716
  });
115525
115717
  if (!escaped) break;
115526
- const wider = import_node_fs137.default.realpathSync(findWorkspaceRoot(import_node_path139.default.dirname(root)));
115718
+ const wider = import_node_fs138.default.realpathSync(findWorkspaceRoot(import_node_path140.default.dirname(root)));
115527
115719
  if (wider === root) break;
115528
115720
  root = wider;
115529
115721
  }
115530
115722
  const members2 = /* @__PURE__ */ new Map();
115531
115723
  for (const file of app.resources) {
115532
- const real = import_node_fs137.default.realpathSync(file);
115533
- const relative6 = import_node_path139.default.relative(root, real);
115534
- if (relative6.startsWith(`..${import_node_path139.default.sep}`) || import_node_path139.default.isAbsolute(relative6))
115724
+ const real = import_node_fs138.default.realpathSync(file);
115725
+ const relative6 = import_node_path140.default.relative(root, real);
115726
+ if (relative6.startsWith(`..${import_node_path140.default.sep}`) || import_node_path140.default.isAbsolute(relative6))
115535
115727
  throw new Error("native app resource escapes the Xcode input root");
115536
- const lexical = import_node_path139.default.relative(root, file);
115537
- if (lexical === ".." || lexical.startsWith(`..${import_node_path139.default.sep}`) || import_node_path139.default.isAbsolute(lexical))
115728
+ const lexical = import_node_path140.default.relative(root, file);
115729
+ if (lexical === ".." || lexical.startsWith(`..${import_node_path140.default.sep}`) || import_node_path140.default.isAbsolute(lexical))
115538
115730
  throw new Error("native app resource escapes the selected project");
115539
- const name3 = `Resources/${lexical.split(import_node_path139.default.sep).join("/")}`;
115731
+ const name3 = `Resources/${lexical.split(import_node_path140.default.sep).join("/")}`;
115540
115732
  members2.set(name3, file);
115541
115733
  }
115542
115734
  const resources = enumerateBundleResources([...members2.keys()]);
@@ -115552,21 +115744,21 @@ function stageAppBundleResources(appDir, origin, iosTarget, environment) {
115552
115744
  const content = bytes[index];
115553
115745
  result[base] = {
115554
115746
  uri: urls[index],
115555
- sha256: (0, import_node_crypto71.createHash)("sha256").update(content).digest("hex"),
115747
+ sha256: (0, import_node_crypto72.createHash)("sha256").update(content).digest("hex"),
115556
115748
  contentType: preferredMimeType(base) ?? "application/octet-stream",
115557
115749
  byteLength: content.byteLength
115558
115750
  };
115559
115751
  });
115560
115752
  return result;
115561
115753
  }
115562
- var import_node_crypto71, import_node_fs137, import_node_path139;
115754
+ var import_node_crypto72, import_node_fs138, import_node_path140;
115563
115755
  var init_app_bundle_resources = __esm({
115564
115756
  "cli/app-bundle-resources.ts"() {
115565
115757
  "use strict";
115566
115758
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
115567
- import_node_crypto71 = require("node:crypto");
115568
- import_node_fs137 = __toESM(require("node:fs"), 1);
115569
- import_node_path139 = __toESM(require("node:path"), 1);
115759
+ import_node_crypto72 = require("node:crypto");
115760
+ import_node_fs138 = __toESM(require("node:fs"), 1);
115761
+ import_node_path140 = __toESM(require("node:path"), 1);
115570
115762
  init_uttype_mime();
115571
115763
  init_bundleAssets();
115572
115764
  init_appBundleResourcesContract();
@@ -115669,45 +115861,45 @@ var init_material_symbol_fonts = __esm({
115669
115861
 
115670
115862
  // cli/material-symbol-fonts.ts
115671
115863
  function materialSymbolFontPaths(appDir) {
115672
- const appRequire = (0, import_node_module24.createRequire)(import_node_path140.default.join(appDir, "package.json"));
115864
+ const appRequire = (0, import_node_module24.createRequire)(import_node_path141.default.join(appDir, "package.json"));
115673
115865
  let nativeManifest;
115674
115866
  try {
115675
115867
  nativeManifest = appRequire.resolve("@react-navigation/native/package.json");
115676
115868
  } catch {
115677
115869
  return [];
115678
115870
  }
115679
- const nativePackage = JSON.parse(import_node_fs138.default.readFileSync(nativeManifest, "utf8"));
115871
+ const nativePackage = JSON.parse(import_node_fs139.default.readFileSync(nativeManifest, "utf8"));
115680
115872
  const dependencies = nativePackage && typeof nativePackage === "object" ? Reflect.get(nativePackage, "dependencies") : null;
115681
115873
  if (!dependencies || typeof dependencies !== "object" || !Reflect.has(dependencies, "@react-navigation/material-symbols"))
115682
115874
  return [];
115683
115875
  const nativeRequire = (0, import_node_module24.createRequire)(nativeManifest);
115684
- const symbolsDir = import_node_path140.default.dirname(
115876
+ const symbolsDir = import_node_path141.default.dirname(
115685
115877
  nativeRequire.resolve("@react-navigation/material-symbols/package.json")
115686
115878
  );
115687
- const fontsDir = import_node_path140.default.join(symbolsDir, "assets/fonts");
115688
- const available = import_node_fs138.default.existsSync(fontsDir) ? import_node_fs138.default.readdirSync(fontsDir).filter((name3) => name3.startsWith("MaterialSymbols") && name3.endsWith(".ttf")) : [];
115879
+ const fontsDir = import_node_path141.default.join(symbolsDir, "assets/fonts");
115880
+ const available = import_node_fs139.default.existsSync(fontsDir) ? import_node_fs139.default.readdirSync(fontsDir).filter((name3) => name3.startsWith("MaterialSymbols") && name3.endsWith(".ttf")) : [];
115689
115881
  const manifest = JSON.parse(
115690
- import_node_fs138.default.readFileSync(import_node_path140.default.join(appDir, "package.json"), "utf8")
115882
+ import_node_fs139.default.readFileSync(import_node_path141.default.join(appDir, "package.json"), "utf8")
115691
115883
  );
115692
115884
  return materialSymbolFontNames(manifest, available, symbolsDir).map(
115693
- (name3) => import_node_path140.default.join(fontsDir, name3)
115885
+ (name3) => import_node_path141.default.join(fontsDir, name3)
115694
115886
  );
115695
115887
  }
115696
115888
  function materialSymbolFontAssets(fontPaths) {
115697
115889
  const selected = fontPaths.filter(
115698
115890
  (fontPath) => /^MaterialSymbols(?:Outlined|Rounded|Sharp)_\d+(?:_Filled)?\.ttf$/.test(
115699
- import_node_path140.default.basename(fontPath)
115891
+ import_node_path141.default.basename(fontPath)
115700
115892
  )
115701
115893
  );
115702
115894
  if (!selected.length) return void 0;
115703
- const directory2 = import_node_path140.default.dirname(selected[0]);
115704
- const codepointsFile = import_node_path140.default.join(directory2, "MaterialSymbols.codepoints");
115705
- const mirroredFile = import_node_path140.default.join(directory2, "MaterialSymbols.mirrored");
115706
- const digest3 = (0, import_node_crypto72.createHash)("md5");
115895
+ const directory2 = import_node_path141.default.dirname(selected[0]);
115896
+ const codepointsFile = import_node_path141.default.join(directory2, "MaterialSymbols.codepoints");
115897
+ const mirroredFile = import_node_path141.default.join(directory2, "MaterialSymbols.mirrored");
115898
+ const digest3 = (0, import_node_crypto73.createHash)("md5");
115707
115899
  for (const asset of [...selected, codepointsFile, mirroredFile].sort(
115708
- (a, b) => import_node_path140.default.basename(a) < import_node_path140.default.basename(b) ? -1 : import_node_path140.default.basename(a) > import_node_path140.default.basename(b) ? 1 : 0
115900
+ (a, b) => import_node_path141.default.basename(a) < import_node_path141.default.basename(b) ? -1 : import_node_path141.default.basename(a) > import_node_path141.default.basename(b) ? 1 : 0
115709
115901
  )) {
115710
- digest3.update(import_node_fs138.default.readFileSync(asset));
115902
+ digest3.update(import_node_fs139.default.readFileSync(asset));
115711
115903
  }
115712
115904
  return {
115713
115905
  hash: digest3.digest("hex").slice(0, 8),
@@ -115715,15 +115907,15 @@ function materialSymbolFontAssets(fontPaths) {
115715
115907
  mirroredPath: mirroredFile
115716
115908
  };
115717
115909
  }
115718
- var import_node_crypto72, import_node_fs138, import_node_module24, import_node_path140;
115910
+ var import_node_crypto73, import_node_fs139, import_node_module24, import_node_path141;
115719
115911
  var init_material_symbol_fonts2 = __esm({
115720
115912
  "cli/material-symbol-fonts.ts"() {
115721
115913
  "use strict";
115722
115914
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
115723
- import_node_crypto72 = require("node:crypto");
115724
- import_node_fs138 = __toESM(require("node:fs"), 1);
115915
+ import_node_crypto73 = require("node:crypto");
115916
+ import_node_fs139 = __toESM(require("node:fs"), 1);
115725
115917
  import_node_module24 = require("node:module");
115726
- import_node_path140 = __toESM(require("node:path"), 1);
115918
+ import_node_path141 = __toESM(require("node:path"), 1);
115727
115919
  init_material_symbol_fonts();
115728
115920
  }
115729
115921
  });
@@ -115731,11 +115923,11 @@ var init_material_symbol_fonts2 = __esm({
115731
115923
  // cli/app-fonts.ts
115732
115924
  function discoverNativeLinkedAppFonts(opts) {
115733
115925
  const { paths, materialSymbols } = discoverNativeLinkedAppFontAssets(opts);
115734
- const realProjectRoot = import_node_fs139.default.realpathSync(opts.projectDir);
115926
+ const realProjectRoot = import_node_fs140.default.realpathSync(opts.projectDir);
115735
115927
  const specs = getCliRuntime().engine_config_plugin_fonts.nativeLinkedFontSpecsFromPaths(
115736
115928
  projectRelativeFontPaths(opts.projectDir, paths),
115737
115929
  nativeFontPlatform(opts.platform),
115738
- (fontPath) => stageHostFile(import_node_path141.default.resolve(realProjectRoot, fontPath), opts.nativeAssetOrigin)
115930
+ (fontPath) => stageHostFile(import_node_path142.default.resolve(realProjectRoot, fontPath), opts.nativeAssetOrigin)
115739
115931
  );
115740
115932
  attachMaterialSymbolMetadata(
115741
115933
  specs,
@@ -115759,28 +115951,28 @@ function attachMaterialSymbolMetadata(specs, files2, assetUrl) {
115759
115951
  };
115760
115952
  }
115761
115953
  function projectRelativeFontPaths(projectDir, fontPaths) {
115762
- const projectRoot = import_node_path141.default.resolve(projectDir);
115763
- const realProjectRoot = import_node_fs139.default.realpathSync(projectDir);
115954
+ const projectRoot = import_node_path142.default.resolve(projectDir);
115955
+ const realProjectRoot = import_node_fs140.default.realpathSync(projectDir);
115764
115956
  return fontPaths.map((fontPath) => {
115765
- const lexical = import_node_path141.default.relative(projectRoot, fontPath);
115766
- const relative6 = lexical.startsWith("..") || import_node_path141.default.isAbsolute(lexical) ? import_node_path141.default.relative(realProjectRoot, import_node_fs139.default.realpathSync(fontPath)) : lexical;
115767
- return relative6.split(import_node_path141.default.sep).join("/");
115957
+ const lexical = import_node_path142.default.relative(projectRoot, fontPath);
115958
+ const relative6 = lexical.startsWith("..") || import_node_path142.default.isAbsolute(lexical) ? import_node_path142.default.relative(realProjectRoot, import_node_fs140.default.realpathSync(fontPath)) : lexical;
115959
+ return relative6.split(import_node_path142.default.sep).join("/");
115768
115960
  });
115769
115961
  }
115770
115962
  function resolveDeclaredFontPath(appDir, declared) {
115771
- let resolved = import_node_path141.default.resolve(appDir, declared);
115772
- if (!import_node_fs139.default.existsSync(resolved)) {
115963
+ let resolved = import_node_path142.default.resolve(appDir, declared);
115964
+ if (!import_node_fs140.default.existsSync(resolved)) {
115773
115965
  try {
115774
- resolved = (0, import_node_module25.createRequire)(import_node_path141.default.join(appDir, "package.json")).resolve(declared);
115966
+ resolved = (0, import_node_module25.createRequire)(import_node_path142.default.join(appDir, "package.json")).resolve(declared);
115775
115967
  } catch {
115776
115968
  return [];
115777
115969
  }
115778
115970
  }
115779
- return import_node_fs139.default.statSync(resolved).isDirectory() ? import_node_fs139.default.readdirSync(resolved).map((file) => import_node_path141.default.join(resolved, file)) : [resolved];
115971
+ return import_node_fs140.default.statSync(resolved).isDirectory() ? import_node_fs140.default.readdirSync(resolved).map((file) => import_node_path142.default.join(resolved, file)) : [resolved];
115780
115972
  }
115781
115973
  function isFile(filePath) {
115782
115974
  try {
115783
- return import_node_fs139.default.statSync(filePath).isFile();
115975
+ return import_node_fs140.default.statSync(filePath).isFile();
115784
115976
  } catch {
115785
115977
  return false;
115786
115978
  }
@@ -115826,13 +116018,13 @@ function discoverNativeLinkedAppFontAssets(opts) {
115826
116018
  scannedFontDirectories++;
115827
116019
  let entries;
115828
116020
  try {
115829
- entries = import_node_fs139.default.readdirSync(current2.dir, { withFileTypes: true });
116021
+ entries = import_node_fs140.default.readdirSync(current2.dir, { withFileTypes: true });
115830
116022
  } catch {
115831
116023
  continue;
115832
116024
  }
115833
116025
  for (const entry of entries) {
115834
116026
  if (entry.isSymbolicLink()) continue;
115835
- const fullPath = import_node_path141.default.join(current2.dir, entry.name);
116027
+ const fullPath = import_node_path142.default.join(current2.dir, entry.name);
115836
116028
  if (entry.isDirectory()) {
115837
116029
  if (current2.depth < 4 && pending2.length < 64 && !entry.name.startsWith(".")) {
115838
116030
  pending2.push({ dir: fullPath, depth: current2.depth + 1 });
@@ -115847,7 +116039,7 @@ function discoverNativeLinkedAppFontAssets(opts) {
115847
116039
  };
115848
116040
  try {
115849
116041
  const packageJson = JSON.parse(
115850
- import_node_fs139.default.readFileSync(import_node_path141.default.join(selectedAppDir, "package.json"), "utf8")
116042
+ import_node_fs140.default.readFileSync(import_node_path142.default.join(selectedAppDir, "package.json"), "utf8")
115851
116043
  );
115852
116044
  const dependencyNames = /* @__PURE__ */ new Set();
115853
116045
  for (const field2 of ["dependencies", "devDependencies", "optionalDependencies"]) {
@@ -115862,22 +116054,22 @@ function discoverNativeLinkedAppFontAssets(opts) {
115862
116054
  const config = Reflect.get(packageJson, "reactNativeVectorIcons");
115863
116055
  const configuredFontDir = config && typeof config === "object" ? Reflect.get(config, "fontDir") : null;
115864
116056
  const configuredDir = typeof configuredFontDir === "string" ? configuredFontDir : "rnvi-fonts";
115865
- const root = import_node_path141.default.resolve(selectedAppDir, configuredDir);
115866
- const relativeRoot = import_node_path141.default.relative(selectedAppDir, root);
115867
- if (!relativeRoot.startsWith("..") && !import_node_path141.default.isAbsolute(relativeRoot)) {
116057
+ const root = import_node_path142.default.resolve(selectedAppDir, configuredDir);
116058
+ const relativeRoot = import_node_path142.default.relative(selectedAppDir, root);
116059
+ if (!relativeRoot.startsWith("..") && !import_node_path142.default.isAbsolute(relativeRoot)) {
115868
116060
  collectFontFiles(root);
115869
116061
  }
115870
- const vectorIconRequire = (0, import_node_module25.createRequire)(import_node_path141.default.join(selectedAppDir, "package.json"));
116062
+ const vectorIconRequire = (0, import_node_module25.createRequire)(import_node_path142.default.join(selectedAppDir, "package.json"));
115871
116063
  for (const dependencyName of vectorIconDependencies) {
115872
116064
  try {
115873
116065
  const entryPath = vectorIconRequire.resolve(dependencyName);
115874
- const dependencyPath = dependencyName.split("/").join(import_node_path141.default.sep);
115875
- const marker = `${import_node_path141.default.sep}node_modules${import_node_path141.default.sep}${dependencyPath}${import_node_path141.default.sep}`;
116066
+ const dependencyPath = dependencyName.split("/").join(import_node_path142.default.sep);
116067
+ const marker = `${import_node_path142.default.sep}node_modules${import_node_path142.default.sep}${dependencyPath}${import_node_path142.default.sep}`;
115876
116068
  const markerIndex = entryPath.lastIndexOf(marker);
115877
116069
  if (markerIndex === -1) continue;
115878
116070
  const packageRoot = entryPath.slice(0, markerIndex + marker.length - 1);
115879
116071
  const fontsDir = dependencyName === "react-native-vector-icons" ? "Fonts" : "fonts";
115880
- collectFontFiles(import_node_path141.default.join(packageRoot, fontsDir));
116072
+ collectFontFiles(import_node_path142.default.join(packageRoot, fontsDir));
115881
116073
  } catch {
115882
116074
  }
115883
116075
  }
@@ -115885,17 +116077,17 @@ function discoverNativeLinkedAppFontAssets(opts) {
115885
116077
  } catch {
115886
116078
  }
115887
116079
  try {
115888
- const configPath = import_node_path141.default.join(selectedAppDir, "react-native.config.js");
115889
- if (import_node_fs139.default.statSync(configPath).isFile()) {
115890
- const appConfigRequire = (0, import_node_module25.createRequire)(import_node_path141.default.join(selectedAppDir, "package.json"));
116080
+ const configPath = import_node_path142.default.join(selectedAppDir, "react-native.config.js");
116081
+ if (import_node_fs140.default.statSync(configPath).isFile()) {
116082
+ const appConfigRequire = (0, import_node_module25.createRequire)(import_node_path142.default.join(selectedAppDir, "package.json"));
115891
116083
  const rnConfig = appConfigRequire(configPath);
115892
116084
  const assets2 = rnConfig && typeof rnConfig === "object" ? Reflect.get(rnConfig, "assets") : null;
115893
116085
  if (Array.isArray(assets2)) {
115894
116086
  for (const assetDir of assets2) {
115895
116087
  if (typeof assetDir !== "string") continue;
115896
- const root = import_node_path141.default.resolve(selectedAppDir, assetDir);
115897
- const relativeRoot = import_node_path141.default.relative(selectedAppDir, root);
115898
- if (relativeRoot.startsWith("..") || import_node_path141.default.isAbsolute(relativeRoot)) continue;
116088
+ const root = import_node_path142.default.resolve(selectedAppDir, assetDir);
116089
+ const relativeRoot = import_node_path142.default.relative(selectedAppDir, root);
116090
+ if (relativeRoot.startsWith("..") || import_node_path142.default.isAbsolute(relativeRoot)) continue;
115899
116091
  collectFontFiles(root);
115900
116092
  }
115901
116093
  }
@@ -115903,33 +116095,33 @@ function discoverNativeLinkedAppFontAssets(opts) {
115903
116095
  } catch {
115904
116096
  }
115905
116097
  if (platform2 === "ios") {
115906
- const iosDir = import_node_path141.default.join(selectedAppDir, "ios");
116098
+ const iosDir = import_node_path142.default.join(selectedAppDir, "ios");
115907
116099
  try {
115908
- const targetDirs = import_node_fs139.default.readdirSync(iosDir, { withFileTypes: true }).filter(
116100
+ const targetDirs = import_node_fs140.default.readdirSync(iosDir, { withFileTypes: true }).filter(
115909
116101
  (entry) => entry.isDirectory() && !entry.isSymbolicLink() && entry.name !== "Pods" && entry.name !== "build" && !entry.name.startsWith(".")
115910
116102
  ).slice(0, 64);
115911
116103
  const bundledByName = /* @__PURE__ */ new Map();
115912
- for (const entry of import_node_fs139.default.readdirSync(iosDir, { withFileTypes: true })) {
116104
+ for (const entry of import_node_fs140.default.readdirSync(iosDir, { withFileTypes: true })) {
115913
116105
  if (!entry.isDirectory() || !entry.name.endsWith(".xcodeproj")) continue;
115914
- const xcodeproj = import_node_path141.default.join(iosDir, entry.name);
116106
+ const xcodeproj = import_node_path142.default.join(iosDir, entry.name);
115915
116107
  for (const target of listXcodeAppTargets(xcodeproj, { requireSources: false })) {
115916
116108
  const members2 = readXcodeAppTarget(xcodeproj, target, void 0, {
115917
116109
  requireSources: false
115918
116110
  });
115919
116111
  for (const file of members2.resources) {
115920
- if (!bundledByName.has(import_node_path141.default.basename(file)))
115921
- bundledByName.set(import_node_path141.default.basename(file), file);
116112
+ if (!bundledByName.has(import_node_path142.default.basename(file)))
116113
+ bundledByName.set(import_node_path142.default.basename(file), file);
115922
116114
  }
115923
116115
  }
115924
116116
  }
115925
- const plistPaths = [import_node_path141.default.join(iosDir, "Info.plist")];
116117
+ const plistPaths = [import_node_path142.default.join(iosDir, "Info.plist")];
115926
116118
  for (const entry of targetDirs) {
115927
- plistPaths.push(import_node_path141.default.join(iosDir, entry.name, "Info.plist"));
116119
+ plistPaths.push(import_node_path142.default.join(iosDir, entry.name, "Info.plist"));
115928
116120
  }
115929
116121
  for (const plistPath of plistPaths) {
115930
116122
  let parsed;
115931
116123
  try {
115932
- parsed = parsePlistSource(import_node_fs139.default.readFileSync(plistPath, "utf8"));
116124
+ parsed = parsePlistSource(import_node_fs140.default.readFileSync(plistPath, "utf8"));
115933
116125
  } catch {
115934
116126
  continue;
115935
116127
  }
@@ -115940,12 +116132,12 @@ function discoverNativeLinkedAppFontAssets(opts) {
115940
116132
  if (typeof declaredFont !== "string") continue;
115941
116133
  const bundled = bundledByName.get(declaredFont);
115942
116134
  const candidates = [
115943
- import_node_path141.default.resolve(import_node_path141.default.dirname(plistPath), declaredFont),
115944
- import_node_path141.default.resolve(iosDir, declaredFont)
116135
+ import_node_path142.default.resolve(import_node_path142.default.dirname(plistPath), declaredFont),
116136
+ import_node_path142.default.resolve(iosDir, declaredFont)
115945
116137
  ];
115946
116138
  const fontPath = candidates.find((candidate) => {
115947
- const relative6 = import_node_path141.default.relative(selectedAppDir, candidate);
115948
- if (relative6.startsWith("..") || import_node_path141.default.isAbsolute(relative6)) return false;
116139
+ const relative6 = import_node_path142.default.relative(selectedAppDir, candidate);
116140
+ if (relative6.startsWith("..") || import_node_path142.default.isAbsolute(relative6)) return false;
115949
116141
  return isFile(candidate);
115950
116142
  }) ?? (bundled && isFile(bundled) ? bundled : void 0);
115951
116143
  if (fontPath) fontPaths.push(fontPath);
@@ -115959,14 +116151,14 @@ function discoverNativeLinkedAppFontAssets(opts) {
115959
116151
  materialSymbols: materialSymbolFontAssets(materialFonts)
115960
116152
  };
115961
116153
  }
115962
- var import_node_fs139, import_node_module25, import_node_path141, require3;
116154
+ var import_node_fs140, import_node_module25, import_node_path142, require3;
115963
116155
  var init_app_fonts = __esm({
115964
116156
  "cli/app-fonts.ts"() {
115965
116157
  "use strict";
115966
116158
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
115967
- import_node_fs139 = __toESM(require("node:fs"), 1);
116159
+ import_node_fs140 = __toESM(require("node:fs"), 1);
115968
116160
  import_node_module25 = require("node:module");
115969
- import_node_path141 = __toESM(require("node:path"), 1);
116161
+ import_node_path142 = __toESM(require("node:path"), 1);
115970
116162
  init_cli_runtime();
115971
116163
  init_staged_host_files();
115972
116164
  init_native_firebase_config();
@@ -116239,7 +116431,7 @@ function splashImageOnDisk(imageUrl, appDir) {
116239
116431
  const { pathname } = new URL(imageUrl);
116240
116432
  if (!pathname.startsWith("/assets/")) return false;
116241
116433
  try {
116242
- return import_node_fs140.default.statSync(import_node_path142.default.join(appDir, decodeURIComponent(pathname.slice("/assets/".length)))).isFile();
116434
+ return import_node_fs141.default.statSync(import_node_path143.default.join(appDir, decodeURIComponent(pathname.slice("/assets/".length)))).isFile();
116243
116435
  } catch {
116244
116436
  return false;
116245
116437
  }
@@ -116285,18 +116477,18 @@ function stageBuiltBundleManifest(bundleUrl, config) {
116285
116477
  const bundle = new URL(bundleUrl);
116286
116478
  if (!isStagedHostFileRequest(bundle.pathname) || Object.keys(config).length === 0)
116287
116479
  return null;
116288
- const directory2 = import_node_fs140.default.mkdtempSync(import_node_path142.default.join(import_node_os24.default.tmpdir(), "peach-app-manifest-"));
116480
+ const directory2 = import_node_fs141.default.mkdtempSync(import_node_path143.default.join(import_node_os24.default.tmpdir(), "peach-app-manifest-"));
116289
116481
  try {
116290
- const file = import_node_path142.default.join(directory2, "manifest.json");
116291
- import_node_fs140.default.writeFileSync(file, JSON.stringify({ extra: { expoClient: config } }));
116482
+ const file = import_node_path143.default.join(directory2, "manifest.json");
116483
+ import_node_fs141.default.writeFileSync(file, JSON.stringify({ extra: { expoClient: config } }));
116292
116484
  return stageHostFile(file, bundle.origin);
116293
116485
  } finally {
116294
- import_node_fs140.default.rmSync(directory2, { recursive: true, force: true });
116486
+ import_node_fs141.default.rmSync(directory2, { recursive: true, force: true });
116295
116487
  }
116296
116488
  }
116297
116489
  function readOneConfigNativeAppIdentity(appDir, platform2) {
116298
- const config = import_node_path142.default.join(appDir, "vite.config.ts");
116299
- return import_node_fs140.default.existsSync(config) ? oneNativeAppIdentity(import_node_fs140.default.readFileSync(config, "utf8"), platform2) : null;
116490
+ const config = import_node_path143.default.join(appDir, "vite.config.ts");
116491
+ return import_node_fs141.default.existsSync(config) ? oneNativeAppIdentity(import_node_fs141.default.readFileSync(config, "utf8"), platform2) : null;
116300
116492
  }
116301
116493
  function readProjectNativeAppIdentityWire(project2, platform2, iosTarget, environment) {
116302
116494
  if (!canExtractNativeAppIdentity(platform2)) return null;
@@ -116509,14 +116701,14 @@ function applyShellLaunchOptions(url, opts) {
116509
116701
  for (const entry of opts.args ?? []) url.searchParams.append("arg", entry);
116510
116702
  return url;
116511
116703
  }
116512
- var import_node_fs140, import_node_os24, import_node_path142, SHELL_APPS, DEV_BUNDLE_RESOLVE_ATTEMPTS, DEV_BUNDLE_RESOLVE_INTERVAL_MS, startedExpoConfigReads;
116704
+ var import_node_fs141, import_node_os24, import_node_path143, SHELL_APPS, DEV_BUNDLE_RESOLVE_ATTEMPTS, DEV_BUNDLE_RESOLVE_INTERVAL_MS, startedExpoConfigReads;
116513
116705
  var init_shell_url = __esm({
116514
116706
  "cli/commands/shell-url.ts"() {
116515
116707
  "use strict";
116516
116708
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
116517
- import_node_fs140 = __toESM(require("node:fs"), 1);
116709
+ import_node_fs141 = __toESM(require("node:fs"), 1);
116518
116710
  import_node_os24 = __toESM(require("node:os"), 1);
116519
- import_node_path142 = __toESM(require("node:path"), 1);
116711
+ import_node_path143 = __toESM(require("node:path"), 1);
116520
116712
  init_oneViteAliases();
116521
116713
  init_dev_server_scanner();
116522
116714
  init_android_root_module();
@@ -116566,12 +116758,12 @@ var init_shell_url = __esm({
116566
116758
  // cli/commands/skills.ts
116567
116759
  function getSkillsDir() {
116568
116760
  if (typeof __PEACH_BUNDLED_SKILLS__ !== "undefined") {
116569
- const dir = path126.join(rnxHomeDir(), "skills", getCliVersion());
116761
+ const dir = path127.join(rnxHomeDir(), "skills", getCliVersion());
116570
116762
  for (const [file, body] of Object.entries(__PEACH_BUNDLED_SKILLS__)) {
116571
- const target = path126.join(dir, file);
116572
- if (fs100.existsSync(target)) continue;
116573
- fs100.mkdirSync(path126.dirname(target), { recursive: true });
116574
- fs100.writeFileSync(target, body);
116763
+ const target = path127.join(dir, file);
116764
+ if (fs101.existsSync(target)) continue;
116765
+ fs101.mkdirSync(path127.dirname(target), { recursive: true });
116766
+ fs101.writeFileSync(target, body);
116575
116767
  }
116576
116768
  return dir;
116577
116769
  }
@@ -116579,10 +116771,10 @@ function getSkillsDir() {
116579
116771
  const pkgPath = (0, import_url3.fileURLToPath)(
116580
116772
  import_meta4.resolve(`${rnxPublicBrand.packageName}/package.json`)
116581
116773
  );
116582
- return primaryCheckoutPath(path126.join(path126.dirname(pkgPath), "skills"));
116774
+ return primaryCheckoutPath(path127.join(path127.dirname(pkgPath), "skills"));
116583
116775
  } catch {
116584
- const __dirname = path126.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
116585
- return primaryCheckoutPath(path126.resolve(__dirname, "../../skills"));
116776
+ const __dirname = path127.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
116777
+ return primaryCheckoutPath(path127.resolve(__dirname, "../../skills"));
116586
116778
  }
116587
116779
  }
116588
116780
  function primaryCheckoutPath(dir) {
@@ -116605,39 +116797,39 @@ function primaryCheckoutPath(dir) {
116605
116797
  } catch {
116606
116798
  return dir;
116607
116799
  }
116608
- if (path126.basename(common) !== ".git") return dir;
116609
- const primary = path126.join(path126.dirname(common), path126.relative(top, dir));
116610
- return fs100.existsSync(primary) ? primary : dir;
116800
+ if (path127.basename(common) !== ".git") return dir;
116801
+ const primary = path127.join(path127.dirname(common), path127.relative(top, dir));
116802
+ return fs101.existsSync(primary) ? primary : dir;
116611
116803
  }
116612
116804
  function skillsDir() {
116613
116805
  skillsDirPath ??= getSkillsDir();
116614
116806
  return skillsDirPath;
116615
116807
  }
116616
116808
  function targetFromHome(envName, fallbackDir) {
116617
- const home = process.env[envName] || path126.join(os21.homedir(), fallbackDir);
116618
- return path126.join(home, "skills");
116809
+ const home = process.env[envName] || path127.join(os21.homedir(), fallbackDir);
116810
+ return path127.join(home, "skills");
116619
116811
  }
116620
116812
  function codexTargets() {
116621
116813
  const homes = /* @__PURE__ */ new Map();
116622
116814
  const userHome = process.env.HOME || os21.homedir();
116623
- const primaryCodexHome = process.env.CODEX_HOME || path126.join(userHome, ".codex");
116624
- homes.set(path126.resolve(primaryCodexHome), "codex");
116815
+ const primaryCodexHome = process.env.CODEX_HOME || path127.join(userHome, ".codex");
116816
+ homes.set(path127.resolve(primaryCodexHome), "codex");
116625
116817
  const tmCodexHomes = process.env.TM_CODEX_HOMES;
116626
116818
  if (tmCodexHomes) {
116627
- for (const h of tmCodexHomes.split(path126.delimiter)) {
116819
+ for (const h of tmCodexHomes.split(path127.delimiter)) {
116628
116820
  if (h.trim()) {
116629
- const resolved = path126.resolve(h.trim());
116821
+ const resolved = path127.resolve(h.trim());
116630
116822
  if (!homes.has(resolved)) {
116631
- homes.set(resolved, path126.basename(resolved).replace(/^\./, ""));
116823
+ homes.set(resolved, path127.basename(resolved).replace(/^\./, ""));
116632
116824
  }
116633
116825
  }
116634
116826
  }
116635
116827
  }
116636
- const tmHome = process.env.TM_HOME || path126.join(userHome, ".team-machine");
116637
- const enginePath = path126.join(tmHome, "engine.yaml");
116638
- if (fs100.existsSync(enginePath)) {
116828
+ const tmHome = process.env.TM_HOME || path127.join(userHome, ".team-machine");
116829
+ const enginePath = path127.join(tmHome, "engine.yaml");
116830
+ if (fs101.existsSync(enginePath)) {
116639
116831
  try {
116640
- const engine = parse(fs100.readFileSync(enginePath, "utf8"));
116832
+ const engine = parse(fs101.readFileSync(enginePath, "utf8"));
116641
116833
  let accounts = engine;
116642
116834
  for (const key2 of ["accounts", "providers", "codex", "accounts"]) {
116643
116835
  accounts = isRecord(accounts) ? accounts[key2] : void 0;
@@ -116645,8 +116837,8 @@ function codexTargets() {
116645
116837
  for (const [name3, account] of Object.entries(isRecord(accounts) ? accounts : {})) {
116646
116838
  const configured = isRecord(account) ? account.home : void 0;
116647
116839
  if (typeof configured !== "string") continue;
116648
- const homeDir = configured.startsWith("~") ? path126.join(userHome, configured.slice(1)) : configured;
116649
- const resolved = path126.resolve(homeDir);
116840
+ const homeDir = configured.startsWith("~") ? path127.join(userHome, configured.slice(1)) : configured;
116841
+ const resolved = path127.resolve(homeDir);
116650
116842
  if (!homes.has(resolved)) {
116651
116843
  homes.set(resolved, `codex-${name3}`);
116652
116844
  }
@@ -116655,13 +116847,13 @@ function codexTargets() {
116655
116847
  }
116656
116848
  }
116657
116849
  try {
116658
- for (const entry of fs100.readdirSync(userHome)) {
116850
+ for (const entry of fs101.readdirSync(userHome)) {
116659
116851
  if (entry.startsWith(".codex-")) {
116660
- const fullPath = path126.join(userHome, entry);
116852
+ const fullPath = path127.join(userHome, entry);
116661
116853
  try {
116662
- const stat2 = fs100.statSync(fullPath);
116854
+ const stat2 = fs101.statSync(fullPath);
116663
116855
  if (stat2.isDirectory()) {
116664
- const resolved = path126.resolve(fullPath);
116856
+ const resolved = path127.resolve(fullPath);
116665
116857
  if (!homes.has(resolved)) {
116666
116858
  homes.set(resolved, entry.replace(/^\./, ""));
116667
116859
  }
@@ -116676,7 +116868,7 @@ function codexTargets() {
116676
116868
  for (const [homePath, label] of homes) {
116677
116869
  targets.push({
116678
116870
  label,
116679
- dir: path126.join(homePath, "skills")
116871
+ dir: path127.join(homePath, "skills")
116680
116872
  });
116681
116873
  }
116682
116874
  return targets;
@@ -116692,7 +116884,7 @@ function hasInstalledPeachSkills() {
116692
116884
  (file) => /^([^/]+)\/SKILL\.md$/.exec(file)?.[1] ?? []
116693
116885
  ) : listSkills().map((skill7) => skill7.name);
116694
116886
  return defaultAgentTargets().some(
116695
- ({ dir }) => names.some((name3) => fs100.existsSync(path126.join(dir, name3, "SKILL.md")))
116887
+ ({ dir }) => names.some((name3) => fs101.existsSync(path127.join(dir, name3, "SKILL.md")))
116696
116888
  );
116697
116889
  }
116698
116890
  function parseSkillFrontmatter(content) {
@@ -116735,27 +116927,27 @@ function readFrontmatterField(frontmatter, field2) {
116735
116927
  return null;
116736
116928
  }
116737
116929
  function listSkills() {
116738
- if (!fs100.existsSync(skillsDir())) return [];
116930
+ if (!fs101.existsSync(skillsDir())) return [];
116739
116931
  const skills = [];
116740
- for (const entry of fs100.readdirSync(skillsDir())) {
116741
- const skillMd = path126.join(skillsDir(), entry, "SKILL.md");
116742
- if (!fs100.existsSync(skillMd)) continue;
116743
- const meta = parseSkillFrontmatter(fs100.readFileSync(skillMd, "utf8"));
116932
+ for (const entry of fs101.readdirSync(skillsDir())) {
116933
+ const skillMd = path127.join(skillsDir(), entry, "SKILL.md");
116934
+ if (!fs101.existsSync(skillMd)) continue;
116935
+ const meta = parseSkillFrontmatter(fs101.readFileSync(skillMd, "utf8"));
116744
116936
  if (meta) {
116745
116937
  skills.push({ name: entry, description: meta.description });
116746
116938
  }
116747
116939
  }
116748
116940
  return skills.sort((a, b) => a.name.localeCompare(b.name));
116749
116941
  }
116750
- var import_child_process9, fs100, os21, path126, import_url3, import_meta4, skillsDirPath;
116942
+ var import_child_process9, fs101, os21, path127, import_url3, import_meta4, skillsDirPath;
116751
116943
  var init_skills = __esm({
116752
116944
  "cli/commands/skills.ts"() {
116753
116945
  "use strict";
116754
116946
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
116755
116947
  import_child_process9 = require("child_process");
116756
- fs100 = __toESM(require("fs"), 1);
116948
+ fs101 = __toESM(require("fs"), 1);
116757
116949
  os21 = __toESM(require("os"), 1);
116758
- path126 = __toESM(require("path"), 1);
116950
+ path127 = __toESM(require("path"), 1);
116759
116951
  import_url3 = require("url");
116760
116952
  init_browser();
116761
116953
  init_cli_version();
@@ -117107,8 +117299,8 @@ __export(metro_bundle_assets_exports, {
117107
117299
  stageMetroBundleAssets: () => stageMetroBundleAssets
117108
117300
  });
117109
117301
  async function stageMetroBundleAssets(bundleFile, source, origin) {
117110
- const directory2 = import_node_path143.default.join(import_node_path143.default.dirname(bundleFile), "assets");
117111
- if (!import_node_fs141.default.existsSync(directory2)) return;
117302
+ const directory2 = import_node_path144.default.join(import_node_path144.default.dirname(bundleFile), "assets");
117303
+ if (!import_node_fs142.default.existsSync(directory2)) return;
117112
117304
  const descriptors = extractAssetDescriptors(source).filter(
117113
117305
  (descriptor) => !isEmbeddedAssetDescriptor(descriptor)
117114
117306
  );
@@ -117132,14 +117324,14 @@ async function stageMetroBundleAssets(bundleFile, source, origin) {
117132
117324
  const bytes = scales.map((scale) => {
117133
117325
  const relative6 = placement.files.get(scale);
117134
117326
  if (!relative6 || !search.dest) throw new Error("Metro asset scale is missing");
117135
- return import_node_fs141.default.readFileSync(import_node_path143.default.join(search.dest.directory, relative6));
117327
+ return import_node_fs142.default.readFileSync(import_node_path144.default.join(search.dest.directory, relative6));
117136
117328
  });
117137
117329
  const verified2 = perFile && hashes ? bytes.every((content, i) => {
117138
- const hash = (0, import_node_crypto73.createHash)("md5").update(content).digest("hex");
117330
+ const hash = (0, import_node_crypto74.createHash)("md5").update(content).digest("hex");
117139
117331
  return descriptor.scales.some(
117140
117332
  (scale, j) => scale === scales[i] && hashes[j] === hash
117141
117333
  );
117142
- }) : scales.length === descriptor.scales.length && (0, import_node_crypto73.createHash)("md5").update(Buffer.concat(bytes)).digest("hex") === descriptor.hash;
117334
+ }) : scales.length === descriptor.scales.length && (0, import_node_crypto74.createHash)("md5").update(Buffer.concat(bytes)).digest("hex") === descriptor.hash;
117143
117335
  if (!verified2)
117144
117336
  throw new Error(`Metro asset changed while staging: ${descriptor.name}`);
117145
117337
  scales.forEach((scale, i) => {
@@ -117166,14 +117358,14 @@ async function stageMetroBundleAssets(bundleFile, source, origin) {
117166
117358
  });
117167
117359
  stageHostMetroAssets(staged, origin);
117168
117360
  }
117169
- var import_node_crypto73, import_node_fs141, import_node_path143;
117361
+ var import_node_crypto74, import_node_fs142, import_node_path144;
117170
117362
  var init_metro_bundle_assets = __esm({
117171
117363
  "cli/metro-bundle-assets.ts"() {
117172
117364
  "use strict";
117173
117365
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
117174
- import_node_crypto73 = require("node:crypto");
117175
- import_node_fs141 = __toESM(require("node:fs"), 1);
117176
- import_node_path143 = __toESM(require("node:path"), 1);
117366
+ import_node_crypto74 = require("node:crypto");
117367
+ import_node_fs142 = __toESM(require("node:fs"), 1);
117368
+ import_node_path144 = __toESM(require("node:path"), 1);
117177
117369
  init_metroAssetArtifact();
117178
117370
  init_staged_host_files();
117179
117371
  }
@@ -117200,9 +117392,9 @@ async function runStreamCommand(args, opts = {}) {
117200
117392
  });
117201
117393
  if (typeof simId !== "string" || !simId)
117202
117394
  throw new Error("Could not identify the local simulator.");
117203
- const directory2 = (0, import_node_path144.join)(rnxHomeDir(), "streams");
117204
- (0, import_node_fs142.mkdirSync)(directory2, { recursive: true });
117205
- const file = (0, import_node_path144.join)(directory2, `${encodeURIComponent(simId)}.json`);
117395
+ const directory2 = (0, import_node_path145.join)(rnxHomeDir(), "streams");
117396
+ (0, import_node_fs143.mkdirSync)(directory2, { recursive: true });
117397
+ const file = (0, import_node_path145.join)(directory2, `${encodeURIComponent(simId)}.json`);
117206
117398
  const state = await callInBridge(bridge, "SootSim.bridges.videoStream.state");
117207
117399
  if (action === "status") {
117208
117400
  console.log(` stream: ${state}`);
@@ -117227,13 +117419,13 @@ async function runStreamCommand(args, opts = {}) {
117227
117419
  await callInBridge(bridge, "SootSim.bridges.videoStream.stop");
117228
117420
  let record4 = null;
117229
117421
  try {
117230
- record4 = recordSchema.parse(JSON.parse((0, import_node_fs142.readFileSync)(file, "utf8")));
117422
+ record4 = recordSchema.parse(JSON.parse((0, import_node_fs143.readFileSync)(file, "utf8")));
117231
117423
  } catch (error) {
117232
117424
  if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
117233
117425
  throw error;
117234
117426
  }
117235
117427
  if (record4) await stopSession(record4);
117236
- (0, import_node_fs142.rmSync)(file, { force: true });
117428
+ (0, import_node_fs143.rmSync)(file, { force: true });
117237
117429
  console.log(" stream: off");
117238
117430
  return;
117239
117431
  }
@@ -117269,7 +117461,7 @@ async function runStreamCommand(args, opts = {}) {
117269
117461
  token: registration.token
117270
117462
  });
117271
117463
  writeSecureJsonAtomic(file, record3);
117272
- removeRecord = () => (0, import_node_fs142.rmSync)(file, { force: true });
117464
+ removeRecord = () => (0, import_node_fs143.rmSync)(file, { force: true });
117273
117465
  console.log(` ${record3.watchUrl}`);
117274
117466
  console.log(" Press Ctrl+C to stop streaming.");
117275
117467
  await new Promise((resolve14) => {
@@ -117279,10 +117471,10 @@ async function runStreamCommand(args, opts = {}) {
117279
117471
  process.off("SIGTERM", finish);
117280
117472
  resolve14();
117281
117473
  };
117282
- const watcher = (0, import_node_fs142.watch)(directory2, (_event, filename) => {
117474
+ const watcher = (0, import_node_fs143.watch)(directory2, (_event, filename) => {
117283
117475
  if (filename !== `${encodeURIComponent(simId)}.json`) return;
117284
117476
  try {
117285
- (0, import_node_fs142.readFileSync)(file);
117477
+ (0, import_node_fs143.readFileSync)(file);
117286
117478
  } catch (error) {
117287
117479
  if (error instanceof Error && "code" in error && error.code === "ENOENT")
117288
117480
  finish();
@@ -117306,13 +117498,13 @@ async function runStreamCommand(args, opts = {}) {
117306
117498
  }
117307
117499
  }
117308
117500
  }
117309
- var import_node_fs142, import_node_path144, import_zod2, STREAM_FLAG, registrationSchema, recordSchema;
117501
+ var import_node_fs143, import_node_path145, import_zod2, STREAM_FLAG, registrationSchema, recordSchema;
117310
117502
  var init_stream = __esm({
117311
117503
  "cli/commands/stream.ts"() {
117312
117504
  "use strict";
117313
117505
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
117314
- import_node_fs142 = require("node:fs");
117315
- import_node_path144 = require("node:path");
117506
+ import_node_fs143 = require("node:fs");
117507
+ import_node_path145 = require("node:path");
117316
117508
  import_zod2 = require("zod");
117317
117509
  init_home_paths();
117318
117510
  init_public_brand();
@@ -117354,14 +117546,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
117354
117546
  const neededPackages = /* @__PURE__ */ new Set();
117355
117547
  const factories = [];
117356
117548
  const visit3 = (filePath) => {
117357
- const real = import_node_fs143.default.realpathSync(filePath);
117549
+ const real = import_node_fs144.default.realpathSync(filePath);
117358
117550
  const previous = files2.get(real);
117359
117551
  if (previous !== void 0) return previous;
117360
117552
  const id = "peach-config-file:" + files2.size;
117361
117553
  files2.set(real, id);
117362
117554
  const compiled = compileReplacementModule({
117363
117555
  filePath: real,
117364
- source: import_node_fs143.default.readFileSync(real, "utf8"),
117556
+ source: import_node_fs144.default.readFileSync(real, "utf8"),
117365
117557
  runtimePackages,
117366
117558
  localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
117367
117559
  });
@@ -117385,7 +117577,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
117385
117577
  if (!entries || typeof entries !== "object") continue;
117386
117578
  for (const resolution of Object.values(entries)) {
117387
117579
  if (resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string") {
117388
- resolution.file = visit3(import_node_path145.default.resolve(resolution.file));
117580
+ resolution.file = visit3(import_node_path146.default.resolve(resolution.file));
117389
117581
  }
117390
117582
  }
117391
117583
  }
@@ -117409,13 +117601,13 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
117409
117601
  const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
117410
117602
  return prefix + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
117411
117603
  }
117412
- var import_node_fs143, import_node_path145, import_sucrase3, import_terser2, PREFIX_START, PREFIX_END;
117604
+ var import_node_fs144, import_node_path146, import_sucrase3, import_terser2, PREFIX_START, PREFIX_END;
117413
117605
  var init_configured_bundle_producer = __esm({
117414
117606
  "src/configured-bundle-producer.ts"() {
117415
117607
  "use strict";
117416
117608
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
117417
- import_node_fs143 = __toESM(require("node:fs"), 1);
117418
- import_node_path145 = __toESM(require("node:path"), 1);
117609
+ import_node_fs144 = __toESM(require("node:fs"), 1);
117610
+ import_node_path146 = __toESM(require("node:path"), 1);
117419
117611
  init_bundle_global_footer();
117420
117612
  import_sucrase3 = require("sucrase");
117421
117613
  import_terser2 = require("terser");
@@ -117725,9 +117917,9 @@ var init_android_theme = __esm({
117725
117917
 
117726
117918
  // src/android-drawables.ts
117727
117919
  function readAndroidDrawables(moduleDir, sources) {
117728
- const res = import_node_path146.default.join(moduleDir, "src/main/res");
117920
+ const res = import_node_path147.default.join(moduleDir, "src/main/res");
117729
117921
  const byName = /* @__PURE__ */ new Map();
117730
- for (const dir of import_node_fs144.default.existsSync(res) ? import_node_fs144.default.readdirSync(res).sort() : []) {
117922
+ for (const dir of import_node_fs145.default.existsSync(res) ? import_node_fs145.default.readdirSync(res).sort() : []) {
117731
117923
  if (!dir.startsWith("drawable")) continue;
117732
117924
  const match = DRAWABLE_DIR.exec(dir);
117733
117925
  const qualifier = match?.[1];
@@ -117737,10 +117929,10 @@ function readAndroidDrawables(moduleDir, sources) {
117737
117929
  `${res}/${dir}: drawables under this qualifier are not resolved by Peach yet`
117738
117930
  );
117739
117931
  const version2 = Number(match[2] ?? 0);
117740
- for (const entry of import_node_fs144.default.readdirSync(import_node_path146.default.join(res, dir)).sort()) {
117932
+ for (const entry of import_node_fs145.default.readdirSync(import_node_path147.default.join(res, dir)).sort()) {
117741
117933
  if (!entry.endsWith(".xml") && !BITMAP.test(entry)) continue;
117742
117934
  const name3 = entry.replace(BITMAP, "").replace(/\.xml$/, "");
117743
- const file = import_node_path146.default.join(res, dir, entry);
117935
+ const file = import_node_path147.default.join(res, dir, entry);
117744
117936
  const files2 = byName.get(name3) ?? [];
117745
117937
  byName.set(name3, files2);
117746
117938
  if (version2 > DEVICE_API) continue;
@@ -117753,7 +117945,7 @@ function readAndroidDrawables(moduleDir, sources) {
117753
117945
  ninePatch: entry.endsWith(".9.png")
117754
117946
  });
117755
117947
  else {
117756
- const root = parseXml(import_node_fs144.default.readFileSync(file, "utf8"), file).children[0];
117948
+ const root = parseXml(import_node_fs145.default.readFileSync(file, "utf8"), file).children[0];
117757
117949
  files2.push(
117758
117950
  root?.name === "vector" ? {
117759
117951
  file,
@@ -117920,13 +118112,13 @@ function readVector(root, file, sources) {
117920
118112
  calls
117921
118113
  };
117922
118114
  }
117923
- var import_node_fs144, import_node_path146, DEVICE_API, BUCKETS, DRAWABLE_DIR, BITMAP;
118115
+ var import_node_fs145, import_node_path147, DEVICE_API, BUCKETS, DRAWABLE_DIR, BITMAP;
117924
118116
  var init_android_drawables = __esm({
117925
118117
  "src/android-drawables.ts"() {
117926
118118
  "use strict";
117927
118119
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
117928
- import_node_fs144 = __toESM(require("node:fs"), 1);
117929
- import_node_path146 = __toESM(require("node:path"), 1);
118120
+ import_node_fs145 = __toESM(require("node:fs"), 1);
118121
+ import_node_path147 = __toESM(require("node:path"), 1);
117930
118122
  init_android_theme();
117931
118123
  init_android_xml();
117932
118124
  DEVICE_API = 37;
@@ -117948,12 +118140,12 @@ var init_android_drawables = __esm({
117948
118140
 
117949
118141
  // src/android-layout-ids.ts
117950
118142
  function readAndroidLayoutIds(moduleDir) {
117951
- const res = import_node_path147.default.join(moduleDir, "src/main/res");
118143
+ const res = import_node_path148.default.join(moduleDir, "src/main/res");
117952
118144
  const layouts = /* @__PURE__ */ new Set();
117953
118145
  const ids = /* @__PURE__ */ new Set();
117954
118146
  const elements = /* @__PURE__ */ new Map();
117955
- for (const dir of import_node_fs145.default.existsSync(res) ? import_node_fs145.default.readdirSync(res).sort() : []) {
117956
- const directory2 = import_node_path147.default.join(res, dir);
118147
+ for (const dir of import_node_fs146.default.existsSync(res) ? import_node_fs146.default.readdirSync(res).sort() : []) {
118148
+ const directory2 = import_node_path148.default.join(res, dir);
117957
118149
  if (dir === "layout" || dir.startsWith("layout-")) {
117958
118150
  const match = LAYOUT_DIR.exec(dir);
117959
118151
  if (!match)
@@ -117963,13 +118155,13 @@ function readAndroidLayoutIds(moduleDir) {
117963
118155
  const orientation = match[1] === "port" ? 1 : match[1] === "land" ? 2 : 0;
117964
118156
  const night = match[2] === "notnight" ? 1 : match[2] === "night" ? 2 : 0;
117965
118157
  const version2 = Number(match[3] ?? 0);
117966
- for (const entry of import_node_fs145.default.readdirSync(directory2).sort()) {
118158
+ for (const entry of import_node_fs146.default.readdirSync(directory2).sort()) {
117967
118159
  if (!entry.endsWith(".xml")) continue;
117968
118160
  const name3 = entry.slice(0, -".xml".length);
117969
118161
  layouts.add(name3);
117970
- const xml = import_node_fs145.default.readFileSync(import_node_path147.default.join(directory2, entry), "utf8");
118162
+ const xml = import_node_fs146.default.readFileSync(import_node_path148.default.join(directory2, entry), "utf8");
117971
118163
  for (const reference of xml.matchAll(ID_REFERENCE)) ids.add(reference[1]);
117972
- const element = parseXml(xml, import_node_path147.default.join(directory2, entry)).children[0];
118164
+ const element = parseXml(xml, import_node_path148.default.join(directory2, entry)).children[0];
117973
118165
  if (!element || version2 > DEVICE_API) continue;
117974
118166
  elements.set(name3, [
117975
118167
  ...elements.get(name3) ?? [],
@@ -117977,9 +118169,9 @@ function readAndroidLayoutIds(moduleDir) {
117977
118169
  ]);
117978
118170
  }
117979
118171
  } else if (dir.startsWith("values")) {
117980
- for (const entry of import_node_fs145.default.readdirSync(directory2).sort()) {
118172
+ for (const entry of import_node_fs146.default.readdirSync(directory2).sort()) {
117981
118173
  if (!entry.endsWith(".xml")) continue;
117982
- const xml = import_node_fs145.default.readFileSync(import_node_path147.default.join(directory2, entry), "utf8");
118174
+ const xml = import_node_fs146.default.readFileSync(import_node_path148.default.join(directory2, entry), "utf8");
117983
118175
  for (const item of xml.matchAll(ID_ITEM)) {
117984
118176
  const name3 = ITEM_NAME.exec(item[0])?.[1];
117985
118177
  if (name3) ids.add(name3);
@@ -117989,13 +118181,13 @@ function readAndroidLayoutIds(moduleDir) {
117989
118181
  }
117990
118182
  return { layouts: [...layouts].sort(), ids: [...ids].sort(), elements };
117991
118183
  }
117992
- var import_node_fs145, import_node_path147, LAYOUT_DIR, ID_REFERENCE, ID_ITEM, ITEM_NAME;
118184
+ var import_node_fs146, import_node_path148, LAYOUT_DIR, ID_REFERENCE, ID_ITEM, ITEM_NAME;
117993
118185
  var init_android_layout_ids = __esm({
117994
118186
  "src/android-layout-ids.ts"() {
117995
118187
  "use strict";
117996
118188
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
117997
- import_node_fs145 = __toESM(require("node:fs"), 1);
117998
- import_node_path147 = __toESM(require("node:path"), 1);
118189
+ import_node_fs146 = __toESM(require("node:fs"), 1);
118190
+ import_node_path148 = __toESM(require("node:path"), 1);
117999
118191
  init_android_drawables();
118000
118192
  init_android_xml();
118001
118193
  LAYOUT_DIR = /^layout(?:-(port|land))?(?:-(notnight|night))?(?:-v(\d+))?$/;
@@ -118010,15 +118202,15 @@ function readAndroidStrings(moduleDir) {
118010
118202
  const strings7 = /* @__PURE__ */ new Map();
118011
118203
  const plurals = /* @__PURE__ */ new Map();
118012
118204
  const arrays = /* @__PURE__ */ new Map();
118013
- const res = import_node_path148.default.join(moduleDir, "src/main/res");
118014
- const dirs = import_node_fs146.default.existsSync(res) ? import_node_fs146.default.readdirSync(res).sort() : [];
118205
+ const res = import_node_path149.default.join(moduleDir, "src/main/res");
118206
+ const dirs = import_node_fs147.default.existsSync(res) ? import_node_fs147.default.readdirSync(res).sort() : [];
118015
118207
  for (const dir of dirs) {
118016
118208
  if (!dir.startsWith("values")) continue;
118017
118209
  const qualifier = VALUES_DIR.exec(dir);
118018
- for (const entry of import_node_fs146.default.readdirSync(import_node_path148.default.join(res, dir)).sort()) {
118210
+ for (const entry of import_node_fs147.default.readdirSync(import_node_path149.default.join(res, dir)).sort()) {
118019
118211
  if (!entry.endsWith(".xml")) continue;
118020
- const file = import_node_path148.default.join(res, dir, entry);
118021
- const text6 = import_node_fs146.default.readFileSync(file, "utf8").replace(/<!--[\s\S]*?-->/g, "");
118212
+ const file = import_node_path149.default.join(res, dir, entry);
118213
+ const text6 = import_node_fs147.default.readFileSync(file, "utf8").replace(/<!--[\s\S]*?-->/g, "");
118022
118214
  for (const match of text6.matchAll(ELEMENT)) {
118023
118215
  const kind = match[1] ?? "";
118024
118216
  const name3 = NAME.exec(match[2] ?? "")?.[1];
@@ -118069,13 +118261,13 @@ function compileString(raw2, where) {
118069
118261
  where
118070
118262
  );
118071
118263
  }
118072
- var import_node_fs146, import_node_path148, VALUES_DIR, ELEMENT, ITEM, NAME, QUANTITY, QUANTITIES, isQuantity, sorted;
118264
+ var import_node_fs147, import_node_path149, VALUES_DIR, ELEMENT, ITEM, NAME, QUANTITY, QUANTITIES, isQuantity, sorted;
118073
118265
  var init_android_strings = __esm({
118074
118266
  "src/android-strings.ts"() {
118075
118267
  "use strict";
118076
118268
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
118077
- import_node_fs146 = __toESM(require("node:fs"), 1);
118078
- import_node_path148 = __toESM(require("node:path"), 1);
118269
+ import_node_fs147 = __toESM(require("node:fs"), 1);
118270
+ import_node_path149 = __toESM(require("node:path"), 1);
118079
118271
  init_android_string_value();
118080
118272
  init_android_xml();
118081
118273
  VALUES_DIR = /^values(?:-([a-z]{2,3})(?:-r([A-Z]{2}))?)?$/;
@@ -129459,7 +129651,7 @@ function repositories(body, where) {
129459
129651
  if (name3 === "google") roots.push("https://dl.google.com/dl/android/maven2");
129460
129652
  else if (name3 === "mavenCentral") roots.push("https://repo1.maven.org/maven2");
129461
129653
  else if (name3 === "mavenLocal")
129462
- roots.push(import_node_path149.default.join(import_node_os25.default.homedir(), ".m2", "repository"));
129654
+ roots.push(import_node_path150.default.join(import_node_os25.default.homedir(), ".m2", "repository"));
129463
129655
  else {
129464
129656
  const declared = direct ?? /["']([^"']+)["']/.exec(block2 ?? "")?.[1];
129465
129657
  if (!declared)
@@ -129474,9 +129666,9 @@ function repositories(body, where) {
129474
129666
  return roots;
129475
129667
  }
129476
129668
  function mavenRepositories(projectDir, where) {
129477
- const file = ["settings.gradle.kts", "settings.gradle"].map((name3) => import_node_path149.default.join(projectDir, name3)).find((candidate) => import_node_fs147.default.existsSync(candidate));
129669
+ const file = ["settings.gradle.kts", "settings.gradle"].map((name3) => import_node_path150.default.join(projectDir, name3)).find((candidate) => import_node_fs148.default.existsSync(candidate));
129478
129670
  if (!file) throw new Error(`${where}: ${projectDir} has no settings.gradle`);
129479
- const text6 = import_node_fs147.default.readFileSync(file, "utf8");
129671
+ const text6 = import_node_fs148.default.readFileSync(file, "utf8");
129480
129672
  const management = text6.search(/\bdependencyResolutionManagement\b/);
129481
129673
  if (management < 0)
129482
129674
  throw new Error(`${where}: ${file} declares no dependency repositories`);
@@ -129531,43 +129723,43 @@ function zipSources(bytes, where) {
129531
129723
  const localExtra = bytes.readUInt16LE(localOffset + 28);
129532
129724
  const start = localOffset + 30 + localName + localExtra;
129533
129725
  const payload = bytes.subarray(start, start + compressed);
129534
- const data = method === 0 ? Buffer.from(payload) : method === 8 ? (0, import_node_zlib4.inflateRawSync)(payload) : null;
129726
+ const data = method === 0 ? Buffer.from(payload) : method === 8 ? (0, import_node_zlib5.inflateRawSync)(payload) : null;
129535
129727
  if (!data) throw new Error(`${where}: ${name3} uses zip method ${method}`);
129536
129728
  entries.push({ name: name3, data });
129537
129729
  }
129538
129730
  return entries;
129539
129731
  }
129540
129732
  function extract(bytes, where) {
129541
- const key2 = (0, import_node_crypto74.createHash)("sha256").update(bytes).digest("hex");
129733
+ const key2 = (0, import_node_crypto75.createHash)("sha256").update(bytes).digest("hex");
129542
129734
  const cached4 = pending.get(key2);
129543
129735
  if (cached4) return cached4;
129544
129736
  const request = (async () => {
129545
- const dest = import_node_path149.default.join(import_node_os25.default.tmpdir(), "peach-maven-sources", key2);
129546
- const marker = import_node_path149.default.join(dest, ".complete");
129547
- if (!import_node_fs147.default.existsSync(marker)) {
129737
+ const dest = import_node_path150.default.join(import_node_os25.default.tmpdir(), "peach-maven-sources", key2);
129738
+ const marker = import_node_path150.default.join(dest, ".complete");
129739
+ if (!import_node_fs148.default.existsSync(marker)) {
129548
129740
  const entries = zipSources(bytes, where);
129549
129741
  const java = entries.find((entry) => entry.name.endsWith(".java"));
129550
129742
  if (java) throw new Error(`${where}: ${java.name} is a Java source`);
129551
129743
  const kotlin = entries.filter((entry) => entry.name.endsWith(".kt"));
129552
129744
  if (kotlin.length === 0) throw new Error(`${where}: sources jar has no Kotlin`);
129553
129745
  const staging = `${dest}.partial-${process.pid}`;
129554
- import_node_fs147.default.rmSync(staging, { recursive: true, force: true });
129746
+ import_node_fs148.default.rmSync(staging, { recursive: true, force: true });
129555
129747
  for (const entry of kotlin) {
129556
- const file = import_node_path149.default.join(staging, entry.name);
129557
- import_node_fs147.default.mkdirSync(import_node_path149.default.dirname(file), { recursive: true });
129558
- import_node_fs147.default.writeFileSync(file, entry.data);
129748
+ const file = import_node_path150.default.join(staging, entry.name);
129749
+ import_node_fs148.default.mkdirSync(import_node_path150.default.dirname(file), { recursive: true });
129750
+ import_node_fs148.default.writeFileSync(file, entry.data);
129559
129751
  }
129560
- import_node_fs147.default.writeFileSync(import_node_path149.default.join(staging, ".complete"), "");
129752
+ import_node_fs148.default.writeFileSync(import_node_path150.default.join(staging, ".complete"), "");
129561
129753
  try {
129562
- import_node_fs147.default.renameSync(staging, dest);
129754
+ import_node_fs148.default.renameSync(staging, dest);
129563
129755
  } catch (error) {
129564
- import_node_fs147.default.rmSync(staging, { recursive: true, force: true });
129565
- if (!import_node_fs147.default.existsSync(marker)) throw error;
129756
+ import_node_fs148.default.rmSync(staging, { recursive: true, force: true });
129757
+ if (!import_node_fs148.default.existsSync(marker)) throw error;
129566
129758
  }
129567
129759
  }
129568
- return import_node_fs147.default.readdirSync(dest, { recursive: true }).flatMap((entry) => {
129760
+ return import_node_fs148.default.readdirSync(dest, { recursive: true }).flatMap((entry) => {
129569
129761
  const name3 = String(entry);
129570
- return name3.endsWith(".kt") ? [import_node_path149.default.join(dest, name3)] : [];
129762
+ return name3.endsWith(".kt") ? [import_node_path150.default.join(dest, name3)] : [];
129571
129763
  }).sort();
129572
129764
  })().catch((error) => {
129573
129765
  pending.delete(key2);
@@ -129590,8 +129782,8 @@ async function sourcesJar(root, group, artifact, version2) {
129590
129782
  if (!response.ok) throw new Error(`${url} answered ${response.status}`);
129591
129783
  return Buffer.from(await response.arrayBuffer());
129592
129784
  }
129593
- const file = import_node_path149.default.join(root, ...parts);
129594
- return import_node_fs147.default.existsSync(file) ? import_node_fs147.default.readFileSync(file) : null;
129785
+ const file = import_node_path150.default.join(root, ...parts);
129786
+ return import_node_fs148.default.existsSync(file) ? import_node_fs148.default.readFileSync(file) : null;
129595
129787
  }
129596
129788
  async function mavenKotlinSources(projectDir, coordinate, where) {
129597
129789
  const { group, artifact, version: version2 } = coordinate;
@@ -129601,28 +129793,28 @@ async function mavenKotlinSources(projectDir, coordinate, where) {
129601
129793
  }
129602
129794
  return null;
129603
129795
  }
129604
- var import_node_crypto74, import_node_fs147, import_node_os25, import_node_path149, import_node_zlib4, pending;
129796
+ var import_node_crypto75, import_node_fs148, import_node_os25, import_node_path150, import_node_zlib5, pending;
129605
129797
  var init_kotlin_maven_sources = __esm({
129606
129798
  "src/kotlin-maven-sources.ts"() {
129607
129799
  "use strict";
129608
129800
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
129609
- import_node_crypto74 = require("node:crypto");
129610
- import_node_fs147 = __toESM(require("node:fs"), 1);
129801
+ import_node_crypto75 = require("node:crypto");
129802
+ import_node_fs148 = __toESM(require("node:fs"), 1);
129611
129803
  import_node_os25 = __toESM(require("node:os"), 1);
129612
- import_node_path149 = __toESM(require("node:path"), 1);
129613
- import_node_zlib4 = require("node:zlib");
129804
+ import_node_path150 = __toESM(require("node:path"), 1);
129805
+ import_node_zlib5 = require("node:zlib");
129614
129806
  pending = /* @__PURE__ */ new Map();
129615
129807
  }
129616
129808
  });
129617
129809
 
129618
129810
  // src/kotlin-version-catalog.ts
129619
- var import_node_fs148, import_node_path150, import_smol_toml, accessorName, KotlinVersionCatalog;
129811
+ var import_node_fs149, import_node_path151, import_smol_toml, accessorName, KotlinVersionCatalog;
129620
129812
  var init_kotlin_version_catalog = __esm({
129621
129813
  "src/kotlin-version-catalog.ts"() {
129622
129814
  "use strict";
129623
129815
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
129624
- import_node_fs148 = __toESM(require("node:fs"), 1);
129625
- import_node_path150 = __toESM(require("node:path"), 1);
129816
+ import_node_fs149 = __toESM(require("node:fs"), 1);
129817
+ import_node_path151 = __toESM(require("node:path"), 1);
129626
129818
  import_smol_toml = require("smol-toml");
129627
129819
  init_is_record();
129628
129820
  accessorName = (name3) => name3.replace(/[-_.]/g, ".");
@@ -129630,8 +129822,8 @@ var init_kotlin_version_catalog = __esm({
129630
129822
  file;
129631
129823
  tables;
129632
129824
  constructor(projectDir) {
129633
- this.file = import_node_path150.default.join(projectDir, "gradle/libs.versions.toml");
129634
- this.tables = import_node_fs148.default.existsSync(this.file) ? (0, import_smol_toml.parse)(import_node_fs148.default.readFileSync(this.file, "utf8")) : {};
129825
+ this.file = import_node_path151.default.join(projectDir, "gradle/libs.versions.toml");
129826
+ this.tables = import_node_fs149.default.existsSync(this.file) ? (0, import_smol_toml.parse)(import_node_fs149.default.readFileSync(this.file, "utf8")) : {};
129635
129827
  }
129636
129828
  entry(section, accessor, where) {
129637
129829
  const table = this.tables[section];
@@ -129689,7 +129881,7 @@ __export(kotlin_app_exports, {
129689
129881
  });
129690
129882
  function readAndroidPins(moduleRoot) {
129691
129883
  const toolchain = JSON.parse(
129692
- import_node_fs149.default.readFileSync(import_node_path151.default.join(moduleRoot, "toolchain.json"), "utf8")
129884
+ import_node_fs150.default.readFileSync(import_node_path152.default.join(moduleRoot, "toolchain.json"), "utf8")
129693
129885
  );
129694
129886
  if (!isRecord(toolchain))
129695
129887
  throw new Error("peachsim kotlin/toolchain.json is not an object");
@@ -129730,8 +129922,8 @@ function readAndroidPins(moduleRoot) {
129730
129922
  }
129731
129923
  function readGradle(dir) {
129732
129924
  for (const name3 of ["build.gradle.kts", "build.gradle"]) {
129733
- const file = import_node_path151.default.join(dir, name3);
129734
- if (import_node_fs149.default.existsSync(file)) return { file, text: import_node_fs149.default.readFileSync(file, "utf8") };
129925
+ const file = import_node_path152.default.join(dir, name3);
129926
+ if (import_node_fs150.default.existsSync(file)) return { file, text: import_node_fs150.default.readFileSync(file, "utf8") };
129735
129927
  }
129736
129928
  return null;
129737
129929
  }
@@ -129928,15 +130120,15 @@ function themeSources(moduleDir, night) {
129928
130120
  } : { android, app: read("values") };
129929
130121
  }
129930
130122
  function valuesFiles(moduleDir, qualifier) {
129931
- const values = import_node_path151.default.join(moduleDir, "src/main/res", qualifier);
129932
- return import_node_fs149.default.existsSync(values) ? import_node_fs149.default.readdirSync(values).filter((entry) => entry.endsWith(".xml")).map((entry) => {
129933
- const file = import_node_path151.default.join(values, entry);
129934
- return { file, text: import_node_fs149.default.readFileSync(file, "utf8") };
130123
+ const values = import_node_path152.default.join(moduleDir, "src/main/res", qualifier);
130124
+ return import_node_fs150.default.existsSync(values) ? import_node_fs150.default.readdirSync(values).filter((entry) => entry.endsWith(".xml")).map((entry) => {
130125
+ const file = import_node_path152.default.join(values, entry);
130126
+ return { file, text: import_node_fs150.default.readFileSync(file, "utf8") };
129935
130127
  }) : [];
129936
130128
  }
129937
130129
  function readAppColors(moduleDir, theme) {
129938
- const res = import_node_path151.default.join(moduleDir, "src/main/res");
129939
- for (const dir of import_node_fs149.default.existsSync(res) ? import_node_fs149.default.readdirSync(res).sort() : []) {
130130
+ const res = import_node_path152.default.join(moduleDir, "src/main/res");
130131
+ for (const dir of import_node_fs150.default.existsSync(res) ? import_node_fs150.default.readdirSync(res).sort() : []) {
129940
130132
  if (!dir.startsWith("values") || dir === "values" || dir === "values-night") continue;
129941
130133
  const colors = Object.keys(readResourceValues(valuesFiles(moduleDir, dir)).colors);
129942
130134
  if (colors.length > 0)
@@ -130008,17 +130200,17 @@ function isLauncher(element) {
130008
130200
  );
130009
130201
  }
130010
130202
  async function readKotlinApp(moduleArg, options) {
130011
- const moduleDir = import_node_fs149.default.realpathSync(import_node_path151.default.resolve(moduleArg));
130012
- const manifestFile = import_node_path151.default.join(moduleDir, "src/main/AndroidManifest.xml");
130013
- if (!import_node_fs149.default.existsSync(manifestFile))
130203
+ const moduleDir = import_node_fs150.default.realpathSync(import_node_path152.default.resolve(moduleArg));
130204
+ const manifestFile = import_node_path152.default.join(moduleDir, "src/main/AndroidManifest.xml");
130205
+ if (!import_node_fs150.default.existsSync(manifestFile))
130014
130206
  throw new Error(
130015
130207
  `${moduleDir} is not an Android app module: no src/main/AndroidManifest.xml`
130016
130208
  );
130017
130209
  let projectDir = moduleDir;
130018
130210
  while (!["settings.gradle.kts", "settings.gradle"].some(
130019
- (name3) => import_node_fs149.default.existsSync(import_node_path151.default.join(projectDir, name3))
130211
+ (name3) => import_node_fs150.default.existsSync(import_node_path152.default.join(projectDir, name3))
130020
130212
  )) {
130021
- const parent = import_node_path151.default.dirname(projectDir);
130213
+ const parent = import_node_path152.default.dirname(projectDir);
130022
130214
  if (parent === projectDir)
130023
130215
  throw new Error(`${moduleDir} has no settings.gradle above it`);
130024
130216
  projectDir = parent;
@@ -130060,7 +130252,7 @@ async function readKotlinApp(moduleArg, options) {
130060
130252
  const language = /^(\d+)\.(\d+)/.exec(kotlin)?.slice(1, 3).join(".");
130061
130253
  if (!language)
130062
130254
  throw new Error(`Kotlin plugin version ${kotlin} names no language version`);
130063
- const manifest = parseXml(import_node_fs149.default.readFileSync(manifestFile, "utf8"), manifestFile);
130255
+ const manifest = parseXml(import_node_fs150.default.readFileSync(manifestFile, "utf8"), manifestFile);
130064
130256
  const root = manifest.children.find((element) => element.name === "manifest");
130065
130257
  const application = root?.children.find((element) => element.name === "application");
130066
130258
  if (!root || !application) throw new Error(`${manifestFile} has no <application>`);
@@ -130154,11 +130346,11 @@ async function readKotlinApp(moduleArg, options) {
130154
130346
  const sources = selected ? selected.kotlin : [];
130155
130347
  if (!selected)
130156
130348
  for (const set2 of ["java", "kotlin"]) {
130157
- const dir = import_node_path151.default.join(moduleDir, "src/main", set2);
130158
- if (!import_node_fs149.default.existsSync(dir)) continue;
130349
+ const dir = import_node_path152.default.join(moduleDir, "src/main", set2);
130350
+ if (!import_node_fs150.default.existsSync(dir)) continue;
130159
130351
  const walk3 = (current2) => {
130160
- for (const entry of import_node_fs149.default.readdirSync(current2, { withFileTypes: true })) {
130161
- const full = import_node_path151.default.join(current2, entry.name);
130352
+ for (const entry of import_node_fs150.default.readdirSync(current2, { withFileTypes: true })) {
130353
+ const full = import_node_path152.default.join(current2, entry.name);
130162
130354
  if (entry.isDirectory()) walk3(full);
130163
130355
  else if (entry.name.endsWith(".java"))
130164
130356
  throw new Error(`${full}: Java sources are not supported by peach open`);
@@ -130203,13 +130395,13 @@ async function readKotlinApp(moduleArg, options) {
130203
130395
  layoutIds: readAndroidLayoutIds(moduleDir)
130204
130396
  };
130205
130397
  }
130206
- var import_node_fs149, import_node_path151, ANDROID_NS, MAIN, LAUNCHER, PLUGINS, PLATFORM_GROUPS, PLATFORM_ARTIFACTS, ANDROID_PIN;
130398
+ var import_node_fs150, import_node_path152, ANDROID_NS, MAIN, LAUNCHER, PLUGINS, PLATFORM_GROUPS, PLATFORM_ARTIFACTS, ANDROID_PIN;
130207
130399
  var init_kotlin_app = __esm({
130208
130400
  "src/kotlin-app.ts"() {
130209
130401
  "use strict";
130210
130402
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
130211
- import_node_fs149 = __toESM(require("node:fs"), 1);
130212
- import_node_path151 = __toESM(require("node:path"), 1);
130403
+ import_node_fs150 = __toESM(require("node:fs"), 1);
130404
+ import_node_path152 = __toESM(require("node:path"), 1);
130213
130405
  init_android_drawables();
130214
130406
  init_android_layout_ids();
130215
130407
  init_android_strings();
@@ -130261,24 +130453,24 @@ __export(native_input_exports, {
130261
130453
  });
130262
130454
  function resolveNativeInput(target) {
130263
130455
  if (!target || /^\w+:\/\//.test(target) || /^\d+$/.test(target)) return null;
130264
- const resolved = import_node_path152.default.resolve(target);
130265
- const stat2 = import_node_fs150.default.statSync(resolved, { throwIfNoEntry: false });
130456
+ const resolved = import_node_path153.default.resolve(target);
130457
+ const stat2 = import_node_fs151.default.statSync(resolved, { throwIfNoEntry: false });
130266
130458
  if (!stat2) return null;
130267
130459
  if (stat2.isFile()) {
130268
- if (resolved.endsWith(".swift") && import_node_path152.default.basename(resolved) !== "Package.swift")
130269
- return { kind: "swift-file", path: import_node_fs150.default.realpathSync(resolved) };
130270
- if (import_node_path152.default.basename(resolved) === "Package.swift")
130271
- return { kind: "swift-package", path: import_node_fs150.default.realpathSync(import_node_path152.default.dirname(resolved)) };
130460
+ if (resolved.endsWith(".swift") && import_node_path153.default.basename(resolved) !== "Package.swift")
130461
+ return { kind: "swift-file", path: import_node_fs151.default.realpathSync(resolved) };
130462
+ if (import_node_path153.default.basename(resolved) === "Package.swift")
130463
+ return { kind: "swift-package", path: import_node_fs151.default.realpathSync(import_node_path153.default.dirname(resolved)) };
130272
130464
  return null;
130273
130465
  }
130274
130466
  if (!stat2.isDirectory()) return null;
130275
- if (import_node_fs150.default.existsSync(import_node_path152.default.join(resolved, "Package.swift")))
130276
- return { kind: "swift-package", path: import_node_fs150.default.realpathSync(resolved) };
130467
+ if (import_node_fs151.default.existsSync(import_node_path153.default.join(resolved, "Package.swift")))
130468
+ return { kind: "swift-package", path: import_node_fs151.default.realpathSync(resolved) };
130277
130469
  const xcode = findXcodeProject(resolved);
130278
- if (xcode) return { kind: "xcode", path: import_node_fs150.default.realpathSync(xcode) };
130279
- if (import_node_fs150.default.existsSync(import_node_path152.default.join(resolved, "src/main/AndroidManifest.xml")))
130280
- return { kind: "kotlin", path: import_node_fs150.default.realpathSync(resolved) };
130281
- if (!import_node_fs150.default.existsSync(import_node_path152.default.join(resolved, "package.json")) && import_node_fs150.default.readdirSync(resolved).some((name3) => name3.endsWith(".swift")))
130470
+ if (xcode) return { kind: "xcode", path: import_node_fs151.default.realpathSync(xcode) };
130471
+ if (import_node_fs151.default.existsSync(import_node_path153.default.join(resolved, "src/main/AndroidManifest.xml")))
130472
+ return { kind: "kotlin", path: import_node_fs151.default.realpathSync(resolved) };
130473
+ if (!import_node_fs151.default.existsSync(import_node_path153.default.join(resolved, "package.json")) && import_node_fs151.default.readdirSync(resolved).some((name3) => name3.endsWith(".swift")))
130282
130474
  throw new Error(
130283
130475
  `${target} holds Swift files but no Package.swift or Xcode project; open one .swift file, a Swift package, or an Xcode project`
130284
130476
  );
@@ -130307,7 +130499,7 @@ async function prepareSwiftInput(input, opts = {}) {
130307
130499
  module2?.root,
130308
130500
  run14?.configuration
130309
130501
  ) : input.path;
130310
- const name3 = input.kind === "swift-file" ? import_node_path152.default.basename(input.path, ".swift") : import_node_path152.default.basename(packagePath);
130502
+ const name3 = input.kind === "swift-file" ? import_node_path153.default.basename(input.path, ".swift") : import_node_path153.default.basename(packagePath);
130311
130503
  const appProject = resolveAppProject(packagePath);
130312
130504
  let appInfo;
130313
130505
  try {
@@ -130362,7 +130554,7 @@ async function prepareNativeInput(input, opts) {
130362
130554
  const metadata = await host2.kotlinAppArtifact(project2, moduleRoot, opts.origin);
130363
130555
  const prefix = new URL(metadata.url).pathname.slice(0, -"app.mjs".length);
130364
130556
  return {
130365
- name: import_node_path152.default.basename(project2.projectDir),
130557
+ name: import_node_path153.default.basename(project2.projectDir),
130366
130558
  guestSource: kotlinGuestBundle(),
130367
130559
  guestPath: KOTLIN_GUEST_PATH,
130368
130560
  metadataPath: host2.KOTLIN_PACKAGE_PATH,
@@ -130397,13 +130589,13 @@ async function prepareNativeInput(input, opts) {
130397
130589
  throw error;
130398
130590
  }
130399
130591
  }
130400
- var import_node_fs150, import_node_path152;
130592
+ var import_node_fs151, import_node_path153;
130401
130593
  var init_native_input = __esm({
130402
130594
  "cli/native-input.ts"() {
130403
130595
  "use strict";
130404
130596
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
130405
- import_node_fs150 = __toESM(require("node:fs"), 1);
130406
- import_node_path152 = __toESM(require("node:path"), 1);
130597
+ import_node_fs151 = __toESM(require("node:fs"), 1);
130598
+ import_node_path153 = __toESM(require("node:path"), 1);
130407
130599
  init_configured_bundle_producer();
130408
130600
  init_guest_bundle();
130409
130601
  init_kotlinDiscoveryContract();
@@ -130541,7 +130733,7 @@ async function runKotlin(args, opts = {}) {
130541
130733
  throw new Error(`unknown peach open flag for an Android app: ${arg}`);
130542
130734
  else if (modulePath)
130543
130735
  throw new Error("peach open expects one Android app module directory");
130544
- else modulePath = import_node_path153.default.resolve(arg);
130736
+ else modulePath = import_node_path154.default.resolve(arg);
130545
130737
  }
130546
130738
  if (!modulePath) throw new Error("usage: peach open <android-app-module>");
130547
130739
  const device = opts.device ?? opts.openArgs?.find((_, index) => opts.openArgs?.[index - 1] === "--device") ?? DEFAULT_DEVICE_BY_PLATFORM.android;
@@ -130564,7 +130756,7 @@ async function runKotlin(args, opts = {}) {
130564
130756
  let origin = "";
130565
130757
  let artifact;
130566
130758
  let compileError = "Kotlin compilation is starting";
130567
- const projectName = import_node_path153.default.basename(project2.projectDir);
130759
+ const projectName = import_node_path154.default.basename(project2.projectDir);
130568
130760
  const routes2 = () => ({
130569
130761
  root: project2.projectDir,
130570
130762
  moduleRoot,
@@ -130689,7 +130881,7 @@ async function runKotlin(args, opts = {}) {
130689
130881
  });
130690
130882
  console.log(` Kotlin app: ${project2.launcher.name} in ${project2.moduleDir}`);
130691
130883
  console.log(` Kotlin preview host: ${origin}`);
130692
- watcher = import_node_fs151.default.watch(project2.projectDir, { recursive: true }, (_event, file) => {
130884
+ watcher = import_node_fs152.default.watch(project2.projectDir, { recursive: true }, (_event, file) => {
130693
130885
  if (file && file.split(/[\\/]/).some((segment) => segment === "build" || segment.startsWith(".")))
130694
130886
  return;
130695
130887
  void rebuild();
@@ -130744,14 +130936,14 @@ async function runKotlin(args, opts = {}) {
130744
130936
  }
130745
130937
  return code;
130746
130938
  }
130747
- var import_node_fs151, import_node_http3, import_node_path153, import_ws5, HMR_PATH;
130939
+ var import_node_fs152, import_node_http3, import_node_path154, import_ws5, HMR_PATH;
130748
130940
  var init_kotlin = __esm({
130749
130941
  "cli/commands/kotlin.ts"() {
130750
130942
  "use strict";
130751
130943
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
130752
- import_node_fs151 = __toESM(require("node:fs"), 1);
130944
+ import_node_fs152 = __toESM(require("node:fs"), 1);
130753
130945
  import_node_http3 = __toESM(require("node:http"), 1);
130754
- import_node_path153 = __toESM(require("node:path"), 1);
130946
+ import_node_path154 = __toESM(require("node:path"), 1);
130755
130947
  import_ws5 = require("ws");
130756
130948
  init_device_catalog();
130757
130949
  init_guest_bundle();
@@ -130808,7 +131000,7 @@ async function runSwift(args, opts = {}) {
130808
131000
  const value = input[++index];
130809
131001
  if (!value || value.startsWith("-"))
130810
131002
  throw new Error("--swift-sdks-path requires a value");
130811
- process.env.PEACH_SWIFT_SDKS_PATH = import_node_path154.default.resolve(value);
131003
+ process.env.PEACH_SWIFT_SDKS_PATH = import_node_path155.default.resolve(value);
130812
131004
  } else if (arg === "--host-port" || valueFlags.has(arg)) {
130813
131005
  const value = input[++index];
130814
131006
  if (!value || value.startsWith("-")) throw new Error(`${arg} requires a value`);
@@ -130822,7 +131014,7 @@ async function runSwift(args, opts = {}) {
130822
131014
  else if (arg.startsWith("-"))
130823
131015
  throw new Error(`unknown peach open flag for a Swift app: ${arg}`);
130824
131016
  else if (packagePath) throw new Error("peach open expects one project");
130825
- else packagePath = import_node_path154.default.resolve(arg);
131017
+ else packagePath = import_node_path155.default.resolve(arg);
130826
131018
  }
130827
131019
  if (!packagePath) {
130828
131020
  throw new Error(
@@ -130997,7 +131189,7 @@ async function runSwift(args, opts = {}) {
130997
131189
  code = 1;
130998
131190
  stop();
130999
131191
  });
131000
- watcher = import_node_fs152.default.watch(
131192
+ watcher = import_node_fs153.default.watch(
131001
131193
  nativeInput.kind === "swift-file" ? nativeInput.path : packagePath,
131002
131194
  { recursive: nativeInput.kind !== "swift-file" },
131003
131195
  (_event, file) => {
@@ -131065,14 +131257,14 @@ async function runSwift(args, opts = {}) {
131065
131257
  }
131066
131258
  return code;
131067
131259
  }
131068
- var import_node_fs152, import_node_http4, import_node_path154, import_ws6;
131260
+ var import_node_fs153, import_node_http4, import_node_path155, import_ws6;
131069
131261
  var init_swift = __esm({
131070
131262
  "cli/commands/swift.ts"() {
131071
131263
  "use strict";
131072
131264
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
131073
- import_node_fs152 = __toESM(require("node:fs"), 1);
131265
+ import_node_fs153 = __toESM(require("node:fs"), 1);
131074
131266
  import_node_http4 = __toESM(require("node:http"), 1);
131075
- import_node_path154 = __toESM(require("node:path"), 1);
131267
+ import_node_path155 = __toESM(require("node:path"), 1);
131076
131268
  import_ws6 = require("ws");
131077
131269
  init_backend_origin();
131078
131270
  init_swift_submit();
@@ -131282,14 +131474,14 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
131282
131474
  );
131283
131475
  }
131284
131476
  const { executable, prefixArgs } = rnxSelfInvocation();
131285
- const bridgeLogPath = import_node_path155.default.join(
131477
+ const bridgeLogPath = import_node_path156.default.join(
131286
131478
  import_node_os26.default.tmpdir(),
131287
131479
  `peach-bridge-${Date.now()}-${process.pid}.log`
131288
131480
  );
131289
- const bridgeLogFd = import_node_fs153.default.openSync(bridgeLogPath, "a");
131481
+ const bridgeLogFd = import_node_fs154.default.openSync(bridgeLogPath, "a");
131290
131482
  let child;
131291
131483
  try {
131292
- child = (0, import_node_child_process62.spawn)(
131484
+ child = (0, import_node_child_process63.spawn)(
131293
131485
  executable,
131294
131486
  [...prefixArgs, "serve", "--quiet", "--port", String(preferredPort)],
131295
131487
  {
@@ -131300,7 +131492,7 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
131300
131492
  }
131301
131493
  );
131302
131494
  } finally {
131303
- import_node_fs153.default.closeSync(bridgeLogFd);
131495
+ import_node_fs154.default.closeSync(bridgeLogFd);
131304
131496
  }
131305
131497
  if (resources) {
131306
131498
  resources.bridge = child;
@@ -131342,7 +131534,7 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
131342
131534
  await sleep2(Math.max(0, Math.min(150, deadline - Date.now())));
131343
131535
  }
131344
131536
  const reason = childExit ? `peach bridge exited before becoming ready (exit ${childExit})` : `peach bridge did not start within ${Math.round(OPEN_BRIDGE_SPAWN_TIMEOUT_MS / 1e3)}s`;
131345
- const bridgeLog = import_node_fs153.default.readFileSync(bridgeLogPath, "utf8").trim().slice(-2e3);
131537
+ const bridgeLog = import_node_fs154.default.readFileSync(bridgeLogPath, "utf8").trim().slice(-2e3);
131346
131538
  throw new Error(
131347
131539
  `${reason}${bridgeLog ? `
131348
131540
  ${bridgeLog}` : ""}
@@ -131354,8 +131546,8 @@ async function retireOutdatedIdleBridge(lock) {
131354
131546
  const current2 = getCliVersion();
131355
131547
  if (isSootsimDevCheckout() || lock.cliVersion === current2) return;
131356
131548
  if (lock.cliVersion && compareSemver(current2, lock.cliVersion) <= 0) return;
131357
- const appRecord = import_node_path155.default.join(rnxHomeDir(), "app-runtime.json");
131358
- if (import_node_fs153.default.existsSync(appRecord)) return;
131549
+ const appRecord = import_node_path156.default.join(rnxHomeDir(), "app-runtime.json");
131550
+ if (import_node_fs154.default.existsSync(appRecord)) return;
131359
131551
  const bridge = createBridge(lock.bridgePort, { commandTimeoutMs: 2e3 });
131360
131552
  const simCount = await bridge.listSims({ includeRetained: true }).then(
131361
131553
  (sims) => sims.length,
@@ -131381,31 +131573,31 @@ function isolateHomeForExplicitPort(preferredPort, explicitPort, lock) {
131381
131573
  return;
131382
131574
  }
131383
131575
  const sharedRuntimes = runtimesDir();
131384
- const home = import_node_path155.default.join(rnxHomeDir(), "port-homes", String(preferredPort));
131576
+ const home = import_node_path156.default.join(rnxHomeDir(), "port-homes", String(preferredPort));
131385
131577
  activatePeachHome(home);
131386
- const runtimes = import_node_path155.default.join(home, "runtimes");
131578
+ const runtimes = import_node_path156.default.join(home, "runtimes");
131387
131579
  if (resolveDevCheckoutRuntimeRoot()) {
131388
131580
  removePortHomeSharedRuntimesLink(runtimes, sharedRuntimes);
131389
- } else if (import_node_fs153.default.existsSync(sharedRuntimes) && !import_node_fs153.default.existsSync(runtimes)) {
131390
- import_node_fs153.default.symlinkSync(sharedRuntimes, runtimes);
131581
+ } else if (import_node_fs154.default.existsSync(sharedRuntimes) && !import_node_fs154.default.existsSync(runtimes)) {
131582
+ import_node_fs154.default.symlinkSync(sharedRuntimes, runtimes);
131391
131583
  }
131392
131584
  process.env[PEACH_HOME_ENV] = home;
131393
131585
  }
131394
131586
  function removePortHomeSharedRuntimesLink(runtimes, sharedRuntimes) {
131395
131587
  let stat2;
131396
131588
  try {
131397
- stat2 = import_node_fs153.default.lstatSync(runtimes);
131589
+ stat2 = import_node_fs154.default.lstatSync(runtimes);
131398
131590
  } catch {
131399
131591
  return;
131400
131592
  }
131401
131593
  if (!stat2.isSymbolicLink()) return;
131402
131594
  let target;
131403
131595
  try {
131404
- target = import_node_path155.default.resolve(import_node_path155.default.dirname(runtimes), import_node_fs153.default.readlinkSync(runtimes));
131596
+ target = import_node_path156.default.resolve(import_node_path156.default.dirname(runtimes), import_node_fs154.default.readlinkSync(runtimes));
131405
131597
  } catch {
131406
131598
  return;
131407
131599
  }
131408
- if (target === sharedRuntimes) import_node_fs153.default.unlinkSync(runtimes);
131600
+ if (target === sharedRuntimes) import_node_fs154.default.unlinkSync(runtimes);
131409
131601
  }
131410
131602
  async function ensureRuntimeForOpen() {
131411
131603
  if (resolveDevCheckoutRuntimeRoot()) return;
@@ -131415,12 +131607,12 @@ async function ensureRuntimeForOpen() {
131415
131607
  );
131416
131608
  }
131417
131609
  const active = readActiveRuntime();
131418
- if (active && import_node_fs153.default.existsSync(import_node_path155.default.join(runtimeDir(active), "index.html"))) {
131610
+ if (active && import_node_fs154.default.existsSync(import_node_path156.default.join(runtimeDir(active), "index.html"))) {
131419
131611
  await ensureCliCompanion(runtimeDir(active));
131420
131612
  return;
131421
131613
  }
131422
131614
  const directory2 = runtimesDir();
131423
- if (import_node_fs153.default.existsSync(directory2) && import_node_fs153.default.readdirSync(directory2).length > 0) {
131615
+ if (import_node_fs154.default.existsSync(directory2) && import_node_fs154.default.readdirSync(directory2).length > 0) {
131424
131616
  throw new Error(
131425
131617
  "peach open: runtime staging or selection is incomplete. finish staging and select the runtime with peach runtime use <version> before opening."
131426
131618
  );
@@ -131506,11 +131698,11 @@ async function readSimDevice(bridge, simId) {
131506
131698
  }
131507
131699
  function prebuiltBundleFile(target) {
131508
131700
  if (!/\.(js|bundle|jsbundle)$/i.test(target)) return null;
131509
- const file = import_node_path155.default.resolve(process.cwd(), target);
131510
- return import_node_fs153.default.statSync(file, { throwIfNoEntry: false })?.isFile() ? file : null;
131701
+ const file = import_node_path156.default.resolve(process.cwd(), target);
131702
+ return import_node_fs154.default.statSync(file, { throwIfNoEntry: false })?.isFile() ? file : null;
131511
131703
  }
131512
131704
  async function stagePrebuiltBundle(file, bridgePort, prepareSource) {
131513
- const bytes = import_node_fs153.default.readFileSync(file);
131705
+ const bytes = import_node_fs154.default.readFileSync(file);
131514
131706
  const source = bytes.toString("utf8");
131515
131707
  const mode = await detectBundleModeFromText(source);
131516
131708
  if (!mode) {
@@ -131528,7 +131720,7 @@ async function stagePrebuiltBundle(file, bridgePort, prepareSource) {
131528
131720
  stageHostBytes(
131529
131721
  prepared === source ? bytes : Buffer.from(prepared, "utf8"),
131530
131722
  `http://127.0.0.1:${bridgePort}`,
131531
- import_node_path155.default.extname(file)
131723
+ import_node_path156.default.extname(file)
131532
131724
  )
131533
131725
  );
131534
131726
  url.searchParams.set("dev", String(mode === "development"));
@@ -131536,10 +131728,10 @@ async function stagePrebuiltBundle(file, bridgePort, prepareSource) {
131536
131728
  }
131537
131729
  function normalizeReplacementPath(filePath) {
131538
131730
  if (filePath.startsWith("~/")) {
131539
- return import_node_path155.default.join(import_node_os26.default.homedir(), filePath.slice(2));
131731
+ return import_node_path156.default.join(import_node_os26.default.homedir(), filePath.slice(2));
131540
131732
  }
131541
- if (import_node_path155.default.isAbsolute(filePath)) return filePath;
131542
- return import_node_path155.default.resolve(process.cwd(), filePath);
131733
+ if (import_node_path156.default.isAbsolute(filePath)) return filePath;
131734
+ return import_node_path156.default.resolve(process.cwd(), filePath);
131543
131735
  }
131544
131736
  function parseOpenRuntimeConfig(args) {
131545
131737
  const modules = {};
@@ -131558,7 +131750,7 @@ function parseOpenRuntimeConfig(args) {
131558
131750
  }
131559
131751
  const moduleName2 = raw2.slice(0, eqIndex).trim();
131560
131752
  const filePath = normalizeReplacementPath(raw2.slice(eqIndex + 1).trim());
131561
- if (!import_node_fs153.default.existsSync(filePath)) {
131753
+ if (!import_node_fs154.default.existsSync(filePath)) {
131562
131754
  console.error(` peach open: replacement file not found: ${filePath}`);
131563
131755
  peachExit(1);
131564
131756
  }
@@ -131584,7 +131776,7 @@ function parseOpenRuntimeConfig(args) {
131584
131776
  return config.modules || config.network ? config : void 0;
131585
131777
  }
131586
131778
  async function ensureConfiguredRuntime(version2) {
131587
- if (import_node_fs153.default.existsSync(import_node_path155.default.join(runtimeDir(version2), "index.html"))) return;
131779
+ if (import_node_fs154.default.existsSync(import_node_path156.default.join(runtimeDir(version2), "index.html"))) return;
131588
131780
  console.error(` installing configured engine runtime ${version2}...`);
131589
131781
  const result = await rnxRuntime.install({
131590
131782
  version: version2,
@@ -131664,7 +131856,7 @@ async function waitForSimMatchOrHostExit(wsPort, commandTimeoutMs, predicate, ho
131664
131856
  const watchHost = !!hostPid && Number.isInteger(hostPid) && hostPid > 1;
131665
131857
  const hostExited = () => watchHost && hostPid !== void 0 && !isProcessRunning(hostPid);
131666
131858
  if (opts.admittedFile && watchHost) {
131667
- while (!import_node_fs153.default.existsSync(opts.admittedFile)) {
131859
+ while (!import_node_fs154.default.existsSync(opts.admittedFile)) {
131668
131860
  opts.signal?.throwIfAborted();
131669
131861
  if (hostExited()) return { kind: "host-exit" };
131670
131862
  await sleep2(intervalMs);
@@ -131724,7 +131916,7 @@ function playwrightHostPidForSim(sim) {
131724
131916
  function signalDriverLaunchConnected(result) {
131725
131917
  if (!result.connectAckFile) return false;
131726
131918
  try {
131727
- import_node_fs153.default.writeFileSync(
131919
+ import_node_fs154.default.writeFileSync(
131728
131920
  result.connectAckFile,
131729
131921
  `${JSON.stringify({ connectedAt: Date.now(), pid: result.pid ?? null })}
131730
131922
  `,
@@ -131738,7 +131930,7 @@ function signalDriverLaunchConnected(result) {
131738
131930
  function readUnservedUrl(result) {
131739
131931
  if (!result.diagnosticLogPath) return null;
131740
131932
  try {
131741
- const detail = import_node_fs153.default.readFileSync(result.diagnosticLogPath, "utf8");
131933
+ const detail = import_node_fs154.default.readFileSync(result.diagnosticLogPath, "utf8");
131742
131934
  const match = detail.match(/\[unserved\] nothing serves (\S+)/);
131743
131935
  return match ? match[1] : null;
131744
131936
  } catch {
@@ -131748,14 +131940,14 @@ function readUnservedUrl(result) {
131748
131940
  function printDriverDiagnosticLogTail(result) {
131749
131941
  if (!result.diagnosticLogPath) return;
131750
131942
  try {
131751
- const detail = import_node_fs153.default.readFileSync(result.diagnosticLogPath, "utf8").trim();
131943
+ const detail = import_node_fs154.default.readFileSync(result.diagnosticLogPath, "utf8").trim();
131752
131944
  if (!detail) {
131753
- console.error(` ${import_node_path155.default.basename(result.diagnosticLogPath)} was empty`);
131945
+ console.error(` ${import_node_path156.default.basename(result.diagnosticLogPath)} was empty`);
131754
131946
  return;
131755
131947
  }
131756
131948
  const shown = detail.length > 4e3 ? `\u2026
131757
131949
  ${detail.slice(-4e3)}` : detail;
131758
- console.error(` ${import_node_path155.default.basename(result.diagnosticLogPath)}:`);
131950
+ console.error(` ${import_node_path156.default.basename(result.diagnosticLogPath)}:`);
131759
131951
  console.error(shown);
131760
131952
  if (/No usable sandbox/i.test(detail)) {
131761
131953
  console.error(
@@ -131765,7 +131957,7 @@ ${detail.slice(-4e3)}` : detail;
131765
131957
  } catch (err) {
131766
131958
  const message = err instanceof Error ? err.message : String(err);
131767
131959
  console.error(
131768
- ` failed to read ${import_node_path155.default.basename(result.diagnosticLogPath)}: ${message}`
131960
+ ` failed to read ${import_node_path156.default.basename(result.diagnosticLogPath)}: ${message}`
131769
131961
  );
131770
131962
  }
131771
131963
  }
@@ -131780,16 +131972,16 @@ async function waitForProcessExit(pid, timeoutMs = 2500) {
131780
131972
  function isPlaywrightHostProcess(pid) {
131781
131973
  if (process.platform === "linux") {
131782
131974
  try {
131783
- return import_node_fs153.default.readFileSync(`/proc/${pid}/environ`, "utf8").split("\0").some((entry) => entry.startsWith("SOOTSIM_PW_URL="));
131975
+ return import_node_fs154.default.readFileSync(`/proc/${pid}/environ`, "utf8").split("\0").some((entry) => entry.startsWith("SOOTSIM_PW_URL="));
131784
131976
  } catch {
131785
131977
  return false;
131786
131978
  }
131787
131979
  }
131788
- const plain = (0, import_node_child_process62.spawnSync)("ps", ["-o", "command=", "-p", String(pid)], {
131980
+ const plain = (0, import_node_child_process63.spawnSync)("ps", ["-o", "command=", "-p", String(pid)], {
131789
131981
  encoding: "utf8",
131790
131982
  stdio: ["ignore", "pipe", "pipe"]
131791
131983
  });
131792
- const withEnv = (0, import_node_child_process62.spawnSync)("ps", ["eww", "-o", "command=", "-p", String(pid)], {
131984
+ const withEnv = (0, import_node_child_process63.spawnSync)("ps", ["eww", "-o", "command=", "-p", String(pid)], {
131793
131985
  encoding: "utf8",
131794
131986
  stdio: ["ignore", "pipe", "pipe"]
131795
131987
  });
@@ -132017,6 +132209,20 @@ async function runOpenCommand(args, opts = {}) {
132017
132209
  }
132018
132210
  }
132019
132211
  async function openSim(args, opts) {
132212
+ const binary2 = args.find((arg) => !arg.startsWith("-") && isAppBinaryPath(arg));
132213
+ if (binary2) {
132214
+ try {
132215
+ const { bundlePath, platform: platform2 } = extractAppBinaryBundle(binary2);
132216
+ args = args.map((arg) => arg === binary2 ? bundlePath : arg);
132217
+ if (platform2 === "android" && !args.includes("--device") && !args.includes("-d"))
132218
+ args = [...args, "--device", "pixel-8"];
132219
+ } catch (error) {
132220
+ console.error(
132221
+ ` peach open: ${error instanceof Error ? error.message : String(error)}`
132222
+ );
132223
+ peachExit(1);
132224
+ }
132225
+ }
132020
132226
  const openArgOptions = {
132021
132227
  stripBooleanFlags: [
132022
132228
  "--new",
@@ -133093,18 +133299,18 @@ async function runCloseCommand(args, opts = {}) {
133093
133299
  bridge.close();
133094
133300
  }
133095
133301
  }
133096
- var import_node_child_process62, import_node_fs153, import_node_http5, import_node_https2, import_node_net, import_node_os26, import_node_path155, import_ws7, DEFAULT_DRIVER_CONNECT_TIMEOUT_MS, DRIVER_CONNECT_INTERVAL_MS, DRIVER_CONNECT_HOST_GRACE_MS, OPEN_BRIDGE_SPAWN_TIMEOUT_MS, OPEN_BRIDGE_RUNTIME_TIMEOUT_MS, OPEN_BRIDGE_HEALTH_TIMEOUT_MS, OPEN_BRIDGE_SILENCE_MS, LIVE_BRIDGE_HANDSHAKE_TIMEOUT_MS;
133302
+ var import_node_child_process63, import_node_fs154, import_node_http5, import_node_https2, import_node_net, import_node_os26, import_node_path156, import_ws7, DEFAULT_DRIVER_CONNECT_TIMEOUT_MS, DRIVER_CONNECT_INTERVAL_MS, DRIVER_CONNECT_HOST_GRACE_MS, OPEN_BRIDGE_SPAWN_TIMEOUT_MS, OPEN_BRIDGE_RUNTIME_TIMEOUT_MS, OPEN_BRIDGE_HEALTH_TIMEOUT_MS, OPEN_BRIDGE_SILENCE_MS, LIVE_BRIDGE_HANDSHAKE_TIMEOUT_MS;
133097
133303
  var init_control = __esm({
133098
133304
  "cli/commands/control.ts"() {
133099
133305
  "use strict";
133100
133306
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
133101
- import_node_child_process62 = require("node:child_process");
133102
- import_node_fs153 = __toESM(require("node:fs"), 1);
133307
+ import_node_child_process63 = require("node:child_process");
133308
+ import_node_fs154 = __toESM(require("node:fs"), 1);
133103
133309
  import_node_http5 = __toESM(require("node:http"), 1);
133104
133310
  import_node_https2 = __toESM(require("node:https"), 1);
133105
133311
  import_node_net = __toESM(require("node:net"), 1);
133106
133312
  import_node_os26 = __toESM(require("node:os"), 1);
133107
- import_node_path155 = __toESM(require("node:path"), 1);
133313
+ import_node_path156 = __toESM(require("node:path"), 1);
133108
133314
  init_src();
133109
133315
  import_ws7 = require("ws");
133110
133316
  init_agent_identity();
@@ -133134,6 +133340,7 @@ var init_control = __esm({
133134
133340
  init_app_config();
133135
133341
  init_app_project();
133136
133342
  init_app_splash();
133343
+ init_binary_sidecar();
133137
133344
  init_bridge_diagnostics();
133138
133345
  init_current_sim();
133139
133346
  init_desktop_companion();
@@ -133603,10 +133810,14 @@ function renderActivityIdleScript({
133603
133810
  maxMs,
133604
133811
  requiredStillMs,
133605
133812
  transitionStartWindowMs,
133606
- transitionTimeoutMs
133813
+ transitionTimeoutMs,
133814
+ skipIfInspectActive
133607
133815
  }) {
133608
133816
  return `(async () => {
133609
133817
  const start = Date.now()
133818
+ if (${skipIfInspectActive} && globalThis.__sootsimEngineState?.inspectActive === true) {
133819
+ return { settled: true, elapsed: 0, blockedBy: '' }
133820
+ }
133610
133821
  const budgetMs = ${Math.max(0, Math.round(maxMs))}
133611
133822
  const requiredStillMs = ${Math.max(1, Math.round(requiredStillMs))}
133612
133823
  let deadline = start + budgetMs
@@ -133710,6 +133921,7 @@ async function waitForSootsimIdle({
133710
133921
  screenStill = false,
133711
133922
  maestro = false,
133712
133923
  motionOnly = false,
133924
+ skipIfInspectActive = false,
133713
133925
  readyPlayback = false,
133714
133926
  transitionStartWindowMs = 80,
133715
133927
  transitionTimeoutMs = 4e3
@@ -133725,7 +133937,8 @@ async function waitForSootsimIdle({
133725
133937
  maxMs,
133726
133938
  requiredStillMs: Math.max(1, Math.round(stablePolls)) * Math.max(1, Math.round(pollMs)),
133727
133939
  transitionStartWindowMs,
133728
- transitionTimeoutMs
133940
+ transitionTimeoutMs,
133941
+ skipIfInspectActive
133729
133942
  }) : `(async () => {
133730
133943
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
133731
133944
  // tests inject a virtual clock as globalThis.__sootsimIdleClock ({ now, sleep })
@@ -133819,6 +134032,7 @@ async function waitForSootsimIdle({
133819
134032
  let webViewBlocker = ''
133820
134033
  let visibleMotion = false
133821
134034
  let visibleMotionBy = ''
134035
+ let motionUnavailable = false
133822
134036
  // the reads are independent, so they run concurrently: a loaded sim
133823
134037
  // answers each one late, and a poll that waits for them in turn
133824
134038
  // costs their sum, which fits too few polls in the budget to settle.
@@ -133889,6 +134103,9 @@ async function waitForSootsimIdle({
133889
134103
  .slice(0, 4)
133890
134104
  .map((anim) => anim.source + '/' + anim.kind + '#' + anim.id + ' at ' + anim.current + (anim.loop ? ' loop' : ''))
133891
134105
  .join(', ')
134106
+ } else if (screenStill) {
134107
+ motionUnavailable = true
134108
+ workerBusy = true
133892
134109
  }
133893
134110
  }
133894
134111
  const stats = await statsRead
@@ -134066,7 +134283,7 @@ async function waitForSootsimIdle({
134066
134283
  }
134067
134284
  }
134068
134285
  }
134069
- return { layout: nodes.join(';'), nodeRows, nativeHierarchy, visibleMotion, visibleMotionBy, animating, animatingBy, shellAnimating, shellBlockers, layoutDirty, pendingFetches, workerBusy, webViewStarting, webViewBlocker, renderStatsAvailable, requestTotal, requestInFlight, appCommits, nodeCount }
134286
+ return { layout: nodes.join(';'), nodeRows, nativeHierarchy, visibleMotion, visibleMotionBy, animating, animatingBy, shellAnimating, shellBlockers, layoutDirty, pendingFetches, workerBusy, motionUnavailable, webViewStarting, webViewBlocker, renderStatsAvailable, requestTotal, requestInFlight, appCommits, nodeCount }
134070
134287
  }
134071
134288
 
134072
134289
  // how long generic background network is allowed to keep us waiting AFTER
@@ -134256,7 +134473,8 @@ async function waitForSootsimIdle({
134256
134473
  if (!maestro && last.appCommits !== null && report.appCommits !== null && last.appCommits !== report.appCommits) blockers.push('layout commits still landing')
134257
134474
  if (!maestro && last.nodeCount !== null && report.nodeCount !== null && last.nodeCount !== report.nodeCount) blockers.push('node count still changing')
134258
134475
  if (last.pendingFetches > 0) blockers.push(last.pendingFetches + ' image fetches pending')
134259
- if (last.workerBusy) blockers.push('a render worker too busy to report')
134476
+ if (last.motionUnavailable) blockers.push('animation reporting unavailable')
134477
+ if (last.workerBusy && !last.motionUnavailable) blockers.push('a render worker too busy to report')
134260
134478
  if (last.webViewStarting) blockers.push(last.webViewBlocker || 'webView still starting')
134261
134479
  if (!maestro && last.layout !== report.layout) blockers.push('layout still changing')
134262
134480
  if (maestro && !hierarchyUnchanged(last.nativeHierarchy, report.nativeHierarchy)) blockers.push(last.nativeHierarchy === null ? 'native accessibility hierarchy unavailable' : 'native accessibility hierarchy still changing')
@@ -135083,16 +135301,16 @@ function readRecentShellAppId(state) {
135083
135301
  }
135084
135302
  function resolveProjectRelativeFlowBase(flowDir) {
135085
135303
  if (!flowDir) return process.cwd();
135086
- return path139.basename(flowDir) === ".maestro" ? path139.dirname(flowDir) : flowDir;
135304
+ return path140.basename(flowDir) === ".maestro" ? path140.dirname(flowDir) : flowDir;
135087
135305
  }
135088
135306
  function resolveFlowScreenshotPathWithMode(screenshotDir, name3, opts) {
135089
135307
  const normalizedName = name3.endsWith(".png") ? name3 : `${name3}.png`;
135090
- if (path139.isAbsolute(normalizedName)) return normalizedName;
135308
+ if (path140.isAbsolute(normalizedName)) return normalizedName;
135091
135309
  if (opts.mode === "flow" && /[\\/]/.test(normalizedName)) {
135092
135310
  const baseDir = normalizedName.startsWith("./") || normalizedName.startsWith("../") ? opts.flowDir ?? process.cwd() : resolveProjectRelativeFlowBase(opts.flowDir);
135093
- return path139.resolve(baseDir, normalizedName);
135311
+ return path140.resolve(baseDir, normalizedName);
135094
135312
  }
135095
- return path139.join(screenshotDir, normalizedName);
135313
+ return path140.join(screenshotDir, normalizedName);
135096
135314
  }
135097
135315
  function normalizeFlowScreenshotSpec(step) {
135098
135316
  if (typeof step === "string") {
@@ -135194,13 +135412,13 @@ function normalizeBareStringStep(verb2) {
135194
135412
  function parseFlowSteps(content) {
135195
135413
  return parseFlowFile(content).steps;
135196
135414
  }
135197
- var fs114, path139, import_frame_identity, DEFAULT_TIMEOUT, ASSERTION_LOOKUP_MS, NON_MUTATING_STEPS, FLOW_TIMEOUT_SCALE, scaledTimeout, MAESTRO_SELECTOR_KEYS, UNSUPPORTED_SELECTOR_KEYS, ACCESSIBILITY_SELECTOR_KEYS, ACCESSIBILITY_TRAIT_FILTERS, MAESTRO_PERMISSION_KINDS, MAESTRO_PERMISSION_STATUS, MAESTRO_LOCATION_STATUS, RANDOM_INPUT_KEYS, pick, CaptureSetupError, SootSimBridgeFlowRunner;
135415
+ var fs115, path140, import_frame_identity, DEFAULT_TIMEOUT, ASSERTION_LOOKUP_MS, NON_MUTATING_STEPS, FLOW_TIMEOUT_SCALE, scaledTimeout, MAESTRO_SELECTOR_KEYS, UNSUPPORTED_SELECTOR_KEYS, ACCESSIBILITY_SELECTOR_KEYS, ACCESSIBILITY_TRAIT_FILTERS, MAESTRO_PERMISSION_KINDS, MAESTRO_PERMISSION_STATUS, MAESTRO_LOCATION_STATUS, RANDOM_INPUT_KEYS, pick, CaptureSetupError, SootSimBridgeFlowRunner;
135198
135416
  var init_bridge_flow_runner = __esm({
135199
135417
  "cli/bridge-flow-runner.ts"() {
135200
135418
  "use strict";
135201
135419
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
135202
- fs114 = __toESM(require("fs"), 1);
135203
- path139 = __toESM(require("path"), 1);
135420
+ fs115 = __toESM(require("fs"), 1);
135421
+ path140 = __toESM(require("path"), 1);
135204
135422
  init_src2();
135205
135423
  import_frame_identity = __toESM(require_frame_identity(), 1);
135206
135424
  init_device_catalog();
@@ -135614,14 +135832,14 @@ var init_bridge_flow_runner = __esm({
135614
135832
  if (chunks.length === 0) {
135615
135833
  throw new Error("recording requested but no video buffer was produced");
135616
135834
  }
135617
- fs114.mkdirSync(this.opts.recordingOutputDir, { recursive: true });
135835
+ fs115.mkdirSync(this.opts.recordingOutputDir, { recursive: true });
135618
135836
  const videoMime = stopped.mime || this.opts.recordingFormat || "video/webm";
135619
135837
  const extension = videoMime.includes("mp4") ? "mp4" : "webm";
135620
- const outputPath2 = path139.join(
135838
+ const outputPath2 = path140.join(
135621
135839
  this.opts.recordingOutputDir,
135622
135840
  `peach-${Date.now()}.${extension}`
135623
135841
  );
135624
- fs114.writeFileSync(outputPath2, Buffer.concat(chunks));
135842
+ fs115.writeFileSync(outputPath2, Buffer.concat(chunks));
135625
135843
  return outputPath2;
135626
135844
  }
135627
135845
  async waitForRecordingTail(opts) {
@@ -135921,7 +136139,7 @@ var init_bridge_flow_runner = __esm({
135921
136139
  }
135922
136140
  const direct = await test.activatePressAt(point.x, point.y, ${nodeId})
135923
136141
  if (direct?.ok) {
135924
- window.dispatchEvent(
136142
+ globalThis.dispatchEvent(
135925
136143
  new CustomEvent('sootsim:agentAction', {
135926
136144
  detail: { type: 'tap', x: point.x, y: point.y, target: ${JSON.stringify(
135927
136145
  replayTarget
@@ -135938,7 +136156,7 @@ var init_bridge_flow_runner = __esm({
135938
136156
  if (!test?.activatePressAt) return null
135939
136157
  const direct = await test.activatePressAt(${x}, ${y})
135940
136158
  if (direct?.ok) {
135941
- window.dispatchEvent(
136159
+ globalThis.dispatchEvent(
135942
136160
  new CustomEvent('sootsim:agentAction', {
135943
136161
  detail: { type: 'tap', x: ${x}, y: ${y} },
135944
136162
  }),
@@ -136337,7 +136555,7 @@ var init_bridge_flow_runner = __esm({
136337
136555
  flowDir: this.opts.flowDir
136338
136556
  }
136339
136557
  );
136340
- fs114.mkdirSync(path139.dirname(outputPath2), { recursive: true });
136558
+ fs115.mkdirSync(path140.dirname(outputPath2), { recursive: true });
136341
136559
  const layers = spec.layers ?? this.opts.screenshotLayers;
136342
136560
  const screenshotRequest = {
136343
136561
  type: "screenshot",
@@ -136372,11 +136590,11 @@ var init_bridge_flow_runner = __esm({
136372
136590
  throw new Error("could not read current device model for framed screenshot");
136373
136591
  }
136374
136592
  const framed = await composeFramedScreenshot(rawBuffer, model);
136375
- fs114.writeFileSync(outputPath2, framed);
136593
+ fs115.writeFileSync(outputPath2, framed);
136376
136594
  console.log(`[flow] screenshot: ${outputPath2} (frame: ${model})`);
136377
136595
  return outputPath2;
136378
136596
  }
136379
- fs114.writeFileSync(outputPath2, rawBuffer);
136597
+ fs115.writeFileSync(outputPath2, rawBuffer);
136380
136598
  console.log(`[flow] screenshot: ${outputPath2}`);
136381
136599
  return outputPath2;
136382
136600
  }
@@ -136415,11 +136633,11 @@ var init_bridge_flow_runner = __esm({
136415
136633
  // + a11y tree + console errors/warnings + failed network requests +
136416
136634
  // shell state, all under one directory so post-mortem is one grep away.
136417
136635
  async captureFailureBundle(outputDir, context) {
136418
- fs114.mkdirSync(outputDir, { recursive: true });
136636
+ fs115.mkdirSync(outputDir, { recursive: true });
136419
136637
  const write = (name3, content) => {
136420
136638
  try {
136421
- fs114.writeFileSync(
136422
- path139.join(outputDir, name3),
136639
+ fs115.writeFileSync(
136640
+ path140.join(outputDir, name3),
136423
136641
  typeof content === "string" ? redactForSharing(content) : content
136424
136642
  );
136425
136643
  } catch {
@@ -137134,8 +137352,8 @@ var init_bridge_flow_runner = __esm({
137134
137352
  runScript(target) {
137135
137353
  const spec = typeof target === "string" ? { file: target } : target;
137136
137354
  if (!spec.file) throw new Error("runScript requires a file");
137137
- const scriptPath = path139.resolve(this.opts.flowDir, spec.file);
137138
- const source = fs114.readFileSync(scriptPath, "utf8");
137355
+ const scriptPath = path140.resolve(this.opts.flowDir, spec.file);
137356
+ const source = fs115.readFileSync(scriptPath, "utf8");
137139
137357
  this.js.evaluate(source, { env: spec.env });
137140
137358
  console.log(`[flow] runScript: ${spec.file} done`);
137141
137359
  }
@@ -137167,10 +137385,10 @@ var init_bridge_flow_runner = __esm({
137167
137385
  throw new Error("addMedia requires at least one file path");
137168
137386
  }
137169
137387
  for (const fileSpec of rawFiles) {
137170
- const filePath = path139.resolve(this.opts.flowDir, fileSpec);
137171
- const stat2 = fs114.statSync(filePath);
137172
- const bytes = fs114.readFileSync(filePath);
137173
- const ext = path139.extname(filePath).slice(1).toLowerCase();
137388
+ const filePath = path140.resolve(this.opts.flowDir, fileSpec);
137389
+ const stat2 = fs115.statSync(filePath);
137390
+ const bytes = fs115.readFileSync(filePath);
137391
+ const ext = path140.extname(filePath).slice(1).toLowerCase();
137174
137392
  const mimeType = ext === "png" ? "image/png" : ext === "webp" ? "image/webp" : ext === "gif" ? "image/gif" : ext === "svg" ? "image/svg+xml" : ext === "avif" ? "image/avif" : ext === "bmp" ? "image/bmp" : ext === "ico" ? "image/x-icon" : "image/jpeg";
137175
137393
  const dataUrl = `data:${mimeType};base64,${bytes.toString("base64")}`;
137176
137394
  const added = await this.evaluate(
@@ -137559,14 +137777,14 @@ var init_bridge_flow_runner = __esm({
137559
137777
  for (const [k, v6] of Object.entries(env)) this.js.putEnv(k, v6);
137560
137778
  }
137561
137779
  if (file) {
137562
- const flowPath = path139.resolve(this.opts.flowDir, file);
137563
- const flowContent = fs114.readFileSync(flowPath, "utf8");
137780
+ const flowPath = path140.resolve(this.opts.flowDir, file);
137781
+ const flowContent = fs115.readFileSync(flowPath, "utf8");
137564
137782
  const { frontmatter } = parseFlowFile(flowContent);
137565
137783
  if (frontmatter.env && typeof frontmatter.env === "object") {
137566
137784
  this.js.defineVariables(frontmatter.env);
137567
137785
  }
137568
137786
  const previousDir = this.opts.flowDir;
137569
- this.opts.flowDir = path139.dirname(flowPath);
137787
+ this.opts.flowDir = path140.dirname(flowPath);
137570
137788
  try {
137571
137789
  await this.runFlow(parseFlowSteps(flowContent));
137572
137790
  } finally {
@@ -137724,8 +137942,8 @@ __export(registry_exports, {
137724
137942
  });
137725
137943
  module.exports = __toCommonJS(registry_exports);
137726
137944
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
137727
- var fs115 = __toESM(require("fs"), 1);
137728
- var path140 = __toESM(require("path"), 1);
137945
+ var fs116 = __toESM(require("fs"), 1);
137946
+ var path141 = __toESM(require("path"), 1);
137729
137947
 
137730
137948
  // src/skills/builtin/a11y-review.ts
137731
137949
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -137745,8 +137963,8 @@ var skill = {
137745
137963
  },
137746
137964
  async execute(params, context) {
137747
137965
  const { chromium } = await import("playwright");
137748
- const path141 = await import("path");
137749
- const fs116 = await import("fs");
137966
+ const path142 = await import("path");
137967
+ const fs117 = await import("fs");
137750
137968
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
137751
137969
  headless: true
137752
137970
  });
@@ -137803,9 +138021,9 @@ var skill = {
137803
138021
  warnings: issues.filter((i) => i.severity === "warning").length,
137804
138022
  tree: typeof tree3 === "string" ? tree3 : JSON.stringify(tree3)
137805
138023
  };
137806
- const reportPath = path141.join(context.outputDir, "a11y-report.json");
137807
- fs116.mkdirSync(path141.dirname(reportPath), { recursive: true });
137808
- fs116.writeFileSync(reportPath, JSON.stringify(report, null, 2));
138024
+ const reportPath = path142.join(context.outputDir, "a11y-report.json");
138025
+ fs117.mkdirSync(path142.dirname(reportPath), { recursive: true });
138026
+ fs117.writeFileSync(reportPath, JSON.stringify(report, null, 2));
137809
138027
  return {
137810
138028
  success: issues.filter((i) => i.severity === "error").length === 0,
137811
138029
  message: `${report.errors} errors, ${report.warnings} warnings across ${report.nodeCount} nodes`,
@@ -137839,14 +138057,14 @@ var skill2 = {
137839
138057
  }
137840
138058
  },
137841
138059
  async execute(params, context) {
137842
- const fs116 = await import("node:fs");
137843
- const path141 = await import("node:path");
138060
+ const fs117 = await import("node:fs");
138061
+ const path142 = await import("node:path");
137844
138062
  const { COMPAT_RESULT_CAVEAT: COMPAT_RESULT_CAVEAT2, formatPackageStatus: formatPackageStatus2, formatScanCounts: formatScanCounts2, scanDeps: scanDeps2 } = await Promise.resolve().then(() => (init_web(), web_exports));
137845
- const packagePath = path141.join(context.projectDir, "package.json");
137846
- if (!fs116.existsSync(packagePath)) {
138063
+ const packagePath = path142.join(context.projectDir, "package.json");
138064
+ if (!fs117.existsSync(packagePath)) {
137847
138065
  return { success: false, message: "No package.json found" };
137848
138066
  }
137849
- const parsed = JSON.parse(fs116.readFileSync(packagePath, "utf8"));
138067
+ const parsed = JSON.parse(fs117.readFileSync(packagePath, "utf8"));
137850
138068
  if (!parsed || typeof parsed !== "object") {
137851
138069
  return { success: false, message: "package.json is not an object" };
137852
138070
  }
@@ -137858,9 +138076,9 @@ var skill2 = {
137858
138076
  }) : scanDeps2(parsed);
137859
138077
  const packageResult = params.packageName ? scan2.packages[0] : void 0;
137860
138078
  const message = packageResult ? `${params.packageName}: ${formatPackageStatus2(packageResult)}. ${COMPAT_RESULT_CAVEAT2}` : `${formatScanCounts2(scan2)}. ${COMPAT_RESULT_CAVEAT2}`;
137861
- const reportPath = path141.join(context.outputDir, "compat-report.json");
137862
- fs116.mkdirSync(path141.dirname(reportPath), { recursive: true });
137863
- fs116.writeFileSync(reportPath, `${JSON.stringify(scan2, null, 2)}
138079
+ const reportPath = path142.join(context.outputDir, "compat-report.json");
138080
+ fs117.mkdirSync(path142.dirname(reportPath), { recursive: true });
138081
+ fs117.writeFileSync(reportPath, `${JSON.stringify(scan2, null, 2)}
137864
138082
  `);
137865
138083
  return {
137866
138084
  success: true,
@@ -137903,8 +138121,8 @@ var skill3 = {
137903
138121
  record: { type: "boolean", description: "Record video of the flow" }
137904
138122
  },
137905
138123
  async execute(params, context) {
137906
- const fs116 = await import("fs");
137907
- const path141 = await import("path");
138124
+ const fs117 = await import("fs");
138125
+ const path142 = await import("path");
137908
138126
  const { parseFlowFile: parseFlowFile2 } = await Promise.resolve().then(() => (init_flow_file(), flow_file_exports));
137909
138127
  const { DEFAULT_SOOTSIM_BRIDGE_PORT: DEFAULT_SOOTSIM_BRIDGE_PORT2 } = await Promise.resolve().then(() => (init_bridge_constants(), bridge_constants_exports));
137910
138128
  const { SootSimBridgeHost: SootSimBridgeHost2 } = await Promise.resolve().then(() => (init_bridge_host(), bridge_host_exports));
@@ -137914,7 +138132,7 @@ var skill3 = {
137914
138132
  const host2 = new SootSimBridgeHost2({ port: DEFAULT_SOOTSIM_BRIDGE_PORT2 });
137915
138133
  host2.start({ silent: true });
137916
138134
  try {
137917
- const flowContent = fs116.readFileSync(params.flowPath, "utf8");
138135
+ const flowContent = fs117.readFileSync(params.flowPath, "utf8");
137918
138136
  const { steps } = parseFlowFile2(flowContent);
137919
138137
  const beforeIds = new Set(host2.listSims().map((sim) => sim.id));
137920
138138
  await runOpenCommand2([context.url, "--new", "--headless", "--no-describe"], {
@@ -137939,7 +138157,7 @@ var skill3 = {
137939
138157
  });
137940
138158
  const driver = new SootSimBridgeFlowRunner2(bridge, {
137941
138159
  screenshotDir: context.outputDir,
137942
- flowDir: path141.dirname(path141.resolve(params.flowPath)),
138160
+ flowDir: path142.dirname(path142.resolve(params.flowPath)),
137943
138161
  simId,
137944
138162
  recordingOutputDir: params.record ? context.outputDir : void 0
137945
138163
  });
@@ -137961,7 +138179,7 @@ var skill3 = {
137961
138179
  simId,
137962
138180
  videoPath: videoPath || void 0
137963
138181
  },
137964
- artifacts: videoPath ? [{ type: "video", name: path141.basename(videoPath), path: videoPath }] : void 0
138182
+ artifacts: videoPath ? [{ type: "video", name: path142.basename(videoPath), path: videoPath }] : void 0
137965
138183
  };
137966
138184
  } finally {
137967
138185
  try {
@@ -138009,8 +138227,8 @@ var skill4 = {
138009
138227
  },
138010
138228
  async execute(params, context) {
138011
138229
  const { chromium } = await import("playwright");
138012
- const path141 = await import("path");
138013
- const fs116 = await import("fs");
138230
+ const path142 = await import("path");
138231
+ const fs117 = await import("fs");
138014
138232
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
138015
138233
  headless: true
138016
138234
  });
@@ -138038,9 +138256,9 @@ var skill4 = {
138038
138256
  ...profile,
138039
138257
  fps: syncCount > 0 ? (syncCount / (duration / 1e3)).toFixed(1) : "0"
138040
138258
  };
138041
- const reportPath = path141.join(context.outputDir, "perf-report.json");
138042
- fs116.mkdirSync(path141.dirname(reportPath), { recursive: true });
138043
- fs116.writeFileSync(reportPath, JSON.stringify(report, null, 2));
138259
+ const reportPath = path142.join(context.outputDir, "perf-report.json");
138260
+ fs117.mkdirSync(path142.dirname(reportPath), { recursive: true });
138261
+ fs117.writeFileSync(reportPath, JSON.stringify(report, null, 2));
138044
138262
  return {
138045
138263
  success: true,
138046
138264
  message: `${report.fps} fps, ${profile.avgSyncMs?.toFixed(1)}ms avg sync, ${nodeCount} nodes`,
@@ -138074,8 +138292,8 @@ var skill5 = {
138074
138292
  },
138075
138293
  async execute(params, context) {
138076
138294
  const { chromium } = await import("playwright");
138077
- const path141 = await import("path");
138078
- const fs116 = await import("fs");
138295
+ const path142 = await import("path");
138296
+ const fs117 = await import("fs");
138079
138297
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
138080
138298
  headless: true
138081
138299
  });
@@ -138083,8 +138301,8 @@ var skill5 = {
138083
138301
  try {
138084
138302
  await page.goto(context.url, { waitUntil: "networkidle" });
138085
138303
  await page.waitForTimeout(2e3);
138086
- const outputPath2 = path141.join(context.outputDir, `${params.name}.png`);
138087
- fs116.mkdirSync(path141.dirname(outputPath2), { recursive: true });
138304
+ const outputPath2 = path142.join(context.outputDir, `${params.name}.png`);
138305
+ fs117.mkdirSync(path142.dirname(outputPath2), { recursive: true });
138088
138306
  await page.screenshot({ path: outputPath2 });
138089
138307
  return {
138090
138308
  success: true,
@@ -138126,8 +138344,8 @@ var skill6 = {
138126
138344
  },
138127
138345
  async execute(params, context) {
138128
138346
  const { chromium } = await import("playwright");
138129
- const path141 = await import("path");
138130
- const fs116 = await import("fs");
138347
+ const path142 = await import("path");
138348
+ const fs117 = await import("fs");
138131
138349
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
138132
138350
  headless: true
138133
138351
  });
@@ -138135,14 +138353,14 @@ var skill6 = {
138135
138353
  try {
138136
138354
  await page.goto(context.url, { waitUntil: "networkidle" });
138137
138355
  await page.waitForTimeout(2e3);
138138
- const currentPath = path141.join(context.outputDir, `${params.name}-current.png`);
138139
- fs116.mkdirSync(path141.dirname(currentPath), { recursive: true });
138356
+ const currentPath = path142.join(context.outputDir, `${params.name}-current.png`);
138357
+ fs117.mkdirSync(path142.dirname(currentPath), { recursive: true });
138140
138358
  await page.screenshot({ path: currentPath });
138141
138359
  try {
138142
138360
  const { PNG } = await import("pngjs");
138143
138361
  const pixelmatch = (await import("pixelmatch")).default;
138144
- const baseline = PNG.sync.read(fs116.readFileSync(params.baseline));
138145
- const current2 = PNG.sync.read(fs116.readFileSync(currentPath));
138362
+ const baseline = PNG.sync.read(fs117.readFileSync(params.baseline));
138363
+ const current2 = PNG.sync.read(fs117.readFileSync(currentPath));
138146
138364
  const { width, height } = baseline;
138147
138365
  const diff = new PNG({ width, height });
138148
138366
  const numDiffPixels = pixelmatch(
@@ -138153,8 +138371,8 @@ var skill6 = {
138153
138371
  height,
138154
138372
  { threshold: params.threshold || 0.1 }
138155
138373
  );
138156
- const diffPath = path141.join(context.outputDir, `${params.name}-diff.png`);
138157
- fs116.writeFileSync(diffPath, PNG.sync.write(diff));
138374
+ const diffPath = path142.join(context.outputDir, `${params.name}-diff.png`);
138375
+ fs117.writeFileSync(diffPath, PNG.sync.write(diff));
138158
138376
  const totalPixels = width * height;
138159
138377
  const diffPercent = (numDiffPixels / totalPixels * 100).toFixed(2);
138160
138378
  return {
@@ -138218,10 +138436,10 @@ var skillRegistry = {
138218
138436
  },
138219
138437
  // load skills from a project manifest (rnx-skills.json)
138220
138438
  async loadFromManifest(projectDir) {
138221
- const manifestPath = path140.join(projectDir, "rnx-skills.json");
138222
- if (!fs115.existsSync(manifestPath)) return;
138439
+ const manifestPath = path141.join(projectDir, "rnx-skills.json");
138440
+ if (!fs116.existsSync(manifestPath)) return;
138223
138441
  try {
138224
- const manifest = JSON.parse(fs115.readFileSync(manifestPath, "utf8"));
138442
+ const manifest = JSON.parse(fs116.readFileSync(manifestPath, "utf8"));
138225
138443
  if (Array.isArray(manifest.skills)) {
138226
138444
  for (const entry of manifest.skills) {
138227
138445
  if (typeof entry === "string") {
@@ -138232,7 +138450,7 @@ var skillRegistry = {
138232
138450
  }
138233
138451
  } else if (entry.file) {
138234
138452
  try {
138235
- const mod = await import(path140.resolve(projectDir, entry.file));
138453
+ const mod = await import(path141.resolve(projectDir, entry.file));
138236
138454
  if (mod.skill) this.register(mod.skill);
138237
138455
  } catch {
138238
138456
  }
@@ -138245,10 +138463,10 @@ var skillRegistry = {
138245
138463
  // auto-discover skills based on project dependencies
138246
138464
  suggestSkills(projectDir) {
138247
138465
  const suggestions = [];
138248
- const pkgPath = path140.join(projectDir, "package.json");
138249
- if (!fs115.existsSync(pkgPath)) return suggestions;
138466
+ const pkgPath = path141.join(projectDir, "package.json");
138467
+ if (!fs116.existsSync(pkgPath)) return suggestions;
138250
138468
  try {
138251
- const pkg = JSON.parse(fs115.readFileSync(pkgPath, "utf8"));
138469
+ const pkg = JSON.parse(fs116.readFileSync(pkgPath, "utf8"));
138252
138470
  const deps = { ...pkg.dependencies, ...pkg.devDependencies };
138253
138471
  if (deps["detox"] || deps["maestro"]) {
138254
138472
  suggestions.push("maestro-test");