peachsim 0.1.2250 → 0.1.2252

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 (92) 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 +16 -12
  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 +14 -10
  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 +47 -34
  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 +20 -8
  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 +4 -4
  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 +90 -60
  71. package/dist-lib/swift-compile.cjs +9 -7
  72. package/dist-lib/swift-compile.mjs +9 -7
  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 +10 -8
  80. package/dist-lib/vite.cjs +4 -4
  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/swift-wasm-prune.ts +10 -6
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2250 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2252 | (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.2250 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2252 | (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) {
@@ -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 ? "640b2c65a7cc0cae7070d468ddede47028d68e8d775c1720062de4adbe886bcf" : 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
@@ -31488,7 +31490,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
31488
31490
  return hash.digest("hex");
31489
31491
  }
31490
31492
  var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
31491
- var STANDIN_SOURCE_DIGEST = true ? "977c30e838b3cb068d200b9a9a12851b01d2192d0d04e2b5a6abe8189c168d42" : standinSourceDigest();
31493
+ var STANDIN_SOURCE_DIGEST = true ? "b785cd6c6dee295198d39a20023038baf3745b53f7cad89e6975823c5c5af402" : standinSourceDigest();
31492
31494
 
31493
31495
  // src/swift-standins.ts
31494
31496
  var import_node_child_process31 = require("node:child_process");
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2250 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2252 | (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
 
@@ -3167,7 +3167,7 @@ var import_plist5 = __toESM(require("plist"), 1);
3167
3167
  init_answeredNativePackages();
3168
3168
 
3169
3169
  // src/swift-standin-digest.ts
3170
- var STANDIN_SOURCE_DIGEST = true ? "977c30e838b3cb068d200b9a9a12851b01d2192d0d04e2b5a6abe8189c168d42" : standinSourceDigest();
3170
+ var STANDIN_SOURCE_DIGEST = true ? "b785cd6c6dee295198d39a20023038baf3745b53f7cad89e6975823c5c5af402" : standinSourceDigest();
3171
3171
 
3172
3172
  // cli/commands/detect.ts
3173
3173
  var import_json5 = __toESM(require_lib(), 1);
@@ -6299,7 +6299,7 @@ var FOUNDATION_IMPLICIT_MODULES = [
6299
6299
  var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
6300
6300
  (module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
6301
6301
  ).join("");
6302
- var compilerSourceDigest = true ? "4a1be1d1296381c7090b5b2b704a7d2bebba03ceaa580613acd0f2c39c31ed4c" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
6302
+ var compilerSourceDigest = true ? "640b2c65a7cc0cae7070d468ddede47028d68e8d775c1720062de4adbe886bcf" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
6303
6303
  var CORE_FOUNDATION_HANDLE_IMPORTS = [
6304
6304
  "CFAllocator",
6305
6305
  "CFArray",
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2250 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2252 | (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.2250 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2252 | (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.2250",
3
+ "version": "0.1.2252",
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')
@@ -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