@e2edev/agent-device 0.2.0 → 0.3.0
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/README.md +15 -10
- package/dist/device.d.ts +3 -3
- package/dist/device.d.ts.map +1 -1
- package/dist/device.js +24 -2
- package/dist/device.js.map +1 -1
- package/dist/engine.d.ts +16 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/{backend.js → engine.js} +25 -14
- package/dist/engine.js.map +1 -0
- package/dist/errors.d.ts +3 -3
- package/dist/errors.js +12 -12
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/locate.d.ts +1 -1
- package/dist/locate.d.ts.map +1 -1
- package/dist/locate.js +7 -4
- package/dist/locate.js.map +1 -1
- package/dist/nodes.d.ts +2 -2
- package/dist/nodes.d.ts.map +1 -1
- package/dist/png.d.ts +1 -19
- package/dist/png.d.ts.map +1 -1
- package/dist/png.js +15 -162
- package/dist/png.js.map +1 -1
- package/dist/selector.js +2 -2
- package/dist/selector.js.map +1 -1
- package/dist/support.d.ts +7 -23
- package/dist/support.d.ts.map +1 -1
- package/dist/support.js +7 -46
- package/dist/support.js.map +1 -1
- package/dist/surface.d.ts +19 -15
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +45 -36
- package/dist/surface.js.map +1 -1
- package/dist/tools.d.ts +8 -8
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +28 -29
- package/dist/tools.js.map +1 -1
- package/package.json +7 -5
- package/dist/backend.d.ts +0 -16
- package/dist/backend.d.ts.map +0 -1
- package/dist/backend.js.map +0 -1
package/dist/png.js
CHANGED
|
@@ -1,172 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const SIGNATURE = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];
|
|
9
|
-
function paeth(a, b, c) {
|
|
10
|
-
const p = a + b - c;
|
|
11
|
-
const pa = Math.abs(p - a);
|
|
12
|
-
const pb = Math.abs(p - b);
|
|
13
|
-
const pc = Math.abs(p - c);
|
|
14
|
-
if (pa <= pb && pa <= pc)
|
|
15
|
-
return a;
|
|
16
|
-
return pb <= pc ? b : c;
|
|
17
|
-
}
|
|
18
|
-
/** Decodes PNG bytes into mutable samples; throws for formats this codec does not read. */
|
|
19
|
-
export function decodePng(bytes) {
|
|
20
|
-
if (bytes.byteLength < 8 || !SIGNATURE.every((byte, index) => bytes[index] === byte)) {
|
|
21
|
-
throw new Error('not a PNG');
|
|
22
|
-
}
|
|
23
|
-
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
24
|
-
let offset = 8;
|
|
25
|
-
let width = 0;
|
|
26
|
-
let height = 0;
|
|
27
|
-
let channels = 0;
|
|
28
|
-
const idat = [];
|
|
29
|
-
while (offset + 8 <= bytes.byteLength) {
|
|
30
|
-
const length = view.getUint32(offset);
|
|
31
|
-
const type = String.fromCharCode(...bytes.subarray(offset + 4, offset + 8));
|
|
32
|
-
const data = bytes.subarray(offset + 8, offset + 8 + length);
|
|
33
|
-
if (type === 'IHDR') {
|
|
34
|
-
width = view.getUint32(offset + 8);
|
|
35
|
-
height = view.getUint32(offset + 12);
|
|
36
|
-
const bitDepth = data[8];
|
|
37
|
-
const colorType = data[9];
|
|
38
|
-
const interlace = data[12];
|
|
39
|
-
if (bitDepth !== 8 || interlace !== 0 || (colorType !== 2 && colorType !== 6)) {
|
|
40
|
-
throw new Error(`unsupported PNG: depth ${String(bitDepth)} type ${String(colorType)}`);
|
|
41
|
-
}
|
|
42
|
-
channels = colorType === 6 ? 4 : 3;
|
|
43
|
-
}
|
|
44
|
-
else if (type === 'IDAT') {
|
|
45
|
-
idat.push(data);
|
|
46
|
-
}
|
|
47
|
-
else if (type === 'IEND') {
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
offset += 12 + length;
|
|
51
|
-
}
|
|
52
|
-
if (channels === 0)
|
|
53
|
-
throw new Error('PNG without IHDR');
|
|
54
|
-
const raw = inflateSync(Buffer.concat(idat));
|
|
55
|
-
const stride = width * channels;
|
|
56
|
-
const pixels = new Uint8Array(stride * height);
|
|
57
|
-
for (let y = 0; y < height; y += 1) {
|
|
58
|
-
const filter = raw[y * (stride + 1)];
|
|
59
|
-
const row = raw.subarray(y * (stride + 1) + 1, (y + 1) * (stride + 1));
|
|
60
|
-
const out = pixels.subarray(y * stride, (y + 1) * stride);
|
|
61
|
-
const prior = y === 0 ? new Uint8Array(stride) : pixels.subarray((y - 1) * stride, y * stride);
|
|
62
|
-
for (let i = 0; i < stride; i += 1) {
|
|
63
|
-
const left = i >= channels ? out[i - channels] : 0;
|
|
64
|
-
const up = prior[i];
|
|
65
|
-
const upLeft = i >= channels ? prior[i - channels] : 0;
|
|
66
|
-
const value = row[i];
|
|
67
|
-
let predicted;
|
|
68
|
-
switch (filter) {
|
|
69
|
-
case 0:
|
|
70
|
-
predicted = 0;
|
|
71
|
-
break;
|
|
72
|
-
case 1:
|
|
73
|
-
predicted = left;
|
|
74
|
-
break;
|
|
75
|
-
case 2:
|
|
76
|
-
predicted = up;
|
|
77
|
-
break;
|
|
78
|
-
case 3:
|
|
79
|
-
predicted = Math.floor((left + up) / 2);
|
|
80
|
-
break;
|
|
81
|
-
case 4:
|
|
82
|
-
predicted = paeth(left, up, upLeft);
|
|
83
|
-
break;
|
|
84
|
-
default:
|
|
85
|
-
throw new Error(`unsupported PNG filter ${String(filter)}`);
|
|
86
|
-
}
|
|
87
|
-
out[i] = (value + predicted) & 0xff;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return { width, height, channels, pixels };
|
|
91
|
-
}
|
|
92
|
-
const CRC_TABLE = new Uint32Array(256).map((_value, n) => {
|
|
93
|
-
let c = n;
|
|
94
|
-
for (let k = 0; k < 8; k += 1)
|
|
95
|
-
c = (c & 1) === 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
96
|
-
return c >>> 0;
|
|
97
|
-
});
|
|
98
|
-
function crc32(bytes) {
|
|
99
|
-
let crc = 0xffffffff;
|
|
100
|
-
for (const byte of bytes)
|
|
101
|
-
crc = CRC_TABLE[(crc ^ byte) & 0xff] ^ (crc >>> 8);
|
|
102
|
-
return (crc ^ 0xffffffff) >>> 0;
|
|
103
|
-
}
|
|
104
|
-
function chunk(type, data) {
|
|
105
|
-
const out = new Uint8Array(12 + data.byteLength);
|
|
106
|
-
const view = new DataView(out.buffer);
|
|
107
|
-
view.setUint32(0, data.byteLength);
|
|
108
|
-
const typed = new Uint8Array(4 + data.byteLength);
|
|
109
|
-
typed.set([...type].map((char) => char.charCodeAt(0)), 0);
|
|
110
|
-
typed.set(data, 4);
|
|
111
|
-
out.set(typed, 4);
|
|
112
|
-
view.setUint32(8 + data.byteLength, crc32(typed));
|
|
113
|
-
return out;
|
|
114
|
-
}
|
|
115
|
-
/** Encodes samples as a PNG with unfiltered rows; size is not the goal, fidelity is. */
|
|
116
|
-
export function encodePng(image) {
|
|
117
|
-
const { width, height, channels, pixels } = image;
|
|
118
|
-
const stride = width * channels;
|
|
119
|
-
const raw = new Uint8Array((stride + 1) * height);
|
|
120
|
-
for (let y = 0; y < height; y += 1) {
|
|
121
|
-
raw[y * (stride + 1)] = 0;
|
|
122
|
-
raw.set(pixels.subarray(y * stride, (y + 1) * stride), y * (stride + 1) + 1);
|
|
123
|
-
}
|
|
124
|
-
const ihdr = new Uint8Array(13);
|
|
125
|
-
const view = new DataView(ihdr.buffer);
|
|
126
|
-
view.setUint32(0, width);
|
|
127
|
-
view.setUint32(4, height);
|
|
128
|
-
ihdr[8] = 8;
|
|
129
|
-
ihdr[9] = channels === 4 ? 6 : 2;
|
|
130
|
-
ihdr[10] = 0;
|
|
131
|
-
ihdr[11] = 0;
|
|
132
|
-
ihdr[12] = 0;
|
|
133
|
-
return Buffer.concat([
|
|
134
|
-
Uint8Array.from(SIGNATURE),
|
|
135
|
-
chunk('IHDR', ihdr),
|
|
136
|
-
chunk('IDAT', deflateSync(raw)),
|
|
137
|
-
chunk('IEND', new Uint8Array(0)),
|
|
138
|
-
]);
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Paints every rect opaque black, in image pixels. Rects are clamped to the
|
|
142
|
-
* image; a rect entirely outside it masks nothing but still counts as
|
|
143
|
-
* handled, because the field it covers is not on screen either.
|
|
144
|
-
*/
|
|
145
|
-
function maskRects(image, rects) {
|
|
146
|
-
const { width, height, channels, pixels } = image;
|
|
1
|
+
/** Screenshot masking policy; PNG parsing and encoding belong to pngjs. */
|
|
2
|
+
import { PNG } from 'pngjs';
|
|
3
|
+
/** Paints each requested rectangle opaque black, rounding outward and clipping to the image. */
|
|
4
|
+
export function maskPng(bytes, rects) {
|
|
5
|
+
if (rects.length === 0)
|
|
6
|
+
return bytes;
|
|
7
|
+
const image = PNG.sync.read(Buffer.from(bytes));
|
|
147
8
|
for (const rect of rects) {
|
|
148
9
|
const x0 = Math.max(0, Math.floor(rect.x));
|
|
149
10
|
const y0 = Math.max(0, Math.floor(rect.y));
|
|
150
|
-
const x1 = Math.min(width, Math.ceil(rect.x + rect.width));
|
|
151
|
-
const y1 = Math.min(height, Math.ceil(rect.y + rect.height));
|
|
11
|
+
const x1 = Math.min(image.width, Math.ceil(rect.x + rect.width));
|
|
12
|
+
const y1 = Math.min(image.height, Math.ceil(rect.y + rect.height));
|
|
152
13
|
for (let y = y0; y < y1; y += 1) {
|
|
153
14
|
for (let x = x0; x < x1; x += 1) {
|
|
154
|
-
const at = (y * width + x) *
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
pixels[at + 3] = 255;
|
|
15
|
+
const at = (y * image.width + x) * 4;
|
|
16
|
+
image.data[at] = 0;
|
|
17
|
+
image.data[at + 1] = 0;
|
|
18
|
+
image.data[at + 2] = 0;
|
|
19
|
+
image.data[at + 3] = 255;
|
|
160
20
|
}
|
|
161
21
|
}
|
|
162
22
|
}
|
|
163
|
-
|
|
164
|
-
/** Decodes, masks, and re-encodes in one step. */
|
|
165
|
-
export function maskPng(bytes, rects) {
|
|
166
|
-
if (rects.length === 0)
|
|
167
|
-
return bytes;
|
|
168
|
-
const image = decodePng(bytes);
|
|
169
|
-
maskRects(image, rects);
|
|
170
|
-
return encodePng(image);
|
|
23
|
+
return PNG.sync.write(image);
|
|
171
24
|
}
|
|
172
25
|
//# sourceMappingURL=png.js.map
|
package/dist/png.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"png.js","sourceRoot":"","sources":["../src/png.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"png.js","sourceRoot":"","sources":["../src/png.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5B,gGAAgG;AAChG,MAAM,UAAU,OAAO,CAAC,KAAiB,EAAE,KAAsB;IAC/D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACrC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACnE,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;gBACrC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;gBACnB,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;gBACvB,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;gBACvB,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/selector.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* runs against the projected snapshot, one immediate pass, every match returned.
|
|
7
7
|
*/
|
|
8
8
|
import { parseSelectorChain } from 'agent-device/selectors';
|
|
9
|
-
import {
|
|
9
|
+
import { EngineError } from '@e2edev/e2e/engine';
|
|
10
10
|
import { normalizeKind } from './nodes.js';
|
|
11
11
|
import { message } from './errors.js';
|
|
12
12
|
/**
|
|
@@ -21,7 +21,7 @@ export function compileSelector(raw) {
|
|
|
21
21
|
chain = parseSelectorChain(raw);
|
|
22
22
|
}
|
|
23
23
|
catch (cause) {
|
|
24
|
-
throw new
|
|
24
|
+
throw new EngineError('ENGINE_FAILURE', `invalid agent-device selector ${JSON.stringify(raw)}: ${message(cause)}`, {
|
|
25
25
|
retryable: false,
|
|
26
26
|
cause,
|
|
27
27
|
});
|
package/dist/selector.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selector.js","sourceRoot":"","sources":["../src/selector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"selector.js","sourceRoot":"","sources":["../src/selector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAsB,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAStC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,IAAI,KAA4C,CAAC;IACjD,IAAI,CAAC;QACH,KAAK,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,WAAW,CAAC,gBAAgB,EAAE,iCAAiC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE;YACjH,SAAS,EAAE,KAAK;YAChB,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IACD,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,KAAK,MAAM,WAAW,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;YAC1C,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM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ACZ,OAAO,CAAC,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzD,KAAK,UAAU;YACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,KAAK,KAAK,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7D;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC"}
|
package/dist/support.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** Shared helpers for the agent-device
|
|
2
|
-
import {
|
|
1
|
+
/** Shared helpers for the agent-device engine: abort racing, filenames, PNG headers, gestures, path anchors. */
|
|
2
|
+
import { EngineError, type Momentum, type ScrollDirection } from '@e2edev/e2e/engine';
|
|
3
3
|
export interface Point {
|
|
4
4
|
readonly x: number;
|
|
5
5
|
readonly y: number;
|
|
@@ -10,26 +10,10 @@ export interface Rect {
|
|
|
10
10
|
readonly width: number;
|
|
11
11
|
readonly height: number;
|
|
12
12
|
}
|
|
13
|
-
export declare function cancelled(text: string):
|
|
14
|
-
export declare function invalidState(text: string):
|
|
15
|
-
export declare function notActionable(text: string):
|
|
16
|
-
export declare function unsupported(text: string):
|
|
17
|
-
/**
|
|
18
|
-
* Awaits `promise` unless `signal` aborts first, in which case the wait ends
|
|
19
|
-
* with `CANCELLED`. agent-device commands take no signal, so the in-flight
|
|
20
|
-
* call is not stopped; its eventual settlement is absorbed instead of
|
|
21
|
-
* surfacing as an unhandled rejection.
|
|
22
|
-
*/
|
|
23
|
-
export declare function raceAbort<T>(promise: Promise<T>, signal: AbortSignal, label: string): Promise<T>;
|
|
24
|
-
/**
|
|
25
|
-
* Best-effort cleanup wait: resolves when `promise` settles, when `signal`
|
|
26
|
-
* aborts, or when `timeoutMs` elapses, whichever comes first. Cleanup never
|
|
27
|
-
* throws through here; a close that outlives its budget is abandoned.
|
|
28
|
-
*/
|
|
29
|
-
export declare function withinCleanupBudget(promise: Promise<unknown>, budget: {
|
|
30
|
-
readonly signal: AbortSignal;
|
|
31
|
-
readonly timeoutMs: number;
|
|
32
|
-
}): Promise<void>;
|
|
13
|
+
export declare function cancelled(text: string): EngineError;
|
|
14
|
+
export declare function invalidState(text: string): EngineError;
|
|
15
|
+
export declare function notActionable(text: string): EngineError;
|
|
16
|
+
export declare function unsupported(text: string): EngineError;
|
|
33
17
|
/** Constrains a caller-supplied artifact label to a safe filename. */
|
|
34
18
|
export declare function sanitizeFilename(name: string): string;
|
|
35
19
|
/** Reads the dimensions out of a PNG's IHDR chunk; undefined for anything else. */
|
|
@@ -49,7 +33,7 @@ export declare function swipeWithin(rect: Rect, direction: ScrollDirection, mome
|
|
|
49
33
|
/**
|
|
50
34
|
* The location a device surface reports through `url`. A simulator has no
|
|
51
35
|
* address bar, but the trace cache anchors every recorded step on a path and
|
|
52
|
-
* refuses to write a trace for a surface without one, so the
|
|
36
|
+
* refuses to write a trace for a surface without one, so the engine mints
|
|
53
37
|
* one: `app://device/<app>/<screen title>`. The cache compares pathnames
|
|
54
38
|
* only, so the app identity lives in the path, not the host: two apps with a
|
|
55
39
|
* screen called "General" must not share an anchor. `new URL(...)` parses
|
package/dist/support.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../src/support.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../src/support.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAEhH,OAAO,EAAE,WAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEtF,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAEnD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAEtD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAEvD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAErD;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAID,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAO3F;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,eAAe,EAC1B,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAC7B;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,KAAK,CAAA;CAAE,CAe5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAIpF"}
|
package/dist/support.js
CHANGED
|
@@ -1,55 +1,16 @@
|
|
|
1
|
-
/** Shared helpers for the agent-device
|
|
2
|
-
import {
|
|
1
|
+
/** Shared helpers for the agent-device engine: abort racing, filenames, PNG headers, gestures, path anchors. */
|
|
2
|
+
import { EngineError } from '@e2edev/e2e/engine';
|
|
3
3
|
export function cancelled(text) {
|
|
4
|
-
return new
|
|
4
|
+
return new EngineError('CANCELLED', text, { retryable: false });
|
|
5
5
|
}
|
|
6
6
|
export function invalidState(text) {
|
|
7
|
-
return new
|
|
7
|
+
return new EngineError('INVALID_STATE', text, { retryable: false });
|
|
8
8
|
}
|
|
9
9
|
export function notActionable(text) {
|
|
10
|
-
return new
|
|
10
|
+
return new EngineError('NOT_ACTIONABLE', text, { retryable: false });
|
|
11
11
|
}
|
|
12
12
|
export function unsupported(text) {
|
|
13
|
-
return new
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Awaits `promise` unless `signal` aborts first, in which case the wait ends
|
|
17
|
-
* with `CANCELLED`. agent-device commands take no signal, so the in-flight
|
|
18
|
-
* call is not stopped; its eventual settlement is absorbed instead of
|
|
19
|
-
* surfacing as an unhandled rejection.
|
|
20
|
-
*/
|
|
21
|
-
export function raceAbort(promise, signal, label) {
|
|
22
|
-
if (signal.aborted) {
|
|
23
|
-
promise.catch(() => undefined);
|
|
24
|
-
return Promise.reject(cancelled(`${label} cancelled`));
|
|
25
|
-
}
|
|
26
|
-
return new Promise((resolve, reject) => {
|
|
27
|
-
const onAbort = () => {
|
|
28
|
-
promise.catch(() => undefined);
|
|
29
|
-
reject(cancelled(`${label} cancelled`));
|
|
30
|
-
};
|
|
31
|
-
signal.addEventListener('abort', onAbort, { once: true });
|
|
32
|
-
promise.then(resolve, reject).finally(() => {
|
|
33
|
-
signal.removeEventListener('abort', onAbort);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Best-effort cleanup wait: resolves when `promise` settles, when `signal`
|
|
39
|
-
* aborts, or when `timeoutMs` elapses, whichever comes first. Cleanup never
|
|
40
|
-
* throws through here; a close that outlives its budget is abandoned.
|
|
41
|
-
*/
|
|
42
|
-
export function withinCleanupBudget(promise, budget) {
|
|
43
|
-
return new Promise((resolve) => {
|
|
44
|
-
const settle = () => {
|
|
45
|
-
clearTimeout(timer);
|
|
46
|
-
budget.signal.removeEventListener('abort', settle);
|
|
47
|
-
resolve();
|
|
48
|
-
};
|
|
49
|
-
const timer = setTimeout(settle, Math.max(0, budget.timeoutMs));
|
|
50
|
-
budget.signal.addEventListener('abort', settle, { once: true });
|
|
51
|
-
promise.then(settle, settle);
|
|
52
|
-
});
|
|
13
|
+
return new EngineError('UNSUPPORTED_CAPABILITY', text, { retryable: false });
|
|
53
14
|
}
|
|
54
15
|
/** Constrains a caller-supplied artifact label to a safe filename. */
|
|
55
16
|
export function sanitizeFilename(name) {
|
|
@@ -91,7 +52,7 @@ export function swipeWithin(rect, direction, momentum) {
|
|
|
91
52
|
/**
|
|
92
53
|
* The location a device surface reports through `url`. A simulator has no
|
|
93
54
|
* address bar, but the trace cache anchors every recorded step on a path and
|
|
94
|
-
* refuses to write a trace for a surface without one, so the
|
|
55
|
+
* refuses to write a trace for a surface without one, so the engine mints
|
|
95
56
|
* one: `app://device/<app>/<screen title>`. The cache compares pathnames
|
|
96
57
|
* only, so the app identity lives in the path, not the host: two apps with a
|
|
97
58
|
* screen called "General" must not share an anchor. `new URL(...)` parses
|
package/dist/support.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support.js","sourceRoot":"","sources":["../src/support.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"support.js","sourceRoot":"","sources":["../src/support.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAEhH,OAAO,EAAE,WAAW,EAAuC,MAAM,oBAAoB,CAAC;AActF,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,IAAI,WAAW,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,WAAW,CAAC,eAAe,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,WAAW,CAAC,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E,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC;QAC5F,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC;IAC9F,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS,CAAC,GAAuB,EAAE,KAAyB;IAC1E,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,UAAU,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,IAAI,SAAS,CAAC;IACtH,MAAM,OAAO,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAChF,OAAO,gBAAgB,QAAQ,IAAI,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;AACzF,CAAC"}
|
package/dist/surface.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* agent-device's commands. The runner owns everything else.
|
|
8
8
|
*/
|
|
9
9
|
import type { createAgentDeviceClient } from 'agent-device';
|
|
10
|
-
import { type
|
|
10
|
+
import { type EngineAttemptContext, type EngineCleanupContext, type EngineInitInfo, type EngineObserveOptions, type EngineSnapshot, type LocatorAction, type LocatorExpression, type Momentum, type NodeRef, type OperationContext, type ScrollDirection, type SemanticNode } from '@e2edev/e2e/engine';
|
|
11
11
|
export type AgentDeviceClient = ReturnType<typeof createAgentDeviceClient>;
|
|
12
12
|
/** Mints the agent-device client for one session; the seam unit tests script. */
|
|
13
13
|
export type ClientFactory = (session: string) => AgentDeviceClient;
|
|
@@ -29,6 +29,14 @@ export interface AgentDeviceOptions {
|
|
|
29
29
|
* package becomes the app opened fresh at the start of every attempt.
|
|
30
30
|
*/
|
|
31
31
|
readonly appPath?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Stable identity keying trace cache and session entries; defaults to `app`,
|
|
34
|
+
* else `appPath`. Declare one when the pinned app differs per run (a build
|
|
35
|
+
* path with a version in it) so entries survive the rename.
|
|
36
|
+
*/
|
|
37
|
+
readonly identity?: string;
|
|
38
|
+
/** Report label joining the cache identity; a simulator or emulator defaults to `test`. */
|
|
39
|
+
readonly environment?: 'test' | 'staging' | 'production';
|
|
32
40
|
/** Simulator or emulator to use, by name or id; agent-device picks a booted one otherwise. */
|
|
33
41
|
readonly device?: string;
|
|
34
42
|
/**
|
|
@@ -66,6 +74,7 @@ export declare class AgentDeviceSurface {
|
|
|
66
74
|
private testIdAttribute;
|
|
67
75
|
private attempt;
|
|
68
76
|
private generation;
|
|
77
|
+
private readonly located;
|
|
69
78
|
private idCounter;
|
|
70
79
|
private appIdentity;
|
|
71
80
|
/** The app `appPath` installed at init, when no `app` option names one. */
|
|
@@ -102,10 +111,10 @@ export declare class AgentDeviceSurface {
|
|
|
102
111
|
* racing it: the launch timeout is the honest bound on a stuck device.
|
|
103
112
|
*/
|
|
104
113
|
private settleInflight;
|
|
105
|
-
init(info:
|
|
106
|
-
startAttempt(context:
|
|
107
|
-
endAttempt(_context:
|
|
108
|
-
dispose(context:
|
|
114
|
+
init(info: EngineInitInfo): Promise<void>;
|
|
115
|
+
startAttempt(context: EngineAttemptContext): Promise<void>;
|
|
116
|
+
endAttempt(_context: EngineCleanupContext): Promise<void>;
|
|
117
|
+
dispose(context: EngineCleanupContext): Promise<void>;
|
|
109
118
|
/** Opens an app in the session, remembering its identity for the path anchor. */
|
|
110
119
|
openApp(app: string, relaunch: boolean, signal: AbortSignal): Promise<void>;
|
|
111
120
|
/**
|
|
@@ -122,13 +131,8 @@ export declare class AgentDeviceSurface {
|
|
|
122
131
|
*/
|
|
123
132
|
private snapshotOrEmpty;
|
|
124
133
|
private project;
|
|
125
|
-
observe(operation: OperationContext, options?:
|
|
126
|
-
/**
|
|
127
|
-
* The located snapshot joins the current generation instead of replacing
|
|
128
|
-
* it, so an observation's ids stay valid across a `screen` query in the
|
|
129
|
-
* same step. The whole snapshot joins, not only the matches: a later action
|
|
130
|
-
* on a match may need its descendants (`controlOf`).
|
|
131
|
-
*/
|
|
134
|
+
observe(operation: OperationContext, options?: EngineObserveOptions): Promise<EngineSnapshot>;
|
|
135
|
+
/** Retains only action bindings for matches, independently of the observation generation. */
|
|
132
136
|
locate(expression: LocatorExpression, operation: OperationContext): Promise<readonly SemanticNode[]>;
|
|
133
137
|
private resolveRef;
|
|
134
138
|
private actionTarget;
|
|
@@ -140,6 +144,8 @@ export declare class AgentDeviceSurface {
|
|
|
140
144
|
* descendant with a ref is the control; a node without one is its own.
|
|
141
145
|
*/
|
|
142
146
|
private controlOf;
|
|
147
|
+
/** Copies the fields actions use and pre-resolves a toggle's inner control. */
|
|
148
|
+
private bind;
|
|
143
149
|
perform(ref: NodeRef, action: LocatorAction, operation: OperationContext): Promise<void>;
|
|
144
150
|
/**
|
|
145
151
|
* Keys on a touch surface: Enter submits through the soft keyboard, a
|
|
@@ -161,15 +167,13 @@ export declare class AgentDeviceSurface {
|
|
|
161
167
|
* written at all.
|
|
162
168
|
*/
|
|
163
169
|
screenshot(label: string | undefined, operation: OperationContext): Promise<string>;
|
|
164
|
-
/** Redacted screen pixels as a PNG, for the agent's screenshot tool. */
|
|
165
|
-
screenshotBytes(signal?: AbortSignal): Promise<Uint8Array>;
|
|
166
170
|
/** Raw device pixels; the caller owns redaction. */
|
|
167
171
|
private rawScreenshot;
|
|
168
172
|
/**
|
|
169
173
|
* Screenshot with every secure node on the current screen painted over.
|
|
170
174
|
* Observes first so the regions describe the screen the pixels show;
|
|
171
175
|
* throws when a secure field cannot be covered, because an image that may
|
|
172
|
-
* hold a credential must not leave the
|
|
176
|
+
* hold a credential must not leave the engine.
|
|
173
177
|
*/
|
|
174
178
|
private maskedScreenshot;
|
|
175
179
|
/**
|
package/dist/surface.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../src/surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../src/surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,OAAO,EAEZ,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAgB5B,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE3E,iFAAiF;AACjF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,iBAAiB,CAAC;AAEnE,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,SAAS,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IACjC,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,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