peachsim 0.1.2243 → 0.1.2244
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/binary-sidecar.ts +89 -0
- package/cli/bridge-flow-runner.ts +2 -2
- package/cli/cloud-client.ts +2 -0
- package/cli/commands/control.ts +16 -0
- package/cli/commands/device.ts +1 -1
- package/cli/commands/flow.ts +2 -2
- package/cli/commands/inspect/core.ts +0 -20
- package/cli/commands/inspect/settling.ts +8 -0
- package/cli/commands/inspect.ts +5 -5
- package/cli/commands/preview.ts +12 -5
- package/cli/commands/shell-boolean-mode.ts +1 -1
- package/cli/commands/slides.ts +1 -1
- 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 +7 -7
- 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 +9 -3
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +6 -6
- 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 +27 -8
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- 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 +9 -3
- 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 +11 -2
- package/dist-lib/menu.mjs +11 -2
- 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 +1 -1
- package/dist-lib/native-app-identity-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +1 -1
- 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 +55 -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 +9 -22
- package/dist-lib/sdk.mjs +9 -20
- package/dist-lib/skills.cjs +872 -733
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +1 -1
- 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 +5 -5
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/native-layout.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -0
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -1
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/src/binarySidecarContract.ts +45 -0
- package/src/menu.ts +14 -0
- package/src/swift-host.ts +6 -7
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process'
|
|
2
|
+
import { createHash } from 'node:crypto'
|
|
3
|
+
import fs from 'node:fs'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import { brotliDecompressSync } from 'node:zlib'
|
|
6
|
+
import { insertPackageVersionsFooter } from '@peach/globals/package-versions'
|
|
7
|
+
import {
|
|
8
|
+
PEACH_SIDECAR_ASSETS,
|
|
9
|
+
PEACH_SIDECAR_BUNDLE,
|
|
10
|
+
PEACH_SIDECAR_DIR,
|
|
11
|
+
PEACH_SIDECAR_MANIFEST,
|
|
12
|
+
readPeachSidecarManifest,
|
|
13
|
+
} from '../src/binarySidecarContract'
|
|
14
|
+
import { cacheDir } from '../src/home-paths'
|
|
15
|
+
|
|
16
|
+
export function isAppBinaryPath(target: string): boolean {
|
|
17
|
+
return (
|
|
18
|
+
/\.(ipa|apk)$/i.test(target) &&
|
|
19
|
+
fs.statSync(target, { throwIfNoEntry: false })?.isFile() === true
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// the plain bundle an ipa or apk we built carries, written as a bundle file
|
|
24
|
+
// with its assets beside it, the layout `peach open` and `peach preview`
|
|
25
|
+
// already read. hermes bytecode alone cannot run in peach.
|
|
26
|
+
export function extractAppBinaryBundle(binary: string): {
|
|
27
|
+
bundlePath: string
|
|
28
|
+
platform: 'ios' | 'android'
|
|
29
|
+
} {
|
|
30
|
+
const file = path.resolve(binary)
|
|
31
|
+
const entries = execFileSync('unzip', ['-Z1', file], {
|
|
32
|
+
encoding: 'utf8',
|
|
33
|
+
maxBuffer: 256 * 1024 * 1024,
|
|
34
|
+
}).split('\n')
|
|
35
|
+
const manifestEntry = entries.find((entry) =>
|
|
36
|
+
new RegExp(
|
|
37
|
+
`^(Payload/[^/]+\\.app|assets)/${PEACH_SIDECAR_DIR}/${PEACH_SIDECAR_MANIFEST.replace('.', '\\.')}$`,
|
|
38
|
+
).test(entry),
|
|
39
|
+
)
|
|
40
|
+
if (!manifestEntry)
|
|
41
|
+
throw new Error(
|
|
42
|
+
`${binary} carries no peach sidecar; only apps built by Contrast include the plain javascript peach runs`,
|
|
43
|
+
)
|
|
44
|
+
const sidecar = path.posix.dirname(manifestEntry)
|
|
45
|
+
const appRoot = path.posix.dirname(sidecar)
|
|
46
|
+
const digest = createHash('sha256').update(fs.readFileSync(file)).digest('hex')
|
|
47
|
+
const out = path.join(cacheDir(), 'app-binaries', digest)
|
|
48
|
+
const bundlePath = path.join(out, 'main.js')
|
|
49
|
+
const extracted = path.join(out, 'extracted')
|
|
50
|
+
if (!fs.existsSync(bundlePath)) {
|
|
51
|
+
fs.rmSync(out, { recursive: true, force: true })
|
|
52
|
+
fs.mkdirSync(extracted, { recursive: true })
|
|
53
|
+
const patterns = [`${sidecar}/*`]
|
|
54
|
+
const iosAssets = `${appRoot}/assets/`
|
|
55
|
+
if (
|
|
56
|
+
appRoot.startsWith('Payload/') &&
|
|
57
|
+
entries.some((entry) => entry.startsWith(iosAssets))
|
|
58
|
+
)
|
|
59
|
+
patterns.push(`${iosAssets}*`)
|
|
60
|
+
execFileSync('unzip', ['-q', '-o', file, ...patterns, '-d', extracted])
|
|
61
|
+
const manifest = readPeachSidecarManifest(
|
|
62
|
+
JSON.parse(fs.readFileSync(path.join(extracted, manifestEntry), 'utf8')),
|
|
63
|
+
)
|
|
64
|
+
const bundle = brotliDecompressSync(
|
|
65
|
+
fs.readFileSync(path.join(extracted, sidecar, PEACH_SIDECAR_BUNDLE)),
|
|
66
|
+
)
|
|
67
|
+
if (createHash('sha256').update(bundle).digest('hex') !== manifest.bundleSha256)
|
|
68
|
+
throw new Error(`${binary}: the peach sidecar bundle does not match its manifest`)
|
|
69
|
+
const assets =
|
|
70
|
+
manifest.platform === 'ios'
|
|
71
|
+
? path.join(extracted, appRoot, 'assets')
|
|
72
|
+
: path.join(extracted, sidecar, PEACH_SIDECAR_ASSETS)
|
|
73
|
+
if (fs.existsSync(assets)) fs.renameSync(assets, path.join(out, 'assets'))
|
|
74
|
+
fs.copyFileSync(
|
|
75
|
+
path.join(extracted, manifestEntry),
|
|
76
|
+
path.join(out, PEACH_SIDECAR_MANIFEST),
|
|
77
|
+
)
|
|
78
|
+
fs.writeFileSync(
|
|
79
|
+
`${bundlePath}.partial`,
|
|
80
|
+
insertPackageVersionsFooter(bundle.toString('utf8'), manifest.nativePackages),
|
|
81
|
+
)
|
|
82
|
+
fs.renameSync(`${bundlePath}.partial`, bundlePath)
|
|
83
|
+
fs.rmSync(extracted, { recursive: true, force: true })
|
|
84
|
+
}
|
|
85
|
+
const { platform } = readPeachSidecarManifest(
|
|
86
|
+
JSON.parse(fs.readFileSync(path.join(out, PEACH_SIDECAR_MANIFEST), 'utf8')),
|
|
87
|
+
)
|
|
88
|
+
return { bundlePath, platform }
|
|
89
|
+
}
|
|
@@ -1852,7 +1852,7 @@ export class SootSimBridgeFlowRunner {
|
|
|
1852
1852
|
}
|
|
1853
1853
|
const direct = await test.activatePressAt(point.x, point.y, ${nodeId})
|
|
1854
1854
|
if (direct?.ok) {
|
|
1855
|
-
|
|
1855
|
+
globalThis.dispatchEvent(
|
|
1856
1856
|
new CustomEvent('sootsim:agentAction', {
|
|
1857
1857
|
detail: { type: 'tap', x: point.x, y: point.y, target: ${JSON.stringify(
|
|
1858
1858
|
replayTarget,
|
|
@@ -1870,7 +1870,7 @@ export class SootSimBridgeFlowRunner {
|
|
|
1870
1870
|
if (!test?.activatePressAt) return null
|
|
1871
1871
|
const direct = await test.activatePressAt(${x}, ${y})
|
|
1872
1872
|
if (direct?.ok) {
|
|
1873
|
-
|
|
1873
|
+
globalThis.dispatchEvent(
|
|
1874
1874
|
new CustomEvent('sootsim:agentAction', {
|
|
1875
1875
|
detail: { type: 'tap', x: ${x}, y: ${y} },
|
|
1876
1876
|
}),
|
package/cli/cloud-client.ts
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
metroAssetPlaceholderBytes,
|
|
17
17
|
metroAssetScaleFilename,
|
|
18
18
|
metroIosAssetDestRelatives,
|
|
19
|
+
resolveMetroAndroidAssetDestFiles,
|
|
19
20
|
resolveMetroIosAssetDestFiles,
|
|
20
21
|
separateMetroArtifactAssets,
|
|
21
22
|
type MetroAssetDescriptor,
|
|
@@ -477,6 +478,7 @@ function placeMetroDescriptor(
|
|
|
477
478
|
distinctByContent(listing.directory, [
|
|
478
479
|
...new Set([
|
|
479
480
|
...resolveMetroIosAssetDestFiles(listing.files, descriptor, scale),
|
|
481
|
+
...resolveMetroAndroidAssetDestFiles(listing.files, descriptor, scale),
|
|
480
482
|
...resolveExpoHashedAssetFiles(listing.files, descriptor, scale),
|
|
481
483
|
]),
|
|
482
484
|
]),
|
package/cli/commands/control.ts
CHANGED
|
@@ -62,6 +62,7 @@ import { sleep } from '../../src/sleep'
|
|
|
62
62
|
import { loadRNXAppConfig } from '../app-config'
|
|
63
63
|
import { findExpoAppConfig } from '../app-project'
|
|
64
64
|
import { discoverOneNativeAppSplash } from '../app-splash'
|
|
65
|
+
import { extractAppBinaryBundle, isAppBinaryPath } from '../binary-sidecar'
|
|
65
66
|
import { printBridgeFailureDiagnostics } from '../bridge-diagnostics'
|
|
66
67
|
import {
|
|
67
68
|
assertNoPendingOpen,
|
|
@@ -1427,6 +1428,21 @@ async function openSim(
|
|
|
1427
1428
|
args: string[],
|
|
1428
1429
|
opts: OpenCommandOptions,
|
|
1429
1430
|
): Promise<{ simId: string; launched: boolean } | undefined> {
|
|
1431
|
+
// an ipa or apk we built opens as the plain bundle it carries
|
|
1432
|
+
const binary = args.find((arg) => !arg.startsWith('-') && isAppBinaryPath(arg))
|
|
1433
|
+
if (binary) {
|
|
1434
|
+
try {
|
|
1435
|
+
const { bundlePath, platform } = extractAppBinaryBundle(binary)
|
|
1436
|
+
args = args.map((arg) => (arg === binary ? bundlePath : arg))
|
|
1437
|
+
if (platform === 'android' && !args.includes('--device') && !args.includes('-d'))
|
|
1438
|
+
args = [...args, '--device', 'pixel-8']
|
|
1439
|
+
} catch (error) {
|
|
1440
|
+
console.error(
|
|
1441
|
+
` peach open: ${error instanceof Error ? error.message : String(error)}`,
|
|
1442
|
+
)
|
|
1443
|
+
peachExit(1)
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1430
1446
|
const openArgOptions = {
|
|
1431
1447
|
stripBooleanFlags: [
|
|
1432
1448
|
'--new',
|
package/cli/commands/device.ts
CHANGED
|
@@ -246,7 +246,7 @@ export async function runDeviceCommand(args: string[], opts: DeviceCommandOption
|
|
|
246
246
|
else if (Date.now() > deadline) resolve(false)
|
|
247
247
|
else setTimeout(check, 50)
|
|
248
248
|
}
|
|
249
|
-
|
|
249
|
+
globalThis.dispatchEvent(new CustomEvent(${JSON.stringify(SOOTSIM_SHELL_COMMAND_NAME)}, { detail: { type: 'fold-to-rest', rest: ${JSON.stringify(target)} } }))
|
|
250
250
|
check()
|
|
251
251
|
})`,
|
|
252
252
|
{ acquireLock: true },
|
package/cli/commands/flow.ts
CHANGED
|
@@ -739,7 +739,7 @@ flow extension:
|
|
|
739
739
|
await bridge.send({
|
|
740
740
|
type: 'evaluate',
|
|
741
741
|
simId: driver.simId,
|
|
742
|
-
code: `
|
|
742
|
+
code: `globalThis.dispatchEvent(new CustomEvent('sootsim:statusBarOverride', { detail: { time: ${JSON.stringify(statusBarTime)} } }))`,
|
|
743
743
|
})
|
|
744
744
|
}
|
|
745
745
|
if (targetTheme) {
|
|
@@ -799,7 +799,7 @@ flow extension:
|
|
|
799
799
|
else if (Date.now() > deadline) resolve(false)
|
|
800
800
|
else setTimeout(check, 50)
|
|
801
801
|
}
|
|
802
|
-
|
|
802
|
+
globalThis.dispatchEvent(new CustomEvent(${JSON.stringify(SOOTSIM_SHELL_COMMAND_NAME)}, { detail: { type: 'fold-to-rest', rest: ${JSON.stringify(targetPosture)} } }))
|
|
803
803
|
check()
|
|
804
804
|
})`,
|
|
805
805
|
})
|
|
@@ -87,26 +87,6 @@ export function isInspectPickCommand(subcommand: string | null | undefined): boo
|
|
|
87
87
|
return typeof subcommand === 'string' && INSPECT_PICK_COMMANDS.has(subcommand)
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export async function isInspectModeActive(bridge: InspectBridge): Promise<boolean> {
|
|
91
|
-
const active = await bridge.send({
|
|
92
|
-
type: 'evaluate',
|
|
93
|
-
code: 'globalThis.__sootsimEngineState?.inspectActive === true',
|
|
94
|
-
})
|
|
95
|
-
return active === true
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export async function shouldSkipAutoSettleForInspectPick(
|
|
99
|
-
bridge: InspectBridge,
|
|
100
|
-
subcommand: string | null | undefined,
|
|
101
|
-
): Promise<boolean> {
|
|
102
|
-
if (!isInspectPickCommand(subcommand)) return false
|
|
103
|
-
try {
|
|
104
|
-
return await isInspectModeActive(bridge)
|
|
105
|
-
} catch {
|
|
106
|
-
return false
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
90
|
// `get count` — total SootSimNode count in the live tree.
|
|
111
91
|
export async function inspectNodeCount(
|
|
112
92
|
bridge: InspectBridge,
|
|
@@ -32,6 +32,7 @@ export type WaitForSootsimIdleOptions = {
|
|
|
32
32
|
// activity and reads nothing per tick (renderActivityIdleScript); the
|
|
33
33
|
// still window is stablePolls * pollMs.
|
|
34
34
|
motionOnly?: boolean
|
|
35
|
+
skipIfInspectActive?: boolean
|
|
35
36
|
// after the app paints, a callback's own next frame is ongoing playback.
|
|
36
37
|
readyPlayback?: boolean
|
|
37
38
|
transitionStartWindowMs?: number
|
|
@@ -92,14 +93,19 @@ function renderActivityIdleScript({
|
|
|
92
93
|
requiredStillMs,
|
|
93
94
|
transitionStartWindowMs,
|
|
94
95
|
transitionTimeoutMs,
|
|
96
|
+
skipIfInspectActive,
|
|
95
97
|
}: {
|
|
96
98
|
maxMs: number
|
|
97
99
|
requiredStillMs: number
|
|
98
100
|
transitionStartWindowMs: number
|
|
99
101
|
transitionTimeoutMs: number
|
|
102
|
+
skipIfInspectActive: boolean
|
|
100
103
|
}): string {
|
|
101
104
|
return `(async () => {
|
|
102
105
|
const start = Date.now()
|
|
106
|
+
if (${skipIfInspectActive} && globalThis.__sootsimEngineState?.inspectActive === true) {
|
|
107
|
+
return { settled: true, elapsed: 0, blockedBy: '' }
|
|
108
|
+
}
|
|
103
109
|
const budgetMs = ${Math.max(0, Math.round(maxMs))}
|
|
104
110
|
const requiredStillMs = ${Math.max(1, Math.round(requiredStillMs))}
|
|
105
111
|
let deadline = start + budgetMs
|
|
@@ -204,6 +210,7 @@ export async function waitForSootsimIdle({
|
|
|
204
210
|
screenStill = false,
|
|
205
211
|
maestro = false,
|
|
206
212
|
motionOnly = false,
|
|
213
|
+
skipIfInspectActive = false,
|
|
207
214
|
readyPlayback = false,
|
|
208
215
|
transitionStartWindowMs = 80,
|
|
209
216
|
transitionTimeoutMs = 4000,
|
|
@@ -224,6 +231,7 @@ export async function waitForSootsimIdle({
|
|
|
224
231
|
Math.max(1, Math.round(stablePolls)) * Math.max(1, Math.round(pollMs)),
|
|
225
232
|
transitionStartWindowMs,
|
|
226
233
|
transitionTimeoutMs,
|
|
234
|
+
skipIfInspectActive,
|
|
227
235
|
})
|
|
228
236
|
: `(async () => {
|
|
229
237
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
package/cli/commands/inspect.ts
CHANGED
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
inspectRequests,
|
|
60
60
|
inspectWarnings,
|
|
61
61
|
MERGED_CONSOLE_COUNT_EVAL,
|
|
62
|
-
|
|
62
|
+
isInspectPickCommand,
|
|
63
63
|
type LogEntry,
|
|
64
64
|
type LogLevel,
|
|
65
65
|
type OpenNativeUISurface,
|
|
@@ -845,7 +845,7 @@ async function runShellVisualCommand(
|
|
|
845
845
|
return bridge.send({
|
|
846
846
|
type: 'evaluate',
|
|
847
847
|
code: `(async () => {
|
|
848
|
-
|
|
848
|
+
globalThis.dispatchEvent(new CustomEvent('sootsim:shake'))
|
|
849
849
|
return { ok: true, action: 'shake' }
|
|
850
850
|
})()`,
|
|
851
851
|
})
|
|
@@ -1235,6 +1235,7 @@ export async function runInspect(args: string[], opts: InspectOptions) {
|
|
|
1235
1235
|
pollMs: 32,
|
|
1236
1236
|
stablePolls: 2,
|
|
1237
1237
|
motionOnly: true,
|
|
1238
|
+
skipIfInspectActive: isInspectPickCommand(subcommand),
|
|
1238
1239
|
})
|
|
1239
1240
|
if (!settled) {
|
|
1240
1241
|
process.stderr.write(
|
|
@@ -3767,7 +3768,7 @@ export async function runInspect(args: string[], opts: InspectOptions) {
|
|
|
3767
3768
|
await globalThis.__sootsimShellPerf.start()
|
|
3768
3769
|
// give a frame for profiling to engage before the event
|
|
3769
3770
|
await new Promise(r => requestAnimationFrame(() => r(undefined)))
|
|
3770
|
-
|
|
3771
|
+
globalThis.dispatchEvent(new Event('${eventName}'))
|
|
3771
3772
|
// shell animations are ~300-500ms; fixed timing avoids complex
|
|
3772
3773
|
// animation-end detection
|
|
3773
3774
|
await new Promise(r => setTimeout(r, 600))
|
|
@@ -4259,8 +4260,7 @@ export async function runInspect(args: string[], opts: InspectOptions) {
|
|
|
4259
4260
|
if (
|
|
4260
4261
|
writeCommands.has(subcommand) &&
|
|
4261
4262
|
!args.includes('--no-wait') &&
|
|
4262
|
-
process.env.PEACH_NO_AUTO_WAIT !== '1'
|
|
4263
|
-
!(await shouldSkipAutoSettleForInspectPick(bridge, subcommand))
|
|
4263
|
+
process.env.PEACH_NO_AUTO_WAIT !== '1'
|
|
4264
4264
|
) {
|
|
4265
4265
|
await autoSettleAfterWrite(bridge)
|
|
4266
4266
|
}
|
package/cli/commands/preview.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { getCliRuntime } from '../../src/cli-runtime.ts'
|
|
|
22
22
|
import { isRecord } from '../../src/is-record'
|
|
23
23
|
import { terminateProcessGroup } from '../../src/process-group'
|
|
24
24
|
import { authHeaderValue, cloudAccountIdOrExit, resolveCliAuth } from '../auth'
|
|
25
|
+
import { extractAppBinaryBundle, isAppBinaryPath } from '../binary-sidecar'
|
|
25
26
|
import { producePreviewArtifact } from '../cloud-client'
|
|
26
27
|
import { publishLiveDevStack, type PublishedLiveDevStack } from '../cloud-test-tunnel'
|
|
27
28
|
import { openUrl } from '../open-url'
|
|
@@ -90,18 +91,24 @@ export async function runPreview(args: string[]): Promise<number> {
|
|
|
90
91
|
origin,
|
|
91
92
|
takeValue(input, '--public-origin') ?? undefined,
|
|
92
93
|
)
|
|
93
|
-
const
|
|
94
|
+
const platformFlag = takeValue(input, '--platform')
|
|
94
95
|
const jsonIndex = input.indexOf('--json')
|
|
95
96
|
const json = jsonIndex >= 0
|
|
96
97
|
if (json) input.splice(jsonIndex, 1)
|
|
97
98
|
const openIndex = input.indexOf('--open')
|
|
98
99
|
const open = openIndex >= 0
|
|
99
100
|
if (open) input.splice(openIndex, 1)
|
|
101
|
+
if (input.length !== 1 || input[0]?.startsWith('-')) {
|
|
102
|
+
throw new Error('usage: peach preview <project|dist|bundle|ipa|apk>')
|
|
103
|
+
}
|
|
104
|
+
// an ipa or apk we built previews the plain bundle it carries
|
|
105
|
+
const binary = isAppBinaryPath(input[0]) ? extractAppBinaryBundle(input[0]) : null
|
|
106
|
+
const platform = platformFlag ?? binary?.platform ?? 'ios'
|
|
100
107
|
if (platform !== 'ios' && platform !== 'android') {
|
|
101
108
|
throw new Error('--platform must be ios or android')
|
|
102
109
|
}
|
|
103
|
-
if (
|
|
104
|
-
throw new Error(
|
|
110
|
+
if (binary && binary.platform !== platform) {
|
|
111
|
+
throw new Error(`${input[0]} is an ${binary.platform} build`)
|
|
105
112
|
}
|
|
106
113
|
const auth = resolveCliAuth()
|
|
107
114
|
if (!auth) throw new Error('peach preview needs `peach login` or PEACH_API_KEY')
|
|
@@ -109,8 +116,8 @@ export async function runPreview(args: string[]): Promise<number> {
|
|
|
109
116
|
|
|
110
117
|
const target = input[0]
|
|
111
118
|
const projectPath = resolve(target)
|
|
112
|
-
let bundleTarget: string | null = null
|
|
113
|
-
if (!/^https?:/.test(target) && statSync(projectPath).isDirectory()) {
|
|
119
|
+
let bundleTarget: string | null = binary?.bundlePath ?? null
|
|
120
|
+
if (!binary && !/^https?:/.test(target) && statSync(projectPath).isDirectory()) {
|
|
114
121
|
const expoBundle = resolveExpoExportBundle(projectPath, platform)
|
|
115
122
|
if (!expoBundle) {
|
|
116
123
|
const receipt = await publishProjectPreview(
|
|
@@ -58,7 +58,7 @@ export async function runShellBooleanMode(
|
|
|
58
58
|
code: `(async () => {
|
|
59
59
|
const modeKey = ${JSON.stringify(config.modeKey)}
|
|
60
60
|
const target = ${JSON.stringify(target)}
|
|
61
|
-
|
|
61
|
+
globalThis.dispatchEvent(new CustomEvent('sootsim:shell-command', {
|
|
62
62
|
detail: { type: 'fire-action', id: ${JSON.stringify(config.actionId)} },
|
|
63
63
|
}))
|
|
64
64
|
const deadline = Date.now() + 1200
|
package/cli/commands/slides.ts
CHANGED
|
@@ -131,7 +131,7 @@ async function ensureScreenshotMode(bridge: WsBridge): Promise<void> {
|
|
|
131
131
|
bridge,
|
|
132
132
|
`(async () => {
|
|
133
133
|
if (globalThis.SootSim?.bridges?.settings?.get?.()?.screenshotMode) return true
|
|
134
|
-
|
|
134
|
+
globalThis.dispatchEvent(new CustomEvent('sootsim:shell-command', {
|
|
135
135
|
detail: { type: 'fire-action', id: 'toggle-screenshot-mode' },
|
|
136
136
|
}))
|
|
137
137
|
const deadline = Date.now() + 2000
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2244 | (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.2244 | (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.2244 | (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.2244 | (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.2244 | (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.2244 | (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.2244 | (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.2244 | (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.2244 | (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.2244 | (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;
|
|
@@ -50462,6 +50462,9 @@ function packageSources(packagePath, hosted = false, linked = /* @__PURE__ */ ne
|
|
|
50462
50462
|
return files2;
|
|
50463
50463
|
}
|
|
50464
50464
|
function packageSnapshot(project2, entry, moduleRoot) {
|
|
50465
|
+
moduleRoot ??= xcodeProjects().get(project2.packagePath)?.moduleRoot ?? linkedModuleRoots(project2.packagePath).find(
|
|
50466
|
+
(root) => import_node_fs80.default.existsSync(import_node_path79.default.join(root, "toolchain.json"))
|
|
50467
|
+
);
|
|
50465
50468
|
const layout2 = xcodeLayout(project2.packagePath);
|
|
50466
50469
|
const pin2 = moduleRoot ? swiftDistributionAt(moduleRoot) ?? JSON.parse(import_node_fs80.default.readFileSync(import_node_path79.default.join(moduleRoot, "toolchain.json"), "utf8")) : null;
|
|
50467
50470
|
const linked = layout2 ? standinLibraries(
|
|
@@ -50932,10 +50935,7 @@ function scopedArtifact(project2, entry, moduleRoot, signal) {
|
|
|
50932
50935
|
queued.then(resolve4, reject).finally(() => signal.removeEventListener("abort", stop));
|
|
50933
50936
|
});
|
|
50934
50937
|
}
|
|
50935
|
-
const
|
|
50936
|
-
(root) => import_node_fs80.default.existsSync(import_node_path79.default.join(root, "toolchain.json"))
|
|
50937
|
-
);
|
|
50938
|
-
const snapshot = packageSnapshot(project2, entry, snapshotRoot);
|
|
50938
|
+
const snapshot = packageSnapshot(project2, entry, moduleRoot);
|
|
50939
50939
|
const compiled = project2.artifact?.compiled;
|
|
50940
50940
|
if (project2.artifact && compiled && compiled.module === moduleStamp(project2.packagePath, moduleRoot, false)) {
|
|
50941
50941
|
const input = snapshotCompileInput(snapshot);
|
|
@@ -56449,7 +56449,7 @@ var init_nitro_superset = __esm({
|
|
|
56449
56449
|
init_nitroContract();
|
|
56450
56450
|
init_swift_standin_digest();
|
|
56451
56451
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
56452
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
56452
|
+
NITRO_COMPILER_DIGEST = true ? "6a6f80ad2d874ad53a058d4aa8764ae971a237caf160c09603cebe64e1b6bbf6" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
56453
56453
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
56454
56454
|
nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
|
|
56455
56455
|
published = /* @__PURE__ */ new Map();
|
|
@@ -57674,7 +57674,7 @@ var init_expo_native_compiler_digest = __esm({
|
|
|
57674
57674
|
|
|
57675
57675
|
// src/expo-native-prebuilt.ts
|
|
57676
57676
|
function expoNativeCompilerDigestValue() {
|
|
57677
|
-
return true ? "
|
|
57677
|
+
return true ? "cf0557e09d89c8c6883a1e9ce3f3f57b9f43040a8f4e81e39c612c37d34d8430" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
57678
57678
|
}
|
|
57679
57679
|
function readSources(value) {
|
|
57680
57680
|
const sources = isRecord(value) ? value.sources : null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2244 | (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.2244 | (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.2244 | (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/cloud.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2244 | (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/cloud.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2244 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
package/dist-lib/config.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2244 | (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/config.mjs
CHANGED
package/dist-lib/detox/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2244 | (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;
|
|
@@ -1628,10 +1628,14 @@ function renderActivityIdleScript({
|
|
|
1628
1628
|
maxMs,
|
|
1629
1629
|
requiredStillMs,
|
|
1630
1630
|
transitionStartWindowMs,
|
|
1631
|
-
transitionTimeoutMs
|
|
1631
|
+
transitionTimeoutMs,
|
|
1632
|
+
skipIfInspectActive
|
|
1632
1633
|
}) {
|
|
1633
1634
|
return `(async () => {
|
|
1634
1635
|
const start = Date.now()
|
|
1636
|
+
if (${skipIfInspectActive} && globalThis.__sootsimEngineState?.inspectActive === true) {
|
|
1637
|
+
return { settled: true, elapsed: 0, blockedBy: '' }
|
|
1638
|
+
}
|
|
1635
1639
|
const budgetMs = ${Math.max(0, Math.round(maxMs))}
|
|
1636
1640
|
const requiredStillMs = ${Math.max(1, Math.round(requiredStillMs))}
|
|
1637
1641
|
let deadline = start + budgetMs
|
|
@@ -1735,6 +1739,7 @@ async function waitForSootsimIdle({
|
|
|
1735
1739
|
screenStill = false,
|
|
1736
1740
|
maestro = false,
|
|
1737
1741
|
motionOnly = false,
|
|
1742
|
+
skipIfInspectActive = false,
|
|
1738
1743
|
readyPlayback = false,
|
|
1739
1744
|
transitionStartWindowMs = 80,
|
|
1740
1745
|
transitionTimeoutMs = 4e3
|
|
@@ -1750,7 +1755,8 @@ async function waitForSootsimIdle({
|
|
|
1750
1755
|
maxMs,
|
|
1751
1756
|
requiredStillMs: Math.max(1, Math.round(stablePolls)) * Math.max(1, Math.round(pollMs)),
|
|
1752
1757
|
transitionStartWindowMs,
|
|
1753
|
-
transitionTimeoutMs
|
|
1758
|
+
transitionTimeoutMs,
|
|
1759
|
+
skipIfInspectActive
|
|
1754
1760
|
}) : `(async () => {
|
|
1755
1761
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
|
1756
1762
|
// tests inject a virtual clock as globalThis.__sootsimIdleClock ({ now, sleep })
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2244 | (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;
|