peachsim 0.1.1815 → 0.1.1818

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 (147) hide show
  1. package/cli/commands/agent-indicator-mode.ts +2 -1
  2. package/cli/commands/coverage-swift.ts +4 -3
  3. package/cli/commands/flow.ts +7 -0
  4. package/cli/commands/inspect/core.ts +1 -1
  5. package/cli/commands/maestro-compare.ts +7 -0
  6. package/cli/commands/package.ts +87 -31
  7. package/cli/commands/screenshot-mode.ts +2 -1
  8. package/cli/commands/shell-boolean-mode.ts +7 -3
  9. package/cli/commands/shell-url.ts +4 -0
  10. package/cli/commands/show-touches-mode.ts +2 -1
  11. package/cli/commands/test.ts +3 -2
  12. package/cli/commands/three-mode.ts +2 -1
  13. package/cli/outbound-endpoints.ts +1 -1
  14. package/cli/packaged-app-launcher.ts +6 -1
  15. package/dist-lib/agent-daemon-client.cjs +1 -1
  16. package/dist-lib/agent-events.cjs +1 -1
  17. package/dist-lib/attached-projects.cjs +1 -1
  18. package/dist-lib/auth/shared-session.cjs +1 -1
  19. package/dist-lib/backend-origin.cjs +1 -1
  20. package/dist-lib/beta.cjs +1 -1
  21. package/dist-lib/beta.mjs +1 -1
  22. package/dist-lib/bridge-constants.cjs +1 -1
  23. package/dist-lib/bridge-contract-input.cjs +1 -1
  24. package/dist-lib/bridge-contract-input.mjs +1 -1
  25. package/dist-lib/bridge-contract.cjs +1 -1
  26. package/dist-lib/bridge-contract.mjs +1 -1
  27. package/dist-lib/bundle-channel.cjs +5728 -7551
  28. package/dist-lib/capture-contract.cjs +1 -1
  29. package/dist-lib/capture-contract.mjs +1 -1
  30. package/dist-lib/cloud-contract.cjs +1 -1
  31. package/dist-lib/cloud-contract.mjs +1 -1
  32. package/dist-lib/cloud-test-args.cjs +1 -1
  33. package/dist-lib/cloud-test-args.mjs +1 -1
  34. package/dist-lib/cloud.cjs +1 -1
  35. package/dist-lib/cloud.mjs +1 -1
  36. package/dist-lib/config.cjs +1 -1
  37. package/dist-lib/config.mjs +1 -1
  38. package/dist-lib/detox/index.cjs +13 -4
  39. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  40. package/dist-lib/expo-swift-bundle.cjs +5234 -5704
  41. package/dist-lib/expo-swift-metadata.cjs +1 -1
  42. package/dist-lib/expo-swift-metadata.mjs +1 -1
  43. package/dist-lib/home-paths.cjs +1 -1
  44. package/dist-lib/host/bridge-host.cjs +4913 -6811
  45. package/dist-lib/host/fetch-proxy-handler.cjs +13 -4
  46. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  47. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  48. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  49. package/dist-lib/host/websocket-proxy.cjs +1 -1
  50. package/dist-lib/index.cjs +40 -30
  51. package/dist-lib/jump-to-source-babel.cjs +1 -1
  52. package/dist-lib/jump-to-source-native.cjs +1 -1
  53. package/dist-lib/kotlin-host.cjs +1 -1
  54. package/dist-lib/menu.cjs +1 -1
  55. package/dist-lib/menu.mjs +1 -1
  56. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  57. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  58. package/dist-lib/metro-production-bundle.cjs +1 -1
  59. package/dist-lib/metro-production-bundle.mjs +1 -1
  60. package/dist-lib/metro.cjs +39 -29
  61. package/dist-lib/native-app-identity-project.cjs +31 -26
  62. package/dist-lib/native-app-identity-project.mjs +295 -279
  63. package/dist-lib/native-app-identity.cjs +1 -1
  64. package/dist-lib/native-app-identity.mjs +1 -1
  65. package/dist-lib/native-firebase-metadata.cjs +1 -1
  66. package/dist-lib/native-firebase-metadata.mjs +1 -1
  67. package/dist-lib/pdfium-raster.cjs +1 -1
  68. package/dist-lib/pdfium-raster.mjs +1 -1
  69. package/dist-lib/plist.cjs +1 -1
  70. package/dist-lib/plist.mjs +1 -1
  71. package/dist-lib/profiles.cjs +1 -1
  72. package/dist-lib/public-brand.cjs +1 -1
  73. package/dist-lib/public-origins-lib-esm.json +29 -24
  74. package/dist-lib/public-origins-lib.json +121 -93
  75. package/dist-lib/react-native-host-modules.cjs +1 -1
  76. package/dist-lib/react-native-host-modules.mjs +1 -1
  77. package/dist-lib/reap-browser.cjs +1 -1
  78. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  79. package/dist-lib/sdk.cjs +2 -2
  80. package/dist-lib/sdk.mjs +2 -2
  81. package/dist-lib/skills.cjs +64622 -66476
  82. package/dist-lib/swift-compile.cjs +328 -265
  83. package/dist-lib/swift-compile.mjs +335 -270
  84. package/dist-lib/swift-package.cjs +1 -1
  85. package/dist-lib/swift-package.mjs +1 -1
  86. package/dist-lib/swift-submit.cjs +1 -1
  87. package/dist-lib/swift-submit.mjs +1 -1
  88. package/dist-lib/swift-toolchain.cjs +52 -6
  89. package/dist-lib/swift.cjs +1 -1
  90. package/dist-lib/vite-swift.cjs +2405 -2262
  91. package/dist-lib/vite.cjs +13 -4
  92. package/dist-lib/worklet-executable.cjs +1 -1
  93. package/dist-lib/worklet-executable.mjs +1 -1
  94. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +5 -0
  95. package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +41 -0
  96. package/dist-types/packages/peach-engine/src/render-worker/mapServicesContract.d.ts +45 -0
  97. package/package.json +2 -1
  98. package/runtime-companion.json +1 -1
  99. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes +1 -1
  100. package/sdk/ios/usr/include/module.modulemap +3 -0
  101. package/sdk/ios/usr/include/notify.modulemap +9 -0
  102. package/sdk/ios/usr/lib/swift/Darwin.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
  103. package/sdk/ios/usr/lib/swift/Dispatch.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -1
  104. package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -1
  105. package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
  106. package/sdk/ios/usr/lib/swift/SwiftUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +21 -0
  107. package/sdk/ios/usr/lib/swift/SwiftUICore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +6 -1
  108. package/sdk/ios/wasm/include/__header_time.h +4 -0
  109. package/sdk/ios/wasm/include/pthread.h +2 -0
  110. package/sdk/ios/wasm/include/sys/mman.h +1 -1
  111. package/sdk/ios/wasm/include/sys/resource.h +31 -0
  112. package/sdk/ios/wasm/include/unistd.h +4 -0
  113. package/src/answeredNativePackages.ts +43 -0
  114. package/src/cli-runtime.ts +2 -9
  115. package/src/expo-discovery-cache.ts +71 -52
  116. package/src/expo-kotlin-host.ts +11 -9
  117. package/src/expo-swift-host.ts +55 -13
  118. package/src/installed-native-libraries.ts +103 -20
  119. package/src/native-static-libraries.ts +69 -33
  120. package/src/nitro-adapter.ts +0 -9
  121. package/src/nitro-bundle.ts +8 -6
  122. package/src/nitro-compile.ts +45 -16
  123. package/src/nitro-compiler-digest.ts +2 -4
  124. package/src/nitro-superset.lock.json +19 -251
  125. package/src/nitro-superset.ts +63 -68
  126. package/src/plist-bytes.ts +9 -0
  127. package/src/portable-expo-workspace.ts +4 -3
  128. package/src/react-native-bridge-modules.ts +13 -19
  129. package/src/swift-compile.ts +379 -269
  130. package/src/swift-cxx-reachable.ts +13 -0
  131. package/src/swift-distribution.ts +3 -4
  132. package/src/swift-host.ts +5 -3
  133. package/src/swift-installed-targets.ts +32 -14
  134. package/src/swift-native-pin.ts +45 -0
  135. package/src/swift-objc-compile.ts +23 -1
  136. package/src/swift-objc-standin.ts +14 -7
  137. package/src/swift-package-manifest.ts +2 -2
  138. package/src/swift-root-lock.ts +4 -3
  139. package/src/swift-standins.ts +41 -38
  140. package/src/swift-toolchain.ts +69 -12
  141. package/src/swift-wasm-prune.ts +1 -0
  142. package/src/swift-xcframework.ts +23 -12
  143. package/src/swiftContract.ts +2 -0
  144. package/src/swiftNativePinContract.ts +68 -0
  145. package/src/turbo-bundle.ts +14 -6
  146. package/src/turbo-compile.ts +76 -11
  147. package/src/turbo-source.ts +93 -18
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1815 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1818 | (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;
@@ -203,7 +203,10 @@ function isValidRuntimeVersion(value) {
203
203
  }
204
204
 
205
205
  // runtime-companion.json
206
- var runtime_companion_default = { abi: 1, sha256: "d657f8c4fd2d3c861f50ea15c42b3275555ac4f799c58a46d3dca829656bc63c", file: "node/cli-d657f8c4fd2d3c861f50ea15c42b3275555ac4f799c58a46d3dca829656bc63c.cjs" };
206
+ var runtime_companion_default = { abi: 1, sha256: "0fda369d66d17e92f3f6c07043aeadb1a813f69c0309f4fa58eb3485eb1ae332", file: "node/cli-0fda369d66d17e92f3f6c07043aeadb1a813f69c0309f4fa58eb3485eb1ae332.cjs" };
207
+
208
+ // src/answeredNativePackages.ts
209
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
207
210
 
208
211
  // src/runtime-assets.ts
209
212
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -484,6 +487,13 @@ function streamFile(res, stream) {
484
487
  stream.pipe(res);
485
488
  }
486
489
 
490
+ // src/answeredNativePackages.ts
491
+ function peachRuntimeRoot() {
492
+ const root = resolveDevCheckoutRuntimeAssetRoot() ?? resolveActiveRuntimeRoot();
493
+ if (!root) throw new Error("No Peach runtime installed; run `peach runtime install`");
494
+ return root;
495
+ }
496
+
487
497
  // src/cli-runtime.ts
488
498
  var CLI_COMPANION_ABI = 1;
489
499
  function cliCompanionPath() {
@@ -513,8 +523,7 @@ function verifyCompanionFile(file) {
513
523
  var loaded;
514
524
  function getCliRuntime() {
515
525
  if (loaded) return loaded.runtime;
516
- const root = resolveDevCheckoutRuntimeAssetRoot() ?? resolveActiveRuntimeRoot();
517
- if (!root) throw new Error("No Peach runtime installed; run `peach runtime install`");
526
+ const root = peachRuntimeRoot();
518
527
  verifyCliCompanion(root);
519
528
  const require2 = (0, import_node_module.createRequire)(__sootsim_import_meta_url);
520
529
  const runtime = require2((0, import_node_path2.join)(root, cliCompanionPath()));
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1815 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1818 | (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.1815 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1818 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/worklet-executable.ts
4
4
  import { parse } from "acorn";
@@ -1007,6 +1007,11 @@ export interface CompositorStats {
1007
1007
  maxMs: number;
1008
1008
  };
1009
1009
  };
1010
+ surfaceState: {
1011
+ received: number;
1012
+ drops: Record<string, number>;
1013
+ last: string | null;
1014
+ };
1010
1015
  appSurfaceLifecycle: {
1011
1016
  liveAppSurfaces: number;
1012
1017
  pendingPrewarms: number;
@@ -1,4 +1,5 @@
1
1
  import { type MapNativeOperation, type MapNativeEvent, type MapResourceRules } from './mapNativeContract.d.ts';
2
+ import { type MapServiceOperation } from './mapServicesContract.d.ts';
2
3
  import type { NativeSurfaceIdentity } from '../../../peach-globals/src/index.d.ts';
3
4
  export type LngLat = [number, number];
4
5
  export type MapCameraTransition = 'fly' | 'ease' | 'linear' | 'move';
@@ -37,6 +38,32 @@ export type MapMarker = {
37
38
  style?: 'apple-balloon';
38
39
  selected?: boolean;
39
40
  };
41
+ export type MapOverlayLine = {
42
+ id: string;
43
+ coordinates: LngLat[];
44
+ color: string;
45
+ width: number;
46
+ };
47
+ export type MapOverlayPolygon = {
48
+ id: string;
49
+ coordinates: LngLat[];
50
+ color: string;
51
+ lineColor: string;
52
+ lineWidth: number;
53
+ };
54
+ export type MapOverlayCircle = {
55
+ id: string;
56
+ center: LngLat;
57
+ radius: number;
58
+ color: string;
59
+ lineColor: string;
60
+ lineWidth: number;
61
+ };
62
+ export type MapOverlays = {
63
+ polylines: MapOverlayLine[];
64
+ polygons: MapOverlayPolygon[];
65
+ circles: MapOverlayCircle[];
66
+ };
40
67
  export type MapSource = {
41
68
  id: string;
42
69
  data?: unknown;
@@ -65,6 +92,12 @@ export type MapCommand = {
65
92
  mapId: string;
66
93
  requestId: number;
67
94
  operation: MapNativeOperation;
95
+ } | {
96
+ kind: 'service';
97
+ mapId: string;
98
+ requestId: number;
99
+ token: string;
100
+ operation: MapServiceOperation;
68
101
  } | ({
69
102
  kind: 'mount';
70
103
  mapId: string;
@@ -108,6 +141,10 @@ export type MapCommand = {
108
141
  kind: 'markers';
109
142
  mapId: string;
110
143
  markers: MapMarker[];
144
+ } | {
145
+ kind: 'overlays';
146
+ mapId: string;
147
+ overlays: MapOverlays;
111
148
  } | {
112
149
  kind: 'tap';
113
150
  mapId: string;
@@ -186,4 +223,8 @@ export declare function __resetMapCommandChannelState(): void;
186
223
  export declare function requestMapNative(mapId: string, operation: MapNativeOperation): Promise<unknown>;
187
224
  export declare function subscribeMapNativeEvents(mapId: string, listener: (event: MapNativeEvent) => void): () => void;
188
225
  export declare function releaseMapNativeRequests(mapId: string): void;
226
+ export declare function requestMapService(channel: string, token: string, operation: MapServiceOperation): {
227
+ requestId: number;
228
+ result: Promise<unknown>;
229
+ };
189
230
  export {};
@@ -0,0 +1,45 @@
1
+ export type MapServicePoint = {
2
+ latitude: number;
3
+ longitude: number;
4
+ };
5
+ export type MapServicePlace = {
6
+ name: string;
7
+ address: string;
8
+ coordinate: MapServicePoint;
9
+ };
10
+ export type MapServiceSuggestion = {
11
+ id: string;
12
+ title: string;
13
+ subtitle: string;
14
+ };
15
+ export type MapServiceRoute = {
16
+ distanceMeters: number;
17
+ expectedTravelTimeSeconds: number;
18
+ polyline: MapServicePoint[];
19
+ steps: Array<{
20
+ instructions: string;
21
+ distanceMeters: number;
22
+ }>;
23
+ };
24
+ export type MapServiceOperation = {
25
+ method: 'search' | 'autocomplete';
26
+ query: string;
27
+ center: MapServicePoint;
28
+ radiusMeters: number;
29
+ } | {
30
+ method: 'resolveSuggestion';
31
+ id: string;
32
+ } | {
33
+ method: 'directions';
34
+ origin: MapServicePoint;
35
+ destination: MapServicePoint;
36
+ transport: 'driving' | 'walking';
37
+ } | {
38
+ method: 'cancel';
39
+ requestId: number;
40
+ };
41
+ export declare function isMapServiceOperation(value: unknown): value is MapServiceOperation;
42
+ export declare function isMapServicePlace(value: unknown): value is MapServicePlace;
43
+ export declare function isMapServicePlaceList(value: unknown): value is MapServicePlace[];
44
+ export declare function isMapServiceSuggestionList(value: unknown): value is MapServiceSuggestion[];
45
+ export declare function isMapServiceRoute(value: unknown): value is MapServiceRoute;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.1815",
3
+ "version": "0.1.1818",
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",
@@ -355,6 +355,7 @@
355
355
  "@peculiar/x509": "1.14.3",
356
356
  "acorn": "^8.16.0",
357
357
  "@sucrase/jest-plugin": "3.0.0",
358
+ "bplist-parser": "0.3.2",
358
359
  "ignore": "7.0.5",
359
360
  "jiti": "2.7.0",
360
361
  "magic-string": "^0.30.21",
@@ -1 +1 @@
1
- {"abi":1,"sha256":"d657f8c4fd2d3c861f50ea15c42b3275555ac4f799c58a46d3dca829656bc63c","file":"node/cli-d657f8c4fd2d3c861f50ea15c42b3275555ac4f799c58a46d3dca829656bc63c.cjs"}
1
+ {"abi":1,"sha256":"0fda369d66d17e92f3f6c07043aeadb1a813f69c0309f4fa58eb3485eb1ae332","file":"node/cli-0fda369d66d17e92f3f6c07043aeadb1a813f69c0309f4fa58eb3485eb1ae332.cjs"}
@@ -1927,7 +1927,7 @@ Typedefs:
1927
1927
  - Name: UISceneSessionRole
1928
1928
  SwiftName: UISceneSession.Role
1929
1929
  - Name: UISheetPresentationControllerDetentIdentifier
1930
- SwiftName: UISheetPresentationControllerDetent.Identifier
1930
+ SwiftPrivate: true
1931
1931
  # Swift 4.2 Renames
1932
1932
  - Name: UIActivityType
1933
1933
  SwiftName: UIActivity.ActivityType
@@ -1,5 +1,7 @@
1
1
  module ObjectiveC [system] {
2
2
  umbrella "objc"
3
+ exclude header "objc/Protocol.h"
4
+ link "objc"
3
5
  export *
4
6
  module * { export * }
5
7
 
@@ -13,3 +15,4 @@ module ObjectiveC [system] {
13
15
  extern module os "os.modulemap"
14
16
  extern module Dispatch "dispatch.modulemap"
15
17
  extern module dnssd "dnssd.modulemap"
18
+ extern module notify "notify.modulemap"
@@ -0,0 +1,9 @@
1
+ module notify [system] {
2
+ header "notify.h"
3
+ export *
4
+
5
+ module notify_keys {
6
+ header "notify_keys.h"
7
+ export *
8
+ }
9
+ }
@@ -0,0 +1,4 @@
1
+ // swift-interface-format-version: 1.0
2
+ // swift-module-flags: -target arm64-apple-ios16.0-simulator -enable-objc-interop -enable-library-evolution -module-name Darwin
3
+ import Swift
4
+ public typealias mach_vm_size_t = Swift.UInt64
@@ -2,4 +2,4 @@
2
2
  // swift-module-flags: -target arm64-apple-ios16.0-simulator -enable-objc-interop -enable-library-evolution -module-name Dispatch
3
3
  @_exported import Dispatch
4
4
  import Swift
5
- public class DispatchWorkItem {}
5
+ @_objcRuntimeName(_TtC8Dispatch17_DispatchWorkItem) public class DispatchWorkItem {}
@@ -6,7 +6,11 @@
6
6
  import Swift
7
7
  import _Concurrency
8
8
  public struct URL {}
9
- public struct Data {}
9
+ public struct Data {
10
+ public typealias ReadingOptions = Foundation.NSData.ReadingOptions
11
+ public typealias WritingOptions = Foundation.NSData.WritingOptions
12
+ public typealias SearchOptions = Foundation.NSData.SearchOptions
13
+ }
10
14
  public struct Date {}
11
15
  public struct DateComponents {}
12
16
  public struct DateInterval {}
@@ -22,6 +26,8 @@ public struct TimeZone {}
22
26
  public struct Calendar {}
23
27
  public struct Notification {}
24
28
  public struct Decimal {}
29
+ public typealias NSErrorPointer = Swift.AutoreleasingUnsafeMutablePointer<Foundation.NSError?>?
30
+ public typealias ErrorPointer = Foundation.NSErrorPointer
25
31
  public protocol CustomNSError : Swift.Error {
26
32
  static var errorDomain: Swift.String { get }
27
33
  var errorCode: Swift.Int { get }
@@ -11,6 +11,7 @@ import Swift
11
11
  public typealias BooleanLiteralType = Swift.Bool
12
12
  }
13
13
  @frozen public struct Selector {
14
+ internal var ptr: Swift.OpaquePointer
14
15
  public init(_ str: Swift.String)
15
16
  }
16
17
  extension ObjectiveC.NSObject : Swift.Equatable, Swift.Hashable {
@@ -1,4 +1,25 @@
1
1
  // swift-interface-format-version: 1.0
2
2
  // swift-module-flags: -target arm64-apple-ios16.0-simulator -enable-objc-interop -enable-library-evolution -module-name SwiftUI
3
3
  @_exported import SwiftUICore
4
+ import UIKit
4
5
  import Swift
6
+ import _Concurrency
7
+ @_Concurrency.MainActor @preconcurrency public protocol UIViewControllerRepresentable : SwiftUICore.View where Self.Body == Swift.Never {
8
+ associatedtype UIViewControllerType : UIKit.UIViewController
9
+ @_Concurrency.MainActor @preconcurrency func makeUIViewController(context: Self.Context) -> Self.UIViewControllerType
10
+ @_Concurrency.MainActor @preconcurrency func updateUIViewController(_ uiViewController: Self.UIViewControllerType, context: Self.Context)
11
+ @_Concurrency.MainActor @preconcurrency static func dismantleUIViewController(_ uiViewController: Self.UIViewControllerType, coordinator: Self.Coordinator)
12
+ associatedtype Coordinator = Swift.Void
13
+ @_Concurrency.MainActor @preconcurrency func makeCoordinator() -> Self.Coordinator
14
+ typealias Context = SwiftUI.UIViewControllerRepresentableContext<Self>
15
+ }
16
+ @_Concurrency.MainActor @preconcurrency public struct UIViewControllerRepresentableContext<Representable> where Representable : SwiftUI.UIViewControllerRepresentable {
17
+ @_Concurrency.MainActor @preconcurrency public let coordinator: Representable.Coordinator
18
+ }
19
+ extension SwiftUI.UIViewControllerRepresentable {
20
+ @_Concurrency.MainActor @preconcurrency public var body: Swift.Never { get }
21
+ @_Concurrency.MainActor @preconcurrency public static func dismantleUIViewController(_ uiViewController: Self.UIViewControllerType, coordinator: Self.Coordinator)
22
+ }
23
+ extension SwiftUI.UIViewControllerRepresentable where Self.Coordinator == Swift.Void {
24
+ @_Concurrency.MainActor @preconcurrency public func makeCoordinator() -> Swift.Void
25
+ }
@@ -2,10 +2,15 @@
2
2
  // swift-module-flags: -target arm64-apple-ios16.0-simulator -enable-objc-interop -enable-library-evolution -module-name SwiftUICore
3
3
  import Swift
4
4
  import _Concurrency
5
- @preconcurrency @_Concurrency.MainActor public protocol View {
5
+ @_Concurrency.MainActor @preconcurrency public protocol View {
6
6
  associatedtype Body : SwiftUICore.View
7
7
  @_Concurrency.MainActor @preconcurrency var body: Self.Body { get }
8
8
  }
9
+ extension Swift.Never : SwiftUICore.View {
10
+ public typealias Body = Swift.Never
11
+ public var body: Swift.Never { get }
12
+ }
13
+ public struct Binding<Value> {}
9
14
  @resultBuilder public struct ViewBuilder {
10
15
  public static func buildBlock<Content>(_ content: Content) -> Content where Content : SwiftUICore.View
11
16
  }
@@ -1,5 +1,9 @@
1
1
  #pragma once
2
2
  #include <__typedef_clockid_t.h>
3
+ // darwin exposes these struct tm members even when a lower module imports the
4
+ // private libc time header before time.h installs its feature aliases.
5
+ #define __tm_gmtoff tm_gmtoff
6
+ #define __tm_zone tm_zone
3
7
  // wasi-libc's private clock objects share names with darwin's enum cases.
4
8
  #define _CLOCK_REALTIME __peach_wasi_clock_realtime
5
9
  #define _CLOCK_MONOTONIC __peach_wasi_clock_monotonic
@@ -54,6 +54,8 @@ int pthread_join(pthread_t, void **) __asm__("__peach_darwin_pthread_join");
54
54
  int pthread_cond_wait(pthread_cond_t *__restrict, pthread_mutex_t *__restrict) __asm__("__peach_darwin_pthread_cond_wait");
55
55
  int pthread_cond_timedwait(pthread_cond_t *__restrict, pthread_mutex_t *__restrict, const struct timespec *__restrict)
56
56
  __asm__("__peach_darwin_pthread_cond_timedwait");
57
+ int pthread_cond_timedwait_relative_np(pthread_cond_t *, pthread_mutex_t *, const struct timespec *)
58
+ __asm__("__peach_darwin_pthread_cond_timedwait_relative_np");
57
59
  // darwin hands out 512 thread-specific keys from 256; these bind to its table.
58
60
  int pthread_key_create(pthread_key_t *, void (* _Nullable)(void *)) __asm__("__peach_darwin_pthread_key_create");
59
61
  int pthread_key_delete(pthread_key_t) __asm__("__peach_darwin_pthread_key_delete");
@@ -114,7 +114,7 @@ int posix_madvise(void *, size_t, int) __asm__("__peach_darwin_madvise");
114
114
 
115
115
  #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
116
116
  int madvise(void *, size_t, int) __asm__("__peach_darwin_madvise");
117
- int mincore(const void *, size_t, char *) __PEACH_DARWIN_MMAN_UNAVAILABLE;
117
+ int mincore(const void *, size_t, char *) __asm__("__peach_darwin_mincore");
118
118
  int minherit(void *, size_t, int) __PEACH_DARWIN_MMAN_UNAVAILABLE;
119
119
  #endif
120
120
  __END_DECLS
@@ -4,12 +4,42 @@
4
4
  // getrlimit and setrlimit bind to the descriptor table's darwin provider.
5
5
  // RLIMIT_STACK reports the executable's linker-owned stack bounds; setting
6
6
  // that limit remains unsupported. RLIMIT_NOFILE owns the descriptor limits.
7
+ #define rusage __peach_wasi_rusage
8
+ #define getrusage __peach_wasi_getrusage
7
9
  #include_next <sys/resource.h>
10
+ #undef rusage
11
+ #undef getrusage
8
12
  #include <sys/cdefs.h>
9
13
  #include <stdint.h>
10
14
 
11
15
  typedef void *rusage_info_t;
12
16
 
17
+ // the complete native record must never reach wasi's two-timeval provider.
18
+ struct rusage {
19
+ struct timeval ru_utime;
20
+ struct timeval ru_stime;
21
+ #if __DARWIN_C_LEVEL < __DARWIN_C_FULL
22
+ long ru_opaque[14];
23
+ #else
24
+ long ru_maxrss;
25
+ #define ru_first ru_ixrss
26
+ long ru_ixrss;
27
+ long ru_idrss;
28
+ long ru_isrss;
29
+ long ru_minflt;
30
+ long ru_majflt;
31
+ long ru_nswap;
32
+ long ru_inblock;
33
+ long ru_oublock;
34
+ long ru_msgsnd;
35
+ long ru_msgrcv;
36
+ long ru_nsignals;
37
+ long ru_nvcsw;
38
+ long ru_nivcsw;
39
+ #define ru_last ru_nivcsw
40
+ #endif
41
+ };
42
+
13
43
  typedef uint64_t rlim_t;
14
44
 
15
45
  #define RLIM_INFINITY (((uint64_t)1 << 63) - 1) /* no limit */
@@ -39,6 +69,7 @@ struct rlimit {
39
69
  };
40
70
 
41
71
  __BEGIN_DECLS
72
+ int getrusage(int, struct rusage *) __asm__("__peach_darwin_getrusage");
42
73
  int getrlimit(int, struct rlimit *) __asm__("__peach_darwin_getrlimit");
43
74
  int setrlimit(int, const struct rlimit *) __asm__("__peach_darwin_setrlimit");
44
75
  __END_DECLS
@@ -14,6 +14,10 @@
14
14
  #include <Availability.h>
15
15
  #include <sys/cdefs.h>
16
16
  __BEGIN_DECLS
17
+ pid_t fork(void) __asm__("__peach_darwin_fork");
18
+ int execv(const char *, char *const []) __asm__("__peach_darwin_execv");
19
+ int execve(const char *, char *const [], char *const []) __asm__("__peach_darwin_execve");
20
+ unsigned int alarm(unsigned int) __asm__("__peach_darwin_alarm");
17
21
  pid_t getppid(void);
18
22
  gid_t getegid(void);
19
23
  uid_t geteuid(void);
@@ -0,0 +1,43 @@
1
+ import { readFileSync } from 'node:fs'
2
+ import { join } from 'node:path'
3
+ import {
4
+ resolveActiveRuntimeRoot,
5
+ resolveDevCheckoutRuntimeAssetRoot,
6
+ } from './runtime-assets'
7
+
8
+ // the runtime states which installed native packages it answers itself, so a
9
+ // CLI built from newer source never skips compiling one its runtime lacks.
10
+ export const ANSWERED_NATIVE_PACKAGES_PATH = 'node/answered-native-packages.json'
11
+
12
+ // the companion and the answered packages come from the runtime the host
13
+ // serves: inside the dev checkout that is the dev build `build:peachsim:cli`
14
+ // copied them beside, unless PEACH_HOME stages a runtime, as a release replay
15
+ // does inside a builder's checkout
16
+ export function peachRuntimeRoot(): string {
17
+ const root = resolveDevCheckoutRuntimeAssetRoot() ?? resolveActiveRuntimeRoot()
18
+ if (!root) throw new Error('No Peach runtime installed; run `peach runtime install`')
19
+ return root
20
+ }
21
+
22
+ export function readPeachRuntimeJson(relative: string): unknown {
23
+ try {
24
+ return JSON.parse(readFileSync(join(peachRuntimeRoot(), relative), 'utf8'))
25
+ } catch (error) {
26
+ if (error instanceof Error && 'code' in error && error.code === 'ENOENT')
27
+ throw new Error(
28
+ `The active Peach runtime predates ${relative}; run \`peach runtime install\``,
29
+ )
30
+ throw error
31
+ }
32
+ }
33
+
34
+ let answered: ReadonlySet<string> | undefined
35
+
36
+ export function peachAnsweredNativePackages(): ReadonlySet<string> {
37
+ if (answered) return answered
38
+ const names = readPeachRuntimeJson(ANSWERED_NATIVE_PACKAGES_PATH)
39
+ if (!Array.isArray(names) || !names.every((name) => typeof name === 'string'))
40
+ throw new Error(`${ANSWERED_NATIVE_PACKAGES_PATH} must list package names`)
41
+ answered = new Set(names)
42
+ return answered
43
+ }
@@ -4,10 +4,7 @@ import { createRequire } from 'node:module'
4
4
  import { join } from 'node:path'
5
5
  import { downloadToFile } from '@contrast/runtime-delivery'
6
6
  import companionIdentity from '../runtime-companion.json' with { type: 'json' }
7
- import {
8
- resolveActiveRuntimeRoot,
9
- resolveDevCheckoutRuntimeAssetRoot,
10
- } from './runtime-assets'
7
+ import { peachRuntimeRoot } from './answeredNativePackages'
11
8
  import type * as CliRuntime from '#peach-cli-contract/cli-companion'
12
9
 
13
10
  export const CLI_COMPANION_ABI = 1
@@ -73,11 +70,7 @@ let loaded: { root: string; runtime: typeof CliRuntime } | undefined
73
70
  // so host serializers receive their implementation rather than a forwarding closure.
74
71
  export function getCliRuntime(): typeof CliRuntime {
75
72
  if (loaded) return loaded.runtime
76
- // the companion comes from the runtime the host serves: inside the dev checkout
77
- // that is the dev build `build:peachsim:cli` copied it beside, unless PEACH_HOME
78
- // stages a runtime, as a release replay does inside a builder's checkout
79
- const root = resolveDevCheckoutRuntimeAssetRoot() ?? resolveActiveRuntimeRoot()
80
- if (!root) throw new Error('No Peach runtime installed; run `peach runtime install`')
73
+ const root = peachRuntimeRoot()
81
74
  verifyCliCompanion(root)
82
75
  const require = createRequire(import.meta.url)
83
76
  const runtime: typeof CliRuntime = require(join(root, cliCompanionPath()))