peachsim 0.1.1692 → 0.1.1700
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/bridge-flow-runner.ts +61 -39
- package/cli/commands/agent-wrapper.ts +21 -10
- package/cli/commands/control.ts +27 -7
- package/cli/commands/coverage.ts +1 -1
- package/cli/commands/detect.ts +17 -4
- package/cli/commands/maestro-compare.ts +25 -99
- package/cli/help-core.ts +3 -4
- package/cli/maestro-compare.ts +172 -4
- package/cli/outbound-endpoints.ts +2 -10
- package/detox/index.ts +15 -0
- package/detox/launch-permissions.ts +169 -0
- package/dist-lib/agent-daemon-client.cjs +2 -2
- package/dist-lib/agent-events.cjs +2 -2
- package/dist-lib/attached-projects.cjs +2 -2
- package/dist-lib/auth/shared-session.cjs +2 -2
- package/dist-lib/backend-origin.cjs +2 -2
- package/dist-lib/beta.cjs +2 -2
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +2 -2
- package/dist-lib/bridge-contract-input.cjs +2 -2
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +2 -2
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +18273 -15925
- package/dist-lib/capture-contract.cjs +2 -2
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +2 -2
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +2 -2
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +2 -2
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +2 -2
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +104 -3
- package/dist-lib/dev-bundle-resolution.cjs +208 -44
- package/dist-lib/expo-swift-bundle.cjs +2349 -1778
- package/dist-lib/expo-swift-metadata.cjs +2 -2
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +2 -2
- package/dist-lib/host/bridge-host.cjs +7885 -3334
- package/dist-lib/host/fetch-proxy-handler.cjs +331 -39
- package/dist-lib/host/fetch-proxy-overrides.cjs +2 -2
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +2 -2
- package/dist-lib/host/websocket-proxy.cjs +2 -2
- package/dist-lib/index.cjs +297 -77
- package/dist-lib/jump-to-source-babel.cjs +2 -2
- package/dist-lib/jump-to-source-native.cjs +2 -2
- package/dist-lib/kotlin-host.cjs +2 -2
- package/dist-lib/menu.cjs +2 -2
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +2 -2
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +2 -2
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +294 -74
- package/dist-lib/native-app-identity-project.cjs +48 -37
- package/dist-lib/native-app-identity-project.mjs +47 -36
- package/dist-lib/native-app-identity.cjs +2 -2
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +2 -2
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +2 -2
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +2 -2
- package/dist-lib/public-brand.cjs +2 -2
- package/dist-lib/public-origins-lib-esm.json +24 -23
- package/dist-lib/public-origins-lib.json +199 -79
- package/dist-lib/react-native-host-modules.cjs +2 -2
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +2 -2
- package/dist-lib/scripts/dev-server-scanner.cjs +206 -31
- package/dist-lib/sdk.cjs +2 -2
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +19600 -15992
- package/dist-lib/swift-compile.cjs +640 -402
- package/dist-lib/swift-compile.mjs +595 -357
- package/dist-lib/swift-package.cjs +24 -20
- package/dist-lib/swift-package.mjs +23 -19
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +31 -4
- package/dist-lib/swift.cjs +2 -2
- package/dist-lib/vite-swift.cjs +1559 -1208
- package/dist-lib/vite.cjs +251 -42
- package/dist-lib/worklet-executable.cjs +2 -2
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/scroll-pan-contacts.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +7 -0
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +17 -0
- package/dist-types/packages/peach-engine/src/render-worker/worker-input-runtime.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +3 -0
- package/dist-types/packages/peach-globals/src/cameraBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/shellHostBridgeContract.d.ts +3 -0
- package/dist-types/packages/peach-kit/src/materials/types.d.ts +1 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +4 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h +2282 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h +55 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h +10551 -6
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h +4236 -3
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h +827 -8
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h +1369 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h +1243 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h +1747 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h +291 -2
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h +1283 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h +811 -91
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h +1342 -25
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns.h +2738 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h +1685 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h +913 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h +1917 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h +23 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h +209 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h +104 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h +77 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h +554 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h +58 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h +186 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h +86 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h +364 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h +195 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h +44 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/BLAS.h +2330 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/Types.h +123 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Solve.h +8339 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h +520 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h +1893 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h +10 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/blas_new.h +1098 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas.h +859 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas_new.h +1134 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/clapack.h +10555 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/fortran_blas.h +695 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack.h +38526 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_types.h +60 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_version.h +20 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/thread_api.h +50 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h +1218 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBigNum.h +1458 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP.h +10377 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP_translate.h +167 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vForce.h +1243 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h +114 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLibTypes.h +146 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vectorOps.h +1106 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vfp.h +294 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h +25 -1
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h +673 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h +232 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h +827 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h +121 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h +387 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h +79 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h +122 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h +674 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h +182 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h +213 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h +82 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h +129 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h +491 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h +883 -2
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h +98 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +11 -229
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +2 -6
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +2 -1
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +1 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecBase.h +906 -3
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h +613 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecItem.h +1284 -29
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h +441 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecTrust.h +845 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/Security.h +4 -0
- package/sdk/ios/usr/include/AvailabilityMacros.h +3985 -0
- package/sdk/ios/usr/include/copyfile.h +143 -0
- package/sdk/ios/usr/include/malloc/_malloc.h +143 -0
- package/sdk/ios/usr/include/malloc/_malloc_type.h +153 -0
- package/sdk/ios/usr/include/malloc/_platform.h +80 -0
- package/sdk/ios/usr/include/malloc/_ptrcheck.h +43 -0
- package/sdk/ios/usr/include/malloc/malloc.h +768 -0
- package/sdk/ios/usr/include/os/availability.h +168 -6
- package/sdk/ios/usr/include/os/base.h +351 -0
- package/sdk/ios/usr/include/os/clock.h +18 -0
- package/sdk/ios/usr/include/os/lock.h +232 -10
- package/sdk/ios/usr/include/os/log.h +521 -38
- package/sdk/ios/usr/include/os/object.h +320 -3
- package/sdk/ios/usr/include/os/trace.h +492 -0
- package/sdk/ios/usr/include/os/trace_base.h +167 -0
- package/sdk/ios/usr/include/os/workgroup.h +37 -0
- package/sdk/ios/usr/include/os/workgroup_base.h +91 -0
- package/sdk/ios/usr/include/os/workgroup_interval.h +156 -0
- package/sdk/ios/usr/include/os/workgroup_object.h +359 -0
- package/sdk/ios/usr/include/os/workgroup_parallel.h +76 -0
- package/sdk/ios/usr/include/sys/cdefs.h +38 -0
- package/sdk/ios/wasm/include/unistd.h +3 -0
- package/skills/contrast/SKILL.md +3 -0
- package/src/codex-client.ts +11 -6
- package/src/dev-bundle-resolution.ts +124 -48
- package/src/expo-native-workspace.ts +176 -0
- package/src/expo-swift-host.ts +161 -26
- package/src/expo-swift-ready.ts +14 -28
- package/src/expoSwiftContract.ts +4 -1
- package/src/generated/swift-c-predefines.json +68 -12
- package/src/host/bridge-host.ts +5 -0
- package/src/installed-package-versions.ts +14 -1
- package/src/metro-project-root.ts +44 -33
- package/src/native-app-identity-project.ts +1 -0
- package/src/nitro-adapter.lock.json +916 -10
- package/src/nitro-adapter.ts +33 -24
- package/src/nitro-bundle.ts +108 -22
- package/src/nitro-compile.ts +32 -5
- package/src/nitro-source.ts +13 -3
- package/src/nitroAdapterContract.ts +100 -20
- package/src/node-http-fetch.ts +116 -0
- package/src/packageVersionsContract.ts +46 -0
- package/src/serverDiscoveryContract.ts +1 -0
- package/src/settingsContract.ts +0 -30
- package/src/swift-binary-modules.ts +20 -5
- package/src/swift-compile.ts +168 -48
- package/src/swift-coverage/xcode-assets.ts +4 -3
- package/src/swift-host.ts +14 -3
- package/src/swift-objc-compile.ts +32 -5
- package/src/swift-objc-metadata.ts +2 -2
- package/src/swift-objc-platform.ts +2 -2
- package/src/swift-objc-standin.ts +43 -13
- package/src/swift-package.ts +33 -26
- package/src/swift-source-pods.ts +126 -41
- package/src/swift-standin-digest.ts +77 -0
- package/src/swift-standin-emit.ts +40 -4
- package/src/swift-standins.ts +68 -19
- package/src/swift-toolchain.ts +38 -0
- package/src/swiftContract.ts +8 -0
- package/src/vite-plugin.ts +0 -10
- package/src/xcode-project.ts +62 -42
- package/src/settings-flags.ts +0 -107
|
@@ -1421,12 +1421,12 @@ export class SootSimBridgeFlowRunner {
|
|
|
1421
1421
|
)
|
|
1422
1422
|
}
|
|
1423
1423
|
|
|
1424
|
-
private async findElement(opts: FlowTargetSelector) {
|
|
1424
|
+
private async findElement(opts: FlowTargetSelector, preferHittable = false) {
|
|
1425
1425
|
assertSupportedSelector(opts)
|
|
1426
1426
|
if (needsAccessibilityProjection(opts, true)) {
|
|
1427
|
-
return this.findElementAccessibilityTree(opts)
|
|
1427
|
+
return this.findElementAccessibilityTree(opts, preferHittable)
|
|
1428
1428
|
}
|
|
1429
|
-
return this.findElementScoped(opts)
|
|
1429
|
+
return this.findElementScoped(opts, preferHittable)
|
|
1430
1430
|
}
|
|
1431
1431
|
|
|
1432
1432
|
private async captureAccessibilityTree(): Promise<PeachAccessibilityNode[]> {
|
|
@@ -1453,7 +1453,10 @@ export class SootSimBridgeFlowRunner {
|
|
|
1453
1453
|
return resolveAccessibilitySelector(tree, opts)
|
|
1454
1454
|
}
|
|
1455
1455
|
|
|
1456
|
-
private async findElementAccessibilityTree(
|
|
1456
|
+
private async findElementAccessibilityTree(
|
|
1457
|
+
opts: FlowTargetSelector,
|
|
1458
|
+
preferHittable = false,
|
|
1459
|
+
) {
|
|
1457
1460
|
const tree = await this.captureAccessibilityTree()
|
|
1458
1461
|
// the snapshot's platform is the live device contract. android keeps its
|
|
1459
1462
|
// existing render-tree text lookup; XCTest-only filters still refuse it.
|
|
@@ -1461,13 +1464,18 @@ export class SootSimBridgeFlowRunner {
|
|
|
1461
1464
|
!needsAccessibilityProjection(opts) &&
|
|
1462
1465
|
tree.some((node) => node.platform === 'android')
|
|
1463
1466
|
) {
|
|
1464
|
-
return this.findElementScoped(opts)
|
|
1467
|
+
return this.findElementScoped(opts, preferHittable)
|
|
1465
1468
|
}
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
)
|
|
1469
|
+
if (tree.some((node) => node.platform !== 'ios'))
|
|
1470
|
+
throw new Error(
|
|
1471
|
+
'text, containsChild, containsDescendants and focused requires the iOS accessibility hierarchy',
|
|
1472
|
+
)
|
|
1473
|
+
const all = accessibilityTreeNodes(tree)
|
|
1474
|
+
const candidates = filterAccessibilityNodes(all, all, opts)
|
|
1475
|
+
const node =
|
|
1476
|
+
preferHittable && opts.index == null
|
|
1477
|
+
? await this.preferHittableCandidate(candidates)
|
|
1478
|
+
: candidates[0]
|
|
1471
1479
|
if (!node) return null
|
|
1472
1480
|
const frame = node.frame
|
|
1473
1481
|
return {
|
|
@@ -1496,9 +1504,9 @@ export class SootSimBridgeFlowRunner {
|
|
|
1496
1504
|
// below/above/leftOf/rightOf filters, `index:` (nth match) and `childOf:`
|
|
1497
1505
|
// (match scoped to a container). a nested selector resolves the same way,
|
|
1498
1506
|
// and a relative filter holds when ANY match of its anchor satisfies it.
|
|
1499
|
-
private async findElementScoped(opts: FlowTargetSelector) {
|
|
1507
|
+
private async findElementScoped(opts: FlowTargetSelector, preferHittable = false) {
|
|
1500
1508
|
const screen = await this.screenBounds()
|
|
1501
|
-
|
|
1509
|
+
const candidates = await this.evaluate<any[]>(`(async () => {
|
|
1502
1510
|
const test = window.__sootsimTest
|
|
1503
1511
|
if (!test || !test.queryAll) return null
|
|
1504
1512
|
const selector = ${JSON.stringify(opts)}
|
|
@@ -1654,9 +1662,9 @@ export class SootSimBridgeFlowRunner {
|
|
|
1654
1662
|
const resolved = index >= 0 ? index : candidates.length + index
|
|
1655
1663
|
return candidates[resolved] ? [candidates[resolved]] : []
|
|
1656
1664
|
}
|
|
1657
|
-
const
|
|
1658
|
-
|
|
1659
|
-
return {
|
|
1665
|
+
const matches = pick(matchAll(selector), selector.index)
|
|
1666
|
+
const nodes = ${JSON.stringify(preferHittable && opts.index == null)} ? matches : matches.slice(0, 1)
|
|
1667
|
+
return nodes.map((node) => ({
|
|
1660
1668
|
nodeId: typeof node.nodeId === 'number' ? node.nodeId : null,
|
|
1661
1669
|
id: node.id || null,
|
|
1662
1670
|
testID: node.testID || null,
|
|
@@ -1666,8 +1674,33 @@ export class SootSimBridgeFlowRunner {
|
|
|
1666
1674
|
// authoritative visibility, as in findElement above.
|
|
1667
1675
|
visibleFrame: node.visibleFrame || null,
|
|
1668
1676
|
isTextInput: !!node.isTextInput,
|
|
1677
|
+
}))
|
|
1678
|
+
})()`)
|
|
1679
|
+
if (!candidates?.length) return null
|
|
1680
|
+
return preferHittable && opts.index == null
|
|
1681
|
+
? this.preferHittableCandidate(candidates)
|
|
1682
|
+
: candidates[0]
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
private async preferHittableCandidate<T extends { nodeId: number | null }>(
|
|
1686
|
+
candidates: T[],
|
|
1687
|
+
): Promise<T | null> {
|
|
1688
|
+
if (candidates.length < 2) return candidates[0] ?? null
|
|
1689
|
+
const nodeIds = candidates.map((node) => node.nodeId)
|
|
1690
|
+
const index = await this.evaluate<number>(`(async () => {
|
|
1691
|
+
const test = window.__sootsimTest
|
|
1692
|
+
for (const [index, nodeId] of ${JSON.stringify(nodeIds)}.entries()) {
|
|
1693
|
+
if (typeof nodeId !== 'number') continue
|
|
1694
|
+
const resolved = await test.resolveTapTarget(nodeId)
|
|
1695
|
+
if (!resolved) continue
|
|
1696
|
+
const verification = await test.verifyTapTargetAt(resolved.cx, resolved.cy, {
|
|
1697
|
+
nodeId: resolved.target.nodeId,
|
|
1698
|
+
})
|
|
1699
|
+
if (verification.requestedTargetMatched === true) return index
|
|
1669
1700
|
}
|
|
1701
|
+
return -1
|
|
1670
1702
|
})()`)
|
|
1703
|
+
return candidates[index] ?? candidates[0] ?? null
|
|
1671
1704
|
}
|
|
1672
1705
|
|
|
1673
1706
|
private async resolveTapTarget(nodeId: number) {
|
|
@@ -1764,14 +1797,18 @@ export class SootSimBridgeFlowRunner {
|
|
|
1764
1797
|
return typeof revision === 'string' ? revision : null
|
|
1765
1798
|
}
|
|
1766
1799
|
|
|
1767
|
-
private async waitForElement(
|
|
1800
|
+
private async waitForElement(
|
|
1801
|
+
opts: FlowTargetSelector,
|
|
1802
|
+
timeoutMs = 5000,
|
|
1803
|
+
preferHittable = false,
|
|
1804
|
+
) {
|
|
1768
1805
|
const deadline = Date.now() + timeoutMs
|
|
1769
1806
|
let revision = await this.geometryRevision()
|
|
1770
|
-
let element = await this.findElement(opts)
|
|
1807
|
+
let element = await this.findElement(opts, preferHittable)
|
|
1771
1808
|
while (!element && Date.now() < deadline) {
|
|
1772
1809
|
await sleep(150)
|
|
1773
1810
|
revision = await this.geometryRevision()
|
|
1774
|
-
element = await this.findElement(opts)
|
|
1811
|
+
element = await this.findElement(opts, preferHittable)
|
|
1775
1812
|
}
|
|
1776
1813
|
if (!element) return element
|
|
1777
1814
|
// a found element can still be mid-transition (modal slide-in, sheet
|
|
@@ -1789,7 +1826,7 @@ export class SootSimBridgeFlowRunner {
|
|
|
1789
1826
|
const sampled = await this.geometryRevision()
|
|
1790
1827
|
if (sampled !== null && sampled === revision) return element
|
|
1791
1828
|
revision = sampled
|
|
1792
|
-
const next = await this.findElement(opts)
|
|
1829
|
+
const next = await this.findElement(opts, preferHittable)
|
|
1793
1830
|
if (!next) break
|
|
1794
1831
|
const moved =
|
|
1795
1832
|
Math.abs(next.absolutePosition.x - prev.absolutePosition.x) > 0.5 ||
|
|
@@ -1897,7 +1934,7 @@ export class SootSimBridgeFlowRunner {
|
|
|
1897
1934
|
// auto-wait like real maestro: if the target is not mounted yet, poll
|
|
1898
1935
|
// before giving up. saves flows from adding an explicit wait before every
|
|
1899
1936
|
// tapOn just to handle the post-nav frame or two before render.
|
|
1900
|
-
|
|
1937
|
+
const element = await this.waitForElement(opts, 5000, true)
|
|
1901
1938
|
// coord-based tap first — this is what fires the agent-cursor animation
|
|
1902
1939
|
// (via the ws-bridge 'tap' case emitting sootsim:agentAction). the
|
|
1903
1940
|
// activatePress fallback below bypasses that event, so we reserve it
|
|
@@ -1915,7 +1952,7 @@ export class SootSimBridgeFlowRunner {
|
|
|
1915
1952
|
// command uses. non-text-input taps keep the single-tap path.
|
|
1916
1953
|
const tapInputAttempts = element.isTextInput ? 4 : 1
|
|
1917
1954
|
for (let attempt = 0; attempt < tapInputAttempts; attempt++) {
|
|
1918
|
-
const current = attempt === 0 ? element : await this.findElement(opts)
|
|
1955
|
+
const current = attempt === 0 ? element : await this.findElement(opts, true)
|
|
1919
1956
|
if (!current) break
|
|
1920
1957
|
const tapTarget =
|
|
1921
1958
|
typeof current.nodeId === 'number'
|
|
@@ -1923,24 +1960,9 @@ export class SootSimBridgeFlowRunner {
|
|
|
1923
1960
|
: null
|
|
1924
1961
|
const cx = tapTarget?.cx ?? current.absolutePosition.x + current.layout.width / 2
|
|
1925
1962
|
const cy = tapTarget?.cy ?? current.absolutePosition.y + current.layout.height / 2
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
tapTarget,
|
|
1930
|
-
)
|
|
1931
|
-
let tappedAtMs = Date.now()
|
|
1932
|
-
let hit = await this.tap(cx, cy, replayTarget)
|
|
1933
|
-
// maestro taps the element's center and whatever sits on top there
|
|
1934
|
-
// takes it, as a finger would: a label under a text input's hitSlop
|
|
1935
|
-
// focuses the input. name the cover, then deliver that same tap.
|
|
1936
|
-
if (hit?.requestedTargetMatched === false && hit.reason === 'target-covered') {
|
|
1937
|
-
console.warn(
|
|
1938
|
-
`[flow] tapOn ${JSON.stringify(opts)}: covered by ${JSON.stringify(hit.coordinateTarget)}, tapping it as maestro does`,
|
|
1939
|
-
)
|
|
1940
|
-
replayTarget = undefined
|
|
1941
|
-
tappedAtMs = Date.now()
|
|
1942
|
-
hit = await this.tap(cx, cy)
|
|
1943
|
-
}
|
|
1963
|
+
const replayTarget = this.replayTargetForElement(opts, current, tapTarget)
|
|
1964
|
+
const tappedAtMs = Date.now()
|
|
1965
|
+
const hit = await this.tap(cx, cy, replayTarget)
|
|
1944
1966
|
if (hit?.requestedTargetMatched === false)
|
|
1945
1967
|
throw new Error(`tapOn refused: ${JSON.stringify(hit)}`)
|
|
1946
1968
|
if (hit?.hit === true) {
|
|
@@ -307,17 +307,28 @@ export async function runAgentWrapper(argv: string[]): Promise<number> {
|
|
|
307
307
|
try {
|
|
308
308
|
currentClaudeChild?.kill('SIGTERM')
|
|
309
309
|
} catch {}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
310
|
+
// exit is announced and the streams close only after the codex process
|
|
311
|
+
// tree is gone. a teardown failure is reported and turns a clean exit
|
|
312
|
+
// into a failing one; an original failing code is kept.
|
|
313
|
+
const stopped = (codexClient?.shutdown(800) ?? Promise.resolve()).then(
|
|
314
|
+
() => code,
|
|
315
|
+
(error: unknown) => {
|
|
316
|
+
process.stderr.write(`codex shutdown failed: ${String(error)}\n`)
|
|
317
|
+
return code === 0 ? 1 : code
|
|
318
|
+
},
|
|
319
|
+
)
|
|
320
|
+
void stopped.then((exitCode) => {
|
|
321
|
+
if (emitExit) emit({ type: 'exited', code: exitCode } as AgentEvent)
|
|
322
|
+
eventsStream.end(() => {
|
|
323
|
+
try {
|
|
324
|
+
transcriptStream?.end()
|
|
325
|
+
} catch {}
|
|
326
|
+
resolveExit(exitCode)
|
|
327
|
+
})
|
|
328
|
+
;(
|
|
329
|
+
setTimeout(() => resolveExit(exitCode), 1500) as unknown as NodeJS.Timeout
|
|
330
|
+
).unref()
|
|
319
331
|
})
|
|
320
|
-
;(setTimeout(() => resolveExit(code), 1500) as unknown as NodeJS.Timeout).unref()
|
|
321
332
|
}
|
|
322
333
|
|
|
323
334
|
// orphan watchdog: if our session dir / FIFOs are deleted out from under
|
package/cli/commands/control.ts
CHANGED
|
@@ -736,29 +736,34 @@ function localBasePort(target: string): number | null {
|
|
|
736
736
|
const DEV_BUNDLE_RESOLVE_ATTEMPTS = 15
|
|
737
737
|
const DEV_BUNDLE_RESOLVE_INTERVAL_MS = 1000
|
|
738
738
|
|
|
739
|
-
async function resolveConnectionInputForCli(
|
|
739
|
+
async function resolveConnectionInputForCli(
|
|
740
|
+
target: string,
|
|
741
|
+
signal?: AbortSignal,
|
|
742
|
+
): Promise<ResolvedDevBundle> {
|
|
740
743
|
const normalized = normalizeKnownTarget(target)
|
|
741
744
|
const registeredPort = /^\d+$/.test(normalized)
|
|
742
745
|
? Number(normalized)
|
|
743
746
|
: localBasePort(normalized)
|
|
744
747
|
|
|
745
|
-
console.log(` resolving native bundle for ${normalized} (
|
|
748
|
+
console.log(` resolving native bundle for ${normalized} (waiting for the dev server)…`)
|
|
746
749
|
let lastError: Error | null = null
|
|
747
750
|
const releaseListenerScan = pinSharedListenerScan()
|
|
748
751
|
try {
|
|
749
752
|
for (let attempt = 0; attempt < DEV_BUNDLE_RESOLVE_ATTEMPTS; attempt++) {
|
|
753
|
+
signal?.throwIfAborted()
|
|
750
754
|
let resolutionTarget = normalized
|
|
751
755
|
if (registeredPort && registeredPort > 0) {
|
|
752
756
|
const discovered = await probePort(registeredPort)
|
|
753
757
|
// a provisional bundle URL is enough to LIST the server but not to open
|
|
754
758
|
// it; resolveConnectionInput joins the scanner's pending manifest with
|
|
755
|
-
// the
|
|
759
|
+
// the server response instead of starting the same work again.
|
|
756
760
|
if (discovered && !discovered.bundleUrlProvisional) {
|
|
757
761
|
return {
|
|
758
762
|
bundleUrl: projectLoopbackUrl(discovered.bundleUrl),
|
|
759
763
|
port: discovered.port,
|
|
760
764
|
framework: discovered.framework,
|
|
761
765
|
projectName: discovered.projectName,
|
|
766
|
+
manifestProjectRoot: discovered.manifestProjectRoot,
|
|
762
767
|
}
|
|
763
768
|
}
|
|
764
769
|
// keep the scanner's answering address and join its manifest request.
|
|
@@ -769,7 +774,10 @@ async function resolveConnectionInputForCli(target: string): Promise<ResolvedDev
|
|
|
769
774
|
}
|
|
770
775
|
|
|
771
776
|
try {
|
|
772
|
-
const resolved = await resolveConnectionInput(resolutionTarget
|
|
777
|
+
const resolved = await resolveConnectionInput(resolutionTarget, undefined, {
|
|
778
|
+
waitMs: null,
|
|
779
|
+
signal,
|
|
780
|
+
})
|
|
773
781
|
return { ...resolved, bundleUrl: projectLoopbackUrl(resolved.bundleUrl) }
|
|
774
782
|
} catch (error) {
|
|
775
783
|
if (
|
|
@@ -975,6 +983,8 @@ function parseOpenRuntimeConfig(args: string[]): PeachConfig | undefined {
|
|
|
975
983
|
export async function resolveAppProjectForBundleUrl(
|
|
976
984
|
bundleUrl?: string,
|
|
977
985
|
projectRoot?: string,
|
|
986
|
+
manifestProjectRoot?: string | null,
|
|
987
|
+
signal?: AbortSignal,
|
|
978
988
|
): Promise<ResolvedAppProject | null> {
|
|
979
989
|
if (projectRoot !== undefined) {
|
|
980
990
|
const project = resolveAppProject(projectRoot)
|
|
@@ -982,7 +992,10 @@ export async function resolveAppProjectForBundleUrl(
|
|
|
982
992
|
return project
|
|
983
993
|
}
|
|
984
994
|
if (!bundleUrl) return null
|
|
985
|
-
const advertisedRoot = await resolveMetroProjectRoot(bundleUrl
|
|
995
|
+
const advertisedRoot = await resolveMetroProjectRoot(bundleUrl, manifestProjectRoot, {
|
|
996
|
+
waitMs: null,
|
|
997
|
+
signal,
|
|
998
|
+
})
|
|
986
999
|
return advertisedRoot ? resolveAppProject(advertisedRoot) : null
|
|
987
1000
|
}
|
|
988
1001
|
|
|
@@ -1466,6 +1479,10 @@ export async function buildShellUrl(
|
|
|
1466
1479
|
'expoSwift',
|
|
1467
1480
|
`http://localhost:${port.port}/__peach/expo-swift?root=${encodeURIComponent(expoRoot)}`,
|
|
1468
1481
|
)
|
|
1482
|
+
expoStamped.searchParams.set(
|
|
1483
|
+
'nitro',
|
|
1484
|
+
`http://localhost:${port.port}/__peach/nitro?root=${encodeURIComponent(expoRoot)}`,
|
|
1485
|
+
)
|
|
1469
1486
|
// the engine fetches only its device platform's build
|
|
1470
1487
|
expoStamped.searchParams.set(
|
|
1471
1488
|
'expoKotlin',
|
|
@@ -1533,6 +1550,7 @@ function deriveCurrentSimBaseUrl(
|
|
|
1533
1550
|
url.searchParams.delete(LAUNCH_METADATA_QUERY_PARAM)
|
|
1534
1551
|
url.searchParams.delete('expoSwift')
|
|
1535
1552
|
url.searchParams.delete('expoKotlin')
|
|
1553
|
+
url.searchParams.delete('nitro')
|
|
1536
1554
|
return url.toString()
|
|
1537
1555
|
} catch {
|
|
1538
1556
|
return fallback
|
|
@@ -2210,7 +2228,7 @@ async function openSim(
|
|
|
2210
2228
|
// a bundle file gets its url once the bridge that serves it is settled
|
|
2211
2229
|
let resolvedBundle =
|
|
2212
2230
|
!prebuiltBundle && shouldResolveBundleTargetInCli(target)
|
|
2213
|
-
? await resolveConnectionInputForCli(target)
|
|
2231
|
+
? await resolveConnectionInputForCli(target, opts.signal)
|
|
2214
2232
|
: undefined
|
|
2215
2233
|
const projectRootIndex = args.indexOf('--project-root')
|
|
2216
2234
|
const projectRoot = projectRootIndex < 0 ? undefined : args[projectRootIndex + 1]
|
|
@@ -2221,6 +2239,8 @@ async function openSim(
|
|
|
2221
2239
|
const project = await resolveAppProjectForBundleUrl(
|
|
2222
2240
|
resolvedBundle?.bundleUrl,
|
|
2223
2241
|
projectRoot ?? (prebuiltBundle ? appDirAbove(prebuiltBundle) : undefined),
|
|
2242
|
+
resolvedBundle?.manifestProjectRoot,
|
|
2243
|
+
opts.signal,
|
|
2224
2244
|
)
|
|
2225
2245
|
startExpoConfigRead(project)
|
|
2226
2246
|
// playwright is the browser-sim launcher. it owns an isolated profile and
|
|
@@ -2712,7 +2732,7 @@ async function openSim(
|
|
|
2712
2732
|
const builtShellUrl =
|
|
2713
2733
|
newSimShellUrl ??
|
|
2714
2734
|
(await buildShellUrl(shellTarget, configuredBaseUrl, buildShellUrlOpts))
|
|
2715
|
-
await awaitStampedExpoSwiftReady(builtShellUrl)
|
|
2735
|
+
await awaitStampedExpoSwiftReady(builtShellUrl, opts.signal)
|
|
2716
2736
|
const openUrl = withOpenToken(builtShellUrl, token)
|
|
2717
2737
|
const ownerPid = opts.ownerPid ?? getStableOwnerPid()
|
|
2718
2738
|
if (!ownerPid) {
|
package/cli/commands/coverage.ts
CHANGED
|
@@ -615,7 +615,7 @@ export async function createCoverageReport(
|
|
|
615
615
|
: null,
|
|
616
616
|
verification: 'unknown',
|
|
617
617
|
reason: 'source references do not select device, OS, settings or interaction cells',
|
|
618
|
-
proofUrl: 'https://peachsim.com/
|
|
618
|
+
proofUrl: 'https://peachsim.com/proof',
|
|
619
619
|
}))
|
|
620
620
|
// one entry per package release and feature the scan could not credit
|
|
621
621
|
const versionUnknown = [
|
package/cli/commands/detect.ts
CHANGED
|
@@ -519,11 +519,11 @@ export function readNativeProjectRenderer(
|
|
|
519
519
|
)
|
|
520
520
|
}
|
|
521
521
|
if (platform === 'ios') {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
'
|
|
525
|
-
true,
|
|
522
|
+
const podfileProperty = metadataValue(
|
|
523
|
+
json('ios/Podfile.properties.json'),
|
|
524
|
+
'newArchEnabled',
|
|
526
525
|
)
|
|
526
|
+
add(podfileProperty, 'ios/Podfile.properties.json newArchEnabled', true)
|
|
527
527
|
const podfile = readProjectMetadata(join(dir, 'ios/Podfile'), files)
|
|
528
528
|
if (podfile === null && files.exists(join(dir, 'ios/Podfile')))
|
|
529
529
|
throw new Error('ios/Podfile: unreadable native metadata')
|
|
@@ -551,6 +551,19 @@ export function readNativeProjectRenderer(
|
|
|
551
551
|
)
|
|
552
552
|
)
|
|
553
553
|
continue
|
|
554
|
+
// expo's generated ternary is ruby `== 'true' ? '1' : '0'`: only the
|
|
555
|
+
// string 'true' enables, so a missing or non-'true' property means 0.
|
|
556
|
+
if (
|
|
557
|
+
/^\s*ENV\s*\[\s*(['"])RCT_NEW_ARCH_ENABLED\1\s*\]\s*=\s*podfile_properties\s*\[\s*(['"])newArchEnabled\2\s*\]\s*==\s*(['"])true\3\s*\?\s*(['"])1\4\s*:\s*(['"])0\5\s*;?\s*(?:#.*)?$/.test(
|
|
558
|
+
line,
|
|
559
|
+
)
|
|
560
|
+
) {
|
|
561
|
+
declarations.push({
|
|
562
|
+
source: 'ios/Podfile RCT_NEW_ARCH_ENABLED',
|
|
563
|
+
enabled: podfileProperty === 'true',
|
|
564
|
+
})
|
|
565
|
+
continue
|
|
566
|
+
}
|
|
554
567
|
const match =
|
|
555
568
|
/^\s*ENV\s*\[\s*(['"])RCT_NEW_ARCH_ENABLED\1\s*\]\s*=\s*(['"])([01])\2\s*;?\s*(?:#.*)?$/.exec(
|
|
556
569
|
line,
|
|
@@ -7,19 +7,23 @@ import { spawn, spawnSync } from 'child_process'
|
|
|
7
7
|
import * as fs from 'fs'
|
|
8
8
|
import * as os from 'os'
|
|
9
9
|
import * as path from 'path'
|
|
10
|
-
import { PNG } from 'pngjs'
|
|
11
|
-
import { devices } from '../../src/device-catalog.ts'
|
|
12
10
|
import { rnxHomeDir } from '../../src/home-paths'
|
|
13
11
|
import { parseFlowFile } from '../flow-file'
|
|
14
12
|
import {
|
|
13
|
+
alignNativeCapture,
|
|
15
14
|
buildCompareHtml,
|
|
16
15
|
buildCompareSide,
|
|
17
16
|
compareScreens,
|
|
17
|
+
discoverNativeOutputs,
|
|
18
|
+
readJson,
|
|
19
|
+
statusBarPx,
|
|
18
20
|
comparePassed,
|
|
19
21
|
instrumentFlowSource,
|
|
20
22
|
nativeStepsFromCommandsJson,
|
|
21
23
|
nativeFlowVerdictsFromJunit,
|
|
22
24
|
junitFlowKey,
|
|
25
|
+
nativeFlowVerdict,
|
|
26
|
+
nativeRecordsScreenshot,
|
|
23
27
|
peachStepsFromCommandsJson,
|
|
24
28
|
screensOverThreshold,
|
|
25
29
|
type CompareCapture,
|
|
@@ -155,52 +159,6 @@ function runLogged(bin: string, args: string[], logPath: string): Promise<number
|
|
|
155
159
|
})
|
|
156
160
|
}
|
|
157
161
|
|
|
158
|
-
// the status bar band of the device whose screen matches the iOS capture's
|
|
159
|
-
// pixel size (peach's own device table); 0 for a size no device has.
|
|
160
|
-
function statusBarPx(png: Buffer): number {
|
|
161
|
-
// png ihdr: width and height are the big-endian words at bytes 16 and 20
|
|
162
|
-
const width = png.readUInt32BE(16)
|
|
163
|
-
const height = png.readUInt32BE(20)
|
|
164
|
-
const spec = Object.values(devices).find(
|
|
165
|
-
(d) =>
|
|
166
|
-
// maestro can truncate fractional point bounds one pixel below simctl.
|
|
167
|
-
Math.abs(Math.round(d.width * d.scale) - width) <= 1 &&
|
|
168
|
-
Math.abs(Math.round(d.height * d.scale) - height) <= 1,
|
|
169
|
-
)
|
|
170
|
-
return spec ? spec.statusBarHeight * spec.scale : 0
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// maestro's xctest shot on an ios 27 simulator drops the rightmost column of
|
|
174
|
-
// an odd framebuffer (1179 becomes 1178). diffing at that short width
|
|
175
|
-
// resamples peach off the pixel grid, so restore the column first.
|
|
176
|
-
function alignNativeCapture(png: Buffer): Buffer {
|
|
177
|
-
const width = png.readUInt32BE(16)
|
|
178
|
-
const height = png.readUInt32BE(20)
|
|
179
|
-
const spec = Object.values(devices).find(
|
|
180
|
-
(d) =>
|
|
181
|
-
Math.abs(Math.round(d.width * d.scale) - width) <= 1 &&
|
|
182
|
-
Math.abs(Math.round(d.height * d.scale) - height) <= 1,
|
|
183
|
-
)
|
|
184
|
-
if (!spec) return png
|
|
185
|
-
const expectedW = Math.round(spec.width * spec.scale)
|
|
186
|
-
const expectedH = Math.round(spec.height * spec.scale)
|
|
187
|
-
if (expectedH !== height || expectedW !== width + 1) return png
|
|
188
|
-
const src = PNG.sync.read(png)
|
|
189
|
-
const dst = new PNG({ width: expectedW, height })
|
|
190
|
-
for (let y = 0; y < height; y++) {
|
|
191
|
-
const srow = y * src.width * 4
|
|
192
|
-
const drow = y * expectedW * 4
|
|
193
|
-
src.data.copy(dst.data, drow, srow, srow + src.width * 4)
|
|
194
|
-
const last = srow + (src.width - 1) * 4
|
|
195
|
-
const o = drow + src.width * 4
|
|
196
|
-
dst.data[o] = src.data[last] ?? 0
|
|
197
|
-
dst.data[o + 1] = src.data[last + 1] ?? 0
|
|
198
|
-
dst.data[o + 2] = src.data[last + 2] ?? 0
|
|
199
|
-
dst.data[o + 3] = 255
|
|
200
|
-
}
|
|
201
|
-
return PNG.sync.write(dst)
|
|
202
|
-
}
|
|
203
|
-
|
|
204
162
|
// the flow as its author would name it: relative inside the working
|
|
205
163
|
// directory, home-relative or absolute outside it.
|
|
206
164
|
function displayPath(cwd: string, file: string): string {
|
|
@@ -210,14 +168,6 @@ function displayPath(cwd: string, file: string): string {
|
|
|
210
168
|
return file.startsWith(home + path.sep) ? `~${file.slice(home.length)}` : file
|
|
211
169
|
}
|
|
212
170
|
|
|
213
|
-
function readJson(file: string): unknown {
|
|
214
|
-
try {
|
|
215
|
-
return JSON.parse(fs.readFileSync(file, 'utf8'))
|
|
216
|
-
} catch {
|
|
217
|
-
return null
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
171
|
function formatConsoleEntry(entry: unknown): string {
|
|
222
172
|
if (typeof entry === 'string') return entry
|
|
223
173
|
if (entry && typeof entry === 'object') {
|
|
@@ -477,52 +427,23 @@ export async function runMaestroCompare(
|
|
|
477
427
|
)
|
|
478
428
|
|
|
479
429
|
// 3. pair and diff
|
|
480
|
-
const
|
|
481
|
-
? fs
|
|
482
|
-
.readdirSync(nativeOut)
|
|
483
|
-
.map((d) => path.join(nativeOut, d))
|
|
484
|
-
.filter((d) => fs.statSync(d).isDirectory())
|
|
485
|
-
.sort()
|
|
486
|
-
.pop()
|
|
487
|
-
: undefined
|
|
488
|
-
const nativeOutputs = new Map<string, Array<{ dir: string; commands: unknown }>>()
|
|
489
|
-
for (const entry of nativeRun
|
|
490
|
-
? fs.readdirSync(nativeRun, { withFileTypes: true })
|
|
491
|
-
: []) {
|
|
492
|
-
if (!entry.isDirectory()) continue
|
|
493
|
-
const dir = path.join(nativeRun!, entry.name)
|
|
494
|
-
const commands = readJson(path.join(dir, 'commands.json'))
|
|
495
|
-
if (!Array.isArray(commands)) continue
|
|
496
|
-
// display names are not paths: maestro replaces slashes and suffixes collisions.
|
|
497
|
-
// the top-level bookkeeping retains the original flow identity.
|
|
498
|
-
let name: string | undefined
|
|
499
|
-
let fileStem: string | undefined
|
|
500
|
-
for (const command of commands) {
|
|
501
|
-
if (command?.metadata?.depth !== 0) continue
|
|
502
|
-
const config = command?.command?.applyConfigurationCommand?.config
|
|
503
|
-
if (typeof config?.name === 'string') name ??= config.name
|
|
504
|
-
const env = command?.command?.defineVariablesCommand?.env
|
|
505
|
-
if (typeof env?.MAESTRO_FILENAME === 'string') fileStem ??= env.MAESTRO_FILENAME
|
|
506
|
-
}
|
|
507
|
-
if (fileStem === undefined) continue
|
|
508
|
-
const key = JSON.stringify([name ?? fileStem, fileStem])
|
|
509
|
-
const outputs = nativeOutputs.get(key) ?? []
|
|
510
|
-
outputs.push({ dir, commands })
|
|
511
|
-
nativeOutputs.set(key, outputs)
|
|
512
|
-
}
|
|
430
|
+
const { nativeOutputs, flatShots } = discoverNativeOutputs(nativeOut)
|
|
513
431
|
const imagesDir = path.join(out, 'images')
|
|
514
432
|
const flows: CompareFlow[] = []
|
|
515
433
|
for (const [i, flow] of instrumented.entries()) {
|
|
516
434
|
const fileStem = path.basename(flow.copy).replace(/\.(ya?ml)$/i, '')
|
|
517
|
-
|
|
518
|
-
const
|
|
435
|
+
// two outputs for one identity cannot be told apart: neither is used
|
|
436
|
+
const candidates = nativeOutputs.get(JSON.stringify([flow.name, fileStem])) ?? []
|
|
437
|
+
const nativeOutput = candidates.length === 1 ? candidates[0] : undefined
|
|
519
438
|
const nativeRan = Boolean(nativeOutput)
|
|
520
439
|
const peachResult = peachResults.get(path.resolve(flow.copy))
|
|
521
440
|
const peachDir = peachResult?.outputDir
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
441
|
+
const nativeFailure = nativeFlowVerdict(
|
|
442
|
+
nativeVerdicts,
|
|
443
|
+
flow.name,
|
|
444
|
+
fileStem,
|
|
445
|
+
instrumented.filter((f) => f.name === flow.name).length === 1,
|
|
446
|
+
)
|
|
526
447
|
const peachRan = Boolean(
|
|
527
448
|
peachDir && fs.existsSync(path.join(peachDir, 'commands.json')),
|
|
528
449
|
)
|
|
@@ -546,9 +467,12 @@ export async function runMaestroCompare(
|
|
|
546
467
|
]
|
|
547
468
|
const screens = []
|
|
548
469
|
for (const capture of flow.captures) {
|
|
549
|
-
const nativePng =
|
|
550
|
-
|
|
551
|
-
|
|
470
|
+
const nativePng =
|
|
471
|
+
nativeOutput?.shotDir &&
|
|
472
|
+
(nativeOutput.shotDir !== flatShots ||
|
|
473
|
+
nativeRecordsScreenshot(nativeOutput.commands, capture.name))
|
|
474
|
+
? path.join(nativeOutput.shotDir, `${capture.name}.png`)
|
|
475
|
+
: ''
|
|
552
476
|
const peachPng = peachDir
|
|
553
477
|
? path.join(peachDir, 'screenshots', `${capture.name}.png`)
|
|
554
478
|
: ''
|
|
@@ -589,7 +513,9 @@ export async function runMaestroCompare(
|
|
|
589
513
|
nativeRan
|
|
590
514
|
? []
|
|
591
515
|
: [
|
|
592
|
-
|
|
516
|
+
candidates.length > 1
|
|
517
|
+
? `maestro wrote ${candidates.length} outputs for this flow identity; they cannot be told apart`
|
|
518
|
+
: `maestro produced no output for this flow (exit ${nativeExit}); see ios.log`,
|
|
593
519
|
],
|
|
594
520
|
nativeFailure,
|
|
595
521
|
),
|
package/cli/help-core.ts
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
DEFAULT_SOOTSIM_BRIDGE_PORT,
|
|
9
9
|
DEFAULT_SOOTSIM_BRIDGE_URL,
|
|
10
10
|
} from '../src/bridge-constants'
|
|
11
|
-
import { formatFlagHelp } from '../src/settings-flags.ts'
|
|
12
11
|
import {
|
|
13
12
|
getRnxCommandAvailability,
|
|
14
13
|
getRnxFirstPositional,
|
|
@@ -100,7 +99,7 @@ export function renderRnxHelp(options: RnxHelpOptions): string {
|
|
|
100
99
|
// backend; the public cli runs the node backend and never sees them.
|
|
101
100
|
const factory = options.backend === 'browser'
|
|
102
101
|
if (!command) {
|
|
103
|
-
const index = renderCliIndexHelp(HELP_CONTEXT
|
|
102
|
+
const index = renderCliIndexHelp(HELP_CONTEXT).trimEnd()
|
|
104
103
|
if (!factory) return index
|
|
105
104
|
return `${index}
|
|
106
105
|
|
|
@@ -116,7 +115,7 @@ ${renderRootAvailability(options.backend)}`
|
|
|
116
115
|
if (factory && (command === 'web' || command === 'ios' || command === 'android')) {
|
|
117
116
|
body = renderPreviewHelp(command)
|
|
118
117
|
} else if (options.group === command && !options.prefer) {
|
|
119
|
-
body = renderCliGroupHelp(command, HELP_CONTEXT
|
|
118
|
+
body = renderCliGroupHelp(command, HELP_CONTEXT)
|
|
120
119
|
} else {
|
|
121
120
|
const subVerb = getRnxFirstPositional(commandArgs)
|
|
122
121
|
const grouping = new Set(['do', 'get', 'debug', 'wait'])
|
|
@@ -126,7 +125,7 @@ ${renderRootAvailability(options.backend)}`
|
|
|
126
125
|
group: options.group,
|
|
127
126
|
})
|
|
128
127
|
if (!body && grouping.has(command)) {
|
|
129
|
-
body = renderCliGroupHelp(command, HELP_CONTEXT
|
|
128
|
+
body = renderCliGroupHelp(command, HELP_CONTEXT)
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
131
|
|