peachsim 0.1.1948 → 0.1.1950

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 (84) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +1 -1
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +1 -1
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +1 -1
  13. package/dist-lib/bundle-channel.cjs +42 -19
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +1 -1
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +1 -1
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +1 -1
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +1 -1
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +1 -1
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/expo-swift-bundle.cjs +41 -18
  27. package/dist-lib/expo-swift-metadata.cjs +1 -1
  28. package/dist-lib/expo-swift-metadata.mjs +1 -1
  29. package/dist-lib/home-paths.cjs +1 -1
  30. package/dist-lib/host/bridge-host.cjs +42 -19
  31. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  32. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  34. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  35. package/dist-lib/host/websocket-proxy.cjs +1 -1
  36. package/dist-lib/index.cjs +2 -2
  37. package/dist-lib/jump-to-source-babel.cjs +1 -1
  38. package/dist-lib/jump-to-source-native.cjs +1 -1
  39. package/dist-lib/kotlin-host.cjs +1 -1
  40. package/dist-lib/menu.cjs +1 -1
  41. package/dist-lib/menu.mjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  44. package/dist-lib/metro-production-bundle.cjs +1 -1
  45. package/dist-lib/metro-production-bundle.mjs +1 -1
  46. package/dist-lib/metro.cjs +2 -2
  47. package/dist-lib/native-app-identity-project.cjs +2 -2
  48. package/dist-lib/native-app-identity-project.mjs +2 -2
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/native-firebase-metadata.cjs +1 -1
  52. package/dist-lib/native-firebase-metadata.mjs +1 -1
  53. package/dist-lib/pdfium-raster.cjs +1 -1
  54. package/dist-lib/pdfium-raster.mjs +1 -1
  55. package/dist-lib/plist.cjs +1 -1
  56. package/dist-lib/plist.mjs +1 -1
  57. package/dist-lib/profiles.cjs +1 -1
  58. package/dist-lib/public-brand.cjs +1 -1
  59. package/dist-lib/public-origins-lib-esm.json +24 -24
  60. package/dist-lib/public-origins-lib.json +53 -53
  61. package/dist-lib/react-native-host-modules.cjs +1 -1
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/reap-browser.cjs +1 -1
  64. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  65. package/dist-lib/sdk.cjs +1 -1
  66. package/dist-lib/sdk.mjs +1 -1
  67. package/dist-lib/skills.cjs +43 -20
  68. package/dist-lib/swift-compile.cjs +5 -5
  69. package/dist-lib/swift-compile.mjs +5 -5
  70. package/dist-lib/swift-package.cjs +1 -1
  71. package/dist-lib/swift-package.mjs +1 -1
  72. package/dist-lib/swift-submit.cjs +1 -1
  73. package/dist-lib/swift-submit.mjs +1 -1
  74. package/dist-lib/swift-toolchain.cjs +1 -1
  75. package/dist-lib/swift.cjs +1 -1
  76. package/dist-lib/vite-swift.cjs +6 -6
  77. package/dist-lib/vite.cjs +1 -1
  78. package/dist-lib/worklet-executable.cjs +1 -1
  79. package/dist-lib/worklet-executable.mjs +1 -1
  80. package/package.json +1 -1
  81. package/src/expo-native-workspace.ts +0 -2
  82. package/src/expo-swift-host.ts +15 -1
  83. package/src/react-native-bridge-modules.ts +27 -6
  84. package/src/swift-guest-link.ts +8 -3
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1948 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1950 | (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;
@@ -8962,11 +8962,11 @@ function linkGuestImages(options) {
8962
8962
  regions: []
8963
8963
  })
8964
8964
  );
