peachsim 0.1.783 → 0.1.785

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 (77) hide show
  1. package/cli/commands/control.ts +3 -1
  2. package/cli/outbound-endpoints.ts +2 -6
  3. package/dist-lib/agent-daemon-client.cjs +1 -1
  4. package/dist-lib/agent-events.cjs +1 -1
  5. package/dist-lib/agent-identity.cjs +1 -1
  6. package/dist-lib/agent-sessions.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/capture-contract.cjs +1 -1
  18. package/dist-lib/capture-contract.mjs +1 -1
  19. package/dist-lib/cli-constants.cjs +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/detox/index.cjs +1 -1
  28. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  29. package/dist-lib/home-paths.cjs +1 -1
  30. package/dist-lib/host/bridge-host.cjs +41 -10
  31. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  32. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  34. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  35. package/dist-lib/host/websocket-proxy.cjs +1 -1
  36. package/dist-lib/index.cjs +1 -1
  37. package/dist-lib/jump-to-source-babel.cjs +1 -1
  38. package/dist-lib/jump-to-source-native.cjs +1 -1
  39. package/dist-lib/kotlin-host.cjs +1 -1
  40. package/dist-lib/menu.cjs +1 -1
  41. package/dist-lib/menu.mjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  44. package/dist-lib/metro-production-bundle.cjs +1 -1
  45. package/dist-lib/metro-production-bundle.mjs +1 -1
  46. package/dist-lib/metro.cjs +1 -1
  47. package/dist-lib/native-app-identity.cjs +1 -1
  48. package/dist-lib/native-app-identity.mjs +1 -1
  49. package/dist-lib/native-firebase-metadata.cjs +1 -1
  50. package/dist-lib/native-firebase-metadata.mjs +1 -1
  51. package/dist-lib/plist.cjs +1 -1
  52. package/dist-lib/plist.mjs +1 -1
  53. package/dist-lib/profiles.cjs +1 -1
  54. package/dist-lib/public-brand.cjs +1 -1
  55. package/dist-lib/react-native-host-modules.cjs +1 -1
  56. package/dist-lib/react-native-host-modules.mjs +1 -1
  57. package/dist-lib/render-mode.cjs +1 -1
  58. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  59. package/dist-lib/sdk.cjs +1 -1
  60. package/dist-lib/sdk.mjs +1 -1
  61. package/dist-lib/skills.cjs +42 -11
  62. package/dist-lib/swift-compile.cjs +1 -1
  63. package/dist-lib/swift-compile.mjs +1 -1
  64. package/dist-lib/swift-package.cjs +1 -1
  65. package/dist-lib/swift-package.mjs +1 -1
  66. package/dist-lib/swift-submit.cjs +1 -1
  67. package/dist-lib/swift-submit.mjs +1 -1
  68. package/dist-lib/swift-toolchain.cjs +1 -1
  69. package/dist-lib/swift.cjs +1 -1
  70. package/dist-lib/vite-swift.cjs +41 -10
  71. package/dist-lib/vite.cjs +1 -1
  72. package/package.json +1 -1
  73. package/src/swift-binary-modules.ts +5 -2
  74. package/src/swift-package-manifest.ts +3 -0
  75. package/src/swift-packages.ts +3 -0
  76. package/src/swift-standin-emit.ts +10 -2
  77. package/src/swift-standins.ts +32 -5
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.783 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.785 | (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;
@@ -31917,7 +31917,7 @@ async function swiftBinaryModules(binary2) {
31917
31917
  if (!binary2.url) return frameworkModules(localEntries(binary2.dir));
31918
31918
  const cached4 = import_node_path13.default.join(
31919
31919
  cacheDir2,
31920
- `${(0, import_node_crypto5.createHash)("sha256").update(binary2.url).digest("hex").slice(0, 32)}.json`
31920
+ `${(0, import_node_crypto5.createHash)("sha256").update(`${binary2.url}\0${binary2.checksum ?? ""}`).digest("hex").slice(0, 32)}.json`
31921
31921
  );
31922
31922
  if (import_node_fs13.default.existsSync(cached4)) {
31923
31923
  const value = JSON.parse(import_node_fs13.default.readFileSync(cached4, "utf8"));
@@ -32105,7 +32105,8 @@ function swiftPackageManifest(dir) {
32105
32105
  languageMode,
32106
32106
  mainActorIsolation,
32107
32107
  declaresResources: array(target.resources).length > 0,
32108
- url: string2(target.url) ?? null
32108
+ url: string2(target.url) ?? null,
32109
+ checksum: string2(target.checksum) ?? null
32109
32110
  });
32110
32111
  }
32111
32112
  const manifest = { dir, products, targets, packages };
@@ -32332,6 +32333,7 @@ function resolveSwiftPackages(options) {
32332
32333
  target: name2,
32333
32334
  source: pkg.source,
32334
32335
  url: target.url,
32336
+ checksum: target.checksum,
32335
32337
  dir: target.dir,
32336
32338
  reached: false
32337
32339
  });
