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.
- package/cli/bridge-flow-runner.ts +61 -39
- package/cli/commands/agent-wrapper.ts +21 -10
- package/cli/commands/control.ts +27 -7
- package/cli/commands/coverage.ts +1 -1
- package/cli/commands/detect.ts +17 -4
- package/cli/commands/maestro-compare.ts +25 -99
- package/cli/help-core.ts +3 -4
- package/cli/maestro-compare.ts +172 -4
- package/cli/outbound-endpoints.ts +2 -10
- package/detox/index.ts +15 -0
- package/detox/launch-permissions.ts +169 -0
- package/dist-lib/agent-daemon-client.cjs +2 -2
- package/dist-lib/agent-events.cjs +2 -2
- package/dist-lib/attached-projects.cjs +2 -2
- package/dist-lib/auth/shared-session.cjs +2 -2
- package/dist-lib/backend-origin.cjs +2 -2
- package/dist-lib/beta.cjs +2 -2
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +2 -2
- package/dist-lib/bridge-contract-input.cjs +2 -2
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +2 -2
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +18273 -15925
- package/dist-lib/capture-contract.cjs +2 -2
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +2 -2
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +2 -2
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +2 -2
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +2 -2
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +104 -3
- package/dist-lib/dev-bundle-resolution.cjs +208 -44
- package/dist-lib/expo-swift-bundle.cjs +2349 -1778
- package/dist-lib/expo-swift-metadata.cjs +2 -2
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +2 -2
- package/dist-lib/host/bridge-host.cjs +7885 -3334
- package/dist-lib/host/fetch-proxy-handler.cjs +331 -39
- package/dist-lib/host/fetch-proxy-overrides.cjs +2 -2
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +2 -2
- package/dist-lib/host/websocket-proxy.cjs +2 -2
- package/dist-lib/index.cjs +297 -77
- package/dist-lib/jump-to-source-babel.cjs +2 -2
- package/dist-lib/jump-to-source-native.cjs +2 -2
- package/dist-lib/kotlin-host.cjs +2 -2
- package/dist-lib/menu.cjs +2 -2
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +2 -2
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +2 -2
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +294 -74
- package/dist-lib/native-app-identity-project.cjs +48 -37
- package/dist-lib/native-app-identity-project.mjs +47 -36
- package/dist-lib/native-app-identity.cjs +2 -2
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +2 -2
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +2 -2
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +2 -2
- package/dist-lib/public-brand.cjs +2 -2
- package/dist-lib/public-origins-lib-esm.json +24 -23
- package/dist-lib/public-origins-lib.json +199 -79
- package/dist-lib/react-native-host-modules.cjs +2 -2
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +2 -2
- package/dist-lib/scripts/dev-server-scanner.cjs +206 -31
- package/dist-lib/sdk.cjs +2 -2
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +19600 -15992
- package/dist-lib/swift-compile.cjs +640 -402
- package/dist-lib/swift-compile.mjs +595 -357
- package/dist-lib/swift-package.cjs +24 -20
- package/dist-lib/swift-package.mjs +23 -19
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +31 -4
- package/dist-lib/swift.cjs +2 -2
- package/dist-lib/vite-swift.cjs +1559 -1208
- package/dist-lib/vite.cjs +251 -42
- package/dist-lib/worklet-executable.cjs +2 -2
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/scroll-pan-contacts.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +7 -0
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +17 -0
- package/dist-types/packages/peach-engine/src/render-worker/worker-input-runtime.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +3 -0
- package/dist-types/packages/peach-globals/src/cameraBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/shellHostBridgeContract.d.ts +3 -0
- package/dist-types/packages/peach-kit/src/materials/types.d.ts +1 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +4 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h +2282 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h +55 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h +10551 -6
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h +4236 -3
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h +827 -8
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h +1369 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h +1243 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h +1747 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h +291 -2
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h +1283 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h +811 -91
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h +1342 -25
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns.h +2738 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h +1685 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h +913 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h +1917 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h +23 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h +209 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h +104 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h +77 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h +554 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h +58 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h +186 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h +86 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h +364 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h +195 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h +44 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/BLAS.h +2330 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/Types.h +123 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Solve.h +8339 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h +520 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h +1893 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h +10 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/blas_new.h +1098 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas.h +859 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas_new.h +1134 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/clapack.h +10555 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/fortran_blas.h +695 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack.h +38526 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_types.h +60 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_version.h +20 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/thread_api.h +50 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h +1218 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBigNum.h +1458 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP.h +10377 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP_translate.h +167 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vForce.h +1243 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h +114 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLibTypes.h +146 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vectorOps.h +1106 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vfp.h +294 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h +25 -1
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h +673 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h +232 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h +827 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h +121 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h +387 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h +79 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h +122 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h +674 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h +182 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h +213 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h +82 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h +129 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h +491 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h +883 -2
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h +98 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +11 -229
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +2 -6
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +2 -1
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +1 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecBase.h +906 -3
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h +613 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecItem.h +1284 -29
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h +441 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecTrust.h +845 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/Security.h +4 -0
- package/sdk/ios/usr/include/AvailabilityMacros.h +3985 -0
- package/sdk/ios/usr/include/copyfile.h +143 -0
- package/sdk/ios/usr/include/malloc/_malloc.h +143 -0
- package/sdk/ios/usr/include/malloc/_malloc_type.h +153 -0
- package/sdk/ios/usr/include/malloc/_platform.h +80 -0
- package/sdk/ios/usr/include/malloc/_ptrcheck.h +43 -0
- package/sdk/ios/usr/include/malloc/malloc.h +768 -0
- package/sdk/ios/usr/include/os/availability.h +168 -6
- package/sdk/ios/usr/include/os/base.h +351 -0
- package/sdk/ios/usr/include/os/clock.h +18 -0
- package/sdk/ios/usr/include/os/lock.h +232 -10
- package/sdk/ios/usr/include/os/log.h +521 -38
- package/sdk/ios/usr/include/os/object.h +320 -3
- package/sdk/ios/usr/include/os/trace.h +492 -0
- package/sdk/ios/usr/include/os/trace_base.h +167 -0
- package/sdk/ios/usr/include/os/workgroup.h +37 -0
- package/sdk/ios/usr/include/os/workgroup_base.h +91 -0
- package/sdk/ios/usr/include/os/workgroup_interval.h +156 -0
- package/sdk/ios/usr/include/os/workgroup_object.h +359 -0
- package/sdk/ios/usr/include/os/workgroup_parallel.h +76 -0
- package/sdk/ios/usr/include/sys/cdefs.h +38 -0
- package/sdk/ios/wasm/include/unistd.h +3 -0
- package/skills/contrast/SKILL.md +3 -0
- package/src/codex-client.ts +11 -6
- package/src/dev-bundle-resolution.ts +124 -48
- package/src/expo-native-workspace.ts +176 -0
- package/src/expo-swift-host.ts +161 -26
- package/src/expo-swift-ready.ts +14 -28
- package/src/expoSwiftContract.ts +4 -1
- package/src/generated/swift-c-predefines.json +68 -12
- package/src/host/bridge-host.ts +5 -0
- package/src/installed-package-versions.ts +14 -1
- package/src/metro-project-root.ts +44 -33
- package/src/native-app-identity-project.ts +1 -0
- package/src/nitro-adapter.lock.json +916 -10
- package/src/nitro-adapter.ts +33 -24
- package/src/nitro-bundle.ts +108 -22
- package/src/nitro-compile.ts +32 -5
- package/src/nitro-source.ts +13 -3
- package/src/nitroAdapterContract.ts +100 -20
- package/src/node-http-fetch.ts +116 -0
- package/src/packageVersionsContract.ts +46 -0
- package/src/serverDiscoveryContract.ts +1 -0
- package/src/settingsContract.ts +0 -30
- package/src/swift-binary-modules.ts +20 -5
- package/src/swift-compile.ts +168 -48
- package/src/swift-coverage/xcode-assets.ts +4 -3
- package/src/swift-host.ts +14 -3
- package/src/swift-objc-compile.ts +32 -5
- package/src/swift-objc-metadata.ts +2 -2
- package/src/swift-objc-platform.ts +2 -2
- package/src/swift-objc-standin.ts +43 -13
- package/src/swift-package.ts +33 -26
- package/src/swift-source-pods.ts +126 -41
- package/src/swift-standin-digest.ts +77 -0
- package/src/swift-standin-emit.ts +40 -4
- package/src/swift-standins.ts +68 -19
- package/src/swift-toolchain.ts +38 -0
- package/src/swiftContract.ts +8 -0
- package/src/vite-plugin.ts +0 -10
- package/src/xcode-project.ts +62 -42
- 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
|
+
}
|
package/src/settingsContract.ts
CHANGED
|
@@ -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
|
|
92
|
+
function localModules(dir: string): string[] {
|
|
92
93
|
if (!fs.existsSync(dir)) return []
|
|
93
|
-
|
|
94
|
+
const slices = fs
|
|
94
95
|
.readdirSync(dir, { withFileTypes: true })
|
|
95
96
|
.filter((slice) => slice.isDirectory())
|
|
96
|
-
|
|
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
|
|
118
|
+
if (!binary.url) return localModules(binary.dir)
|
|
104
119
|
const cached = path.join(
|
|
105
120
|
cacheDir,
|
|
106
121
|
`${createHash('sha256')
|