peachsim 0.1.1463 → 0.1.1469

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 (82) hide show
  1. package/cli/bridge-flow-runner.ts +25 -17
  2. package/cli/cloud-client.ts +12 -19
  3. package/cli/commands/inspect/settling.ts +4 -1
  4. package/cli/drivers/playwright-sim-host.ts +10 -0
  5. package/dist-lib/agent-daemon-client.cjs +1 -1
  6. package/dist-lib/agent-events.cjs +1 -1
  7. package/dist-lib/attached-projects.cjs +1 -1
  8. package/dist-lib/auth/shared-session.cjs +1 -1
  9. package/dist-lib/backend-origin.cjs +1 -1
  10. package/dist-lib/beta.cjs +1 -1
  11. package/dist-lib/beta.mjs +1 -1
  12. package/dist-lib/bridge-constants.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.cjs +1 -1
  14. package/dist-lib/bridge-contract-input.mjs +1 -1
  15. package/dist-lib/bridge-contract.cjs +1 -1
  16. package/dist-lib/bridge-contract.mjs +1 -1
  17. package/dist-lib/bundle-channel.cjs +2 -2
  18. package/dist-lib/capture-contract.cjs +1 -1
  19. package/dist-lib/capture-contract.mjs +1 -1
  20. package/dist-lib/cloud-contract.cjs +1 -1
  21. package/dist-lib/cloud-contract.mjs +1 -1
  22. package/dist-lib/cloud-test-args.cjs +1 -1
  23. package/dist-lib/cloud-test-args.mjs +1 -1
  24. package/dist-lib/cloud.cjs +1 -1
  25. package/dist-lib/cloud.mjs +1 -1
  26. package/dist-lib/config.cjs +1 -1
  27. package/dist-lib/config.mjs +1 -1
  28. package/dist-lib/detox/index.cjs +191 -78
  29. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  30. package/dist-lib/expo-swift-bundle.cjs +2 -2
  31. package/dist-lib/expo-swift-metadata.cjs +1 -1
  32. package/dist-lib/expo-swift-metadata.mjs +1 -1
  33. package/dist-lib/home-paths.cjs +1 -1
  34. package/dist-lib/host/bridge-host.cjs +69 -12
  35. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  36. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  37. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  38. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  39. package/dist-lib/host/websocket-proxy.cjs +1 -1
  40. package/dist-lib/index.cjs +5 -2
  41. package/dist-lib/jump-to-source-babel.cjs +1 -1
  42. package/dist-lib/jump-to-source-native.cjs +1 -1
  43. package/dist-lib/kotlin-host.cjs +1 -1
  44. package/dist-lib/menu.cjs +1 -1
  45. package/dist-lib/menu.mjs +1 -1
  46. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  47. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  48. package/dist-lib/metro-production-bundle.cjs +1 -1
  49. package/dist-lib/metro-production-bundle.mjs +1 -1
  50. package/dist-lib/metro.cjs +1 -1
  51. package/dist-lib/native-app-identity-project.cjs +1 -1
  52. package/dist-lib/native-app-identity-project.mjs +1 -1
  53. package/dist-lib/native-app-identity.cjs +1 -1
  54. package/dist-lib/native-app-identity.mjs +1 -1
  55. package/dist-lib/native-firebase-metadata.cjs +1 -1
  56. package/dist-lib/native-firebase-metadata.mjs +1 -1
  57. package/dist-lib/plist.cjs +1 -1
  58. package/dist-lib/plist.mjs +1 -1
  59. package/dist-lib/profiles.cjs +1 -1
  60. package/dist-lib/public-brand.cjs +1 -1
  61. package/dist-lib/react-native-host-modules.cjs +1 -1
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  64. package/dist-lib/sdk.cjs +5 -2
  65. package/dist-lib/sdk.mjs +5 -2
  66. package/dist-lib/skills.cjs +480 -296
  67. package/dist-lib/swift-compile.cjs +2 -2
  68. package/dist-lib/swift-compile.mjs +2 -2
  69. package/dist-lib/swift-package.cjs +1 -1
  70. package/dist-lib/swift-package.mjs +1 -1
  71. package/dist-lib/swift-submit.cjs +1 -1
  72. package/dist-lib/swift-submit.mjs +1 -1
  73. package/dist-lib/swift-toolchain.cjs +1 -1
  74. package/dist-lib/swift.cjs +1 -1
  75. package/dist-lib/vite-swift.cjs +2 -2
  76. package/dist-lib/vite.cjs +1 -1
  77. package/dist-lib/worklet-executable.cjs +5 -1
  78. package/dist-lib/worklet-executable.mjs +5 -1
  79. package/package.json +1 -1
  80. package/src/bundle-asset-resource.ts +8 -0
  81. package/src/swift-compile.ts +4 -0
  82. package/src/worklet-executable.ts +7 -2
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1463 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -35,6 +35,103 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
35
35
  ));
36
36
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
37
 
38
+ // ../../scripts/lib/chromium-admission.ts
39
+ async function acquireChromiumAdmission(deps) {
40
+ const { fs: fs38, os: os14, path: path42, childProcess: childProcess2, label } = deps;
41
+ const dir = path42.join(
42
+ process.platform === "win32" ? os14.tmpdir() : "/tmp",
43
+ "chromium-admission"
44
+ );
45
+ fs38.mkdirSync(dir, { recursive: true });
46
+ const limit = Math.max(2, Math.floor(os14.availableParallelism() / 3));
47
+ const startedAt = Math.round(Date.now() / 1e3 - process.uptime());
48
+ const name2 = `${process.pid}-${startedAt}-${Math.random().toString(36).slice(2, 10)}`;
49
+ const ticket = path42.join(dir, name2);
50
+ fs38.closeSync(fs38.openSync(ticket, "wx"));
51
+ let released = false;
52
+ const release = () => {
53
+ if (released) return;
54
+ released = true;
55
+ process.removeListener("exit", release);
56
+ try {
57
+ fs38.unlinkSync(ticket);
58
+ } catch {
59
+ }
60
+ };
61
+ process.on("exit", release);
62
+ const verified3 = /* @__PURE__ */ new Map();
63
+ const live = (entry) => {
64
+ const match = /^(\d+)-(\d+)-/.exec(entry);
65
+ if (!match) return false;
66
+ const pid = Number(match[1]);
67
+ try {
68
+ process.kill(pid, 0);
69
+ } catch (err) {
70
+ if (!(err instanceof Error && "code" in err && err.code === "EPERM")) return false;
71
+ }
72
+ const known = verified3.get(entry);
73
+ if (known !== void 0) return known;
74
+ let same = pid === process.pid;
75
+ if (!same) {
76
+ try {
77
+ const started = childProcess2.execFileSync("ps", ["-p", String(pid), "-o", "lstart="], { encoding: "utf8" }).trim();
78
+ same = Math.abs(Date.parse(started) / 1e3 - Number(match[2])) <= 2;
79
+ } catch {
80
+ same = false;
81
+ }
82
+ }
83
+ verified3.set(entry, same);
84
+ return same;
85
+ };
86
+ let waited = false;
87
+ while (true) {
88
+ const tickets = [];
89
+ for (const entry of fs38.readdirSync(dir)) {
90
+ if (entry !== name2 && !live(entry)) {
91
+ try {
92
+ fs38.unlinkSync(path42.join(dir, entry));
93
+ } catch {
94
+ }
95
+ continue;
96
+ }
97
+ try {
98
+ tickets.push({
99
+ entry,
100
+ created: fs38.statSync(path42.join(dir, entry), { bigint: true }).ctimeNs
101
+ });
102
+ } catch {
103
+ }
104
+ }
105
+ tickets.sort(
106
+ (a, b) => a.created === b.created ? a.entry < b.entry ? -1 : 1 : a.created < b.created ? -1 : 1
107
+ );
108
+ const rank = tickets.findIndex((t) => t.entry === name2);
109
+ if (rank < 0) {
110
+ fs38.closeSync(fs38.openSync(ticket, "wx"));
111
+ continue;
112
+ }
113
+ if (rank < limit) {
114
+ if (waited) process.stderr.write(`[chromium-admission] ${label}: admitted
115
+ `);
116
+ return release;
117
+ }
118
+ if (!waited) {
119
+ const holders = tickets.slice(0, limit).map((t) => t.entry.split("-")[0]);
120
+ process.stderr.write(
121
+ `[chromium-admission] ${label}: ${limit} chromium launches already run on this machine (pids ${holders.join(" ")}), queued ${rank - limit + 1}
122
+ `
123
+ );
124
+ waited = true;
125
+ }
126
+ await new Promise((resolve10) => setTimeout(resolve10, 500));
127
+ }
128
+ }
129
+ var init_chromium_admission = __esm({
130
+ "../../scripts/lib/chromium-admission.ts"() {
131
+ "use strict";
132
+ }
133
+ });
134
+
38
135
  // ../../scripts/lib/reap-browser.ts
39
136
  function currentRuntime() {
40
137
  return { platform: process.platform, env: process.env };
@@ -318,7 +415,20 @@ function installReaper() {
318
415
  process.on("exit", reap);
319
416
  }
320
417
  async function launchReapedScoped(launch2, readIdentity2 = processIdentity) {
321
- const browser = await launch2();
418
+ const releaseAdmission = await acquireChromiumAdmission({
419
+ fs,
420
+ os,
421
+ path,
422
+ childProcess,
423
+ label: process.argv.slice(1, 3).join(" ")
424
+ });
425
+ let browser;
426
+ try {
427
+ browser = await launch2();
428
+ } catch (err) {
429
+ releaseAdmission();
430
+ throw err;
431
+ }
322
432
  let root = rootChromePid(browser);
323
433
  if (root === null) {
324
434
  try {
@@ -341,6 +451,7 @@ async function launchReapedScoped(launch2, readIdentity2 = processIdentity) {
341
451
  untrackReapPid(tracked);
342
452
  }
343
453
  mine.clear();
454
+ releaseAdmission();
344
455
  });
345
456
  }
346
457
  const reapNow = () => {
@@ -349,6 +460,7 @@ async function launchReapedScoped(launch2, readIdentity2 = processIdentity) {
349
460
  untrackReapPid(tracked);
350
461
  }
351
462
  mine.clear();
463
+ releaseAdmission();
352
464
  };
353
465
  return { browser, reapNow };
354
466
  }
@@ -538,11 +650,16 @@ async function launchReapedChrome(launch2, opts = {}, rendererTarget, policy = {
538
650
  policy.processIdentity
539
651
  );
540
652
  }
