peachsim 0.1.2255 → 0.1.2258

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 (122) hide show
  1. package/cli/bridge-flow-runner.ts +41 -0
  2. package/cli/commands/control.ts +8 -2
  3. package/cli/commands/flow.ts +9 -0
  4. package/cli/commands/swift.ts +5 -0
  5. package/cli/current-sim.ts +23 -15
  6. package/cli/outbound-endpoints.ts +0 -2
  7. package/cli/secure-file.ts +8 -2
  8. package/dist-lib/agent-daemon-client.cjs +1 -1
  9. package/dist-lib/agent-events.cjs +1 -1
  10. package/dist-lib/attached-projects.cjs +1 -1
  11. package/dist-lib/auth/shared-session.cjs +1 -1
  12. package/dist-lib/backend-origin.cjs +1 -1
  13. package/dist-lib/beta.cjs +1 -1
  14. package/dist-lib/beta.mjs +1 -1
  15. package/dist-lib/bridge-constants.cjs +1 -1
  16. package/dist-lib/bridge-contract-input.cjs +1 -1
  17. package/dist-lib/bridge-contract-input.mjs +1 -1
  18. package/dist-lib/bridge-contract.cjs +1 -1
  19. package/dist-lib/bridge-contract.mjs +1 -1
  20. package/dist-lib/bundle-channel.cjs +418 -143
  21. package/dist-lib/capture-contract.cjs +1 -1
  22. package/dist-lib/capture-contract.mjs +1 -1
  23. package/dist-lib/cloud-contract.cjs +1 -1
  24. package/dist-lib/cloud-contract.mjs +1 -1
  25. package/dist-lib/cloud-test-args.cjs +1 -1
  26. package/dist-lib/cloud-test-args.mjs +1 -1
  27. package/dist-lib/cloud.cjs +1 -1
  28. package/dist-lib/cloud.mjs +1 -1
  29. package/dist-lib/config.cjs +1 -1
  30. package/dist-lib/config.mjs +1 -1
  31. package/dist-lib/detox/index.cjs +16 -12
  32. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  33. package/dist-lib/expo-swift-bundle.cjs +359 -116
  34. package/dist-lib/expo-swift-metadata.cjs +1 -1
  35. package/dist-lib/expo-swift-metadata.mjs +1 -1
  36. package/dist-lib/home-paths.cjs +1 -1
  37. package/dist-lib/host/bridge-host.cjs +939 -595
  38. package/dist-lib/host/fetch-proxy-handler.cjs +3607 -1627
  39. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  40. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  41. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  42. package/dist-lib/host/websocket-proxy.cjs +1 -1
  43. package/dist-lib/index.cjs +12611 -11232
  44. package/dist-lib/jump-to-source-babel.cjs +1 -1
  45. package/dist-lib/jump-to-source-native.cjs +1 -1
  46. package/dist-lib/kotlin-host.cjs +5 -4
  47. package/dist-lib/menu.cjs +1 -1
  48. package/dist-lib/menu.mjs +1 -1
  49. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  50. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  51. package/dist-lib/metro-production-bundle.cjs +1 -1
  52. package/dist-lib/metro-production-bundle.mjs +1 -1
  53. package/dist-lib/metro.cjs +9700 -8326
  54. package/dist-lib/native-app-identity-project.cjs +2 -2
  55. package/dist-lib/native-app-identity-project.mjs +2 -2
  56. package/dist-lib/native-app-identity.cjs +1 -1
  57. package/dist-lib/native-app-identity.mjs +1 -1
  58. package/dist-lib/native-firebase-metadata.cjs +1 -1
  59. package/dist-lib/native-firebase-metadata.mjs +1 -1
  60. package/dist-lib/pdfium-raster.cjs +1 -1
  61. package/dist-lib/pdfium-raster.mjs +1 -1
  62. package/dist-lib/plist.cjs +1 -1
  63. package/dist-lib/plist.mjs +1 -1
  64. package/dist-lib/profiles.cjs +1 -1
  65. package/dist-lib/public-brand.cjs +1 -1
  66. package/dist-lib/public-origins-lib-esm.json +24 -24
  67. package/dist-lib/public-origins-lib.json +606 -228
  68. package/dist-lib/react-native-host-modules.cjs +1 -1
  69. package/dist-lib/react-native-host-modules.mjs +1 -1
  70. package/dist-lib/reap-browser.cjs +1 -1
  71. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  72. package/dist-lib/sdk.cjs +1 -1
  73. package/dist-lib/sdk.mjs +1 -1
  74. package/dist-lib/skills.cjs +1192 -797
  75. package/dist-lib/swift-compile.cjs +334 -99
  76. package/dist-lib/swift-compile.mjs +334 -99
  77. package/dist-lib/swift-package.cjs +1 -1
  78. package/dist-lib/swift-package.mjs +1 -1
  79. package/dist-lib/swift-submit.cjs +1 -1
  80. package/dist-lib/swift-submit.mjs +1 -1
  81. package/dist-lib/swift-toolchain.cjs +1 -1
  82. package/dist-lib/swift.cjs +1 -1
  83. package/dist-lib/vite-swift.cjs +340 -101
  84. package/dist-lib/vite.cjs +4729 -2900
  85. package/dist-lib/worklet-executable.cjs +1 -1
  86. package/dist-lib/worklet-executable.mjs +1 -1
  87. package/dist-types/packages/peach-engine/src/engine/node.d.ts +0 -6
  88. package/dist-types/packages/peach-engine/src/render-worker/reanimated-readiness.d.ts +1 -0
  89. package/dist-types/packages/peach-globals/src/appLifecycleBridgeContract.d.ts +1 -0
  90. package/dist-types/packages/peach-globals/src/index.d.ts +1 -0
  91. package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +1 -0
  92. package/dist-types/packages/peach-kit/src/transitions/screen-transition-math.d.ts +6 -0
  93. package/java-platform/licenses/android.txt +183 -0
  94. package/java-platform/licenses/arm-optimized-routines.txt +256 -0
  95. package/java-platform/licenses/fdlibm.txt +72 -0
  96. package/java-platform/licenses/icu.txt +50 -0
  97. package/java-platform/licenses/openjdk.txt +395 -0
  98. package/java-platform/licenses/teavm.txt +182 -0
  99. package/java-platform/licenses/threeten-backport.txt +29 -0
  100. package/kotlin/README.md +1 -1
  101. package/kotlin/sdk.tar.gz +0 -0
  102. package/package.json +2 -1
  103. package/runtime-companion.json +1 -1
  104. package/src/expo-autolinking.ts +47 -4
  105. package/src/expo-native-workspace.ts +4 -1
  106. package/src/expo-pod-prebuilt.ts +96 -9
  107. package/src/expo-swift-host.ts +29 -9
  108. package/src/kotlin-host.ts +3 -2
  109. package/src/kotlinSdkContract.ts +1 -0
  110. package/src/native-package-slice-build.ts +386 -0
  111. package/src/native-package-slice.ts +835 -0
  112. package/src/native-prebuilt.ts +4 -0
  113. package/src/native-seam-manifest.ts +0 -8
  114. package/src/nitro-adapter.lock.json +255 -255
  115. package/src/nitro-compile.ts +37 -13
  116. package/src/nitro-superset.lock.json +4 -4
  117. package/src/swift-distribution.lock.json +11 -11
  118. package/src/swift-distribution.ts +7 -2
  119. package/src/swift-link-roots.ts +23 -22
  120. package/src/swift-wasm-prune.ts +436 -105
  121. package/src/turbo-compile.ts +22 -7
  122. package/src/turbo-runtime.lock.json +23 -23