@@ -32693,6 +32695,11 @@ function emitSwiftStandin(graphs, options) {
32693
32695
  `${indent}${shape.attrs}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
32694
32696
  );
32695
32697
  const members = membersOf(id);
32698
+ const extra = options.behavior?.get(path37)?.members;
32699
+ if (extra) {
32700
+ used.add(path37);
32701
+ emit(`${inner}${extra}`);
32702
+ }
32696
32703
  for (const member of members)
32697
32704
  emitMember(member, inner, {
32698
32705
  openOwner: open,
@@ -32739,7 +32746,8 @@ function emitSwiftStandin(graphs, options) {
32739
32746
  continue;
32740
32747
  if (hasDefault.has(member.identifier.precise)) continue;
32741
32748
  if (isObjC(member) && / async\b/.test(text(member))) continue;
32742
- if (met(member) || member.kind.identifier === "swift.associatedtype") continue;
32749
+ if (met(member) || member.kind.identifier === "swift.associatedtype")
32750
+ continue;
32743
32751
  have.add(witnessKey(member));
32744
32752
  have.add(sideLeaf(member));
32745
32753
  emitWitness(member, inner, path37);
@@ -33014,7 +33022,7 @@ var STANDIN_EMIT_VERSION, TYPE_KINDS, MEMBER_KINDS, ACCESSOR_WORD, KEEP_EXTERNAL
33014
33022
  var init_swift_standin_emit = __esm({
33015
33023
  "src/swift-standin-emit.ts"() {
33016
33024
  "use strict";
33017
- STANDIN_EMIT_VERSION = "2";
33025
+ STANDIN_EMIT_VERSION = "3";
33018
33026
  TYPE_KINDS = /* @__PURE__ */ new Set([
33019
33027
  "swift.class",
33020
33028
  "swift.struct",
@@ -33156,7 +33164,10 @@ function locateXcframework(tree) {
33156
33164
  function xcframework(binary2) {
33157
33165
  if (!binary2.url && !binary2.dir.endsWith(".zip"))
33158
33166
  return { dir: binary2.dir, digest: treeDigest(binary2.dir) };
33159
- const dir = import_node_path16.default.join(cacheDir4, "archives", key(binary2.url ?? binary2.dir));
33167
+ if (binary2.url && (!binary2.checksum || !/^[a-f0-9]{64}$/i.test(binary2.checksum)))
33168
+ throw new Error("remote binary archive requires its Package.swift SHA-256 checksum");
33169
+ const expected = binary2.checksum?.toLowerCase();
33170
+ const dir = import_node_path16.default.join(cacheDir4, "archives", key(binary2.url ? expected : binary2.dir));
33160
33171
  const archive = import_node_path16.default.join(dir, "archive.zip");
33161
33172
  const fingerprint = import_node_path16.default.join(dir, ".fingerprint");
33162
33173
  const stored = (() => {
@@ -33186,13 +33197,20 @@ function xcframework(binary2) {
33186
33197
  return { dir: found2, digest: sha2 };
33187
33198
  }
33188
33199
  if (stored && import_node_fs16.default.existsSync(archive)) {
33200
+ const sha2 = (0, import_node_crypto7.createHash)("sha256").update(import_node_fs16.default.readFileSync(archive)).digest("hex");
33201
+ if (sha2 !== expected)
33202
+ throw new Error(`archive checksum ${sha2} is not the declared checksum ${expected}`);
33189
33203
  const found2 = locateXcframework(import_node_path16.default.join(dir, "tree"));
33190
- if (found2) return { dir: found2, digest: stored.sha };
33204
+ if (found2) return { dir: found2, digest: sha2 };
33191
33205
  }
33192
33206
  import_node_fs16.default.rmSync(dir, { recursive: true, force: true });
33193
33207
  import_node_fs16.default.mkdirSync(import_node_path16.default.join(dir, "tree"), { recursive: true });
33194
33208
  exec("curl", ["-fsSL", "--retry", "2", "-o", archive, binary2.url]);
33195
33209
  const sha = (0, import_node_crypto7.createHash)("sha256").update(import_node_fs16.default.readFileSync(archive)).digest("hex");
33210
+ if (sha !== expected) {
33211
+ import_node_fs16.default.rmSync(dir, { recursive: true, force: true });
33212
+ throw new Error(`archive checksum ${sha} is not the declared checksum ${expected}`);
33213
+ }
33196
33214
  exec("unzip", ["-q", archive, "-d", import_node_path16.default.join(dir, "tree")]);
33197
33215
  import_node_fs16.default.writeFileSync(fingerprint, JSON.stringify({ sha }));
33198
33216
  const found = locateXcframework(import_node_path16.default.join(dir, "tree"));
@@ -33446,7 +33464,13 @@ function splitDeclarators(statement, names) {
33446
33464
  throw new Error(
33447
33465
  `${names[0]} has an unexpected grouped declaration in ${JSON.stringify(statement.trim().slice(0, 80))}`
33448
33466
  );
33449
- let end = chunks[0].indexOf(names[0]);
33467
+ let end = -1;
33468
+ for (let at = 0; at < chunks[0].length; at++) {
33469
+ if (chunks[0].startsWith(names[0], at) && !identChar(chunks[0][at - 1]) && !identChar(chunks[0][at + names[0].length])) {
33470
+ end = at;
33471
+ break;
33472
+ }
33473
+ }
33450
33474
  if (end < 0) throw new Error(`${names[0]} names no declarator in its own declaration`);
33451
33475
  for (; ; ) {
33452
33476
  while (end > 0 && /[\s*]/.test(chunks[0][end - 1])) end--;
@@ -33589,7 +33613,7 @@ ${roots.map((file) => ` header "${file}"
33589
33613
  function standinGenerationInputs(binaries, toolchain) {
33590
33614
  const { moduleRoot, toolchainBin, release } = toolchain;
33591
33615
  const parts = [
33592
- "standin/v2",
33616
+ "standin/v3",
33593
33617
  toolchainBin,
33594
33618
  release,
33595
33619
  swiftModuleSdk(moduleRoot).wasmSdkId,
@@ -33604,10 +33628,17 @@ function standinGenerationInputs(binaries, toolchain) {
33604
33628
  binary2.target,
33605
33629
  binary2.source,
33606
33630
  binary2.url ?? "",
33631
+ binary2.checksum ?? "",
33607
33632
  xcframework(binary2).digest
33608
33633
  );
33609
33634
  } catch {
33610
- parts.push(binary2.target, binary2.source, binary2.url ?? "", "unreadable");
33635
+ parts.push(
33636
+ binary2.target,
33637
+ binary2.source,
33638
+ binary2.url ?? "",
33639
+ binary2.checksum ?? "",
33640
+ "unreadable"
33641
+ );
33611
33642
  }
33612
33643
  }
33613
33644
  return (0, import_node_crypto7.createHash)("sha256").update(parts.join("\0")).digest("hex");
@@ -52640,6 +52671,7 @@ function normalizeKnownTarget(target) {
52640
52671
  async function ensureBridgeForOpen(preferredPort, explicitPort = false, resources) {
52641
52672
  const lock = readDaemonLockfile();
52642
52673
  assertExplicitBridgeLock(preferredPort, explicitPort, lock);
52674
+ await ensureRuntimeForOpen();
52643
52675
  const preferredWorld = worldForBridgePort(preferredPort);
52644
52676
  if ((explicitPort || preferredWorld !== null) && await canConnectToBridge(preferredPort, 2e3)) {
52645
52677
  return preferredPort;
@@ -52657,7 +52689,6 @@ async function ensureBridgeForOpen(preferredPort, explicitPort = false, resource
52657
52689
  `peach bridge lockfile is fresh (port ${lock.bridgePort}) but the bridge is not reachable. run \`peach daemon restart\` or \`peach daemon uninstall\`.`
52658
52690
  );
52659
52691
  }
52660
- await ensureRuntimeForOpen();
52661
52692
  const child = spawnSootsim(["serve", "--quiet", "--port", String(preferredPort)]);
52662
52693
  if (resources) {
52663
52694
  resources.bridge = child;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.783 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.785 | (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;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.783 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.785 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/swift-compile.ts
4
4
  import { execFile as execFile2, execFileSync } from "node:child_process";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.783 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.785 | (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 __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.783 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.785 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/swift-package.ts
4
4
  function isSwiftManifestFile(file) {
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.783 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.785 | (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 __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.783 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.785 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/swift-submit.ts
4
4
  var SWIFT_COMPILE_PATH = "/api/swift-compile";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.783 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.785 | (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;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.783 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.785 | (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 __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.783 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.785 | (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;
@@ -3964,7 +3964,7 @@ async function swiftBinaryModules(binary) {
3964
3964
  if (!binary.url) return frameworkModules(localEntries(binary.dir));
3965
3965
  const cached2 = import_node_path5.default.join(
3966
3966
  cacheDir,
3967
- `${(0, import_node_crypto3.createHash)("sha256").update(binary.url).digest("hex").slice(0, 32)}.json`
3967
+ `${(0, import_node_crypto3.createHash)("sha256").update(`${binary.url}\0${binary.checksum ?? ""}`).digest("hex").slice(0, 32)}.json`
3968
3968
  );
3969
3969
  if (import_node_fs4.default.existsSync(cached2)) {
3970
3970
  const value = JSON.parse(import_node_fs4.default.readFileSync(cached2, "utf8"));
@@ -4424,7 +4424,8 @@ function swiftPackageManifest(dir) {
4424
4424
  languageMode,
4425
4425
  mainActorIsolation,
4426
4426
  declaresResources: array(target.resources).length > 0,
4427
- url: string(target.url) ?? null
4427
+ url: string(target.url) ?? null,
4428
+ checksum: string(target.checksum) ?? null
4428
4429
  });
4429
4430
  }
4430
4431
  const manifest = { dir, products, targets, packages };
@@ -4628,6 +4629,7 @@ function resolveSwiftPackages(options) {
4628
4629
  target: name2,
4629
4630
  source: pkg.source,
4630
4631
  url: target.url,
4632
+ checksum: target.checksum,
4631
4633
  dir: target.dir,
4632
4634
  reached: false
4633
4635
  });
@@ -4721,7 +4723,7 @@ function getCliVersion() {
4721
4723
  }
4722
4724
 
4723
4725
  // src/swift-standin-emit.ts
4724
- var STANDIN_EMIT_VERSION = "2";
4726
+ var STANDIN_EMIT_VERSION = "3";
4725
4727
  var TYPE_KINDS = /* @__PURE__ */ new Set([
4726
4728
  "swift.class",
4727
4729
  "swift.struct",
@@ -5068,6 +5070,11 @@ function emitSwiftStandin(graphs, options) {
5068
5070
  `${indent}${shape.attrs}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
5069
5071
  );
5070
5072
  const members = membersOf(id);
5073
+ const extra = options.behavior?.get(path16)?.members;
5074
+ if (extra) {
5075
+ used.add(path16);
5076
+ emit(`${inner}${extra}`);
5077
+ }
5071
5078
  for (const member of members)
5072
5079
  emitMember(member, inner, {
5073
5080
  openOwner: open,
@@ -5114,7 +5121,8 @@ function emitSwiftStandin(graphs, options) {
5114
5121
  continue;
5115
5122
  if (hasDefault.has(member.identifier.precise)) continue;
5116
5123
  if (isObjC(member) && / async\b/.test(text(member))) continue;
5117
- if (met(member) || member.kind.identifier === "swift.associatedtype") continue;
5124
+ if (met(member) || member.kind.identifier === "swift.associatedtype")
5125
+ continue;
5118
5126
  have.add(witnessKey(member));
5119
5127
  have.add(sideLeaf(member));
5120
5128
  emitWitness(member, inner, path16);
@@ -5483,7 +5491,10 @@ function locateXcframework(tree) {
5483
5491
  function xcframework(binary) {
5484
5492
  if (!binary.url && !binary.dir.endsWith(".zip"))
5485
5493
  return { dir: binary.dir, digest: treeDigest(binary.dir) };
5486
- const dir = import_node_path11.default.join(cacheDir3, "archives", key(binary.url ?? binary.dir));
5494
+ if (binary.url && (!binary.checksum || !/^[a-f0-9]{64}$/i.test(binary.checksum)))
5495
+ throw new Error("remote binary archive requires its Package.swift SHA-256 checksum");
5496
+ const expected = binary.checksum?.toLowerCase();
5497
+ const dir = import_node_path11.default.join(cacheDir3, "archives", key(binary.url ? expected : binary.dir));
5487
5498
  const archive = import_node_path11.default.join(dir, "archive.zip");
5488
5499
  const fingerprint = import_node_path11.default.join(dir, ".fingerprint");
5489
5500
  const stored = (() => {
@@ -5513,13 +5524,20 @@ function xcframework(binary) {
5513
5524
  return { dir: found2, digest: sha2 };
5514
5525
  }
5515
5526
  if (stored && import_node_fs11.default.existsSync(archive)) {
5527
+ const sha2 = (0, import_node_crypto6.createHash)("sha256").update(import_node_fs11.default.readFileSync(archive)).digest("hex");
5528
+ if (sha2 !== expected)
5529
+ throw new Error(`archive checksum ${sha2} is not the declared checksum ${expected}`);
5516
5530
  const found2 = locateXcframework(import_node_path11.default.join(dir, "tree"));
5517
- if (found2) return { dir: found2, digest: stored.sha };
5531
+ if (found2) return { dir: found2, digest: sha2 };
5518
5532
  }
5519
5533
  import_node_fs11.default.rmSync(dir, { recursive: true, force: true });
5520
5534
  import_node_fs11.default.mkdirSync(import_node_path11.default.join(dir, "tree"), { recursive: true });
5521
5535
  exec("curl", ["-fsSL", "--retry", "2", "-o", archive, binary.url]);
5522
5536
  const sha = (0, import_node_crypto6.createHash)("sha256").update(import_node_fs11.default.readFileSync(archive)).digest("hex");
5537
+ if (sha !== expected) {
5538
+ import_node_fs11.default.rmSync(dir, { recursive: true, force: true });
5539
+ throw new Error(`archive checksum ${sha} is not the declared checksum ${expected}`);
5540
+ }
5523
5541
  exec("unzip", ["-q", archive, "-d", import_node_path11.default.join(dir, "tree")]);
5524
5542
  import_node_fs11.default.writeFileSync(fingerprint, JSON.stringify({ sha }));
5525
5543
  const found = locateXcframework(import_node_path11.default.join(dir, "tree"));
@@ -5776,7 +5794,13 @@ function splitDeclarators(statement, names) {
5776
5794
  throw new Error(
5777
5795
  `${names[0]} has an unexpected grouped declaration in ${JSON.stringify(statement.trim().slice(0, 80))}`
5778
5796
  );
5779
- let end = chunks[0].indexOf(names[0]);
5797
+ let end = -1;
5798
+ for (let at = 0; at < chunks[0].length; at++) {
5799
+ if (chunks[0].startsWith(names[0], at) && !identChar(chunks[0][at - 1]) && !identChar(chunks[0][at + names[0].length])) {
5800
+ end = at;
5801
+ break;
5802
+ }
5803
+ }
5780
5804
  if (end < 0) throw new Error(`${names[0]} names no declarator in its own declaration`);
5781
5805
  for (; ; ) {
5782
5806
  while (end > 0 && /[\s*]/.test(chunks[0][end - 1])) end--;
@@ -5920,7 +5944,7 @@ var built = /* @__PURE__ */ new Map();
5920
5944
  function standinGenerationInputs(binaries, toolchain) {
5921
5945
  const { moduleRoot, toolchainBin, release } = toolchain;
5922
5946
  const parts = [
5923
- "standin/v2",
5947
+ "standin/v3",
5924
5948
  toolchainBin,
5925
5949
  release,
5926
5950
  swiftModuleSdk(moduleRoot).wasmSdkId,
@@ -5935,10 +5959,17 @@ function standinGenerationInputs(binaries, toolchain) {
5935
5959
  binary.target,
5936
5960
  binary.source,
5937
5961
  binary.url ?? "",
5962
+ binary.checksum ?? "",
5938
5963
  xcframework(binary).digest
5939
5964
  );
5940
5965
  } catch {
5941
- parts.push(binary.target, binary.source, binary.url ?? "", "unreadable");
5966
+ parts.push(
5967
+ binary.target,
5968
+ binary.source,
5969
+ binary.url ?? "",
5970
+ binary.checksum ?? "",
5971
+ "unreadable"
5972
+ );
5942
5973
  }
5943
5974
  }
5944
5975
  return (0, import_node_crypto6.createHash)("sha256").update(parts.join("\0")).digest("hex");
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.783 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.785 | (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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.783",
3
+ "version": "0.1.785",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -94,12 +94,15 @@ function localEntries(dir: string): string[] {
94
94
  )
95
95
  }
96
96
 
97
- /** the modules a binary target ships, cached per archive url. */
97
+ /** the modules a binary target ships, cached per declared archive checksum. */
98
98
  export async function swiftBinaryModules(binary: SwiftPackageBinary): Promise<string[]> {
99
99
  if (!binary.url) return frameworkModules(localEntries(binary.dir))
100
100
  const cached = path.join(
101
101
  cacheDir,
102
- `${createHash('sha256').update(binary.url).digest('hex').slice(0, 32)}.json`,
102
+ `${createHash('sha256')
103
+ .update(`${binary.url}\0${binary.checksum ?? ''}`)
104
+ .digest('hex')
105
+ .slice(0, 32)}.json`,
103
106
  )
104
107
  if (fs.existsSync(cached)) {
105
108
  const value: unknown = JSON.parse(fs.readFileSync(cached, 'utf8'))
@@ -44,6 +44,8 @@ export interface SwiftManifestTarget {
44
44
  declaresResources: boolean
45
45
  /** a binary target's archive url; a local one's artifact is `dir`. */
46
46
  url: string | null
47
+ /** the declared SHA-256 for a remote binary archive. */
48
+ checksum: string | null
47
49
  }
48
50
 
49
51
  export interface SwiftPackageManifest {
@@ -260,6 +262,7 @@ export function swiftPackageManifest(dir: string): SwiftPackageManifest {
260
262
  mainActorIsolation,
261
263
  declaresResources: array(target.resources).length > 0,
262
264
  url: string(target.url) ?? null,
265
+ checksum: string(target.checksum) ?? null,
263
266
  })
264
267
  }
265
268
  const manifest = { dir, products, targets, packages }
@@ -65,6 +65,8 @@ export interface SwiftPackageBinary {
65
65
  source: string
66
66
  /** the archive url, or null for a local artifact at `dir`. */
67
67
  url: string | null
68
+ /** the Package.swift SHA-256, required for a remote archive. */
69
+ checksum: string | null
68
70
  dir: string
69
71
  /** a linked product's closure reaches it, so the app links it. */
70
72
  reached: boolean
@@ -336,6 +338,7 @@ export function resolveSwiftPackages(options: {
336
338
  target: name,
337
339
  source: pkg.source,
338
340
  url: target.url,
341
+ checksum: target.checksum,
339
342
  dir: target.dir,
340
343
  reached: false,
341
344
  })
@@ -64,6 +64,8 @@ export type StandinOptions = {
64
64
  }
65
65
 
66
66
  export type StandinBehavior = {
67
+ /** module-owned class members, including factory-only initializers */
68
+ members?: string
67
69
  /** statements for a function, initializer, or getter body */
68
70
  body?: string
69
71
  /** an async overload or a Result completion overload of the same sdk path */
@@ -83,7 +85,7 @@ export type StandinResult = {
83
85
  }
84
86
 
85
87
  /** bump when emitted source changes: the stand-in cache keys on it. */
86
- export const STANDIN_EMIT_VERSION = '2'
88
+ export const STANDIN_EMIT_VERSION = '3'
87
89
 
88
90
  const TYPE_KINDS = new Set([
89
91
  'swift.class',
@@ -549,6 +551,11 @@ export function emitSwiftStandin(
549
551
  `${indent}${shape.attrs}${open ? 'open' : 'public'} class ${shape.name}${shape.generics}${list.length ? `: ${list.join(', ')}` : ''}${selfConforming(shape.where)} {`,
550
552
  )
551
553
  const members = membersOf(id)
554
+ const extra = options.behavior?.get(path)?.members
555
+ if (extra) {
556
+ used.add(path)
557
+ emit(`${inner}${extra}`)
558
+ }
552
559
  for (const member of members)
553
560
  emitMember(member, inner, {
554
561
  openOwner: open,
@@ -612,7 +619,8 @@ export function emitSwiftStandin(
612
619
  continue
613
620
  if (hasDefault.has(member.identifier.precise)) continue
614
621
  if (isObjC(member) && / async\b/.test(text(member))) continue
615
- if (met(member) || member.kind.identifier === 'swift.associatedtype') continue
622
+ if (met(member) || member.kind.identifier === 'swift.associatedtype')
623
+ continue
616
624
  have.add(witnessKey(member))
617
625
  have.add(sideLeaf(member))
618
626
  emitWitness(member, inner, path)
@@ -137,7 +137,10 @@ function locateXcframework(tree: string): string | null {
137
137
  function xcframework(binary: SwiftPackageBinary): { dir: string; digest: string } {
138
138
  if (!binary.url && !binary.dir.endsWith('.zip'))
139
139
  return { dir: binary.dir, digest: treeDigest(binary.dir) }
140
- const dir = path.join(cacheDir, 'archives', key(binary.url ?? binary.dir))
140
+ if (binary.url && (!binary.checksum || !/^[a-f0-9]{64}$/i.test(binary.checksum)))
141
+ throw new Error('remote binary archive requires its Package.swift SHA-256 checksum')
142
+ const expected = binary.checksum?.toLowerCase()
143
+ const dir = path.join(cacheDir, 'archives', key(binary.url ? expected! : binary.dir))
141
144
  const archive = path.join(dir, 'archive.zip')
142
145
  const fingerprint = path.join(dir, '.fingerprint')
143
146
  const stored: { stamp?: string; sha: string } | null = (() => {
@@ -171,13 +174,20 @@ function xcframework(binary: SwiftPackageBinary): { dir: string; digest: string
171
174
  return { dir: found, digest: sha }
172
175
  }
173
176
  if (stored && fs.existsSync(archive)) {
177
+ const sha = createHash('sha256').update(fs.readFileSync(archive)).digest('hex')
178
+ if (sha !== expected)
179
+ throw new Error(`archive checksum ${sha} is not the declared checksum ${expected}`)
174
180
  const found = locateXcframework(path.join(dir, 'tree'))
175
- if (found) return { dir: found, digest: stored.sha }
181
+ if (found) return { dir: found, digest: sha }
176
182
  }
177
183
  fs.rmSync(dir, { recursive: true, force: true })
178
184
  fs.mkdirSync(path.join(dir, 'tree'), { recursive: true })
179
185
  exec('curl', ['-fsSL', '--retry', '2', '-o', archive, binary.url])
180
186
  const sha = createHash('sha256').update(fs.readFileSync(archive)).digest('hex')
187
+ if (sha !== expected) {
188
+ fs.rmSync(dir, { recursive: true, force: true })
189
+ throw new Error(`archive checksum ${sha} is not the declared checksum ${expected}`)
190
+ }
181
191
  exec('unzip', ['-q', archive, '-d', path.join(dir, 'tree')])
182
192
  fs.writeFileSync(fingerprint, JSON.stringify({ sha }))
183
193
  const found = locateXcframework(path.join(dir, 'tree'))
@@ -507,7 +517,17 @@ function splitDeclarators(statement: string, names: readonly string[]): string[]
507
517
  // the specifiers end where the first declarator starts: left of its name
508
518
  // over pointers and whitespace, and over attribute groups, stopping at a
509
519
  // paren that groups the declarator itself (`int (*fp)(void)`).
510
- let end = chunks[0]!.indexOf(names[0]!)
520
+ let end = -1
521
+ for (let at = 0; at < chunks[0]!.length; at++) {
522
+ if (
523
+ chunks[0]!.startsWith(names[0]!, at) &&
524
+ !identChar(chunks[0]![at - 1]) &&
525
+ !identChar(chunks[0]![at + names[0]!.length])
526
+ ) {
527
+ end = at
528
+ break
529
+ }
530
+ }
511
531
  if (end < 0) throw new Error(`${names[0]} names no declarator in its own declaration`)
512
532
  for (;;) {
513
533
  while (end > 0 && /[\s*]/.test(chunks[0]![end - 1]!)) end--
@@ -672,7 +692,7 @@ export function standinGenerationInputs(
672
692
  ): string {
673
693
  const { moduleRoot, toolchainBin, release } = toolchain
674
694
  const parts = [
675
- 'standin/v2',
695
+ 'standin/v3',
676
696
  toolchainBin,
677
697
  release,
678
698
  swiftModuleSdk(moduleRoot).wasmSdkId,
@@ -687,11 +707,18 @@ export function standinGenerationInputs(
687
707
  binary.target,
688
708
  binary.source,
689
709
  binary.url ?? '',
710
+ binary.checksum ?? '',
690
711
  xcframework(binary).digest,
691
712
  )
692
713
  } catch {
693
714
  // unreadable here fails again below, where it becomes a gap
694
- parts.push(binary.target, binary.source, binary.url ?? '', 'unreadable')
715
+ parts.push(
716
+ binary.target,
717
+ binary.source,
718
+ binary.url ?? '',
719
+ binary.checksum ?? '',
720
+ 'unreadable',
721
+ )
695
722
  }
696
723
  }
697
724
  return createHash('sha256').update(parts.join('\0')).digest('hex')