peachsim 0.1.2433 → 0.1.2435

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 (97) hide show
  1. package/cli/app-project.ts +5 -0
  2. package/cli/commands/box.ts +3 -0
  3. package/cli/commands/control.ts +14 -6
  4. package/cli/commands/platform.ts +3 -3
  5. package/cli/commands/stream.ts +8 -1
  6. package/dist-lib/agent-daemon-client.cjs +1 -1
  7. package/dist-lib/agent-events.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/bundle-channel.cjs +109 -38
  19. package/dist-lib/capture-contract.cjs +1 -1
  20. package/dist-lib/capture-contract.mjs +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/config.mjs +1 -1
  29. package/dist-lib/detox/index.cjs +1 -1
  30. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  31. package/dist-lib/expo-swift-bundle.cjs +99 -28
  32. package/dist-lib/expo-swift-metadata.cjs +1 -1
  33. package/dist-lib/expo-swift-metadata.mjs +1 -1
  34. package/dist-lib/home-paths.cjs +1 -1
  35. package/dist-lib/host/bridge-host.cjs +100 -29
  36. package/dist-lib/host/fetch-proxy-handler.cjs +4 -3
  37. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  38. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  39. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  40. package/dist-lib/host/websocket-proxy.cjs +1 -1
  41. package/dist-lib/index.cjs +15 -6
  42. package/dist-lib/jump-to-source-babel.cjs +1 -1
  43. package/dist-lib/jump-to-source-native.cjs +1 -1
  44. package/dist-lib/kotlin-host.cjs +1 -1
  45. package/dist-lib/menu.cjs +1 -1
  46. package/dist-lib/menu.mjs +1 -1
  47. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  48. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  49. package/dist-lib/metro-production-bundle.cjs +1 -1
  50. package/dist-lib/metro-production-bundle.mjs +1 -1
  51. package/dist-lib/metro.cjs +15 -6
  52. package/dist-lib/native-app-identity-project.cjs +13 -5
  53. package/dist-lib/native-app-identity-project.mjs +13 -5
  54. package/dist-lib/native-app-identity.cjs +1 -1
  55. package/dist-lib/native-app-identity.mjs +1 -1
  56. package/dist-lib/native-firebase-metadata.cjs +1 -1
  57. package/dist-lib/native-firebase-metadata.mjs +1 -1
  58. package/dist-lib/pdfium-raster.cjs +1 -1
  59. package/dist-lib/pdfium-raster.mjs +1 -1
  60. package/dist-lib/plist.cjs +1 -1
  61. package/dist-lib/plist.mjs +1 -1
  62. package/dist-lib/profiles.cjs +1 -1
  63. package/dist-lib/public-brand.cjs +1 -1
  64. package/dist-lib/public-origins-lib-esm.json +25 -25
  65. package/dist-lib/public-origins-lib.json +56 -56
  66. package/dist-lib/react-native-host-modules.cjs +1 -1
  67. package/dist-lib/react-native-host-modules.mjs +1 -1
  68. package/dist-lib/reap-browser.cjs +1 -1
  69. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  70. package/dist-lib/sdk.cjs +1 -1
  71. package/dist-lib/sdk.mjs +1 -1
  72. package/dist-lib/skills.cjs +122 -39
  73. package/dist-lib/swift-compile.cjs +78 -25
  74. package/dist-lib/swift-compile.mjs +78 -25
  75. package/dist-lib/swift-package.cjs +1 -1
  76. package/dist-lib/swift-package.mjs +1 -1
  77. package/dist-lib/swift-submit.cjs +1 -1
  78. package/dist-lib/swift-submit.mjs +1 -1
  79. package/dist-lib/swift-toolchain.cjs +1 -1
  80. package/dist-lib/swift.cjs +1 -1
  81. package/dist-lib/vite-swift.cjs +101 -31
  82. package/dist-lib/vite.cjs +4 -3
  83. package/dist-lib/worklet-executable.cjs +1 -1
  84. package/dist-lib/worklet-executable.mjs +1 -1
  85. package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
  86. package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +2 -2
  87. package/kotlin/sdk.tar.gz +0 -0
  88. package/package.json +1 -1
  89. package/src/bazel-project.ts +11 -3
  90. package/src/react-native-coverage/native-typescript-parser.ts +29 -1
  91. package/src/swift-compile.ts +49 -5
  92. package/src/swift-guest-image-ledger.ts +15 -12
  93. package/src/swift-guest-link.ts +13 -2
  94. package/src/swift-guest-source-inputs.ts +5 -1
  95. package/src/swift-host.ts +12 -0
  96. package/src/swift-submit.ts +2 -0
  97. package/src/swift-wasm-prune.ts +8 -3
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2433 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2435 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -11663,7 +11663,11 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
11663
11663
  const def = definedGlobalSyms.get(symName);
11664
11664
  if (def) activateSymbolInObj(def.obj, def.symIdx);
11665
11665
  }
