peachsim 0.1.1692 → 0.1.1700

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 (245) hide show
  1. package/cli/bridge-flow-runner.ts +61 -39
  2. package/cli/commands/agent-wrapper.ts +21 -10
  3. package/cli/commands/control.ts +27 -7
  4. package/cli/commands/coverage.ts +1 -1
  5. package/cli/commands/detect.ts +17 -4
  6. package/cli/commands/maestro-compare.ts +25 -99
  7. package/cli/help-core.ts +3 -4
  8. package/cli/maestro-compare.ts +172 -4
  9. package/cli/outbound-endpoints.ts +2 -10
  10. package/detox/index.ts +15 -0
  11. package/detox/launch-permissions.ts +169 -0
  12. package/dist-lib/agent-daemon-client.cjs +2 -2
  13. package/dist-lib/agent-events.cjs +2 -2
  14. package/dist-lib/attached-projects.cjs +2 -2
  15. package/dist-lib/auth/shared-session.cjs +2 -2
  16. package/dist-lib/backend-origin.cjs +2 -2
  17. package/dist-lib/beta.cjs +2 -2
  18. package/dist-lib/beta.mjs +1 -1
  19. package/dist-lib/bridge-constants.cjs +2 -2
  20. package/dist-lib/bridge-contract-input.cjs +2 -2
  21. package/dist-lib/bridge-contract-input.mjs +1 -1
  22. package/dist-lib/bridge-contract.cjs +2 -2
  23. package/dist-lib/bridge-contract.mjs +1 -1
  24. package/dist-lib/bundle-channel.cjs +18273 -15925
  25. package/dist-lib/capture-contract.cjs +2 -2
  26. package/dist-lib/capture-contract.mjs +1 -1
  27. package/dist-lib/cloud-contract.cjs +2 -2
  28. package/dist-lib/cloud-contract.mjs +1 -1
  29. package/dist-lib/cloud-test-args.cjs +2 -2
  30. package/dist-lib/cloud-test-args.mjs +1 -1
  31. package/dist-lib/cloud.cjs +2 -2
  32. package/dist-lib/cloud.mjs +1 -1
  33. package/dist-lib/config.cjs +2 -2
  34. package/dist-lib/config.mjs +1 -1
  35. package/dist-lib/detox/index.cjs +104 -3
  36. package/dist-lib/dev-bundle-resolution.cjs +208 -44
  37. package/dist-lib/expo-swift-bundle.cjs +2349 -1778
  38. package/dist-lib/expo-swift-metadata.cjs +2 -2
  39. package/dist-lib/expo-swift-metadata.mjs +1 -1
  40. package/dist-lib/home-paths.cjs +2 -2
  41. package/dist-lib/host/bridge-host.cjs +7885 -3334
  42. package/dist-lib/host/fetch-proxy-handler.cjs +331 -39
  43. package/dist-lib/host/fetch-proxy-overrides.cjs +2 -2
  44. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  45. package/dist-lib/host/replacement-module-handler.cjs +2 -2
  46. package/dist-lib/host/websocket-proxy.cjs +2 -2
  47. package/dist-lib/index.cjs +297 -77
  48. package/dist-lib/jump-to-source-babel.cjs +2 -2
  49. package/dist-lib/jump-to-source-native.cjs +2 -2
  50. package/dist-lib/kotlin-host.cjs +2 -2
  51. package/dist-lib/menu.cjs +2 -2
  52. package/dist-lib/menu.mjs +1 -1
  53. package/dist-lib/metro-fingerprint-registry.cjs +2 -2
  54. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  55. package/dist-lib/metro-production-bundle.cjs +2 -2
  56. package/dist-lib/metro-production-bundle.mjs +1 -1
  57. package/dist-lib/metro.cjs +294 -74
  58. package/dist-lib/native-app-identity-project.cjs +48 -37
  59. package/dist-lib/native-app-identity-project.mjs +47 -36
  60. package/dist-lib/native-app-identity.cjs +2 -2
  61. package/dist-lib/native-app-identity.mjs +1 -1
  62. package/dist-lib/native-firebase-metadata.cjs +2 -2
  63. package/dist-lib/native-firebase-metadata.mjs +1 -1
  64. package/dist-lib/plist.cjs +2 -2
  65. package/dist-lib/plist.mjs +1 -1
  66. package/dist-lib/profiles.cjs +2 -2
  67. package/dist-lib/public-brand.cjs +2 -2
  68. package/dist-lib/public-origins-lib-esm.json +24 -23
  69. package/dist-lib/public-origins-lib.json +199 -79
  70. package/dist-lib/react-native-host-modules.cjs +2 -2
  71. package/dist-lib/react-native-host-modules.mjs +1 -1
  72. package/dist-lib/reap-browser.cjs +2 -2
  73. package/dist-lib/scripts/dev-server-scanner.cjs +206 -31
  74. package/dist-lib/sdk.cjs +2 -2
  75. package/dist-lib/sdk.mjs +1 -1
  76. package/dist-lib/skills.cjs +19600 -15992
  77. package/dist-lib/swift-compile.cjs +640 -402
  78. package/dist-lib/swift-compile.mjs +595 -357
  79. package/dist-lib/swift-package.cjs +24 -20
  80. package/dist-lib/swift-package.mjs +23 -19
  81. package/dist-lib/swift-submit.cjs +2 -2
  82. package/dist-lib/swift-submit.mjs +1 -1
  83. package/dist-lib/swift-toolchain.cjs +31 -4
  84. package/dist-lib/swift.cjs +2 -2
  85. package/dist-lib/vite-swift.cjs +1559 -1208
  86. package/dist-lib/vite.cjs +251 -42
  87. package/dist-lib/worklet-executable.cjs +2 -2
  88. package/dist-lib/worklet-executable.mjs +1 -1
  89. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +1 -1
  90. package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
  91. package/dist-types/packages/peach-engine/src/engine/scroll-pan-contacts.d.ts +3 -1
  92. package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +7 -0
  93. package/dist-types/packages/peach-engine/src/engine/types.d.ts +2 -1
  94. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
  95. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
  96. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +1 -0
  97. package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +17 -0
  98. package/dist-types/packages/peach-engine/src/render-worker/worker-input-runtime.d.ts +2 -1
  99. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +3 -0
  100. package/dist-types/packages/peach-globals/src/cameraBridgeContract.d.ts +1 -0
  101. package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +1 -0
  102. package/dist-types/packages/peach-globals/src/shellHostBridgeContract.d.ts +3 -0
  103. package/dist-types/packages/peach-kit/src/materials/types.d.ts +1 -0
  104. package/package.json +1 -1
  105. package/runtime-companion.json +1 -1
  106. package/scripts/dev-server-scanner.ts +4 -0
  107. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h +2282 -0
  108. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h +55 -0
  109. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h +10551 -6
  110. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h +4236 -3
  111. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h +827 -8
  112. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h +1369 -0
  113. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h +1243 -0
  114. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h +1747 -0
  115. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h +291 -2
  116. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h +1283 -0
  117. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h +811 -91
  118. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h +1342 -25
  119. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns.h +2738 -0
  120. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h +1685 -0
  121. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h +913 -0
  122. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h +1917 -0
  123. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h +23 -0
  124. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h +209 -0
  125. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h +104 -0
  126. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h +77 -0
  127. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h +554 -0
  128. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h +58 -0
  129. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h +186 -0
  130. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h +86 -0
  131. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h +364 -0
  132. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h +195 -0
  133. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h +44 -0
  134. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/BLAS.h +2330 -0
  135. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/Types.h +123 -0
  136. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Solve.h +8339 -0
  137. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h +520 -0
  138. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h +1893 -0
  139. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h +10 -0
  140. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/blas_new.h +1098 -0
  141. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas.h +859 -0
  142. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas_new.h +1134 -0
  143. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/clapack.h +10555 -0
  144. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/fortran_blas.h +695 -0
  145. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack.h +38526 -0
  146. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_types.h +60 -0
  147. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_version.h +20 -0
  148. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/thread_api.h +50 -0
  149. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h +1218 -0
  150. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBigNum.h +1458 -0
  151. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP.h +10377 -0
  152. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP_translate.h +167 -0
  153. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vForce.h +1243 -0
  154. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h +114 -0
  155. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLibTypes.h +146 -0
  156. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vectorOps.h +1106 -0
  157. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vfp.h +294 -0
  158. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h +25 -1
  159. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h +673 -0
  160. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h +232 -0
  161. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h +827 -0
  162. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h +121 -0
  163. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h +387 -0
  164. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h +79 -0
  165. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h +122 -0
  166. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h +674 -0
  167. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h +182 -0
  168. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h +213 -0
  169. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h +82 -0
  170. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h +129 -0
  171. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h +491 -0
  172. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h +883 -2
  173. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h +98 -0
  174. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +11 -229
  175. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +2 -6
  176. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +2 -1
  177. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +1 -0
  178. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecBase.h +906 -3
  179. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h +613 -0
  180. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecItem.h +1284 -29
  181. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h +441 -0
  182. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecTrust.h +845 -0
  183. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/Security.h +4 -0
  184. package/sdk/ios/usr/include/AvailabilityMacros.h +3985 -0
  185. package/sdk/ios/usr/include/copyfile.h +143 -0
  186. package/sdk/ios/usr/include/malloc/_malloc.h +143 -0
  187. package/sdk/ios/usr/include/malloc/_malloc_type.h +153 -0
  188. package/sdk/ios/usr/include/malloc/_platform.h +80 -0
  189. package/sdk/ios/usr/include/malloc/_ptrcheck.h +43 -0
  190. package/sdk/ios/usr/include/malloc/malloc.h +768 -0
  191. package/sdk/ios/usr/include/os/availability.h +168 -6
  192. package/sdk/ios/usr/include/os/base.h +351 -0
  193. package/sdk/ios/usr/include/os/clock.h +18 -0
  194. package/sdk/ios/usr/include/os/lock.h +232 -10
  195. package/sdk/ios/usr/include/os/log.h +521 -38
  196. package/sdk/ios/usr/include/os/object.h +320 -3
  197. package/sdk/ios/usr/include/os/trace.h +492 -0
  198. package/sdk/ios/usr/include/os/trace_base.h +167 -0
  199. package/sdk/ios/usr/include/os/workgroup.h +37 -0
  200. package/sdk/ios/usr/include/os/workgroup_base.h +91 -0
  201. package/sdk/ios/usr/include/os/workgroup_interval.h +156 -0
  202. package/sdk/ios/usr/include/os/workgroup_object.h +359 -0
  203. package/sdk/ios/usr/include/os/workgroup_parallel.h +76 -0
  204. package/sdk/ios/usr/include/sys/cdefs.h +38 -0
  205. package/sdk/ios/wasm/include/unistd.h +3 -0
  206. package/skills/contrast/SKILL.md +3 -0
  207. package/src/codex-client.ts +11 -6
  208. package/src/dev-bundle-resolution.ts +124 -48
  209. package/src/expo-native-workspace.ts +176 -0
  210. package/src/expo-swift-host.ts +161 -26
  211. package/src/expo-swift-ready.ts +14 -28
  212. package/src/expoSwiftContract.ts +4 -1
  213. package/src/generated/swift-c-predefines.json +68 -12
  214. package/src/host/bridge-host.ts +5 -0
  215. package/src/installed-package-versions.ts +14 -1
  216. package/src/metro-project-root.ts +44 -33
  217. package/src/native-app-identity-project.ts +1 -0
  218. package/src/nitro-adapter.lock.json +916 -10
  219. package/src/nitro-adapter.ts +33 -24
  220. package/src/nitro-bundle.ts +108 -22
  221. package/src/nitro-compile.ts +32 -5
  222. package/src/nitro-source.ts +13 -3
  223. package/src/nitroAdapterContract.ts +100 -20
  224. package/src/node-http-fetch.ts +116 -0
  225. package/src/packageVersionsContract.ts +46 -0
  226. package/src/serverDiscoveryContract.ts +1 -0
  227. package/src/settingsContract.ts +0 -30
  228. package/src/swift-binary-modules.ts +20 -5
  229. package/src/swift-compile.ts +168 -48
  230. package/src/swift-coverage/xcode-assets.ts +4 -3
  231. package/src/swift-host.ts +14 -3
  232. package/src/swift-objc-compile.ts +32 -5
  233. package/src/swift-objc-metadata.ts +2 -2
  234. package/src/swift-objc-platform.ts +2 -2
  235. package/src/swift-objc-standin.ts +43 -13
  236. package/src/swift-package.ts +33 -26
  237. package/src/swift-source-pods.ts +126 -41
  238. package/src/swift-standin-digest.ts +77 -0
  239. package/src/swift-standin-emit.ts +40 -4
  240. package/src/swift-standins.ts +68 -19
  241. package/src/swift-toolchain.ts +38 -0
  242. package/src/swiftContract.ts +8 -0
  243. package/src/vite-plugin.ts +0 -10
  244. package/src/xcode-project.ts +62 -42
  245. package/src/settings-flags.ts +0 -107
