peachsim 0.1.2129 → 0.1.2155

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 (146) hide show
  1. package/README.md +1 -1
  2. package/cli/app-fonts.ts +1 -1
  3. package/cli/app-stubs.ts +1 -1
  4. package/cli/cli-release-origin.ts +1 -0
  5. package/cli/cli-update.ts +1 -1
  6. package/cli/cloud-box-artifact.ts +1 -1
  7. package/cli/cloud-test-tunnel.ts +1 -1
  8. package/cli/commands/compat.ts +1 -1
  9. package/cli/commands/control.ts +2 -0
  10. package/cli/commands/coverage.ts +1 -1
  11. package/cli/commands/flow.ts +8 -1
  12. package/cli/commands/inspect/core.ts +25 -4
  13. package/cli/commands/package.ts +21 -12
  14. package/cli/commands/shell-url.ts +8 -3
  15. package/cli/commands/upgrade.ts +1 -1
  16. package/cli/drivers/linux-browser-libs.ts +1 -1
  17. package/cli/outbound-endpoints.ts +4 -0
  18. package/cli/remote-project-bundle.ts +2 -2
  19. package/detox/index.ts +12 -5
  20. package/dist-lib/agent-daemon-client.cjs +1 -1
  21. package/dist-lib/agent-events.cjs +1 -1
  22. package/dist-lib/attached-projects.cjs +1 -1
  23. package/dist-lib/auth/shared-session.cjs +1 -1
  24. package/dist-lib/backend-origin.cjs +1 -1
  25. package/dist-lib/beta.cjs +1 -1
  26. package/dist-lib/beta.mjs +1 -1
  27. package/dist-lib/bridge-constants.cjs +1 -1
  28. package/dist-lib/bridge-contract-input.cjs +1 -1
  29. package/dist-lib/bridge-contract-input.mjs +1 -1
  30. package/dist-lib/bridge-contract.cjs +1 -1
  31. package/dist-lib/bridge-contract.mjs +1 -1
  32. package/dist-lib/bundle-channel.cjs +1795 -1801
  33. package/dist-lib/capture-contract.cjs +1 -1
  34. package/dist-lib/capture-contract.mjs +1 -1
  35. package/dist-lib/cloud-contract.cjs +1 -1
  36. package/dist-lib/cloud-contract.mjs +1 -1
  37. package/dist-lib/cloud-test-args.cjs +1 -1
  38. package/dist-lib/cloud-test-args.mjs +1 -1
  39. package/dist-lib/cloud.cjs +1 -1
  40. package/dist-lib/cloud.mjs +1 -1
  41. package/dist-lib/config.cjs +2 -2
  42. package/dist-lib/config.mjs +2 -2
  43. package/dist-lib/detox/index.cjs +31 -8
  44. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  45. package/dist-lib/expo-swift-bundle.cjs +41 -33
  46. package/dist-lib/expo-swift-metadata.cjs +10 -2
  47. package/dist-lib/expo-swift-metadata.mjs +9 -2
  48. package/dist-lib/home-paths.cjs +1 -1
  49. package/dist-lib/host/bridge-host.cjs +276 -243
  50. package/dist-lib/host/fetch-proxy-handler.cjs +459 -484
  51. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  52. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  53. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  54. package/dist-lib/host/websocket-proxy.cjs +1 -1
  55. package/dist-lib/index.cjs +266 -266
  56. package/dist-lib/jump-to-source-babel.cjs +1 -1
  57. package/dist-lib/jump-to-source-native.cjs +1 -1
  58. package/dist-lib/kotlin-host.cjs +1 -1
  59. package/dist-lib/menu.cjs +1 -1
  60. package/dist-lib/menu.mjs +1 -1
  61. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  62. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  63. package/dist-lib/metro-production-bundle.cjs +2 -2
  64. package/dist-lib/metro-production-bundle.mjs +2 -2
  65. package/dist-lib/metro.cjs +320 -336
  66. package/dist-lib/native-app-identity-project.cjs +134 -159
  67. package/dist-lib/native-app-identity-project.mjs +428 -459
  68. package/dist-lib/native-app-identity.cjs +18 -18
  69. package/dist-lib/native-app-identity.mjs +18 -18
  70. package/dist-lib/native-firebase-metadata.cjs +2 -2
  71. package/dist-lib/native-firebase-metadata.mjs +2 -2
  72. package/dist-lib/pdfium-raster.cjs +1 -1
  73. package/dist-lib/pdfium-raster.mjs +1 -1
  74. package/dist-lib/plist.cjs +1 -1
  75. package/dist-lib/plist.mjs +1 -1
  76. package/dist-lib/profiles.cjs +1 -1
  77. package/dist-lib/public-brand.cjs +1 -1
  78. package/dist-lib/public-origins-lib-esm.json +32 -36
  79. package/dist-lib/public-origins-lib.json +135 -161
  80. package/dist-lib/react-native-host-modules.cjs +1 -1
  81. package/dist-lib/react-native-host-modules.mjs +1 -1
  82. package/dist-lib/reap-browser.cjs +1 -1
  83. package/dist-lib/scripts/dev-server-scanner.cjs +2 -2
  84. package/dist-lib/sdk.cjs +20 -2
  85. package/dist-lib/sdk.mjs +20 -2
  86. package/dist-lib/skills.cjs +587 -531
  87. package/dist-lib/swift-compile.cjs +23 -8
  88. package/dist-lib/swift-compile.mjs +23 -8
  89. package/dist-lib/swift-package.cjs +1 -1
  90. package/dist-lib/swift-package.mjs +1 -1
  91. package/dist-lib/swift-submit.cjs +1 -1
  92. package/dist-lib/swift-submit.mjs +1 -1
  93. package/dist-lib/swift-toolchain.cjs +1 -1
  94. package/dist-lib/swift.cjs +1 -1
  95. package/dist-lib/vite-swift.cjs +41 -39
  96. package/dist-lib/vite.cjs +745 -768
  97. package/dist-lib/worklet-executable.cjs +1 -1
  98. package/dist-lib/worklet-executable.mjs +1 -1
  99. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +1 -1
  100. package/dist-types/packages/peach-engine/src/engine/secureItemHostContract.d.ts +1 -1
  101. package/dist-types/packages/peach-engine/src/render-worker/expo-widgets-activityContract.d.ts +1 -1
  102. package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +2 -0
  103. package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +1 -1
  104. package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +1 -1
  105. package/dist-types/packages/peach-engine/src/render-worker/one-native-contentContract.d.ts +1 -1
  106. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +2 -2
  107. package/dist-types/packages/peach-engine/src/render-worker/worklet-serialize.d.ts +1 -1
  108. package/dist-types/packages/peach-engine/src/render-worker/worklet-wire.d.ts +1 -1
  109. package/dist-types/packages/peach-globals/src/globalsContract.d.ts +1 -1
  110. package/dist-types/packages/peach-globals/src/package-versions.d.ts +16 -0
  111. package/package.json +1 -1
  112. package/runtime-companion.json +1 -1
  113. package/src/androidAutolinkingContract.ts +1 -1
  114. package/src/androidRootModuleContract.ts +1 -1
  115. package/src/bundle-channel.mjs +1 -1
  116. package/src/config.ts +1 -1
  117. package/src/configured-bundle-producer.ts +1 -1
  118. package/src/expo-swift-host.ts +34 -4
  119. package/src/expoKotlinContract.ts +4 -1
  120. package/src/expoSwiftContract.ts +18 -4
  121. package/src/guest-bundle.ts +1 -1
  122. package/src/host/dev-server-package-versions.ts +1 -1
  123. package/src/host/fetch-proxy-handler.ts +1 -1
  124. package/src/installed-native-build-options.ts +2 -2
  125. package/src/installed-package-versions.ts +7 -7
  126. package/src/metro-plugin.ts +1 -1
  127. package/src/metro-production-bundle.ts +1 -1
  128. package/src/native-app-identity.ts +1 -1
  129. package/src/native-firebase-metadata.ts +1 -1
  130. package/src/nitro-adapter.lock.json +244 -244
  131. package/src/nitro-superset.lock.json +4 -4
  132. package/src/nitroContract.ts +1 -1
  133. package/src/oneSdkContract.ts +1 -1
  134. package/src/react-native-coverage/capability-reference-resolution.ts +4 -4
  135. package/src/storageSnapshotContract.ts +2 -2
  136. package/src/swift-compile.ts +24 -7
  137. package/src/swift-coverage/source.ts +1 -1
  138. package/src/swift-distribution.lock.json +8 -8
  139. package/src/turbo-runtime.lock.json +18 -18
  140. package/src/vite-plugin-one.ts +4 -4
  141. package/src/vite-plugin.ts +6 -6
  142. package/src/bundleGlobalFooter.ts +0 -137
  143. package/src/packageVersionsContract.ts +0 -131
  144. /package/dist-types/packages/{peach-compat/src/stubs → peach-engine/src/guest}/native-evaluation-lease.d.ts +0 -0
  145. /package/dist-types/packages/{peach-compat → peach-globals}/src/secure-item-store.d.ts +0 -0
  146. /package/dist-types/packages/{peach-compat/src/stubs → peach-kit/src}/ring-mode-state.d.ts +0 -0
