peachsim 0.1.1619 → 0.1.1625

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 (140) hide show
  1. package/README.md +35 -5
  2. package/cli/app-fonts.ts +2 -1
  3. package/cli/bridge-flow-runner.ts +222 -175
  4. package/cli/cloud-client.ts +81 -48
  5. package/cli/commands/box/search-command.ts +3 -2
  6. package/cli/commands/box.ts +10 -29
  7. package/cli/commands/control.ts +108 -43
  8. package/cli/commands/inspect/settling.ts +57 -20
  9. package/cli/commands/maestro-compare.ts +11 -32
  10. package/cli/commands/platform.ts +74 -17
  11. package/cli/commands/record.ts +20 -15
  12. package/cli/commands/upload.ts +5 -1
  13. package/cli/dev-build-freshness.ts +37 -2
  14. package/cli/drivers/playwright-sim-host.ts +18 -6
  15. package/cli/maestro-accessibility.ts +53 -0
  16. package/cli/maestro-compare.ts +24 -0
  17. package/cli/outbound-endpoints.ts +27 -8
  18. package/cli/parent-pid.ts +0 -9
  19. package/cli/remote-simulators.ts +112 -0
  20. package/cli/remoteSimulatorContract.ts +21 -0
  21. package/detox/expectations.ts +5 -1
  22. package/detox/index.ts +133 -98
  23. package/detox/motion-change.cjs +37 -0
  24. package/detox/motion-change.d.cts +16 -0
  25. package/detox/navigation-lifecycle.ts +22 -4
  26. package/dist-lib/agent-daemon-client.cjs +3 -2
  27. package/dist-lib/agent-events.cjs +1 -1
  28. package/dist-lib/attached-projects.cjs +1 -1
  29. package/dist-lib/auth/shared-session.cjs +3 -2
  30. package/dist-lib/backend-origin.cjs +1 -1
  31. package/dist-lib/beta.cjs +1 -1
  32. package/dist-lib/beta.mjs +1 -1
  33. package/dist-lib/bridge-constants.cjs +1 -1
  34. package/dist-lib/bridge-contract-input.cjs +1 -1
  35. package/dist-lib/bridge-contract-input.mjs +1 -1
  36. package/dist-lib/bridge-contract.cjs +1 -1
  37. package/dist-lib/bridge-contract.mjs +1 -1
  38. package/dist-lib/bundle-channel.cjs +1528 -937
  39. package/dist-lib/capture-contract.cjs +1 -1
  40. package/dist-lib/capture-contract.mjs +1 -1
  41. package/dist-lib/cloud-contract.cjs +1 -1
  42. package/dist-lib/cloud-contract.mjs +1 -1
  43. package/dist-lib/cloud-test-args.cjs +1 -1
  44. package/dist-lib/cloud-test-args.mjs +1 -1
  45. package/dist-lib/cloud.cjs +4 -3
  46. package/dist-lib/cloud.mjs +4 -3
  47. package/dist-lib/config.cjs +5 -4
  48. package/dist-lib/config.mjs +5 -4
  49. package/dist-lib/detox/index.cjs +1021 -364
  50. package/dist-lib/dev-bundle-resolution.cjs +51 -23
  51. package/dist-lib/expo-swift-bundle.cjs +1351 -804
  52. package/dist-lib/expo-swift-metadata.cjs +5 -4
  53. package/dist-lib/expo-swift-metadata.mjs +5 -4
  54. package/dist-lib/home-paths.cjs +1 -1
  55. package/dist-lib/host/bridge-host.cjs +2475 -1343
  56. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  57. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  58. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  59. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  60. package/dist-lib/host/websocket-proxy.cjs +1 -1
  61. package/dist-lib/index.cjs +1269 -300
  62. package/dist-lib/jump-to-source-babel.cjs +1 -1
  63. package/dist-lib/jump-to-source-native.cjs +1 -1
  64. package/dist-lib/kotlin-host.cjs +1 -1
  65. package/dist-lib/menu.cjs +3 -2
  66. package/dist-lib/menu.mjs +3 -2
  67. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  68. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  69. package/dist-lib/metro-production-bundle.cjs +5 -4
  70. package/dist-lib/metro-production-bundle.mjs +5 -4
  71. package/dist-lib/metro.cjs +806 -398
  72. package/dist-lib/native-app-identity-project.cjs +729 -21
  73. package/dist-lib/native-app-identity-project.mjs +728 -21
  74. package/dist-lib/native-app-identity.cjs +232 -9
  75. package/dist-lib/native-app-identity.mjs +230 -8
  76. package/dist-lib/native-firebase-metadata.cjs +5 -4
  77. package/dist-lib/native-firebase-metadata.mjs +5 -4
  78. package/dist-lib/plist.cjs +1 -1
  79. package/dist-lib/plist.mjs +1 -1
  80. package/dist-lib/profiles.cjs +1 -1
  81. package/dist-lib/public-brand.cjs +3 -2
  82. package/dist-lib/react-native-host-modules.cjs +4 -1
  83. package/dist-lib/react-native-host-modules.mjs +4 -1
  84. package/dist-lib/scripts/dev-server-scanner.cjs +94 -28
  85. package/dist-lib/sdk.cjs +89 -24
  86. package/dist-lib/sdk.mjs +89 -24
  87. package/dist-lib/skills.cjs +4471 -2394
  88. package/dist-lib/swift-compile.cjs +336 -145
  89. package/dist-lib/swift-compile.mjs +350 -150
  90. package/dist-lib/swift-package.cjs +1 -1
  91. package/dist-lib/swift-package.mjs +1 -1
  92. package/dist-lib/swift-submit.cjs +1 -1
  93. package/dist-lib/swift-submit.mjs +1 -1
  94. package/dist-lib/swift-toolchain.cjs +1 -1
  95. package/dist-lib/swift.cjs +1 -1
  96. package/dist-lib/vite-swift.cjs +891 -557
  97. package/dist-lib/vite.cjs +68 -14
  98. package/dist-lib/worklet-executable.cjs +25 -2
  99. package/dist-lib/worklet-executable.mjs +25 -2
  100. package/package.json +2 -2
  101. package/scripts/dev-server-scanner.ts +33 -13
  102. package/src/admitted-mac-build.ts +34 -8
  103. package/src/android-app-identity.ts +146 -0
  104. package/src/android-autolinking.ts +75 -0
  105. package/src/android-string-value.ts +36 -0
  106. package/src/android-strings.ts +5 -36
  107. package/src/androidAutolinkingContract.ts +40 -0
  108. package/src/bundleGlobalFooter.ts +26 -7
  109. package/src/cloud.ts +2 -2
  110. package/src/codex-client.ts +3 -2
  111. package/src/dev-bundle-resolution.ts +58 -25
  112. package/src/expo-kotlin-host.ts +6 -36
  113. package/src/expo-swift-bundle.ts +17 -12
  114. package/src/expo-swift-host.ts +477 -173
  115. package/src/expoSwiftContract.ts +6 -0
  116. package/src/host/bridge-host.ts +7 -55
  117. package/src/host/staged-host-files.ts +29 -2
  118. package/src/installed-package-versions.ts +54 -14
  119. package/src/launchMetadataContract.ts +24 -0
  120. package/src/metro-plugin.ts +37 -42
  121. package/src/native-app-identity-project.ts +118 -3
  122. package/src/native-app-identity.ts +103 -11
  123. package/src/nitro-compile.ts +2 -5
  124. package/src/nitro-source.ts +147 -63
  125. package/src/process-group.ts +90 -60
  126. package/src/process-output.ts +0 -9
  127. package/src/public-brand.ts +1 -0
  128. package/src/react-native-host-modules.ts +3 -0
  129. package/src/sim-client.ts +6 -4
  130. package/src/swift-compile.ts +185 -31
  131. package/src/swift-distribution.lock.json +37 -11
  132. package/src/swift-distribution.ts +61 -9
  133. package/src/swift-host.ts +58 -27
  134. package/src/swift-objc-standin.ts +13 -0
  135. package/src/swift-standin-emit.ts +1 -1
  136. package/src/swift-standins.ts +17 -5
  137. package/src/vite-plugin.ts +8 -19
  138. package/src/worklet-executable.ts +30 -3
  139. package/src/worklets-babel.ts +35 -14
  140. package/src/xcode-project.ts +10 -0