@@ -0,0 +1,116 @@
1
+ import http from 'node:http'
2
+ import https from 'node:https'
3
+ import { pipeline, Transform, type Readable } from 'node:stream'
4
+ import zlib from 'node:zlib'
5
+
6
+ // node's fetch ends a request whose response headers take five minutes. a cold
7
+ // dev server or a Swift compile can legitimately answer later, and that close
8
+ // is also the signal that aborts the server's shared work. node:http has no
9
+ // headers deadline, so a loopback wait is bounded only by its caller's signal.
10
+ const BODYLESS_STATUS = new Set([101, 204, 205, 304])
11
+
12
+ // fetch yields what a truncated zlib stream held instead of throwing
13
+ const TRUNCATION_TOLERANT = { finishFlush: zlib.constants.Z_SYNC_FLUSH }
14
+
15
+ const MAX_REDIRECTS = 5
16
+
17
+ const DECODABLE_CODINGS = new Set(['gzip', 'x-gzip', 'deflate', 'br'])
18
+
19
+ // follows redirects the way fetch does, on GET only
20
+ export function nodeHttpFetch(
21
+ url: string,
22
+ init: { headers?: Record<string, string>; signal?: AbortSignal } = {},
23
+ redirects = 0,
24
+ ): Promise<Response> {
25
+ const target = new URL(url)
26
+ const transport = target.protocol === 'https:' ? https : http
27
+ return new Promise((resolve, reject) => {
28
+ const req = transport.request(
29
+ target,
30
+ { method: 'GET', headers: init.headers, signal: init.signal },
31
+ (res) => {
32
+ const status = res.statusCode ?? 0
33
+ const location = res.headers.location
34
+ if (status >= 300 && status < 400 && location) {
35
+ res.resume()
36
+ if (redirects >= MAX_REDIRECTS) {
37
+ reject(new Error(`too many redirects from ${url}`))
38
+ return
39
+ }
40
+ resolve(nodeHttpFetch(new URL(location, target).href, init, redirects + 1))
41
+ return
42
+ }
43
+ const headers = new Headers()
44
+ for (const [name, value] of Object.entries(res.headers)) {
45
+ if (Array.isArray(value)) for (const entry of value) headers.append(name, entry)
46
+ else if (value !== undefined) headers.set(name, value)
47
+ }
48
+ if (BODYLESS_STATUS.has(status)) {
49
+ res.resume()
50
+ resolve(new Response(null, { status, headers }))
51
+ return
52
+ }
53
+ // fetch decodes only when every listed coding is supported and leaves
54
+ // the headers as the server sent them
55
+ let source: Readable = res
56
+ const codings = (res.headers['content-encoding'] ?? '')
57
+ .split(',')
58
+ .map((entry) => entry.trim().toLowerCase())
59
+ .filter((entry) => entry && entry !== 'identity')
60
+ if (codings.every((coding) => DECODABLE_CODINGS.has(coding))) {
61
+ for (const coding of codings.reverse()) {
62
+ let decoder: Transform
63
+ if (coding === 'br') decoder = zlib.createBrotliDecompress()
64
+ else if (coding === 'deflate') {
65
+ // servers send zlib-wrapped or raw deflate; the first byte tells which
66
+ let inner: Transform | undefined
67
+ decoder = new Transform({
68
+ transform(chunk, _encoding, done) {
69
+ if (!inner) {
70
+ inner =
71
+ (chunk[0] & 0x0f) === 8
72
+ ? zlib.createInflate(TRUNCATION_TOLERANT)
73
+ : zlib.createInflateRaw(TRUNCATION_TOLERANT)
74
+ inner.on('data', (data) => decoder.push(data))
75
+ inner.on('error', (error) => decoder.destroy(error))
76
+ }
77
+ inner.write(chunk, done)
78
+ },
79
+ flush(done) {
80
+ if (!inner) return done()
81
+ inner.once('end', () => done())
82
+ inner.end()
83
+ },
84
+ destroy(error, done) {
85
+ inner?.destroy()
86
+ done(error)
87
+ },
88
+ })
89
+ } else decoder = zlib.createGunzip(TRUNCATION_TOLERANT)
90
+ source = pipeline(source, decoder, () => {})
91
+ }
92
+ }
93
+ const chunks = source[Symbol.asyncIterator]()
94
+ const body = new ReadableStream<Uint8Array>({
95
+ async pull(controller) {
96
+ try {
97
+ const chunk = await chunks.next()
98
+ if (chunk.done) controller.close()
99
+ else if (chunk.value instanceof Uint8Array) controller.enqueue(chunk.value)
100
+ else controller.error(new Error('HTTP response returned a non-byte chunk'))
101
+ } catch (error) {
102
+ controller.error(error)
103
+ }
104
+ },
105
+ cancel() {
106
+ source.destroy()
107
+ res.destroy()
108
+ },
109
+ })
110
+ resolve(new Response(body, { status, headers }))
111
+ },
112
+ )
113
+ req.on('error', reject)
114
+ req.end()
115
+ })
116
+ }
@@ -50,3 +50,49 @@ export function detachPackageVersionsFooter(source: string): {
50
50
  versions: detached.value === null ? null : readPackageVersions(detached.value),
51
51
  }