541
- var import_node_child_process, discoveredChromePids, discoveredChromeProcesses, reapPids, installed, signalShutdownClaimed, PLAYWRIGHT_DISABLED_FEATURES, PLAYWRIGHT_ENABLED_FEATURES, DISABLED_FEATURES;
653
+ var childProcess, import_node_child_process, fs, os, path, discoveredChromePids, discoveredChromeProcesses, reapPids, installed, signalShutdownClaimed, PLAYWRIGHT_DISABLED_FEATURES, PLAYWRIGHT_ENABLED_FEATURES, DISABLED_FEATURES;
542
654
  var init_reap_browser = __esm({
543
655
  "../../scripts/lib/reap-browser.ts"() {
544
656
  "use strict";
657
+ childProcess = __toESM(require("node:child_process"), 1);
545
658
  import_node_child_process = require("node:child_process");
659
+ fs = __toESM(require("node:fs"), 1);
660
+ os = __toESM(require("node:os"), 1);
661
+ path = __toESM(require("node:path"), 1);
662
+ init_chromium_admission();
546
663
  discoveredChromePids = /* @__PURE__ */ new WeakMap();
547
664
  discoveredChromeProcesses = /* @__PURE__ */ new WeakMap();
548
665
  reapPids = /* @__PURE__ */ new Map();
@@ -19141,17 +19258,17 @@ function visit(node, visitor) {
19141
19258
  } else
19142
19259
  visit_(null, node, visitor_, Object.freeze([]));
19143
19260
  }
19144
- function visit_(key2, node, visitor, path41) {
19145
- const ctrl = callVisitor(key2, node, visitor, path41);
19261
+ function visit_(key2, node, visitor, path42) {
19262
+ const ctrl = callVisitor(key2, node, visitor, path42);
19146
19263
  if (isNode(ctrl) || isPair(ctrl)) {
19147
- replaceNode(key2, path41, ctrl);
19148
- return visit_(key2, ctrl, visitor, path41);
19264
+ replaceNode(key2, path42, ctrl);
19265
+ return visit_(key2, ctrl, visitor, path42);
19149
19266
  }
19150
19267
  if (typeof ctrl !== "symbol") {
19151
19268
  if (isCollection(node)) {
19152
- path41 = Object.freeze(path41.concat(node));
19269
+ path42 = Object.freeze(path42.concat(node));
19153
19270
  for (let i = 0; i < node.items.length; ++i) {
19154
- const ci = visit_(i, node.items[i], visitor, path41);
19271
+ const ci = visit_(i, node.items[i], visitor, path42);
19155
19272
  if (typeof ci === "number")
19156
19273
  i = ci - 1;
19157
19274
  else if (ci === BREAK)
@@ -19162,13 +19279,13 @@ function visit_(key2, node, visitor, path41) {
19162
19279
  }
19163
19280
  }
19164
19281
  } else if (isPair(node)) {
19165
- path41 = Object.freeze(path41.concat(node));
19166
- const ck = visit_("key", node.key, visitor, path41);
19282
+ path42 = Object.freeze(path42.concat(node));
19283
+ const ck = visit_("key", node.key, visitor, path42);
19167
19284
  if (ck === BREAK)
19168
19285
  return BREAK;
19169
19286
  else if (ck === REMOVE)
19170
19287
  node.key = null;
19171
- const cv = visit_("value", node.value, visitor, path41);
19288
+ const cv = visit_("value", node.value, visitor, path42);
19172
19289
  if (cv === BREAK)
19173
19290
  return BREAK;
19174
19291
  else if (cv === REMOVE)
@@ -19186,17 +19303,17 @@ async function visitAsync(node, visitor) {
19186
19303
  } else
19187
19304
  await visitAsync_(null, node, visitor_, Object.freeze([]));
19188
19305
  }
19189
- async function visitAsync_(key2, node, visitor, path41) {
19190
- const ctrl = await callVisitor(key2, node, visitor, path41);
19306
+ async function visitAsync_(key2, node, visitor, path42) {
19307
+ const ctrl = await callVisitor(key2, node, visitor, path42);
19191
19308
  if (isNode(ctrl) || isPair(ctrl)) {
19192
- replaceNode(key2, path41, ctrl);
19193
- return visitAsync_(key2, ctrl, visitor, path41);
19309
+ replaceNode(key2, path42, ctrl);
19310
+ return visitAsync_(key2, ctrl, visitor, path42);
19194
19311
  }
19195
19312
  if (typeof ctrl !== "symbol") {
19196
19313
  if (isCollection(node)) {
19197
- path41 = Object.freeze(path41.concat(node));
19314
+ path42 = Object.freeze(path42.concat(node));
19198
19315
  for (let i = 0; i < node.items.length; ++i) {
19199
- const ci = await visitAsync_(i, node.items[i], visitor, path41);
19316
+ const ci = await visitAsync_(i, node.items[i], visitor, path42);
19200
19317
  if (typeof ci === "number")
19201
19318
  i = ci - 1;
19202
19319
  else if (ci === BREAK)
@@ -19207,13 +19324,13 @@ async function visitAsync_(key2, node, visitor, path41) {
19207
19324
  }
19208
19325
  }
19209
19326
  } else if (isPair(node)) {
19210
- path41 = Object.freeze(path41.concat(node));
19211
- const ck = await visitAsync_("key", node.key, visitor, path41);
19327
+ path42 = Object.freeze(path42.concat(node));
19328
+ const ck = await visitAsync_("key", node.key, visitor, path42);
19212
19329
  if (ck === BREAK)
19213
19330
  return BREAK;
19214
19331
  else if (ck === REMOVE)
19215
19332
  node.key = null;
19216
- const cv = await visitAsync_("value", node.value, visitor, path41);
19333
+ const cv = await visitAsync_("value", node.value, visitor, path42);
19217
19334
  if (cv === BREAK)
19218
19335
  return BREAK;
19219
19336
  else if (cv === REMOVE)
@@ -19240,23 +19357,23 @@ function initVisitor(visitor) {
19240
19357
  }
19241
19358
  return visitor;
19242
19359
  }
19243
- function callVisitor(key2, node, visitor, path41) {
19360
+ function callVisitor(key2, node, visitor, path42) {
19244
19361
  if (typeof visitor === "function")
19245
- return visitor(key2, node, path41);
19362
+ return visitor(key2, node, path42);
19246
19363
  if (isMap(node))
19247
- return visitor.Map?.(key2, node, path41);
19364
+ return visitor.Map?.(key2, node, path42);
19248
19365
  if (isSeq(node))
19249
- return visitor.Seq?.(key2, node, path41);
19366
+ return visitor.Seq?.(key2, node, path42);
19250
19367
  if (isPair(node))
19251
- return visitor.Pair?.(key2, node, path41);
19368
+ return visitor.Pair?.(key2, node, path42);
19252
19369
  if (isScalar(node))
19253
- return visitor.Scalar?.(key2, node, path41);
19370
+ return visitor.Scalar?.(key2, node, path42);
19254
19371
  if (isAlias(node))
19255
- return visitor.Alias?.(key2, node, path41);
19372
+ return visitor.Alias?.(key2, node, path42);
19256
19373
  return void 0;
19257
19374
  }
19258
- function replaceNode(key2, path41, node) {
19259
- const parent = path41[path41.length - 1];
19375
+ function replaceNode(key2, path42, node) {
19376
+ const parent = path42[path42.length - 1];
19260
19377
  if (isCollection(parent)) {
19261
19378
  parent.items[key2] = node;
19262
19379
  } else if (isPair(parent)) {
@@ -19856,10 +19973,10 @@ var init_createNode = __esm({
19856
19973
  });
19857
19974
 
19858
19975
  // ../../node_modules/yaml/browser/dist/nodes/Collection.js
19859
- function collectionFromPath(schema4, path41, value) {
19976
+ function collectionFromPath(schema4, path42, value) {
19860
19977
  let v = value;
19861
- for (let i = path41.length - 1; i >= 0; --i) {
19862
- const k = path41[i];
19978
+ for (let i = path42.length - 1; i >= 0; --i) {
19979
+ const k = path42[i];
19863
19980
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
19864
19981
  const a = [];
19865
19982
  a[k] = v;
@@ -19884,7 +20001,7 @@ var init_Collection = __esm({
19884
20001
  init_createNode();
19885
20002
  init_identity();
19886
20003
  init_Node();
19887
- isEmptyPath = (path41) => path41 == null || typeof path41 === "object" && !!path41[Symbol.iterator]().next().done;
20004
+ isEmptyPath = (path42) => path42 == null || typeof path42 === "object" && !!path42[Symbol.iterator]().next().done;
19888
20005
  Collection = class extends NodeBase {
19889
20006
  constructor(type, schema4) {
19890
20007
  super(type);
@@ -19914,11 +20031,11 @@ var init_Collection = __esm({
19914
20031
  * be a Pair instance or a `{ key, value }` object, which may not have a key
19915
20032
  * that already exists in the map.
19916
20033
  */
19917
- addIn(path41, value) {
19918
- if (isEmptyPath(path41))
20034
+ addIn(path42, value) {
20035
+ if (isEmptyPath(path42))
19919
20036
  this.add(value);
19920
20037
  else {
19921
- const [key2, ...rest] = path41;
20038
+ const [key2, ...rest] = path42;
19922
20039
  const node = this.get(key2, true);
19923
20040
  if (isCollection(node))
19924
20041
  node.addIn(rest, value);
@@ -19932,8 +20049,8 @@ var init_Collection = __esm({
19932
20049
  * Removes a value from the collection.
19933
20050
  * @returns `true` if the item was found and removed.
19934
20051
  */
19935
- deleteIn(path41) {
19936
- const [key2, ...rest] = path41;
20052
+ deleteIn(path42) {
20053
+ const [key2, ...rest] = path42;
19937
20054
  if (rest.length === 0)
19938
20055
  return this.delete(key2);
19939
20056
  const node = this.get(key2, true);
@@ -19947,8 +20064,8 @@ var init_Collection = __esm({
19947
20064
  * scalar values from their surrounding node; to disable set `keepScalar` to
19948
20065
  * `true` (collections are always returned intact).
19949
20066
  */
19950
- getIn(path41, keepScalar) {
19951
- const [key2, ...rest] = path41;
20067
+ getIn(path42, keepScalar) {
20068
+ const [key2, ...rest] = path42;
19952
20069
  const node = this.get(key2, true);
19953
20070
  if (rest.length === 0)
19954
20071
  return !keepScalar && isScalar(node) ? node.value : node;
@@ -19966,8 +20083,8 @@ var init_Collection = __esm({
19966
20083
  /**
19967
20084
  * Checks if the collection includes a value with the key `key`.
19968
20085
  */
19969
- hasIn(path41) {
19970
- const [key2, ...rest] = path41;
20086
+ hasIn(path42) {
20087
+ const [key2, ...rest] = path42;
19971
20088
  if (rest.length === 0)
19972
20089
  return this.has(key2);
19973
20090
  const node = this.get(key2, true);
@@ -19977,8 +20094,8 @@ var init_Collection = __esm({
19977
20094
  * Sets a value in this collection. For `!!set`, `value` needs to be a
19978
20095
  * boolean to add/remove the item from the set.
19979
20096
  */
19980
- setIn(path41, value) {
19981
- const [key2, ...rest] = path41;
20097
+ setIn(path42, value) {
20098
+ const [key2, ...rest] = path42;
19982
20099
  if (rest.length === 0) {
19983
20100
  this.set(key2, value);
19984
20101
  } else {
@@ -22412,9 +22529,9 @@ var init_Document = __esm({
22412
22529
  this.contents.add(value);
22413
22530
  }
22414
22531
  /** Adds a value to the document. */
22415
- addIn(path41, value) {
22532
+ addIn(path42, value) {
22416
22533
  if (assertCollection(this.contents))
22417
- this.contents.addIn(path41, value);
22534
+ this.contents.addIn(path42, value);
22418
22535
  }
22419
22536
  /**
22420
22537
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -22489,14 +22606,14 @@ var init_Document = __esm({
22489
22606
  * Removes a value from the document.
22490
22607
  * @returns `true` if the item was found and removed.
22491
22608
  */
22492
- deleteIn(path41) {
22493
- if (isEmptyPath(path41)) {
22609
+ deleteIn(path42) {
22610
+ if (isEmptyPath(path42)) {
22494
22611
  if (this.contents == null)
22495
22612
  return false;
22496
22613
  this.contents = null;
22497
22614
  return true;
22498
22615
  }
22499
- return assertCollection(this.contents) ? this.contents.deleteIn(path41) : false;
22616
+ return assertCollection(this.contents) ? this.contents.deleteIn(path42) : false;
22500
22617
  }
22501
22618
  /**
22502
22619
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -22511,10 +22628,10 @@ var init_Document = __esm({
22511
22628
  * scalar values from their surrounding node; to disable set `keepScalar` to
22512
22629
  * `true` (collections are always returned intact).
22513
22630
  */
22514
- getIn(path41, keepScalar) {
22515
- if (isEmptyPath(path41))
22631
+ getIn(path42, keepScalar) {
22632
+ if (isEmptyPath(path42))
22516
22633
  return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
22517
- return isCollection(this.contents) ? this.contents.getIn(path41, keepScalar) : void 0;
22634
+ return isCollection(this.contents) ? this.contents.getIn(path42, keepScalar) : void 0;
22518
22635
  }
22519
22636
  /**
22520
22637
  * Checks if the document includes a value with the key `key`.
@@ -22525,10 +22642,10 @@ var init_Document = __esm({
22525
22642
  /**
22526
22643
  * Checks if the document includes a value at `path`.
22527
22644
  */
22528
- hasIn(path41) {
22529
- if (isEmptyPath(path41))
22645
+ hasIn(path42) {
22646
+ if (isEmptyPath(path42))
22530
22647
  return this.contents !== void 0;
22531
- return isCollection(this.contents) ? this.contents.hasIn(path41) : false;
22648
+ return isCollection(this.contents) ? this.contents.hasIn(path42) : false;
22532
22649
  }
22533
22650
  /**
22534
22651
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -22545,13 +22662,13 @@ var init_Document = __esm({
22545
22662
  * Sets a value in this document. For `!!set`, `value` needs to be a
22546
22663
  * boolean to add/remove the item from the set.
22547
22664
  */
22548
- setIn(path41, value) {
22549
- if (isEmptyPath(path41)) {
22665
+ setIn(path42, value) {
22666
+ if (isEmptyPath(path42)) {
22550
22667
  this.contents = value;
22551
22668
  } else if (this.contents == null) {
22552
- this.contents = collectionFromPath(this.schema, Array.from(path41), value);
22669
+ this.contents = collectionFromPath(this.schema, Array.from(path42), value);
22553
22670
  } else if (assertCollection(this.contents)) {
22554
- this.contents.setIn(path41, value);
22671
+ this.contents.setIn(path42, value);
22555
22672
  }
22556
22673
  }
22557
22674
  /**
@@ -24456,15 +24573,15 @@ function visit2(cst, visitor) {
24456
24573
  cst = { start: cst.start, value: cst.value };
24457
24574
  _visit(Object.freeze([]), cst, visitor);
24458
24575
  }
24459
- function _visit(path41, item, visitor) {
24460
- let ctrl = visitor(item, path41);
24576
+ function _visit(path42, item, visitor) {
24577
+ let ctrl = visitor(item, path42);
24461
24578
  if (typeof ctrl === "symbol")
24462
24579
  return ctrl;
24463
24580
  for (const field of ["key", "value"]) {
24464
24581
  const token = item[field];
24465
24582
  if (token && "items" in token) {
24466
24583
  for (let i = 0; i < token.items.length; ++i) {
24467
- const ci = _visit(Object.freeze(path41.concat([[field, i]])), token.items[i], visitor);
24584
+ const ci = _visit(Object.freeze(path42.concat([[field, i]])), token.items[i], visitor);
24468
24585
  if (typeof ci === "number")
24469
24586
  i = ci - 1;
24470
24587
  else if (ci === BREAK2)
@@ -24475,10 +24592,10 @@ function _visit(path41, item, visitor) {
24475
24592
  }
24476
24593
  }
24477
24594
  if (typeof ctrl === "function" && field === "key")
24478
- ctrl = ctrl(item, path41);
24595
+ ctrl = ctrl(item, path42);
24479
24596
  }
24480
24597
  }
24481
- return typeof ctrl === "function" ? ctrl(item, path41) : ctrl;
24598
+ return typeof ctrl === "function" ? ctrl(item, path42) : ctrl;
24482
24599
  }
24483
24600
  var BREAK2, SKIP2, REMOVE2;
24484
24601
  var init_cst_visit = __esm({
@@ -24489,9 +24606,9 @@ var init_cst_visit = __esm({
24489
24606
  visit2.BREAK = BREAK2;
24490
24607
  visit2.SKIP = SKIP2;
24491
24608
  visit2.REMOVE = REMOVE2;
24492
- visit2.itemAtPath = (cst, path41) => {
24609
+ visit2.itemAtPath = (cst, path42) => {
24493
24610
  let item = cst;
24494
- for (const [field, index] of path41) {
24611
+ for (const [field, index] of path42) {
24495
24612
  const tok = item?.[field];
24496
24613
  if (tok && "items" in tok) {
24497
24614
  item = tok.items[index];
@@ -24500,9 +24617,9 @@ var init_cst_visit = __esm({
24500
24617
  }
24501
24618
  return item;
24502
24619
  };
24503
- visit2.parentCollection = (cst, path41) => {
24504
- const parent = visit2.itemAtPath(cst, path41.slice(0, -1));
24505
- const field = path41[path41.length - 1][0];
24620
+ visit2.parentCollection = (cst, path42) => {
24621
+ const parent = visit2.itemAtPath(cst, path42.slice(0, -1));
24622
+ const field = path42[path42.length - 1][0];
24506
24623
  const coll = parent?.[field];
24507
24624
  if (coll && "items" in coll)
24508
24625
  return coll;
@@ -25805,14 +25922,14 @@ var init_parser = __esm({
25805
25922
  case "scalar":
25806
25923
  case "single-quoted-scalar":
25807
25924
  case "double-quoted-scalar": {
25808
- const fs37 = this.flowScalar(this.type);
25925
+ const fs38 = this.flowScalar(this.type);
25809
25926
  if (atNextItem || it.value) {
25810
- map2.items.push({ start, key: fs37, sep: [] });
25927
+ map2.items.push({ start, key: fs38, sep: [] });
25811
25928
  this.onKeyLine = true;
25812
25929
  } else if (it.sep) {
25813
- this.stack.push(fs37);
25930
+ this.stack.push(fs38);
25814
25931
  } else {
25815
- Object.assign(it, { key: fs37, sep: [] });
25932
+ Object.assign(it, { key: fs38, sep: [] });
25816
25933
  this.onKeyLine = true;
25817
25934
  }
25818
25935
  return;
@@ -25940,13 +26057,13 @@ var init_parser = __esm({
25940
26057
  case "scalar":
25941
26058
  case "single-quoted-scalar":
25942
26059
  case "double-quoted-scalar": {
25943
- const fs37 = this.flowScalar(this.type);
26060
+ const fs38 = this.flowScalar(this.type);
25944
26061
  if (!it || it.value)
25945
- fc.items.push({ start: [], key: fs37, sep: [] });
26062
+ fc.items.push({ start: [], key: fs38, sep: [] });
25946
26063
  else if (it.sep)
25947
- this.stack.push(fs37);
26064
+ this.stack.push(fs38);
25948
26065
  else
25949
- Object.assign(it, { key: fs37, sep: [] });
26066
+ Object.assign(it, { key: fs38, sep: [] });
25950
26067
  return;
25951
26068
  }
25952
26069
  case "flow-map-end":
@@ -27326,9 +27443,9 @@ function safeChildPlistName(value) {
27326
27443
  name: file.toLowerCase().endsWith(".plist") ? file : `${file}.plist`
27327
27444
  };
27328
27445
  }
27329
- async function readableSettingsBundle(path41) {
27446
+ async function readableSettingsBundle(path42) {
27330
27447
  try {
27331
- const root = await (0, import_promises.stat)((0, import_node_path.join)(path41, "Root.plist"));
27448
+ const root = await (0, import_promises.stat)((0, import_node_path.join)(path42, "Root.plist"));
27332
27449
  return root.isFile() && root.size <= MAX_PLIST_BYTES;
27333
27450
  } catch {
27334
27451
  return false;
@@ -27373,11 +27490,11 @@ async function settingsBundleFingerprint(bundlePath) {
27373
27490
  return null;
27374
27491
  }
27375
27492
  }
27376
- async function parsePlistRecord(path41) {
27493
+ async function parsePlistRecord(path42) {
27377
27494
  try {
27378
- const metadata = await (0, import_promises.stat)(path41);
27495
+ const metadata = await (0, import_promises.stat)(path42);
27379
27496
  if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
27380
- const source = await (0, import_promises.readFile)(path41, "utf8");
27497
+ const source = await (0, import_promises.readFile)(path42, "utf8");
27381
27498
  const parsed = parsePlistSource(source);
27382
27499
  return isRecord2(parsed) ? parsed : null;
27383
27500
  } catch {
@@ -27723,7 +27840,7 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
27723
27840
  return null;
27724
27841
  }
27725
27842
  }
27726
- function httpGet(hostname, port, path41, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
27843
+ function httpGet(hostname, port, path42, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
27727
27844
  return new Promise((resolve10) => {
27728
27845
  let settled = false;
27729
27846
  let killing = false;
@@ -27732,7 +27849,7 @@ function httpGet(hostname, port, path41, method = "GET", timeout = TIMEOUT_MS, h
27732
27849
  settled = true;
27733
27850
  resolve10(value);
27734
27851
  };
27735
- const req = import_http.default.request({ hostname, port, path: path41, method, headers }, (res) => {
27852
+ const req = import_http.default.request({ hostname, port, path: path42, method, headers }, (res) => {
27736
27853
  let body = "";
27737
27854
  res.on("data", (c) => body += c.toString());
27738
27855
  const contentType = (() => {
@@ -31987,7 +32104,7 @@ function compileSwiftProjectUnit(input, options) {
31987
32104
  };
31988
32105
  const hash = swiftArtifactHash(input, options.release, moduleRoot);
31989
32106
  return serialize(root, async () => {
31990
- if (process.platform === "darwin" && process.env.TM_SESSION && process.env.CI !== "true" && moduleRoot === import_node_path10.default.resolve(__sootsim_import_meta_dirname, "../../sootsim-swift") && !swiftDistributionAt(moduleRoot)) {
32107
+ if (process.platform === "darwin" && process.env.TM_SESSION && !process.env.CONTRAST_REMOTE_BUILD && process.env.CI !== "true" && moduleRoot === import_node_path10.default.resolve(__sootsim_import_meta_dirname, "../../sootsim-swift") && !swiftDistributionAt(moduleRoot)) {
31991
32108
  const requestRoot = (0, import_node_fs10.mkdtempSync)(import_node_path10.default.join(root, ".builder-request-"));
31992
32109
  const output = import_node_path10.default.join(requestRoot, "output");
31993
32110
  const request = import_node_path10.default.join(requestRoot, "request.json");
@@ -32542,8 +32659,8 @@ function imagesetFiles(images) {
32542
32659
  ];
32543
32660
  }).sort((a, b) => a.scale - b.scale);
32544
32661
  }
32545
- function flatScale(path41) {
32546
- const match = /@([23])x\.[^./]+$/.exec(path41);
32662
+ function flatScale(path42) {
32663
+ const match = /@([23])x\.[^./]+$/.exec(path42);
32547
32664
  return match ? Number(match[1]) : 1;
32548
32665
  }
32549
32666
  function providesNamespace(text3) {
@@ -32570,8 +32687,8 @@ function catalogEntryName(contentsPath, kind, readText2) {
32570
32687
  }
32571
32688
  return segments.join("/");
32572
32689
  }
32573
- function isFlatResourceImage(path41) {
32574
- return path41.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path41));
32690
+ function isFlatResourceImage(path42) {
32691
+ return path42.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path42));
32575
32692
  }
32576
32693
  function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
32577
32694
  const table = [];
@@ -32584,7 +32701,7 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
32584
32701
  seen.set(bundlePath, names);
32585
32702
  return { bundlePath, names };
32586
32703
  };
32587
- const catalogs = paths.filter((path41) => baseOf(path41) === "Contents.json");
32704
+ const catalogs = paths.filter((path42) => baseOf(path42) === "Contents.json");
32588
32705
  for (const contentsPath of catalogs) {
32589
32706
  const name2 = catalogEntryName(contentsPath, ".imageset", readText2);
32590
32707
  if (name2 === null) continue;
@@ -32612,13 +32729,13 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
32612
32729
  bundlePath
32613
32730
  });
32614
32731
  }
32615
- for (const path41 of paths) {
32616
- if (!isFlatResourceImage(path41)) continue;
32617
- const name2 = baseOf(path41).slice(0, -extOf(path41).length);
32618
- const { bundlePath, names } = namesFor(path41);
32732
+ for (const path42 of paths) {
32733
+ if (!isFlatResourceImage(path42)) continue;
32734
+ const name2 = baseOf(path42).slice(0, -extOf(path42).length);
32735
+ const { bundlePath, names } = namesFor(path42);
32619
32736
  if (name2 === "" || names.has(name2)) continue;
32620
32737
  names.add(name2);
32621
- table.push({ name: name2, file: path41, scale: flatScale(path41), bundlePath });
32738
+ table.push({ name: name2, file: path42, scale: flatScale(path42), bundlePath });
32622
32739
  }
32623
32740
  return table;
32624
32741
  }
@@ -32647,7 +32764,7 @@ function colorsetValue(color) {
32647
32764
  }
32648
32765
  function enumerateBundleColors(paths, readText2) {
32649
32766
  const table = {};
32650
- for (const contentsPath of paths.filter((path41) => baseOf(path41) === "Contents.json")) {
32767
+ for (const contentsPath of paths.filter((path42) => baseOf(path42) === "Contents.json")) {
32651
32768
  const name2 = catalogEntryName(contentsPath, ".colorset", readText2);
32652
32769
  if (name2 === null || name2 in table) continue;
32653
32770
  let colors;
@@ -32711,8 +32828,8 @@ function axisExtremes(points) {
32711
32828
  function pathBounds(d) {
32712
32829
  const xs = [];
32713
32830
  const ys = [];
32714
- for (const path41 of d)
32715
- (0, import_svgpath.default)(path41).abs().unshort().unarc().iterate((segment, _index, x, y) => {
32831
+ for (const path42 of d)
32832
+ (0, import_svgpath.default)(path42).abs().unshort().unarc().iterate((segment, _index, x, y) => {
32716
32833
  const [command, ...args] = segment;
32717
32834
  if (command === "M" || command === "L") {
32718
32835
  xs.push(Number(args[0]));
@@ -32739,7 +32856,7 @@ function guide(svg, id, axis) {
32739
32856
  }
32740
32857
  function enumerateBundleSymbols(paths, readText2, bundleForFile) {
32741
32858
  const table = {};
32742
- for (const contentsPath of paths.filter((path41) => baseOf(path41) === "Contents.json")) {
32859
+ for (const contentsPath of paths.filter((path42) => baseOf(path42) === "Contents.json")) {
32743
32860
  const name2 = catalogEntryName(contentsPath, ".symbolset", readText2);
32744
32861
  if (name2 === null) continue;
32745
32862
  const bundle = bundleForFile(contentsPath);
@@ -32775,24 +32892,24 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
32775
32892
  viewBox: "0 0 24 24",
32776
32893
  advance,
32777
32894
  box: [12 - advance / 2, 12 - tall / 2, advance, tall],
32778
- layers: d.map((path41) => ({
32779
- d: (0, import_svgpath.default)(path41).abs().scale(scale).translate(translateX, translateY).round(3).toString()
32895
+ layers: d.map((path42) => ({
32896
+ d: (0, import_svgpath.default)(path42).abs().scale(scale).translate(translateX, translateY).round(3).toString()
32780
32897
  }))
32781
32898
  };
32782
32899
  }
32783
32900
  return table;
32784
32901
  }
32785
- function isCopiedResource(path41) {
32786
- if (path41.split("/").some((segment) => segment.endsWith(".atlasc"))) return true;
32787
- const ext = extOf(path41);
32902
+ function isCopiedResource(path42) {
32903
+ if (path42.split("/").some((segment) => segment.endsWith(".atlasc"))) return true;
32904
+ const ext = extOf(path42);
32788
32905
  if (ext === ".json" || ext === ".xcstrings") return true;
32789
- return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !path41.split("/").some((segment) => NESTED_BUNDLE_DIR.test(segment));
32906
+ return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !path42.split("/").some((segment) => NESTED_BUNDLE_DIR.test(segment));
32790
32907
  }
32791
32908
  function enumerateBundleResources(paths) {
32792
32909
  const found = [];
32793
32910
  const seen = /* @__PURE__ */ new Set();
32794
32911
  const ordered = [...paths].filter(
32795
- (path41) => path41.split("/").includes("Resources") && path41.split("/").every((segment) => segment !== "" && segment !== "..") && isCopiedResource(path41)
32912
+ (path42) => path42.split("/").includes("Resources") && path42.split("/").every((segment) => segment !== "" && segment !== "..") && isCopiedResource(path42)
32796
32913
  ).sort((a, b) => {
32797
32914
  const aDepth = a.split("/").length;
32798
32915
  const bDepth = b.split("/").length;
@@ -34111,10 +34228,10 @@ function emitSwiftStandin(graphs, options) {
34111
34228
  owners.push(...physical.map(() => current));
34112
34229
  };
34113
34230
  const scoped = (body) => (symbol, ...rest) => {
34114
- const path41 = pathOf(symbol);
34115
- if (omit.has(path41)) return void skipped.push({ path: path41, reason: omit.get(path41) });
34231
+ const path42 = pathOf(symbol);
34232
+ if (omit.has(path42)) return void skipped.push({ path: path42, reason: omit.get(path42) });
34116
34233
  const previous = current;
34117
- current = path41;
34234
+ current = path42;
34118
34235
  try {
34119
34236
  body(symbol, ...rest);
34120
34237
  } finally {
@@ -34134,14 +34251,14 @@ function emitSwiftStandin(graphs, options) {
34134
34251
  const access = (symbol, openOwner) => symbol.accessLevel === "open" && openOwner ? "open" : "public";
34135
34252
  const emitMember = scoped(
34136
34253
  (member, indent, context) => {
34137
- const path41 = pathOf(member);
34254
+ const path42 = pathOf(member);
34138
34255
  if (TYPE_KINDS.has(member.kind.identifier)) {
34139
34256
  emitType(member, indent);
34140
34257
  return;
34141
34258
  }
34142
34259
  if (member.kind.identifier === "swift.enum.case") return;
34143
34260
  if (!MEMBER_KINDS.has(member.kind.identifier)) {
34144
- skipped.push({ path: path41, reason: `unhandled ${member.kind.identifier}` });
34261
+ skipped.push({ path: path42, reason: `unhandled ${member.kind.identifier}` });
34145
34262
  return;
34146
34263
  }
34147
34264
  const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(member));
@@ -34155,12 +34272,12 @@ function emitSwiftStandin(graphs, options) {
34155
34272
  const final = context.inClass && flags.has("final") ? "final " : "";
34156
34273
  const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
34157
34274
  let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
34158
- const override = context.inClass && !options.plain?.has(path41) && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path41) || isObjC(member) && path41.endsWith(".init()")) ? "override " : "";
34275
+ const override = context.inClass && !options.plain?.has(path42) && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path42) || isObjC(member) && path42.endsWith(".init()")) ? "override " : "";
34159
34276
  const head = `${indent}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
34160
- const measured = behavior.get(path41);
34161
- if (measured) used.add(path41);
34277
+ const measured = behavior.get(path42);
34278
+ if (measured) used.add(path42);
34162
34279
  const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
34163
- const body = overloadBody ?? measured?.body ?? trap(path41);
34280
+ const body = overloadBody ?? measured?.body ?? trap(path42);
34164
34281
  switch (member.kind.identifier) {
34165
34282
  case "swift.property":
34166
34283
  case "swift.type.property":
@@ -34181,7 +34298,7 @@ function emitSwiftStandin(graphs, options) {
34181
34298
  return;
34182
34299
  }
34183
34300
  emit(
34184
- `${head}${computed} { get${effects} { ${body} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? trap(path41)} }` : ""} }`
34301
+ `${head}${computed} { get${effects} { ${body} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? trap(path42)} }` : ""} }`
34185
34302
  );
34186
34303
  return;
34187
34304
  }
@@ -34234,7 +34351,7 @@ function emitSwiftStandin(graphs, options) {
34234
34351
  };
34235
34352
  const emitType = scoped(
34236
34353
  (symbol, indent) => {
34237
- const path41 = pathOf(symbol);
34354
+ const path42 = pathOf(symbol);
34238
34355
  const id = symbol.identifier.precise;
34239
34356
  const inner = `${indent} `;
34240
34357
  switch (symbol.kind.identifier) {
@@ -34246,10 +34363,10 @@ function emitSwiftStandin(graphs, options) {
34246
34363
  case "swift.class": {
34247
34364
  const shape = header(symbol, "class", indent);
34248
34365
  if (!shape)
34249
- return void skipped.push({ path: path41, reason: `unparsed class ${text(symbol)}` });
34250
- const parent = options.superclasses?.get(path41) ?? superclass.get(id);
34366
+ return void skipped.push({ path: path42, reason: `unparsed class ${text(symbol)}` });
34367
+ const parent = options.superclasses?.get(path42) ?? superclass.get(id);
34251
34368
  const blocked = classBlocked(id);
34252
- if (blocked) return void skipped.push({ path: path41, reason: blocked });
34369
+ if (blocked) return void skipped.push({ path: path42, reason: blocked });
34253
34370
  const ancestors = /* @__PURE__ */ new Set();
34254
34371
  for (let at = superId.get(id); at; at = superId.get(at))
34255
34372
  for (const name2 of conforms.get(at) ?? []) ancestors.add(name2);
@@ -34265,9 +34382,9 @@ function emitSwiftStandin(graphs, options) {
34265
34382
  `${indent}${shape.attrs}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
34266
34383
  );
34267
34384
  const members = membersOf(id);
34268
- const extra = options.behavior?.get(path41)?.members;
34385
+ const extra = options.behavior?.get(path42)?.members;
34269
34386
  if (extra) {
34270
- used.add(path41);
34387
+ used.add(path42);
34271
34388
  emit(`${inner}${extra}`);
34272
34389
  }
34273
34390
  for (const member of members)
@@ -34319,13 +34436,13 @@ function emitSwiftStandin(graphs, options) {
34319
34436
  continue;
34320
34437
  have.add(witnessKey(member));
34321
34438
  have.add(sideLeaf(member));
34322
- emitWitness(member, inner, path41);
34439
+ emitWitness(member, inner, path42);
34323
34440
  }
34324
34441
  }
34325
34442
  const coder = members.some((member) => leaf(member) === "init(coder:)");
34326
34443
  if (designated && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
34327
34444
  emit(
34328
- `${inner}public required init?(coder: NSCoder) { ${trap(`${path41}.init(coder:)`)} }`
34445
+ `${inner}public required init?(coder: NSCoder) { ${trap(`${path42}.init(coder:)`)} }`
34329
34446
  );
34330
34447
  emit(`${indent}}`);
34331
34448
  return;
@@ -34333,7 +34450,7 @@ function emitSwiftStandin(graphs, options) {
34333
34450
  case "swift.struct": {
34334
34451
  const shape = header(symbol, "struct", indent);
34335
34452
  if (!shape)
34336
- return void skipped.push({ path: path41, reason: `unparsed struct ${text(symbol)}` });
34453
+ return void skipped.push({ path: path42, reason: `unparsed struct ${text(symbol)}` });
34337
34454
  const members = membersOf(id);
34338
34455
  const raw2 = rawType(members);
34339
34456
  const list2 = inheritance(id);
@@ -34365,7 +34482,7 @@ function emitSwiftStandin(graphs, options) {
34365
34482
  case "swift.enum": {
34366
34483
  const shape = header(symbol, "enum", indent);
34367
34484
  if (!shape)
34368
- return void skipped.push({ path: path41, reason: `unparsed enum ${text(symbol)}` });
34485
+ return void skipped.push({ path: path42, reason: `unparsed enum ${text(symbol)}` });
34369
34486
  const members = membersOf(id);
34370
34487
  const raw2 = rawType(members);
34371
34488
  const cases = members.filter(
@@ -34374,7 +34491,7 @@ function emitSwiftStandin(graphs, options) {
34374
34491
  const missing = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
34375
34492
  if (raw2 && isObjC(symbol) && missing.length > 0)
34376
34493
  return void skipped.push({
34377
- path: path41,
34494
+ path: path42,
34378
34495
  reason: `no header value for ${missing.map(leaf).join(", ")}`
34379
34496
  });
34380
34497
  const list2 = inheritance(id, raw2 ?? void 0).filter(
@@ -34414,7 +34531,7 @@ function emitSwiftStandin(graphs, options) {
34414
34531
  const shape = header(symbol, "protocol", indent);
34415
34532
  if (!shape)
34416
34533
  return void skipped.push({
34417
- path: path41,
34534
+ path: path42,
34418
34535
  reason: `unparsed protocol ${text(symbol)}`
34419
34536
  });
34420
34537
  const list2 = [...isObjC(symbol) ? ["AnyObject"] : [], ...inheritance(id)];
@@ -34439,7 +34556,7 @@ function emitSwiftStandin(graphs, options) {
34439
34556
  }
34440
34557
  emit(`${indent}}`);
34441
34558
  if (defaults.length > 0) {
34442
- emit(`${indent}extension ${path41} {`);
34559
+ emit(`${indent}extension ${path42} {`);
34443
34560
  for (const member of defaults) {
34444
34561
  const decl = text(member);
34445
34562
  if (optional.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
@@ -34485,7 +34602,7 @@ function emitSwiftStandin(graphs, options) {
34485
34602
  return init ? /rawValue:\s*([^)]+)\)/.exec(text(init))?.[1]?.trim() ?? null : null;
34486
34603
  };
34487
34604
  const emitGlobal = scoped((symbol) => {
34488
- const path41 = pathOf(symbol);
34605
+ const path42 = pathOf(symbol);
34489
34606
  const kind = symbol.kind.identifier;
34490
34607
  if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
34491
34608
  const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(symbol));
@@ -34496,22 +34613,22 @@ function emitSwiftStandin(graphs, options) {
34496
34613
  if (fix && !/^(?:prefix|infix|postfix)\b/.test(spelled))
34497
34614
  spelled = `${fix} ${spelled}`;
34498
34615
  }
34499
- const measured = behavior.get(path41);
34500
- if (measured) used.add(path41);
34616
+ const measured = behavior.get(path42);
34617
+ if (measured) used.add(path42);
34501
34618
  const overloadBody = /\basync\b/.test(spelled) ? measured?.asyncBody : /\bResult</.test(spelled) ? measured?.resultBody : void 0;
34502
34619
  emit(
34503
- `${attrs}public ${spelled} { ${overloadBody ?? measured?.body ?? trap(path41)} }`
34620
+ `${attrs}public ${spelled} { ${overloadBody ?? measured?.body ?? trap(path42)} }`
34504
34621
  );
34505
34622
  } else if (kind === "swift.var") {
34506
34623
  const parsed = splitAccessors(text(symbol).replace(/^let /, "var "));
34507
- const measured = behavior.get(path41);
34508
- if (measured) used.add(path41);
34509
- emit(`public ${parsed.decl} { ${measured?.body ?? trap(path41)} }`);
34510
- } else skipped.push({ path: path41, reason: `unhandled top-level ${kind}` });
34624
+ const measured = behavior.get(path42);
34625
+ if (measured) used.add(path42);
34626
+ emit(`public ${parsed.decl} { ${measured?.body ?? trap(path42)} }`);
34627
+ } else skipped.push({ path: path42, reason: `unhandled top-level ${kind}` });
34511
34628
  });
34512
34629
  const roots = [...byId.values()].filter((symbol) => !owner.has(symbol.identifier.precise) && !unavailable(symbol)).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
34513
34630
  for (const symbol of roots) {
34514
- const path41 = pathOf(symbol);
34631
+ const path42 = pathOf(symbol);
34515
34632
  if (TYPE_KINDS.has(symbol.kind.identifier)) emitType(symbol, "");
34516
34633
  else emitGlobal(symbol);
34517
34634
  }
@@ -34552,9 +34669,9 @@ function emitSwiftStandin(graphs, options) {
34552
34669
  ...imports.map((name2) => `import ${name2}`),
34553
34670
  ""
34554
34671
  ];
34555
- for (const path41 of behavior.keys())
34556
- if (!used.has(path41))
34557
- skipped.push({ path: path41, reason: "behavior names no emitted declaration" });
34672
+ for (const path42 of behavior.keys())
34673
+ if (!used.has(path42))
34674
+ skipped.push({ path: path42, reason: "behavior names no emitted declaration" });
34558
34675
  return {
34559
34676
  source: `${[...banner, ...lines].join("\n")}
34560
34677
  `,
@@ -34641,7 +34758,7 @@ var init_swift_standin_emit = __esm({
34641
34758
  sideLeaf = (symbol) => `${symbol.kind.identifier.startsWith("swift.type.") ? "type" : "instance"}|leaf|${leaf(symbol)}`;
34642
34759
  isObjC = (symbol) => symbol.identifier.precise.startsWith("c:");
34643
34760
  synthesizedEquality = (symbol, conforms) => conforms.includes("Hashable") ? ["==(_:_:)", "hash(into:)", "hashValue"].includes(leaf(symbol)) : conforms.includes("Equatable") && leaf(symbol) === "==(_:_:)";
34644
- trap = (path41) => `fatalError("${path41} is a binary framework peach cannot run")`;
34761
+ trap = (path42) => `fatalError("${path42} is a binary framework peach cannot run")`;
34645
34762
  KEYWORDS = /* @__PURE__ */ new Set([
34646
34763
  "Type",
34647
34764
  "Protocol",
@@ -39473,8 +39590,8 @@ function sourceEntryPath() {
39473
39590
  return null;
39474
39591
  }
39475
39592
  }
39476
- function isCliEntry(path41) {
39477
- const name2 = (0, import_node_path23.basename)(path41);
39593
+ function isCliEntry(path42) {
39594
+ const name2 = (0, import_node_path23.basename)(path42);
39478
39595
  return name2 === "bin.ts" || name2 === "bin.js";
39479
39596
  }
39480
39597
  function rnxSelfInvocation() {
@@ -45100,6 +45217,15 @@ var init_metro_production_bundle = __esm({
45100
45217
  }
45101
45218
  });
45102
45219
 
45220
+ // src/bundle-asset-resource.ts
45221
+ var PEACH_BUNDLE_ASSET_PREFIX;
45222
+ var init_bundle_asset_resource = __esm({
45223
+ "src/bundle-asset-resource.ts"() {
45224
+ "use strict";
45225
+ PEACH_BUNDLE_ASSET_PREFIX = "peach-asset://";
45226
+ }
45227
+ });
45228
+
45103
45229
  // ../contrast-bundler/src/metroAssetArtifact.ts
45104
45230
  function isEmbeddedAssetDescriptor(descriptor) {
45105
45231
  return descriptor.fileUris?.length === descriptor.scales.length && descriptor.fileHashes?.length === descriptor.scales.length;
@@ -45641,6 +45767,56 @@ async function assertSelfContainedMetroArtifactAssets(bundle) {
45641
45767
  sizes: sortedAssetSizes(sizes)
45642
45768
  };
45643
45769
  }
45770
+ async function separateMetroArtifactAssets(bundle) {
45771
+ const assets2 = await assertSelfContainedMetroArtifactAssets(bundle);
45772
+ const sites = scanAssetDescriptorSites(bundle);
45773
+ const resources = /* @__PURE__ */ new Map();
45774
+ const entries = /* @__PURE__ */ new Map();
45775
+ for (const site of sites) {
45776
+ const descriptor = site.descriptor;
45777
+ const key2 = assetDescriptorKey(descriptor);
45778
+ if (entries.has(key2)) continue;
45779
+ const contentType = metroAssetContentType(descriptor.type);
45780
+ const prefix = `data:${contentType};base64,`;
45781
+ const fileUris = [];
45782
+ const fileHashes = [];
45783
+ for (let index = 0; index < descriptor.scales.length; index++) {
45784
+ const dataUri = descriptor.fileUris?.[index];
45785
+ const sha256 = descriptor.fileHashes?.[index];
45786
+ if (!dataUri || !sha256) throw new Error("verified Metro asset is incomplete");
45787
+ const scale = descriptor.scales[index];
45788
+ if (scale === void 0) throw new Error("verified Metro asset scale is missing");
45789
+ const filename = metroAssetScaleFilename(descriptor.name, descriptor.type, scale);
45790
+ const uri = `${PEACH_BUNDLE_ASSET_PREFIX}${sha256}/${encodeURIComponent(filename)}`;
45791
+ if (!resources.has(uri)) {
45792
+ const bytes = decodeBase64ToBytes(dataUri.slice(prefix.length));
45793
+ resources.set(uri, {
45794
+ uri,
45795
+ sha256,
45796
+ contentType,
45797
+ bytes,
45798
+ byteLength: bytes.byteLength
45799
+ });
45800
+ }
45801
+ fileUris.push(uri);
45802
+ fileHashes.push(sha256);
45803
+ }
45804
+ entries.set(key2, { fileUris, fileHashes, scales: descriptor.scales });
45805
+ }
45806
+ const pieces = [];
45807
+ let cursor = 0;
45808
+ for (const site of sites) {
45809
+ const entry = entries.get(assetDescriptorKey(site.descriptor));
45810
+ if (!entry) throw new Error("verified Metro asset descriptor is missing");
45811
+ pieces.push(
45812
+ bundle.slice(cursor, site.start),
45813
+ rewriteDescriptorObject(bundle, site, entry)
45814
+ );
45815
+ cursor = site.end;
45816
+ }
45817
+ pieces.push(bundle.slice(cursor));
45818
+ return { code: pieces.join(""), assets: assets2, resources: [...resources.values()] };
45819
+ }
45644
45820
  function metroAssetScaleFilename(name2, type, scale) {
45645
45821
  const suffix = scale === 1 ? "" : `@${scale}x`;
45646
45822
  return `${name2}${suffix}.${type}`;
@@ -45668,8 +45844,8 @@ function metroIosAssetDestRelatives(httpServerLocation, filename) {
45668
45844
  }
45669
45845
  const out = [];
45670
45846
  for (const dir of dirs) {
45671
- const path41 = `${dir}/${filename}`;
45672
- if (!out.includes(path41)) out.push(path41);
45847
+ const path42 = `${dir}/${filename}`;
45848
+ if (!out.includes(path42)) out.push(path42);
45673
45849
  }
45674
45850
  if (!out.includes(filename)) out.push(filename);
45675
45851
  return out;
@@ -45835,6 +46011,7 @@ var EXPRESSION_KEYWORDS, PLACEHOLDER_JPEG, METRO_ASSET_PLACEHOLDERS;
45835
46011
  var init_metroAssetArtifact = __esm({
45836
46012
  "../contrast-bundler/src/metroAssetArtifact.ts"() {
45837
46013
  "use strict";
46014
+ init_bundle_asset_resource();
45838
46015
  EXPRESSION_KEYWORDS = /* @__PURE__ */ new Set([
45839
46016
  "await",
45840
46017
  "case",
@@ -46689,13 +46866,13 @@ function readFactoryStringLiterals(factory) {
46689
46866
  return literals;
46690
46867
  }
46691
46868
  function normalizeFingerprintLiteral(literal2) {
46692
- const path41 = literal2.replaceAll("\\\\", "/").replaceAll("\\/", "/");
46869
+ const path42 = literal2.replaceAll("\\\\", "/").replaceAll("\\/", "/");
46693
46870
  const nodeModulesMarker = "/node_modules/";
46694
- const nodeModulesIndex = path41.lastIndexOf(nodeModulesMarker);
46871
+ const nodeModulesIndex = path42.lastIndexOf(nodeModulesMarker);
46695
46872
  if (nodeModulesIndex >= 0) {
46696
- return `node_modules/${path41.slice(nodeModulesIndex + nodeModulesMarker.length)}`;
46873
+ return `node_modules/${path42.slice(nodeModulesIndex + nodeModulesMarker.length)}`;
46697
46874
  }
46698
- if ((path41.startsWith("/") || /^[A-Za-z]:\//.test(path41) || path41.startsWith("file:/")) && /\.[cm]?[jt]sx?(?::\d+(?::\d+)?)?$/.test(path41)) {
46875
+ if ((path42.startsWith("/") || /^[A-Za-z]:\//.test(path42) || path42.startsWith("file:/")) && /\.[cm]?[jt]sx?(?::\d+(?::\d+)?)?$/.test(path42)) {
46699
46876
  return null;
46700
46877
  }
46701
46878
  return literal2;
@@ -46933,10 +47110,10 @@ function templateAssignment(template, embeddings) {
46933
47110
  if (existingNode !== void 0 && existingNode !== nodeIndex) return null;
46934
47111
  nodesByModuleId.set(moduleId, nodeIndex);
46935
47112
  const node = template.nodes[nodeIndex];
46936
- const path41 = node.landmarkPath ?? `node_modules/${template.packageName}/__rnx_inferred__/${moduleId}.js`;
47113
+ const path42 = node.landmarkPath ?? `node_modules/${template.packageName}/__rnx_inferred__/${moduleId}.js`;
46937
47114
  const existingPath = pathsByModuleId.get(moduleId);
46938
- if (existingPath !== void 0 && existingPath !== path41) return null;
46939
- pathsByModuleId.set(moduleId, path41);
47115
+ if (existingPath !== void 0 && existingPath !== path42) return null;
47116
+ pathsByModuleId.set(moduleId, path42);
46940
47117
  }
46941
47118
  }
46942
47119
  return {
@@ -47098,14 +47275,14 @@ async function inferMetroModuleIdentity(args) {
47098
47275
  const packageClaims = claimsByPackage.values().next().value;
47099
47276
  if (!packageClaims) continue;
47100
47277
  const exactClaims = packageClaims.filter((assignment2) => {
47101
- const path41 = assignment2.pathsByModuleId.get(moduleId);
47102
- return path41 !== void 0 && !path41.includes("/__rnx_inferred__/");
47278
+ const path42 = assignment2.pathsByModuleId.get(moduleId);
47279
+ return path42 !== void 0 && !path42.includes("/__rnx_inferred__/");
47103
47280
  });
47104
47281
  const preferredClaims = exactClaims.length > 0 ? exactClaims : packageClaims;
47105
47282
  const routes = new Set(
47106
47283
  preferredClaims.flatMap((assignment2) => {
47107
- const path41 = assignment2.pathsByModuleId.get(moduleId);
47108
- return path41 ? [metroFingerprintModuleClaimRoute(assignment2.packageName, path41)] : [];
47284
+ const path42 = assignment2.pathsByModuleId.get(moduleId);
47285
+ return path42 ? [metroFingerprintModuleClaimRoute(assignment2.packageName, path42)] : [];
47109
47286
  })
47110
47287
  );
47111
47288
  if (routes.size !== 1) continue;
@@ -47461,8 +47638,8 @@ function metadataValue(value, key2) {
47461
47638
  if (!value || typeof value !== "object") return void 0;
47462
47639
  return Object.getOwnPropertyDescriptor(value, key2)?.value;
47463
47640
  }
47464
- function readProjectJson(path41, files2 = nodeRepoFileReader) {
47465
- const text3 = readProjectMetadata(path41, files2);
47641
+ function readProjectJson(path42, files2 = nodeRepoFileReader) {
47642
+ const text3 = readProjectMetadata(path42, files2);
47466
47643
  if (text3 === null) return null;
47467
47644
  try {
47468
47645
  const value = JSON.parse(text3);
@@ -47498,17 +47675,17 @@ function readNativeProjectRenderer(dir, platform, files2 = nodeRepoFileReader) {
47498
47675
  declarations.push({ source, enabled: value === "true" });
47499
47676
  else throw new Error(`${source}: new architecture setting must be true or false`);
47500
47677
  };
47501
- const json = (path41) => {
47502
- const text3 = readProjectMetadata((0, import_node_path33.join)(dir, path41), files2);
47678
+ const json = (path42) => {
47679
+ const text3 = readProjectMetadata((0, import_node_path33.join)(dir, path42), files2);
47503
47680
  if (text3 === null) {
47504
- if (files2.exists((0, import_node_path33.join)(dir, path41)))
47505
- throw new Error(`${path41}: unreadable native metadata`);
47681
+ if (files2.exists((0, import_node_path33.join)(dir, path42)))
47682
+ throw new Error(`${path42}: unreadable native metadata`);
47506
47683
  return void 0;
47507
47684
  }
47508
47685
  try {
47509
47686
  return JSON.parse(text3);
47510
47687
  } catch {
47511
- throw new Error(`${path41}: malformed native metadata`);
47688
+ throw new Error(`${path42}: malformed native metadata`);
47512
47689
  }
47513
47690
  };
47514
47691
  const expo = metadataValue(json("app.json"), "expo");
@@ -47903,11 +48080,6 @@ function searchMetroAssetDest(bundlePath, descriptors, assetsDirectory) {
47903
48080
  }
47904
48081
  return { dest: winner.dest, searched, truncated, unconfirmed: best === 0 };
47905
48082
  }
47906
- function largestEmbeddedAssets(sizes, count) {
47907
- if (sizes.length === 0) return "";
47908
- const largest = sizes.slice(0, count).map((entry) => `${entry.asset} ${entry.bytes} bytes`).join(", ");
47909
- return ` Largest embedded assets: ${largest}.`;
47910
- }
47911
48083
  async function inferCloudModuleIdentity(source) {
47912
48084
  let receipt;
47913
48085
  try {
@@ -48027,9 +48199,10 @@ async function produceArtifact(bundlePath, maxBytes, command, assetPolicy, asset
48027
48199
  });
48028
48200
  const bytes = Buffer.from(artifact.code, "utf8");
48029
48201
  const assets2 = artifact.receipt.assets;
48030
- if (bytes.length > maxBytes) {
48202
+ const executableBytes = command === PREVIEW_COMMAND ? bytes.length : Buffer.byteLength((await separateMetroArtifactAssets(artifact.code)).code, "utf8");
48203
+ if (executableBytes > maxBytes) {
48031
48204
  throw new Error(
48032
- `${REMOTE_COMMAND} artifact is ${bytes.length} bytes and exceeds the ${maxBytes}-byte limit. Embedded assets weigh ${assets2.bytes} bytes on disk, and base64 embedding costs about a third on top of that, so the practical asset budget is roughly ${Math.round(maxBytes * 0.75 / 1e6)} MB.${largestEmbeddedAssets(assets2.sizes, 10)}`
48205
+ `${command} executable is ${executableBytes} bytes and exceeds the ${maxBytes}-byte limit. The ${assets2.bytes} asset bytes are stored outside guest code.`
48033
48206
  );
48034
48207
  }
48035
48208
  const warnings = [];
@@ -48043,9 +48216,9 @@ async function produceArtifact(bundlePath, maxBytes, command, assetPolicy, asset
48043
48216
  `${command} embedded a placeholder image for ${prepared.substituted.length} asset(s) no scale of which is in ${prepared.search.searched.join(", ") || "any asset dest directory"}: ${prepared.substituted.join(", ")}. Rebuild with \`react-native bundle --assets-dest\` to ship the real images.`
48044
48217
  );
48045
48218
  }
48046
- if (bytes.length >= Math.floor(maxBytes * 0.8)) {
48219
+ if (executableBytes >= Math.floor(maxBytes * 0.8)) {
48047
48220
  warnings.push(
48048
- `${command} artifact is ${bytes.length} bytes, ${Math.round(bytes.length / maxBytes * 100)}% of the ${maxBytes}-byte limit.${largestEmbeddedAssets(assets2.sizes, 5)}`
48221
+ `${command} executable is ${executableBytes} bytes, ${Math.round(executableBytes / maxBytes * 100)}% of the ${maxBytes}-byte limit.`
48049
48222
  );
48050
48223
  }
48051
48224
  return {
@@ -48195,7 +48368,7 @@ function createCloudBridgeForParsed(parsed) {
48195
48368
  if (!session) return null;
48196
48369
  return session.service === "box" ? new CloudBoxBridge(session) : new CloudBridge(session);
48197
48370
  }
48198
- var import_node_crypto16, import_node_fs33, import_node_path34, import_node_vm, DEFAULT_RNX_CLOUD_ORIGIN, MAX_RNX_CLOUD_BUNDLE_BYTES, REMOTE_COMMAND, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS, CloudBridge, CloudBoxBridge;
48371
+ var import_node_crypto16, import_node_fs33, import_node_path34, import_node_vm, DEFAULT_RNX_CLOUD_ORIGIN, MAX_RNX_CLOUD_BUNDLE_BYTES, REMOTE_COMMAND, PREVIEW_COMMAND, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS, CloudBridge, CloudBoxBridge;
48199
48372
  var init_cloud_client = __esm({
48200
48373
  "cli/cloud-client.ts"() {
48201
48374
  "use strict";
@@ -48220,6 +48393,7 @@ var init_cloud_client = __esm({
48220
48393
  DEFAULT_RNX_CLOUD_ORIGIN = rnxPublicBrand.origin;
48221
48394
  MAX_RNX_CLOUD_BUNDLE_BYTES = RNX_CLOUD_MAX_ARTIFACT_BYTES;
48222
48395
  REMOTE_COMMAND = "peach remote";
48396
+ PREVIEW_COMMAND = "peach preview";
48223
48397
  MAX_ASSET_DEST_FILES = 25e3;
48224
48398
  ACCOUNT_CHOICE_REFUSALS = /* @__PURE__ */ new Set([
48225
48399
  "accountId is required",
@@ -51569,11 +51743,11 @@ async function evalInBridge(bridge, code, opts = {}) {
51569
51743
  if (opts.acquireLock) payload.acquireLock = true;
51570
51744
  return bridge.send(payload);
51571
51745
  }
51572
- async function callInBridge(bridge, path41, ...args) {
51573
- return bridge.send({ type: "call", path: path41, args });
51746
+ async function callInBridge(bridge, path42, ...args) {
51747
+ return bridge.send({ type: "call", path: path42, args });
51574
51748
  }
51575
- async function callInBridgeWrite(bridge, path41, ...args) {
51576
- return bridge.send({ type: "call", path: path41, args, acquireLock: true });
51749
+ async function callInBridgeWrite(bridge, path42, ...args) {
51750
+ return bridge.send({ type: "call", path: path42, args, acquireLock: true });
51577
51751
  }
51578
51752
  var import_node_fs35, import_node_path36, import_ws2, PEACH_PLACEMENT_ENV, resolvedWorld, BridgeSimLockedError, DisconnectedSimError, BRIDGE_VALUE_FLAGS_TABLE, BRIDGE_VALUE_FLAGS;
51579
51753
  var init_ws_bridge = __esm({
@@ -51710,8 +51884,8 @@ function getDefaultPortForProtocol(protocol) {
51710
51884
  return protocol === "https:" ? 443 : 80;
51711
51885
  }
51712
51886
  function isBaseServerUrl(url) {
51713
- const path41 = url.pathname || "/";
51714
- return (path41 === "/" || path41 === "") && !url.search && !url.hash;
51887
+ const path42 = url.pathname || "/";
51888
+ return (path42 === "/" || path42 === "") && !url.search && !url.hash;
51715
51889
  }
51716
51890
  async function resolvePortViaServerScan(port) {
51717
51891
  try {
@@ -55932,12 +56106,12 @@ var init_runtime_diagnostics = __esm({
55932
56106
  // cli/commands/skills.ts
55933
56107
  function getSkillsDir() {
55934
56108
  if (typeof __PEACH_BUNDLED_SKILLS__ !== "undefined") {
55935
- const dir = path37.join(rnxHomeDir(), "skills", getCliVersion());
56109
+ const dir = path38.join(rnxHomeDir(), "skills", getCliVersion());
55936
56110
  for (const [file, body] of Object.entries(__PEACH_BUNDLED_SKILLS__)) {
55937
- const target = path37.join(dir, file);
55938
- if (fs32.existsSync(target)) continue;
55939
- fs32.mkdirSync(path37.dirname(target), { recursive: true });
55940
- fs32.writeFileSync(target, body);
56111
+ const target = path38.join(dir, file);
56112
+ if (fs33.existsSync(target)) continue;
56113
+ fs33.mkdirSync(path38.dirname(target), { recursive: true });
56114
+ fs33.writeFileSync(target, body);
55941
56115
  }
55942
56116
  return dir;
55943
56117
  }
@@ -55945,10 +56119,10 @@ function getSkillsDir() {
55945
56119
  const pkgPath = (0, import_url3.fileURLToPath)(
55946
56120
  import_meta3.resolve(`${rnxPublicBrand.packageName}/package.json`)
55947
56121
  );
55948
- return primaryCheckoutPath(path37.join(path37.dirname(pkgPath), "skills"));
56122
+ return primaryCheckoutPath(path38.join(path38.dirname(pkgPath), "skills"));
55949
56123
  } catch {
55950
- const __dirname = path37.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
55951
- return primaryCheckoutPath(path37.resolve(__dirname, "../../skills"));
56124
+ const __dirname = path38.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
56125
+ return primaryCheckoutPath(path38.resolve(__dirname, "../../skills"));
55952
56126
  }
55953
56127
  }
55954
56128
  function primaryCheckoutPath(dir) {
@@ -55971,39 +56145,39 @@ function primaryCheckoutPath(dir) {
55971
56145
  } catch {
55972
56146
  return dir;
55973
56147
  }
55974
- if (path37.basename(common) !== ".git") return dir;
55975
- const primary = path37.join(path37.dirname(common), path37.relative(top, dir));
55976
- return fs32.existsSync(primary) ? primary : dir;
56148
+ if (path38.basename(common) !== ".git") return dir;
56149
+ const primary = path38.join(path38.dirname(common), path38.relative(top, dir));
56150
+ return fs33.existsSync(primary) ? primary : dir;
55977
56151
  }
55978
56152
  function skillsDir() {
55979
56153
  skillsDirPath ??= getSkillsDir();
55980
56154
  return skillsDirPath;
55981
56155
  }
55982
56156
  function targetFromHome(envName, fallbackDir) {
55983
- const home = process.env[envName] || path37.join(os11.homedir(), fallbackDir);
55984
- return path37.join(home, "skills");
56157
+ const home = process.env[envName] || path38.join(os12.homedir(), fallbackDir);
56158
+ return path38.join(home, "skills");
55985
56159
  }
55986
56160
  function codexTargets() {
55987
56161
  const homes = /* @__PURE__ */ new Map();
55988
- const userHome = process.env.HOME || os11.homedir();
55989
- const primaryCodexHome = process.env.CODEX_HOME || path37.join(userHome, ".codex");
55990
- homes.set(path37.resolve(primaryCodexHome), "codex");
56162
+ const userHome = process.env.HOME || os12.homedir();
56163
+ const primaryCodexHome = process.env.CODEX_HOME || path38.join(userHome, ".codex");
56164
+ homes.set(path38.resolve(primaryCodexHome), "codex");
55991
56165
  const tmCodexHomes = process.env.TM_CODEX_HOMES;
55992
56166
  if (tmCodexHomes) {
55993
- for (const h of tmCodexHomes.split(path37.delimiter)) {
56167
+ for (const h of tmCodexHomes.split(path38.delimiter)) {
55994
56168
  if (h.trim()) {
55995
- const resolved = path37.resolve(h.trim());
56169
+ const resolved = path38.resolve(h.trim());
55996
56170
  if (!homes.has(resolved)) {
55997
- homes.set(resolved, path37.basename(resolved).replace(/^\./, ""));
56171
+ homes.set(resolved, path38.basename(resolved).replace(/^\./, ""));
55998
56172
  }
55999
56173
  }
56000
56174
  }
56001
56175
  }
56002
- const tmHome = process.env.TM_HOME || path37.join(userHome, ".team-machine");
56003
- const enginePath = path37.join(tmHome, "engine.yaml");
56004
- if (fs32.existsSync(enginePath)) {
56176
+ const tmHome = process.env.TM_HOME || path38.join(userHome, ".team-machine");
56177
+ const enginePath = path38.join(tmHome, "engine.yaml");
56178
+ if (fs33.existsSync(enginePath)) {
56005
56179
  try {
56006
- const content = fs32.readFileSync(enginePath, "utf8");
56180
+ const content = fs33.readFileSync(enginePath, "utf8");
56007
56181
  let inCodex = false;
56008
56182
  let inAccounts = false;
56009
56183
  let currentAccount = "";
@@ -56033,9 +56207,9 @@ function codexTargets() {
56033
56207
  if (match) {
56034
56208
  let homeDir = match[1].trim();
56035
56209
  if (homeDir.startsWith("~")) {
56036
- homeDir = path37.join(userHome, homeDir.slice(1));
56210
+ homeDir = path38.join(userHome, homeDir.slice(1));
56037
56211
  }
56038
- const resolved = path37.resolve(homeDir);
56212
+ const resolved = path38.resolve(homeDir);
56039
56213
  if (!homes.has(resolved)) {
56040
56214
  homes.set(resolved, `codex-${currentAccount}`);
56041
56215
  }
@@ -56046,13 +56220,13 @@ function codexTargets() {
56046
56220
  }
56047
56221
  }
56048
56222
  try {
56049
- for (const entry of fs32.readdirSync(userHome)) {
56223
+ for (const entry of fs33.readdirSync(userHome)) {
56050
56224
  if (entry.startsWith(".codex-")) {
56051
- const fullPath = path37.join(userHome, entry);
56225
+ const fullPath = path38.join(userHome, entry);
56052
56226
  try {
56053
- const stat2 = fs32.statSync(fullPath);
56227
+ const stat2 = fs33.statSync(fullPath);
56054
56228
  if (stat2.isDirectory()) {
56055
- const resolved = path37.resolve(fullPath);
56229
+ const resolved = path38.resolve(fullPath);
56056
56230
  if (!homes.has(resolved)) {
56057
56231
  homes.set(resolved, entry.replace(/^\./, ""));
56058
56232
  }
@@ -56067,7 +56241,7 @@ function codexTargets() {
56067
56241
  for (const [homePath, label] of homes) {
56068
56242
  targets.push({
56069
56243
  label,
56070
- dir: path37.join(homePath, "skills")
56244
+ dir: path38.join(homePath, "skills")
56071
56245
  });
56072
56246
  }
56073
56247
  return targets;
@@ -56083,7 +56257,7 @@ function hasInstalledPeachSkills() {
56083
56257
  (file) => /^([^/]+)\/SKILL\.md$/.exec(file)?.[1] ?? []
56084
56258
  ) : listSkills().map((skill7) => skill7.name);
56085
56259
  return defaultAgentTargets().some(
56086
- ({ dir }) => names.some((name2) => fs32.existsSync(path37.join(dir, name2, "SKILL.md")))
56260
+ ({ dir }) => names.some((name2) => fs33.existsSync(path38.join(dir, name2, "SKILL.md")))
56087
56261
  );
56088
56262
  }
56089
56263
  function parseSkillFrontmatter(content) {
@@ -56126,26 +56300,26 @@ function readFrontmatterField(frontmatter, field) {
56126
56300
  return null;
56127
56301
  }
56128
56302
  function listSkills() {
56129
- if (!fs32.existsSync(skillsDir())) return [];
56303
+ if (!fs33.existsSync(skillsDir())) return [];
56130
56304
  const skills = [];
56131
- for (const entry of fs32.readdirSync(skillsDir())) {
56132
- const skillMd = path37.join(skillsDir(), entry, "SKILL.md");
56133
- if (!fs32.existsSync(skillMd)) continue;
56134
- const meta = parseSkillFrontmatter(fs32.readFileSync(skillMd, "utf8"));
56305
+ for (const entry of fs33.readdirSync(skillsDir())) {
56306
+ const skillMd = path38.join(skillsDir(), entry, "SKILL.md");
56307
+ if (!fs33.existsSync(skillMd)) continue;
56308
+ const meta = parseSkillFrontmatter(fs33.readFileSync(skillMd, "utf8"));
56135
56309
  if (meta) {
56136
56310
  skills.push({ name: entry, description: meta.description });
56137
56311
  }
56138
56312
  }
56139
56313
  return skills.sort((a, b) => a.name.localeCompare(b.name));
56140
56314
  }
56141
- var import_child_process7, fs32, os11, path37, import_url3, import_meta3, skillsDirPath;
56315
+ var import_child_process7, fs33, os12, path38, import_url3, import_meta3, skillsDirPath;
56142
56316
  var init_skills = __esm({
56143
56317
  "cli/commands/skills.ts"() {
56144
56318
  "use strict";
56145
56319
  import_child_process7 = require("child_process");
56146
- fs32 = __toESM(require("fs"), 1);
56147
- os11 = __toESM(require("os"), 1);
56148
- path37 = __toESM(require("path"), 1);
56320
+ fs33 = __toESM(require("fs"), 1);
56321
+ os12 = __toESM(require("os"), 1);
56322
+ path38 = __toESM(require("path"), 1);
56149
56323
  import_url3 = require("url");
56150
56324
  init_cli_version();
56151
56325
  init_home_paths();
@@ -59140,6 +59314,7 @@ async function waitForSootsimIdle({
59140
59314
  return true
59141
59315
  }
59142
59316
  while (Date.now() < deadline) {
59317
+ const pollStarted = Date.now()
59143
59318
  const snapshot = await readSnapshot()
59144
59319
  if (snapshot.runtimeUnsupported) return snapshot.runtimeUnsupported
59145
59320
  polls++
@@ -59212,7 +59387,9 @@ async function waitForSootsimIdle({
59212
59387
  lastRequestTotal = snapshot.requestTotal
59213
59388
  lastAppCommits = snapshot.appCommits
59214
59389
  lastNodeCount = snapshot.nodeCount
59215
- await sleep(pollMs)
59390
+ // reply latency belongs inside the poll interval; the stillness window
59391
+ // above remains measured from completed observations.
59392
+ await sleep(Math.max(0, pollMs - (Date.now() - pollStarted)))
59216
59393
  }
59217
59394
  const last = await readSnapshot()
59218
59395
  if (last.runtimeUnsupported) return last.runtimeUnsupported
@@ -60021,16 +60198,16 @@ function readRecentShellAppId(state) {
60021
60198
  }
60022
60199
  function resolveProjectRelativeFlowBase(flowDir) {
60023
60200
  if (!flowDir) return process.cwd();
60024
- return path39.basename(flowDir) === ".maestro" ? path39.dirname(flowDir) : flowDir;
60201
+ return path40.basename(flowDir) === ".maestro" ? path40.dirname(flowDir) : flowDir;
60025
60202
  }
60026
60203
  function resolveFlowScreenshotPathWithMode(screenshotDir, name2, opts) {
60027
60204
  const normalizedName = name2.endsWith(".png") ? name2 : `${name2}.png`;
60028
- if (path39.isAbsolute(normalizedName)) return normalizedName;
60205
+ if (path40.isAbsolute(normalizedName)) return normalizedName;
60029
60206
  if (opts.mode === "flow" && /[\\/]/.test(normalizedName)) {
60030
60207
  const baseDir = normalizedName.startsWith("./") || normalizedName.startsWith("../") ? opts.flowDir ?? process.cwd() : resolveProjectRelativeFlowBase(opts.flowDir);
60031
- return path39.resolve(baseDir, normalizedName);
60208
+ return path40.resolve(baseDir, normalizedName);
60032
60209
  }
60033
- return path39.join(screenshotDir, normalizedName);
60210
+ return path40.join(screenshotDir, normalizedName);
60034
60211
  }
60035
60212
  function normalizeFlowScreenshotSpec(step) {
60036
60213
  if (typeof step === "string") {
@@ -60084,12 +60261,12 @@ function normalizeBareStringStep(verb) {
60084
60261
  function parseFlowSteps(content) {
60085
60262
  return parseFlowFile(content).steps;
60086
60263
  }
60087
- var fs35, path39, import_devices4, import_proof_frame, DEFAULT_TIMEOUT, ASSERTION_LOOKUP_MS, FLOW_TIMEOUT_SCALE, scaledTimeout, MAESTRO_SELECTOR_KEYS, UNSUPPORTED_SELECTOR_KEYS, ACCESSIBILITY_SELECTOR_KEYS, ACCESSIBILITY_TRAIT_FILTERS, MAESTRO_PERMISSION_KINDS, MAESTRO_PERMISSION_STATUS, SootSimBridgeFlowRunner;
60264
+ var fs36, path40, import_devices4, import_proof_frame, DEFAULT_TIMEOUT, ASSERTION_LOOKUP_MS, FLOW_TIMEOUT_SCALE, scaledTimeout, MAESTRO_SELECTOR_KEYS, UNSUPPORTED_SELECTOR_KEYS, ACCESSIBILITY_SELECTOR_KEYS, ACCESSIBILITY_TRAIT_FILTERS, MAESTRO_PERMISSION_KINDS, MAESTRO_PERMISSION_STATUS, SootSimBridgeFlowRunner;
60088
60265
  var init_bridge_flow_runner = __esm({
60089
60266
  "cli/bridge-flow-runner.ts"() {
60090
60267
  "use strict";
60091
- fs35 = __toESM(require("fs"), 1);
60092
- path39 = __toESM(require("path"), 1);
60268
+ fs36 = __toESM(require("fs"), 1);
60269
+ path40 = __toESM(require("path"), 1);
60093
60270
  import_devices4 = require("peach-engine/settings/devices");
60094
60271
  import_proof_frame = __toESM(require_proof_frame(), 1);
60095
60272
  init_flow_timeout_scale();
@@ -60401,14 +60578,14 @@ var init_bridge_flow_runner = __esm({
60401
60578
  if (chunks.length === 0) {
60402
60579
  throw new Error("recording requested but no video buffer was produced");
60403
60580
  }
60404
- fs35.mkdirSync(this.opts.recordingOutputDir, { recursive: true });
60581
+ fs36.mkdirSync(this.opts.recordingOutputDir, { recursive: true });
60405
60582
  const videoMime = stopped.mime || this.opts.recordingFormat || "video/webm";
60406
60583
  const extension = videoMime.includes("mp4") ? "mp4" : "webm";
60407
- const outputPath = path39.join(
60584
+ const outputPath = path40.join(
60408
60585
  this.opts.recordingOutputDir,
60409
60586
  `peach-${Date.now()}.${extension}`
60410
60587
  );
60411
- fs35.writeFileSync(outputPath, Buffer.concat(chunks));
60588
+ fs36.writeFileSync(outputPath, Buffer.concat(chunks));
60412
60589
  return outputPath;
60413
60590
  }
60414
60591
  async waitForRecordingTail(opts) {
@@ -60443,7 +60620,7 @@ var init_bridge_flow_runner = __esm({
60443
60620
  // engine's XCTest accessibility projection — one bridge evaluate, then the
60444
60621
  // same Orchestra.buildFilter semantics the render resolver implements, over
60445
60622
  // PeachAccessibilityNode instead of the visible semantic tree.
60446
- async findElementAccessibilityTree(opts) {
60623
+ async resolveAccessibilityElement(opts, command) {
60447
60624
  const tree = await this.evaluate(`(async () => {
60448
60625
  const test = window.__sootsimTest
60449
60626
  if (!test || typeof test.captureAccessibilityTree !== 'function') throw new Error('engine accessibility snapshot is unavailable')
@@ -60452,11 +60629,15 @@ var init_bridge_flow_runner = __esm({
60452
60629
  if (!isPeachAccessibilityTree(tree))
60453
60630
  throw new Error("engine returned an invalid accessibility snapshot");
60454
60631
  if (tree.length === 0) return null;
60455
- if (tree.some((node2) => node2.platform !== "ios"))
60456
- throw new Error(
60457
- "containsChild, containsDescendants and focused require the iOS accessibility hierarchy"
60458
- );
60459
- const node = resolveAccessibilitySelector(tree, opts);
60632
+ if (tree.some((node) => node.platform !== "ios"))
60633
+ throw new Error(`${command} requires the iOS accessibility hierarchy`);
60634
+ return resolveAccessibilitySelector(tree, opts);
60635
+ }
60636
+ async findElementAccessibilityTree(opts) {
60637
+ const node = await this.resolveAccessibilityElement(
60638
+ opts,
60639
+ "containsChild, containsDescendants and focused"
60640
+ );
60460
60641
  if (!node) return null;
60461
60642
  const frame = node.frame;
60462
60643
  return {
@@ -61029,7 +61210,7 @@ var init_bridge_flow_runner = __esm({
61029
61210
  flowDir: this.opts.flowDir
61030
61211
  }
61031
61212
  );
61032
- fs35.mkdirSync(path39.dirname(outputPath), { recursive: true });
61213
+ fs36.mkdirSync(path40.dirname(outputPath), { recursive: true });
61033
61214
  const layers = spec.layers ?? this.opts.screenshotLayers;
61034
61215
  const screenshotRequest = {
61035
61216
  type: "screenshot",
@@ -61064,11 +61245,11 @@ var init_bridge_flow_runner = __esm({
61064
61245
  throw new Error("could not read current device model for framed screenshot");
61065
61246
  }
61066
61247
  const framed = await composeFramedScreenshot(rawBuffer, model);
61067
- fs35.writeFileSync(outputPath, framed);
61248
+ fs36.writeFileSync(outputPath, framed);
61068
61249
  console.log(`[flow] screenshot: ${outputPath} (frame: ${model})`);
61069
61250
  return outputPath;
61070
61251
  }
61071
- fs35.writeFileSync(outputPath, rawBuffer);
61252
+ fs36.writeFileSync(outputPath, rawBuffer);
61072
61253
  console.log(`[flow] screenshot: ${outputPath}`);
61073
61254
  return outputPath;
61074
61255
  }
@@ -61107,10 +61288,10 @@ var init_bridge_flow_runner = __esm({
61107
61288
  // + a11y tree + console errors/warnings + failed network requests +
61108
61289
  // shell state, all under one directory so post-mortem is one grep away.
61109
61290
  async captureFailureBundle(outputDir, context) {
61110
- fs35.mkdirSync(outputDir, { recursive: true });
61291
+ fs36.mkdirSync(outputDir, { recursive: true });
61111
61292
  const write = (name2, content) => {
61112
61293
  try {
61113
- fs35.writeFileSync(path39.join(outputDir, name2), content);
61294
+ fs36.writeFileSync(path40.join(outputDir, name2), content);
61114
61295
  } catch {
61115
61296
  }
61116
61297
  };
@@ -61676,14 +61857,17 @@ var init_bridge_flow_runner = __esm({
61676
61857
  }
61677
61858
  // maestro copyTextFrom: find an element and capture its text for use in
61678
61859
  // later steps via ${maestro.copiedText} (upstream form) or the legacy
61679
- // ${maestroCopiedText}. the matcher shape matches tapOn.
61860
+ // ${maestroCopiedText}. the string form is a text selector, as in tapOn.
61861
+ // the copied text is Orchestra.resolveText over the XCTest attributes:
61862
+ // text (the value), then hintText (the placeholder), then the label.
61680
61863
  async copyTextFrom(target) {
61681
- const opts = typeof target === "string" ? { id: target } : target;
61682
- const node = await this.findElement(opts);
61864
+ const opts = typeof target === "string" ? { text: target } : target;
61865
+ assertSupportedSelector(opts);
61866
+ const node = await this.resolveAccessibilityElement(opts, "copyTextFrom");
61683
61867
  if (!node) {
61684
61868
  throw new Error(`copyTextFrom: element not found: ${JSON.stringify(opts)}`);
61685
61869
  }
61686
- const captured = node.text ?? node.testID ?? "";
61870
+ const captured = node.value || node.placeholder || node.label || "";
61687
61871
  this.js.setCopiedText(captured);
61688
61872
  this.js.putEnv("maestroCopiedText", captured);
61689
61873
  console.log(`[flow] copied text: ${JSON.stringify(captured)}`);
@@ -61707,8 +61891,8 @@ var init_bridge_flow_runner = __esm({
61707
61891
  runScript(target) {
61708
61892
  const spec = typeof target === "string" ? { file: target } : target;
61709
61893
  if (!spec.file) throw new Error("runScript requires a file");
61710
- const scriptPath = path39.resolve(this.opts.flowDir, spec.file);
61711
- const source = fs35.readFileSync(scriptPath, "utf8");
61894
+ const scriptPath = path40.resolve(this.opts.flowDir, spec.file);
61895
+ const source = fs36.readFileSync(scriptPath, "utf8");
61712
61896
  this.js.evaluate(source, { env: spec.env });
61713
61897
  console.log(`[flow] runScript: ${spec.file} done`);
61714
61898
  }
@@ -62068,14 +62252,14 @@ var init_bridge_flow_runner = __esm({
62068
62252
  for (const [k, v] of Object.entries(env)) this.js.putEnv(k, v);
62069
62253
  }
62070
62254
  if (file) {
62071
- const flowPath = path39.resolve(this.opts.flowDir, file);
62072
- const flowContent = fs35.readFileSync(flowPath, "utf8");
62255
+ const flowPath = path40.resolve(this.opts.flowDir, file);
62256
+ const flowContent = fs36.readFileSync(flowPath, "utf8");
62073
62257
  const { frontmatter } = parseFlowFile(flowContent);
62074
62258
  if (frontmatter.env && typeof frontmatter.env === "object") {
62075
62259
  this.js.defineVariables(frontmatter.env);
62076
62260
  }
62077
62261
  const previousDir = this.opts.flowDir;
62078
- this.opts.flowDir = path39.dirname(flowPath);
62262
+ this.opts.flowDir = path40.dirname(flowPath);
62079
62263
  try {
62080
62264
  await this.runFlow(parseFlowSteps(flowContent));
62081
62265
  } finally {
@@ -62246,8 +62430,8 @@ __export(registry_exports, {
62246
62430
  skillRegistry: () => skillRegistry
62247
62431
  });
62248
62432
  module.exports = __toCommonJS(registry_exports);
62249
- var fs36 = __toESM(require("fs"), 1);
62250
- var path40 = __toESM(require("path"), 1);
62433
+ var fs37 = __toESM(require("fs"), 1);
62434
+ var path41 = __toESM(require("path"), 1);
62251
62435
 
62252
62436
  // src/skills/builtin/a11y-review.ts
62253
62437
  init_reap_browser();
@@ -62266,8 +62450,8 @@ var skill = {
62266
62450
  },
62267
62451
  async execute(params, context) {
62268
62452
  const { chromium } = await import("playwright");
62269
- const path41 = await import("path");
62270
- const fs37 = await import("fs");
62453
+ const path42 = await import("path");
62454
+ const fs38 = await import("fs");
62271
62455
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
62272
62456
  headless: true
62273
62457
  });
@@ -62324,9 +62508,9 @@ var skill = {
62324
62508
  warnings: issues.filter((i) => i.severity === "warning").length,
62325
62509
  tree: typeof tree === "string" ? tree : JSON.stringify(tree)
62326
62510
  };
62327
- const reportPath = path41.join(context.outputDir, "a11y-report.json");
62328
- fs37.mkdirSync(path41.dirname(reportPath), { recursive: true });
62329
- fs37.writeFileSync(reportPath, JSON.stringify(report, null, 2));
62511
+ const reportPath = path42.join(context.outputDir, "a11y-report.json");
62512
+ fs38.mkdirSync(path42.dirname(reportPath), { recursive: true });
62513
+ fs38.writeFileSync(reportPath, JSON.stringify(report, null, 2));
62330
62514
  return {
62331
62515
  success: issues.filter((i) => i.severity === "error").length === 0,
62332
62516
  message: `${report.errors} errors, ${report.warnings} warnings across ${report.nodeCount} nodes`,
@@ -62359,14 +62543,14 @@ var skill2 = {
62359
62543
  }
62360
62544
  },
62361
62545
  async execute(params, context) {
62362
- const fs37 = await import("node:fs");
62363
- const path41 = await import("node:path");
62546
+ const fs38 = await import("node:fs");
62547
+ const path42 = await import("node:path");
62364
62548
  const { COMPAT_RESULT_CAVEAT: COMPAT_RESULT_CAVEAT2, formatPackageStatus: formatPackageStatus2, formatScanCounts: formatScanCounts2, scanDeps: scanDeps2 } = await Promise.resolve().then(() => (init_web(), web_exports));
62365
- const packagePath = path41.join(context.projectDir, "package.json");
62366
- if (!fs37.existsSync(packagePath)) {
62549
+ const packagePath = path42.join(context.projectDir, "package.json");
62550
+ if (!fs38.existsSync(packagePath)) {
62367
62551
  return { success: false, message: "No package.json found" };
62368
62552
  }
62369
- const parsed = JSON.parse(fs37.readFileSync(packagePath, "utf8"));
62553
+ const parsed = JSON.parse(fs38.readFileSync(packagePath, "utf8"));
62370
62554
  if (!parsed || typeof parsed !== "object") {
62371
62555
  return { success: false, message: "package.json is not an object" };
62372
62556
  }
@@ -62378,9 +62562,9 @@ var skill2 = {
62378
62562
  }) : scanDeps2(parsed);
62379
62563
  const packageResult = params.packageName ? scan.packages[0] : void 0;
62380
62564
  const message = packageResult ? `${params.packageName}: ${formatPackageStatus2(packageResult)}. ${COMPAT_RESULT_CAVEAT2}` : `${formatScanCounts2(scan)}. ${COMPAT_RESULT_CAVEAT2}`;
62381
- const reportPath = path41.join(context.outputDir, "compat-report.json");
62382
- fs37.mkdirSync(path41.dirname(reportPath), { recursive: true });
62383
- fs37.writeFileSync(reportPath, `${JSON.stringify(scan, null, 2)}
62565
+ const reportPath = path42.join(context.outputDir, "compat-report.json");
62566
+ fs38.mkdirSync(path42.dirname(reportPath), { recursive: true });
62567
+ fs38.writeFileSync(reportPath, `${JSON.stringify(scan, null, 2)}
62384
62568
  `);
62385
62569
  return {
62386
62570
  success: true,
@@ -62422,8 +62606,8 @@ var skill3 = {
62422
62606
  record: { type: "boolean", description: "Record video of the flow" }
62423
62607
  },
62424
62608
  async execute(params, context) {
62425
- const fs37 = await import("fs");
62426
- const path41 = await import("path");
62609
+ const fs38 = await import("fs");
62610
+ const path42 = await import("path");
62427
62611
  const yaml = await Promise.resolve().then(() => (init_browser(), browser_exports));
62428
62612
  const { DEFAULT_SOOTSIM_BRIDGE_PORT: DEFAULT_SOOTSIM_BRIDGE_PORT3 } = await Promise.resolve().then(() => (init_bridge_constants(), bridge_constants_exports));
62429
62613
  const { SootSimBridgeHost: SootSimBridgeHost2 } = await Promise.resolve().then(() => (init_bridge_host(), bridge_host_exports));
@@ -62433,7 +62617,7 @@ var skill3 = {
62433
62617
  const host2 = new SootSimBridgeHost2({ port: DEFAULT_SOOTSIM_BRIDGE_PORT3 });
62434
62618
  host2.start({ silent: true });
62435
62619
  try {
62436
- const flowContent = fs37.readFileSync(params.flowPath, "utf8");
62620
+ const flowContent = fs38.readFileSync(params.flowPath, "utf8");
62437
62621
  const fmMatch = flowContent.match(/^---\n([\s\S]*?)\n---\n?/);
62438
62622
  const stepsBody = fmMatch ? flowContent.slice(fmMatch[0].length) : flowContent;
62439
62623
  const steps = yaml.parse(stepsBody);
@@ -62460,7 +62644,7 @@ var skill3 = {
62460
62644
  });
62461
62645
  const driver = new SootSimBridgeFlowRunner2(bridge, {
62462
62646
  screenshotDir: context.outputDir,
62463
- flowDir: path41.dirname(path41.resolve(params.flowPath)),
62647
+ flowDir: path42.dirname(path42.resolve(params.flowPath)),
62464
62648
  simId,
62465
62649
  recordingOutputDir: params.record ? context.outputDir : void 0
62466
62650
  });
@@ -62482,7 +62666,7 @@ var skill3 = {
62482
62666
  simId,
62483
62667
  videoPath: videoPath || void 0
62484
62668
  },
62485
- artifacts: videoPath ? [{ type: "video", name: path41.basename(videoPath), path: videoPath }] : void 0
62669
+ artifacts: videoPath ? [{ type: "video", name: path42.basename(videoPath), path: videoPath }] : void 0
62486
62670
  };
62487
62671
  } finally {
62488
62672
  try {
@@ -62529,8 +62713,8 @@ var skill4 = {
62529
62713
  },
62530
62714
  async execute(params, context) {
62531
62715
  const { chromium } = await import("playwright");
62532
- const path41 = await import("path");
62533
- const fs37 = await import("fs");
62716
+ const path42 = await import("path");
62717
+ const fs38 = await import("fs");
62534
62718
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
62535
62719
  headless: true
62536
62720
  });
@@ -62558,9 +62742,9 @@ var skill4 = {
62558
62742
  ...profile,
62559
62743
  fps: syncCount > 0 ? (syncCount / (duration / 1e3)).toFixed(1) : "0"
62560
62744
  };
62561
- const reportPath = path41.join(context.outputDir, "perf-report.json");
62562
- fs37.mkdirSync(path41.dirname(reportPath), { recursive: true });
62563
- fs37.writeFileSync(reportPath, JSON.stringify(report, null, 2));
62745
+ const reportPath = path42.join(context.outputDir, "perf-report.json");
62746
+ fs38.mkdirSync(path42.dirname(reportPath), { recursive: true });
62747
+ fs38.writeFileSync(reportPath, JSON.stringify(report, null, 2));
62564
62748
  return {
62565
62749
  success: true,
62566
62750
  message: `${report.fps} fps, ${profile.avgSyncMs?.toFixed(1)}ms avg sync, ${nodeCount} nodes`,
@@ -62593,8 +62777,8 @@ var skill5 = {
62593
62777
  },
62594
62778
  async execute(params, context) {
62595
62779
  const { chromium } = await import("playwright");
62596
- const path41 = await import("path");
62597
- const fs37 = await import("fs");
62780
+ const path42 = await import("path");
62781
+ const fs38 = await import("fs");
62598
62782
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
62599
62783
  headless: true
62600
62784
  });
@@ -62602,8 +62786,8 @@ var skill5 = {
62602
62786
  try {
62603
62787
  await page.goto(context.url, { waitUntil: "networkidle" });
62604
62788
  await page.waitForTimeout(2e3);
62605
- const outputPath = path41.join(context.outputDir, `${params.name}.png`);
62606
- fs37.mkdirSync(path41.dirname(outputPath), { recursive: true });
62789
+ const outputPath = path42.join(context.outputDir, `${params.name}.png`);
62790
+ fs38.mkdirSync(path42.dirname(outputPath), { recursive: true });
62607
62791
  await page.screenshot({ path: outputPath });
62608
62792
  return {
62609
62793
  success: true,
@@ -62644,8 +62828,8 @@ var skill6 = {
62644
62828
  },
62645
62829
  async execute(params, context) {
62646
62830
  const { chromium } = await import("playwright");
62647
- const path41 = await import("path");
62648
- const fs37 = await import("fs");
62831
+ const path42 = await import("path");
62832
+ const fs38 = await import("fs");
62649
62833
  const browser = await launchReapedChrome((options) => chromium.launch(options), {
62650
62834
  headless: true
62651
62835
  });
@@ -62653,14 +62837,14 @@ var skill6 = {
62653
62837
  try {
62654
62838
  await page.goto(context.url, { waitUntil: "networkidle" });
62655
62839
  await page.waitForTimeout(2e3);
62656
- const currentPath = path41.join(context.outputDir, `${params.name}-current.png`);
62657
- fs37.mkdirSync(path41.dirname(currentPath), { recursive: true });
62840
+ const currentPath = path42.join(context.outputDir, `${params.name}-current.png`);
62841
+ fs38.mkdirSync(path42.dirname(currentPath), { recursive: true });
62658
62842
  await page.screenshot({ path: currentPath });
62659
62843
  try {
62660
62844
  const { PNG } = await import("pngjs");
62661
62845
  const pixelmatch = (await import("pixelmatch")).default;
62662
- const baseline = PNG.sync.read(fs37.readFileSync(params.baseline));
62663
- const current = PNG.sync.read(fs37.readFileSync(currentPath));
62846
+ const baseline = PNG.sync.read(fs38.readFileSync(params.baseline));
62847
+ const current = PNG.sync.read(fs38.readFileSync(currentPath));
62664
62848
  const { width, height } = baseline;
62665
62849
  const diff = new PNG({ width, height });
62666
62850
  const numDiffPixels = pixelmatch(
@@ -62671,8 +62855,8 @@ var skill6 = {
62671
62855
  height,
62672
62856
  { threshold: params.threshold || 0.1 }
62673
62857
  );
62674
- const diffPath = path41.join(context.outputDir, `${params.name}-diff.png`);
62675
- fs37.writeFileSync(diffPath, PNG.sync.write(diff));
62858
+ const diffPath = path42.join(context.outputDir, `${params.name}-diff.png`);
62859
+ fs38.writeFileSync(diffPath, PNG.sync.write(diff));
62676
62860
  const totalPixels = width * height;
62677
62861
  const diffPercent = (numDiffPixels / totalPixels * 100).toFixed(2);
62678
62862
  return {
@@ -62736,10 +62920,10 @@ var skillRegistry = {
62736
62920
  },
62737
62921
  // load skills from a project manifest (rnx-skills.json)
62738
62922
  async loadFromManifest(projectDir) {
62739
- const manifestPath = path40.join(projectDir, "rnx-skills.json");
62740
- if (!fs36.existsSync(manifestPath)) return;
62923
+ const manifestPath = path41.join(projectDir, "rnx-skills.json");
62924
+ if (!fs37.existsSync(manifestPath)) return;
62741
62925
  try {
62742
- const manifest = JSON.parse(fs36.readFileSync(manifestPath, "utf8"));
62926
+ const manifest = JSON.parse(fs37.readFileSync(manifestPath, "utf8"));
62743
62927
  if (Array.isArray(manifest.skills)) {
62744
62928
  for (const entry of manifest.skills) {
62745
62929
  if (typeof entry === "string") {
@@ -62750,7 +62934,7 @@ var skillRegistry = {
62750
62934
  }
62751
62935
  } else if (entry.file) {
62752
62936
  try {
62753
- const mod = await import(path40.resolve(projectDir, entry.file));
62937
+ const mod = await import(path41.resolve(projectDir, entry.file));
62754
62938
  if (mod.skill) this.register(mod.skill);
62755
62939
  } catch {
62756
62940
  }
@@ -62763,10 +62947,10 @@ var skillRegistry = {
62763
62947
  // auto-discover skills based on project dependencies
62764
62948
  suggestSkills(projectDir) {
62765
62949
  const suggestions = [];
62766
- const pkgPath = path40.join(projectDir, "package.json");
62767
- if (!fs36.existsSync(pkgPath)) return suggestions;
62950
+ const pkgPath = path41.join(projectDir, "package.json");
62951
+ if (!fs37.existsSync(pkgPath)) return suggestions;
62768
62952
  try {
62769
- const pkg = JSON.parse(fs36.readFileSync(pkgPath, "utf8"));
62953
+ const pkg = JSON.parse(fs37.readFileSync(pkgPath, "utf8"));
62770
62954
  const deps = { ...pkg.dependencies, ...pkg.devDependencies };
62771
62955
  if (deps["detox"] || deps["maestro"]) {
62772
62956
  suggestions.push("maestro-test");