peachsim 0.1.784 → 0.1.786

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 (76) hide show
  1. package/cli/outbound-endpoints.ts +2 -6
  2. package/dist-lib/agent-daemon-client.cjs +1 -1
  3. package/dist-lib/agent-events.cjs +1 -1
  4. package/dist-lib/agent-identity.cjs +1 -1
  5. package/dist-lib/agent-sessions.cjs +1 -1
  6. package/dist-lib/attached-projects.cjs +1 -1
  7. package/dist-lib/auth/shared-session.cjs +1 -1
  8. package/dist-lib/backend-origin.cjs +1 -1
  9. package/dist-lib/beta.cjs +1 -1
  10. package/dist-lib/beta.mjs +1 -1
  11. package/dist-lib/bridge-constants.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.mjs +1 -1
  14. package/dist-lib/bridge-contract.cjs +1 -1
  15. package/dist-lib/bridge-contract.mjs +1 -1
  16. package/dist-lib/capture-contract.cjs +1 -1
  17. package/dist-lib/capture-contract.mjs +1 -1
  18. package/dist-lib/cli-constants.cjs +1 -1
  19. package/dist-lib/cloud-contract.cjs +1 -1
  20. package/dist-lib/cloud-contract.mjs +1 -1
  21. package/dist-lib/cloud-test-args.cjs +1 -1
  22. package/dist-lib/cloud-test-args.mjs +1 -1
  23. package/dist-lib/cloud.cjs +1 -1
  24. package/dist-lib/cloud.mjs +1 -1
  25. package/dist-lib/config.cjs +1 -1
  26. package/dist-lib/detox/index.cjs +1 -1
  27. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  28. package/dist-lib/home-paths.cjs +1 -1
  29. package/dist-lib/host/bridge-host.cjs +59 -10
  30. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  31. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  32. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  33. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  34. package/dist-lib/host/websocket-proxy.cjs +1 -1
  35. package/dist-lib/index.cjs +1 -1
  36. package/dist-lib/jump-to-source-babel.cjs +1 -1
  37. package/dist-lib/jump-to-source-native.cjs +1 -1
  38. package/dist-lib/kotlin-host.cjs +1 -1
  39. package/dist-lib/menu.cjs +1 -1
  40. package/dist-lib/menu.mjs +1 -1
  41. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  43. package/dist-lib/metro-production-bundle.cjs +1 -1
  44. package/dist-lib/metro-production-bundle.mjs +1 -1
  45. package/dist-lib/metro.cjs +1 -1
  46. package/dist-lib/native-app-identity.cjs +1 -1
  47. package/dist-lib/native-app-identity.mjs +1 -1
  48. package/dist-lib/native-firebase-metadata.cjs +1 -1
  49. package/dist-lib/native-firebase-metadata.mjs +1 -1
  50. package/dist-lib/plist.cjs +1 -1
  51. package/dist-lib/plist.mjs +1 -1
  52. package/dist-lib/profiles.cjs +1 -1
  53. package/dist-lib/public-brand.cjs +1 -1
  54. package/dist-lib/react-native-host-modules.cjs +1 -1
  55. package/dist-lib/react-native-host-modules.mjs +1 -1
  56. package/dist-lib/render-mode.cjs +1 -1
  57. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  58. package/dist-lib/sdk.cjs +1 -1
  59. package/dist-lib/sdk.mjs +1 -1
  60. package/dist-lib/skills.cjs +59 -10
  61. package/dist-lib/swift-compile.cjs +1 -1
  62. package/dist-lib/swift-compile.mjs +1 -1
  63. package/dist-lib/swift-package.cjs +1 -1
  64. package/dist-lib/swift-package.mjs +1 -1
  65. package/dist-lib/swift-submit.cjs +1 -1
  66. package/dist-lib/swift-submit.mjs +1 -1
  67. package/dist-lib/swift-toolchain.cjs +1 -1
  68. package/dist-lib/swift.cjs +1 -1
  69. package/dist-lib/vite-swift.cjs +59 -10
  70. package/dist-lib/vite.cjs +1 -1
  71. package/package.json +1 -1
  72. package/src/swift-binary-modules.ts +5 -2
  73. package/src/swift-package-manifest.ts +3 -0
  74. package/src/swift-packages.ts +3 -0
  75. package/src/swift-standin-emit.ts +31 -2
  76. package/src/swift-standins.ts +32 -5
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.784 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.786 | (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);
@@ -32777,6 +32785,24 @@ function emitSwiftStandin(graphs, options) {
32777
32785
  );
32778
32786
  continue;
32779
32787
  }
