peachsim 0.1.2269 → 0.1.2271
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/app-catalog.ts +13 -5
- package/cli/bridge-flow-runner.ts +1 -1
- package/cli/commands/control.ts +10 -1
- package/cli/commands/flow.ts +117 -23
- package/cli/commands/record.ts +4 -1
- package/cli/commands/shell-url.ts +10 -2
- package/cli/commands/upload.ts +49 -39
- package/detox/index.ts +8 -4
- 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 +70 -72
- 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 +8 -5
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +49 -59
- 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 +82 -76
- package/dist-lib/host/fetch-proxy-handler.cjs +6 -6
- 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 +6 -6
- 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 +9 -5
- 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 +6 -6
- package/dist-lib/native-app-identity-project.cjs +3 -3
- package/dist-lib/native-app-identity-project.mjs +3 -3
- 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 +102 -84
- package/dist-lib/swift-compile.cjs +23 -12
- package/dist-lib/swift-compile.mjs +23 -12
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +22 -11
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +26 -15
- package/dist-lib/vite.cjs +6 -6
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/layout-engine.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/render-damage.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/yoga-layout.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/recordingBridgeContract.d.ts +12 -0
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
- package/dist-types/packages/peach-kit/src/ui/hosting-safe-area.d.ts +1 -0
- package/dist-types/packages/peach-kit/src/ui/popover-placement.d.ts +1 -0
- package/java-platform/licenses/android.txt +6 -3
- package/java-platform/licenses/openjdk.txt +5 -4
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/desktop-host-delivery.ts +22 -6
- package/src/expo-pod-prebuilt.ts +29 -3
- package/src/guest-bundle.ts +1 -0
- package/src/kotlin-host.ts +8 -4
- package/src/native-package-slice-build.ts +156 -96
- package/src/nitro-adapter.lock.json +279 -279
- package/src/nitro-superset.lock.json +4 -4
- package/src/package-tree-digest.ts +33 -10
- package/src/swift-distribution.lock.json +12 -11
- package/src/swift-submit.ts +2 -1
- package/src/swift-toolchain.ts +24 -10
- package/src/turbo-compile.ts +5 -1
- package/src/turbo-runtime.lock.json +22 -22
- package/src/turbo-source.ts +4 -32
package/cli/app-catalog.ts
CHANGED
|
@@ -174,11 +174,12 @@ export function oneDeclaredAppCatalog(
|
|
|
174
174
|
return catalog
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
// a running dev server reports the declaration from its evaluated config
|
|
178
|
-
|
|
177
|
+
// a running dev server reports the declaration from its evaluated config. a
|
|
178
|
+
// server busy with its first bundle build answers late, so `peach open` asks
|
|
179
|
+
// before it requests the bundle.
|
|
180
|
+
export async function fetchOneNativeAppCatalogDeclaration(
|
|
179
181
|
metroOrigin: string,
|
|
180
|
-
|
|
181
|
-
): Promise<AppCatalog | null> {
|
|
182
|
+
): Promise<OneNativeAppCatalog | null> {
|
|
182
183
|
const response = await fetch(`${metroOrigin}${ONE_NATIVE_APP_CATALOG_ROUTE}`, {
|
|
183
184
|
signal: AbortSignal.timeout(1500),
|
|
184
185
|
}).catch(() => null)
|
|
@@ -187,7 +188,14 @@ export async function discoverOneNativeAppCatalog(
|
|
|
187
188
|
!(response.headers.get('content-type') ?? '').toLowerCase().includes('json')
|
|
188
189
|
)
|
|
189
190
|
return null
|
|
190
|
-
|
|
191
|
+
return parseOneNativeAppCatalog(await response.json().catch(() => null))
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export async function discoverOneNativeAppCatalog(
|
|
195
|
+
metroOrigin: string,
|
|
196
|
+
assetOrigin: string,
|
|
197
|
+
): Promise<AppCatalog | null> {
|
|
198
|
+
const declared = await fetchOneNativeAppCatalogDeclaration(metroOrigin)
|
|
191
199
|
return declared ? oneDeclaredAppCatalog(declared, assetOrigin) : null
|
|
192
200
|
}
|
|
193
201
|
|
|
@@ -1447,7 +1447,7 @@ export class SootSimBridgeFlowRunner {
|
|
|
1447
1447
|
}
|
|
1448
1448
|
const value = (step as Record<string, unknown>)[stepName]
|
|
1449
1449
|
if (typeof value === 'string') return value.slice(0, 80)
|
|
1450
|
-
if (typeof value === 'number'
|
|
1450
|
+
if (typeof value === 'number') return String(value)
|
|
1451
1451
|
if (Array.isArray(value)) return value.map(String).join(', ').slice(0, 80)
|
|
1452
1452
|
if (!value || typeof value !== 'object') return undefined
|
|
1453
1453
|
const record = value as Record<string, unknown>
|
package/cli/commands/control.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { buildPermissionSeedScript } from '../../detox/launch-permissions'
|
|
|
13
13
|
import { ANDROID_ROOT_MODULE_QUERY_PARAM } from '../../src/androidRootModuleContract'
|
|
14
14
|
import { loadRNXAppConfig } from '../../src/app-config'
|
|
15
15
|
import { isAppDeepLinkTarget, openAppUrl } from '../../src/app-url'
|
|
16
|
-
import { isLoopbackHost } from '../../src/backend-origin'
|
|
16
|
+
import { isLoopbackHost, loopbackOriginOf } from '../../src/backend-origin'
|
|
17
17
|
import { ensureCliCompanion, getCliRuntime } from '../../src/cli-runtime.ts'
|
|
18
18
|
import { getCliVersion } from '../../src/cli-version'
|
|
19
19
|
import {
|
|
@@ -62,6 +62,7 @@ import {
|
|
|
62
62
|
} from '../../src/runtime-assets'
|
|
63
63
|
import { rnxRuntime } from '../../src/runtime-delivery'
|
|
64
64
|
import { sleep } from '../../src/sleep'
|
|
65
|
+
import { fetchOneNativeAppCatalogDeclaration } from '../app-catalog'
|
|
65
66
|
import { findExpoAppConfig } from '../app-project'
|
|
66
67
|
import { discoverOneNativeAppSplash } from '../app-splash'
|
|
67
68
|
import { extractAppBinaryBundle, isAppBinaryPath } from '../binary-sidecar'
|
|
@@ -1791,6 +1792,13 @@ async function openSim(
|
|
|
1791
1792
|
resolvedBundle && project && !findExpoAppConfig(project.appDir)
|
|
1792
1793
|
? discoverOneNativeAppSplash(resolvedBundle.bundleUrl)
|
|
1793
1794
|
: undefined
|
|
1795
|
+
const oneAppCatalogOrigin =
|
|
1796
|
+
resolvedBundle && project && !findExpoAppConfig(project.appDir)
|
|
1797
|
+
? loopbackOriginOf(resolvedBundle.bundleUrl)
|
|
1798
|
+
: null
|
|
1799
|
+
const oneAppCatalog = oneAppCatalogOrigin
|
|
1800
|
+
? fetchOneNativeAppCatalogDeclaration(oneAppCatalogOrigin)
|
|
1801
|
+
: undefined
|
|
1794
1802
|
const explicitBaseUrl = args.find((_, i) => args[i - 1] === '--base-url')
|
|
1795
1803
|
const baseUrlConfig = explicitBaseUrl
|
|
1796
1804
|
? readPeachConfigFromSearchParams(new URL(explicitBaseUrl).searchParams)
|
|
@@ -2077,6 +2085,7 @@ async function openSim(
|
|
|
2077
2085
|
resolvedBundle,
|
|
2078
2086
|
project,
|
|
2079
2087
|
oneAppSplash,
|
|
2088
|
+
oneAppCatalog,
|
|
2080
2089
|
proof: args.includes('--proof'),
|
|
2081
2090
|
ephemeral: ephemeralProfile,
|
|
2082
2091
|
env: envArgs.length ? envArgs : undefined,
|
package/cli/commands/flow.ts
CHANGED
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
parseBridgeCliArgs,
|
|
39
39
|
resolveBridgePortForPin,
|
|
40
40
|
worldForBridgePort,
|
|
41
|
+
type WsBridge,
|
|
41
42
|
} from '../ws-bridge'
|
|
42
43
|
import {
|
|
43
44
|
closeSimsBulk,
|
|
@@ -50,6 +51,7 @@ import { getShellState } from './inspect/shared'
|
|
|
50
51
|
import { resolveDefaultUploadOrigin } from './upload'
|
|
51
52
|
import type { PeachConfig } from '../../src/config'
|
|
52
53
|
import type { UploadResult } from './upload'
|
|
54
|
+
import type { SootSimRecordedPreviewSnapshot } from '@peach/globals'
|
|
53
55
|
import type { ProfileFile } from '@peach/globals/profiler'
|
|
54
56
|
|
|
55
57
|
export { parseFlowFile, validateFlowFile } from '../flow-file'
|
|
@@ -882,6 +884,8 @@ flow extension:
|
|
|
882
884
|
let scenePath: string | null = null
|
|
883
885
|
let previewRecordingStartedAtMs: number | null = null
|
|
884
886
|
let previewScreenshotPath: string | null = null
|
|
887
|
+
let previewFinalCapturedAtMs: number | null = null
|
|
888
|
+
let recordedPreviewSnapshots: FlowSnapshotManifestEntry[] = []
|
|
885
889
|
let failureBundleDir: string | null = null
|
|
886
890
|
let exitCode = 0
|
|
887
891
|
const dryRun = args.includes('--dry-run') || args.includes('--no-run')
|
|
@@ -996,12 +1000,18 @@ flow extension:
|
|
|
996
1000
|
})()`,
|
|
997
1001
|
})) as Array<Record<string, any>>
|
|
998
1002
|
console.log(` captured ${capturedEvents.length} replay events`)
|
|
1003
|
+
recordedPreviewSnapshots = await drainRecorderSnapshots(
|
|
1004
|
+
bridge,
|
|
1005
|
+
driver.simId,
|
|
1006
|
+
screenshotDir,
|
|
1007
|
+
)
|
|
999
1008
|
if (sceneRecording) {
|
|
1000
1009
|
sceneRecording = false
|
|
1001
1010
|
scenePath = await stopPreviewSceneRecording(bridge, driver.simId)
|
|
1002
1011
|
}
|
|
1003
1012
|
previewScreenshotPath = path.join(screenshotDir, 'preview-final.png')
|
|
1004
1013
|
await driver.captureScreenshot(previewScreenshotPath)
|
|
1014
|
+
previewFinalCapturedAtMs = Date.now()
|
|
1005
1015
|
console.log(` final screenshot: ${previewScreenshotPath}`)
|
|
1006
1016
|
}
|
|
1007
1017
|
|
|
@@ -1051,6 +1061,11 @@ flow extension:
|
|
|
1051
1061
|
})()`,
|
|
1052
1062
|
})) as Array<Record<string, any>>
|
|
1053
1063
|
console.log(` captured ${capturedEvents.length} partial replay events`)
|
|
1064
|
+
recordedPreviewSnapshots = await drainRecorderSnapshots(
|
|
1065
|
+
bridge,
|
|
1066
|
+
driver.simId,
|
|
1067
|
+
screenshotDir,
|
|
1068
|
+
)
|
|
1054
1069
|
} catch (eventErr: any) {
|
|
1055
1070
|
console.warn(
|
|
1056
1071
|
` event recorder stop failed: ${eventErr?.message || String(eventErr)}`,
|
|
@@ -1134,9 +1149,6 @@ flow extension:
|
|
|
1134
1149
|
// catches up.
|
|
1135
1150
|
if (videoPath) uploadArgs.push('--video', videoPath)
|
|
1136
1151
|
if (scenePath) uploadArgs.push('--scene', scenePath, '--live-bundle')
|
|
1137
|
-
if (previewScreenshotPath) {
|
|
1138
|
-
uploadArgs.push('--screenshot', previewScreenshotPath)
|
|
1139
|
-
}
|
|
1140
1152
|
if (videoPath && videoDurationMs && Number.isFinite(videoDurationMs)) {
|
|
1141
1153
|
uploadArgs.push('--video-duration-ms', String(Math.round(videoDurationMs)))
|
|
1142
1154
|
uploadArgs.push('--recorded-duration-ms', String(Math.round(videoDurationMs)))
|
|
@@ -1171,10 +1183,15 @@ flow extension:
|
|
|
1171
1183
|
await prepareFlowStepTimelineFile(flowTraceSteps),
|
|
1172
1184
|
)
|
|
1173
1185
|
}
|
|
1174
|
-
const snapshotManifest = await prepareFlowSnapshotManifest(
|
|
1175
|
-
flowTraceSteps,
|
|
1186
|
+
const snapshotManifest = await prepareFlowSnapshotManifest({
|
|
1187
|
+
steps: flowTraceSteps,
|
|
1176
1188
|
recordingStartedAtMs,
|
|
1177
|
-
|
|
1189
|
+
recorded: recordedPreviewSnapshots,
|
|
1190
|
+
final:
|
|
1191
|
+
previewScreenshotPath && previewFinalCapturedAtMs
|
|
1192
|
+
? { path: previewScreenshotPath, capturedAtMs: previewFinalCapturedAtMs }
|
|
1193
|
+
: null,
|
|
1194
|
+
})
|
|
1178
1195
|
if (snapshotManifest) {
|
|
1179
1196
|
uploadArgs.push('--snapshot-manifest', snapshotManifest)
|
|
1180
1197
|
}
|
|
@@ -1415,24 +1432,101 @@ async function prepareFlowStepTimelineFile(
|
|
|
1415
1432
|
return outPath
|
|
1416
1433
|
}
|
|
1417
1434
|
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
+
type FlowSnapshotManifestEntry = {
|
|
1436
|
+
id: string
|
|
1437
|
+
label: string
|
|
1438
|
+
kind: SootSimRecordedPreviewSnapshot['kind']
|
|
1439
|
+
t?: number
|
|
1440
|
+
eventIndex?: number
|
|
1441
|
+
width?: number
|
|
1442
|
+
height?: number
|
|
1443
|
+
contentType: SootSimRecordedPreviewSnapshot['contentType']
|
|
1444
|
+
path: string
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
function isRecordedPreviewSnapshot(
|
|
1448
|
+
value: unknown,
|
|
1449
|
+
): value is SootSimRecordedPreviewSnapshot {
|
|
1450
|
+
if (value === null || typeof value !== 'object') return false
|
|
1451
|
+
const id = Reflect.get(value, 'id')
|
|
1452
|
+
const contentType = Reflect.get(value, 'contentType')
|
|
1453
|
+
return (
|
|
1454
|
+
typeof id === 'string' &&
|
|
1455
|
+
/^[\w-]+$/.test(id) &&
|
|
1456
|
+
typeof Reflect.get(value, 'base64') === 'string' &&
|
|
1457
|
+
(contentType === 'image/png' || contentType === 'image/webp')
|
|
1435
1458
|
)
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
// the page's event recorder holds the settled landing and per-interaction
|
|
1462
|
+
// frames; drain them to files so the upload carries them beside the runner's
|
|
1463
|
+
// own captures.
|
|
1464
|
+
async function drainRecorderSnapshots(
|
|
1465
|
+
bridge: WsBridge,
|
|
1466
|
+
simId: string | undefined,
|
|
1467
|
+
dir: string,
|
|
1468
|
+
): Promise<FlowSnapshotManifestEntry[]> {
|
|
1469
|
+
const drained: unknown = await bridge.send({
|
|
1470
|
+
type: 'evaluate',
|
|
1471
|
+
simId,
|
|
1472
|
+
code: `(() => {
|
|
1473
|
+
const r = globalThis.SootSim?.bridges?.eventRecorder ?? globalThis.__sootsimEventRecorder
|
|
1474
|
+
return r?.drainSnapshots?.() ?? []
|
|
1475
|
+
})()`,
|
|
1476
|
+
})
|
|
1477
|
+
if (!Array.isArray(drained) || !drained.every(isRecordedPreviewSnapshot)) {
|
|
1478
|
+
throw new Error('event recorder returned an invalid snapshot list')
|
|
1479
|
+
}
|
|
1480
|
+
fs.mkdirSync(dir, { recursive: true })
|
|
1481
|
+
const entries = drained.map((snapshot) => {
|
|
1482
|
+
const extension = snapshot.contentType === 'image/webp' ? 'webp' : 'png'
|
|
1483
|
+
const filePath = path.join(dir, `preview-${snapshot.id}.${extension}`)
|
|
1484
|
+
fs.writeFileSync(filePath, Buffer.from(snapshot.base64, 'base64'))
|
|
1485
|
+
const { base64: _base64, ...meta } = snapshot
|
|
1486
|
+
return { ...meta, path: filePath }
|
|
1487
|
+
})
|
|
1488
|
+
console.log(` recorder snapshots: ${entries.length}`)
|
|
1489
|
+
return entries
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
async function prepareFlowSnapshotManifest(input: {
|
|
1493
|
+
steps: SootSimFlowTraceStep[]
|
|
1494
|
+
recordingStartedAtMs: number | null
|
|
1495
|
+
recorded: FlowSnapshotManifestEntry[]
|
|
1496
|
+
final: { path: string; capturedAtMs: number } | null
|
|
1497
|
+
}): Promise<string | null> {
|
|
1498
|
+
const { recordingStartedAtMs } = input
|
|
1499
|
+
const runnerSnapshots: FlowSnapshotManifestEntry[] = recordingStartedAtMs
|
|
1500
|
+
? input.steps.flatMap<FlowSnapshotManifestEntry>((step) =>
|
|
1501
|
+
step.screenshotPath
|
|
1502
|
+
? [
|
|
1503
|
+
{
|
|
1504
|
+
id: `flow-step-${step.stepIndex}`,
|
|
1505
|
+
label: step.targetLabel ?? `Step ${step.stepIndex + 1}`,
|
|
1506
|
+
kind: 'interaction',
|
|
1507
|
+
t: Math.max(0, step.endedAtMs - recordingStartedAtMs),
|
|
1508
|
+
contentType: 'image/png',
|
|
1509
|
+
path: step.screenshotPath,
|
|
1510
|
+
},
|
|
1511
|
+
]
|
|
1512
|
+
: [],
|
|
1513
|
+
)
|
|
1514
|
+
: []
|
|
1515
|
+
const finalSnapshot: FlowSnapshotManifestEntry[] = input.final
|
|
1516
|
+
? [
|
|
1517
|
+
{
|
|
1518
|
+
id: 'final',
|
|
1519
|
+
label: 'Final frame',
|
|
1520
|
+
kind: 'final',
|
|
1521
|
+
...(recordingStartedAtMs
|
|
1522
|
+
? { t: Math.max(0, input.final.capturedAtMs - recordingStartedAtMs) }
|
|
1523
|
+
: {}),
|
|
1524
|
+
contentType: 'image/png',
|
|
1525
|
+
path: input.final.path,
|
|
1526
|
+
},
|
|
1527
|
+
]
|
|
1528
|
+
: []
|
|
1529
|
+
const snapshots = [...input.recorded, ...runnerSnapshots, ...finalSnapshot]
|
|
1436
1530
|
if (snapshots.length === 0) return null
|
|
1437
1531
|
const outPath = path.join(tmpdir(), `peach-flow-snapshots-${Date.now()}.json`)
|
|
1438
1532
|
fs.writeFileSync(outPath, JSON.stringify(snapshots))
|
package/cli/commands/record.ts
CHANGED
|
@@ -1070,7 +1070,10 @@ async function recordStart(args: string[], opts: RecordOptions) {
|
|
|
1070
1070
|
: args.includes('--no-shell')
|
|
1071
1071
|
? 'tenant'
|
|
1072
1072
|
: undefined
|
|
1073
|
-
const
|
|
1073
|
+
const outputExt = extname(valueOf(args, '--output') ?? '')
|
|
1074
|
+
const formatArg =
|
|
1075
|
+
(valueOf(args, '--format') as OutputFormat | undefined) ??
|
|
1076
|
+
(outputExt === '.mp4' ? 'mp4' : outputExt === '.webm' ? 'webm' : undefined)
|
|
1074
1077
|
const format =
|
|
1075
1078
|
formatArg === 'mp4' || (!formatArg && mode === 'combined') ? 'mp4' : 'webm'
|
|
1076
1079
|
if (formatArg && format !== formatArg) {
|
|
@@ -55,7 +55,8 @@ import { sleep } from '../../src/sleep'
|
|
|
55
55
|
import { stageAppBundleResources } from '../app-bundle-resources'
|
|
56
56
|
import {
|
|
57
57
|
discoverAppCatalog,
|
|
58
|
-
|
|
58
|
+
fetchOneNativeAppCatalogDeclaration,
|
|
59
|
+
oneDeclaredAppCatalog,
|
|
59
60
|
discoverProjectOneNativeAppCatalog,
|
|
60
61
|
} from '../app-catalog'
|
|
61
62
|
import { discoverNativeLinkedAppFonts } from '../app-fonts'
|
|
@@ -79,6 +80,7 @@ import {
|
|
|
79
80
|
} from '../ws-bridge'
|
|
80
81
|
import { readExpoNativeRenderer, readNativeProjectRenderer } from './detect'
|
|
81
82
|
import type { NitroBuildConfiguration } from '../../src/nitroContract'
|
|
83
|
+
import type { OneNativeAppCatalog } from '../../src/one-native-app-catalog'
|
|
82
84
|
|
|
83
85
|
// built-in shell apps use pathname-based routing, not ?bundle= params
|
|
84
86
|
const SHELL_APPS: Record<string, string> = {
|
|
@@ -469,6 +471,7 @@ async function stampAppCatalog(
|
|
|
469
471
|
urlStr: string,
|
|
470
472
|
assetOrigin: string,
|
|
471
473
|
project?: ResolvedAppProject | null,
|
|
474
|
+
oneAppCatalog?: Promise<OneNativeAppCatalog | null>,
|
|
472
475
|
): Promise<string> {
|
|
473
476
|
const url = new URL(urlStr)
|
|
474
477
|
const bundleUrl = url.searchParams.get('bundle') ?? ''
|
|
@@ -479,7 +482,9 @@ async function stampAppCatalog(
|
|
|
479
482
|
const catalog =
|
|
480
483
|
(await discoverAppCatalog(project.appDir, assetOrigin)) ??
|
|
481
484
|
(metroOrigin && !isStagedHostFileRequest(new URL(bundleUrl).pathname)
|
|
482
|
-
? await
|
|
485
|
+
? await (oneAppCatalog ?? fetchOneNativeAppCatalogDeclaration(metroOrigin)).then(
|
|
486
|
+
(declared) => declared && oneDeclaredAppCatalog(declared, assetOrigin),
|
|
487
|
+
)
|
|
483
488
|
: await discoverProjectOneNativeAppCatalog(project.appDir, assetOrigin))
|
|
484
489
|
if (!catalog) return urlStr
|
|
485
490
|
url.searchParams.set(
|
|
@@ -570,6 +575,8 @@ export interface BuildShellUrlOptions {
|
|
|
570
575
|
// starts the read beside its early bundle request so the answer overlaps
|
|
571
576
|
// bridge and host setup instead of preceding the launch.
|
|
572
577
|
oneAppSplash?: Promise<DiscoveredAppSplashSpec | null>
|
|
578
|
+
// the same early read for the One app's asset catalog declaration
|
|
579
|
+
oneAppCatalog?: Promise<OneNativeAppCatalog | null>
|
|
573
580
|
// deterministic-capture mode, stamped onto the engine URL as ?proof=1. the
|
|
574
581
|
// shell worker, compositor worker and tenant worker each read it off the
|
|
575
582
|
// host page URL at boot (syncProofModeFromInitUrl) and pin everything that
|
|
@@ -817,6 +824,7 @@ export async function buildShellUrl(
|
|
|
817
824
|
),
|
|
818
825
|
nativeAssetOrigin,
|
|
819
826
|
project,
|
|
827
|
+
opts.oneAppCatalog,
|
|
820
828
|
)
|
|
821
829
|
const expoStamped = new URL(stamped)
|
|
822
830
|
expoStamped.searchParams.delete('nativeAppIdentity')
|
package/cli/commands/upload.ts
CHANGED
|
@@ -67,12 +67,26 @@ export function parseServerMessage(responseText?: string): string | null {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
type
|
|
70
|
+
type AttachedSnapshot = {
|
|
71
71
|
meta: NonNullable<InitRequestBody['snapshots']>[number] & { id: string }
|
|
72
72
|
bytes: Uint8Array
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
const MANIFEST_SNAPSHOT_KINDS = ['landing', 'interaction', 'final', 'manual'] as const
|
|
76
|
+
type ManifestSnapshotKind = (typeof MANIFEST_SNAPSHOT_KINDS)[number]
|
|
77
|
+
function isManifestSnapshotKind(value: unknown): value is ManifestSnapshotKind {
|
|
78
|
+
return MANIFEST_SNAPSHOT_KINDS.some((kind) => kind === value)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function optionalFiniteNumber(value: unknown, name: string, index: number) {
|
|
82
|
+
if (value === undefined) return undefined
|
|
83
|
+
if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {
|
|
84
|
+
throw new Error(`snapshot manifest entry ${index} has an invalid ${name}`)
|
|
85
|
+
}
|
|
86
|
+
return Math.round(value)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function readSnapshotManifest(manifestPath: string): AttachedSnapshot[] {
|
|
76
90
|
const parsed: unknown = JSON.parse(readFileSync(manifestPath, 'utf8'))
|
|
77
91
|
if (!Array.isArray(parsed)) throw new Error('snapshot manifest must be an array')
|
|
78
92
|
const seen = new Set<string>()
|
|
@@ -82,26 +96,41 @@ function readSnapshotManifest(manifestPath: string): AttachedInteractionSnapshot
|
|
|
82
96
|
}
|
|
83
97
|
const id = Reflect.get(entry, 'id')
|
|
84
98
|
const label = Reflect.get(entry, 'label')
|
|
99
|
+
const kind = Reflect.get(entry, 'kind')
|
|
85
100
|
const filePath = Reflect.get(entry, 'path')
|
|
86
|
-
const
|
|
101
|
+
const contentType = Reflect.get(entry, 'contentType')
|
|
87
102
|
if (typeof id !== 'string' || !id || seen.has(id)) {
|
|
88
103
|
throw new Error(`snapshot manifest entry ${index} has an invalid or duplicate id`)
|
|
89
104
|
}
|
|
105
|
+
if (!isManifestSnapshotKind(kind)) {
|
|
106
|
+
throw new Error(`snapshot manifest entry ${index} has an invalid kind`)
|
|
107
|
+
}
|
|
90
108
|
if (typeof filePath !== 'string' || !filePath) {
|
|
91
|
-
throw new Error(`snapshot manifest entry ${index} has no
|
|
109
|
+
throw new Error(`snapshot manifest entry ${index} has no image path`)
|
|
92
110
|
}
|
|
93
|
-
if (
|
|
94
|
-
throw new Error(`snapshot manifest entry ${index} has an invalid
|
|
111
|
+
if (contentType !== 'image/png' && contentType !== 'image/webp') {
|
|
112
|
+
throw new Error(`snapshot manifest entry ${index} has an invalid content type`)
|
|
95
113
|
}
|
|
96
114
|
seen.add(id)
|
|
97
115
|
const bytes = readFileSync(filePath)
|
|
116
|
+
const t = optionalFiniteNumber(Reflect.get(entry, 't'), 'capture time', index)
|
|
117
|
+
const eventIndex = optionalFiniteNumber(
|
|
118
|
+
Reflect.get(entry, 'eventIndex'),
|
|
119
|
+
'event index',
|
|
120
|
+
index,
|
|
121
|
+
)
|
|
122
|
+
const width = optionalFiniteNumber(Reflect.get(entry, 'width'), 'width', index)
|
|
123
|
+
const height = optionalFiniteNumber(Reflect.get(entry, 'height'), 'height', index)
|
|
98
124
|
return {
|
|
99
125
|
meta: {
|
|
100
126
|
id,
|
|
101
127
|
label: typeof label === 'string' && label ? label : id,
|
|
102
|
-
kind
|
|
103
|
-
t:
|
|
104
|
-
|
|
128
|
+
kind,
|
|
129
|
+
...(t === undefined ? {} : { t }),
|
|
130
|
+
...(eventIndex === undefined ? {} : { eventIndex }),
|
|
131
|
+
...(width === undefined ? {} : { width }),
|
|
132
|
+
...(height === undefined ? {} : { height }),
|
|
133
|
+
contentType,
|
|
105
134
|
sizeBytes: bytes.byteLength,
|
|
106
135
|
},
|
|
107
136
|
bytes,
|
|
@@ -155,7 +184,7 @@ function printHelp() {
|
|
|
155
184
|
peach record upload — publish a recording as a /preview/<id> link
|
|
156
185
|
|
|
157
186
|
usage:
|
|
158
|
-
peach record upload [--origin <url>] [--public-origin <url>] (--events <path> | --video <path> | --scene <path>) [--live-bundle] [--
|
|
187
|
+
peach record upload [--origin <url>] [--public-origin <url>] (--events <path> | --video <path> | --scene <path>) [--live-bundle] [--snapshot-manifest <path>] [--owner <org> --repo <repo>] [--sim <sim>] [--open] [--assets-only]
|
|
159
188
|
|
|
160
189
|
options:
|
|
161
190
|
--origin <url> upload target (default: ${REMOTE_DEFAULT_ORIGIN})
|
|
@@ -167,10 +196,11 @@ options:
|
|
|
167
196
|
--events <path> path to a gzipped events .jsonl.gz file to attach
|
|
168
197
|
required unless --video or --scene is present;
|
|
169
198
|
previews must have replay or recording playback data
|
|
170
|
-
--screenshot <path>
|
|
171
|
-
path to a PNG thumbnail to attach to the share
|
|
172
199
|
--snapshot-manifest <path>
|
|
173
|
-
JSON
|
|
200
|
+
JSON array of snapshots to attach: id, label, kind
|
|
201
|
+
(landing, interaction, final, manual), path,
|
|
202
|
+
contentType (image/png or image/webp), optional t,
|
|
203
|
+
eventIndex, width and height
|
|
174
204
|
--video <path> path to a mp4/gif flow recording. embedded inline
|
|
175
205
|
in the pr sticky comment served at
|
|
176
206
|
/api/preview/flow-video?id=<share-id>
|
|
@@ -413,7 +443,6 @@ export async function runUpload(
|
|
|
413
443
|
extractStringFlag(mutableArgs, '--public-origin'),
|
|
414
444
|
)
|
|
415
445
|
const eventsPath = extractStringFlag(mutableArgs, '--events')
|
|
416
|
-
const screenshotPath = extractStringFlag(mutableArgs, '--screenshot')
|
|
417
446
|
const snapshotManifestPath = extractStringFlag(mutableArgs, '--snapshot-manifest')
|
|
418
447
|
const videoPath = extractStringFlag(mutableArgs, '--video')
|
|
419
448
|
const scenePath = extractStringFlag(mutableArgs, '--scene')
|
|
@@ -783,18 +812,11 @@ export async function runUpload(
|
|
|
783
812
|
}`,
|
|
784
813
|
)
|
|
785
814
|
|
|
786
|
-
|
|
787
|
-
if (screenshotPath) {
|
|
788
|
-
screenshotBytes = readFileSync(screenshotPath)
|
|
789
|
-
console.log(
|
|
790
|
-
` attaching screenshot: ${(screenshotBytes.byteLength / 1024).toFixed(1)} KiB`,
|
|
791
|
-
)
|
|
792
|
-
}
|
|
793
|
-
const interactionSnapshots = snapshotManifestPath
|
|
815
|
+
const manifestSnapshots = snapshotManifestPath
|
|
794
816
|
? readSnapshotManifest(snapshotManifestPath)
|
|
795
817
|
: []
|
|
796
|
-
if (
|
|
797
|
-
console.log(` attaching ${
|
|
818
|
+
if (manifestSnapshots.length > 0) {
|
|
819
|
+
console.log(` attaching ${manifestSnapshots.length} snapshots`)
|
|
798
820
|
}
|
|
799
821
|
|
|
800
822
|
// the flow runner's per-failure debug bundle: text artifacts fold into one
|
|
@@ -1197,16 +1219,6 @@ export async function runUpload(
|
|
|
1197
1219
|
: undefined,
|
|
1198
1220
|
snapshots: (() => {
|
|
1199
1221
|
const entries: NonNullable<InitRequestBody['snapshots']> = []
|
|
1200
|
-
if (screenshotBytes) {
|
|
1201
|
-
entries.push({
|
|
1202
|
-
id: 'landing',
|
|
1203
|
-
label: 'Landing',
|
|
1204
|
-
kind: 'landing',
|
|
1205
|
-
t: 0,
|
|
1206
|
-
contentType: 'image/png',
|
|
1207
|
-
sizeBytes: screenshotBytes.byteLength,
|
|
1208
|
-
})
|
|
1209
|
-
}
|
|
1210
1222
|
if (failureScreenshotBytes) {
|
|
1211
1223
|
entries.push({
|
|
1212
1224
|
id: 'failure',
|
|
@@ -1216,7 +1228,7 @@ export async function runUpload(
|
|
|
1216
1228
|
sizeBytes: failureScreenshotBytes.byteLength,
|
|
1217
1229
|
})
|
|
1218
1230
|
}
|
|
1219
|
-
for (const snapshot of
|
|
1231
|
+
for (const snapshot of manifestSnapshots) entries.push(snapshot.meta)
|
|
1220
1232
|
return entries.length > 0 ? entries : undefined
|
|
1221
1233
|
})(),
|
|
1222
1234
|
flowVideo:
|
|
@@ -1233,9 +1245,8 @@ export async function runUpload(
|
|
|
1233
1245
|
const filesByHash = new Map<string, Uint8Array>()
|
|
1234
1246
|
for (const f of prepared) filesByHash.set(f.urlhash, f.bytes)
|
|
1235
1247
|
const snapshotBytes = new Map<string, Uint8Array>()
|
|
1236
|
-
if (screenshotBytes) snapshotBytes.set('landing', screenshotBytes)
|
|
1237
1248
|
if (failureScreenshotBytes) snapshotBytes.set('failure', failureScreenshotBytes)
|
|
1238
|
-
for (const snapshot of
|
|
1249
|
+
for (const snapshot of manifestSnapshots) {
|
|
1239
1250
|
snapshotBytes.set(snapshot.meta.id, snapshot.bytes)
|
|
1240
1251
|
}
|
|
1241
1252
|
|
|
@@ -1245,9 +1256,8 @@ export async function runUpload(
|
|
|
1245
1256
|
if (eventsGz) putBytes += eventsGz.byteLength
|
|
1246
1257
|
putBytes += timelineGz.byteLength
|
|
1247
1258
|
if (storageGz) putBytes += storageGz.byteLength
|
|
1248
|
-
if (screenshotBytes) putBytes += screenshotBytes.byteLength
|
|
1249
1259
|
if (failureScreenshotBytes) putBytes += failureScreenshotBytes.byteLength
|
|
1250
|
-
for (const snapshot of
|
|
1260
|
+
for (const snapshot of manifestSnapshots) putBytes += snapshot.bytes.byteLength
|
|
1251
1261
|
if (failureBundleGz) putBytes += failureBundleGz.byteLength
|
|
1252
1262
|
if (videoBytes) putBytes += videoBytes.byteLength
|
|
1253
1263
|
if (sceneBytes) putBytes += sceneBytes.byteLength
|
package/detox/index.ts
CHANGED
|
@@ -3013,10 +3013,14 @@ export const device = {
|
|
|
3013
3013
|
const nativeStages = nativeRecord?.stages ?? []
|
|
3014
3014
|
// native first sees the motion on a 60Hz display frame that can land deep
|
|
3015
3015
|
// into the curve; the onset here is the first step showing as much change,
|
|
3016
|
-
// so both legs measure their stages from the same progress
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3016
|
+
// so both legs measure their stages from the same progress. a native
|
|
3017
|
+
// onset that changed the whole region asks for the most a minimum allows.
|
|
3018
|
+
const onsetChangePercent = Math.min(
|
|
3019
|
+
Math.max(
|
|
3020
|
+
proofObserver.motionChangeDefinition.minimumChangePercent,
|
|
3021
|
+
nativeRecord?.videoTriggerDetection?.changedPixelPercent ?? 0,
|
|
3022
|
+
),
|
|
3023
|
+
99.9,
|
|
3020
3024
|
)
|
|
3021
3025
|
const pairedStages: typeof stages = stages.map((stage) => {
|
|
3022
3026
|
if (DETOX_PLATFORM !== 'ios') return stage
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2271 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2271 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2271 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2271 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2271 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/beta.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2271 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/beta.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2271 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2271 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2271 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|