package/README.md CHANGED
@@ -311,7 +311,7 @@ therefore runs before assertions in each flow.
311
311
  | runtime delivery + Peach home | Versioned engine runtime management. The shared machinery owns manifest fetch, sha256 verification, channels, and auto-update. Peach binds it to `https://contrast.dev` and `~/.peach/runtimes/<version>`. A repo can select `runtimeVersion` without changing the machine default. | `src/runtime-delivery.ts`, `packages/contrast-runtime-delivery/`, `src/home-paths.ts`, `src/runtime-assets.ts` |
312
312
  | standalone CLI delivery | Cached stable-version checks, bounded interactive notices, and verified atomic executable replacement. | `cli/cli-update.ts`, `cli/commands/upgrade.ts`, `cli/commands/version.ts`, `src/cli-version.ts` |
313
313
  | `peachsim/vite` + `peachsim/metro` (runtime serving) | Published bundler plugins. Both serve the installed engine runtime at `/__peachsim/` from `~/.peach/runtimes/<version>` so an app's own dev server can host the sim shell; the Vite plugin can opt into a named Electron window. | `src/vite-plugin-one.ts`, `src/metro-plugin.ts`, `src/runtime-assets.ts` |
314
- | `sootsim()` vite resolver plugin (internal) | The large RN-resolution / native-stub vite plugin: aliases `react-native` to the engine shim, native packages to `@sootsim/compat` stubs, and applies worklets/babel transforms. Distinct from the published `peachsim/vite` export. | `src/vite-plugin.ts`, `src/worklets-babel.ts`, `packages/peach-compat/src/stub-manifest.ts` |
314
+ | `sootsim()` vite resolver plugin (internal) | The large RN-resolution / native-stub vite plugin: aliases `react-native` to the engine shim, native packages to `@sootsim/compat` stubs, and applies worklets/babel transforms. Distinct from the published `peachsim/vite` export. | `src/vite-plugin.ts`, `src/worklets-babel.ts`, `packages/peach-globals/src/guest-modules/stub-manifest.ts` |
315
315
  | skills registry | Peach agent skills (`peach-setup`, `peach-debug`, `peach-test`, `peach-visual`, and the generated `contrast` index) installable with `peach skill`. | `skills/*.md`, `src/skills/registry.ts`, `src/skills/types.ts` |