11666
- for (const symName of ["__peach_dlsym_from_image", "__peach_dlerror"]) {
11666
+ for (const symName of [
11667
+ "__peach_dlsym_from_image",
11668
+ "__peach_dlerror",
11669
+ ...link ? ["_dyld_register_func_for_add_image"] : []
11670
+ ]) {
11667
11671
  const provider = lazyProviders.get(symName)?.[0];
11668
11672
  if (provider) extractObject(provider);
11669
11673
  const def = definedGlobalSyms.get(symName);
@@ -12216,7 +12220,7 @@ function readString(bytes, position) {
12216
12220
  const [length, start] = readNumber(bytes, position);
12217
12221
  if (start + length > bytes.length) throw new Error("invalid wasm string");
12218
12222
  return [
12219
- Buffer.from(bytes.subarray(start, start + length)).toString("utf8"),
12223
+ Buffer.from(bytes.buffer, bytes.byteOffset + start, length).toString("utf8"),
12220
12224
  start + length
12221
12225
  ];
12222
12226
  }
@@ -12243,7 +12247,7 @@ var OBJC_LOAD_FUNCTION = ".objcv2_load_function";
12243
12247
  function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLookups, preserveCanonical) {
12244
12248
  if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
12245
12249
  throw new Error("expected wasm object");
12246
- const sections2 = [Buffer.from(bytes.subarray(0, 8))];
12250
+ const sections2 = binding ? [Buffer.from(bytes.subarray(0, 8))] : void 0;
12247
12251
  const types = [];
12248
12252
  const functionTypes = [];
12249
12253
  const definitions = [];
@@ -12257,8 +12261,9 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
12257
12261
  const [size, start] = readNumber(bytes, position);
12258
12262
  const end = start + size;
12259
12263
  if (end > bytes.length) throw new Error("invalid wasm section");
12260
- let section = Buffer.from(bytes.subarray(start, end));
12261
12264
  position = end;
12265
+ if (!sections2 && id > 3) continue;
12266
+ let section = Buffer.from(bytes.buffer, bytes.byteOffset + start, size);
12262
12267
  let offset = 0;
12263
12268
  const number3 = () => {
12264
12269
  const [value, next] = readNumber(section, offset);
@@ -12286,7 +12291,7 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
12286
12291
  }
12287
12292
  } else if (id === 2) {
12288
12293
  const count = number3();
12289
- const imports2 = [encodeNumber(count)];
12294
+ const imports2 = sections2 ? [encodeNumber(count)] : void 0;
12290
12295
  for (let i = 0; i < count; i++) {
12291
12296
  const module2 = string4();
12292
12297
  const name3 = string4();
@@ -12330,17 +12335,17 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
12330
12335
  }
12331
12336
  if (isDlsym) usesDlsym = true;
12332
12337
  if (isDlerror) usesDlerror = true;
12333
- imports2.push(
12338
+ imports2?.push(
12334
12339
  encodedString(module2),
12335
12340
  encodedString(
12336
- isDlsym ? callerAlias : isDlerror ? "__peach_dlerror" : module2 === "env" && name3 !== "dlsym" && name3 !== "dlerror" ? binding(name3) ?? name3 : name3
12341
+ isDlsym ? callerAlias : isDlerror ? "__peach_dlerror" : module2 === "env" && name3 !== "dlsym" && name3 !== "dlerror" ? binding?.(name3) ?? name3 : name3
12337
12342
  ),
12338
12343
  Buffer.from([kind]),
12339
12344
  section.subarray(typeStart, offset)
12340
12345
  );
12341
12346
  }
12342
12347
  if (offset !== section.length) throw new Error("invalid wasm import section");
12343
- section = Buffer.concat(imports2);
12348
+ if (imports2) section = Buffer.concat(imports2);
12344
12349
  } else if (id === 3) {
12345
12350
  const count = number3();
12346
12351
  for (let i = 0; i < count; i++) functionTypes.push(number3());
@@ -12424,7 +12429,7 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
12424
12429
  encodedString(name3 === "dlsym" ? callerAlias : "__peach_dlerror"),
12425
12430
  section.subarray(nameEnd, offset)
12426
12431
  );
12427
- } else if (flags & 16 && name3 !== "dlsym" && name3 !== "dlerror" && binding(name3) !== void 0) {
12432
+ } else if (flags & 16 && name3 !== "dlsym" && name3 !== "dlerror" && binding?.(name3) !== void 0) {
12428
12433
  entries.push(
12429
12434
  section.subarray(begin, nameStart),
12430
12435
  encodedString(binding(name3)),
@@ -12499,10 +12504,10 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
12499
12504
  section = Buffer.concat(parts);
12500
12505
  }
12501
12506
  }
12502
- sections2.push(Buffer.from([id]), encodeNumber(section.length), section);
12507
+ sections2?.push(Buffer.from([id]), encodeNumber(section.length), section);
12503
12508
  }