@@ -1,10 +1,10 @@
1
1
  {
2
- "id": "fab4e40b5d51a4ba",
2
+ "id": "0c0e33b4b191ff3a",
3
3
  "release": "swift-6.4.0-RELEASE-custom-fb42d2535739dfd2",
4
- "wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-4dcccce1",
5
- "wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-4dcccce1.artifactbundle.tar.gz",
6
- "wasmSdkChecksum": "a1139bae6549a600a3fbc3c8d6032f5a6b4c3392a64f5d1ece867a6ac11ce92b",
7
- "source": "eb5014e2cbd517b63594b28184e7c67a060e2ea1",
4
+ "wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-6ff7e819",
5
+ "wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-6ff7e819.artifactbundle.tar.gz",
6
+ "wasmSdkChecksum": "ac7bf36166760fd4074f430847dcf1d12bdb6727c061919ee1425dbb9fb7f128",
7
+ "source": "b254279f14bc49350d365053d7a710ca0e31f36c",
8
8
  "targets": [
9
9
  "ImagePlayground",
10
10
  "QuickLookThumbnailing",
@@ -245,16 +245,16 @@
245
245
  },
246
246
  "hosts": {
247
247
  "darwin-arm64": {
248
- "sha256": "be97d84d3b601245b49be90a91fde03ed4055b0402ae800a4a4f2ad6e78cec8e",
249
- "size": 106980477
248
+ "sha256": "373cd2b7d6195bfac48af0025df023101f5428c84f5091cc2d55f70f1f48adb1",
249
+ "size": 106983039
250
250
  },
251
251
  "linux-x64": {
252
- "sha256": "a095dc9030a4c72a4e3c2d6fa9c835801e7cfba7423afc6548d69131bfe916ee",
253
- "size": 109699290
252
+ "sha256": "1979606dd0846a3a4e69352a1c521ebc6cc890477b89d26d05ab74df6332c00f",
253
+ "size": 109699697
254
254
  },
255
255
  "linux-arm64": {
256
- "sha256": "0690fd9cdfc637b0353b27ed449c9d40885370edd269d023935102bfcab9dc6c",
257
- "size": 109192596
256
+ "sha256": "b98e79472e81ea1ffedcf07c94c9056152fd1545e1b56ac2e05db3807dda345e",
257
+ "size": 109193780
258
258
  }
259
259
  }
260
260
  }
