@cbxss/eoka 0.1.0-beta.10 → 0.1.0-beta.12
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 +89 -10
- package/dist/action-failure.d.ts +2 -0
- package/dist/action-failure.js +99 -0
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +12 -4
- package/dist/call-site.d.ts +5 -0
- package/dist/call-site.js +46 -0
- package/dist/duration.d.ts +3 -0
- package/dist/duration.js +10 -0
- package/dist/errors.d.ts +3 -1
- package/dist/errors.js +4 -1
- package/dist/generated/catalog.d.ts +102 -0
- package/dist/generated/catalog.js +90 -0
- package/dist/generated/protocol.d.ts +3223 -1456
- package/dist/generated/protocol.js +2 -2
- package/dist/generated/schema-bundle.json +14521 -6967
- package/dist/index.d.ts +2 -2
- package/dist/operations.js +2 -0
- package/dist/page-blockers.d.ts +7 -0
- package/dist/page-blockers.js +54 -0
- package/dist/page.d.ts +16 -2
- package/dist/page.js +63 -9
- package/dist/recording.js +2 -0
- package/dist/release-manifest.json +18 -18
- package/dist/transport.d.ts +7 -0
- package/dist/transport.js +98 -19
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type { ReleaseManifest, ChromeRelease, ChromePlatformRelease, ServerRelea
|
|
|
9
9
|
export { detectPlatform, selectPlatform } from "./platform.js";
|
|
10
10
|
export type { PlatformId } from "./platform.js";
|
|
11
11
|
export { Page } from "./page.js";
|
|
12
|
-
export type { PerformOptions, LocatorInput, PageWaitOptions, AgentStepOptions, AgentObserveOptions, FetchOptions, BoundedFetchOptions, ViewportOptions, ScreenshotOptions, ScreenshotFileOptions, RecordOptions, } from "./page.js";
|
|
12
|
+
export type { ActionOptions, PageFunction, PerformOptions, LocatorInput, PageWaitOptions, AgentStepOptions, AgentObserveOptions, FetchOptions, BoundedFetchOptions, ViewportOptions, ScreenshotOptions, ScreenshotFileOptions, RecordOptions, } from "./page.js";
|
|
13
13
|
export { Operation, OperationError } from "./operations.js";
|
|
14
14
|
export type { WaitOptions } from "./operations.js";
|
|
15
15
|
export { Recording, RecordingError } from "./recording.js";
|
|
@@ -19,4 +19,4 @@ export { EokaError, ConfigurationError, TransportError, ProtocolError, ServerOpe
|
|
|
19
19
|
export type { ErrorDetails, RequestState } from "./errors.js";
|
|
20
20
|
export type { CallOptions, InvokeClient } from "./client.js";
|
|
21
21
|
export { protocolVersion, methodNames } from "./generated/protocol.js";
|
|
22
|
-
export type { Action,
|
|
22
|
+
export type { Action, ActionOutcome, ActionReceipt, AgentAction, AgentMode, AgentObservation, AgentStepResult, BrowserState, Artifact, ArtifactContainer, ScreenshotClip, ScreenshotFormat, RecordingRecord, RecordingState, RecordingFailure, RecordingFailureStage, DispatchState, ErrorCode, ErrorData, ErrorDetail, Expectation, HelloParams, HelloResult, LocatorQuery, LocatorSpec, MethodName, MethodParams, MethodResults, OperationRecord, OperationState, PageBlocker, ProtocolRequest, ProtocolResponse, ProtocolVersion, ServerError, TransportLimits, } from "./generated/protocol.js";
|
package/dist/operations.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PageBlocker } from './generated/protocol.js';
|
|
2
|
+
export type BlockedPage = 'dialog' | 'navigation' | 'unresponsive' | 'navigation_timeout';
|
|
3
|
+
export declare const inspectBeforeContinuing = "inspect the page before deciding what to do next";
|
|
4
|
+
export declare function blockedPage(...codes: unknown[]): BlockedPage | undefined;
|
|
5
|
+
export declare function pageBlocker(data: unknown): PageBlocker | undefined;
|
|
6
|
+
export declare function nodeNextStep(blocked: BlockedPage, blocker?: PageBlocker): string;
|
|
7
|
+
export declare function withNodeNextStep(message: string, codes: readonly unknown[], data: unknown): string;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const blockedPages = {
|
|
2
|
+
DialogOpen: 'dialog',
|
|
3
|
+
dialog_open: 'dialog',
|
|
4
|
+
NavigationPending: 'navigation',
|
|
5
|
+
navigation_pending: 'navigation',
|
|
6
|
+
PageUnresponsive: 'unresponsive',
|
|
7
|
+
page_unresponsive: 'unresponsive',
|
|
8
|
+
navigation_timeout: 'navigation_timeout',
|
|
9
|
+
};
|
|
10
|
+
export const inspectBeforeContinuing = 'inspect the page before deciding what to do next';
|
|
11
|
+
function fields(value) {
|
|
12
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value) ? value : undefined;
|
|
13
|
+
}
|
|
14
|
+
export function blockedPage(...codes) {
|
|
15
|
+
for (const code of codes) {
|
|
16
|
+
if (typeof code === 'string' && Object.hasOwn(blockedPages, code))
|
|
17
|
+
return blockedPages[code];
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
export function pageBlocker(data) {
|
|
22
|
+
const blocker = fields(fields(data)?.blocker);
|
|
23
|
+
if (blocker?.kind === 'dialog' && typeof blocker.message === 'string')
|
|
24
|
+
return blocker;
|
|
25
|
+
if (blocker?.kind === 'navigation')
|
|
26
|
+
return blocker;
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
export function nodeNextStep(blocked, blocker) {
|
|
30
|
+
if (blocked === 'navigation') {
|
|
31
|
+
return 'Keep waiting, for example with page.ops.wait({ url, timeout }), or abandon the load: page.goto(url) navigates again and page.ops.reload() returns to the page that is still displayed.';
|
|
32
|
+
}
|
|
33
|
+
if (blocked === 'unresponsive') {
|
|
34
|
+
return 'Give the page time to settle; if it stays frozen, continue in a new tab with browser.newPage(url). After Browser.connect, page.ops.dialogDismiss() clears a dialog that was already open when the browser was attached.';
|
|
35
|
+
}
|
|
36
|
+
if (blocked === 'navigation_timeout') {
|
|
37
|
+
return 'Allow more time if the site is slow (timeoutMs on page.goto), or check the URL, network and proxy.';
|
|
38
|
+
}
|
|
39
|
+
const dialogType = blocker?.kind === 'dialog' ? blocker.dialogType : undefined;
|
|
40
|
+
if (dialogType === 'beforeunload')
|
|
41
|
+
return 'Call page.ops.dialogAccept() to leave the page or page.ops.dialogDismiss() to stay.';
|
|
42
|
+
if (dialogType === 'prompt')
|
|
43
|
+
return 'Call page.ops.dialogAccept({ prompt_text }) to answer the prompt or page.ops.dialogDismiss() to cancel it.';
|
|
44
|
+
return 'Call page.ops.dialogAccept() or page.ops.dialogDismiss() on this page to close the dialog.';
|
|
45
|
+
}
|
|
46
|
+
export function withNodeNextStep(message, codes, data) {
|
|
47
|
+
const blocked = blockedPage(...codes);
|
|
48
|
+
if (blocked === undefined)
|
|
49
|
+
return message;
|
|
50
|
+
const sentence = message.trimEnd();
|
|
51
|
+
const interrupted = fields(fields(fields(data)?.detail)?.context)?.action_status === 'may_have_executed';
|
|
52
|
+
const consequence = interrupted ? ` The interrupted call may already have changed the page; ${inspectBeforeContinuing}.` : '';
|
|
53
|
+
return `${sentence}${/[.!?]$/.test(sentence) ? '' : '.'} ${nodeNextStep(blocked, pageBlocker(data))}${consequence}`;
|
|
54
|
+
}
|
package/dist/page.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { type CatalogOperations } from './generated/catalog.js';
|
|
1
2
|
import { Buffer } from 'node:buffer';
|
|
2
3
|
import type { CallOptions, InvokeClient } from './client.js';
|
|
3
|
-
import type { Action, ActionOptions, ActionReceipt, AgentAction, AgentMode, AgentObservation, AgentStepResult, BrowserState, Expectation, LocatorSpec, MethodName, MethodParams, MethodResults, OperationRecord, InputMode, Destination } from './generated/protocol.js';
|
|
4
|
+
import type { Action, ActionOptions as WireActionOptions, ActionReceipt, AgentAction, AgentMode, AgentObservation, AgentStepResult, BrowserState, Expectation, LocatorSpec, MethodName, MethodParams, MethodResults, OperationRecord, InputMode, Destination } from './generated/protocol.js';
|
|
4
5
|
import { Operation } from './operations.js';
|
|
5
6
|
import { Recording } from './recording.js';
|
|
6
7
|
export type LocatorInput = string | LocatorSpec;
|
|
8
|
+
type Declared<T> = {
|
|
9
|
+
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
|
|
10
|
+
};
|
|
11
|
+
export type ActionOptions = Declared<WireActionOptions>;
|
|
12
|
+
export type PageFunction<R = unknown> = (...args: any[]) => R;
|
|
7
13
|
export interface PerformOptions {
|
|
8
14
|
operationId?: string;
|
|
9
15
|
actionOptions?: ActionOptions;
|
|
@@ -37,6 +43,12 @@ export type RecordOptions = Pick<MethodParams['recording.start'], 'path' | 'fps'
|
|
|
37
43
|
export declare class Page implements InvokeClient {
|
|
38
44
|
readonly id: string;
|
|
39
45
|
private readonly client;
|
|
46
|
+
/**
|
|
47
|
+
* Every operation the eoka CLI offers, bound to this page and generated from
|
|
48
|
+
* the operation catalog: `page.ops.console()`, `page.ops.cookies()`,
|
|
49
|
+
* `page.ops.networkRecordStart()`. Results are not yet typed.
|
|
50
|
+
*/
|
|
51
|
+
readonly ops: CatalogOperations;
|
|
40
52
|
constructor(client: InvokeClient, id: string);
|
|
41
53
|
supports(method: string): boolean;
|
|
42
54
|
hasCapability(name: string): boolean;
|
|
@@ -68,9 +80,10 @@ export declare class Page implements InvokeClient {
|
|
|
68
80
|
waitFor(selector: string, options?: PageWaitOptions): Promise<void>;
|
|
69
81
|
waitForVisible(selector: string, options?: PageWaitOptions): Promise<void>;
|
|
70
82
|
waitForText(text: string, options?: PageWaitOptions): Promise<void>;
|
|
83
|
+
evaluate<R>(fn: PageFunction<R>, args?: unknown[], options?: CallOptions): Promise<Awaited<R>>;
|
|
71
84
|
evaluate(fn: string, args?: unknown[], options?: CallOptions): Promise<unknown>;
|
|
72
85
|
evaluateRaw(js: string, options?: CallOptions): Promise<unknown>;
|
|
73
|
-
execute(fn: string, args?: unknown[], options?: CallOptions): Promise<void>;
|
|
86
|
+
execute(fn: string | PageFunction, args?: unknown[], options?: CallOptions): Promise<void>;
|
|
74
87
|
executeRaw(js: string, options?: CallOptions): Promise<void>;
|
|
75
88
|
/** List every frame in the page, including cross-origin OOPIFs. */
|
|
76
89
|
frames(options?: CallOptions): Promise<MethodResults['page.frames']>;
|
|
@@ -105,3 +118,4 @@ export declare class Page implements InvokeClient {
|
|
|
105
118
|
step(action: AgentAction, options?: AgentStepOptions): Promise<AgentStepResult>;
|
|
106
119
|
close(options?: CallOptions): Promise<void>;
|
|
107
120
|
}
|
|
121
|
+
export {};
|
package/dist/page.js
CHANGED
|
@@ -1,18 +1,65 @@
|
|
|
1
|
+
import { catalogOperations } from './generated/catalog.js';
|
|
2
|
+
import bundle from './generated/schema-bundle.json' with { type: 'json' };
|
|
1
3
|
import { Buffer } from 'node:buffer';
|
|
2
4
|
import { randomUUID } from 'node:crypto';
|
|
3
5
|
import { resolve } from 'node:path';
|
|
6
|
+
import { actionFailureMessage } from './action-failure.js';
|
|
7
|
+
import { traceCallSites } from './call-site.js';
|
|
8
|
+
import { duration, maximumTimer, serverGraceMs } from './duration.js';
|
|
9
|
+
import { ConfigurationError, EokaError } from './errors.js';
|
|
4
10
|
import { Operation, OperationError, operationFailure, validateOperationRecord } from './operations.js';
|
|
5
11
|
import { Recording, RecordingError, recordingFailure, requireCaptureCapability, validateRecordingRecord } from './recording.js';
|
|
6
12
|
const recordingIdPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
13
|
+
const actionOptionKeys = Object.keys(bundle.types.ActionOptions.properties);
|
|
14
|
+
const defaultActionTimeoutMs = bundle.types.ActionOptions.properties.timeout_ms.default;
|
|
15
|
+
const maximumWaitMs = bundle.methods['operations.wait'].params.properties.timeout_ms.maximum;
|
|
7
16
|
function locator(target) {
|
|
8
17
|
return typeof target === 'string' ? { query: { kind: 'css', selector: target } } : target;
|
|
9
18
|
}
|
|
19
|
+
function comparable(name) {
|
|
20
|
+
return name.replace(/[^a-z0-9]/gi, '').toLowerCase();
|
|
21
|
+
}
|
|
22
|
+
function rejectUnknownActionOptions(options, operationId) {
|
|
23
|
+
for (const key of Object.keys(options)) {
|
|
24
|
+
if (actionOptionKeys.includes(key))
|
|
25
|
+
continue;
|
|
26
|
+
const intended = actionOptionKeys.find(name => comparable(name) === comparable(key));
|
|
27
|
+
throw new ConfigurationError(`Unknown actionOptions key "${key}"${intended === undefined ? '.' : `; did you mean "${intended}"?`} Valid keys: ${actionOptionKeys.join(', ')}.`, { operationId, requestState: 'not_sent' });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function actionBudget(options) {
|
|
31
|
+
const localMs = options.timeoutMs === undefined ? undefined : duration(options.timeoutMs, 0, 'timeoutMs');
|
|
32
|
+
const requested = options.actionOptions?.timeout_ms;
|
|
33
|
+
if (requested !== undefined && (typeof requested !== 'number' || !Number.isFinite(requested) || requested < 0)) {
|
|
34
|
+
return { actionMs: undefined, localMs: localMs ?? defaultActionTimeoutMs + serverGraceMs, settleMs: 0 };
|
|
35
|
+
}
|
|
36
|
+
if (requested !== undefined && localMs !== undefined)
|
|
37
|
+
return { actionMs: requested, localMs, settleMs: 0 };
|
|
38
|
+
const actionMs = requested ?? (localMs === undefined ? defaultActionTimeoutMs : Math.ceil(localMs));
|
|
39
|
+
return { actionMs, localMs: actionMs === 0 ? 0 : Math.min(maximumTimer, actionMs + serverGraceMs), settleMs: serverGraceMs / 2 };
|
|
40
|
+
}
|
|
41
|
+
function functionSource(fn, method) {
|
|
42
|
+
if (typeof fn !== 'function')
|
|
43
|
+
return fn;
|
|
44
|
+
const source = fn.toString();
|
|
45
|
+
if (/\{\s*\[native code\]\s*\}$/.test(source)) {
|
|
46
|
+
throw new ConfigurationError(`${method} needs a function with source text; native and bound functions cannot be sent to the page`, { requestState: 'not_sent' });
|
|
47
|
+
}
|
|
48
|
+
return source;
|
|
49
|
+
}
|
|
10
50
|
export class Page {
|
|
11
51
|
id;
|
|
12
52
|
client;
|
|
53
|
+
/**
|
|
54
|
+
* Every operation the eoka CLI offers, bound to this page and generated from
|
|
55
|
+
* the operation catalog: `page.ops.console()`, `page.ops.cookies()`,
|
|
56
|
+
* `page.ops.networkRecordStart()`. Results are not yet typed.
|
|
57
|
+
*/
|
|
58
|
+
ops;
|
|
13
59
|
constructor(client, id) {
|
|
14
60
|
this.client = client;
|
|
15
61
|
this.id = id;
|
|
62
|
+
this.ops = catalogOperations(this);
|
|
16
63
|
}
|
|
17
64
|
supports(method) { return this.client.supports?.(method) === true; }
|
|
18
65
|
hasCapability(name) { return this.client.hasCapability?.(name) === true; }
|
|
@@ -27,6 +74,8 @@ export class Page {
|
|
|
27
74
|
}
|
|
28
75
|
async perform(action, options = {}) {
|
|
29
76
|
const id = options.operationId ?? randomUUID();
|
|
77
|
+
if (options.actionOptions != null && typeof options.actionOptions === 'object')
|
|
78
|
+
rejectUnknownActionOptions(options.actionOptions, id);
|
|
30
79
|
if ((action.kind === 'click' || action.kind === 'type' || action.kind === 'press_key' || action.kind === 'submit' || action.kind === 'drag' || action.kind === 'insert_text') && options.actionOptions?.expect == null) {
|
|
31
80
|
throw new OperationError('expectation_required', 'This action requires actionOptions.expect before dispatch.', id, undefined, { requestState: 'not_sent' });
|
|
32
81
|
}
|
|
@@ -48,16 +97,17 @@ export class Page {
|
|
|
48
97
|
}
|
|
49
98
|
}
|
|
50
99
|
async verified(action, options = {}) {
|
|
51
|
-
const
|
|
52
|
-
const deadline = performance.now() +
|
|
53
|
-
const
|
|
100
|
+
const budget = actionBudget(options);
|
|
101
|
+
const deadline = performance.now() + budget.localMs;
|
|
102
|
+
const actionOptions = budget.actionMs === undefined ? options.actionOptions : { ...options.actionOptions, timeout_ms: budget.actionMs };
|
|
103
|
+
const operation = await this.perform(action, { ...options, ...(actionOptions === undefined ? {} : { actionOptions }), timeoutMs: budget.localMs });
|
|
54
104
|
let record = operation.record;
|
|
55
105
|
const remaining = deadline - performance.now();
|
|
56
106
|
if (remaining <= 0) {
|
|
57
107
|
throw new OperationError('DeadlineExceeded', 'The local action deadline elapsed; recover the operation by ID to learn its outcome.', operation.id, record, { requestState: 'acknowledged' });
|
|
58
108
|
}
|
|
59
109
|
if (record?.state === 'running' || record === undefined) {
|
|
60
|
-
const waitOptions = { timeoutMs: remaining, waitTimeoutMs: Math.floor(remaining) };
|
|
110
|
+
const waitOptions = { timeoutMs: remaining, waitTimeoutMs: Math.min(maximumWaitMs, Math.floor(Math.max(0, remaining - budget.settleMs))) };
|
|
61
111
|
if (options.signal !== undefined)
|
|
62
112
|
waitOptions.signal = options.signal;
|
|
63
113
|
record = await operation.wait(waitOptions);
|
|
@@ -67,7 +117,10 @@ export class Page {
|
|
|
67
117
|
throw new OperationError('DeadlineExceeded', 'The local action deadline elapsed; recover the operation by ID to learn its outcome.', operation.id, record, { requestState: 'acknowledged' });
|
|
68
118
|
}
|
|
69
119
|
if (record.state !== 'finished' || record.outcome !== 'verified_complete' || record.receipt?.outcome !== 'verified_complete' || record.error_code != null) {
|
|
70
|
-
|
|
120
|
+
const details = { requestState: 'acknowledged' };
|
|
121
|
+
if (record.error != null)
|
|
122
|
+
details.cause = new EokaError(record.error.code, record.error.message, { operationId: operation.id, data: record.error });
|
|
123
|
+
throw new OperationError(record.error_code ?? (record.state === 'running' ? 'OperationRunning' : record.outcome), actionFailureMessage(action, actionOptions?.expect, budget.actionMs, record), operation.id, record, details);
|
|
71
124
|
}
|
|
72
125
|
return record.receipt;
|
|
73
126
|
}
|
|
@@ -132,13 +185,13 @@ export class Page {
|
|
|
132
185
|
await this.invoke('page.wait_for_text', { pageId: this.id, text, timeoutMs: waitTimeoutMs }, localOptions);
|
|
133
186
|
}
|
|
134
187
|
async evaluate(fn, args = [], options) {
|
|
135
|
-
return (await this.invoke('page.evaluate', { pageId: this.id, function: fn, arguments: args }, options)).result;
|
|
188
|
+
return (await this.invoke('page.evaluate', { pageId: this.id, function: functionSource(fn, 'page.evaluate'), arguments: args }, options)).result;
|
|
136
189
|
}
|
|
137
190
|
async evaluateRaw(js, options) {
|
|
138
191
|
return (await this.invoke('page.evaluate_raw', { pageId: this.id, js }, options)).result;
|
|
139
192
|
}
|
|
140
193
|
async execute(fn, args = [], options) {
|
|
141
|
-
await this.invoke('page.execute', { pageId: this.id, function: fn, arguments: args }, options);
|
|
194
|
+
await this.invoke('page.execute', { pageId: this.id, function: functionSource(fn, 'page.execute'), arguments: args }, options);
|
|
142
195
|
}
|
|
143
196
|
async executeRaw(js, options) {
|
|
144
197
|
await this.invoke('page.execute_raw', { pageId: this.id, js }, options);
|
|
@@ -159,7 +212,7 @@ export class Page {
|
|
|
159
212
|
// server-side resolution deadline. Derive an RPC deadline that cannot
|
|
160
213
|
// outlive a long resolution when the caller did not set one explicitly.
|
|
161
214
|
if (callOptions.timeoutMs === undefined && resolveTimeoutMs !== undefined) {
|
|
162
|
-
callOptions.timeoutMs = resolveTimeoutMs +
|
|
215
|
+
callOptions.timeoutMs = resolveTimeoutMs + serverGraceMs;
|
|
163
216
|
}
|
|
164
217
|
return this.invoke('page.click_shadow', {
|
|
165
218
|
pageId: this.id,
|
|
@@ -176,7 +229,7 @@ export class Page {
|
|
|
176
229
|
solveTurnstile(options = {}) {
|
|
177
230
|
const { timeoutMs = 30_000, ...callOptions } = options;
|
|
178
231
|
// The local deadline outlasts the server's solve deadline so its error wins.
|
|
179
|
-
return this.invoke('page.solve_turnstile', { pageId: this.id, timeoutMs }, { ...callOptions, timeoutMs: timeoutMs +
|
|
232
|
+
return this.invoke('page.solve_turnstile', { pageId: this.id, timeoutMs }, { ...callOptions, timeoutMs: timeoutMs + serverGraceMs });
|
|
180
233
|
}
|
|
181
234
|
async captureState(options) {
|
|
182
235
|
return (await this.invoke('page.capture_state', { pageId: this.id }, options)).state;
|
|
@@ -297,3 +350,4 @@ export class Page {
|
|
|
297
350
|
await this.invoke('page.close', { pageId: this.id }, options);
|
|
298
351
|
}
|
|
299
352
|
}
|
|
353
|
+
traceCallSites(Page.prototype);
|
package/dist/recording.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isAbsolute, toNamespacedPath } from 'node:path';
|
|
2
|
+
import { traceCallSites } from './call-site.js';
|
|
2
3
|
import { EokaError } from './errors.js';
|
|
3
4
|
export function requireCaptureCapability(client, method, capability) {
|
|
4
5
|
if (client.supports?.(method) !== true) {
|
|
@@ -122,3 +123,4 @@ export class Recording {
|
|
|
122
123
|
return record;
|
|
123
124
|
}
|
|
124
125
|
}
|
|
126
|
+
traceCallSites(Recording.prototype);
|
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"sdkVersion": "0.1.0-beta.
|
|
3
|
+
"sdkVersion": "0.1.0-beta.12",
|
|
4
4
|
"installerVersion": "3.2.4",
|
|
5
5
|
"server": {
|
|
6
|
-
"version": "0.
|
|
7
|
-
"protocolVersion": "2.
|
|
6
|
+
"version": "0.10.0",
|
|
7
|
+
"protocolVersion": "2.2",
|
|
8
8
|
"platforms": {
|
|
9
9
|
"linux-x64-gnu": {
|
|
10
10
|
"packageName": "@cbxss/eoka-server-linux-x64-gnu",
|
|
11
|
-
"packageVersion": "0.1.0-beta.
|
|
11
|
+
"packageVersion": "0.1.0-beta.12",
|
|
12
12
|
"target": "x86_64-unknown-linux-gnu",
|
|
13
13
|
"asset": "eoka-server-linux-amd64",
|
|
14
14
|
"executablePath": "bin/eoka-server",
|
|
15
|
-
"sha256": "
|
|
16
|
-
"size":
|
|
15
|
+
"sha256": "c6dfd03cf49b48884016d5774fcdd78a6c58a157f8a0a8938ffe30e9f65aad05",
|
|
16
|
+
"size": 30544224,
|
|
17
17
|
"minimumGlibc": "2.35",
|
|
18
18
|
"development": false
|
|
19
19
|
},
|
|
20
20
|
"linux-arm64-gnu": {
|
|
21
21
|
"packageName": "@cbxss/eoka-server-linux-arm64-gnu",
|
|
22
|
-
"packageVersion": "0.1.0-beta.
|
|
22
|
+
"packageVersion": "0.1.0-beta.12",
|
|
23
23
|
"target": "aarch64-unknown-linux-gnu",
|
|
24
24
|
"asset": "eoka-server-linux-arm64",
|
|
25
25
|
"executablePath": "bin/eoka-server",
|
|
26
|
-
"sha256": "
|
|
27
|
-
"size":
|
|
26
|
+
"sha256": "c3220d78ced90ff3f9c6bd2dfa13e4ed69e4e0ebc101b807a5d974ab4191dc99",
|
|
27
|
+
"size": 28113504,
|
|
28
28
|
"minimumGlibc": "2.35",
|
|
29
29
|
"development": false
|
|
30
30
|
},
|
|
31
31
|
"darwin-x64": {
|
|
32
32
|
"packageName": "@cbxss/eoka-server-darwin-x64",
|
|
33
|
-
"packageVersion": "0.1.0-beta.
|
|
33
|
+
"packageVersion": "0.1.0-beta.12",
|
|
34
34
|
"target": "x86_64-apple-darwin",
|
|
35
35
|
"asset": "eoka-server-darwin-amd64",
|
|
36
36
|
"executablePath": "bin/eoka-server",
|
|
37
|
-
"sha256": "
|
|
38
|
-
"size":
|
|
37
|
+
"sha256": "da96b2a0a34773931071aab849e05bc7be467f5aed177ab2a2e5ec1c2bf93232",
|
|
38
|
+
"size": 27288048,
|
|
39
39
|
"minimumGlibc": null,
|
|
40
40
|
"development": false
|
|
41
41
|
},
|
|
42
42
|
"darwin-arm64": {
|
|
43
43
|
"packageName": "@cbxss/eoka-server-darwin-arm64",
|
|
44
|
-
"packageVersion": "0.1.0-beta.
|
|
44
|
+
"packageVersion": "0.1.0-beta.12",
|
|
45
45
|
"target": "aarch64-apple-darwin",
|
|
46
46
|
"asset": "eoka-server-darwin-arm64",
|
|
47
47
|
"executablePath": "bin/eoka-server",
|
|
48
|
-
"sha256": "
|
|
49
|
-
"size":
|
|
48
|
+
"sha256": "dfb9666bf9c9aa6e3fd5273a6fd86b61050f6f99f44808d6e41861e07ff46767",
|
|
49
|
+
"size": 25488912,
|
|
50
50
|
"minimumGlibc": null,
|
|
51
51
|
"development": false
|
|
52
52
|
},
|
|
53
53
|
"win32-x64": {
|
|
54
54
|
"packageName": "@cbxss/eoka-server-win32-x64",
|
|
55
|
-
"packageVersion": "0.1.0-beta.
|
|
55
|
+
"packageVersion": "0.1.0-beta.12",
|
|
56
56
|
"target": "x86_64-pc-windows-msvc",
|
|
57
57
|
"asset": "eoka-server-windows-amd64.exe",
|
|
58
58
|
"executablePath": "bin/eoka-server.exe",
|
|
59
|
-
"sha256": "
|
|
60
|
-
"size":
|
|
59
|
+
"sha256": "dc7c1b549e359e89dd8c21fdde4889a340c9ffca120df1fc6047c502002dac95",
|
|
60
|
+
"size": 25646080,
|
|
61
61
|
"minimumGlibc": null,
|
|
62
62
|
"development": false
|
|
63
63
|
}
|
package/dist/transport.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface SidecarStartOptions {
|
|
|
5
5
|
env?: NodeJS.ProcessEnv;
|
|
6
6
|
timeoutMs?: number;
|
|
7
7
|
shutdownTimeoutMs?: number;
|
|
8
|
+
defaultTimeoutMs?: number | null;
|
|
8
9
|
signal?: AbortSignal;
|
|
9
10
|
redactionValues?: readonly string[];
|
|
10
11
|
onTransport?: (transport: SidecarTransport) => void;
|
|
@@ -13,9 +14,11 @@ export interface TrackedInvocation<M extends MethodName> {
|
|
|
13
14
|
result: Promise<MethodResults[M]>;
|
|
14
15
|
completion: Promise<MethodResults[M]>;
|
|
15
16
|
}
|
|
17
|
+
export declare const defaultCallTimeoutMs = 120000;
|
|
16
18
|
export declare class SidecarTransport implements InvokeClient {
|
|
17
19
|
private readonly child;
|
|
18
20
|
private readonly shutdownTimeoutMs;
|
|
21
|
+
private readonly defaultTimeoutMs;
|
|
19
22
|
private readonly pending;
|
|
20
23
|
private readonly decoder;
|
|
21
24
|
private greeting;
|
|
@@ -23,6 +26,7 @@ export declare class SidecarTransport implements InvokeClient {
|
|
|
23
26
|
private nextId;
|
|
24
27
|
private messageLimit;
|
|
25
28
|
private pendingLimit;
|
|
29
|
+
private inFlight;
|
|
26
30
|
private frame;
|
|
27
31
|
private frameLength;
|
|
28
32
|
private queuedBytes;
|
|
@@ -40,6 +44,7 @@ export declare class SidecarTransport implements InvokeClient {
|
|
|
40
44
|
private cleanupError;
|
|
41
45
|
private closeCompletion;
|
|
42
46
|
private teardownTimer;
|
|
47
|
+
private closeDeadline;
|
|
43
48
|
private shutdownId;
|
|
44
49
|
private readonly closed;
|
|
45
50
|
private terminationConfirmed;
|
|
@@ -61,6 +66,7 @@ export declare class SidecarTransport implements InvokeClient {
|
|
|
61
66
|
}): Promise<MethodResults['browser.close_tab']>;
|
|
62
67
|
private validate;
|
|
63
68
|
private request;
|
|
69
|
+
private fallbackTimeout;
|
|
64
70
|
private details;
|
|
65
71
|
private detach;
|
|
66
72
|
private remove;
|
|
@@ -77,6 +83,7 @@ export declare class SidecarTransport implements InvokeClient {
|
|
|
77
83
|
private readonly onProcessError;
|
|
78
84
|
private readonly onExit;
|
|
79
85
|
private readonly onClose;
|
|
86
|
+
private awaitGroupExit;
|
|
80
87
|
close(): Promise<void>;
|
|
81
88
|
whenClosed(): Promise<void>;
|
|
82
89
|
get ownedProcessesTerminated(): boolean;
|