8965
- const generated = import_node_fs13.default.readFileSync(ledgerObject);
8965
+ const ledgerPieces = guestProjectionRegionCapacity([import_node_fs13.default.readFileSync(ledgerObject)], 0);
8966
8966
  const capacities = ledger.images.map((image) => ({
8967
8967
  regions: guestProjectionRegionCapacity(
8968
- [...image.objects.map((object3) => object3.bytes), generated],
8969
- images.length + 2
8968
+ image.objects.map((object3) => object3.bytes),
8969
+ 1 + ledger.callerWrappers.filter((wrapper) => wrapper.image === image.id).length + (image.id === options.ledgerDataImage ? ledgerPieces : 0) + (image.id === projection.image ? images.length + 2 : 0)
8970
8970
  ),
8971
8971
  memoryProtection: projection.memoryProtection,
8972
8972
  tableProtection: projection.tableProtection
@@ -12134,7 +12134,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
12134
12134
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
12135
12135
  var MULTI_MANIFEST_VERSION = 66;
12136
12136
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
12137
- var compilerSourceDigest = true ? "d206ac7f2dd3ac07413fe6e3a1f0cf0ce1598850ace01d84428d65d0b3c4527b" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
12137
+ var compilerSourceDigest = true ? "5ba16a172660afb20c60efe88153141d4e404fc7b7730f1cdcd5c172e56a963d" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
12138
12138
  function swiftArtifactHash(input, release, moduleRoot) {
12139
12139
  const hash = (0, import_node_crypto12.createHash)("sha256");
12140
12140
  hash.update(`swift-compile
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1948 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1950 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/swift-compile.ts
4
4
  import {
@@ -8911,11 +8911,11 @@ function linkGuestImages(options) {
8911
8911
  regions: []
8912
8912
  })
8913
8913
  );
8914
- const generated = fs5.readFileSync(ledgerObject);
8914
+ const ledgerPieces = guestProjectionRegionCapacity([fs5.readFileSync(ledgerObject)], 0);
8915
8915
  const capacities = ledger.images.map((image) => ({
8916
8916
  regions: guestProjectionRegionCapacity(
8917
- [...image.objects.map((object3) => object3.bytes), generated],
8918
- images.length + 2
8917
+ image.objects.map((object3) => object3.bytes),
8918
+ 1 + ledger.callerWrappers.filter((wrapper) => wrapper.image === image.id).length + (image.id === options.ledgerDataImage ? ledgerPieces : 0) + (image.id === projection.image ? images.length + 2 : 0)
8919
8919
  ),
8920
8920
  memoryProtection: projection.memoryProtection,
8921
8921
  tableProtection: projection.tableProtection
@@ -12110,7 +12110,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
12110
12110
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
12111
12111
  var MULTI_MANIFEST_VERSION = 66;
12112
12112
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
12113
- var compilerSourceDigest = true ? "d206ac7f2dd3ac07413fe6e3a1f0cf0ce1598850ace01d84428d65d0b3c4527b" : swiftCompilerSourceDigest(import.meta.dirname);
12113
+ var compilerSourceDigest = true ? "5ba16a172660afb20c60efe88153141d4e404fc7b7730f1cdcd5c172e56a963d" : swiftCompilerSourceDigest(import.meta.dirname);
12114
12114
  function swiftArtifactHash(input, release, moduleRoot) {
12115
12115
  const hash = createHash13("sha256");
12116
12116
  hash.update(`swift-compile
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1948 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1950 | (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.1948 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1950 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/swift-package.ts
4
4
  function swiftManifestSettings(target) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1948 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1950 | (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.1948 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1950 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/is-record.ts
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1948 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1950 | (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;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1948 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1950 | (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.1948 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1950 | (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;
@@ -13409,11 +13409,11 @@ function linkGuestImages(options) {
13409
13409
  regions: []
13410
13410
  })
13411
13411
  );
13412
- const generated = import_node_fs14.default.readFileSync(ledgerObject);
13412
+ const ledgerPieces = guestProjectionRegionCapacity([import_node_fs14.default.readFileSync(ledgerObject)], 0);
13413
13413
  const capacities = ledger.images.map((image) => ({
13414
13414
  regions: guestProjectionRegionCapacity(
13415
- [...image.objects.map((object4) => object4.bytes), generated],
13416
- images.length + 2
13415
+ image.objects.map((object4) => object4.bytes),
13416
+ 1 + ledger.callerWrappers.filter((wrapper) => wrapper.image === image.id).length + (image.id === options.ledgerDataImage ? ledgerPieces : 0) + (image.id === projection.image ? images.length + 2 : 0)
13417
13417
  ),
13418
13418
  memoryProtection: projection.memoryProtection,
13419
13419
  tableProtection: projection.tableProtection
@@ -16447,7 +16447,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
16447
16447
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
16448
16448
  var MULTI_MANIFEST_VERSION = 66;
16449
16449
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
16450
- var compilerSourceDigest = true ? "d206ac7f2dd3ac07413fe6e3a1f0cf0ce1598850ace01d84428d65d0b3c4527b" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
16450
+ var compilerSourceDigest = true ? "5ba16a172660afb20c60efe88153141d4e404fc7b7730f1cdcd5c172e56a963d" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
16451
16451
  function swiftArtifactHash(input, release, moduleRoot) {
16452
16452
  const hash = (0, import_node_crypto12.createHash)("sha256");
16453
16453
  hash.update(`swift-compile
@@ -29615,7 +29615,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
29615
29615
  return hash.digest("hex");
29616
29616
  }
29617
29617
  var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
29618
- var STANDIN_SOURCE_DIGEST = true ? "fab9086c55f32bb50f7e8d86d13c7ce473a0cdcfe5daef1d191032e8b5365d35" : standinSourceDigest();
29618
+ var STANDIN_SOURCE_DIGEST = true ? "8bf5b7389fe4f21e3cd1db2b0d4f2ac89aadb99d2bdeedd0488666b00b2d8c38" : standinSourceDigest();
29619
29619
 
29620
29620
  // src/swift-standins.ts
29621
29621
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1948 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1950 | (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;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1948 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1950 | (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.1948 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1950 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/worklet-executable.ts
4
4
  import { parse } from "acorn";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.1948",
3
+ "version": "0.1.1950",
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",
@@ -795,8 +795,6 @@ async function prepareWorkspace(
795
795
  manager,
796
796
  'install',
797
797
  '--frozen-lockfile',
798
- '--filter',
799
- `${appManifest.name}...`,
800
798
  // the copied node_modules link into the store pnpm chose on the app's volume
801
799
  ...pnpmStoreArgs(root),
802
800
  ]
@@ -1941,7 +1941,21 @@ async function compileExpoSwiftModulesTraced(
1941
1941
  )
1942
1942
  )
1943
1943
  await ensureSwiftToolchain(signal)
1944
- const bridge = collectBridgeModuleSources(fs.realpathSync(root), signal)
1944
+ let bridge = collectBridgeModuleSources(fs.realpathSync(root), signal)
1945
+ if (
1946
+ nativeWorkspaceAvailable() &&
1947
+ fs.existsSync(path.join(root, 'ios', 'Podfile')) &&
1948
+ bridge?.units.some((unit) =>
1949
+ unit.nativeTargets?.some((target) => target.bridgingHeader),
1950
+ )
1951
+ ) {
1952
+ const prepared = await prepareExpoNativeWorkspace(root, signal, options.iosTarget)
1953
+ bridge = collectBridgeModuleSources(
1954
+ fs.realpathSync(prepared.app),
1955
+ signal,
1956
+ options.installedWorkspace ?? prepared.workspace,
1957
+ )
1958
+ }
1945
1959
  if (bridge && bridge.installedNamespaces.length > 0) {
1946
1960
  const workspace =
1947
1961
  options.installedWorkspace ??
@@ -327,6 +327,7 @@ export const BRIDGE_MODULE_FILE_PREFIX = '__peach_react_module_'
327
327
  export function collectBridgeModuleSources(
328
328
  appRoot: string,
329
329
  signal?: AbortSignal,
330
+ installedWorkspace?: string,
330
331
  ): {
331
332
  units: ExpoSwiftSourceUnit[]
332
333
  failures: { namespace: string; diagnostic: string }[]
@@ -338,7 +339,8 @@ export function collectBridgeModuleSources(
338
339
  const installedNamespaces = new Set<string>()
339
340
  const projectRoot = fs.realpathSync(appRoot)
340
341
  const iosRoot = path.join(appRoot, 'ios')
341
- const project = fs.existsSync(iosRoot) ? findXcodeProject(iosRoot) : null
342
+ const project =
343
+ installedWorkspace ?? (fs.existsSync(iosRoot) ? findXcodeProject(iosRoot) : null)
342
344
  const targets = project ? listXcodeAppTargets(project, { requireSources: false }) : []
343
345
  // RCTRegisterModule runs in the one app binary; several targets are
344
346
  // several apps, and nothing here says which one this bundle runs in
@@ -346,6 +348,7 @@ export function collectBridgeModuleSources(
346
348
  project && targets.length === 1
347
349
  ? readXcodeAppTarget(project, targets[0]!, 'Release', {
348
350
  requireSources: false,
351
+ installedPods: installedWorkspace !== undefined,
349
352
  })
350
353
  : null
351
354
  let nativeInputs: ReturnType<typeof xcodeObjCInputs> | undefined
@@ -492,7 +495,24 @@ export function collectBridgeModuleSources(
492
495
  /\.(?:h|hh|hpp|hxx|pch|inc|inl|modulemap)$/.test(file),
493
496
  )
494
497
  unit.nativeFiles = Object.fromEntries(
495
- headerFiles.map(([file, bytes]) => [key(file), bytes.toString('utf8')]),
498
+ headerFiles.flatMap(([file, bytes]) => {
499
+ const source = bytes.toString('utf8')
500
+ const canonical = nativeInputs!.links[file]
501
+ return canonical
502
+ ? [
503
+ [key(file), source],
504
+ [key(canonical), source],
505
+ ]
506
+ : [[key(file), source]]
507
+ }),
508
+ )
509
+ unit.headerAliases = Object.fromEntries(
510
+ headerFiles.flatMap(([file]) => {
511
+ const canonical = nativeInputs!.links[file]
512
+ return canonical && !file.endsWith('.modulemap')
513
+ ? [[key(file), key(canonical)]]
514
+ : []
515
+ }),
496
516
  )
497
517
  const directories = (files: string[]) =>
498
518
  files.flatMap((file) =>
@@ -533,10 +553,11 @@ export function collectBridgeModuleSources(
533
553
  ),
534
554
  })),
535
555
  productHeaders: Object.fromEntries(
536
- Object.entries(native.productHeaders).map(([product, file]) => [
537
- key(product),
538
- key(file),
539
- ]),
556
+ nativeInputs.targets.flatMap((target) =>
557
+ Object.entries(target.productHeaders).flatMap(([product, file]) =>
558
+ nativeInputs!.sources.has(file) ? [[key(product), key(file)]] : [],
559
+ ),
560
+ ),
540
561
  ),
541
562
  flags: [
542
563
  ...xcodeNativeFlags(native.flags, nativePath),
@@ -534,11 +534,16 @@ export function linkGuestImages(
534
534
  regions: [],
535
535
  }),
536
536
  )
537
- const generated = fs.readFileSync(ledgerObject)
537
+ // generated pieces belong to one image each: the lookup tables to the ledger data
538
+ // image, a caller wrapper to its caller, the projection tables to the projection image.
539
+ const ledgerPieces = guestProjectionRegionCapacity([fs.readFileSync(ledgerObject)], 0)
538
540
  const capacities = ledger.images.map((image) => ({
539
541
  regions: guestProjectionRegionCapacity(
540
- [...image.objects.map((object) => object.bytes), generated],
541
- images.length + 2,
542
+ image.objects.map((object) => object.bytes),
543
+ 1 +
544
+ ledger.callerWrappers.filter((wrapper) => wrapper.image === image.id).length +
545
+ (image.id === options.ledgerDataImage ? ledgerPieces : 0) +
546
+ (image.id === projection.image ? images.length + 2 : 0),
542
547
  ),
543
548
  memoryProtection: projection.memoryProtection,
544
549
  tableProtection: projection.tableProtection,