package/README.md CHANGED
@@ -231,6 +231,11 @@ actions discover the sim's owning world. Each world probe has one two-second
231
231
  wall deadline covering both connection and response. An inferred default port
232
232
  does not override the named sim's world.
233
233
 
234
+ Bridge sockets use TCP keepalive so a governor-stopped browser can resume an
235
+ in-flight render without losing its connection to an unanswered application
236
+ ping. Command deadlines still bound stalled work; idle leases and abandoned
237
+ sim cleanup remain separate from transport liveness.
238
+
234
239
  **The sim** is a browser/Electron *page* launched by a CLI driver. Inside that
235
240
  page run three workers: the **shell worker** owns device and native state, the
236
241
  **compositor worker** paints every visible CanvasKit surface, and the **tenant
@@ -279,7 +284,7 @@ therefore runs before assertions in each flow.
279
284
  | 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` |
280
285
  | 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` |
281
286
  | `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` |
282
- | `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, applies worklets/babel transforms, and instantiates `SootSimBridgeHost` in its dev server. Distinct from the published `peachsim/vite` export. | `src/vite-plugin.ts`, `src/worklets-babel.ts`, `packages/peach-compat/src/stub-manifest.ts` |
287
+ | `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` |
283
288
  | 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` |
284
289
 
285
290
  ## Getting started
