peachsim 0.1.2233 → 0.1.2235
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/command-registry.ts +1 -0
- package/cli/commands/control.ts +12 -0
- package/cli/commands/stream.ts +150 -0
- package/cli/main.ts +6 -0
- package/cli/outbound-endpoints.ts +10 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +33 -47
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +31 -45
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +33 -47
- package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +4 -4
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +54 -53
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +385 -212
- package/dist-lib/swift-compile.cjs +13 -21
- package/dist-lib/swift-compile.mjs +13 -21
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +14 -22
- package/dist-lib/vite.cjs +4 -4
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/native-layout.d.ts +4 -1
- package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/settings/devices.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +8 -0
- package/dist-types/packages/peach-globals/src/globalsContract.d.ts +2 -1
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/skills/contrast/SKILL.md +1 -0
- package/src/expo-native-workspace.ts +16 -21
- package/src/expo-swift-host.ts +2 -2
- package/src/react-native-bridge-modules.ts +6 -6
- package/src/swift-guest-runtime-plan.ts +2 -2
- package/src/swift-shared-sdk.ts +7 -10
- package/src/swift-wasm-prune.ts +3 -8
|
@@ -8,7 +8,7 @@ import { createRequire } from 'node:module'
|
|
|
8
8
|
import path from 'node:path'
|
|
9
9
|
import { peachAnsweredNativePackages } from './answeredNativePackages'
|
|
10
10
|
import { swiftCodeMask, swiftSourceClosure } from './swift-compile'
|
|
11
|
-
import { xcodeNativeFlags,
|
|
11
|
+
import { xcodeNativeFlags, xcodeObjCInputsAsync } from './swift-objc-compile'
|
|
12
12
|
import { SWIFT_NATIVE_INPUT_ROOT, SWIFT_NATIVE_SDK_INCLUDE } from './swiftContract'
|
|
13
13
|
import {
|
|
14
14
|
findXcodeProject,
|
|
@@ -324,15 +324,15 @@ export const BRIDGE_MODULE_FILE_PREFIX = '__peach_react_module_'
|
|
|
324
324
|
* each, or null when the app has no iOS project or registers none. a module
|
|
325
325
|
* the host cannot provide is a unit with a diagnostic instead of files.
|
|
326
326
|
*/
|
|
327
|
-
export function collectBridgeModuleSources(
|
|
327
|
+
export async function collectBridgeModuleSources(
|
|
328
328
|
appRoot: string,
|
|
329
329
|
signal?: AbortSignal,
|
|
330
330
|
installedWorkspace?: string,
|
|
331
|
-
): {
|
|
331
|
+
): Promise<{
|
|
332
332
|
units: ExpoSwiftSourceUnit[]
|
|
333
333
|
failures: { namespace: string; diagnostic: string }[]
|
|
334
334
|
installedNamespaces: string[]
|
|
335
|
-
} | null {
|
|
335
|
+
} | null> {
|
|
336
336
|
signal?.throwIfAborted()
|
|
337
337
|
const units: ExpoSwiftSourceUnit[] = []
|
|
338
338
|
const failures: { namespace: string; diagnostic: string }[] = []
|
|
@@ -351,7 +351,7 @@ export function collectBridgeModuleSources(
|
|
|
351
351
|
installedPods: installedWorkspace !== undefined,
|
|
352
352
|
})
|
|
353
353
|
: null
|
|
354
|
-
let nativeInputs: ReturnType<typeof
|
|
354
|
+
let nativeInputs: Awaited<ReturnType<typeof xcodeObjCInputsAsync>> | undefined
|
|
355
355
|
// the reader owns dependency order and visits a shared framework only once.
|
|
356
356
|
// each target keeps its own Swift module identity and compilation settings.
|
|
357
357
|
for (const target of app ? [...app.frameworks, app] : []) {
|
|
@@ -477,7 +477,7 @@ export function collectBridgeModuleSources(
|
|
|
477
477
|
if (swiftClass) {
|
|
478
478
|
const bridgingHeader = target.objc?.bridgingHeader
|
|
479
479
|
if (bridgingHeader && target.objc && app) {
|
|
480
|
-
nativeInputs ??=
|
|
480
|
+
nativeInputs ??= await xcodeObjCInputsAsync(
|
|
481
481
|
app,
|
|
482
482
|
[],
|
|
483
483
|
null,
|
|
@@ -4,7 +4,7 @@ import path from 'node:path'
|
|
|
4
4
|
import * as v from 'valibot'
|
|
5
5
|
import { ordinaryGuestCallerScopes } from './swift-guest-source-plan'
|
|
6
6
|
import { frameworkRuntimeProductId } from './swift-runtime-products'
|
|
7
|
-
import {
|
|
7
|
+
import { weakenFoundationOverridesInArchive } from './swift-shared-sdk'
|
|
8
8
|
import {
|
|
9
9
|
patchSwiftrtObject,
|
|
10
10
|
readArMembers,
|
|
@@ -52,7 +52,7 @@ function sdkArtifactBytes(root: string, artifact: SwiftSdkProduct['artifacts'][n
|
|
|
52
52
|
if (hash(source) !== artifact.sha256)
|
|
53
53
|
throw new Error(`SDK product artifact changed ${file}`)
|
|
54
54
|
const transformed = Uint8Array.from(source)
|
|
55
|
-
|
|
55
|
+
weakenFoundationOverridesInArchive(transformed)
|
|
56
56
|
if (!linked.equals(transformed))
|
|
57
57
|
throw new Error(`SDK view transformation changed ${file}`)
|
|
58
58
|
return { source, linked }
|
package/src/swift-shared-sdk.ts
CHANGED
|
@@ -70,10 +70,7 @@ function readULEB(b: Uint8Array, o: number): [number, number] {
|
|
|
70
70
|
return [res, p]
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
const
|
|
74
|
-
'$s10Foundation6BundleC22preferredLocalizations4from14forPreferencesSaySSGAG_AGSgtFZ',
|
|
75
|
-
'$s10Foundation6BundleC22preferredLocalizations4fromSaySSGAF_tFZ',
|
|
76
|
-
'$s10Foundation6BundleC22preferredLocalizationsSaySSGvg',
|
|
73
|
+
const WEAKEN_FOUNDATION_SYMS = new Set([
|
|
77
74
|
'$s10Foundation16NSSortDescriptorC3key9ascendingACSSSg_SbtcfC',
|
|
78
75
|
'$s10Foundation16NSSortDescriptorC3key9ascendingACSSSg_Sbtcfc',
|
|
79
76
|
'$s10Foundation16NSSortDescriptorC3keySSSgvg',
|
|
@@ -81,7 +78,7 @@ const WEAKEN_BUNDLE_SYMS = new Set([
|
|
|
81
78
|
'$s10Foundation16NSSortDescriptorC7keyPath9ascendingACs03KeyE0Cyxq_G_SbtcSLR_r0_lufc',
|
|
82
79
|
])
|
|
83
80
|
|
|
84
|
-
function
|
|
81
|
+
function weakenFoundationSymbolsInWasmObj(buf: Uint8Array): void {
|
|
85
82
|
let pos = 8
|
|
86
83
|
while (pos < buf.length) {
|
|
87
84
|
const id = buf[pos++]!
|
|
@@ -112,7 +109,7 @@ function weakenBundleSymbolsInWasmObj(buf: Uint8Array): void {
|
|
|
112
109
|
if (!isUndef || isExplicitName) {
|
|
113
110
|
const [sLen, c4] = readULEB(buf, cur)
|
|
114
111
|
const sName = Buffer.from(buf.subarray(c4, c4 + sLen)).toString('utf8')
|
|
115
|
-
if (!isUndef && kind === 0 &&
|
|
112
|
+
if (!isUndef && kind === 0 && WEAKEN_FOUNDATION_SYMS.has(sName)) {
|
|
116
113
|
buf[flOffset] = (buf[flOffset]! & ~0x03) | 0x01
|
|
117
114
|
}
|
|
118
115
|
cur = c4 + sLen
|
|
@@ -140,7 +137,7 @@ function weakenBundleSymbolsInWasmObj(buf: Uint8Array): void {
|
|
|
140
137
|
}
|
|
141
138
|
}
|
|
142
139
|
|
|
143
|
-
export function
|
|
140
|
+
export function weakenFoundationOverridesInArchive(arBuf: Uint8Array): void {
|
|
144
141
|
let gnuNames: Uint8Array | null = null
|
|
145
142
|
let pos = 8
|
|
146
143
|
while (pos + 60 <= arBuf.length) {
|
|
@@ -186,8 +183,8 @@ export function weakenBundleInArchive(arBuf: Uint8Array): void {
|
|
|
186
183
|
} else if (name.endsWith('/')) {
|
|
187
184
|
name = name.slice(0, -1)
|
|
188
185
|
}
|
|
189
|
-
if (name.endsWith('
|
|
190
|
-
|
|
186
|
+
if (name.endsWith('NSSortDescriptor.o')) {
|
|
187
|
+
weakenFoundationSymbolsInWasmObj(arBuf.subarray(bodyStart, bodyEnd))
|
|
191
188
|
}
|
|
192
189
|
pos = bodyEnd + (size & 1)
|
|
193
190
|
}
|
|
@@ -396,7 +393,7 @@ export function swiftSharedSdkViewOptions(
|
|
|
396
393
|
path.relative(realRoot, foundationArchive),
|
|
397
394
|
)
|
|
398
395
|
const arBuf = new Uint8Array(fs.readFileSync(foundationArchive))
|
|
399
|
-
|
|
396
|
+
weakenFoundationOverridesInArchive(arBuf)
|
|
400
397
|
fs.writeFileSync(foundationSlot, arBuf)
|
|
401
398
|
}
|
|
402
399
|
try {
|
package/src/swift-wasm-prune.ts
CHANGED
|
@@ -1704,12 +1704,7 @@ export function pruneSwiftWasmLink(
|
|
|
1704
1704
|
if (def) activateSymbolInObj(def.obj, def.symIdx)
|
|
1705
1705
|
}
|
|
1706
1706
|
|
|
1707
|
-
const
|
|
1708
|
-
'$s10Foundation6BundleC22preferredLocalizations4from14forPreferencesSaySSGAG_AGSgtFZ',
|
|
1709
|
-
'$s10Foundation6BundleC22preferredLocalizations4fromSaySSGAF_tFZ',
|
|
1710
|
-
'$s10Foundation6BundleC22preferredLocalizationsSaySSGvg',
|
|
1711
|
-
'$s10Foundation6BundleC22preferredLocalizations4from14forPreferencesSaySSGAG_AGSgtFZTf4nnd_n',
|
|
1712
|
-
'$s10Foundation6BundleC22preferredLocalizations4fromSaySSGAF_tFZTf4nd_n',
|
|
1707
|
+
const WEAKEN_SDK_FOUNDATION_SYMS = new Set([
|
|
1713
1708
|
'$s10Foundation16NSSortDescriptorC3key9ascendingACSSSg_SbtcfC',
|
|
1714
1709
|
'$s10Foundation16NSSortDescriptorC3key9ascendingACSSSg_Sbtcfc',
|
|
1715
1710
|
'$s10Foundation16NSSortDescriptorC3keySSSgvg',
|
|
@@ -1745,7 +1740,7 @@ export function pruneSwiftWasmLink(
|
|
|
1745
1740
|
} else {
|
|
1746
1741
|
const name = obj.symNames[symIdx]!
|
|
1747
1742
|
if (!name) continue
|
|
1748
|
-
if (
|
|
1743
|
+
if (WEAKEN_SDK_FOUNDATION_SYMS.has(name)) {
|
|
1749
1744
|
const overrideCand = lazyProviders
|
|
1750
1745
|
.get(name)
|
|
1751
1746
|
?.find((c) => !c.file.startsWith(sdkObjsDir))
|
|
@@ -2009,7 +2004,7 @@ export function pruneSwiftWasmLink(
|
|
|
2009
2004
|
!isUndef &&
|
|
2010
2005
|
kind === 0 &&
|
|
2011
2006
|
obj.file.startsWith(sdkObjsDir) &&
|
|
2012
|
-
|
|
2007
|
+
WEAKEN_SDK_FOUNDATION_SYMS.has(obj.symNames[i]!)
|
|
2013
2008
|
) {
|
|
2014
2009
|
newFl = ((fl & ~0x03) | 0x01) & 0x7f
|
|
2015
2010
|
}
|