peachsim 0.1.2298 → 0.1.2299
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/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 +89 -16
- 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 +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +87 -14
- 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 +98 -25
- 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 +5 -5
- 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 +5 -5
- package/dist-lib/native-app-identity-project.cjs +4 -4
- package/dist-lib/native-app-identity-project.mjs +4 -4
- 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 +53 -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 +99 -26
- package/dist-lib/swift-compile.cjs +24 -2
- package/dist-lib/swift-compile.mjs +24 -2
- 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 +34 -9
- 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/render-worker/nativeAnimMirrorContract.d.ts +2 -1
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +2 -2
- package/dist-types/packages/peach-kit/src/transitions/screen-transition-math.d.ts +23 -11
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/src/expo-discovery-cache.ts +65 -4
- package/src/native-swift-slices.ts +9 -2
- package/src/swift-standins.ts +6 -3
- package/src/swift-wasm-prune.ts +29 -0
- package/src/xcode-project.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LayoutHookPlacement, SootSimNode as SlotContainer } from '../../peach-engine/src/engine/node.d.ts';
|
|
2
2
|
import type { ScreenFormSheetCommit, ScreenFormSheetMotion } from '../../peach-engine/src/render-worker/screen-form-sheet-commit-protocol.d.ts';
|
|
3
3
|
import type { ScreenInfo } from './navigation-types.d.ts';
|
|
4
|
-
import type { ShellInteractiveEdgeSwipeSpec, ShellInteractiveFormSheetSpec } from './transitions/screen-transition-math.d.ts';
|
|
4
|
+
import type { ShellInteractiveEdgeSwipeSpec, ShellInteractiveFormSheetSpec, ZoomFinger } from './transitions/screen-transition-math.d.ts';
|
|
5
5
|
import type { ShellNativeEvaluationOwner, SystemPermissionDescriptor, SystemPermissionKind, SystemPermissionLocationAccuracy, SystemPermissionState, SystemPermissionStatus, SootsimSettingsPage } from '../../peach-globals/src/index.d.ts';
|
|
6
6
|
import type { ComponentType, Context, ReactNode, ReactPortal } from 'react';
|
|
7
7
|
export type { SystemNotificationSettings, SystemPermissionDescriptor, SystemPermissionKind, SystemPermissionLocationAccuracy, SystemPermissionState, SystemPermissionStatus, } from '../../peach-globals/src/index.d.ts';
|
|
@@ -271,7 +271,7 @@ export interface SootSimEngineConfig {
|
|
|
271
271
|
interactiveId: number;
|
|
272
272
|
surfaceId: string;
|
|
273
273
|
generation: number;
|
|
274
|
-
}, drag: number) => void;
|
|
274
|
+
}, drag: number, finger?: ZoomFinger) => void;
|
|
275
275
|
endShellScreenInteractive?: (owner: {
|
|
276
276
|
interactiveId: number;
|
|
277
277
|
surfaceId: string;
|
|
@@ -97,7 +97,6 @@ export interface ScreenSlideInput {
|
|
|
97
97
|
height: number;
|
|
98
98
|
};
|
|
99
99
|
zoomInteraction?: ZoomInteraction;
|
|
100
|
-
zoomEdgeDrag?: ZoomEdgeDrag;
|
|
101
100
|
zoomRelease?: ZoomRelease;
|
|
102
101
|
zoomReleaseMs?: number;
|
|
103
102
|
handoff01?: number;
|
|
@@ -236,19 +235,32 @@ export interface SlideTrack {
|
|
|
236
235
|
}
|
|
237
236
|
export declare function slideTrackFollow(track: SlideTrack, target: number, dtMs: number): SlideTrack;
|
|
238
237
|
export declare function slideTrackSettled(track: SlideTrack, target: number, screenWidth: number): boolean;
|
|
239
|
-
export interface
|
|
238
|
+
export interface ZoomFinger {
|
|
239
|
+
gesture: 'edge' | 'pull';
|
|
240
240
|
touchX: number;
|
|
241
241
|
touchY: number;
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
242
|
+
dx: number;
|
|
243
|
+
dy: number;
|
|
244
|
+
}
|
|
245
|
+
export declare function zoomFingerPose(finger: ZoomFinger, target: ZoomTargetRect): ZoomInteraction;
|
|
246
|
+
export interface ZoomFollow {
|
|
247
|
+
pose: ZoomInteraction;
|
|
248
|
+
velocity: {
|
|
249
|
+
anchorX: number;
|
|
250
|
+
anchorY: number;
|
|
251
|
+
contentScale: number;
|
|
252
|
+
boundsProgress: number;
|
|
253
|
+
};
|
|
254
|
+
samples: number;
|
|
255
|
+
}
|
|
256
|
+
export declare function zoomFollowStart(finger: ZoomFinger, target: ZoomTargetRect): ZoomFollow;
|
|
257
|
+
export declare function zoomFollowStep(follow: ZoomFollow, goal: ZoomInteraction, dtMs: number): ZoomFollow;
|
|
258
|
+
export declare function zoomFollowSettled(follow: ZoomFollow, goal: ZoomInteraction, target: ZoomTargetRect): boolean;
|
|
250
259
|
export declare function zoomEdgeDismissCommits(translation: number, vx: number): boolean;
|
|
251
|
-
export declare function
|
|
260
|
+
export declare function zoomFollowRelease(follow: ZoomFollow, gesture: ZoomFinger['gesture'], commit: boolean, fingerVelocity: {
|
|
261
|
+
x: number;
|
|
262
|
+
y: number;
|
|
263
|
+
}): ZoomRelease;
|
|
252
264
|
export declare const ZOOM_RELEASE_COMMIT_MS = 700;
|
|
253
265
|
export declare const ZOOM_PULL_COMMIT_SCALE_SPRING: {
|
|
254
266
|
omega: number;
|
package/kotlin/sdk.tar.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -233,6 +233,7 @@ export function readExpoDiscovery(key: string): ExpoSwiftSourceUnit[] | null | u
|
|
|
233
233
|
for (const [directory, expected] of Object.entries(parsed.frameworks)) {
|
|
234
234
|
if (frameworkDigest(directory) !== expected) return undefined
|
|
235
235
|
}
|
|
236
|
+
saveFileHashes()
|
|
236
237
|
} catch {
|
|
237
238
|
return undefined
|
|
238
239
|
}
|
|
@@ -291,6 +292,68 @@ export function readExpoDiscovery(key: string): ExpoSwiftSourceUnit[] | null | u
|
|
|
291
292
|
|
|
292
293
|
const sourceLocationLine = /^#sourceLocation\(file: "(.*)", line: 1\)$/
|
|
293
294
|
|
|
295
|
+
// a warm read re-verifies every framework file; a file whose stat is unchanged
|
|
296
|
+
// reuses its saved hash, as the swift sdk check does.
|
|
297
|
+
const fileHashes = new Map<string, { stamp: string; checksum: string }>()
|
|
298
|
+
let fileHashesLoaded = false
|
|
299
|
+
let fileHashesChanged = false
|
|
300
|
+
|
|
301
|
+
function fileHashesPath(): string {
|
|
302
|
+
return path.join(sharedDir(), 'framework-file-hashes.json')
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function stampedFileHash(file: string): string {
|
|
306
|
+
if (!fileHashesLoaded) {
|
|
307
|
+
fileHashesLoaded = true
|
|
308
|
+
try {
|
|
309
|
+
const saved: unknown = JSON.parse(fs.readFileSync(fileHashesPath(), 'utf8'))
|
|
310
|
+
if (isRecord(saved))
|
|
311
|
+
for (const [entry, value] of Object.entries(saved))
|
|
312
|
+
if (
|
|
313
|
+
Array.isArray(value) &&
|
|
314
|
+
typeof value[0] === 'string' &&
|
|
315
|
+
typeof value[1] === 'string'
|
|
316
|
+
)
|
|
317
|
+
fileHashes.set(entry, { stamp: value[0], checksum: value[1] })
|
|
318
|
+
} catch {
|
|
319
|
+
// an unreadable save starts empty; every file is hashed again
|
|
320
|
+
fileHashes.clear()
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
const stat = fs.statSync(file, { bigint: true })
|
|
324
|
+
const stamp = [stat.dev, stat.ino, stat.size, stat.mtimeNs, stat.ctimeNs].join(':')
|
|
325
|
+
const cached = fileHashes.get(file)
|
|
326
|
+
if (cached?.stamp === stamp) return cached.checksum
|
|
327
|
+
const checksum = createHash('sha256').update(fs.readFileSync(file)).digest('hex')
|
|
328
|
+
fileHashes.set(file, { stamp, checksum })
|
|
329
|
+
fileHashesChanged = true
|
|
330
|
+
return checksum
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function saveFileHashes(): void {
|
|
334
|
+
if (!fileHashesChanged) return
|
|
335
|
+
fileHashesChanged = false
|
|
336
|
+
const target = fileHashesPath()
|
|
337
|
+
const temporary = `${target}.${process.pid}.${randomUUID()}.tmp`
|
|
338
|
+
// a failed save only costs the next process the hashing it skipped
|
|
339
|
+
try {
|
|
340
|
+
fs.mkdirSync(path.dirname(target), { recursive: true })
|
|
341
|
+
fs.writeFileSync(
|
|
342
|
+
temporary,
|
|
343
|
+
JSON.stringify(
|
|
344
|
+
Object.fromEntries(
|
|
345
|
+
[...fileHashes]
|
|
346
|
+
.filter(([entry]) => fs.existsSync(entry))
|
|
347
|
+
.map(([entry, { stamp, checksum }]) => [entry, [stamp, checksum]]),
|
|
348
|
+
),
|
|
349
|
+
),
|
|
350
|
+
)
|
|
351
|
+
fs.renameSync(temporary, target)
|
|
352
|
+
} catch {
|
|
353
|
+
fs.rmSync(temporary, { force: true })
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
294
357
|
// digest a framework tree the way the collector traverses it: every file by
|
|
295
358
|
// bytes, every link by target, each directory once.
|
|
296
359
|
function treeDigest(directory: string, signal?: AbortSignal): Map<string, string> {
|
|
@@ -311,10 +374,7 @@ function treeDigest(directory: string, signal?: AbortSignal): Map<string, string
|
|
|
311
374
|
} else if (child.isDirectory()) {
|
|
312
375
|
walk(file)
|
|
313
376
|
} else if (child.isFile()) {
|
|
314
|
-
entries.set(
|
|
315
|
-
relative,
|
|
316
|
-
`file\0${createHash('sha256').update(fs.readFileSync(file)).digest('hex')}`,
|
|
317
|
-
)
|
|
377
|
+
entries.set(relative, `file\0${stampedFileHash(file)}`)
|
|
318
378
|
}
|
|
319
379
|
}
|
|
320
380
|
}
|
|
@@ -588,6 +648,7 @@ export function writeExpoDiscovery(options: {
|
|
|
588
648
|
)
|
|
589
649
|
fs.renameSync(tmp, path.join(dir, `${options.key}.json`))
|
|
590
650
|
expireDiscovery(dir, path.join(dir, `${options.key}.json`))
|
|
651
|
+
saveFileHashes()
|
|
591
652
|
return rewritten.units
|
|
592
653
|
} catch (error) {
|
|
593
654
|
if (options.signal?.aborted) throw error
|
|
@@ -14,7 +14,11 @@ import {
|
|
|
14
14
|
swiftInterfaceDeclarations,
|
|
15
15
|
withoutSwiftDeclarations,
|
|
16
16
|
} from './swift-compile'
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
privateSwiftDistributionRoot,
|
|
19
|
+
sourceSwiftCheckout,
|
|
20
|
+
SWIFT_PRIVATE_DISTRIBUTION_ENV,
|
|
21
|
+
} from './swift-toolchain'
|
|
18
22
|
import { simulatorNativeLibrary } from './swift-xcframework'
|
|
19
23
|
import type { SwiftStandin } from './swift-standins'
|
|
20
24
|
|
|
@@ -104,7 +108,10 @@ export function nativeSwiftSlice(
|
|
|
104
108
|
`${standin.module}: configured binary behavior cannot replace a compiled native slice`,
|
|
105
109
|
)
|
|
106
110
|
const distribution = swiftDistributionAt(moduleRoot)
|
|
107
|
-
if (!distribution)
|
|
111
|
+
if (!distribution)
|
|
112
|
+
throw new Error(
|
|
113
|
+
`${standin.module}'s native Swift slice needs a compiled distribution; a source checkout names one with ${SWIFT_PRIVATE_DISTRIBUTION_ENV}`,
|
|
114
|
+
)
|
|
108
115
|
const entry = nativeSwiftSliceEntry(distribution, generator)
|
|
109
116
|
const directory =
|
|
110
117
|
fetchNativeEntry('slice', entry.name, entry.key) ??
|
package/src/swift-standins.ts
CHANGED
|
@@ -453,10 +453,13 @@ export function binaryHeaderSearchPaths(
|
|
|
453
453
|
const name = path.basename(framework, '.framework')
|
|
454
454
|
if (!declaredFrameworks) continue
|
|
455
455
|
const imports = declaredFrameworks.imports.get(name)
|
|
456
|
-
const swift =
|
|
456
|
+
const swift =
|
|
457
|
+
!REACH_STAGED_FRAMEWORKS.has(name) &&
|
|
458
|
+
imports &&
|
|
459
|
+
swiftModuleInterface(declaredFrameworks.moduleRoot, name)
|
|
457
460
|
const compiled = declaredFrameworks.compiledImports.get(name)
|
|
458
461
|
if (swift) declared.set(framework, { ...swift, imports, sdkHeader: null })
|
|
459
|
-
else if (compiled && REACH_STAGED_FRAMEWORKS.has(name)) {
|
|
462
|
+
else if ((compiled || imports) && REACH_STAGED_FRAMEWORKS.has(name)) {
|
|
460
463
|
const sdkHeader = path.join(
|
|
461
464
|
swiftSharedSdkRoot(
|
|
462
465
|
declaredFrameworks.moduleRoot,
|
|
@@ -468,7 +471,7 @@ export function binaryHeaderSearchPaths(
|
|
|
468
471
|
declared.set(framework, {
|
|
469
472
|
declared: null,
|
|
470
473
|
header: null,
|
|
471
|
-
imports: compiled,
|
|
474
|
+
imports: compiled ?? new Set(),
|
|
472
475
|
sdkHeader: fs.readFileSync(sdkHeader, 'utf8'),
|
|
473
476
|
})
|
|
474
477
|
}
|
package/src/swift-wasm-prune.ts
CHANGED
|
@@ -714,6 +714,35 @@ function parseWasmObjectBytes(
|
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
716
|
|
|
717
|
+
// swift places constant metadata in one explicit .rodata segment, and the
|
|
718
|
+
// assembler folds a relative pointer between two symbols of that segment
|
|
719
|
+
// into a constant with no relocation (a generic requirement's protocol, a
|
|
720
|
+
// nested type's parent). a relocation-free word that lands on another
|
|
721
|
+
// symbol's start, past swift's two low int-pair flag bits, keeps that symbol
|
|
722
|
+
// live as a relocation would; a coincidental match only keeps extra data.
|
|
723
|
+
const relocatedWords = new Map<number, Set<number>>()
|
|
724
|
+
for (const r of dataRelocList) {
|
|
725
|
+
let words = relocatedWords.get(r.segIdx)
|
|
726
|
+
if (!words) relocatedWords.set(r.segIdx, (words = new Set()))
|
|
727
|
+
words.add(r.offInSeg)
|
|
728
|
+
}
|
|
729
|
+
for (const [segIdx, tops] of segTopSyms) {
|
|
730
|
+
const starts = new Map(tops.map((top) => [top.off, top.symIdx]))
|
|
731
|
+
const relocated = relocatedWords.get(segIdx)
|
|
732
|
+
const payload = dataStart + sPayloadStarts[segIdx]!
|
|
733
|
+
const view = new DataView(buf.buffer, buf.byteOffset + payload)
|
|
734
|
+
for (const top of tops) {
|
|
735
|
+
for (let at = top.off; at + 4 <= top.end; at += 4) {
|
|
736
|
+
if (relocated?.has(at)) continue
|
|
737
|
+
const target = starts.get(at + (view.getInt32(at, true) & ~3))
|
|
738
|
+
if (target === undefined || target === top.symIdx) continue
|
|
739
|
+
let list = symDataRelocs.get(top.symIdx)
|
|
740
|
+
if (!list) symDataRelocs.set(top.symIdx, (list = []))
|
|
741
|
+
list.push(target)
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
717
746
|
const typePrefixesInObj = new Set<string>()
|
|
718
747
|
for (let i = 0; i < symKind.length; i++) {
|
|
719
748
|
if (
|
package/src/xcode-project.ts
CHANGED
|
@@ -2649,7 +2649,7 @@ export function readXcodeAppTarget(
|
|
|
2649
2649
|
nativeTargets.add(ref)
|
|
2650
2650
|
for (const dependency of dependenciesOf(ref)) includeNativeTarget(dependency)
|
|
2651
2651
|
}
|
|
2652
|
-
for (const { ref, module } of builtTargets)
|
|
2652
|
+
for (const { ref, module } of builtTargets.slice(0, -1))
|
|
2653
2653
|
if (
|
|
2654
2654
|
options.nativeModules?.some(
|
|
2655
2655
|
(name) => name === module.moduleName || name === module.name,
|