@opensteer/engine-abp 0.7.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/LICENSE +21 -0
- package/README.md +10 -0
- package/dist/index.cjs +6538 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1143 -0
- package/dist/index.d.ts +1143 -0
- package/dist/index.js +6530 -0
- package/dist/index.js.map +1 -0
- package/package.json +62 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1143 @@
|
|
|
1
|
+
declare const brandSymbol: unique symbol;
|
|
2
|
+
type Brand<Value, Name extends string> = Value & {
|
|
3
|
+
readonly [brandSymbol]: Name;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
type SessionRef = Brand<string, "SessionRef">;
|
|
7
|
+
type PageRef = Brand<string, "PageRef">;
|
|
8
|
+
type FrameRef = Brand<string, "FrameRef">;
|
|
9
|
+
type DocumentRef = Brand<string, "DocumentRef">;
|
|
10
|
+
type NodeRef = Brand<string, "NodeRef">;
|
|
11
|
+
type NetworkRequestId = Brand<string, "NetworkRequestId">;
|
|
12
|
+
type DownloadRef = Brand<string, "DownloadRef">;
|
|
13
|
+
type DialogRef = Brand<string, "DialogRef">;
|
|
14
|
+
type ChooserRef = Brand<string, "ChooserRef">;
|
|
15
|
+
type WorkerRef = Brand<string, "WorkerRef">;
|
|
16
|
+
type DocumentEpoch = Brand<number, "DocumentEpoch">;
|
|
17
|
+
interface NodeLocator {
|
|
18
|
+
readonly documentRef: DocumentRef;
|
|
19
|
+
readonly documentEpoch: DocumentEpoch;
|
|
20
|
+
readonly nodeRef: NodeRef;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type PageLifecycleState = "opening" | "open" | "closing" | "closed" | "crashed";
|
|
24
|
+
interface PageInfo {
|
|
25
|
+
readonly pageRef: PageRef;
|
|
26
|
+
readonly sessionRef: SessionRef;
|
|
27
|
+
readonly openerPageRef?: PageRef;
|
|
28
|
+
readonly url: string;
|
|
29
|
+
readonly title: string;
|
|
30
|
+
readonly lifecycleState: PageLifecycleState;
|
|
31
|
+
}
|
|
32
|
+
interface FrameInfo {
|
|
33
|
+
readonly frameRef: FrameRef;
|
|
34
|
+
readonly pageRef: PageRef;
|
|
35
|
+
readonly parentFrameRef?: FrameRef;
|
|
36
|
+
readonly documentRef: DocumentRef;
|
|
37
|
+
readonly documentEpoch: DocumentEpoch;
|
|
38
|
+
readonly url: string;
|
|
39
|
+
readonly name?: string;
|
|
40
|
+
readonly isMainFrame: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface Point {
|
|
44
|
+
readonly x: number;
|
|
45
|
+
readonly y: number;
|
|
46
|
+
}
|
|
47
|
+
interface Size {
|
|
48
|
+
readonly width: number;
|
|
49
|
+
readonly height: number;
|
|
50
|
+
}
|
|
51
|
+
interface Rect {
|
|
52
|
+
readonly x: number;
|
|
53
|
+
readonly y: number;
|
|
54
|
+
readonly width: number;
|
|
55
|
+
readonly height: number;
|
|
56
|
+
}
|
|
57
|
+
type Quad = readonly [Point, Point, Point, Point];
|
|
58
|
+
interface ScrollOffset {
|
|
59
|
+
readonly x: number;
|
|
60
|
+
readonly y: number;
|
|
61
|
+
}
|
|
62
|
+
type CoordinateSpace = "document-css" | "layout-viewport-css" | "visual-viewport-css" | "computer-display-css" | "window" | "screen" | "device-pixel";
|
|
63
|
+
interface LayoutViewport {
|
|
64
|
+
readonly origin: Point;
|
|
65
|
+
readonly size: Size;
|
|
66
|
+
}
|
|
67
|
+
interface VisualViewport {
|
|
68
|
+
readonly origin: Point;
|
|
69
|
+
readonly offsetWithinLayoutViewport: ScrollOffset;
|
|
70
|
+
readonly size: Size;
|
|
71
|
+
}
|
|
72
|
+
type DevicePixelRatio = Brand<number, "DevicePixelRatio">;
|
|
73
|
+
type PageScaleFactor = Brand<number, "PageScaleFactor">;
|
|
74
|
+
type PageZoomFactor = Brand<number, "PageZoomFactor">;
|
|
75
|
+
interface ViewportMetrics {
|
|
76
|
+
readonly layoutViewport: LayoutViewport;
|
|
77
|
+
readonly visualViewport: VisualViewport;
|
|
78
|
+
readonly scrollOffset: ScrollOffset;
|
|
79
|
+
readonly contentSize: Size;
|
|
80
|
+
readonly devicePixelRatio: DevicePixelRatio;
|
|
81
|
+
readonly pageScaleFactor: PageScaleFactor;
|
|
82
|
+
readonly pageZoomFactor: PageZoomFactor;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface HeaderEntry {
|
|
86
|
+
readonly name: string;
|
|
87
|
+
readonly value: string;
|
|
88
|
+
}
|
|
89
|
+
type BodyPayloadEncoding = "identity" | "base64" | "gzip" | "deflate" | "brotli" | "unknown";
|
|
90
|
+
interface BodyPayload {
|
|
91
|
+
readonly bytes: Uint8Array;
|
|
92
|
+
readonly encoding: BodyPayloadEncoding;
|
|
93
|
+
readonly mimeType?: string;
|
|
94
|
+
readonly charset?: string;
|
|
95
|
+
readonly truncated: boolean;
|
|
96
|
+
readonly capturedByteLength: number;
|
|
97
|
+
readonly originalByteLength?: number;
|
|
98
|
+
}
|
|
99
|
+
type NetworkCaptureState = "pending" | "complete" | "failed" | "skipped";
|
|
100
|
+
type NetworkRecordKind = "http" | "websocket" | "event-stream";
|
|
101
|
+
type NetworkResourceType = "document" | "stylesheet" | "image" | "media" | "font" | "script" | "fetch" | "xhr" | "websocket" | "event-stream" | "manifest" | "texttrack" | "beacon" | "ping" | "preflight" | "other";
|
|
102
|
+
type NetworkInitiatorType = "parser" | "script" | "preload" | "redirect" | "user" | "service-worker" | "other";
|
|
103
|
+
interface NetworkInitiator {
|
|
104
|
+
readonly type: NetworkInitiatorType;
|
|
105
|
+
readonly url?: string;
|
|
106
|
+
readonly lineNumber?: number;
|
|
107
|
+
readonly columnNumber?: number;
|
|
108
|
+
readonly requestId?: NetworkRequestId;
|
|
109
|
+
readonly stackTrace?: readonly string[];
|
|
110
|
+
}
|
|
111
|
+
interface NetworkTiming {
|
|
112
|
+
readonly requestStartMs?: number;
|
|
113
|
+
readonly dnsStartMs?: number;
|
|
114
|
+
readonly dnsEndMs?: number;
|
|
115
|
+
readonly connectStartMs?: number;
|
|
116
|
+
readonly connectEndMs?: number;
|
|
117
|
+
readonly sslStartMs?: number;
|
|
118
|
+
readonly sslEndMs?: number;
|
|
119
|
+
readonly requestSentMs?: number;
|
|
120
|
+
readonly responseStartMs?: number;
|
|
121
|
+
readonly responseEndMs?: number;
|
|
122
|
+
readonly workerStartMs?: number;
|
|
123
|
+
readonly workerReadyMs?: number;
|
|
124
|
+
}
|
|
125
|
+
interface NetworkTransferSizes {
|
|
126
|
+
readonly requestHeadersBytes?: number;
|
|
127
|
+
readonly responseHeadersBytes?: number;
|
|
128
|
+
readonly encodedBodyBytes?: number;
|
|
129
|
+
readonly decodedBodyBytes?: number;
|
|
130
|
+
readonly transferSizeBytes?: number;
|
|
131
|
+
}
|
|
132
|
+
interface NetworkSourceMetadata {
|
|
133
|
+
readonly protocol?: string;
|
|
134
|
+
readonly remoteAddress?: {
|
|
135
|
+
readonly ip?: string;
|
|
136
|
+
readonly port?: number;
|
|
137
|
+
};
|
|
138
|
+
readonly fromServiceWorker?: boolean;
|
|
139
|
+
readonly fromDiskCache?: boolean;
|
|
140
|
+
readonly fromMemoryCache?: boolean;
|
|
141
|
+
readonly workerRef?: WorkerRef;
|
|
142
|
+
}
|
|
143
|
+
interface NetworkRecord {
|
|
144
|
+
readonly kind: NetworkRecordKind;
|
|
145
|
+
readonly requestId: NetworkRequestId;
|
|
146
|
+
readonly sessionRef: SessionRef;
|
|
147
|
+
readonly pageRef?: PageRef;
|
|
148
|
+
readonly frameRef?: FrameRef;
|
|
149
|
+
readonly documentRef?: DocumentRef;
|
|
150
|
+
readonly method: string;
|
|
151
|
+
readonly url: string;
|
|
152
|
+
readonly requestHeaders: readonly HeaderEntry[];
|
|
153
|
+
readonly responseHeaders: readonly HeaderEntry[];
|
|
154
|
+
readonly status?: number;
|
|
155
|
+
readonly statusText?: string;
|
|
156
|
+
readonly resourceType: NetworkResourceType;
|
|
157
|
+
readonly redirectFromRequestId?: NetworkRequestId;
|
|
158
|
+
readonly redirectToRequestId?: NetworkRequestId;
|
|
159
|
+
readonly navigationRequest: boolean;
|
|
160
|
+
readonly initiator?: NetworkInitiator;
|
|
161
|
+
readonly timing?: NetworkTiming;
|
|
162
|
+
readonly transfer?: NetworkTransferSizes;
|
|
163
|
+
readonly source?: NetworkSourceMetadata;
|
|
164
|
+
readonly captureState: NetworkCaptureState;
|
|
165
|
+
readonly requestBodyState: NetworkCaptureState;
|
|
166
|
+
readonly responseBodyState: NetworkCaptureState;
|
|
167
|
+
readonly requestBodySkipReason?: string;
|
|
168
|
+
readonly responseBodySkipReason?: string;
|
|
169
|
+
readonly requestBodyError?: string;
|
|
170
|
+
readonly responseBodyError?: string;
|
|
171
|
+
readonly requestBody?: BodyPayload;
|
|
172
|
+
readonly responseBody?: BodyPayload;
|
|
173
|
+
}
|
|
174
|
+
interface NetworkRecordFilterInput {
|
|
175
|
+
readonly url?: string;
|
|
176
|
+
readonly hostname?: string;
|
|
177
|
+
readonly path?: string;
|
|
178
|
+
readonly method?: string;
|
|
179
|
+
readonly status?: string;
|
|
180
|
+
readonly resourceType?: NetworkResourceType;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
type ScreenshotFormat = "png" | "jpeg" | "webp";
|
|
184
|
+
interface ScreenshotArtifact {
|
|
185
|
+
readonly pageRef: PageRef;
|
|
186
|
+
readonly frameRef?: FrameRef;
|
|
187
|
+
readonly documentRef?: DocumentRef;
|
|
188
|
+
readonly documentEpoch?: DocumentEpoch;
|
|
189
|
+
readonly payload: BodyPayload;
|
|
190
|
+
readonly format: ScreenshotFormat;
|
|
191
|
+
readonly size: Size;
|
|
192
|
+
readonly coordinateSpace: CoordinateSpace;
|
|
193
|
+
readonly clip?: Rect;
|
|
194
|
+
}
|
|
195
|
+
interface HtmlSnapshot {
|
|
196
|
+
readonly pageRef: PageRef;
|
|
197
|
+
readonly frameRef: FrameRef;
|
|
198
|
+
readonly documentRef: DocumentRef;
|
|
199
|
+
readonly documentEpoch: DocumentEpoch;
|
|
200
|
+
readonly url: string;
|
|
201
|
+
readonly capturedAt: number;
|
|
202
|
+
readonly html: string;
|
|
203
|
+
}
|
|
204
|
+
interface DomSnapshotNode {
|
|
205
|
+
readonly snapshotNodeId: number;
|
|
206
|
+
readonly nodeRef?: NodeRef;
|
|
207
|
+
readonly parentSnapshotNodeId?: number;
|
|
208
|
+
readonly childSnapshotNodeIds: readonly number[];
|
|
209
|
+
readonly shadowRootType?: "open" | "closed" | "user-agent";
|
|
210
|
+
readonly shadowHostNodeRef?: NodeRef;
|
|
211
|
+
readonly contentDocumentRef?: DocumentRef;
|
|
212
|
+
readonly nodeType: number;
|
|
213
|
+
readonly nodeName: string;
|
|
214
|
+
readonly nodeValue: string;
|
|
215
|
+
readonly textContent?: string;
|
|
216
|
+
readonly computedStyle?: {
|
|
217
|
+
readonly display?: string;
|
|
218
|
+
readonly visibility?: string;
|
|
219
|
+
readonly opacity?: string;
|
|
220
|
+
readonly position?: string;
|
|
221
|
+
readonly cursor?: string;
|
|
222
|
+
readonly overflowX?: string;
|
|
223
|
+
readonly overflowY?: string;
|
|
224
|
+
};
|
|
225
|
+
readonly attributes: readonly {
|
|
226
|
+
readonly name: string;
|
|
227
|
+
readonly value: string;
|
|
228
|
+
}[];
|
|
229
|
+
readonly layout?: {
|
|
230
|
+
readonly rect?: Rect;
|
|
231
|
+
readonly quad?: Quad;
|
|
232
|
+
readonly paintOrder?: number;
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
type ShadowDomSnapshotMode = "flattened" | "preserved" | "unsupported";
|
|
236
|
+
interface DomSnapshot {
|
|
237
|
+
readonly pageRef: PageRef;
|
|
238
|
+
readonly frameRef: FrameRef;
|
|
239
|
+
readonly documentRef: DocumentRef;
|
|
240
|
+
readonly parentDocumentRef?: DocumentRef;
|
|
241
|
+
readonly documentEpoch: DocumentEpoch;
|
|
242
|
+
readonly url: string;
|
|
243
|
+
readonly capturedAt: number;
|
|
244
|
+
readonly rootSnapshotNodeId: number;
|
|
245
|
+
readonly shadowDomMode: ShadowDomSnapshotMode;
|
|
246
|
+
readonly geometryCoordinateSpace?: CoordinateSpace;
|
|
247
|
+
readonly nodes: readonly DomSnapshotNode[];
|
|
248
|
+
}
|
|
249
|
+
interface HitTestResult {
|
|
250
|
+
readonly inputPoint: Point;
|
|
251
|
+
readonly inputCoordinateSpace: CoordinateSpace;
|
|
252
|
+
readonly resolvedPoint: Point;
|
|
253
|
+
readonly resolvedCoordinateSpace: CoordinateSpace;
|
|
254
|
+
readonly pageRef: PageRef;
|
|
255
|
+
readonly frameRef: FrameRef;
|
|
256
|
+
readonly documentRef: DocumentRef;
|
|
257
|
+
readonly documentEpoch: DocumentEpoch;
|
|
258
|
+
readonly nodeRef?: NodeRef;
|
|
259
|
+
readonly targetQuad?: Quad;
|
|
260
|
+
readonly obscured: boolean;
|
|
261
|
+
readonly pointerEventsSkipped: boolean;
|
|
262
|
+
}
|
|
263
|
+
type VisualStabilityScope = "main-frame" | "visible-frames";
|
|
264
|
+
|
|
265
|
+
type CookieSameSite = "strict" | "lax" | "none";
|
|
266
|
+
type CookiePriority = "low" | "medium" | "high";
|
|
267
|
+
interface CookieRecord {
|
|
268
|
+
readonly sessionRef: SessionRef;
|
|
269
|
+
readonly name: string;
|
|
270
|
+
readonly value: string;
|
|
271
|
+
readonly domain: string;
|
|
272
|
+
readonly path: string;
|
|
273
|
+
readonly secure: boolean;
|
|
274
|
+
readonly httpOnly: boolean;
|
|
275
|
+
readonly sameSite?: CookieSameSite;
|
|
276
|
+
readonly priority?: CookiePriority;
|
|
277
|
+
readonly partitionKey?: string;
|
|
278
|
+
readonly session: boolean;
|
|
279
|
+
readonly expiresAt?: number | null;
|
|
280
|
+
}
|
|
281
|
+
interface StorageEntry {
|
|
282
|
+
readonly key: string;
|
|
283
|
+
readonly value: string;
|
|
284
|
+
}
|
|
285
|
+
interface IndexedDbRecord {
|
|
286
|
+
readonly key: unknown;
|
|
287
|
+
readonly primaryKey?: unknown;
|
|
288
|
+
readonly value: unknown;
|
|
289
|
+
}
|
|
290
|
+
interface IndexedDbIndexSnapshot {
|
|
291
|
+
readonly name: string;
|
|
292
|
+
readonly keyPath?: string | readonly string[];
|
|
293
|
+
readonly multiEntry: boolean;
|
|
294
|
+
readonly unique: boolean;
|
|
295
|
+
}
|
|
296
|
+
interface IndexedDbObjectStoreSnapshot {
|
|
297
|
+
readonly name: string;
|
|
298
|
+
readonly keyPath?: string | readonly string[];
|
|
299
|
+
readonly autoIncrement: boolean;
|
|
300
|
+
readonly indexes: readonly IndexedDbIndexSnapshot[];
|
|
301
|
+
readonly records: readonly IndexedDbRecord[];
|
|
302
|
+
}
|
|
303
|
+
interface IndexedDbDatabaseSnapshot {
|
|
304
|
+
readonly name: string;
|
|
305
|
+
readonly version: number;
|
|
306
|
+
readonly objectStores: readonly IndexedDbObjectStoreSnapshot[];
|
|
307
|
+
}
|
|
308
|
+
interface StorageOriginSnapshot {
|
|
309
|
+
readonly origin: string;
|
|
310
|
+
readonly localStorage: readonly StorageEntry[];
|
|
311
|
+
readonly indexedDb?: readonly IndexedDbDatabaseSnapshot[];
|
|
312
|
+
}
|
|
313
|
+
interface SessionStorageSnapshot {
|
|
314
|
+
readonly pageRef: PageRef;
|
|
315
|
+
readonly frameRef: FrameRef;
|
|
316
|
+
readonly origin: string;
|
|
317
|
+
readonly entries: readonly StorageEntry[];
|
|
318
|
+
}
|
|
319
|
+
interface StorageSnapshot {
|
|
320
|
+
readonly sessionRef: SessionRef;
|
|
321
|
+
readonly capturedAt: number;
|
|
322
|
+
readonly origins: readonly StorageOriginSnapshot[];
|
|
323
|
+
readonly sessionStorage?: readonly SessionStorageSnapshot[];
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
interface BrowserCapabilities {
|
|
327
|
+
readonly executor: {
|
|
328
|
+
readonly sessionLifecycle: boolean;
|
|
329
|
+
readonly pageLifecycle: boolean;
|
|
330
|
+
readonly navigation: boolean;
|
|
331
|
+
readonly pointerInput: boolean;
|
|
332
|
+
readonly keyboardInput: boolean;
|
|
333
|
+
readonly touchInput: boolean;
|
|
334
|
+
readonly screenshots: boolean;
|
|
335
|
+
readonly executionControl: {
|
|
336
|
+
readonly pause: boolean;
|
|
337
|
+
readonly resume: boolean;
|
|
338
|
+
readonly freeze: boolean;
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
readonly inspector: {
|
|
342
|
+
readonly pageEnumeration: boolean;
|
|
343
|
+
readonly frameEnumeration: boolean;
|
|
344
|
+
readonly html: boolean;
|
|
345
|
+
readonly domSnapshot: boolean;
|
|
346
|
+
readonly visualStability: boolean;
|
|
347
|
+
readonly text: boolean;
|
|
348
|
+
readonly attributes: boolean;
|
|
349
|
+
readonly hitTest: boolean;
|
|
350
|
+
readonly viewportMetrics: boolean;
|
|
351
|
+
readonly network: boolean;
|
|
352
|
+
readonly networkBodies: boolean;
|
|
353
|
+
readonly cookies: boolean;
|
|
354
|
+
readonly localStorage: boolean;
|
|
355
|
+
readonly sessionStorage: boolean;
|
|
356
|
+
readonly indexedDb: boolean;
|
|
357
|
+
};
|
|
358
|
+
readonly transport: {
|
|
359
|
+
readonly sessionHttp: boolean;
|
|
360
|
+
};
|
|
361
|
+
readonly instrumentation: {
|
|
362
|
+
readonly initScripts: boolean;
|
|
363
|
+
readonly routing: boolean;
|
|
364
|
+
};
|
|
365
|
+
readonly events: {
|
|
366
|
+
readonly pageLifecycle: boolean;
|
|
367
|
+
readonly dialog: boolean;
|
|
368
|
+
readonly download: boolean;
|
|
369
|
+
readonly chooser: boolean;
|
|
370
|
+
readonly worker: boolean;
|
|
371
|
+
readonly console: boolean;
|
|
372
|
+
readonly pageError: boolean;
|
|
373
|
+
readonly websocket: boolean;
|
|
374
|
+
readonly eventStream: boolean;
|
|
375
|
+
readonly executionState: boolean;
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
type ConsoleLevel = "debug" | "log" | "info" | "warn" | "error" | "trace";
|
|
380
|
+
interface StepEventBase {
|
|
381
|
+
readonly eventId: string;
|
|
382
|
+
readonly kind: string;
|
|
383
|
+
readonly timestamp: number;
|
|
384
|
+
readonly sessionRef: SessionRef;
|
|
385
|
+
readonly pageRef?: PageRef;
|
|
386
|
+
readonly frameRef?: FrameRef;
|
|
387
|
+
readonly documentRef?: DocumentRef;
|
|
388
|
+
readonly documentEpoch?: DocumentEpoch;
|
|
389
|
+
}
|
|
390
|
+
interface PageCreatedStepEvent extends StepEventBase {
|
|
391
|
+
readonly kind: "page-created";
|
|
392
|
+
readonly pageRef: PageRef;
|
|
393
|
+
}
|
|
394
|
+
interface PopupOpenedStepEvent extends StepEventBase {
|
|
395
|
+
readonly kind: "popup-opened";
|
|
396
|
+
readonly pageRef: PageRef;
|
|
397
|
+
readonly openerPageRef: PageRef;
|
|
398
|
+
}
|
|
399
|
+
interface PageClosedStepEvent extends StepEventBase {
|
|
400
|
+
readonly kind: "page-closed";
|
|
401
|
+
readonly pageRef: PageRef;
|
|
402
|
+
}
|
|
403
|
+
interface DialogOpenedStepEvent extends StepEventBase {
|
|
404
|
+
readonly kind: "dialog-opened";
|
|
405
|
+
readonly dialogRef: DialogRef;
|
|
406
|
+
readonly dialogType: "alert" | "beforeunload" | "confirm" | "prompt";
|
|
407
|
+
readonly message: string;
|
|
408
|
+
readonly defaultValue?: string;
|
|
409
|
+
}
|
|
410
|
+
interface DownloadStartedStepEvent extends StepEventBase {
|
|
411
|
+
readonly kind: "download-started";
|
|
412
|
+
readonly downloadRef: DownloadRef;
|
|
413
|
+
readonly url: string;
|
|
414
|
+
readonly suggestedFilename?: string;
|
|
415
|
+
}
|
|
416
|
+
interface DownloadFinishedStepEvent extends StepEventBase {
|
|
417
|
+
readonly kind: "download-finished";
|
|
418
|
+
readonly downloadRef: DownloadRef;
|
|
419
|
+
readonly state: "completed" | "canceled" | "failed";
|
|
420
|
+
readonly filePath?: string;
|
|
421
|
+
}
|
|
422
|
+
interface ChooserOpenedStepEvent extends StepEventBase {
|
|
423
|
+
readonly kind: "chooser-opened";
|
|
424
|
+
readonly chooserRef: ChooserRef;
|
|
425
|
+
readonly chooserType: "file" | "select";
|
|
426
|
+
readonly multiple: boolean;
|
|
427
|
+
readonly options?: readonly {
|
|
428
|
+
readonly index: number;
|
|
429
|
+
readonly label: string;
|
|
430
|
+
readonly value: string;
|
|
431
|
+
readonly selected: boolean;
|
|
432
|
+
}[];
|
|
433
|
+
}
|
|
434
|
+
interface WorkerCreatedStepEvent extends StepEventBase {
|
|
435
|
+
readonly kind: "worker-created";
|
|
436
|
+
readonly workerRef: WorkerRef;
|
|
437
|
+
readonly workerType: "dedicated" | "shared" | "service";
|
|
438
|
+
readonly url: string;
|
|
439
|
+
}
|
|
440
|
+
interface WorkerDestroyedStepEvent extends StepEventBase {
|
|
441
|
+
readonly kind: "worker-destroyed";
|
|
442
|
+
readonly workerRef: WorkerRef;
|
|
443
|
+
readonly workerType: "dedicated" | "shared" | "service";
|
|
444
|
+
readonly url: string;
|
|
445
|
+
}
|
|
446
|
+
interface ConsoleStepEvent extends StepEventBase {
|
|
447
|
+
readonly kind: "console";
|
|
448
|
+
readonly level: ConsoleLevel;
|
|
449
|
+
readonly text: string;
|
|
450
|
+
readonly location?: {
|
|
451
|
+
readonly url?: string;
|
|
452
|
+
readonly lineNumber?: number;
|
|
453
|
+
readonly columnNumber?: number;
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
interface PageErrorStepEvent extends StepEventBase {
|
|
457
|
+
readonly kind: "page-error";
|
|
458
|
+
readonly message: string;
|
|
459
|
+
readonly stack?: string;
|
|
460
|
+
}
|
|
461
|
+
interface WebSocketOpenedStepEvent extends StepEventBase {
|
|
462
|
+
readonly kind: "websocket-opened";
|
|
463
|
+
readonly socketId: string;
|
|
464
|
+
readonly url: string;
|
|
465
|
+
}
|
|
466
|
+
interface WebSocketFrameStepEvent extends StepEventBase {
|
|
467
|
+
readonly kind: "websocket-frame";
|
|
468
|
+
readonly socketId: string;
|
|
469
|
+
readonly direction: "sent" | "received";
|
|
470
|
+
readonly opcode?: number;
|
|
471
|
+
readonly payloadPreview?: string;
|
|
472
|
+
}
|
|
473
|
+
interface WebSocketClosedStepEvent extends StepEventBase {
|
|
474
|
+
readonly kind: "websocket-closed";
|
|
475
|
+
readonly socketId: string;
|
|
476
|
+
readonly code?: number;
|
|
477
|
+
readonly reason?: string;
|
|
478
|
+
}
|
|
479
|
+
interface EventStreamMessageStepEvent extends StepEventBase {
|
|
480
|
+
readonly kind: "event-stream-message";
|
|
481
|
+
readonly streamId: string;
|
|
482
|
+
readonly eventName?: string;
|
|
483
|
+
readonly dataPreview?: string;
|
|
484
|
+
}
|
|
485
|
+
interface PausedStepEvent extends StepEventBase {
|
|
486
|
+
readonly kind: "paused";
|
|
487
|
+
readonly reason?: string;
|
|
488
|
+
}
|
|
489
|
+
interface ResumedStepEvent extends StepEventBase {
|
|
490
|
+
readonly kind: "resumed";
|
|
491
|
+
readonly reason?: string;
|
|
492
|
+
}
|
|
493
|
+
interface FrozenStepEvent extends StepEventBase {
|
|
494
|
+
readonly kind: "frozen";
|
|
495
|
+
readonly reason?: string;
|
|
496
|
+
}
|
|
497
|
+
type StepEvent = PageCreatedStepEvent | PopupOpenedStepEvent | PageClosedStepEvent | DialogOpenedStepEvent | DownloadStartedStepEvent | DownloadFinishedStepEvent | ChooserOpenedStepEvent | WorkerCreatedStepEvent | WorkerDestroyedStepEvent | ConsoleStepEvent | PageErrorStepEvent | WebSocketOpenedStepEvent | WebSocketFrameStepEvent | WebSocketClosedStepEvent | EventStreamMessageStepEvent | PausedStepEvent | ResumedStepEvent | FrozenStepEvent;
|
|
498
|
+
interface StepResult<TData = void> {
|
|
499
|
+
readonly stepId: string;
|
|
500
|
+
readonly sessionRef: SessionRef;
|
|
501
|
+
readonly pageRef?: PageRef;
|
|
502
|
+
readonly frameRef?: FrameRef;
|
|
503
|
+
readonly documentRef?: DocumentRef;
|
|
504
|
+
readonly documentEpoch?: DocumentEpoch;
|
|
505
|
+
readonly startedAt: number;
|
|
506
|
+
readonly completedAt: number;
|
|
507
|
+
readonly durationMs: number;
|
|
508
|
+
readonly events: readonly StepEvent[];
|
|
509
|
+
readonly data: TData;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
type MouseButton = "left" | "middle" | "right";
|
|
513
|
+
type KeyModifier = "Shift" | "Control" | "Alt" | "Meta";
|
|
514
|
+
interface SessionTransportRequest {
|
|
515
|
+
readonly method: string;
|
|
516
|
+
readonly url: string;
|
|
517
|
+
readonly headers?: readonly HeaderEntry[];
|
|
518
|
+
readonly body?: BodyPayload;
|
|
519
|
+
readonly timeoutMs?: number;
|
|
520
|
+
readonly followRedirects?: boolean;
|
|
521
|
+
}
|
|
522
|
+
interface SessionTransportResponse {
|
|
523
|
+
readonly url: string;
|
|
524
|
+
readonly status: number;
|
|
525
|
+
readonly statusText: string;
|
|
526
|
+
readonly headers: readonly HeaderEntry[];
|
|
527
|
+
readonly body?: BodyPayload;
|
|
528
|
+
readonly redirected: boolean;
|
|
529
|
+
}
|
|
530
|
+
interface BrowserInitScriptInput {
|
|
531
|
+
readonly sessionRef: SessionRef;
|
|
532
|
+
readonly pageRef?: PageRef;
|
|
533
|
+
readonly script: string;
|
|
534
|
+
readonly args?: readonly unknown[];
|
|
535
|
+
}
|
|
536
|
+
interface BrowserInitScriptRegistration {
|
|
537
|
+
readonly registrationId: string;
|
|
538
|
+
readonly sessionRef: SessionRef;
|
|
539
|
+
readonly pageRef?: PageRef;
|
|
540
|
+
}
|
|
541
|
+
interface BrowserRouteRequest {
|
|
542
|
+
readonly url: string;
|
|
543
|
+
readonly method: string;
|
|
544
|
+
readonly headers: readonly HeaderEntry[];
|
|
545
|
+
readonly resourceType: NetworkRecord["resourceType"];
|
|
546
|
+
readonly pageRef?: PageRef;
|
|
547
|
+
readonly postData?: BodyPayload;
|
|
548
|
+
}
|
|
549
|
+
interface BrowserRouteFetchResult extends SessionTransportResponse {
|
|
550
|
+
}
|
|
551
|
+
type BrowserRouteHandlerResult = {
|
|
552
|
+
readonly kind: "continue";
|
|
553
|
+
} | {
|
|
554
|
+
readonly kind: "fulfill";
|
|
555
|
+
readonly status?: number;
|
|
556
|
+
readonly headers?: readonly HeaderEntry[];
|
|
557
|
+
readonly body?: BodyPayload;
|
|
558
|
+
readonly contentType?: string;
|
|
559
|
+
} | {
|
|
560
|
+
readonly kind: "abort";
|
|
561
|
+
readonly errorCode?: string;
|
|
562
|
+
};
|
|
563
|
+
interface BrowserRouteRegistrationInput {
|
|
564
|
+
readonly sessionRef: SessionRef;
|
|
565
|
+
readonly pageRef?: PageRef;
|
|
566
|
+
readonly urlPattern: string;
|
|
567
|
+
readonly resourceTypes?: readonly NetworkRecord["resourceType"][];
|
|
568
|
+
readonly times?: number;
|
|
569
|
+
readonly handler: (input: {
|
|
570
|
+
readonly request: BrowserRouteRequest;
|
|
571
|
+
fetchOriginal(): Promise<BrowserRouteFetchResult>;
|
|
572
|
+
}) => Promise<BrowserRouteHandlerResult> | BrowserRouteHandlerResult;
|
|
573
|
+
}
|
|
574
|
+
interface BrowserRouteRegistration {
|
|
575
|
+
readonly routeId: string;
|
|
576
|
+
readonly sessionRef: SessionRef;
|
|
577
|
+
readonly pageRef?: PageRef;
|
|
578
|
+
readonly urlPattern: string;
|
|
579
|
+
}
|
|
580
|
+
interface GetNetworkRecordsInput extends NetworkRecordFilterInput {
|
|
581
|
+
readonly sessionRef: SessionRef;
|
|
582
|
+
readonly pageRef?: PageRef;
|
|
583
|
+
readonly requestIds?: readonly string[];
|
|
584
|
+
readonly includeBodies?: boolean;
|
|
585
|
+
readonly signal?: AbortSignal;
|
|
586
|
+
}
|
|
587
|
+
interface BrowserExecutor {
|
|
588
|
+
readonly capabilities: Readonly<BrowserCapabilities>;
|
|
589
|
+
createSession(): Promise<SessionRef>;
|
|
590
|
+
closeSession(input: {
|
|
591
|
+
readonly sessionRef: SessionRef;
|
|
592
|
+
}): Promise<void>;
|
|
593
|
+
createPage(input: {
|
|
594
|
+
readonly sessionRef: SessionRef;
|
|
595
|
+
readonly openerPageRef?: PageRef;
|
|
596
|
+
readonly url?: string;
|
|
597
|
+
}): Promise<StepResult<PageInfo>>;
|
|
598
|
+
closePage(input: {
|
|
599
|
+
readonly pageRef: PageRef;
|
|
600
|
+
}): Promise<StepResult<void>>;
|
|
601
|
+
activatePage(input: {
|
|
602
|
+
readonly pageRef: PageRef;
|
|
603
|
+
}): Promise<StepResult<PageInfo>>;
|
|
604
|
+
navigate(input: {
|
|
605
|
+
readonly pageRef: PageRef;
|
|
606
|
+
readonly url: string;
|
|
607
|
+
readonly referrer?: string;
|
|
608
|
+
readonly timeoutMs?: number;
|
|
609
|
+
}): Promise<StepResult<{
|
|
610
|
+
readonly pageInfo: PageInfo;
|
|
611
|
+
readonly mainFrame: FrameInfo;
|
|
612
|
+
}>>;
|
|
613
|
+
reload(input: {
|
|
614
|
+
readonly pageRef: PageRef;
|
|
615
|
+
readonly timeoutMs?: number;
|
|
616
|
+
}): Promise<StepResult<{
|
|
617
|
+
readonly pageInfo: PageInfo;
|
|
618
|
+
readonly mainFrame: FrameInfo;
|
|
619
|
+
}>>;
|
|
620
|
+
goBack(input: {
|
|
621
|
+
readonly pageRef: PageRef;
|
|
622
|
+
}): Promise<StepResult<boolean>>;
|
|
623
|
+
goForward(input: {
|
|
624
|
+
readonly pageRef: PageRef;
|
|
625
|
+
}): Promise<StepResult<boolean>>;
|
|
626
|
+
stopLoading(input: {
|
|
627
|
+
readonly pageRef: PageRef;
|
|
628
|
+
}): Promise<StepResult<void>>;
|
|
629
|
+
mouseMove(input: {
|
|
630
|
+
readonly pageRef: PageRef;
|
|
631
|
+
readonly point: Point;
|
|
632
|
+
readonly coordinateSpace: CoordinateSpace;
|
|
633
|
+
}): Promise<StepResult<void>>;
|
|
634
|
+
mouseClick(input: {
|
|
635
|
+
readonly pageRef: PageRef;
|
|
636
|
+
readonly point: Point;
|
|
637
|
+
readonly coordinateSpace: CoordinateSpace;
|
|
638
|
+
readonly button?: MouseButton;
|
|
639
|
+
readonly clickCount?: number;
|
|
640
|
+
readonly modifiers?: readonly KeyModifier[];
|
|
641
|
+
}): Promise<StepResult<HitTestResult | undefined>>;
|
|
642
|
+
mouseScroll(input: {
|
|
643
|
+
readonly pageRef: PageRef;
|
|
644
|
+
readonly point: Point;
|
|
645
|
+
readonly coordinateSpace: CoordinateSpace;
|
|
646
|
+
readonly delta: Point;
|
|
647
|
+
}): Promise<StepResult<void>>;
|
|
648
|
+
keyPress(input: {
|
|
649
|
+
readonly pageRef: PageRef;
|
|
650
|
+
readonly key: string;
|
|
651
|
+
readonly modifiers?: readonly KeyModifier[];
|
|
652
|
+
}): Promise<StepResult<void>>;
|
|
653
|
+
textInput(input: {
|
|
654
|
+
readonly pageRef: PageRef;
|
|
655
|
+
readonly text: string;
|
|
656
|
+
}): Promise<StepResult<void>>;
|
|
657
|
+
captureScreenshot(input: {
|
|
658
|
+
readonly pageRef: PageRef;
|
|
659
|
+
readonly format?: ScreenshotFormat;
|
|
660
|
+
readonly clip?: Rect;
|
|
661
|
+
readonly clipSpace?: CoordinateSpace;
|
|
662
|
+
readonly fullPage?: boolean;
|
|
663
|
+
readonly includeCursor?: boolean;
|
|
664
|
+
}): Promise<StepResult<ScreenshotArtifact>>;
|
|
665
|
+
setExecutionState(input: {
|
|
666
|
+
readonly pageRef: PageRef;
|
|
667
|
+
readonly paused?: boolean;
|
|
668
|
+
readonly frozen?: boolean;
|
|
669
|
+
}): Promise<StepResult<{
|
|
670
|
+
readonly paused: boolean;
|
|
671
|
+
readonly frozen: boolean;
|
|
672
|
+
}>>;
|
|
673
|
+
}
|
|
674
|
+
interface BrowserInspector {
|
|
675
|
+
readonly capabilities: Readonly<BrowserCapabilities>;
|
|
676
|
+
listPages(input: {
|
|
677
|
+
readonly sessionRef: SessionRef;
|
|
678
|
+
}): Promise<readonly PageInfo[]>;
|
|
679
|
+
listFrames(input: {
|
|
680
|
+
readonly pageRef: PageRef;
|
|
681
|
+
}): Promise<readonly FrameInfo[]>;
|
|
682
|
+
getPageInfo(input: {
|
|
683
|
+
readonly pageRef: PageRef;
|
|
684
|
+
}): Promise<PageInfo>;
|
|
685
|
+
getFrameInfo(input: {
|
|
686
|
+
readonly frameRef: FrameRef;
|
|
687
|
+
}): Promise<FrameInfo>;
|
|
688
|
+
getHtmlSnapshot(input: {
|
|
689
|
+
readonly frameRef?: FrameRef;
|
|
690
|
+
readonly documentRef?: DocumentRef;
|
|
691
|
+
}): Promise<HtmlSnapshot>;
|
|
692
|
+
getDomSnapshot(input: {
|
|
693
|
+
readonly frameRef?: FrameRef;
|
|
694
|
+
readonly documentRef?: DocumentRef;
|
|
695
|
+
}): Promise<DomSnapshot>;
|
|
696
|
+
waitForVisualStability(input: {
|
|
697
|
+
readonly pageRef: PageRef;
|
|
698
|
+
readonly timeoutMs?: number;
|
|
699
|
+
readonly settleMs?: number;
|
|
700
|
+
readonly scope?: VisualStabilityScope;
|
|
701
|
+
}): Promise<void>;
|
|
702
|
+
readText(input: NodeLocator): Promise<string | null>;
|
|
703
|
+
readAttributes(input: NodeLocator): Promise<readonly {
|
|
704
|
+
readonly name: string;
|
|
705
|
+
readonly value: string;
|
|
706
|
+
}[]>;
|
|
707
|
+
hitTest(input: {
|
|
708
|
+
readonly pageRef: PageRef;
|
|
709
|
+
readonly point: Point;
|
|
710
|
+
readonly coordinateSpace: CoordinateSpace;
|
|
711
|
+
readonly ignorePointerEventsNone?: boolean;
|
|
712
|
+
readonly includeUserAgentShadowDom?: boolean;
|
|
713
|
+
}): Promise<HitTestResult>;
|
|
714
|
+
getViewportMetrics(input: {
|
|
715
|
+
readonly pageRef: PageRef;
|
|
716
|
+
}): Promise<ViewportMetrics>;
|
|
717
|
+
getNetworkRecords(input: GetNetworkRecordsInput): Promise<readonly NetworkRecord[]>;
|
|
718
|
+
getCookies(input: {
|
|
719
|
+
readonly sessionRef: SessionRef;
|
|
720
|
+
readonly urls?: readonly string[];
|
|
721
|
+
}): Promise<readonly CookieRecord[]>;
|
|
722
|
+
setCookies(input: {
|
|
723
|
+
readonly sessionRef: SessionRef;
|
|
724
|
+
readonly cookies: readonly CookieRecord[];
|
|
725
|
+
}): Promise<void>;
|
|
726
|
+
getStorageSnapshot(input: {
|
|
727
|
+
readonly sessionRef: SessionRef;
|
|
728
|
+
readonly includeSessionStorage?: boolean;
|
|
729
|
+
readonly includeIndexedDb?: boolean;
|
|
730
|
+
}): Promise<StorageSnapshot>;
|
|
731
|
+
evaluatePage(input: {
|
|
732
|
+
readonly pageRef: PageRef;
|
|
733
|
+
readonly script: string;
|
|
734
|
+
readonly args?: readonly unknown[];
|
|
735
|
+
readonly timeoutMs?: number;
|
|
736
|
+
}): Promise<StepResult<unknown>>;
|
|
737
|
+
}
|
|
738
|
+
interface SessionTransportExecutor {
|
|
739
|
+
readonly capabilities: Readonly<BrowserCapabilities>;
|
|
740
|
+
executeRequest(input: {
|
|
741
|
+
readonly sessionRef: SessionRef;
|
|
742
|
+
readonly request: SessionTransportRequest;
|
|
743
|
+
readonly signal?: AbortSignal;
|
|
744
|
+
}): Promise<StepResult<SessionTransportResponse>>;
|
|
745
|
+
}
|
|
746
|
+
interface BrowserInstrumentation {
|
|
747
|
+
readonly capabilities: Readonly<BrowserCapabilities>;
|
|
748
|
+
addInitScript(input: BrowserInitScriptInput): Promise<BrowserInitScriptRegistration>;
|
|
749
|
+
registerRoute(input: BrowserRouteRegistrationInput): Promise<BrowserRouteRegistration>;
|
|
750
|
+
}
|
|
751
|
+
interface BrowserCoreEngine extends BrowserExecutor, BrowserInspector, SessionTransportExecutor, BrowserInstrumentation {
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
declare const opensteerComputerAnnotationNames: readonly ["clickable", "typeable", "scrollable", "grid", "selected"];
|
|
755
|
+
type OpensteerComputerAnnotation = (typeof opensteerComputerAnnotationNames)[number];
|
|
756
|
+
type OpensteerComputerMouseButton = "left" | "middle" | "right";
|
|
757
|
+
type OpensteerComputerKeyModifier = "Shift" | "Control" | "Alt" | "Meta";
|
|
758
|
+
interface OpensteerComputerClickAction {
|
|
759
|
+
readonly type: "click";
|
|
760
|
+
readonly x: number;
|
|
761
|
+
readonly y: number;
|
|
762
|
+
readonly button?: OpensteerComputerMouseButton;
|
|
763
|
+
readonly clickCount?: number;
|
|
764
|
+
readonly modifiers?: readonly OpensteerComputerKeyModifier[];
|
|
765
|
+
}
|
|
766
|
+
interface OpensteerComputerMoveAction {
|
|
767
|
+
readonly type: "move";
|
|
768
|
+
readonly x: number;
|
|
769
|
+
readonly y: number;
|
|
770
|
+
}
|
|
771
|
+
interface OpensteerComputerScrollAction {
|
|
772
|
+
readonly type: "scroll";
|
|
773
|
+
readonly x: number;
|
|
774
|
+
readonly y: number;
|
|
775
|
+
readonly deltaX: number;
|
|
776
|
+
readonly deltaY: number;
|
|
777
|
+
}
|
|
778
|
+
interface OpensteerComputerTypeAction {
|
|
779
|
+
readonly type: "type";
|
|
780
|
+
readonly text: string;
|
|
781
|
+
}
|
|
782
|
+
interface OpensteerComputerKeyAction {
|
|
783
|
+
readonly type: "key";
|
|
784
|
+
readonly key: string;
|
|
785
|
+
readonly modifiers?: readonly OpensteerComputerKeyModifier[];
|
|
786
|
+
}
|
|
787
|
+
interface OpensteerComputerDragAction {
|
|
788
|
+
readonly type: "drag";
|
|
789
|
+
readonly start: Point;
|
|
790
|
+
readonly end: Point;
|
|
791
|
+
readonly steps?: number;
|
|
792
|
+
}
|
|
793
|
+
interface OpensteerComputerScreenshotAction {
|
|
794
|
+
readonly type: "screenshot";
|
|
795
|
+
}
|
|
796
|
+
interface OpensteerComputerWaitAction {
|
|
797
|
+
readonly type: "wait";
|
|
798
|
+
readonly durationMs: number;
|
|
799
|
+
}
|
|
800
|
+
type OpensteerComputerAction = OpensteerComputerClickAction | OpensteerComputerMoveAction | OpensteerComputerScrollAction | OpensteerComputerTypeAction | OpensteerComputerKeyAction | OpensteerComputerDragAction | OpensteerComputerScreenshotAction | OpensteerComputerWaitAction;
|
|
801
|
+
interface OpensteerComputerExecuteTiming {
|
|
802
|
+
readonly actionMs: number;
|
|
803
|
+
readonly waitMs: number;
|
|
804
|
+
readonly totalMs: number;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
declare const OPENSTEER_COMPUTER_USE_BRIDGE_SYMBOL: unique symbol;
|
|
808
|
+
interface NormalizedComputerScreenshotOptions {
|
|
809
|
+
readonly format: ScreenshotFormat;
|
|
810
|
+
readonly includeCursor: boolean;
|
|
811
|
+
readonly annotations: readonly OpensteerComputerAnnotation[];
|
|
812
|
+
}
|
|
813
|
+
interface ComputerUseBridgeInput {
|
|
814
|
+
readonly pageRef: PageRef;
|
|
815
|
+
readonly action: OpensteerComputerAction;
|
|
816
|
+
readonly screenshot: NormalizedComputerScreenshotOptions;
|
|
817
|
+
readonly signal: AbortSignal;
|
|
818
|
+
remainingMs(): number | undefined;
|
|
819
|
+
policySettle(pageRef: PageRef): Promise<void>;
|
|
820
|
+
}
|
|
821
|
+
interface ComputerUseBridgeOutput {
|
|
822
|
+
readonly pageRef: PageRef;
|
|
823
|
+
readonly screenshot: ScreenshotArtifact;
|
|
824
|
+
readonly viewport: ViewportMetrics;
|
|
825
|
+
readonly events: readonly StepEvent[];
|
|
826
|
+
readonly timing: OpensteerComputerExecuteTiming;
|
|
827
|
+
}
|
|
828
|
+
interface ComputerUseBridge {
|
|
829
|
+
execute(input: ComputerUseBridgeInput): Promise<ComputerUseBridgeOutput>;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
declare const OPENSTEER_DOM_ACTION_BRIDGE_SYMBOL: unique symbol;
|
|
833
|
+
type DomActionScrollAlignment = "start" | "center" | "end" | "nearest";
|
|
834
|
+
interface DomActionTargetInspection {
|
|
835
|
+
readonly connected: boolean;
|
|
836
|
+
readonly visible: boolean;
|
|
837
|
+
readonly enabled: boolean;
|
|
838
|
+
readonly editable: boolean;
|
|
839
|
+
readonly pointerEvents: string;
|
|
840
|
+
readonly bounds?: Rect;
|
|
841
|
+
readonly contentQuads: readonly Quad[];
|
|
842
|
+
}
|
|
843
|
+
interface DomActionScrollOptions {
|
|
844
|
+
readonly block?: DomActionScrollAlignment;
|
|
845
|
+
readonly inline?: DomActionScrollAlignment;
|
|
846
|
+
}
|
|
847
|
+
interface DomActionKeyPressInput {
|
|
848
|
+
readonly key: string;
|
|
849
|
+
readonly modifiers?: readonly KeyModifier[];
|
|
850
|
+
}
|
|
851
|
+
interface DomActionSettleOptions {
|
|
852
|
+
readonly operation: "dom.click" | "dom.hover" | "dom.input" | "dom.scroll";
|
|
853
|
+
readonly signal: AbortSignal;
|
|
854
|
+
remainingMs(): number | undefined;
|
|
855
|
+
policySettle(pageRef: PageRef): Promise<void>;
|
|
856
|
+
}
|
|
857
|
+
type DomPointerHitRelation = "self" | "descendant" | "ancestor" | "same-owner" | "outside" | "unknown";
|
|
858
|
+
interface DomPointerHitAssessment {
|
|
859
|
+
readonly relation: DomPointerHitRelation;
|
|
860
|
+
readonly blocking: boolean;
|
|
861
|
+
readonly ambiguous?: boolean;
|
|
862
|
+
readonly canonicalTarget?: NodeLocator;
|
|
863
|
+
readonly hitOwner?: NodeLocator;
|
|
864
|
+
}
|
|
865
|
+
interface DomActionBridge {
|
|
866
|
+
inspectActionTarget(locator: NodeLocator): Promise<DomActionTargetInspection>;
|
|
867
|
+
canonicalizePointerTarget(locator: NodeLocator): Promise<NodeLocator>;
|
|
868
|
+
classifyPointerHit(input: {
|
|
869
|
+
readonly target: NodeLocator;
|
|
870
|
+
readonly hit: NodeLocator;
|
|
871
|
+
readonly point: Point;
|
|
872
|
+
}): Promise<DomPointerHitAssessment>;
|
|
873
|
+
scrollNodeIntoView(locator: NodeLocator, options?: DomActionScrollOptions): Promise<void>;
|
|
874
|
+
focusNode(locator: NodeLocator): Promise<void>;
|
|
875
|
+
pressKey(locator: NodeLocator, input: DomActionKeyPressInput): Promise<void>;
|
|
876
|
+
finalizeDomAction(pageRef: PageRef, options: DomActionSettleOptions): Promise<void>;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
interface AbpLaunchOptions {
|
|
880
|
+
readonly abpExecutablePath?: string;
|
|
881
|
+
readonly browserExecutablePath?: string;
|
|
882
|
+
readonly headless?: boolean;
|
|
883
|
+
readonly userDataDir?: string;
|
|
884
|
+
readonly sessionDir?: string;
|
|
885
|
+
readonly args?: readonly string[];
|
|
886
|
+
readonly verbose?: boolean;
|
|
887
|
+
}
|
|
888
|
+
interface AdoptedAbpBrowser {
|
|
889
|
+
readonly baseUrl: string;
|
|
890
|
+
readonly remoteDebuggingUrl: string;
|
|
891
|
+
}
|
|
892
|
+
interface AbpBrowserCoreEngineOptions {
|
|
893
|
+
readonly launch?: AbpLaunchOptions;
|
|
894
|
+
readonly browser?: AdoptedAbpBrowser;
|
|
895
|
+
readonly extraHTTPHeaders?: readonly HeaderEntry[];
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
declare class AbpBrowserCoreEngine implements BrowserCoreEngine {
|
|
899
|
+
readonly capabilities: BrowserCapabilities;
|
|
900
|
+
private readonly launchOptions;
|
|
901
|
+
private readonly adoptedBrowser;
|
|
902
|
+
private readonly extraHTTPHeaders;
|
|
903
|
+
private readonly sessions;
|
|
904
|
+
private readonly pages;
|
|
905
|
+
private readonly frames;
|
|
906
|
+
private readonly documents;
|
|
907
|
+
private readonly retiredDocuments;
|
|
908
|
+
private readonly downloadRefsByAbpId;
|
|
909
|
+
private readonly actionSettler;
|
|
910
|
+
private pageCounter;
|
|
911
|
+
private frameCounter;
|
|
912
|
+
private documentCounter;
|
|
913
|
+
private nodeCounter;
|
|
914
|
+
private requestCounter;
|
|
915
|
+
private sessionCounter;
|
|
916
|
+
private computerUseBridge;
|
|
917
|
+
private domActionBridge;
|
|
918
|
+
private eventCounter;
|
|
919
|
+
private stepCounter;
|
|
920
|
+
private dialogCounter;
|
|
921
|
+
private chooserCounter;
|
|
922
|
+
private downloadCounter;
|
|
923
|
+
private disposed;
|
|
924
|
+
private constructor();
|
|
925
|
+
static create(options?: AbpBrowserCoreEngineOptions): Promise<AbpBrowserCoreEngine>;
|
|
926
|
+
dispose(): Promise<void>;
|
|
927
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
928
|
+
[OPENSTEER_COMPUTER_USE_BRIDGE_SYMBOL](): ComputerUseBridge;
|
|
929
|
+
[OPENSTEER_DOM_ACTION_BRIDGE_SYMBOL](): DomActionBridge;
|
|
930
|
+
createSession(): Promise<SessionRef>;
|
|
931
|
+
closeSession(input: {
|
|
932
|
+
readonly sessionRef: SessionRef;
|
|
933
|
+
}): Promise<void>;
|
|
934
|
+
createPage(input: {
|
|
935
|
+
readonly sessionRef: SessionRef;
|
|
936
|
+
readonly openerPageRef?: PageRef;
|
|
937
|
+
readonly url?: string;
|
|
938
|
+
}): Promise<StepResult<PageInfo>>;
|
|
939
|
+
closePage(input: {
|
|
940
|
+
readonly pageRef: PageRef;
|
|
941
|
+
}): Promise<StepResult<void>>;
|
|
942
|
+
activatePage(input: {
|
|
943
|
+
readonly pageRef: PageRef;
|
|
944
|
+
}): Promise<StepResult<PageInfo>>;
|
|
945
|
+
navigate(input: {
|
|
946
|
+
readonly pageRef: PageRef;
|
|
947
|
+
readonly url: string;
|
|
948
|
+
readonly referrer?: string;
|
|
949
|
+
readonly timeoutMs?: number;
|
|
950
|
+
}): Promise<StepResult<{
|
|
951
|
+
readonly pageInfo: PageInfo;
|
|
952
|
+
readonly mainFrame: FrameInfo;
|
|
953
|
+
}>>;
|
|
954
|
+
reload(input: {
|
|
955
|
+
readonly pageRef: PageRef;
|
|
956
|
+
readonly timeoutMs?: number;
|
|
957
|
+
}): Promise<StepResult<{
|
|
958
|
+
readonly pageInfo: PageInfo;
|
|
959
|
+
readonly mainFrame: FrameInfo;
|
|
960
|
+
}>>;
|
|
961
|
+
goBack(input: {
|
|
962
|
+
readonly pageRef: PageRef;
|
|
963
|
+
}): Promise<StepResult<boolean>>;
|
|
964
|
+
goForward(input: {
|
|
965
|
+
readonly pageRef: PageRef;
|
|
966
|
+
}): Promise<StepResult<boolean>>;
|
|
967
|
+
stopLoading(input: {
|
|
968
|
+
readonly pageRef: PageRef;
|
|
969
|
+
}): Promise<StepResult<void>>;
|
|
970
|
+
mouseMove(input: {
|
|
971
|
+
readonly pageRef: PageRef;
|
|
972
|
+
readonly point: Point;
|
|
973
|
+
readonly coordinateSpace: CoordinateSpace;
|
|
974
|
+
}): Promise<StepResult<void>>;
|
|
975
|
+
mouseClick(input: {
|
|
976
|
+
readonly pageRef: PageRef;
|
|
977
|
+
readonly point: Point;
|
|
978
|
+
readonly coordinateSpace: CoordinateSpace;
|
|
979
|
+
readonly button?: MouseButton;
|
|
980
|
+
readonly clickCount?: number;
|
|
981
|
+
readonly modifiers?: readonly KeyModifier[];
|
|
982
|
+
}): Promise<StepResult<HitTestResult | undefined>>;
|
|
983
|
+
mouseScroll(input: {
|
|
984
|
+
readonly pageRef: PageRef;
|
|
985
|
+
readonly point: Point;
|
|
986
|
+
readonly coordinateSpace: CoordinateSpace;
|
|
987
|
+
readonly delta: Point;
|
|
988
|
+
}): Promise<StepResult<void>>;
|
|
989
|
+
keyPress(input: {
|
|
990
|
+
readonly pageRef: PageRef;
|
|
991
|
+
readonly key: string;
|
|
992
|
+
readonly modifiers?: readonly KeyModifier[];
|
|
993
|
+
}): Promise<StepResult<void>>;
|
|
994
|
+
textInput(input: {
|
|
995
|
+
readonly pageRef: PageRef;
|
|
996
|
+
readonly text: string;
|
|
997
|
+
}): Promise<StepResult<void>>;
|
|
998
|
+
captureScreenshot(input: {
|
|
999
|
+
readonly pageRef: PageRef;
|
|
1000
|
+
readonly format?: ScreenshotFormat;
|
|
1001
|
+
readonly clip?: Rect;
|
|
1002
|
+
readonly clipSpace?: CoordinateSpace;
|
|
1003
|
+
readonly fullPage?: boolean;
|
|
1004
|
+
readonly includeCursor?: boolean;
|
|
1005
|
+
}): Promise<StepResult<ScreenshotArtifact>>;
|
|
1006
|
+
setExecutionState(input: {
|
|
1007
|
+
readonly pageRef: PageRef;
|
|
1008
|
+
readonly paused?: boolean;
|
|
1009
|
+
readonly frozen?: boolean;
|
|
1010
|
+
}): Promise<StepResult<{
|
|
1011
|
+
readonly paused: boolean;
|
|
1012
|
+
readonly frozen: boolean;
|
|
1013
|
+
}>>;
|
|
1014
|
+
listPages(input: {
|
|
1015
|
+
readonly sessionRef: SessionRef;
|
|
1016
|
+
}): Promise<readonly PageInfo[]>;
|
|
1017
|
+
listFrames(input: {
|
|
1018
|
+
readonly pageRef: PageRef;
|
|
1019
|
+
}): Promise<readonly FrameInfo[]>;
|
|
1020
|
+
getPageInfo(input: {
|
|
1021
|
+
readonly pageRef: PageRef;
|
|
1022
|
+
}): Promise<PageInfo>;
|
|
1023
|
+
getFrameInfo(input: {
|
|
1024
|
+
readonly frameRef: FrameRef;
|
|
1025
|
+
}): Promise<FrameInfo>;
|
|
1026
|
+
getHtmlSnapshot(input: {
|
|
1027
|
+
readonly frameRef?: FrameRef;
|
|
1028
|
+
readonly documentRef?: DocumentRef;
|
|
1029
|
+
}): Promise<HtmlSnapshot>;
|
|
1030
|
+
getDomSnapshot(input: {
|
|
1031
|
+
readonly frameRef?: FrameRef;
|
|
1032
|
+
readonly documentRef?: DocumentRef;
|
|
1033
|
+
}): Promise<DomSnapshot>;
|
|
1034
|
+
waitForVisualStability(input: {
|
|
1035
|
+
readonly pageRef: PageRef;
|
|
1036
|
+
readonly timeoutMs?: number;
|
|
1037
|
+
readonly settleMs?: number;
|
|
1038
|
+
readonly scope?: "main-frame" | "visible-frames";
|
|
1039
|
+
}): Promise<void>;
|
|
1040
|
+
readText(input: NodeLocator): Promise<string | null>;
|
|
1041
|
+
readAttributes(input: NodeLocator): Promise<readonly {
|
|
1042
|
+
readonly name: string;
|
|
1043
|
+
readonly value: string;
|
|
1044
|
+
}[]>;
|
|
1045
|
+
hitTest(input: {
|
|
1046
|
+
readonly pageRef: PageRef;
|
|
1047
|
+
readonly point: Point;
|
|
1048
|
+
readonly coordinateSpace: CoordinateSpace;
|
|
1049
|
+
readonly ignorePointerEventsNone?: boolean;
|
|
1050
|
+
readonly includeUserAgentShadowDom?: boolean;
|
|
1051
|
+
}): Promise<HitTestResult>;
|
|
1052
|
+
getViewportMetrics(input: {
|
|
1053
|
+
readonly pageRef: PageRef;
|
|
1054
|
+
}): Promise<ViewportMetrics>;
|
|
1055
|
+
getNetworkRecords(input: GetNetworkRecordsInput): Promise<readonly NetworkRecord[]>;
|
|
1056
|
+
private readNetworkRecordsForPage;
|
|
1057
|
+
getCookies(input: {
|
|
1058
|
+
readonly sessionRef: SessionRef;
|
|
1059
|
+
readonly urls?: readonly string[];
|
|
1060
|
+
}): Promise<readonly CookieRecord[]>;
|
|
1061
|
+
setCookies(input: {
|
|
1062
|
+
readonly sessionRef: SessionRef;
|
|
1063
|
+
readonly cookies: readonly CookieRecord[];
|
|
1064
|
+
}): Promise<void>;
|
|
1065
|
+
getStorageSnapshot(input: {
|
|
1066
|
+
readonly sessionRef: SessionRef;
|
|
1067
|
+
readonly includeSessionStorage?: boolean;
|
|
1068
|
+
readonly includeIndexedDb?: boolean;
|
|
1069
|
+
}): Promise<StorageSnapshot>;
|
|
1070
|
+
evaluatePage(input: {
|
|
1071
|
+
readonly pageRef: PageRef;
|
|
1072
|
+
readonly script: string;
|
|
1073
|
+
readonly args?: readonly unknown[];
|
|
1074
|
+
readonly timeoutMs?: number;
|
|
1075
|
+
}): Promise<StepResult<unknown>>;
|
|
1076
|
+
addInitScript(_input: BrowserInitScriptInput): Promise<BrowserInitScriptRegistration>;
|
|
1077
|
+
registerRoute(_input: BrowserRouteRegistrationInput): Promise<BrowserRouteRegistration>;
|
|
1078
|
+
executeRequest(input: {
|
|
1079
|
+
readonly sessionRef: SessionRef;
|
|
1080
|
+
readonly request: SessionTransportRequest;
|
|
1081
|
+
readonly signal?: AbortSignal;
|
|
1082
|
+
}): Promise<StepResult<SessionTransportResponse>>;
|
|
1083
|
+
private awaitSessionHttpResponse;
|
|
1084
|
+
private createLaunchSession;
|
|
1085
|
+
private createAdoptedSession;
|
|
1086
|
+
private initializePageController;
|
|
1087
|
+
private handleFrameAttached;
|
|
1088
|
+
private handleFrameDetached;
|
|
1089
|
+
private handleFrameNavigated;
|
|
1090
|
+
private handleNavigatedWithinDocument;
|
|
1091
|
+
private handleDocumentUpdated;
|
|
1092
|
+
private syncFrameTree;
|
|
1093
|
+
private waitForPageTargetInfo;
|
|
1094
|
+
private waitForMainFrame;
|
|
1095
|
+
private waitForNavigationObservation;
|
|
1096
|
+
private captureMainFrameSnapshot;
|
|
1097
|
+
private setControllerExecutionPaused;
|
|
1098
|
+
private syncControllerExecutionPaused;
|
|
1099
|
+
private normalizeActionEvents;
|
|
1100
|
+
private executeInputAction;
|
|
1101
|
+
private detectNewTabs;
|
|
1102
|
+
private applyActionTabChange;
|
|
1103
|
+
private normalizeNetworkRecord;
|
|
1104
|
+
private createSessionHttpNetworkRecord;
|
|
1105
|
+
private storeDocumentNavigationRecord;
|
|
1106
|
+
private markNetworkRecordBodyFailure;
|
|
1107
|
+
private readLocalNetworkRecords;
|
|
1108
|
+
private projectNetworkRecordBodies;
|
|
1109
|
+
private storeNetworkRecords;
|
|
1110
|
+
private readStorageEntriesForOrigin;
|
|
1111
|
+
private readIndexedDbSnapshotForOrigin;
|
|
1112
|
+
private collectSessionStorageSnapshots;
|
|
1113
|
+
private buildPageInfo;
|
|
1114
|
+
private buildFrameInfo;
|
|
1115
|
+
private refreshTabTitle;
|
|
1116
|
+
private reconcileDocumentEpochs;
|
|
1117
|
+
private queueDocumentReconciliation;
|
|
1118
|
+
private flushDomUpdateTask;
|
|
1119
|
+
private captureDomSnapshot;
|
|
1120
|
+
private nodeRefForBackendNode;
|
|
1121
|
+
private resolveDocumentTarget;
|
|
1122
|
+
private requireLiveNode;
|
|
1123
|
+
private requireMainFrame;
|
|
1124
|
+
private requireSession;
|
|
1125
|
+
private requirePage;
|
|
1126
|
+
private requireFrame;
|
|
1127
|
+
private requireDocument;
|
|
1128
|
+
private cleanupPageController;
|
|
1129
|
+
private throwBackgroundError;
|
|
1130
|
+
private createEvent;
|
|
1131
|
+
private queueEvent;
|
|
1132
|
+
private drainQueuedEvents;
|
|
1133
|
+
private createStepResult;
|
|
1134
|
+
private retireDocument;
|
|
1135
|
+
private isDescendantFrame;
|
|
1136
|
+
private isHistoryBoundaryError;
|
|
1137
|
+
private readString;
|
|
1138
|
+
private readBoolean;
|
|
1139
|
+
private assertNotDisposed;
|
|
1140
|
+
}
|
|
1141
|
+
declare function createAbpBrowserCoreEngine(options?: AbpBrowserCoreEngineOptions): Promise<AbpBrowserCoreEngine>;
|
|
1142
|
+
|
|
1143
|
+
export { AbpBrowserCoreEngine, type AbpBrowserCoreEngineOptions, type AbpLaunchOptions, type AdoptedAbpBrowser, createAbpBrowserCoreEngine };
|