@@ -3,7 +3,7 @@
3
3
  // packages/sootsim-swift; an installed peach downloads the prebuilt
4
4
  // distribution from PEACH_SWIFT_ENDPOINT, or the public default when it is
5
5
  // unset, verifies it against the lock this build carries, and unpacks it under
6
- // the peach home
6
+ // the swift cache
7
7
  // (docs/peach/swift/distribution.md). no path here asks Contrast to compile.
8
8
  import fs from 'node:fs'
9
9
  import os from 'node:os'
@@ -28,6 +28,7 @@ import {
28
28
  swiftCompiler,
29
29
  swiftCompilerAsync,
30
30
  swiftCompilerInstallSteps,
31
+ swiftCacheDir,
31
32
  sourceSwiftCheckout,
32
33
  setSwiftLinuxLibraryPath,
33
34
  swiftHostCompilerArchive,
@@ -124,7 +125,11 @@ export async function swiftDistributionRoot(signal?: AbortSignal): Promise<strin
124
125
  // the archive is useless without its compiler, so the toolchain installs
125
126
  // or fails before the download
126
127
  await installSwiftToolchain(lock.release, lock, signal)
127
- const dir = path.join(rnxHomeDir(), 'swift', `${lock.id}-${host}`)
128
+ const dir = path.join(
129
+ swiftCacheDir(),
130
+ 'swift-distributions',
131
+ `${lock.id}-${host}-${lock.hosts[host].sha256}`,
132
+ )
128
133
  let pending = installs.get(dir)
129
134
  if (pending?.controller.signal.aborted) pending = undefined
130
135
  if (!pending) {
@@ -1,17 +1,11 @@
1
1
  import fs from 'node:fs'
2
2
  import path from 'node:path'
3
3
  // which distribution objects a link must keep as roots when the rest of the
4
- // distribution links as an archive. the gnustep ObjC runtime registers an
5
- // object's categories and class aliases from its own initializer, and the host
6
- // runtime calls wasm-exported entrypoints by export name, so an archive pass
7
- // would never load them. classes and Swift metadata are pulled by type and
8
- // symbol reachability (swift-wasm-prune.ts).
9
- import { foundationCategoryObjects } from './swift-foundation'
10
-
11
- const OBJC_SENTINELS = new Map([
12
- ['__objc_cats', '.objc_null_category'],
13
- ['__objc_class_aliases', '.objc_null_class_alias'],
14
- ])
4
+ // distribution links as an archive. the gnustep ObjC runtime registers
5
+ // class aliases and NSObject +load categories before archive extraction, and the
6
+ // host runtime calls wasm-exported entrypoints by export name. ordinary ObjC
7
+ // categories load lazily through swift-wasm-prune.ts when their target class
8
+ // becomes live, alongside Swift metadata reachability.
15
9
 
16
10
  const leb = (bytes: Uint8Array, at: { offset: number }): number => {
17
11
  let value = 0
@@ -31,6 +25,7 @@ function objcRootInfo(bytes: Uint8Array): { registration: boolean; exported: boo
31
25
  const at = { offset: 8 }
32
26
  const names: string[] = []
33
27
  const dataSymbols: { segment: number; name: string }[] = []
28
+ let hasNSObjectLoad = false
34
29
  let hasExportedSymbol = false
35
30
  while (at.offset < bytes.length) {
36
31
  const id = bytes[at.offset++]!
@@ -67,6 +62,12 @@ function objcRootInfo(bytes: Uint8Array): { registration: boolean; exported: boo
67
62
  leb(bytes, at)
68
63
  if (!isUndef || isExplicitName) {
69
64
  const sLen = leb(bytes, at)
65
+ if (!isUndef && symKind === 0) {
66
+ const name = Buffer.from(
67
+ bytes.subarray(at.offset, at.offset + sLen),
68
+ ).toString()
69
+ if (/^_c_NSObject_.*_load$/.test(name)) hasNSObjectLoad = true
70
+ }
70
71
  at.offset += sLen
71
72
  }
72
73
  } else if (symKind === 1) {
@@ -93,11 +94,12 @@ function objcRootInfo(bytes: Uint8Array): { registration: boolean; exported: boo
93
94
  at.offset = end
94
95
  }
95
96
  return {
96
- registration: dataSymbols.some(({ segment, name }) => {
97
- if (name.startsWith('.objc_category_')) return true
98
- const sentinel = OBJC_SENTINELS.get(names[segment]!)
99
- return sentinel !== undefined && name !== sentinel
100
- }),
97
+ registration:
98
+ hasNSObjectLoad ||
99
+ dataSymbols.some(
100
+ ({ segment, name }) =>
101
+ names[segment] === '__objc_class_aliases' && name !== '.objc_null_class_alias',
102
+ ),
101
103
  exported: hasExportedSymbol,
102
104
  }
103
105
  }
@@ -105,9 +107,9 @@ function objcRootInfo(bytes: Uint8Array): { registration: boolean; exported: boo
105
107
  const rootsByDistribution = new Map<string, ReadonlySet<string>>()
106
108
 
107
109
  /**
108
- * the objects (relative to root) that define an ObjC category, class alias or
109
- * wasm-exported entrypoint. real registration symbols are distinct from
110
- * the runtime's empty category and alias terminators.
110
+ * the objects (relative to root) that define an NSObject +load category,
111
+ * class alias or wasm-exported entrypoint. ordinary category objects load
112
+ * through swift-wasm-prune.ts when their target ObjC class is live.
111
113
  */
112
114
  export function swiftObjcRootObjects(
113
115
  id: string,
@@ -123,10 +125,9 @@ export function swiftObjcRootObjects(
123
125
  measured
124
126
  .filter(
125
127
  ([object, info]) =>
126
- !foundationCategoryObjects.some(
127
- (name) => object === `lib/Foundation-${name}.o`,
128
- ) &&
129
128
  object !== 'lib/FoundationNetworking-Session.o' &&
129
+ object !== 'lib/Metal-MetalExecution.o' &&
130
+ object !== 'lib/PeachICU-icu.c.o' &&
130
131
  object !== 'lib/SwiftUI-MetalExecution.o' &&
131
132
  object !== 'lib/UIKitCore-NativeStub.o' &&
132
133
  (info.registration || info.exported),