peachsim 0.1.2251 → 0.1.2253

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 (95) hide show
  1. package/cli/bridge-flow-runner.ts +20 -13
  2. package/cli/commands/control.ts +6 -5
  3. package/cli/commands/inspect/core.ts +18 -3
  4. package/dist-lib/agent-daemon-client.cjs +1 -1
  5. package/dist-lib/agent-events.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 +6 -2
  13. package/dist-lib/bridge-contract-input.mjs +6 -2
  14. package/dist-lib/bridge-contract.cjs +1 -1
  15. package/dist-lib/bridge-contract.mjs +1 -1
  16. package/dist-lib/bundle-channel.cjs +23 -16
  17. package/dist-lib/capture-contract.cjs +1 -1
  18. package/dist-lib/capture-contract.mjs +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/config.mjs +1 -1
  27. package/dist-lib/detox/index.cjs +33 -24
  28. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  29. package/dist-lib/expo-swift-bundle.cjs +21 -14
  30. package/dist-lib/expo-swift-metadata.cjs +1 -1
  31. package/dist-lib/expo-swift-metadata.mjs +1 -1
  32. package/dist-lib/home-paths.cjs +1 -1
  33. package/dist-lib/host/bridge-host.cjs +65 -40
  34. package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
  35. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  36. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  37. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  38. package/dist-lib/host/websocket-proxy.cjs +1 -1
  39. package/dist-lib/index.cjs +31 -10
  40. package/dist-lib/jump-to-source-babel.cjs +1 -1
  41. package/dist-lib/jump-to-source-native.cjs +1 -1
  42. package/dist-lib/kotlin-host.cjs +1 -1
  43. package/dist-lib/menu.cjs +1 -1
  44. package/dist-lib/menu.mjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  46. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  47. package/dist-lib/metro-production-bundle.cjs +1 -1
  48. package/dist-lib/metro-production-bundle.mjs +1 -1
  49. package/dist-lib/metro.cjs +15 -6
  50. package/dist-lib/native-app-identity-project.cjs +2 -2
  51. package/dist-lib/native-app-identity-project.mjs +2 -2
  52. package/dist-lib/native-app-identity.cjs +1 -1
  53. package/dist-lib/native-app-identity.mjs +1 -1
  54. package/dist-lib/native-firebase-metadata.cjs +1 -1
  55. package/dist-lib/native-firebase-metadata.mjs +1 -1
  56. package/dist-lib/pdfium-raster.cjs +1 -1
  57. package/dist-lib/pdfium-raster.mjs +1 -1
  58. package/dist-lib/plist.cjs +1 -1
  59. package/dist-lib/plist.mjs +1 -1
  60. package/dist-lib/profiles.cjs +1 -1
  61. package/dist-lib/public-brand.cjs +1 -1
  62. package/dist-lib/public-origins-lib-esm.json +24 -24
  63. package/dist-lib/public-origins-lib.json +53 -53
  64. package/dist-lib/react-native-host-modules.cjs +1 -1
  65. package/dist-lib/react-native-host-modules.mjs +1 -1
  66. package/dist-lib/reap-browser.cjs +32 -23
  67. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  68. package/dist-lib/sdk.cjs +17 -5
  69. package/dist-lib/sdk.mjs +17 -5
  70. package/dist-lib/skills.cjs +108 -66
  71. package/dist-lib/swift-compile.cjs +12 -9
  72. package/dist-lib/swift-compile.mjs +12 -9
  73. package/dist-lib/swift-package.cjs +1 -1
  74. package/dist-lib/swift-package.mjs +1 -1
  75. package/dist-lib/swift-submit.cjs +1 -1
  76. package/dist-lib/swift-submit.mjs +1 -1
  77. package/dist-lib/swift-toolchain.cjs +1 -1
  78. package/dist-lib/swift.cjs +1 -1
  79. package/dist-lib/vite-swift.cjs +16 -11
  80. package/dist-lib/vite.cjs +15 -6
  81. package/dist-lib/worklet-executable.cjs +1 -1
  82. package/dist-lib/worklet-executable.mjs +1 -1
  83. package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
  84. package/dist-types/packages/peach-engine/src/engine/scroll-momentum-math.d.ts +1 -0
  85. package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +2 -0
  86. package/package.json +1 -1
  87. package/runtime-companion.json +1 -1
  88. package/src/bridge-contract-input.ts +5 -1
  89. package/src/bridge-contract.ts +2 -1
  90. package/src/chromium-admission.ts +37 -29
  91. package/src/one-sdk-preparation.ts +3 -3
  92. package/src/runtime-delivery.ts +3 -2
  93. package/src/swift-compile.ts +6 -1
  94. package/src/swift-host.ts +4 -1
  95. package/src/swift-wasm-prune.ts +10 -6
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2251 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2253 | (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;
@@ -10526,13 +10526,15 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
10526
10526
  };