316
316
 
317
317
  ## Getting started
package/cli/app-fonts.ts CHANGED
@@ -115,7 +115,7 @@ function isFile(filePath: string): boolean {
115
115
  }
116
116
 
117
117
  // absolute paths of every existing font file the native app links.
118
- function discoverNativeLinkedAppFontAssets(opts: {
118
+ export function discoverNativeLinkedAppFontAssets(opts: {
119
119
  projectDir: string
120
120
  platform?: string
121
121
  }): { paths: string[]; materialSymbols?: ReturnType<typeof materialSymbolFontAssets> } {
package/cli/app-stubs.ts CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  statSync,
13
13
  } from 'node:fs'
14
14
  import { dirname, join, relative, resolve } from 'node:path'
15
- import { resolveCompatVersionRange } from '@peach/compat/version-range'
15
+ import { resolveCompatVersionRange } from '@peach/globals/guest-modules/version-range'
16
16
  import { parseSync, type Expression, type PrivateIdentifier } from 'oxc-parser'
17
17
  import { transform } from 'sucrase'
18
18
  import {
@@ -0,0 +1 @@
1
+ export const DEFAULT_CLI_RELEASE_ORIGIN = 'https://r2.rnxsim.com/rnx-cli'
package/cli/cli-update.ts CHANGED
@@ -5,8 +5,8 @@ import { automaticPeachUpdatesEnabled } from '../src/automatic-update-policy'
5
5
  import { getCliVersion } from '../src/cli-version'
6
6
  import { cliUpdateFilePath } from '../src/home-paths'
7
7
  import { isAgentEnv } from './commands/inspect/env'
8
+ import { DEFAULT_CLI_RELEASE_ORIGIN } from './cli-release-origin'
8
9
 
9
- export const DEFAULT_CLI_RELEASE_ORIGIN = 'https://r2.rnxsim.com/rnx-cli'
10
10
  export const CLI_UPDATE_CHECK_INTERVAL_MS = 20 * 60 * 60 * 1000
11
11
  export const CLI_UPDATE_NOTIFICATION_COOLDOWN_MS = 7 * 24 * 60 * 60 * 1000
12
12
 
@@ -5,6 +5,7 @@ import { createHash } from 'node:crypto'
5
5
  import { existsSync, readFileSync } from 'node:fs'
6
6
  import { dirname, join, resolve } from 'node:path'
7
7
  import { prebuiltNativeAssetUrl } from '@peach/box/template'
8
+ import { readPackageVersionsFooter } from '@peach/globals/package-versions'
8
9
  import { getCliRuntime } from '../src/cli-runtime.ts'
9
10
  import { isRecord } from '../src/is-record'
10
11
  import { detectBundleModeFromText } from '../src/metro-production-bundle.ts'
@@ -13,7 +14,6 @@ import {
13
14
  insertNativeBundleFooters,
14
15
  nativeBundleAssets,
15
16
  } from '../src/native-bundles'
16
- import { readPackageVersionsFooter } from '../src/packageVersionsContract'
17
17
  import { embedBundleAssets, isRemoteBundleInput } from './cloud-client.ts'
18
18
  import type { RemotePlatform } from './cloud-session.ts'
19
19
 
@@ -28,9 +28,9 @@ import { tmpdir } from 'node:os'
28
28
  import { join } from 'node:path'
29
29
  import { pipeline } from 'node:stream'
30
30
  import { text } from 'node:stream/consumers'
31
+ import { PACKAGE_VERSIONS_HEADER } from '@peach/globals/package-versions'
31
32
  import { isLoopbackHost } from '../src/backend-origin'
32
33
  import { insertExpoSwiftFooter, readExpoSwiftFooter } from '../src/expoSwiftContract'
33
- import { PACKAGE_VERSIONS_HEADER } from '../src/packageVersionsContract'
34
34
  import { sleep } from '../src/sleep'
35
35
 
36
36
  // must match packages/contrast-runner/src/hostedPorts.ts.
@@ -8,7 +8,6 @@
8
8
  import { createHash } from 'node:crypto'
9
9
  import { join, relative, resolve } from 'node:path'
10
10
  import { PURE_JS_PACKAGES } from '@peach/compat/pure-js-whitelist'
11
- import { resolveCompatVersionRange } from '@peach/compat/version-range'
12
11
  import {
13
12
  implementationPercent,
14
13
  scanDepsWithData,
@@ -16,6 +15,7 @@ import {
16
15
  type PackageResult,
17
16
  type ScanResult,
18
17
  } from '@peach/compat/web'
18
+ import { resolveCompatVersionRange } from '@peach/globals/guest-modules/version-range'
19
19
  import { getCliVersion } from '../../src/cli-version'
20
20
  import { readActiveRuntime } from '../../src/home-paths'
21
21
  import { rnxPublicBrand } from '../../src/public-brand'
@@ -1427,6 +1427,7 @@ async function openSim(
1427
1427
  '--base-url',
1428
1428
  '--bundle-origin',
1429
1429
  '--project-root',
1430
+ '--app-fonts-dir',
1430
1431
  '--replace',
1431
1432
  '--remap',
1432
1433
  '--driver',
@@ -2013,6 +2014,7 @@ async function openSim(
2013
2014
 
2014
2015
  const buildShellUrlOpts: BuildShellUrlOptions = {
2015
2016
  bundleOriginOverride: args.find((_, i) => args[i - 1] === '--bundle-origin'),
2017
+ appFontsDir: args.find((_, i) => args[i - 1] === '--app-fonts-dir'),
2016
2018
  hot: hotMode,
2017
2019
  hostDriver: driverId === 'desktop' ? 'desktop' : undefined,
2018
2020
  device: deviceArg,
@@ -8,7 +8,7 @@ import {
8
8
  verifiedSourceApiDoors,
9
9
  type VerifiedSurface,
10
10
  } from '@peach/compat/verified-map-types'
11
- import { resolveCompatVersionRange } from '@peach/compat/version-range'
11
+ import { resolveCompatVersionRange } from '@peach/globals/guest-modules/version-range'
12
12
  import { z } from 'zod'
13
13
  import inventoryData from '../../../peach-compat/src/generated/capability-inventory.json'
14
14
  import { resolveCapabilityReferences } from '../../src/react-native-coverage/capability-reference-resolution'
@@ -70,6 +70,7 @@ const FLOW_BOOLEAN_FLAGS = [
70
70
 
71
71
  const FLOW_VALUE_FLAGS = [
72
72
  '--app',
73
+ '--app-fonts-dir',
73
74
  '--out',
74
75
  '--base-url',
75
76
  '--device',
@@ -607,6 +608,8 @@ flow extension:
607
608
  if (targetDevice) openArgs.push('--device', targetDevice)
608
609
  const iosTarget = getFlag('--ios-target')
609
610
  if (iosTarget) openArgs.push('--ios-target', iosTarget)
611
+ const appFontsDir = getFlag('--app-fonts-dir')
612
+ if (appFontsDir) openArgs.push('--app-fonts-dir', appFontsDir)
610
613
  openArgs.push(...replaceArgs)
611
614
  openArgs.push(...remapArgs)
612
615
  if (effectiveOpenInNewSim) {
@@ -633,7 +636,11 @@ flow extension:
633
636
  ...(parsedBridgeArgs.explicitPort ? { port: parsedBridgeArgs.wsPort } : {}),
634
637
  timeoutMs: parsedBridgeArgs.commandTimeoutMs,
635
638
  resources: openResources,
636
- runtimeConfig: targetAppResolution.runtimeConfig,
639
+ // a prebuilt bundle file carries its own configuration footer; the registry's
640
+ // copy names files by this checkout's paths and would never match it
641
+ runtimeConfig: openTarget.endsWith('.js')
642
+ ? undefined
643
+ : targetAppResolution.runtimeConfig,
637
644
  })
638
645
  openedSimId = opened?.simId
639
646
  // the steps must talk to the bridge open actually settled on, not the
@@ -378,6 +378,8 @@ export function scoreLayoutTextContrast(input: {
378
378
  box: LayoutBox
379
379
  fontSize: number
380
380
  fontWeight?: number
381
+ // the text's styled color as rgb, when it resolves to an opaque color
382
+ declaredColor?: readonly number[]
381
383
  }): LayoutTextContrast {
382
384
  const required: 3 | 4.5 =
383
385
  input.fontSize >= 18 || (input.fontSize >= 14 && (input.fontWeight ?? 400) >= 700)
@@ -484,9 +486,18 @@ export function scoreLayoutTextContrast(input: {
484
486
  }
485
487
  }
486
488
  } else if (opaqueBackground) {
487
- // No final pixel changed when the renderer omitted this visible text. Its
488
- // effective foreground is therefore identical to the pixels behind it:
489
- // exact 1:1 contrast, not an "unmeasurable" escape hatch.
489
+ // No final pixel changed when the renderer omitted this text. A color that
490
+ // stands apart from the pixels behind it would have drawn, so something
491
+ // covers or clips the text here; only a color matching its background is
492
+ // a real 1:1.
493
+ if (input.declaredColor && ratioOf(input.declaredColor, opaqueBackground) >= 1.5) {
494
+ return {
495
+ ratio: null,
496
+ required,
497
+ background: hex(opaqueBackground),
498
+ reason: 'covered or clipped here; measure it where it is visible',
499
+ }
500
+ }
490
501
  consider(opaqueBackground, opaqueBackground)
491
502
  }
492
503
 
@@ -771,6 +782,15 @@ export function layoutGetNativeEval(opts: LayoutExtractionOptions = {}): string
771
782
  }
772
783
  const normal = await capture(false)
773
784
  const background = await capture(true)
785
+ const colorProbe = document.createElement('canvas').getContext('2d')
786
+ const rgbOf = (color) => {
787
+ if (!colorProbe || !color) return undefined
788
+ colorProbe.clearRect(0, 0, 1, 1)
789
+ colorProbe.fillStyle = color
790
+ colorProbe.fillRect(0, 0, 1, 1)
791
+ const pixel = colorProbe.getImageData(0, 0, 1, 1).data
792
+ return pixel[3] === 255 ? [pixel[0], pixel[1], pixel[2]] : undefined
793
+ }
774
794
  for (const element of textElements) {
775
795
  element.contrast = scoreContrast({
776
796
  normal,
@@ -778,6 +798,7 @@ export function layoutGetNativeEval(opts: LayoutExtractionOptions = {}): string
778
798
  box: element.box,
779
799
  fontSize: element.fontSize,
780
800
  fontWeight: element.fontWeight,
801
+ declaredColor: rgbOf(element.color),
781
802
  })
782
803
  }
783
804
  return elements
@@ -880,7 +901,7 @@ export function formatLayoutElements(
880
901
  if (el.contrast) {
881
902
  const score =
882
903
  el.contrast.ratio == null
883
- ? `?/${el.contrast.required}`
904
+ ? `?/${el.contrast.required}${el.contrast.reason ? ` (${el.contrast.reason})` : ''}`
884
905
  : `${el.contrast.ratio}/${el.contrast.required}${el.contrast.ratio < el.contrast.required && !el.disabled ? ' FAIL' : ''}`
885
906
  parts.push(`contrast:${score}`)
886
907
  if (el.contrast.background) parts.push(`on:${el.contrast.background}`)
@@ -3,6 +3,16 @@ import { createHash, randomUUID } from 'node:crypto'
3
3
  import fs from 'node:fs'
4
4
  import os from 'node:os'
5
5
  import path from 'node:path'
6
+ import {
7
+ detachBundleGlobalFooter,
8
+ stripBundleMetadataFooter,
9
+ } from '@peach/globals/bundle-global-footer'
10
+ import {
11
+ insertPackageVersionsFooter,
12
+ readPackageVersions,
13
+ readPackageVersionsFooter,
14
+ type PackageVersions,
15
+ } from '@peach/globals/package-versions'
6
16
  import {
7
17
  extractAssetDescriptors,
8
18
  metroAssetScaleFilename,
@@ -14,10 +24,6 @@ import {
14
24
  packageSettingDefaults,
15
25
  type AppPackageManifest,
16
26
  } from '../../src/appPackageContract'
17
- import {
18
- detachBundleGlobalFooter,
19
- stripBundleMetadataFooter,
20
- } from '../../src/bundleGlobalFooter'
21
27
  import { getCliRuntime, verifyCliCompanion } from '../../src/cli-runtime'
22
28
  import { produceConfiguredBundle } from '../../src/configured-bundle-producer'
23
29
  import { activeDesktopHostApp } from '../../src/desktop-host-delivery'
@@ -38,12 +44,6 @@ import {
38
44
  nativeBundleAssets,
39
45
  } from '../../src/native-bundles'
40
46
  import { readExpoConfigAsync } from '../../src/native-firebase-config'
41
- import {
42
- insertPackageVersionsFooter,
43
- readPackageVersions,
44
- readPackageVersionsFooter,
45
- type PackageVersions,
46
- } from '../../src/packageVersionsContract'
47
47
  import { terminateProcessGroup } from '../../src/process-group'
48
48
  import { resolveActiveRuntimeRoot } from '../../src/runtime-assets'
49
49
  import { discoverAppCatalog } from '../app-catalog'
@@ -707,9 +707,18 @@ export async function runPackage(args: string[]): Promise<void> {
707
707
  }
708
708
  fs.writeFileSync(path.join(resources, 'peach-app.json'), JSON.stringify(manifest))
709
709
  fs.writeFileSync(path.join(resources, 'app-launcher.cjs'), packagedAppLauncher)
710
+ // launchd refuses a script executable beside a mach-o when the plist sets LSEnvironment
711
+ // (posix error 162), so the launcher exports the host's environment instead
712
+ const exports = Object.entries(
713
+ isRecord(hostInfo.LSEnvironment) ? hostInfo.LSEnvironment : {},
714
+ )
715
+ .map(
716
+ ([key, value]) => `export ${key}='${String(value).replaceAll("'", `'\\''`)}'\n`,
717
+ )
718
+ .join('')
710
719
  fs.writeFileSync(
711
720
  path.join(contents, 'MacOS', 'PeachApp'),
712
- '#!/bin/sh\nexec "$(dirname "$0")/../Frameworks/node" "$(dirname "$0")/../Resources/app-launcher.cjs" "$@"\n',
721
+ `#!/bin/sh\n${exports}exec "$(dirname "$0")/../Frameworks/node" "$(dirname "$0")/../Resources/app-launcher.cjs" "$@"\n`,
713
722
  { mode: 0o755 },
714
723
  )
715
724
  const bundleInfo: Record<string, unknown> = {
@@ -719,7 +728,7 @@ export async function runPackage(args: string[]): Promise<void> {
719
728
  CFBundleName: name,
720
729
  CFBundleDisplayName: name,
721
730
  }
722
- for (const key of ['CFBundleURLTypes', 'SUFeedURL', 'SUPublicEDKey'])
731
+ for (const key of ['CFBundleURLTypes', 'LSEnvironment', 'SUFeedURL', 'SUPublicEDKey'])
723
732
  delete bundleInfo[key]
724
733
  fs.writeFileSync(plist, JSON.stringify(bundleInfo))
725
734
  execFileSync('/usr/bin/plutil', ['-convert', 'xml1', plist])
@@ -352,12 +352,14 @@ function stampAppFonts(
352
352
  platform: 'ios' | 'android',
353
353
  nativeAssetOrigin: string,
354
354
  project?: ResolvedAppProject | null,
355
+ appFontsDir?: string,
355
356
  ): string {
356
357
  try {
357
358
  const url = new URL(urlStr)
358
- if (!url.searchParams.get('bundle') || !project) return urlStr
359
+ const projectDir = project?.appDir ?? appFontsDir
360
+ if (!url.searchParams.get('bundle') || !projectDir) return urlStr
359
361
  const specs = discoverNativeLinkedAppFonts({
360
- projectDir: project.appDir,
362
+ projectDir,
361
363
  platform,
362
364
  nativeAssetOrigin,
363
365
  })
@@ -489,6 +491,9 @@ function splashImageOnDisk(imageUrl: string, appDir: string): boolean {
489
491
  }
490
492
 
491
493
  export interface BuildShellUrlOptions {
494
+ // a directory of font files to register when the app has no project to scan,
495
+ // as a stored bundle replay does.
496
+ appFontsDir?: string
492
497
  // manifest and asset origin provided by an authenticated recorder proxy.
493
498
  bundleOriginOverride?: string
494
499
  // marks native host windows so the bridge can reuse a CLI-opened desktop sim.
@@ -778,7 +783,7 @@ export async function buildShellUrl(
778
783
  }
779
784
  const stamped = await stampAppCatalog(
780
785
  await stampAppSplash(
781
- stampAppFonts(resolved, platform, nativeAssetOrigin, project),
786
+ stampAppFonts(resolved, platform, nativeAssetOrigin, project, opts.appFontsDir),
782
787
  project,
783
788
  opts.oneAppSplash,
784
789
  ),
@@ -21,8 +21,8 @@ import {
21
21
  runtimeDir,
22
22
  } from '../../src/home-paths'
23
23
  import { resolveRNXAppConfig } from '../app-config'
24
+ import { DEFAULT_CLI_RELEASE_ORIGIN } from '../cli-release-origin'
24
25
  import {
25
- DEFAULT_CLI_RELEASE_ORIGIN,
26
26
  fetchCliReleaseFile,
27
27
  refreshCliUpdateCache,
28
28
  } from '../cli-update'
@@ -8,7 +8,7 @@ import { join } from 'node:path'
8
8
  import { installVerifiedTarball } from '@contrast/runtime-delivery'
9
9
  import { rnxHomeDir } from '../../src/home-paths'
10
10
  import { isRecord } from '../../src/is-record'
11
- import { DEFAULT_CLI_RELEASE_ORIGIN } from '../cli-update'
11
+ import { DEFAULT_CLI_RELEASE_ORIGIN } from '../cli-release-origin'
12
12
  import lockJson from './linux-browser-libs.lock.json' with { type: 'json' }
13
13
 
14
14
  // the debian package providing each shared library chromium and swift link
@@ -325,6 +325,10 @@ export const DECLARED_OUTBOUND_CALLS: Record<string, OutboundCallDeclaration> =
325
325
  category: 'local_development',
326
326
  count: 1,
327
327
  },
328
+ 'packages/peach-engine/src/guest/bedrock-assets.ts :: fetch-alias :: url': {
329
+ category: 'same_origin_runtime',
330
+ count: 1,
331
+ },
328
332
  'packages/peach-engine/src/engine/barcode-reader.worker.ts :: fetch :: wasmUrl': {
329
333
  category: 'same_origin_runtime',
330
334
  count: 1,
@@ -2,11 +2,11 @@ import { spawn } from 'node:child_process'
2
2
  import { readFileSync, writeFileSync } from 'node:fs'
3
3
  import { createRequire } from 'node:module'
4
4
  import { dirname, join } from 'node:path'
5
- import { readInstalledNativePackageVersionsAsync } from '../src/installed-package-versions'
6
5
  import {
7
6
  insertPackageVersionsFooter,
8
7
  readPackageVersionsFooter,
9
- } from '../src/packageVersionsContract'
8
+ } from '@peach/globals/package-versions'
9
+ import { readInstalledNativePackageVersionsAsync } from '../src/installed-package-versions'
10
10
  import { detectProject } from './commands/detect'
11
11
  import type { RemotePlatform } from './cloud-session'
12
12
 
package/detox/index.ts CHANGED
@@ -1132,8 +1132,10 @@ async function dispatchStatusBarOverride(config: StatusBarConfig) {
1132
1132
  // right; android keeps the engine's default landscape.
1133
1133
  async function dispatchDeviceOrientation(orientation: 'portrait' | 'landscape') {
1134
1134
  const page = getPage()
1135
+ const captureToken = Reflect.get(page, '__sootsimCaptureToken')
1135
1136
  await page.evaluate(
1136
- ({ eventType, next, landscapeSide }) => {
1137
+ ({ eventType, next, landscapeSide, token }) => {
1138
+ if (token) window.__sootsimAnchorTimedInput?.(token)
1137
1139
  window.dispatchEvent(
1138
1140
  new CustomEvent(eventType, {
1139
1141
  detail: { type: 'set-device-orientation', orientation: next, landscapeSide },
@@ -1144,6 +1146,7 @@ async function dispatchDeviceOrientation(orientation: 'portrait' | 'landscape')
1144
1146
  eventType: SOOTSIM_SHELL_COMMAND_NAME,
1145
1147
  next: orientation,
1146
1148
  landscapeSide: DETOX_PLATFORM === 'ios' ? 'right' : 'left',
1149
+ token: captureToken,
1147
1150
  },
1148
1151
  )
1149
1152
  // destination dimensions publish before the interface finishes turning.
@@ -1169,13 +1172,15 @@ async function dispatchDeviceOrientation(orientation: 'portrait' | 'landscape')
1169
1172
  // resolves once the fold bus reports the hinge resting there.
1170
1173
  async function dispatchDevicePosture(rest: 'closed' | 'book' | 'open') {
1171
1174
  const page = getPage()
1175
+ const captureToken = Reflect.get(page, '__sootsimCaptureToken')
1172
1176
  await page.evaluate(
1173
- ({ eventType, rest }) => {
1177
+ ({ eventType, rest, token }) => {
1178
+ if (token) window.__sootsimAnchorTimedInput?.(token)
1174
1179
  window.dispatchEvent(
1175
1180
  new CustomEvent(eventType, { detail: { type: 'fold-to-rest', rest } }),
1176
1181
  )
1177
1182
  },
1178
- { eventType: SOOTSIM_SHELL_COMMAND_NAME, rest },
1183
+ { eventType: SOOTSIM_SHELL_COMMAND_NAME, rest, token: captureToken },
1179
1184
  )
1180
1185
  await page.waitForFunction(
1181
1186
  (rest) => {
@@ -4335,7 +4340,7 @@ export const device = {
4335
4340
  // actually fired (typically within a few ms of offsetMs).
4336
4341
  async takeScreenshotStagesFast(
4337
4342
  namePrefix: string,
4338
- stages: Array<{ label: string; offsetMs: number }>,
4343
+ stages: Array<{ label: string; offsetMs: number; nativeActualMs?: number }>,
4339
4344
  options: {
4340
4345
  anchorAfterTrigger?: boolean
4341
4346
  skipWarmup?: boolean
@@ -4510,7 +4515,9 @@ export const device = {
4510
4515
  },
4511
4516
  Math.max(
4512
4517
  0,
4513
- captureAnchorPerformanceMs + stage.offsetMs - performance.now(),
4518
+ captureAnchorPerformanceMs +
4519
+ (stage.nativeActualMs ?? stage.offsetMs) -
4520
+ performance.now(),
4514
4521
  ),
4515
4522
  )
4516
4523
  }),
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (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.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (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.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (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.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (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.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (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;
package/dist-lib/beta.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (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;
package/dist-lib/beta.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/beta.ts
4
4
  var IS_BETA = true;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (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.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (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.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var SIM_LONG_PRESS_MAX_MS = 5e3;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (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.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var REFUSED_PERFORM_STEP_TYPES = [