|
1 | 1 | import type { |
2 | | - IosAcquisitionResidue, |
3 | 2 | IosRunnerQualityPayloadFacts, |
4 | 3 | IosSnapshotInput, |
5 | 4 | IosViewportEvidence, |
6 | 5 | } from '@agent-device/contracts/ios-snapshot'; |
7 | 6 | import type { SnapshotOptions } from '@agent-device/contracts/interactor-types'; |
8 | 7 | import { normalizeType } from '@agent-device/contracts/snapshot'; |
9 | 8 | import { |
10 | | - publishIosSnapshot, |
11 | 9 | IosSnapshotEngineError, |
| 10 | + presentIosRunnerSnapshot, |
12 | 11 | } from '@agent-device/capture-kit/ios-snapshot-engine'; |
13 | 12 | import { readSnapshotQualityVerdict } from '@agent-device/capture-kit/snapshot-quality-verdict'; |
14 | 13 | import { |
@@ -82,12 +81,12 @@ export function presentAppleRunnerSnapshot( |
82 | 81 | viewport, |
83 | 82 | hittability: { kind: 'available' }, |
84 | 83 | lineage: { targetId: deviceId }, |
85 | | - residue: runnerResidue(result), |
| 84 | + residue: [], |
86 | 85 | }, |
87 | 86 | }; |
88 | 87 |
|
89 | 88 | try { |
90 | | - return [...publishIosSnapshot(input, request).payload.nodes]; |
| 89 | + return presentIosRunnerSnapshot(input, request).nodes; |
91 | 90 | } catch (error) { |
92 | 91 | throwSnapshotEngineError(error); |
93 | 92 | } |
@@ -152,21 +151,6 @@ function rectArea(rect: RawSnapshotNode['rect']): number { |
152 | 151 | return rect ? rect.width * rect.height : 0; |
153 | 152 | } |
154 | 153 |
|
155 | | -function runnerResidue(result: AppleRunnerSnapshotResult): IosAcquisitionResidue[] { |
156 | | - const residue: IosAcquisitionResidue[] = []; |
157 | | - if (result.truncated === true || result.qualityPayload?.truncated === true) { |
158 | | - residue.push({ kind: 'truncated', dimension: 'payload' }); |
159 | | - } |
160 | | - if (result.quality?.effectiveDepth !== undefined) { |
161 | | - residue.push({ |
162 | | - kind: 'truncated', |
163 | | - dimension: 'depth', |
164 | | - limit: result.quality.effectiveDepth, |
165 | | - }); |
166 | | - } |
167 | | - return residue; |
168 | | -} |
169 | | - |
170 | 154 | function isRecord(value: unknown): value is Record<string, unknown> { |
171 | 155 | return typeof value === 'object' && value !== null && !Array.isArray(value); |
172 | 156 | } |
|
0 commit comments