32788
+ if (raw2 && list2.includes("Hashable")) {
32789
+ if (leaf(member) === "hash(into:)") {
32790
+ emit(
32791
+ `${inner}public func hash(into hasher: inout Hasher) { hasher.combine(rawValue) }`
32792
+ );
32793
+ continue;
32794
+ }
32795
+ if (leaf(member) === "hashValue") {
32796
+ emit(`${inner}public var hashValue: Int { rawValue.hashValue }`);
32797
+ continue;
32798
+ }
32799
+ if (leaf(member).startsWith("==")) {
32800
+ emit(
32801
+ `${inner}public static func == (lhs: ${shape.name}${shape.generics}, rhs: ${shape.name}${shape.generics}) -> Bool { lhs.rawValue == rhs.rawValue }`
32802
+ );
32803
+ continue;
32804
+ }
32805
+ }
32780
32806
  emitMember(member, inner, {
32781
32807
  openOwner: false,
32782
32808
  inClass: false,
@@ -33014,7 +33040,7 @@ var STANDIN_EMIT_VERSION, TYPE_KINDS, MEMBER_KINDS, ACCESSOR_WORD, KEEP_EXTERNAL
33014
33040
  var init_swift_standin_emit = __esm({
33015
33041
  "src/swift-standin-emit.ts"() {
33016
33042
  "use strict";
33017
- STANDIN_EMIT_VERSION = "2";
33043
+ STANDIN_EMIT_VERSION = "3";
33018
33044
  TYPE_KINDS = /* @__PURE__ */ new Set([
33019
33045
  "swift.class",
33020
33046
  "swift.struct",
@@ -33156,7 +33182,10 @@ function locateXcframework(tree) {
33156
33182
  function xcframework(binary2) {
33157
33183
  if (!binary2.url && !binary2.dir.endsWith(".zip"))
33158
33184
  return { dir: binary2.dir, digest: treeDigest(binary2.dir) };
33159
- const dir = import_node_path16.default.join(cacheDir4, "archives", key(binary2.url ?? binary2.dir));
33185
+ if (binary2.url && (!binary2.checksum || !/^[a-f0-9]{64}$/i.test(binary2.checksum)))
33186
+ throw new Error("remote binary archive requires its Package.swift SHA-256 checksum");
33187
+ const expected = binary2.checksum?.toLowerCase();
33188
+ const dir = import_node_path16.default.join(cacheDir4, "archives", key(binary2.url ? expected : binary2.dir));
33160
33189
  const archive = import_node_path16.default.join(dir, "archive.zip");
33161
33190
  const fingerprint = import_node_path16.default.join(dir, ".fingerprint");
33162
33191
  const stored = (() => {
@@ -33186,13 +33215,20 @@ function xcframework(binary2) {
33186
33215
  return { dir: found2, digest: sha2 };
33187
33216
  }
33188
33217
  if (stored && import_node_fs16.default.existsSync(archive)) {
33218
+ const sha2 = (0, import_node_crypto7.createHash)("sha256").update(import_node_fs16.default.readFileSync(archive)).digest("hex");
33219
+ if (sha2 !== expected)
33220
+ throw new Error(`archive checksum ${sha2} is not the declared checksum ${expected}`);
33189
33221
  const found2 = locateXcframework(import_node_path16.default.join(dir, "tree"));
33190
- if (found2) return { dir: found2, digest: stored.sha };
33222
+ if (found2) return { dir: found2, digest: sha2 };
33191
33223
  }
33192
33224
  import_node_fs16.default.rmSync(dir, { recursive: true, force: true });
33193
33225
  import_node_fs16.default.mkdirSync(import_node_path16.default.join(dir, "tree"), { recursive: true });
33194
33226
  exec("curl", ["-fsSL", "--retry", "2", "-o", archive, binary2.url]);
33195
33227
  const sha = (0, import_node_crypto7.createHash)("sha256").update(import_node_fs16.default.readFileSync(archive)).digest("hex");
33228
+ if (sha !== expected) {
33229
+ import_node_fs16.default.rmSync(dir, { recursive: true, force: true });
33230
+ throw new Error(`archive checksum ${sha} is not the declared checksum ${expected}`);
33231
+ }
33196
33232
  exec("unzip", ["-q", archive, "-d", import_node_path16.default.join(dir, "tree")]);
33197
33233
  import_node_fs16.default.writeFileSync(fingerprint, JSON.stringify({ sha }));
33198
33234
  const found = locateXcframework(import_node_path16.default.join(dir, "tree"));
@@ -33446,7 +33482,13 @@ function splitDeclarators(statement, names) {
33446
33482
  throw new Error(
33447
33483
  `${names[0]} has an unexpected grouped declaration in ${JSON.stringify(statement.trim().slice(0, 80))}`
33448
33484
  );
33449
- let end = chunks[0].indexOf(names[0]);
33485
+ let end = -1;
33486
+ for (let at = 0; at < chunks[0].length; at++) {
33487
+ if (chunks[0].startsWith(names[0], at) && !identChar(chunks[0][at - 1]) && !identChar(chunks[0][at + names[0].length])) {
33488
+ end = at;
33489
+ break;
33490
+ }
33491
+ }
33450
33492
  if (end < 0) throw new Error(`${names[0]} names no declarator in its own declaration`);
33451
33493
  for (; ; ) {
33452
33494
  while (end > 0 && /[\s*]/.test(chunks[0][end - 1])) end--;
@@ -33589,7 +33631,7 @@ ${roots.map((file) => ` header "${file}"
33589
33631
  function standinGenerationInputs(binaries, toolchain) {
33590
33632
  const { moduleRoot, toolchainBin, release } = toolchain;
33591
33633
  const parts = [
33592
- "standin/v2",
33634
+ "standin/v3",
33593
33635
  toolchainBin,
33594
33636
  release,
33595
33637
  swiftModuleSdk(moduleRoot).wasmSdkId,
@@ -33604,10 +33646,17 @@ function standinGenerationInputs(binaries, toolchain) {
33604
33646
  binary2.target,
33605
33647
  binary2.source,
33606
33648
  binary2.url ?? "",
33649
+ binary2.checksum ?? "",
33607
33650
  xcframework(binary2).digest
33608
33651
  );
33609
33652
  } catch {
33610
- parts.push(binary2.target, binary2.source, binary2.url ?? "", "unreadable");
33653
+ parts.push(
33654
+ binary2.target,
33655
+ binary2.source,
33656
+ binary2.url ?? "",
33657
+ binary2.checksum ?? "",
33658
+ "unreadable"
33659
+ );
33611
33660
  }
33612
33661
  }
33613
33662
  return (0, import_node_crypto7.createHash)("sha256").update(parts.join("\0")).digest("hex");
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.784 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.786 | (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.784 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.786 | (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.784 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.786 | (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.784 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.786 | (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.784 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.786 | (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.784 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.786 | (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.784 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.786 | (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.784 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.786 | (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.784 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.786 | (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);
@@ -5152,6 +5160,24 @@ function emitSwiftStandin(graphs, options) {
5152
5160
  );
5153
5161
  continue;
5154
5162
  }
5163
+ if (raw2 && list2.includes("Hashable")) {
5164
+ if (leaf(member) === "hash(into:)") {
5165
+ emit(
5166
+ `${inner}public func hash(into hasher: inout Hasher) { hasher.combine(rawValue) }`
5167
+ );
5168
+ continue;
5169
+ }
5170
+ if (leaf(member) === "hashValue") {
5171
+ emit(`${inner}public var hashValue: Int { rawValue.hashValue }`);
5172
+ continue;
5173
+ }
5174
+ if (leaf(member).startsWith("==")) {
5175
+ emit(
5176
+ `${inner}public static func == (lhs: ${shape.name}${shape.generics}, rhs: ${shape.name}${shape.generics}) -> Bool { lhs.rawValue == rhs.rawValue }`
5177
+ );
5178
+ continue;
5179
+ }
5180
+ }
5155
5181
  emitMember(member, inner, {
5156
5182
  openOwner: false,
5157
5183
  inClass: false,
@@ -5483,7 +5509,10 @@ function locateXcframework(tree) {
5483
5509
  function xcframework(binary) {
5484
5510
  if (!binary.url && !binary.dir.endsWith(".zip"))
5485
5511
  return { dir: binary.dir, digest: treeDigest(binary.dir) };
5486
- const dir = import_node_path11.default.join(cacheDir3, "archives", key(binary.url ?? binary.dir));
5512
+ if (binary.url && (!binary.checksum || !/^[a-f0-9]{64}$/i.test(binary.checksum)))
5513
+ throw new Error("remote binary archive requires its Package.swift SHA-256 checksum");
5514
+ const expected = binary.checksum?.toLowerCase();
5515
+ const dir = import_node_path11.default.join(cacheDir3, "archives", key(binary.url ? expected : binary.dir));
5487
5516
  const archive = import_node_path11.default.join(dir, "archive.zip");
5488
5517
  const fingerprint = import_node_path11.default.join(dir, ".fingerprint");
5489
5518
  const stored = (() => {
@@ -5513,13 +5542,20 @@ function xcframework(binary) {
5513
5542
  return { dir: found2, digest: sha2 };
5514
5543
  }
5515
5544
  if (stored && import_node_fs11.default.existsSync(archive)) {
5545
+ const sha2 = (0, import_node_crypto6.createHash)("sha256").update(import_node_fs11.default.readFileSync(archive)).digest("hex");
5546
+ if (sha2 !== expected)
5547
+ throw new Error(`archive checksum ${sha2} is not the declared checksum ${expected}`);
5516
5548
  const found2 = locateXcframework(import_node_path11.default.join(dir, "tree"));
5517
- if (found2) return { dir: found2, digest: stored.sha };
5549
+ if (found2) return { dir: found2, digest: sha2 };
5518
5550
  }
5519
5551
  import_node_fs11.default.rmSync(dir, { recursive: true, force: true });
5520
5552
  import_node_fs11.default.mkdirSync(import_node_path11.default.join(dir, "tree"), { recursive: true });
5521
5553
  exec("curl", ["-fsSL", "--retry", "2", "-o", archive, binary.url]);
5522
5554
  const sha = (0, import_node_crypto6.createHash)("sha256").update(import_node_fs11.default.readFileSync(archive)).digest("hex");
5555
+ if (sha !== expected) {
5556
+ import_node_fs11.default.rmSync(dir, { recursive: true, force: true });
5557
+ throw new Error(`archive checksum ${sha} is not the declared checksum ${expected}`);
5558
+ }
5523
5559
  exec("unzip", ["-q", archive, "-d", import_node_path11.default.join(dir, "tree")]);
5524
5560
  import_node_fs11.default.writeFileSync(fingerprint, JSON.stringify({ sha }));
5525
5561
  const found = locateXcframework(import_node_path11.default.join(dir, "tree"));
@@ -5776,7 +5812,13 @@ function splitDeclarators(statement, names) {
5776
5812
  throw new Error(
5777
5813
  `${names[0]} has an unexpected grouped declaration in ${JSON.stringify(statement.trim().slice(0, 80))}`
5778
5814
  );
5779
- let end = chunks[0].indexOf(names[0]);
5815
+ let end = -1;
5816
+ for (let at = 0; at < chunks[0].length; at++) {
5817
+ if (chunks[0].startsWith(names[0], at) && !identChar(chunks[0][at - 1]) && !identChar(chunks[0][at + names[0].length])) {
5818
+ end = at;
5819
+ break;
5820
+ }
5821
+ }
5780
5822
  if (end < 0) throw new Error(`${names[0]} names no declarator in its own declaration`);
5781
5823
  for (; ; ) {
5782
5824
  while (end > 0 && /[\s*]/.test(chunks[0][end - 1])) end--;
@@ -5920,7 +5962,7 @@ var built = /* @__PURE__ */ new Map();
5920
5962
  function standinGenerationInputs(binaries, toolchain) {
5921
5963
  const { moduleRoot, toolchainBin, release } = toolchain;
5922
5964
  const parts = [
5923
- "standin/v2",
5965
+ "standin/v3",
5924
5966
  toolchainBin,
5925
5967
  release,
5926
5968
  swiftModuleSdk(moduleRoot).wasmSdkId,
@@ -5935,10 +5977,17 @@ function standinGenerationInputs(binaries, toolchain) {
5935
5977
  binary.target,
5936
5978
  binary.source,
5937
5979
  binary.url ?? "",
5980
+ binary.checksum ?? "",
5938
5981
  xcframework(binary).digest
5939
5982
  );
5940
5983
  } catch {
5941
- parts.push(binary.target, binary.source, binary.url ?? "", "unreadable");
5984
+ parts.push(
5985
+ binary.target,
5986
+ binary.source,
5987
+ binary.url ?? "",
5988
+ binary.checksum ?? "",
5989
+ "unreadable"
5990
+ );
5942
5991
  }
5943
5992
  }
5944
5993
  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.784 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.786 | (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.784",
3
+ "version": "0.1.786",
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)
@@ -660,6 +668,27 @@ export function emitSwiftStandin(
660
668
  )
661
669
  continue
662
670
  }
671
+ // a hashable raw-value struct hashes and equates by its raw
672
+ // value, which is what swift synthesizes when the graph spells
673
+ // the members out; without it any hashed use traps.
674
+ if (raw && list.includes('Hashable')) {
675
+ if (leaf(member) === 'hash(into:)') {
676
+ emit(
677
+ `${inner}public func hash(into hasher: inout Hasher) { hasher.combine(rawValue) }`,
678
+ )
679
+ continue
680
+ }
681
+ if (leaf(member) === 'hashValue') {
682
+ emit(`${inner}public var hashValue: Int { rawValue.hashValue }`)
683
+ continue
684
+ }
685
+ if (leaf(member).startsWith('==')) {
686
+ emit(
687
+ `${inner}public static func == (lhs: ${shape.name}${shape.generics}, rhs: ${shape.name}${shape.generics}) -> Bool { lhs.rawValue == rhs.rawValue }`,
688
+ )
689
+ continue
690
+ }
691
+ }
663
692
  emitMember(member, inner, {
664
693
  openOwner: false,
665
694
  inClass: false,
@@ -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')