12504
12509
  return {
12505
- bytes: Buffer.concat(sections2),
12510
+ bytes: sections2 ? Buffer.concat(sections2) : bytes,
12506
12511
  definitions,
12507
12512
  functionImports,
12508
12513
  usesDlsym,
@@ -12558,7 +12563,7 @@ function createGuestImageLedger(input) {
12558
12563
  object4.bytes,
12559
12564
  aliases,
12560
12565
  `__peach_dlsym_caller_${image.id}`,
12561
- () => void 0,
12566
+ void 0,
12562
12567
  object4.instrumentDynamicLookups,
12563
12568
  /* @__PURE__ */ new Set()
12564
12569
  );
@@ -15154,13 +15159,21 @@ function verifyGuestSymbolScopes(options) {
15154
15159
  continue;
15155
15160
  if (!scope2.includes(provider)) {
15156
15161
  const candidates = options.definitionObjects.get(symbol2) ?? /* @__PURE__ */ new Set();
15157
- const providers = [...record2.providers.keys()];
15162
+ const traced = [...record2.providers.keys()];
15163
+ const strongTraced = traced.filter(
15164
+ (definer) => !options.weakDefinitions.get(definer)?.has(symbol2)
15165
+ );
15166
+ const providers = strongTraced.length === 1 ? strongTraced : traced;
15158
15167
  if (options.weakReferences.get(object4)?.has(symbol2) && !providers.some((provider2) => options.systemProviders.has(provider2)))
15159
15168
  continue;
15160
15169
  const equivalentCopies = providers.length === 1 && candidates.has(providers[0]) && [...candidates].every(
15161
15170
  (definer) => options.weakDefinitions.get(definer)?.has(symbol2)
15162
15171
  );
15163
- if (!equivalentCopies && (candidates.size !== 1 || providers.length !== 1 || !candidates.has(providers[0]) || !(options.systemProviders.has(providers[0]) || // a strong undefined reference binds through the process global
15172
+ const strongCandidates = [...candidates].filter(
15173
+ (definer) => !options.weakDefinitions.get(definer)?.has(symbol2)
15174
+ );
15175
+ const soleCandidate = candidates.size === 1 || strongCandidates.length === 1 && strongCandidates[0] === providers[0];
15176
+ if (!equivalentCopies && (!soleCandidate || providers.length !== 1 || !candidates.has(providers[0]) || !(options.systemProviders.has(providers[0]) || // a strong undefined reference binds through the process global
15164
15177
  // scope, the root image and its dependency closure, as in elf.
15165
15178
  provider === 0 || callers.get(0)?.includes(provider) || !options.weakReferences.get(object4)?.has(symbol2) && options.frameworkProviders.get(object4)?.has(providers[0]))))
15166
15179
  throw new Error(
@@ -15308,6 +15321,11 @@ var import_node_child_process12 = require("node:child_process");
15308
15321
  var import_node_crypto10 = require("node:crypto");
15309
15322
  var import_node_fs17 = require("node:fs");
15310
15323
  var import_node_path17 = __toESM(require("node:path"), 1);
15324
+
15325
+ // src/forked-script-contract.ts
15326
+ var PEACH_FORKED_SCRIPT_ENV = "PEACH_RUNS_FORKED_SCRIPTS";
15327
+
15328
+ // src/swift-guest-source-inputs.ts
15311
15329
  function clangIrLinkOptions(ir) {
15312
15330
  const list2 = /^!llvm\.linker\.options = !\{([^\n]*)\}$/m.exec(ir);
15313
15331
  if (!list2) {
@@ -15428,10 +15446,13 @@ function sourceGuestClangLinkOptions(options) {
15428
15446
  plan,
15429
15447
  JSON.stringify(replays.map(({ compiler, args }) => [compiler, ...args]))
15430
15448
  );
15431
- (0, import_node_child_process12.execFileSync)(process.execPath, ["-e", PARALLEL_REPLAY], {
15449
+ const script = import_node_path17.default.join(options.directory, "clang-link-replay.cjs");
15450
+ (0, import_node_fs17.writeFileSync)(script, PARALLEL_REPLAY);
15451
+ (0, import_node_child_process12.execFileSync)(process.execPath, [script], {
15432
15452
  stdio: "inherit",
15433
15453
  env: {
15434
15454
  ...process.env,
15455
+ [PEACH_FORKED_SCRIPT_ENV]: "1",
15435
15456
  PEACH_CLANG_REPLAYS: plan,
15436
15457
  PEACH_CLANG_JOBS: String(options.jobs)
15437
15458
  }
@@ -16727,11 +16748,6 @@ var import_node_crypto12 = require("node:crypto");
16727
16748
  var import_node_fs22 = require("node:fs");
16728
16749
  var import_node_http = require("node:http");
16729
16750
  var import_node_path22 = __toESM(require("node:path"), 1);
16730
-
16731
- // src/forked-script-contract.ts
16732
- var PEACH_FORKED_SCRIPT_ENV = "PEACH_RUNS_FORKED_SCRIPTS";
16733
-
16734
- // src/swift-header-compiler.ts
16735
16751
  var SWIFT_HEADER_COMPILER_WRAPPER = ".build/peach-swiftc";
16736
16752
  var argument = (value) => `'${value.replaceAll("'", `'"'"'`)}'`;
16737
16753
  var client = `const { request } = require('node:http')
@@ -19002,7 +19018,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
19002
19018
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
19003
19019
  var MULTI_MANIFEST_VERSION = 72;
19004
19020
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
19005
- var compilerSourceDigest = true ? "cdc5ec2138bb4a158f783cf86ed87144cd455551e18374805c743783ac04aa46" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
19021
+ var compilerSourceDigest = true ? "4a6e02699924195639b15c5cdfd8852b5f17fb2ffacb8f9f964ef3daeee8b9dc" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
19006
19022
  function swiftArtifactHash(input, release, moduleRoot) {
19007
19023
  const hash = (0, import_node_crypto15.createHash)("sha256");
19008
19024
  hash.update(`swift-compile
@@ -19054,6 +19070,8 @@ ${WASM_LOWER_IDENTITY}
19054
19070
  hash.update(JSON.stringify(input.staticClangTargets ?? []));
19055
19071
  hash.update(JSON.stringify(input.headerAliases ?? {}));
19056
19072
  hash.update(JSON.stringify(input.packageGuestImports ?? []));
19073
+ if (input.packageHostMacros?.length)
19074
+ hash.update("package-host-macros\n" + JSON.stringify(input.packageHostMacros));
19057
19075
  if (input.defaultLocalization)
19058
19076
  hash.update(`default-localization
19059
19077
  ${input.defaultLocalization}
@@ -22994,6 +23012,7 @@ ${args.frameworkKey}`, scratch2, [
22994
23012
  };
22995
23013
  }
22996
23014
  var SWIFT_LINK_STAMP = ".peach-link-stamp";
23015
+ var SWIFT_HOST_COMPILER_WRAPPER = ".peach-swiftc";
22997
23016
  var SWIFT_FRAMEWORK_SLOTS = 8;
22998
23017
  var SWIFT_FRAMEWORK_SLOT_KEY = ".peach-framework-key";
22999
23018
  var SWIFT_FRAMEWORK_SLOT_ORIGIN = ".peach-framework-origin";
@@ -23151,6 +23170,8 @@ function swiftLinkStamp(args) {
23151
23170
  hash.update(`swift-link/v1
23152
23171
  ${args.frameworkKey}
23153
23172
  `);
23173
+ if (args.packageHostMacros?.length)
23174
+ hash.update("package-host-macros\n" + JSON.stringify(args.packageHostMacros));
23154
23175
  if (!args.prebuilt) return hash.digest("hex");
23155
23176
  const statOf = (file) => {
23156
23177
  const stat = (0, import_node_fs29.statSync)(file, { bigint: true });
@@ -23375,11 +23396,13 @@ function compileSwiftProjectOnce(input, options) {
23375
23396
  });
23376
23397
  }
23377
23398
  if (options.project) removeProjectLinks(root);
23399
+ const packageHostMacros = process.platform === "linux" ? input.packageHostMacros : void 0;
23378
23400
  if (retireStaleSwiftLink(
23379
23401
  root,
23380
23402
  swiftLinkStamp({
23381
23403
  frameworkKey,
23382
- prebuilt
23404
+ prebuilt,
23405
+ packageHostMacros
23383
23406
  })
23384
23407
  ))
23385
23408
  report("framework revision changed; rebuilding the app link");
@@ -23402,8 +23425,38 @@ function compileSwiftProjectOnce(input, options) {
23402
23425
  ).product.name
23403
23426
  ] : []
23404
23427
  );
23405
- const projectProcess = options.project ? prepareSwiftProjectProcess(root, options.project) : void 0;
23406
23428
  const compiler = preparation.targetToolset ? { CC: import_node_path30.default.join(root, CLANG_TARGET_MODULE_WRAPPER) } : {};
23429
+ if (packageHostMacros?.length) {
23430
+ const swiftc = import_node_path30.default.join(root, SWIFT_HOST_COMPILER_WRAPPER);
23431
+ writeBuildFile(
23432
+ swiftc,
23433
+ [
23434
+ "#!/bin/sh",
23435
+ "target=",
23436
+ "module=",
23437
+ "compile=",
23438
+ "previous=",
23439
+ "for argument do",
23440
+ ' case "$previous" in -target) target=$argument ;; -module-name) module=$argument ;; esac',
23441
+ ' case "$argument" in -c|-emit-module|-scan-dependencies|-typecheck) compile=1 ;; esac',
23442
+ " previous=$argument",
23443
+ "done",
23444
+ 'case "$target/$compile" in',
23445
+ " *-*-linux*/1)",
23446
+ ' case ",$PEACH_SWIFT_HOST_MACROS," in',
23447
+ ' *",$module,"*) set -- "$@" -Xfrontend -import-module -Xfrontend Foundation ;;',
23448
+ " esac ;;",
23449
+ "esac",
23450
+ 'exec "$PEACH_SWIFTC" "$@"',
23451
+ ""
23452
+ ].join("\n")
23453
+ );
23454
+ (0, import_node_fs29.chmodSync)(swiftc, 493);
23455
+ compiler.SWIFT_EXEC = swiftc;
23456
+ compiler.PEACH_SWIFT_HOST_MACROS = packageHostMacros.join(",");
23457
+ compiler.PEACH_SWIFTC = import_node_path30.default.join(options.toolchainBin, "swiftc");
23458
+ }
23459
+ const projectProcess = options.project ? prepareSwiftProjectProcess(root, options.project) : void 0;
23407
23460
  const appOptions = projectProcess ? {
23408
23461
  ...buildOptions,
23409
23462
  uid: projectProcess.uid,
@@ -23758,7 +23811,7 @@ function compileSwiftProjectOnce(input, options) {
23758
23811
  releaseDirectory: import_node_path30.default.dirname(linked),
23759
23812
  moduleRoot: frameworkRoot,
23760
23813
  toolchainBin: options.toolchainBin,
23761
- swiftCompiler: preparation.headerCompiler ? import_node_path30.default.join(root, SWIFT_HEADER_COMPILER_WRAPPER) : import_node_path30.default.join(options.toolchainBin, "swiftc"),
23814
+ swiftCompiler: preparation.headerCompiler ? import_node_path30.default.join(root, SWIFT_HEADER_COMPILER_WRAPPER) : compiler.SWIFT_EXEC ?? import_node_path30.default.join(options.toolchainBin, "swiftc"),
23762
23815
  sysroot: swiftSdkPaths(frameworkRoot, options.toolchainBin).sysroot,
23763
23816
  sdk: swiftModuleSdk(frameworkRoot),
23764
23817
  staticClangTargets: input.staticClangTargets ?? [],
@@ -26572,7 +26625,7 @@ function configurationFlags(configuration) {
26572
26625
  "--action_env=PATH"
26573
26626
  ];
26574
26627
  }
26575
- var GRAPH_FORMAT = 4;
26628
+ var GRAPH_FORMAT = 6;
26576
26629
  function bazelGraph(root, label, configuration) {
26577
26630
  const key2 = JSON.stringify([root, label, configuration]);
26578
26631
  const cached = graphs.get(key2);
@@ -26596,8 +26649,10 @@ function bazelGraph(root, label, configuration) {
26596
26649
  );
26597
26650
  const deps = app2.attrs.get("deps")?.list ?? [];
26598
26651
  if (deps.length === 0) throw new Error(`${label} links no libraries`);
26652
+ const strings = app2.attrs.get("strings")?.list ?? [];
26599
26653
  const infoplists = app2.attrs.get("infoplists")?.list ?? [];
26600
- const query = `kind("${QUERIED_RULES.join("|")}", deps(set(${deps.join(" ")})))${infoplists.length > 0 ? ` + set(${infoplists.join(" ")})` : ""}`;
26654
+ const roots = [...deps, ...strings];
26655
+ const query = `kind("${QUERIED_RULES.join("|")}", deps(set(${roots.join(" ")})))${infoplists.length > 0 ? ` + set(${infoplists.join(" ")})` : ""}`;
26601
26656
  const output2 = run5(["cquery", query, ...flags, "--output=jsonproto"]);
26602
26657
  const defaults = run5([
26603
26658
  "cquery",
@@ -27027,8 +27082,14 @@ ${published.map(
27027
27082
  graph.app.attrs.get("infoplists")?.list ?? [],
27028
27083
  graph.app.label
27029
27084
  );
27085
+ const strings = files2.expand(
27086
+ graph.app.attrs.get("strings")?.list ?? [],
27087
+ graph.app.label
27088
+ );
27089
+ resources.push(...strings);
27030
27090
  const absent = () => [
27031
27091
  ...infoPlistFiles,
27092
+ ...strings,
27032
27093
  ...[...frameworks, appModule].flatMap((module2) => [
27033
27094
  ...module2.allSources,
27034
27095
  ...module2.objc?.headers ?? []
@@ -27072,7 +27133,7 @@ ${published.map(
27072
27133
  const missing = options.requireSources === false ? [] : absent();
27073
27134
  if (missing.length > 0)
27074
27135
  throw new Error(
27075
- `bazel generates ${missing.length} sources this app compiles that are not built: ${missing.slice(0, 5).map((file) => import_node_path33.default.relative(root, file)).join(", ")}`
27136
+ `bazel application has ${missing.length} unbuilt inputs: ${missing.slice(0, 5).map((file) => import_node_path33.default.relative(root, file)).join(", ")}`
27076
27137
  );
27077
27138
  const archives = /* @__PURE__ */ new Map();
27078
27139
  for (const rule of order) {
@@ -34880,7 +34941,7 @@ function sourceClosureDigest(srcDir, entrypoints, excludedFiles) {
34880
34941
  return hash.digest("hex");
34881
34942
  }
34882
34943
  var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
34883
- var STANDIN_SOURCE_DIGEST = true ? "edbd6d6714a42d5d22c4d8b74e605e5c897358beb450af3e5605c81299e68531" : standinSourceDigest();
34944
+ var STANDIN_SOURCE_DIGEST = true ? "2517dacc106de8d2cadefded667b8502b029a35f04f5453646eb48792e0fb55c" : standinSourceDigest();
34884
34945
 
34885
34946
  // src/swift-standins.ts
34886
34947
  var import_node_child_process32 = require("node:child_process");
@@ -42275,6 +42336,13 @@ function packageSnapshot(project, entry, moduleRoot) {
42275
42336
  ...Object.keys(projectFiles).length > 0 ? { projectFiles } : {},
42276
42337
  ...Object.keys(packageFiles2).length > 0 ? {
42277
42338
  packageFiles: packageFiles2,
42339
+ packageHostMacros: [
42340
+ ...new Set(
42341
+ (layout2?.packages.nativePackages ?? []).flatMap(
42342
+ ({ manifest }) => [...manifest.targets.values()].filter((target) => target.type === "macro").map((target) => swiftTargetModuleName(target.name))
42343
+ )
42344
+ )
42345
+ ].sort(),
42278
42346
  packageGuestImports: [
42279
42347
  ...new Set(
42280
42348
  (layout2?.packages.nativePackages ?? []).flatMap(
@@ -42341,7 +42409,8 @@ function snapshotCompileInput(snapshot) {
42341
42409
  files: snapshot.files,
42342
42410
  ...snapshot.packageFiles ? {
42343
42411
  packageFiles: snapshot.packageFiles,
42344
- packageGuestImports: snapshot.packageGuestImports
42412
+ packageGuestImports: snapshot.packageGuestImports,
42413
+ packageHostMacros: snapshot.packageHostMacros
42345
42414
  } : {},
42346
42415
  ...snapshot.projectFiles ? { projectFiles: snapshot.projectFiles } : {},
42347
42416
  ...snapshot.nativeTargets ? { nativeTargets: snapshot.nativeTargets } : {},
@@ -42614,7 +42683,8 @@ async function compileRemote(packagePath, snapshot, hosted, ownerSignal) {
42614
42683
  files: snapshot.files,
42615
42684
  ...snapshot.packageFiles ? {
42616
42685
  packageFiles: snapshot.packageFiles,
42617
- packageGuestImports: snapshot.packageGuestImports
42686
+ packageGuestImports: snapshot.packageGuestImports,
42687
+ packageHostMacros: snapshot.packageHostMacros
42618
42688
  } : {},
42619
42689
  ...snapshot.nativeTargets ? { nativeTargets: snapshot.nativeTargets } : {},
42620
42690
  ...snapshot.sourceLinkGraph ? { sourceLinkGraph: snapshot.sourceLinkGraph } : {},
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2433 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2435 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -4392,7 +4392,7 @@ var STANDIN_SOURCE_DIGEST;
4392
4392
  var init_swift_standin_digest = __esm({
4393
4393
  "src/swift-standin-digest.ts"() {
4394
4394
  "use strict";
4395
- STANDIN_SOURCE_DIGEST = true ? "edbd6d6714a42d5d22c4d8b74e605e5c897358beb450af3e5605c81299e68531" : standinSourceDigest();
4395
+ STANDIN_SOURCE_DIGEST = true ? "2517dacc106de8d2cadefded667b8502b029a35f04f5453646eb48792e0fb55c" : standinSourceDigest();
4396
4396
  }
4397
4397
  });
4398
4398
 
@@ -5511,6 +5511,7 @@ var init_swift_guest_link = __esm({
5511
5511
  var init_swift_guest_source_inputs = __esm({
5512
5512
  "src/swift-guest-source-inputs.ts"() {
5513
5513
  "use strict";
5514
+ init_forked_script_contract();
5514
5515
  init_swift_guest_source_plan();
5515
5516
  init_swift_runtime_products();
5516
5517
  }
@@ -5822,7 +5823,7 @@ var init_swift_compile = __esm({
5822
5823
  FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
5823
5824
  (module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
5824
5825
  ).join("");
5825
- compilerSourceDigest = true ? "cdc5ec2138bb4a158f783cf86ed87144cd455551e18374805c743783ac04aa46" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
5826
+ compilerSourceDigest = true ? "4a6e02699924195639b15c5cdfd8852b5f17fb2ffacb8f9f964ef3daeee8b9dc" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
5826
5827
  C_WORDS = new Set(
5827
5828
  "auto bool break case char const continue default do double else enum extern false float for goto if inline int long register restrict return short signed sizeof static struct switch true typedef union unsigned void volatile while YES NO NULL nil Nil id self super instancetype".split(
5828
5829
  " "
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2433 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2435 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2433 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2435 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __typeError = (msg) => {
4
4
  throw TypeError(msg);
@@ -555,6 +555,7 @@ export declare class SootSimNode extends NativeNodeRecord {
555
555
  x: number;
556
556
  y: number;
557
557
  };
558
+ getTranslatedPositionIn(ancestor: SootSimNode): NodePoint | null;
558
559
  getAbsolutePosition(options?: {
559
560
  ignorePresentationLayerTransforms?: boolean;
560
561
  ignoreSelfTransform?: boolean;
@@ -135,7 +135,7 @@ export type CanvasMapSection = {
135
135
  screenIds: string[];
136
136
  sectionIds: string[];
137
137
  };
138
- outline?: 'bounds';
138
+ outline?: 'bounds' | 'none';
139
139
  dragFromBody?: boolean;
140
140
  fitInsets?: {
141
141
  horizontal: number;
@@ -238,7 +238,7 @@ export type CanvasMapTap = {
238
238
  y: number;
239
239
  };
240
240
  export type CanvasMapKey = 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'ArrowDown' | 'Enter' | 'Home';
241
- export type CanvasMapCommand = 'fit' | 'actual-size' | {
241
+ export type CanvasMapCommand = 'fit' | 'actual-size' | 'clear-selection' | {
242
242
  kind: 'agent';
243
243
  agent: CanvasMapAgent;
244
244
  } | {
package/kotlin/sdk.tar.gz CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.2433",
3
+ "version": "0.1.2435",
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",
@@ -167,7 +167,7 @@ function configurationFlags(configuration: string): string[] {
167
167
  }
168
168
 
169
169
  // the stored query's shape; a change to what bazelGraph asks for bumps it
170
- const GRAPH_FORMAT = 4
170
+ const GRAPH_FORMAT = 6
171
171
 
172
172
  function bazelGraph(root: string, label: string, configuration: string): BazelGraph {
173
173
  const key = JSON.stringify([root, label, configuration])
@@ -199,8 +199,10 @@ function bazelGraph(root: string, label: string, configuration: string): BazelGr
199
199
  )
200
200
  const deps = app.attrs.get('deps')?.list ?? []
201
201
  if (deps.length === 0) throw new Error(`${label} links no libraries`)
202
+ const strings = app.attrs.get('strings')?.list ?? []
202
203
  const infoplists = app.attrs.get('infoplists')?.list ?? []
203
- const query = `kind("${QUERIED_RULES.join('|')}", deps(set(${deps.join(' ')})))${infoplists.length > 0 ? ` + set(${infoplists.join(' ')})` : ''}`
204
+ const roots = [...deps, ...strings]
205
+ const query = `kind("${QUERIED_RULES.join('|')}", deps(set(${roots.join(' ')})))${infoplists.length > 0 ? ` + set(${infoplists.join(' ')})` : ''}`
204
206
  const output = run(['cquery', query, ...flags, '--output=jsonproto'])
205
207
  // a rule that declares its outputs in its implementation lists none in the
206
208
  // proto; its default outputs name them
@@ -740,9 +742,15 @@ export function readBazelAppTarget(
740
742
  graph.app.attrs.get('infoplists')?.list ?? [],
741
743
  graph.app.label,
742
744
  )
745
+ const strings = files.expand(
746
+ graph.app.attrs.get('strings')?.list ?? [],
747
+ graph.app.label,
748
+ )
749
+ resources.push(...strings)
743
750
  const absent = () =>
744
751
  [
745
752
  ...infoPlistFiles,
753
+ ...strings,
746
754
  ...[...frameworks, appModule].flatMap((module) => [
747
755
  ...module.allSources,
748
756
  ...(module.objc?.headers ?? []),
@@ -790,7 +798,7 @@ export function readBazelAppTarget(
790
798
  const missing = options.requireSources === false ? [] : absent()
791
799
  if (missing.length > 0)
792
800
  throw new Error(
793
- `bazel generates ${missing.length} sources this app compiles that are not built: ${missing
801
+ `bazel application has ${missing.length} unbuilt inputs: ${missing
794
802
  .slice(0, 5)
795
803
  .map((file) => path.relative(root, file))
796
804
  .join(', ')}`,
@@ -18,10 +18,38 @@ export type TypeScriptSourceParser = <T>(
18
18
  requestedSources?: Iterable<string>,
19
19
  ) => Promise<T>
20
20
 
21
+ const SOURCE_FILE_MEMO = new Map<string, { source: string; ast: SourceFile }>()
22
+ const MAX_SOURCE_FILE_MEMO = 8192
23
+
21
24
  export async function parseTypeScriptSources(
22
25
  files: ReadonlyMap<string, string>,
23
26
  ): Promise<Map<string, SourceFile>> {
24
- return withTypeScriptSourceParser((parse) => parse(files, async (sources) => sources))
27
+ const hits = new Map<string, SourceFile>()
28
+ const pending = new Map<string, string>()
29
+ for (const [path, source] of files) {
30
+ const cached = SOURCE_FILE_MEMO.get(path)
31
+ if (cached && cached.source === source) hits.set(path, cached.ast)
32
+ else pending.set(path, source)
33
+ }
34
+ if (pending.size === 0) return hits
35
+ const freshlyParsed = await withTypeScriptSourceParser((parse) =>
36
+ parse(pending, async (sources) => sources),
37
+ )
38
+ for (const [path, ast] of freshlyParsed) {
39
+ const source = pending.get(path)
40
+ if (source === undefined) continue
41
+ if (SOURCE_FILE_MEMO.size >= MAX_SOURCE_FILE_MEMO && !SOURCE_FILE_MEMO.has(path)) {
42
+ const oldest = SOURCE_FILE_MEMO.keys().next().value
43
+ if (oldest !== undefined) SOURCE_FILE_MEMO.delete(oldest)
44
+ }
45
+ SOURCE_FILE_MEMO.set(path, { source, ast })
46
+ }
47
+ const ordered = new Map<string, SourceFile>()
48
+ for (const path of files.keys()) {
49
+ const ast = hits.get(path) ?? freshlyParsed.get(path)
50
+ if (ast) ordered.set(path, ast)
51
+ }
52
+ return ordered
25
53
  }
26
54
 
27
55
  export async function withTypeScriptSourceParser<T>(
@@ -50,7 +50,9 @@ import {
50
50
  } from './swift-distribution-contract'
51
51
  import { foundationCategoryObjects } from './swift-foundation'
52
52
  import { compileGuestLink } from './swift-guest-compile'
53
- import { CLANG_TARGET_MODULE_WRAPPER } from './swift-guest-source-inputs'
53
+ import {
54
+ CLANG_TARGET_MODULE_WRAPPER,
55
+ } from './swift-guest-source-inputs'
54
56
  import {
55
57
  SWIFT_HEADER_COMPILER_WRAPPER,
56
58
  withSwiftHeaderCompiler,
@@ -307,6 +309,7 @@ export interface SwiftCompileInput {
307
309
  */
308
310
  projectFiles?: Record<string, string>
309
311
  packageGuestImports?: string[]
312
+ packageHostMacros?: string[]
310
313
  nativeTargets?: SwiftNativeTarget[]
311
314
  sourceLinkGraph?: SwiftSourceLinkGraph
312
315
  headerAliases?: SwiftHeaderAliases
@@ -1866,6 +1869,8 @@ export function swiftArtifactHash(
1866
1869
  hash.update(JSON.stringify(input.staticClangTargets ?? []))
1867
1870
  hash.update(JSON.stringify(input.headerAliases ?? {}))
1868
1871
  hash.update(JSON.stringify(input.packageGuestImports ?? []))
1872
+ if (input.packageHostMacros?.length)
1873
+ hash.update('package-host-macros\n' + JSON.stringify(input.packageHostMacros))
1869
1874
  if (input.defaultLocalization)
1870
1875
  hash.update(`default-localization\n${input.defaultLocalization}\n`)
1871
1876
  for (const file of Object.keys(input.packageFiles ?? {}).sort()) {
@@ -7240,6 +7245,7 @@ async function buildFrameworkProducts(
7240
7245
  // when it moves, so each revision compiles and links against its own objects
7241
7246
  // the way the builder's per-build-key roots do.
7242
7247
  const SWIFT_LINK_STAMP = '.peach-link-stamp'
7248
+ const SWIFT_HOST_COMPILER_WRAPPER = '.peach-swiftc'
7243
7249
 
7244
7250
  // stable slot paths preserve swiftpm's incremental products across checkout paths.
7245
7251
  const SWIFT_FRAMEWORK_SLOTS = 8
@@ -7441,9 +7447,12 @@ function stageFrameworkSource(
7441
7447
  function swiftLinkStamp(args: {
7442
7448
  frameworkKey: string
7443
7449
  prebuilt?: SwiftFrameworkProducts
7450
+ packageHostMacros?: string[]
7444
7451
  }): string {
7445
7452
  const hash = createHash('sha256')
7446
7453
  hash.update(`swift-link/v1\n${args.frameworkKey}\n`)
7454
+ if (args.packageHostMacros?.length)
7455
+ hash.update('package-host-macros\n' + JSON.stringify(args.packageHostMacros))
7447
7456
  if (!args.prebuilt) return hash.digest('hex')
7448
7457
  const statOf = (file: string) => {
7449
7458
  const stat = statSync(file, { bigint: true })
@@ -7717,12 +7726,15 @@ function compileSwiftProjectOnce(
7717
7726
  })
7718
7727
  }
7719
7728
  if (options.project) removeProjectLinks(root)
7729
+ const packageHostMacros =
7730
+ process.platform === 'linux' ? input.packageHostMacros : undefined
7720
7731
  if (
7721
7732
  retireStaleSwiftLink(
7722
7733
  root,
7723
7734
  swiftLinkStamp({
7724
7735
  frameworkKey,
7725
7736
  prebuilt,
7737
+ packageHostMacros,
7726
7738
  }),
7727
7739
  )
7728
7740
  )
@@ -7750,13 +7762,45 @@ function compileSwiftProjectOnce(
7750
7762
  ]
7751
7763
  : [],
7752
7764
  )
7753
- const projectProcess = options.project
7754
- ? prepareSwiftProjectProcess(root, options.project)
7755
- : undefined
7756
7765
  // the native build system takes its C compiler from CC, never a toolset
7757
7766
  const compiler: Record<string, string> = preparation.targetToolset
7758
7767
  ? { CC: path.join(root, CLANG_TARGET_MODULE_WRAPPER) }
7759
7768
  : {}
7769
+ if (packageHostMacros?.length) {
7770
+ // swiftpm build-tool flags skip macro targets; forward the import
7771
+ // when swiftpm compiles a declared macro for the linux host.
7772
+ const swiftc = path.join(root, SWIFT_HOST_COMPILER_WRAPPER)
7773
+ writeBuildFile(
7774
+ swiftc,
7775
+ [
7776
+ '#!/bin/sh',
7777
+ 'target=',
7778
+ 'module=',
7779
+ 'compile=',
7780
+ 'previous=',
7781
+ 'for argument do',
7782
+ ' case "$previous" in -target) target=$argument ;; -module-name) module=$argument ;; esac',
7783
+ ' case "$argument" in -c|-emit-module|-scan-dependencies|-typecheck) compile=1 ;; esac',
7784
+ ' previous=$argument',
7785
+ 'done',
7786
+ 'case "$target/$compile" in',
7787
+ ' *-*-linux*/1)',
7788
+ ' case ",$PEACH_SWIFT_HOST_MACROS," in',
7789
+ ' *",$module,"*) set -- "$@" -Xfrontend -import-module -Xfrontend Foundation ;;',
7790
+ ' esac ;;',
7791
+ 'esac',
7792
+ 'exec "$PEACH_SWIFTC" "$@"',
7793
+ '',
7794
+ ].join('\n'),
7795
+ )
7796
+ chmodSync(swiftc, 0o755)
7797
+ compiler.SWIFT_EXEC = swiftc
7798
+ compiler.PEACH_SWIFT_HOST_MACROS = packageHostMacros.join(',')
7799
+ compiler.PEACH_SWIFTC = path.join(options.toolchainBin, 'swiftc')
7800
+ }
7801
+ const projectProcess = options.project
7802
+ ? prepareSwiftProjectProcess(root, options.project)
7803
+ : undefined
7760
7804
  const appOptions = projectProcess
7761
7805
  ? {
7762
7806
  ...buildOptions,
@@ -8181,7 +8225,7 @@ function compileSwiftProjectOnce(
8181
8225
  toolchainBin: options.toolchainBin,
8182
8226
  swiftCompiler: preparation.headerCompiler
8183
8227
  ? path.join(root, SWIFT_HEADER_COMPILER_WRAPPER)
8184
- : path.join(options.toolchainBin, 'swiftc'),
8228
+ : compiler.SWIFT_EXEC ?? path.join(options.toolchainBin, 'swiftc'),
8185
8229
  sysroot: swiftSdkPaths(frameworkRoot, options.toolchainBin).sysroot,
8186
8230
  sdk: swiftModuleSdk(frameworkRoot),
8187
8231
  staticClangTargets: input.staticClangTargets ?? [],