52
52
  }
53
+
54
+ // the installed react-native-worklets compiles its static feature flags from
55
+ // src/featureFlags/staticFlags.json plus the app manifest's `worklets` overrides.
56
+ // the producer that read the install records the resolved table beside the
57
+ // versions, keyed by the file it came from, so every app and runtime answers
58
+ // from what the app installed.
59
+ export const WORKLETS_STATIC_FLAGS_KEY = 'react-native-worklets/staticFlags.json'
60
+
61
+ export type WorkletsStaticFlags = Readonly<Record<string, boolean>>
62
+
63
+ function isFlagRecord(value: unknown): value is Record<string, unknown> {
64
+ return typeof value === 'object' && value !== null && !Array.isArray(value)
65
+ }
66
+
67
+ // package defaults with the app manifest's overrides, as the native build resolves them.
68
+ export function resolveWorkletsStaticFlags(
69
+ defaults: unknown,
70
+ appManifest: unknown,
71
+ ): string {
72
+ if (!isFlagRecord(defaults)) throw new Error('Worklets static flags are malformed')
73
+ const worklets = isFlagRecord(appManifest) ? appManifest.worklets : undefined
74
+ const overrides = isFlagRecord(worklets) ? worklets.staticFeatureFlags : undefined
75
+ if (overrides !== undefined && !isFlagRecord(overrides)) {
76
+ throw new Error('Worklets static flag overrides are malformed')
77
+ }
78
+ const flags: Record<string, boolean> = {}
79
+ for (const [name, value] of Object.entries({ ...defaults, ...overrides })) {
80
+ flags[name] = String(value) === 'true'
81
+ }
82
+ return JSON.stringify(flags)
83
+ }
84
+
85
+ export function readWorkletsStaticFlags(
86
+ versions: PackageVersions | null,
87
+ ): WorkletsStaticFlags | null {
88
+ const wire = versions?.[WORKLETS_STATIC_FLAGS_KEY]
89
+ if (wire === undefined) return null
90
+ const flags: unknown = JSON.parse(wire)
91
+ if (!isFlagRecord(flags)) throw new Error('invalid Worklets static flags')
92
+ const table: Record<string, boolean> = {}
93
+ for (const [name, value] of Object.entries(flags)) {
94
+ if (typeof value !== 'boolean') throw new Error('invalid Worklets static flags')
95
+ table[name] = value
96
+ }
97
+ return table
98
+ }
@@ -13,6 +13,7 @@ export interface DiscoveredServer {
13
13
  | 'kotlin'
14
14
  | 'unknown'
15
15
  status?: 'compiling' | 'ready' | 'error'
16
+ manifestProjectRoot?: string | null
16
17
  projectName?: string
17
18
  bundleUrl: string
18
19
  hmrUrl?: string
@@ -35,8 +35,6 @@ export interface SettingDef<T = any> {
35
35
  type: SettingType
36
36
  default: T
37
37
  description: string
38
- cliFlag?: string // --flag-name (omit for settings not exposed as CLI flags)
39
- cliFlagShort?: string // single-char shorthand like -d
40
38
  options?: readonly string[] // for enum type
41
39
  group: SettingGroup
42
40
  validate?: (value: T) => boolean
@@ -45,7 +43,6 @@ export interface SettingDef<T = any> {
45
43
  export type SettingGroup =
46
44
  | 'device'
47
45
  | 'appearance'
48
- | 'network'
49
46
  | 'locale'
50
47
  | 'simulator'
51
48
  | 'privacy'
@@ -69,8 +66,6 @@ export type RenderResolution = SootSimRenderResolution
69
66
  // and the stage background, for the same reason.
70
67
  export type StageBackground = SootSimStageBackground
71
68
 
72
- export type NetworkCondition = 'wifi' | 'lte' | 'fast-3g' | 'slow-3g' | 'offline'
73
-
74
69
  export type Orientation = 'portrait' | 'landscape'
75
70
 
76
71
  // all settings
@@ -110,8 +105,6 @@ export interface SettingsValues {
110
105
  preferCrossFadeTransitions: boolean
111
106
  // settings > appearance > liquid glass: 0 most clear, 1 most tinted
112
107
  glassTintAmount: number
113
- // network
114
- networkCondition: NetworkCondition
115
108
  // locale
116
109
  language: string
117
110
  region: string
@@ -180,8 +173,6 @@ export const settingsSchema: Record<SettingKey, SettingDef> = {
180
173
  type: 'enum',
181
174
  default: DEFAULT_DEVICE,
182
175
  description: 'device model to simulate',
183
- cliFlag: 'device',
184
- cliFlagShort: 'd',
185
176
  options: listDeviceModels(),
186
177
  group: 'device',
187
178
  },
@@ -196,7 +187,6 @@ export const settingsSchema: Record<SettingKey, SettingDef> = {
196
187
  type: 'enum',
197
188
  default: 'portrait',
198
189
  description: 'screen orientation',
199
- cliFlag: 'orientation',
200
190
  options: ['portrait', 'landscape'] as const,
201
191
  group: 'device',
202
192
  },
@@ -204,7 +194,6 @@ export const settingsSchema: Record<SettingKey, SettingDef> = {
204
194
  type: 'enum',
205
195
  default: 'left',
206
196
  description: 'which landscape the device turns to: left (clockwise) or right',
207
- cliFlag: 'landscape-side',
208
197
  options: ['left', 'right'] as const,
209
198
  group: 'device',
210
199
  },
@@ -229,8 +218,6 @@ export const settingsSchema: Record<SettingKey, SettingDef> = {
229
218
  type: 'enum',
230
219
  default: 'auto',
231
220
  description: 'color scheme (auto follows system preference)',
232
- cliFlag: 'theme',
233
- cliFlagShort: 't',
234
221
  options: ['light', 'dark', 'auto'] as const,
235
222
  group: 'appearance',
236
223
  },
@@ -313,29 +300,17 @@ export const settingsSchema: Record<SettingKey, SettingDef> = {
313
300
  validate: (value: number) => value >= 0 && value <= 1,
314
301
  },
315
302
 
316
- // network
317
- networkCondition: {
318
- type: 'enum',
319
- default: 'wifi',
320
- description: 'simulated network condition',
321
- cliFlag: 'network',
322
- options: ['wifi', 'lte', 'fast-3g', 'slow-3g', 'offline'] as const,
323
- group: 'network',
324
- },
325
-
326
303
  // locale
327
304
  language: {
328
305
  type: 'string',
329
306
  default: DEFAULT_REACT_NATIVE_CONFIGURATION.language,
330
307
  description: 'language code (ISO 639-1)',
331
- cliFlag: 'language',
332
308
  group: 'locale',
333
309
  },
334
310
  region: {
335
311
  type: 'string',
336
312
  default: DEFAULT_REACT_NATIVE_CONFIGURATION.region,
337
313
  description: 'region code (ISO 3166-1)',
338
- cliFlag: 'region',
339
314
  group: 'locale',
340
315
  },
341
316
 
@@ -372,14 +347,12 @@ export const settingsSchema: Record<SettingKey, SettingDef> = {
372
347
  type: 'boolean',
373
348
  default: false,
374
349
  description: 'show touch indicators',
375
- cliFlag: 'show-touches',
376
350
  group: 'simulator',
377
351
  },
378
352
  showFrame: {
379
353
  type: 'boolean',
380
354
  default: true,
381
355
  description: 'show device frame',
382
- cliFlag: 'frame',
383
356
  group: 'simulator',
384
357
  },
385
358
  showMenuBar: {
@@ -399,7 +372,6 @@ export const settingsSchema: Record<SettingKey, SettingDef> = {
399
372
  default: true,
400
373
  description:
401
374
  'show the connected agent indicator over the device while a CLI or agent drives it',
402
- cliFlag: 'agent-indicator',
403
375
  group: 'simulator',
404
376
  },
405
377
  solidWindow: {
@@ -415,7 +387,6 @@ export const settingsSchema: Record<SettingKey, SettingDef> = {
415
387
  description:
416
388
  "bleed the app's own edge colors outward behind the device, like bias lighting behind a TV (off, soft, full)",
417
389
  options: SOOTSIM_AMBIENT_GLOW_LEVELS,
418
- cliFlag: 'ambient-glow',
419
390
  group: 'simulator',
420
391
  },
421
392
  stageBackground: {
@@ -424,7 +395,6 @@ export const settingsSchema: Record<SettingKey, SettingDef> = {
424
395
  description:
425
396
  "the stage behind the device: system follows the computer's appearance (white in light mode, black in dark), or light, dark or gray",
426
397
  options: SOOTSIM_STAGE_BACKGROUNDS,
427
- cliFlag: 'stage-background',
428
398
  group: 'simulator',
429
399
  },
430
400
  stageChecker: {
@@ -8,6 +8,7 @@ import { createHash } from 'node:crypto'
8
8
  import fs from 'node:fs'
9
9
  import path from 'node:path'
10
10
  import { cacheDir as peachCacheDir } from './home-paths'
11
+ import { moduleMapName } from './swift-package'
11
12
  import type { SwiftPackageBinary } from './swift-packages'
12
13
 
13
14
  const cacheDir = path.join(peachCacheDir(), 'swift-binary-modules')
@@ -88,19 +89,33 @@ async function zipEntries(url: string): Promise<string[]> {
88
89
  return names
89
90
  }
90
91
 
91
- function localEntries(dir: string): string[] {
92
+ function localModules(dir: string): string[] {
92
93
  if (!fs.existsSync(dir)) return []
93
- return fs
94
+ const slices = fs
94
95
  .readdirSync(dir, { withFileTypes: true })
95
96
  .filter((slice) => slice.isDirectory())
96
- .flatMap((slice) =>
97
+ const frameworks = frameworkModules(
98
+ slices.flatMap((slice) =>
97
99
  fs.readdirSync(path.join(dir, slice.name)).map((entry) => `${slice.name}/${entry}`),
98
- )
100
+ ),
101
+ )
102
+ if (frameworks.length > 0) return frameworks
103
+ const modules = new Set<string>()
104
+ for (const slice of slices) {
105
+ const headers = path.join(dir, slice.name, 'Headers')
106
+ if (!fs.existsSync(headers)) continue
107
+ for (const file of fs.readdirSync(headers, { recursive: true, encoding: 'utf8' })) {
108
+ if (path.basename(file) !== 'module.modulemap') continue
109
+ const module = moduleMapName(fs.readFileSync(path.join(headers, file), 'utf8'))
110
+ if (module) modules.add(module)
111
+ }
112
+ }
113
+ return [...modules].sort()
99
114
  }
100
115
 
101
116
  /** the modules a binary target ships, cached per declared archive checksum. */
102
117
  export async function swiftBinaryModules(binary: SwiftPackageBinary): Promise<string[]> {
103
- if (!binary.url) return frameworkModules(localEntries(binary.dir))
118
+ if (!binary.url) return localModules(binary.dir)
104
119
  const cached = path.join(
105
120
  cacheDir,
106
121
  `${createHash('sha256')