10527
10527
  }
10528
10528
  function parseWasmObjectCached(file, isDist, useCache) {
10529
+ if (!useCache)
10530
+ return parseWasmObjectBytes(file, new Uint8Array(import_node_fs10.default.readFileSync(file)), isDist);
10529
10531
  const key2 = `${isDist ? "1" : "0"}:${file}`;
10530
- if (useCache) {
10531
- const hit = parsedObjectCache.get(key2);
10532
- if (hit) return hit;
10533
- }
10532
+ const stat = import_node_fs10.default.statSync(file, { bigint: true });
10533
+ const stamp = `${stat.ino}:${stat.size}:${stat.mtimeNs}:${stat.ctimeNs}`;
10534
+ const hit = parsedObjectCache.get(key2);
10535
+ if (hit?.stamp === stamp) return hit.parsed;
10534
10536
  const parsed = parseWasmObjectBytes(file, new Uint8Array(import_node_fs10.default.readFileSync(file)), isDist);
10535
- if (useCache) parsedObjectCache.set(key2, parsed);
10537
+ parsedObjectCache.set(key2, { stamp, parsed });
10536
10538
  return parsed;
10537
10539
  }
10538
10540
  function localizeDefinedWasmSymbols(bytes, names) {
@@ -17456,7 +17458,7 @@ function swiftCondition(text5, available) {
17456
17458
  if (name3 === "canImport")
17457
17459
  return argument !== "FoundationNetworking" && available?.has(argument);
17458
17460
  if (name3 === "targetEnvironment") return argument === "simulator";
17459
- if (name3 === "arch") return argument === "wasm64";
17461
+ if (name3 === "arch") return argument === "wasm64" || argument === "arm64";
17460
17462
  return void 0;
17461
17463
  };
17462
17464
  const both = () => {
@@ -17933,7 +17935,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
17933
17935
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
17934
17936
  var MULTI_MANIFEST_VERSION = 68;
17935
17937
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
17936
- var compilerSourceDigest = true ? "4a1be1d1296381c7090b5b2b704a7d2bebba03ceaa580613acd0f2c39c31ed4c" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
17938
+ var compilerSourceDigest = true ? "a0acd3d55350e702b64da3ee739e811f7963210d0eb97002ee7d2214bb99e47c" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
17937
17939
  function swiftArtifactHash(input, release, moduleRoot) {
17938
17940
  const hash = (0, import_node_crypto13.createHash)("sha256");
17939
17941
  hash.update(`swift-compile
@@ -18443,6 +18445,7 @@ function syncSwiftTree(base, files2) {
18443
18445
  }
18444
18446
  var DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
18445
18447
  var OS_IOS = /\b(?:os\(\s*iOS\s*\)|targetEnvironment\(\s*simulator\s*\))/g;
18448
+ var ARCH_ARM64 = /\barch\(\s*arm64\s*\)/g;
18446
18449
  var NOT_ON_IOS = /\b(?:os\(\s*WASI\s*\)|canImport\(\s*FoundationNetworking\s*\))/g;
18447
18450
  var DELEGATE_CLASS = /^class\s+[A-Za-z_]\w*\s*(?:<[^>{]*>)?\s*:[^{]*\b(?:UIApplicationDelegate|UISceneDelegate|UIWindowSceneDelegate)\b[^{]*\{/;
18448
18451
  function compiledSwiftSources(files2, targets, overlayFrameworks) {
@@ -19125,7 +19128,7 @@ function swiftConditionsAsIOS(source, lineStarts, swiftPackage) {
19125
19128
  const start = offset;
19126
19129
  offset += line.length + 1;
19127
19130
  if (!lineStarts.has(start) || !DIRECTIVE.test(line)) return line;
19128
- const platform = line.replace(OS_IOS, (match) => "true".padEnd(match.length)).replace(NOT_ON_IOS, (match) => "false".padEnd(match.length));
19131
+ const platform = line.replace(OS_IOS, (match) => "true".padEnd(match.length)).replace(ARCH_ARM64, (match) => "true".padEnd(match.length)).replace(NOT_ON_IOS, (match) => "false".padEnd(match.length));
19129
19132
  return swiftPackage === false ? platform.replace(/\bSWIFT_PACKAGE\b/g, (match) => "false".padEnd(match.length)) : platform;
19130
19133
  }).join("\n");
19131
19134
  }
@@ -31488,7 +31491,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
31488
31491
  return hash.digest("hex");
31489
31492
  }
31490
31493
  var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
31491
- var STANDIN_SOURCE_DIGEST = true ? "977c30e838b3cb068d200b9a9a12851b01d2192d0d04e2b5a6abe8189c168d42" : standinSourceDigest();
31494
+ var STANDIN_SOURCE_DIGEST = true ? "1f63cea9c23045599de30a6706e16844da16611e8d385fe31034727e8884380c" : standinSourceDigest();
31492
31495
 
31493
31496
  // src/swift-standins.ts
31494
31497
  var import_node_child_process31 = require("node:child_process");
@@ -37918,6 +37921,7 @@ function buildSwiftResourceTable(project, baseUrl, inputs) {
37918
37921
  let bytes;
37919
37922
  let ext = import_node_path54.default.posix.extname(file).toLowerCase();
37920
37923
  let uploadName = import_node_path54.default.posix.basename(file);
37924
+ let variantScale = scale;
37921
37925
  if (ext === ".pdf") {
37922
37926
  const pdfBytes = readPackageFile2(project.packagePath, disk, limits.imageBytes);
37923
37927
  const pdfHash = (0, import_node_crypto29.createHash)("sha256").update(pdfBytes).digest("hex");
@@ -37936,6 +37940,7 @@ function buildSwiftResourceTable(project, baseUrl, inputs) {
37936
37940
  const svg = ext === ".svg" ? rasterizeSvgFile(disk, (0, import_node_crypto29.createHash)("sha256").update(bytes).digest("hex")) : null;
37937
37941
  if (svg) {
37938
37942
  bytes = svg.bytes;
37943
+ variantScale = 3;
37939
37944
  ext = ".png";
37940
37945
  uploadName = `${import_node_path54.default.posix.basename(file, import_node_path54.default.posix.extname(file))}.png`;
37941
37946
  }
@@ -37949,7 +37954,7 @@ function buildSwiftResourceTable(project, baseUrl, inputs) {
37949
37954
  const variants = bundle[name3] ??= [];
37950
37955
  variants.push({
37951
37956
  uri: `${baseUrl}${RESOURCE_PATH}${hash}${ext}`,
37952
- scale,
37957
+ scale: variantScale,
37953
37958
  ...renderingMode ? { renderingMode } : {}
37954
37959
  });
37955
37960
  table[bundlePath] = bundle;
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2251 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2253 | (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;
@@ -1059,7 +1059,7 @@ var init_src = __esm({
1059
1059
  var runtime_companion_default;
1060
1060
  var init_runtime_companion = __esm({
1061
1061
  "runtime-companion.json"() {
1062
- runtime_companion_default = { abi: 1, sha256: "15053b90437ccef5f18e3e8cde5732e85d2dc9feb3a3e76076cb671a640c465e", file: "node/cli-15053b90437ccef5f18e3e8cde5732e85d2dc9feb3a3e76076cb671a640c465e.cjs" };
1062
+ runtime_companion_default = { abi: 1, sha256: "3f866674ef9cb3c9dd8d40d8b28a4b9c1131b5c5f7fa6504651570ed7ce753a3", file: "node/cli-3f866674ef9cb3c9dd8d40d8b28a4b9c1131b5c5f7fa6504651570ed7ce753a3.cjs" };
1063
1063
  }
1064
1064
  });
1065
1065
 
@@ -1388,6 +1388,14 @@ var init_answeredNativePackages = __esm({
1388
1388
  });
1389
1389
 
1390
1390
  // src/cli-runtime.ts
1391
+ var cli_runtime_exports = {};
1392
+ __export(cli_runtime_exports, {
1393
+ CLI_COMPANION_ABI: () => CLI_COMPANION_ABI,
1394
+ cliCompanionPath: () => cliCompanionPath,
1395
+ ensureCliCompanion: () => ensureCliCompanion,
1396
+ getCliRuntime: () => getCliRuntime,
1397
+ verifyCliCompanion: () => verifyCliCompanion
1398
+ });
1391
1399
  function cliCompanionPath() {
1392
1400
  return `node/cli-${runtime_companion_default.sha256}.cjs`;
1393
1401
  }
@@ -2703,7 +2711,6 @@ var init_runtime_delivery = __esm({
2703
2711
  "src/runtime-delivery.ts"() {
2704
2712
  "use strict";
2705
2713
  init_src();
2706
- init_cli_runtime();
2707
2714
  init_home_paths();
2708
2715
  init_public_brand();
2709
2716
  DEFAULT_RUNTIME_CDN_ORIGIN = peachPublicBrand.origin;
@@ -2718,7 +2725,9 @@ var init_runtime_delivery = __esm({
2718
2725
  // engine-tenant/ beneath it. index.html is what the daemon and the
2719
2726
  // vite/metro plugins serve, so its absence means the tarball is not one.
2720
2727
  installedMarker: "index.html",
2721
- verifyInstall: ensureCliCompanion,
2728
+ // loaded on use: its companion identity is generated by the CLI build, and
2729
+ // source-tree hosts such as the recorder import this module without one
2730
+ verifyInstall: async (dir) => (await Promise.resolve().then(() => (init_cli_runtime(), cli_runtime_exports))).ensureCliCompanion(dir),
2722
2731
  // canvaskit's ganesh backend is a runtime pack because a browser with WebGPU
2723
2732
  // never runs it, but linux and CI browsers usually have no GPU and always do
2724
2733
  afterInstall: async (dir) => {
@@ -3167,7 +3176,7 @@ var import_plist5 = __toESM(require("plist"), 1);
3167
3176
  init_answeredNativePackages();
3168
3177
 
3169
3178
  // src/swift-standin-digest.ts
3170
- var STANDIN_SOURCE_DIGEST = true ? "977c30e838b3cb068d200b9a9a12851b01d2192d0d04e2b5a6abe8189c168d42" : standinSourceDigest();
3179
+ var STANDIN_SOURCE_DIGEST = true ? "1f63cea9c23045599de30a6706e16844da16611e8d385fe31034727e8884380c" : standinSourceDigest();
3171
3180
 
3172
3181
  // cli/commands/detect.ts
3173
3182
  var import_json5 = __toESM(require_lib(), 1);
@@ -6299,7 +6308,7 @@ var FOUNDATION_IMPLICIT_MODULES = [
6299
6308
  var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
6300
6309
  (module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
6301
6310
  ).join("");
6302
- var compilerSourceDigest = true ? "4a1be1d1296381c7090b5b2b704a7d2bebba03ceaa580613acd0f2c39c31ed4c" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
6311
+ var compilerSourceDigest = true ? "a0acd3d55350e702b64da3ee739e811f7963210d0eb97002ee7d2214bb99e47c" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
6303
6312
  var CORE_FOUNDATION_HANDLE_IMPORTS = [
6304
6313
  "CFAllocator",
6305
6314
  "CFArray",
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2251 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2253 | (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.2251 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2253 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/worklet-executable.ts
4
4
  import { parse } from "acorn";
@@ -35,6 +35,7 @@ export declare function noteMetalEffects(style: {
35
35
  export declare function registerHoistUnlinker(unlinker: (node: SootSimNode) => void): void;
36
36
  export declare function registerBackdropGroupSyncer(syncer: (node: SootSimNode, style: Readonly<SootSimStyle> | null) => void): void;
37
37
  export declare function registerLayoutNodeDisposer(disposer: (node: SootSimNode) => void): void;
38
+ export declare function registerParagraphRecycler(recycler: (node: SootSimNode) => boolean): void;
38
39
  export declare function registerLottieNodeDisposer(disposer: (node: SootSimNode) => void): void;
39
40
  export declare const classicLayoutAnimations: Set<SootSimNode>;
40
41
  export declare function releaseDetachedNode(node: SootSimNode | SootSimTextNode): void;
@@ -10,6 +10,7 @@ export type TimedScrollControl = {
10
10
  target: number;
11
11
  durationMs: number;
12
12
  curve: TimedScrollCurve;
13
+ startedAtEpochMs: number;
13
14
  } | {
14
15
  id: number;
15
16
  type: 'cancel';
@@ -125,6 +125,7 @@ export interface CompositorGpuWarm {
125
125
  noteClockParked(): void;
126
126
  pumpIfQueued(): void;
127
127
  notePaintFlushed(): void;
128
+ notePixelsRead(): void;
128
129
  }
129
130
  export interface CompositorGpuWarmDeps {
130
131
  prewarmBlocked(): boolean;
@@ -133,6 +134,7 @@ export interface CompositorGpuWarmDeps {
133
134
  appMotionBusy(): boolean;
134
135
  foregroundAppId(): string | null;
135
136
  fontMgr(): FontMgr | null;
137
+ pixelsRead(): boolean;
136
138
  }
137
139
  export interface CompositorGpuBackend {
138
140
  readonly kind: CompositorGpuBackendKind;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.2251",
3
+ "version": "0.1.2253",
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",
@@ -1 +1 @@
1
- {"abi":1,"sha256":"15053b90437ccef5f18e3e8cde5732e85d2dc9feb3a3e76076cb671a640c465e","file":"node/cli-15053b90437ccef5f18e3e8cde5732e85d2dc9feb3a3e76076cb671a640c465e.cjs"}
1
+ {"abi":1,"sha256":"3f866674ef9cb3c9dd8d40d8b28a4b9c1131b5c5f7fa6504651570ed7ce753a3","file":"node/cli-3f866674ef9cb3c9dd8d40d8b28a4b9c1131b5c5f7fa6504651570ed7ce753a3.cjs"}
@@ -622,8 +622,12 @@ export function parseSemanticWaitOptions(value: unknown): SemanticWaitOptions {
622
622
  const type = stringValue(condition.type, 'waitFor.condition.type')
623
623
  const timeoutMs = semanticWaitTimeout(input, 'waitFor')
624
624
  if (type === 'ready') {
625
+ const stableMs = optionalNumber(condition, 'stableMs', 'waitFor.condition')
626
+ if (stableMs !== undefined && stableMs < 0) {
627
+ return validationFailure('waitFor.condition.stableMs', 'must not be negative')
628
+ }
625
629
  return {
626
- condition: { type },
630
+ condition: { type, ...(stableMs === undefined ? {} : { stableMs }) },
627
631
  ...(timeoutMs === undefined ? {} : { timeoutMs }),
628
632
  }
629
633
  }
@@ -423,7 +423,8 @@ export interface PerformResult {
423
423
  // something to look at — those are 1x1 and painted under the whole app, so they
424
424
  // are permanently occluded and `present` can never match one.
425
425
  export type SemanticWaitCondition =
426
- | { type: 'ready' }
426
+ // stableMs is how long the node count must hold still (SEMANTIC_READY_NODE_STABLE_MS by default)
427
+ | { type: 'ready'; stableMs?: number }
427
428
  | { type: 'present'; selector: SimSemanticResolveSelector }
428
429
  | { type: 'mounted'; selector: SimSemanticResolveSelector }
429
430
  | { type: 'absent'; selector: SimSemanticResolveSelector }
@@ -67,44 +67,52 @@ export function readChromiumQueue(
67
67
 
68
68
  // a pid alone can be reused, and a reused pid belongs to a process that
69
69
  // started after the holder died. so a ticket is stale only when its pid
70
- // started after the start second the ticket recorded, read once per ticket.
71
- // the recorded start comes from process.uptime(), which only ever trails the
72
- // real start (startup latency, an exec after a fork, a sleep), so a live
73
- // holder's pid never starts after it. a ps that fails or prints nothing
74
- // usable proves nothing, and kill() already proved the pid alive, so the
75
- // ticket stays and a dead pid is pruned by the next read's kill()
76
- const live = (entry: string): boolean => {
77
- const match = /^(\d+)-(\d+)-/.exec(entry)
78
- if (!match) return false
79
- const pid = Number(match[1])
70
+ // started after the start second the ticket recorded, read once per ticket
71
+ // with one ps for every unread ticket. the recorded start comes from
72
+ // process.uptime(), which only ever trails the real start (startup latency,
73
+ // an exec after a fork, a sleep), so a live holder's pid never starts after
74
+ // it. a ps that fails or prints nothing usable proves nothing, and kill()
75
+ // already proved the pid alive, so the ticket stays and a dead pid is pruned
76
+ // by the next read's kill()
77
+ const alive = (pid: number): boolean => {
80
78
  try {
81
79
  process.kill(pid, 0)
80
+ return true
82
81
  } catch (err) {
83
82
  // EPERM: alive, owned by another user
84
- if (!(err instanceof Error && 'code' in err && err.code === 'EPERM')) return false
83
+ return err instanceof Error && 'code' in err && err.code === 'EPERM'
85
84
  }
86
- if (pid === process.pid) return true
87
- const known = verified.get(entry)
88
- if (known !== undefined) return known
89
- let startedAt: number
90
- try {
91
- startedAt = Date.parse(
92
- childProcess
93
- .execFileSync('ps', ['-p', String(pid), '-o', 'lstart='], { encoding: 'utf8' })
94
- .trim(),
95
- )
96
- } catch {
97
- return true
85
+ }
86
+ const entries = fs.readdirSync(dir).map((entry) => {
87
+ const match = /^(\d+)-(\d+)-/.exec(entry)
88
+ const pid = match ? Number(match[1]) : 0
89
+ const held = entry === own || (match !== null && alive(pid))
90
+ return { entry, pid, start: match ? Number(match[2]) : 0, held }
91
+ })
92
+ const unread = entries.filter(
93
+ (e) => e.held && e.entry !== own && e.pid !== process.pid && !verified.has(e.entry),
94
+ )
95
+ if (unread.length) {
96
+ const startedAt = new Map<number, number>()
97
+ const out = childProcess.spawnSync(
98
+ 'ps',
99
+ ['-p', unread.map((e) => e.pid).join(','), '-o', 'pid=,lstart='],
100
+ { encoding: 'utf8' },
101
+ ).stdout
102
+ for (const line of (out ?? '').split('\n')) {
103
+ const m = /^\s*(\d+)\s+(.+?)\s*$/.exec(line)
104
+ if (m) startedAt.set(Number(m[1]), Date.parse(m[2]!))
105
+ }
106
+ for (const e of unread) {
107
+ const at = startedAt.get(e.pid)
108
+ if (at === undefined || Number.isNaN(at)) continue
109
+ verified.set(e.entry, at / 1000 <= e.start + 2)
98
110
  }
99
- if (Number.isNaN(startedAt)) return true
100
- const same = startedAt / 1000 <= Number(match[2]) + 2
101
- verified.set(entry, same)
102
- return same
103
111
  }
104
112
 
105
113
  const tickets: { entry: string; created: bigint }[] = []
106
- for (const entry of fs.readdirSync(dir)) {
107
- if (entry !== own && !live(entry)) {
114
+ for (const { entry, held } of entries) {
115
+ if (!held || verified.get(entry) === false) {
108
116
  try {
109
117
  fs.unlinkSync(path.join(dir, entry))
110
118
  } catch {}
@@ -29,9 +29,9 @@ export async function selectOneSDK(appRoot: string) {
29
29
  throw error
30
30
  }
31
31
  const one = path.dirname(onePackage)
32
- const generator: SDKGenerator = await import(
33
- pathToFileURL(path.join(one, 'dist/sdk/app.mjs')).href
34
- )
32
+ const generatorFile = path.join(one, 'dist/sdk/app.mjs')
33
+ if (!fs.existsSync(generatorFile)) return null
34
+ const generator: SDKGenerator = await import(pathToFileURL(generatorFile).href)
35
35
  const frameworks = generator
36
36
  .importedFrameworks(appRoot)
37
37
  .filter((name) => name === 'UIKit')
@@ -11,7 +11,6 @@
11
11
  // out as a bare require.
12
12
 
13
13
  import { createRuntimeDelivery, type RuntimeProduct } from '@contrast/runtime-delivery'
14
- import { ensureCliCompanion } from './cli-runtime'
15
14
  import {
16
15
  cacheDir,
17
16
  configFilePath,
@@ -38,7 +37,9 @@ export const RNX_RUNTIME_PRODUCT: RuntimeProduct = {
38
37
  // engine-tenant/ beneath it. index.html is what the daemon and the
39
38
  // vite/metro plugins serve, so its absence means the tarball is not one.
40
39
  installedMarker: 'index.html',
41
- verifyInstall: ensureCliCompanion,
40
+ // loaded on use: its companion identity is generated by the CLI build, and
41
+ // source-tree hosts such as the recorder import this module without one
42
+ verifyInstall: async (dir) => (await import('./cli-runtime')).ensureCliCompanion(dir),
42
43
  // canvaskit's ganesh backend is a runtime pack because a browser with WebGPU
43
44
  // never runs it, but linux and CI browsers usually have no GPU and always do
44
45
  afterInstall: async (dir) => {
@@ -1047,7 +1047,7 @@ function swiftCondition(
1047
1047
  if (name === 'canImport')
1048
1048
  return argument !== 'FoundationNetworking' && available?.has(argument!)
1049
1049
  if (name === 'targetEnvironment') return argument === 'simulator'
1050
- if (name === 'arch') return argument === 'wasm64'
1050
+ if (name === 'arch') return argument === 'wasm64' || argument === 'arm64'
1051
1051
  return undefined
1052
1052
  }
1053
1053
  const both = (): boolean | undefined => {
@@ -2614,6 +2614,10 @@ export function syncSwiftTree(base: string, files: Map<string, string | Buffer>)
2614
2614
  // objective-c syntax is compiled unchanged by the native importer.
2615
2615
  const DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/
2616
2616
  const OS_IOS = /\b(?:os\(\s*iOS\s*\)|targetEnvironment\(\s*simulator\s*\))/g
2617
+ // the guest is the arm64 iOS simulator at 64-bit pointers: the compiler reports wasm64, so a
2618
+ // package that lists only the architectures its iOS build runs on would reach its
2619
+ // `#error("Unknown architecture")`
2620
+ const ARCH_ARM64 = /\barch\(\s*arm64\s*\)/g
2617
2621
  // iOS has no FoundationNetworking module; Peach's is imported implicitly
2618
2622
  // and gated packages must take their Apple branch
2619
2623
  const NOT_ON_IOS = /\b(?:os\(\s*WASI\s*\)|canImport\(\s*FoundationNetworking\s*\))/g
@@ -3379,6 +3383,7 @@ function swiftConditionsAsIOS(
3379
3383
  if (!lineStarts.has(start) || !DIRECTIVE.test(line)) return line
3380
3384
  const platform = line
3381
3385
  .replace(OS_IOS, (match) => 'true'.padEnd(match.length))
3386
+ .replace(ARCH_ARM64, (match) => 'true'.padEnd(match.length))
3382
3387
  .replace(NOT_ON_IOS, (match) => 'false'.padEnd(match.length))
3383
3388
  // SwiftPM is the backend for Xcode targets, whose original conditions
3384
3389
  // do not include its automatically injected SWIFT_PACKAGE definition.
package/src/swift-host.ts CHANGED
@@ -2065,6 +2065,8 @@ export function buildSwiftResourceTable(
2065
2065
  let bytes: Buffer
2066
2066
  let ext = path.posix.extname(file).toLowerCase()
2067
2067
  let uploadName = path.posix.basename(file)
2068
+ // an svg keeps its point size when it travels as a 3x png
2069
+ let variantScale = scale
2068
2070
  if (ext === '.pdf') {
2069
2071
  const pdfBytes = readPackageFile(project.packagePath, disk, limits.imageBytes)
2070
2072
  const pdfHash = createHash('sha256').update(pdfBytes).digest('hex')
@@ -2086,6 +2088,7 @@ export function buildSwiftResourceTable(
2086
2088
  : null
2087
2089
  if (svg) {
2088
2090
  bytes = svg.bytes
2091
+ variantScale = 3
2089
2092
  ext = '.png'
2090
2093
  uploadName = `${path.posix.basename(file, path.posix.extname(file))}.png`
2091
2094
  }
@@ -2099,7 +2102,7 @@ export function buildSwiftResourceTable(
2099
2102
  const variants = (bundle[name] ??= [])
2100
2103
  variants.push({
2101
2104
  uri: `${baseUrl}${RESOURCE_PATH}${hash}${ext}`,
2102
- scale,
2105
+ scale: variantScale,
2103
2106
  ...(renderingMode ? { renderingMode } : {}),
2104
2107
  })
2105
2108
  table[bundlePath] = bundle
@@ -197,7 +197,9 @@ interface ParsedObject {
197
197
  segPayloadRanges: [number, number][]
198
198
  }
199
199
 
200
- const parsedObjectCache = new Map<string, ParsedObject>()
200
+ // keyed by path, stamped by file identity: a framework slot rewrites its
201
+ // objects in place, and a stale parse would pair new code with old relocations.
202
+ const parsedObjectCache = new Map<string, { stamp: string; parsed: ParsedObject }>()
201
203
 
202
204
  export function readArMembers(buf: Uint8Array): { name: string; bytes: Uint8Array }[] {
203
205
  if (buf.length < 8) return []
@@ -801,13 +803,15 @@ function parseWasmObjectCached(
801
803
  isDist: boolean,
802
804
  useCache: boolean,
803
805
  ): ParsedObject {
806
+ if (!useCache)
807
+ return parseWasmObjectBytes(file, new Uint8Array(fs.readFileSync(file)), isDist)
804
808
  const key = `${isDist ? '1' : '0'}:${file}`
805
- if (useCache) {
806
- const hit = parsedObjectCache.get(key)
807
- if (hit) return hit
808
- }
809
+ const stat = fs.statSync(file, { bigint: true })
810
+ const stamp = `${stat.ino}:${stat.size}:${stat.mtimeNs}:${stat.ctimeNs}`
811
+ const hit = parsedObjectCache.get(key)
812
+ if (hit?.stamp === stamp) return hit.parsed
809
813
  const parsed = parseWasmObjectBytes(file, new Uint8Array(fs.readFileSync(file)), isDist)
810
- if (useCache) parsedObjectCache.set(key, parsed)
814
+ parsedObjectCache.set(key, { stamp, parsed })
811
815
  return parsed
812
816
  }
813
817