peachsim 0.1.727 → 0.1.729

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 (74) hide show
  1. package/cli/commands/preview.ts +236 -8
  2. package/cli/commands/skills.ts +41 -3
  3. package/cli/outbound-endpoints.ts +6 -4
  4. package/dist-lib/agent-daemon-client.cjs +1 -1
  5. package/dist-lib/agent-events.cjs +1 -1
  6. package/dist-lib/agent-identity.cjs +1 -1
  7. package/dist-lib/agent-sessions.cjs +1 -1
  8. package/dist-lib/attached-projects.cjs +1 -1
  9. package/dist-lib/auth/shared-session.cjs +1 -1
  10. package/dist-lib/backend-origin.cjs +1 -1
  11. package/dist-lib/beta.cjs +1 -1
  12. package/dist-lib/beta.mjs +1 -1
  13. package/dist-lib/bridge-constants.cjs +1 -1
  14. package/dist-lib/bridge-contract-input.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.mjs +1 -1
  16. package/dist-lib/bridge-contract.cjs +1 -1
  17. package/dist-lib/bridge-contract.mjs +1 -1
  18. package/dist-lib/capture-contract.cjs +1 -1
  19. package/dist-lib/capture-contract.mjs +1 -1
  20. package/dist-lib/cli-constants.cjs +1 -1
  21. package/dist-lib/cloud-contract.cjs +1 -1
  22. package/dist-lib/cloud-contract.mjs +1 -1
  23. package/dist-lib/cloud-test-args.cjs +1 -1
  24. package/dist-lib/cloud-test-args.mjs +1 -1
  25. package/dist-lib/cloud.cjs +1 -1
  26. package/dist-lib/cloud.mjs +1 -1
  27. package/dist-lib/config.cjs +1 -1
  28. package/dist-lib/detox/index.cjs +1 -1
  29. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  30. package/dist-lib/home-paths.cjs +1 -1
  31. package/dist-lib/host/bridge-host.cjs +178 -3
  32. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  34. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  35. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  36. package/dist-lib/host/websocket-proxy.cjs +1 -1
  37. package/dist-lib/index.cjs +1 -1
  38. package/dist-lib/jump-to-source-babel.cjs +1 -1
  39. package/dist-lib/jump-to-source-native.cjs +1 -1
  40. package/dist-lib/kotlin-host.cjs +1 -1
  41. package/dist-lib/menu.cjs +1 -1
  42. package/dist-lib/menu.mjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  44. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  45. package/dist-lib/metro-production-bundle.cjs +1 -1
  46. package/dist-lib/metro-production-bundle.mjs +1 -1
  47. package/dist-lib/metro.cjs +1 -1
  48. package/dist-lib/native-app-identity.cjs +1 -1
  49. package/dist-lib/native-app-identity.mjs +1 -1
  50. package/dist-lib/native-firebase-metadata.cjs +1 -1
  51. package/dist-lib/native-firebase-metadata.mjs +1 -1
  52. package/dist-lib/plist.cjs +1 -1
  53. package/dist-lib/plist.mjs +1 -1
  54. package/dist-lib/profiles.cjs +1 -1
  55. package/dist-lib/public-brand.cjs +1 -1
  56. package/dist-lib/react-native-host-modules.cjs +1 -1
  57. package/dist-lib/react-native-host-modules.mjs +1 -1
  58. package/dist-lib/render-mode.cjs +1 -1
  59. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  60. package/dist-lib/sdk.cjs +1 -1
  61. package/dist-lib/sdk.mjs +1 -1
  62. package/dist-lib/skills.cjs +264 -64
  63. package/dist-lib/swift-compile.cjs +180 -3
  64. package/dist-lib/swift-compile.mjs +179 -3
  65. package/dist-lib/swift-package.cjs +1 -1
  66. package/dist-lib/swift-package.mjs +1 -1
  67. package/dist-lib/swift-submit.cjs +1 -1
  68. package/dist-lib/swift-submit.mjs +1 -1
  69. package/dist-lib/swift-toolchain.cjs +1 -1
  70. package/dist-lib/swift.cjs +1 -1
  71. package/dist-lib/vite-swift.cjs +178 -3
  72. package/dist-lib/vite.cjs +1 -1
  73. package/package.json +1 -1
  74. package/src/swift-compile.ts +215 -2
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.727 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.729 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -21688,9 +21688,9 @@ function swiftManifestTargets(manifest, resourcePaths = []) {
21688
21688
  const prefix = targetPath === "." ? "" : `${targetPath}/`;
21689
21689
  const resources = /\bresources\s*:/.test(flat) || implicitResources.some((file) => {
21690
21690
  if (!file.startsWith(prefix)) return false;
21691
- const relative2 = file.slice(prefix.length);
21691
+ const relative3 = file.slice(prefix.length);
21692
21692
  if (excluded.some(
21693
- (exclude) => relative2 === exclude || relative2.startsWith(`${exclude}/`)
21693
+ (exclude) => relative3 === exclude || relative3.startsWith(`${exclude}/`)
21694
21694
  ))
21695
21695
  return false;
21696
21696
  return true;
@@ -21741,9 +21741,9 @@ function swiftModuleInputFiles(root) {
21741
21741
  ];
21742
21742
  const walk = (dir) => {
21743
21743
  for (const entry of (0, import_node_fs7.readdirSync)(import_node_path7.default.join(root, dir), { withFileTypes: true })) {
21744
- const relative2 = `${dir}/${entry.name}`;
21745
- if (entry.isDirectory()) walk(relative2);
21746
- else if (/\.(swift|c|cpp|h)$/.test(entry.name)) files.push(relative2);
21744
+ const relative3 = `${dir}/${entry.name}`;
21745
+ if (entry.isDirectory()) walk(relative3);
21746
+ else if (/\.(swift|c|cpp|h)$/.test(entry.name)) files.push(relative3);
21747
21747
  }
21748
21748
  };
21749
21749
  walk("Sources");
@@ -21845,7 +21845,7 @@ function swiftTargetDependencies(files, targets) {
21845
21845
  }
21846
21846
  function swiftArtifactHash(input, release, moduleRoot) {
21847
21847
  const hash = (0, import_node_crypto3.createHash)("sha256");
21848
- hash.update(`swift-compile/v13
21848
+ hash.update(`swift-compile/v14
21849
21849
  ${release}
21850
21850
  `);
21851
21851
  if (input.oneModule) hash.update("one-module\n");
@@ -22130,6 +22130,180 @@ function liftExtensionOverrides(source) {
22130
22130
  out = out.slice(0, at) + insert + out.slice(at + remove);
22131
22131
  return out;
22132
22132
  }
22133
+ function lowerAnyObjectDoubleValue(source) {
22134
+ const masked = swiftCodeMask(source);
22135
+ const names = /* @__PURE__ */ new Set();
22136
+ const binding = /(?:\blet\b|\bvar\b)\s+([A-Za-z_]\w*)\s*=[^\n;{}]*?\bas[?!]?\s*AnyObject\??(?=\s*(?:[,;{]|\belse\b|$))/gm;
22137
+ const declared = /(?:\blet\b|\bvar\b)\s+([A-Za-z_]\w*)\s*:\s*AnyObject\b/g;
22138
+ const parameter = /[(,]\s*(?:[A-Za-z_]\w*\s+)?([A-Za-z_]\w*)\s*:\s*AnyObject\??(?=\s*[,)=])/g;
22139
+ for (const pattern of [binding, declared, parameter]) {
22140
+ pattern.lastIndex = 0;
22141
+ for (let found = pattern.exec(masked); found; found = pattern.exec(masked))
22142
+ names.add(found[1]);
22143
+ }
22144
+ const edits = [];
22145
+ const member = /\.\s*doubleValue\b/g;
22146
+ let hit;
22147
+ while ((hit = member.exec(masked)) !== null) {
22148
+ const memberEnd = hit.index + hit[0].length;
22149
+ let j = hit.index - 1;
22150
+ while (j >= 0 && /\s/.test(masked[j])) j--;
22151
+ if (masked[j] === "?" || masked[j] === "!") {
22152
+ j--;
22153
+ while (j >= 0 && /\s/.test(masked[j])) j--;
22154
+ }
22155
+ if (masked[j] === ")") {
22156
+ const close = j;
22157
+ let depth = 0;
22158
+ let open = -1;
22159
+ for (let k = close; k >= 0; k--) {
22160
+ if (masked[k] === ")") depth++;
22161
+ else if (masked[k] === "(" && --depth === 0) {
22162
+ open = k;
22163
+ break;
22164
+ }
22165
+ }
22166
+ if (open === -1) continue;
22167
+ const inner = masked.slice(open + 1, close);
22168
+ const cast = /^(?:\s*(?:try\b|await\b))*\s*([\s\S]*?)\bas[?!]?\s*AnyObject\??\s*$/.exec(inner);
22169
+ if (!cast) continue;
22170
+ const expression = source.slice(open + 1, open + 1 + cast[1].length).replace(/\s+$/, "");
22171
+ const hoisted = /^\s*((?:try\b\s*|await\s*)+)([\s\S]*)$/.exec(expression);
22172
+ edits.push([
22173
+ open,
22174
+ memberEnd - open,
22175
+ `${hoisted ? hoisted[1] : ""}_objcNumber(${hoisted ? hoisted[2] : expression})`
22176
+ ]);
22177
+ continue;
22178
+ }
22179
+ const head = masked.slice(0, j + 1);
22180
+ const selfed = /(?:^|[^\w$])self\s*\.\s*([A-Za-z_]\w*)$/.exec(head);
22181
+ if (selfed) {
22182
+ if (!names.has(selfed[1])) continue;
22183
+ const receiver = selfed[0].replace(/^[^\w$]+/, "");
22184
+ edits.push([
22185
+ j + 1 - receiver.length,
22186
+ memberEnd - (j + 1 - receiver.length),
22187
+ `_objcNumber(${receiver})`
22188
+ ]);
22189
+ continue;
22190
+ }
22191
+ const named = /([A-Za-z_]\w*)$/.exec(head);
22192
+ if (!named || !names.has(named[1])) continue;
22193
+ const nameStart = j + 1 - named[1].length;
22194
+ let before = nameStart - 1;
22195
+ while (before >= 0 && /\s/.test(masked[before])) before--;
22196
+ if (masked[before] === ".") continue;
22197
+ edits.push([nameStart, memberEnd - nameStart, `_objcNumber(${named[1]})`]);
22198
+ }
22199
+ let out = source;
22200
+ for (const [at, remove, insert] of edits.sort((a, b) => b[0] - a[0]))
22201
+ out = out.slice(0, at) + insert + out.slice(at + remove);
22202
+ return out;
22203
+ }
22204
+ function swiftCodeMask(source) {
22205
+ const chars = source.split("");
22206
+ const blank = (from, to) => {
22207
+ for (let i = Math.max(0, from); i < Math.min(to, chars.length); i++)
22208
+ if (chars[i] !== "\n") chars[i] = " ";
22209
+ };
22210
+ const hashesAt = (at) => {
22211
+ let end = at;
22212
+ while (source[end] === "#") end++;
22213
+ return end - at;
22214
+ };
22215
+ const scanString = (quote, hashes) => {
22216
+ const multiline = source.startsWith('"""', quote);
22217
+ let i = quote + (multiline ? 3 : 1);
22218
+ const keep = [];
22219
+ const quoteEnd = (at) => {
22220
+ const mark = multiline ? '"""' : '"';
22221
+ return source.startsWith(mark, at) && source.startsWith("#".repeat(hashes), at + mark.length);
22222
+ };
22223
+ while (i < chars.length) {
22224
+ if (source[i] === "\\" && source.startsWith("#".repeat(hashes), i + 1) && source[i + 1 + hashes] === "(") {
22225
+ const codeStart = i + 2 + hashes;
22226
+ const codeEnd = scanCode(codeStart, true);
22227
+ keep.push([codeStart, codeEnd]);
22228
+ i = codeEnd + 1;
22229
+ continue;
22230
+ }
22231
+ if (quoteEnd(i)) {
22232
+ const close = i + (multiline ? 3 : 1) + hashes;
22233
+ let cursor = quote - hashes;
22234
+ for (const [from, to] of [...keep, [close, close]])
22235
+ if (from > cursor) {
22236
+ blank(cursor, from);
22237
+ cursor = to;
22238
+ } else cursor = Math.max(cursor, to);
22239
+ return close;
22240
+ }
22241
+ i++;
22242
+ }
22243
+ blank(quote - hashes, chars.length);
22244
+ return chars.length;
22245
+ };
22246
+ const scanCode = (i, nested) => {
22247
+ let parens = 0;
22248
+ while (i < chars.length) {
22249
+ const char = source[i];
22250
+ if (char === "/" && source[i + 1] === "/") {
22251
+ const end = source.indexOf("\n", i);
22252
+ blank(i, end === -1 ? chars.length : end);
22253
+ i = end === -1 ? chars.length : end;
22254
+ continue;
22255
+ }
22256
+ if (char === "/" && source[i + 1] === "*") {
22257
+ let j = i + 2;
22258
+ let depth = 1;
22259
+ while (j < chars.length && depth > 0) {
22260
+ if (source.startsWith("/*", j)) {
22261
+ depth++;
22262
+ j += 2;
22263
+ } else if (source.startsWith("*/", j)) {
22264
+ depth--;
22265
+ j += 2;
22266
+ } else j++;
22267
+ }
22268
+ blank(i, j);
22269
+ i = j;
22270
+ continue;
22271
+ }
22272
+ if (char === "#") {
22273
+ const hashes = hashesAt(i);
22274
+ const at = i + hashes;
22275
+ if (source[at] === '"') {
22276
+ i = scanString(at, hashes);
22277
+ continue;
22278
+ }
22279
+ if (hashes > 0 && source[at] === "/") {
22280
+ const mark = "#".repeat(hashes);
22281
+ let j = at + 1;
22282
+ while (j < chars.length && !(source[j] === "/" && source.startsWith(mark, j + 1)))
22283
+ j++;
22284
+ blank(i, Math.min(chars.length, j + 1 + hashes));
22285
+ i = Math.min(chars.length, j + 1 + hashes);
22286
+ continue;
22287
+ }
22288
+ i++;
22289
+ continue;
22290
+ }
22291
+ if (char === '"') {
22292
+ i = scanString(i, 0);
22293
+ continue;
22294
+ }
22295
+ if (char === "(") parens++;
22296
+ else if (char === ")") {
22297
+ if (nested && parens === 0) return i;
22298
+ parens--;
22299
+ }
22300
+ i++;
22301
+ }
22302
+ return i;
22303
+ };
22304
+ scanCode(0, false);
22305
+ return chars.join("");
22306
+ }
22133
22307
  function swiftSourceAsIOS(original) {
22134
22308
  const source = liftExtensionOverrides(original);
22135
22309
  const { lineStarts, tokens } = swiftCodeScan(source);
@@ -22204,7 +22378,7 @@ function swiftSourceAsIOS(original) {
22204
22378
  out += conditioned.slice(copied, at) + replacement;
22205
22379
  copied = at + match[0].length;
22206
22380
  }
22207
- return out + conditioned.slice(copied);
22381
+ return lowerAnyObjectDoubleValue(out + conditioned.slice(copied));
22208
22382
  }
22209
22383
  function swiftCodeScan(source) {
22210
22384
  const starts = /* @__PURE__ */ new Set();
@@ -22540,6 +22714,7 @@ var init_swift_compile = __esm({
22540
22714
  Accelerate: [],
22541
22715
  CryptoKit: [],
22542
22716
  CommonCrypto: [],
22717
+ CoreText: [],
22543
22718
  Security: [],
22544
22719
  TikTokBusinessSDK: [],
22545
22720
  nSure: [],
@@ -23916,8 +24091,8 @@ function packageFiles(root) {
23916
24091
  const full = import_node_path13.default.join(dir, entry.name);
23917
24092
  if (entry.isSymbolicLink()) throw new Error(`swift input is a symlink: ${full}`);
23918
24093
  const real = import_node_fs13.default.realpathSync(full);
23919
- const relative2 = import_node_path13.default.relative(canonicalRoot, real);
23920
- if (relative2.startsWith(`..${import_node_path13.default.sep}`) || relative2 === ".." || import_node_path13.default.isAbsolute(relative2)) {
24094
+ const relative3 = import_node_path13.default.relative(canonicalRoot, real);
24095
+ if (relative3.startsWith(`..${import_node_path13.default.sep}`) || relative3 === ".." || import_node_path13.default.isAbsolute(relative3)) {
23921
24096
  throw new Error(`swift input escapes the selected package: ${full}`);
23922
24097
  }
23923
24098
  if (entry.isDirectory()) {
@@ -23934,8 +24109,8 @@ function packageFiles(root) {
23934
24109
  }
23935
24110
  function readPackageFile(root, file, maxBytes) {
23936
24111
  const canonicalRoot = import_node_fs13.default.realpathSync(root);
23937
- const relative2 = import_node_path13.default.relative(canonicalRoot, import_node_fs13.default.realpathSync(file));
23938
- if (relative2 === ".." || relative2.startsWith(`..${import_node_path13.default.sep}`) || import_node_path13.default.isAbsolute(relative2)) {
24112
+ const relative3 = import_node_path13.default.relative(canonicalRoot, import_node_fs13.default.realpathSync(file));
24113
+ if (relative3 === ".." || relative3.startsWith(`..${import_node_path13.default.sep}`) || import_node_path13.default.isAbsolute(relative3)) {
23939
24114
  throw new Error(`swift input escapes the selected package: ${file}`);
23940
24115
  }
23941
24116
  let ancestor = import_node_path13.default.resolve(file);
@@ -23985,10 +24160,10 @@ function resourceCandidateFiles(root) {
23985
24160
  }
23986
24161
  function buildSwiftResourceTable(project, baseUrl) {
23987
24162
  const absolute = resourceCandidateFiles(project.packagePath);
23988
- const relative2 = absolute.map(
24163
+ const relative3 = absolute.map(
23989
24164
  (file) => import_node_path13.default.relative(project.packagePath, file).split(import_node_path13.default.sep).join(import_node_path13.default.posix.sep)
23990
24165
  );
23991
- const byRelative = new Map(absolute.map((file, index) => [relative2[index], file]));
24166
+ const byRelative = new Map(absolute.map((file, index) => [relative3[index], file]));
23992
24167
  const readContents = (candidate) => {
23993
24168
  const file = byRelative.get(candidate);
23994
24169
  if (!file || !/(^|\/)Contents\.json$|\.symbolset\/[^/]+\.svg$/.test(candidate))
@@ -23999,9 +24174,9 @@ function buildSwiftResourceTable(project, baseUrl) {
23999
24174
  MAX_SWIFT_COMPILE_RESOURCE_BYTES
24000
24175
  ).toString("utf8");
24001
24176
  };
24002
- const found = enumerateBundleImages(relative2, readContents);
24003
- const colors = enumerateBundleColors(relative2, readContents);
24004
- const symbols = enumerateBundleSymbols(relative2, readContents);
24177
+ const found = enumerateBundleImages(relative3, readContents);
24178
+ const colors = enumerateBundleColors(relative3, readContents);
24179
+ const symbols = enumerateBundleSymbols(relative3, readContents);
24005
24180
  const table = {};
24006
24181
  const images = {};
24007
24182
  const watched = [];
@@ -24034,7 +24209,7 @@ function buildSwiftResourceTable(project, baseUrl) {
24034
24209
  contentType: RESOURCE_CONTENT_TYPES[ext] ?? "application/octet-stream"
24035
24210
  });
24036
24211
  }
24037
- for (const file of relative2) {
24212
+ for (const file of relative3) {
24038
24213
  if (file.endsWith(".colorset/Contents.json") || file.includes(".symbolset/"))
24039
24214
  watched.push(file);
24040
24215
  }
@@ -24048,13 +24223,13 @@ function buildSwiftResourceTable(project, baseUrl) {
24048
24223
  }
24049
24224
  function buildSwiftBundleFiles(packagePath) {
24050
24225
  packagePath = import_node_fs13.default.realpathSync(packagePath);
24051
- const relative2 = resourceCandidateFiles(packagePath).map(
24226
+ const relative3 = resourceCandidateFiles(packagePath).map(
24052
24227
  (file) => import_node_path13.default.relative(packagePath, file).split(import_node_path13.default.sep).join(import_node_path13.default.posix.sep)
24053
24228
  );
24054
24229
  const files = {};
24055
24230
  const watched = [];
24056
24231
  let total = 0;
24057
- for (const { base, file } of enumerateBundleJson(relative2)) {
24232
+ for (const { base, file } of enumerateBundleJson(relative3)) {
24058
24233
  watched.push(file);
24059
24234
  const disk = import_node_path13.default.join(packagePath, ...file.split("/"));
24060
24235
  if (Object.keys(files).length >= BUNDLE_MAX_FILES || total + import_node_fs13.default.statSync(disk).size > BUNDLE_MAX_TOTAL_BYTES) {
@@ -24105,9 +24280,9 @@ function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
24105
24280
  );
24106
24281
  if (moduleRoot) {
24107
24282
  hash.update(moduleRoot);
24108
- for (const relative2 of swiftModuleInputFiles(moduleRoot)) {
24109
- hash.update(relative2);
24110
- hash.update(String(import_node_fs13.default.statSync(import_node_path13.default.join(moduleRoot, relative2)).mtimeMs));
24283
+ for (const relative3 of swiftModuleInputFiles(moduleRoot)) {
24284
+ hash.update(relative3);
24285
+ hash.update(String(import_node_fs13.default.statSync(import_node_path13.default.join(moduleRoot, relative3)).mtimeMs));
24111
24286
  }
24112
24287
  }
24113
24288
  return hash.digest("hex").slice(0, 16);
@@ -24125,8 +24300,8 @@ function packageSources(packagePath) {
24125
24300
  throw new Error("swift source byte cap exceeded");
24126
24301
  const files = {};
24127
24302
  for (const file of sources) {
24128
- const relative2 = import_node_path13.default.relative(packagePath, file).split(import_node_path13.default.sep).join(import_node_path13.default.posix.sep);
24129
- files[relative2] = readPackageFile(
24303
+ const relative3 = import_node_path13.default.relative(packagePath, file).split(import_node_path13.default.sep).join(import_node_path13.default.posix.sep);
24304
+ files[relative3] = readPackageFile(
24130
24305
  packagePath,
24131
24306
  file,
24132
24307
  MAX_SWIFT_COMPILE_SOURCE_BYTES
@@ -27095,19 +27270,19 @@ var init_checkout_plane = __esm({
27095
27270
  }
27096
27271
  const next = /* @__PURE__ */ new Map();
27097
27272
  const nextSniffed = /* @__PURE__ */ new Map();
27098
- for (const relative2 of stdout.split("\0")) {
27099
- if (!relative2) continue;
27273
+ for (const relative3 of stdout.split("\0")) {
27274
+ if (!relative3) continue;
27100
27275
  let stat2;
27101
27276
  try {
27102
- stat2 = import_node_fs19.default.statSync(import_node_path19.default.join(this.root, relative2));
27277
+ stat2 = import_node_fs19.default.statSync(import_node_path19.default.join(this.root, relative3));
27103
27278
  } catch {
27104
27279
  continue;
27105
27280
  }
27106
27281
  if (!stat2.isFile()) continue;
27107
- const seen = this.sniffed.get(relative2);
27108
- const binary = seen && seen.size === stat2.size && seen.mtimeMs === stat2.mtimeMs ? seen.binary : looksBinary(import_node_path19.default.join(this.root, relative2), stat2.size);
27109
- nextSniffed.set(relative2, { size: stat2.size, mtimeMs: stat2.mtimeMs, binary });
27110
- next.set(relative2, {
27282
+ const seen = this.sniffed.get(relative3);
27283
+ const binary = seen && seen.size === stat2.size && seen.mtimeMs === stat2.mtimeMs ? seen.binary : looksBinary(import_node_path19.default.join(this.root, relative3), stat2.size);
27284
+ nextSniffed.set(relative3, { size: stat2.size, mtimeMs: stat2.mtimeMs, binary });
27285
+ next.set(relative3, {
27111
27286
  size: stat2.size,
27112
27287
  // a checkout carries no write policy of its own; if the user can write
27113
27288
  // the file, so can the shell
@@ -29185,12 +29360,12 @@ var init_devices = __esm({
29185
29360
 
29186
29361
  // src/metro-production-bundle.ts
29187
29362
  function toRNXProductionBundleUrl(bundleUrl) {
29188
- const relative2 = bundleUrl.startsWith("/");
29363
+ const relative3 = bundleUrl.startsWith("/");
29189
29364
  const url = new URL(bundleUrl, "http://peachsim.local");
29190
29365
  url.searchParams.set("dev", "false");
29191
29366
  url.searchParams.set("hot", "false");
29192
29367
  url.searchParams.set("minify", "true");
29193
- return relative2 ? `${url.pathname}${url.search}${url.hash}` : url.toString();
29368
+ return relative3 ? `${url.pathname}${url.search}${url.hash}` : url.toString();
29194
29369
  }
29195
29370
  var RNX_METRO_MODULE_IDENTITY_VERSION;
29196
29371
  var init_metro_production_bundle = __esm({
@@ -29723,8 +29898,8 @@ function metroAssetScaleFilename(name2, type, scale) {
29723
29898
  const suffix = scale === 1 ? "" : `@${scale}x`;
29724
29899
  return `${name2}${suffix}.${type}`;
29725
29900
  }
29726
- function dropDotSegments(relative2) {
29727
- return relative2.split("/").filter((part) => part !== "" && part !== "." && part !== "..").join("/");
29901
+ function dropDotSegments(relative3) {
29902
+ return relative3.split("/").filter((part) => part !== "" && part !== "." && part !== "..").join("/");
29728
29903
  }
29729
29904
  function swapNodeModulesPrefix(part) {
29730
29905
  if (part === "node_modules") return "__node_modules";
@@ -29732,9 +29907,9 @@ function swapNodeModulesPrefix(part) {
29732
29907
  return part;
29733
29908
  }
29734
29909
  function metroIosAssetDestRelatives(httpServerLocation, filename) {
29735
- const relative2 = httpServerLocation.startsWith("/") ? httpServerLocation.slice(1) : httpServerLocation;
29736
- const classic = relative2.replace(/\.\.\//g, "_");
29737
- const dropped = dropDotSegments(relative2);
29910
+ const relative3 = httpServerLocation.startsWith("/") ? httpServerLocation.slice(1) : httpServerLocation;
29911
+ const classic = relative3.replace(/\.\.\//g, "_");
29912
+ const dropped = dropDotSegments(relative3);
29738
29913
  const dirs = [];
29739
29914
  for (const base of [classic, dropped]) {
29740
29915
  if (!base) continue;
@@ -29753,8 +29928,8 @@ function metroIosAssetDestRelatives(httpServerLocation, filename) {
29753
29928
  return out;
29754
29929
  }
29755
29930
  function metroIosAssetLocationSuffixes(httpServerLocation) {
29756
- const relative2 = httpServerLocation.startsWith("/") ? httpServerLocation.slice(1) : httpServerLocation;
29757
- const dropped = relative2.split("/").filter((part) => part !== "" && part !== "." && part !== "..");
29931
+ const relative3 = httpServerLocation.startsWith("/") ? httpServerLocation.slice(1) : httpServerLocation;
29932
+ const dropped = relative3.split("/").filter((part) => part !== "" && part !== "." && part !== "..");
29758
29933
  const variants = [dropped];
29759
29934
  if (dropped[0] === "assets" && dropped.length > 1) variants.push(dropped.slice(1));
29760
29935
  const suffixes = [];
@@ -31648,15 +31823,15 @@ function placementCombinations(perScale) {
31648
31823
  function distinctByContent(directory, options) {
31649
31824
  if (options.length < 2) return [...options];
31650
31825
  const byContent = /* @__PURE__ */ new Map();
31651
- for (const relative2 of options) {
31826
+ for (const relative3 of options) {
31652
31827
  let bytes;
31653
31828
  try {
31654
- bytes = (0, import_node_fs23.readFileSync)((0, import_node_path23.join)(directory, relative2));
31829
+ bytes = (0, import_node_fs23.readFileSync)((0, import_node_path23.join)(directory, relative3));
31655
31830
  } catch {
31656
31831
  continue;
31657
31832
  }
31658
31833
  const digest = (0, import_node_crypto11.createHash)("md5").update(bytes).digest("hex");
31659
- if (!byContent.has(digest)) byContent.set(digest, relative2);
31834
+ if (!byContent.has(digest)) byContent.set(digest, relative3);
31660
31835
  }
31661
31836
  return [...byContent.values()];
31662
31837
  }
@@ -31683,7 +31858,7 @@ function placeMetroDescriptor(listing, descriptor) {
31683
31858
  let bytes;
31684
31859
  try {
31685
31860
  bytes = combination.map(
31686
- (relative2) => (0, import_node_fs23.readFileSync)((0, import_node_path23.join)(listing.directory, relative2))
31861
+ (relative3) => (0, import_node_fs23.readFileSync)((0, import_node_path23.join)(listing.directory, relative3))
31687
31862
  );
31688
31863
  } catch {
31689
31864
  continue;
@@ -31697,8 +31872,8 @@ function placeMetroDescriptor(listing, descriptor) {
31697
31872
  if (!identical) continue;
31698
31873
  const chosen = /* @__PURE__ */ new Map();
31699
31874
  scales.forEach((scale, index) => {
31700
- const relative2 = combination[index];
31701
- if (relative2) chosen.set(scale, relative2);
31875
+ const relative3 = combination[index];
31876
+ if (relative3) chosen.set(scale, relative3);
31702
31877
  });
31703
31878
  return { files: chosen, ambiguous: [], verified: true, mismatched: false };
31704
31879
  }
@@ -31709,7 +31884,7 @@ function placeMetroDescriptor(listing, descriptor) {
31709
31884
  }
31710
31885
  function unverifiedFileKey(dest) {
31711
31886
  return dest.placements.filter((placement) => !placement.verified).flatMap(
31712
- (placement) => [...placement.files.values()].map((relative2) => (0, import_node_path23.join)(dest.directory, relative2))
31887
+ (placement) => [...placement.files.values()].map((relative3) => (0, import_node_path23.join)(dest.directory, relative3))
31713
31888
  ).sort().join("\n");
31714
31889
  }
31715
31890
  function searchMetroAssetDest(bundlePath, descriptors) {
@@ -31853,8 +32028,8 @@ async function embedBundleAssets(bundlePath, command, assetPolicy) {
31853
32028
  `${command} found ${variant.descriptor.name}.${variant.descriptor.type} in ${dest.directory}, but its bytes are not the ones this bundle was built against. Rebuild with \`react-native bundle --assets-dest ${dest.directory}\` so the bundle and the images match.`
31854
32029
  );
31855
32030
  }
31856
- const relative2 = placement?.files.get(variant.scale);
31857
- if (relative2 && dest) return (0, import_node_fs23.readFileSync)((0, import_node_path23.join)(dest.directory, relative2));
32031
+ const relative3 = placement?.files.get(variant.scale);
32032
+ if (relative3 && dest) return (0, import_node_fs23.readFileSync)((0, import_node_path23.join)(dest.directory, relative3));
31858
32033
  if (placement && placement.files.size > 0) return null;
31859
32034
  if (placement && placement.ambiguous.length > 0 && dest) {
31860
32035
  throw new Error(
@@ -34805,8 +34980,8 @@ function checkoutRoot(cwd) {
34805
34980
  }
34806
34981
  }
34807
34982
  function pathContains(parent, child) {
34808
- const relative2 = import_node_path25.default.relative(parent, child);
34809
- return relative2 === "" || relative2 !== ".." && !relative2.startsWith(`..${import_node_path25.default.sep}`) && !import_node_path25.default.isAbsolute(relative2);
34983
+ const relative3 = import_node_path25.default.relative(parent, child);
34984
+ return relative3 === "" || relative3 !== ".." && !relative3.startsWith(`..${import_node_path25.default.sep}`) && !import_node_path25.default.isAbsolute(relative3);
34810
34985
  }
34811
34986
  function resolveDefaultDevBridgeLockfile() {
34812
34987
  const lockfiles = liveDevBridgeLockfiles();
@@ -36118,11 +36293,11 @@ function discoverAppCatalog(appDir) {
36118
36293
  if (entry.isDirectory() && entry.name.endsWith(".xcassets"))
36119
36294
  catalogFiles(import_node_path28.default.join(targetDir, entry.name), files);
36120
36295
  }
36121
- const relative2 = files.map(
36296
+ const relative3 = files.map(
36122
36297
  (file) => import_node_path28.default.relative(targetDir, file).split(import_node_path28.default.sep).join(import_node_path28.default.posix.sep)
36123
36298
  );
36124
36299
  const colors = enumerateBundleColors(
36125
- relative2,
36300
+ relative3,
36126
36301
  (candidate) => candidate.endsWith("Contents.json") ? readText(import_node_path28.default.join(targetDir, candidate)) : null
36127
36302
  );
36128
36303
  const pbxproj = listDir(iosDir).find((entry) => entry.name.endsWith(".xcodeproj"));
@@ -36326,8 +36501,8 @@ function discoverNativeLinkedAppFonts(opts) {
36326
36501
  continue;
36327
36502
  }
36328
36503
  if (!entry.isFile() || !/\.(ttf|otf|woff|woff2)$/i.test(entry.name)) continue;
36329
- const relative2 = import_node_path31.default.relative(root, fullPath).split(import_node_path31.default.sep).join("/");
36330
- fontPaths.push(import_node_path31.default.posix.join(metroPathPrefix, relative2));
36504
+ const relative3 = import_node_path31.default.relative(root, fullPath).split(import_node_path31.default.sep).join("/");
36505
+ fontPaths.push(import_node_path31.default.posix.join(metroPathPrefix, relative3));
36331
36506
  if (fontPaths.length >= 256) break;
36332
36507
  }
36333
36508
  }
@@ -36428,8 +36603,8 @@ function discoverNativeLinkedAppFonts(opts) {
36428
36603
  import_node_path31.default.resolve(iosDir, declaredFont)
36429
36604
  ];
36430
36605
  const fontPath = candidates.find((candidate) => {
36431
- const relative2 = import_node_path31.default.relative(selectedAppDir, candidate);
36432
- if (relative2.startsWith("..") || import_node_path31.default.isAbsolute(relative2)) return false;
36606
+ const relative3 = import_node_path31.default.relative(selectedAppDir, candidate);
36607
+ if (relative3.startsWith("..") || import_node_path31.default.isAbsolute(relative3)) return false;
36433
36608
  try {
36434
36609
  return import_node_fs30.default.statSync(candidate).isFile();
36435
36610
  } catch {
@@ -39634,11 +39809,35 @@ function getSkillsDir() {
39634
39809
  const pkgPath = (0, import_url3.fileURLToPath)(
39635
39810
  import_meta4.resolve(`${rnxPublicBrand.packageName}/package.json`)
39636
39811
  );
39637
- return path26.join(path26.dirname(pkgPath), "skills");
39812
+ return primaryCheckoutPath(path26.join(path26.dirname(pkgPath), "skills"));
39638
39813
  } catch {
39639
39814
  const __dirname = path26.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
39640
- return path26.resolve(__dirname, "../../skills");
39815
+ return primaryCheckoutPath(path26.resolve(__dirname, "../../skills"));
39816
+ }
39817
+ }
39818
+ function primaryCheckoutPath(dir) {
39819
+ let top;
39820
+ let common;
39821
+ try {
39822
+ const out = (0, import_child_process7.execFileSync)(
39823
+ "git",
39824
+ [
39825
+ "-C",
39826
+ dir,
39827
+ "rev-parse",
39828
+ "--path-format=absolute",
39829
+ "--show-toplevel",
39830
+ "--git-common-dir"
39831
+ ],
39832
+ { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }
39833
+ );
39834
+ [top, common] = out.trim().split("\n");
39835
+ } catch {
39836
+ return dir;
39641
39837
  }
39838
+ if (path26.basename(common) !== ".git") return dir;
39839
+ const primary = path26.join(path26.dirname(common), path26.relative(top, dir));
39840
+ return fs23.existsSync(primary) ? primary : dir;
39642
39841
  }
39643
39842
  function skillsDir() {
39644
39843
  skillsDirPath ??= getSkillsDir();
@@ -39714,10 +39913,11 @@ function listSkills() {
39714
39913
  }
39715
39914
  return skills.sort((a, b) => a.name.localeCompare(b.name));
39716
39915
  }
39717
- var fs23, os6, path26, import_url3, import_meta4, skillsDirPath;
39916
+ var import_child_process7, fs23, os6, path26, import_url3, import_meta4, skillsDirPath;
39718
39917
  var init_skills = __esm({
39719
39918
  "cli/commands/skills.ts"() {
39720
39919
  "use strict";
39920
+ import_child_process7 = require("child_process");
39721
39921
  fs23 = __toESM(require("fs"), 1);
39722
39922
  os6 = __toESM(require("os"), 1);
39723
39923
  path26 = __toESM(require("path"), 1);
@@ -42527,7 +42727,7 @@ function executeSyncHttp(url, method, params) {
42527
42727
  }
42528
42728
  }
42529
42729
  const self = rnxSelfInvocation();
42530
- const child = (0, import_child_process7.spawnSync)(
42730
+ const child = (0, import_child_process8.spawnSync)(
42531
42731
  self.executable,
42532
42732
  [...self.prefixArgs, RNX_INTERNAL_COMMAND, RNX_INTERNAL_CHILDREN.syncHttp],
42533
42733
  {
@@ -42583,11 +42783,11 @@ function scriptConditionIsTruthy(value) {
42583
42783
  if (!Number.isNaN(num) && num === 0) return false;
42584
42784
  return true;
42585
42785
  }
42586
- var import_child_process7, vm, HTTP_TIMEOUT_MS, TEMPLATE_RE, ESCAPED_TEMPLATE_RE, BARE_IDENTIFIER_RE, MaestroJsContext;
42786
+ var import_child_process8, vm, HTTP_TIMEOUT_MS, TEMPLATE_RE, ESCAPED_TEMPLATE_RE, BARE_IDENTIFIER_RE, MaestroJsContext;
42587
42787
  var init_maestro_js = __esm({
42588
42788
  "cli/maestro-js.ts"() {
42589
42789
  "use strict";
42590
- import_child_process7 = require("child_process");
42790
+ import_child_process8 = require("child_process");
42591
42791
  vm = __toESM(require("vm"), 1);
42592
42792
  init_internal_child();
42593
42793
  init_self_invocation();