@@ -510,8 +515,8 @@ a supported input; pass Peach the JavaScript bundle produced before Hermes
510
515
  compilation.
511
516
 
512
517
  If an app has unusual dependencies or fingerprint inference fails, you can
513
- optionally wrap your Metro configuration with `withPeach(config)`. It takes no
514
- options and enables two integrations:
518
+ optionally wrap your Metro configuration with `withPeach(config)`. It enables
519
+ two integrations:
515
520
 
516
521
  1. **Deterministic module identity:** appends Metro's exact module identity map
517
522
  as a trailing `globalThis.__sootsimModulePaths = { ... }` footer to every
@@ -521,6 +526,23 @@ options and enables two integrations:
521
526
  2. **In-browser dev shell:** serves the Peach simulator shell at `/__peachsim/` on
522
527
  the Metro dev server.
523
528
 
529
+ Native app identity also travels in the bundle. Android permissions come only
530
+ from a completed app manifest merger output. A sole output under
531
+ `android/<module>/build/intermediates/merged_manifests/` is selected automatically;
532
+ select one explicitly when multiple variants exist:
533
+
534
+ ```js
535
+ module.exports = withPeach(config, {
536
+ androidMergedManifest:
537
+ 'android/app/build/intermediates/merged_manifests/debug/processDebugManifest/AndroidManifest.xml',
538
+ })
539
+ ```
540
+
541
+ Without resolved merged output, Android permissions contain only the explicit
542
+ Expo `android.permissions` set minus `android.blockedPermissions`. Defaults,
543
+ plugins and linked library additions require completed merged output. See the
544
+ [native identity contract](../../specs/sootsim-engine/native-app-identity.md).
545
+
524
546
  The URL helpers request ordinary Metro graphs: `dev=false&minify=true` for
525
547
  production and `dev=true&minify=false` for development.
526
548
 
@@ -571,6 +593,12 @@ and video recording create a new browser context; cold launches still use the
571
593
  supplied shell URL. When synchronization is enabled, URL delivery waits for
572
594
  existing work before dispatch and for navigation and painting afterward.
573
595
 
596
+ Element taps finish viewport measurement before resolving the selected node's
597
+ current center, visible frame, and relative offset in the browser task that
598
+ sends the physical tap. Stillness samples do not supply later tap coordinates:
599
+ startup layout can change while other bridge reads finish. A removed node
600
+ rejects the action instead of reusing its old geometry.
601
+
574
602
  See `../../docs/migrating-from-detox.md` for details.
575
603
 
576
604
  ## Coming from Maestro
@@ -751,8 +779,10 @@ fails instead of loading empty native configuration. Bare Metro, which has no
751
779
  Expo manifest project root, uses
752
780
  the listening development process's cwd inside that same resolver. The invoking
753
781
  CLI's cwd is never an asset/config fallback. Asset wires stay on each opened
754
- project URL, so one daemon can serve several attached projects without sharing
755
- font or splash state between them.
782
+ project URL. Font catalogs use content-addressed bridge asset references, so
783
+ the navigation request stays bounded as the number of fonts grows. Recordings
784
+ resolve these references before capturing the catalog and its assets. One daemon
785
+ can serve several attached projects without sharing font or splash state.
756
786
 
757
787
  Bare iOS projects carry default Firebase options from their selected app
758
788
  target's Google services build resource when the app delegate initializes
package/cli/app-fonts.ts CHANGED
@@ -4,6 +4,7 @@ import { createRequire } from 'node:module'
4
4
  import path from 'node:path'
5
5
  import {
6
6
  encodeAppFontsWire,
7
+ resolveAppFontsWire,
7
8
  expoFontPathsFromPlugins,
8
9
  nativeLinkedFontSpecsFromPaths,
9
10
  metroFontSpecsFromPaths,
@@ -448,7 +449,7 @@ export async function fetchAppFontFiles(
448
449
  ): Promise<FetchedAppFont[]> {
449
450
  const out: FetchedAppFont[] = []
450
451
  const seen = new Set<string>()
451
- for (const url of appFontAssetUrlsFromWire(wire)) {
452
+ for (const url of appFontAssetUrlsFromWire(await resolveAppFontsWire(wire, fetch))) {
452
453
  const urlhash = createHash('sha256').update(url).digest('hex')
453
454
  if (seen.has(urlhash)) continue
454
455
  seen.add(urlhash)