@cbxss/eoka 0.1.0-beta.1 → 0.1.0-beta.11
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 +98 -467
- package/dist/browser-install-inventory.d.ts +10 -1
- package/dist/browser-install-inventory.js +8 -2
- package/dist/browser.d.ts +3 -0
- package/dist/browser.js +7 -0
- package/dist/cloudflare.d.ts +12 -0
- package/dist/cloudflare.js +19 -0
- package/dist/generated/protocol.d.ts +995 -18
- package/dist/generated/protocol.js +2 -2
- package/dist/generated/schema-bundle.json +5228 -250
- package/dist/index.d.ts +1 -0
- package/dist/page.d.ts +35 -5
- package/dist/page.js +61 -12
- package/dist/release-manifest.json +29 -29
- package/dist/release.js +1 -1
- package/dist/server-binary.d.ts +1 -0
- package/dist/server-binary.js +24 -1
- package/examples/explicit-paths.mjs +1 -1
- package/examples/offline.mjs +1 -1
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Browser } from "./browser.js";
|
|
2
2
|
export type { BrowserOptions, LaunchOptions, ConnectOptions } from "./browser.js";
|
|
3
|
+
export type { CloudflareOptions } from "./cloudflare.js";
|
|
3
4
|
export { installBrowser } from "./browser-install.js";
|
|
4
5
|
export type { InstallBrowserOptions, InstallProgress, BrowserInstallation } from "./browser-install.js";
|
|
5
6
|
export { InstallationError } from "./install-errors.js";
|
package/dist/page.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Buffer } from 'node:buffer';
|
|
2
2
|
import type { CallOptions, InvokeClient } from './client.js';
|
|
3
|
-
import type { Action, ActionOptions, ActionReceipt, AgentAction, AgentMode, AgentObservation, AgentStepResult, BrowserState, Expectation, LocatorSpec, MethodName, MethodParams, MethodResults, OperationRecord } from './generated/protocol.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
4
|
import { Operation } from './operations.js';
|
|
5
5
|
import { Recording } from './recording.js';
|
|
6
6
|
export type LocatorInput = string | LocatorSpec;
|
|
@@ -14,10 +14,14 @@ export interface PageWaitOptions extends CallOptions {
|
|
|
14
14
|
waitTimeoutMs?: number;
|
|
15
15
|
}
|
|
16
16
|
export interface AgentObserveOptions extends CallOptions {
|
|
17
|
+
cursor?: string;
|
|
18
|
+
role?: string;
|
|
19
|
+
name?: string;
|
|
17
20
|
observationTimeoutMs?: number;
|
|
18
21
|
maxControls?: number;
|
|
19
22
|
}
|
|
20
23
|
export interface AgentStepOptions extends AgentObserveOptions {
|
|
24
|
+
destination?: Destination;
|
|
21
25
|
expect?: Expectation;
|
|
22
26
|
mode?: AgentMode;
|
|
23
27
|
actionTimeoutMs?: number;
|
|
@@ -42,11 +46,15 @@ export declare class Page implements InvokeClient {
|
|
|
42
46
|
perform(action: Action, options?: PerformOptions): Promise<Operation>;
|
|
43
47
|
private verified;
|
|
44
48
|
goto(url: string, options?: PerformOptions): Promise<ActionReceipt>;
|
|
45
|
-
fill(target: LocatorInput, value: string, options?: PerformOptions
|
|
49
|
+
fill(target: LocatorInput, value: string, options?: PerformOptions & {
|
|
50
|
+
inputMode?: InputMode;
|
|
51
|
+
}): Promise<ActionReceipt>;
|
|
46
52
|
select(target: LocatorInput, value: string | string[], options?: PerformOptions): Promise<ActionReceipt>;
|
|
47
53
|
hover(target: LocatorInput, options?: PerformOptions): Promise<ActionReceipt>;
|
|
48
54
|
click(target: LocatorInput, options?: PerformOptions): Promise<ActionReceipt>;
|
|
49
|
-
type(target: LocatorInput, text: string, options?: PerformOptions
|
|
55
|
+
type(target: LocatorInput, text: string, options?: PerformOptions & {
|
|
56
|
+
inputMode?: InputMode;
|
|
57
|
+
}): Promise<ActionReceipt>;
|
|
50
58
|
pressKey(key: string, options?: PerformOptions): Promise<ActionReceipt>;
|
|
51
59
|
submit(target: LocatorInput, options?: PerformOptions): Promise<ActionReceipt>;
|
|
52
60
|
drag(target: LocatorInput, dx: number, dy: number, options?: PerformOptions): Promise<ActionReceipt>;
|
|
@@ -60,8 +68,30 @@ export declare class Page implements InvokeClient {
|
|
|
60
68
|
waitFor(selector: string, options?: PageWaitOptions): Promise<void>;
|
|
61
69
|
waitForVisible(selector: string, options?: PageWaitOptions): Promise<void>;
|
|
62
70
|
waitForText(text: string, options?: PageWaitOptions): Promise<void>;
|
|
63
|
-
evaluate(
|
|
64
|
-
|
|
71
|
+
evaluate(fn: string, args?: unknown[], options?: CallOptions): Promise<unknown>;
|
|
72
|
+
evaluateRaw(js: string, options?: CallOptions): Promise<unknown>;
|
|
73
|
+
execute(fn: string, args?: unknown[], options?: CallOptions): Promise<void>;
|
|
74
|
+
executeRaw(js: string, options?: CallOptions): Promise<void>;
|
|
75
|
+
/** List every frame in the page, including cross-origin OOPIFs. */
|
|
76
|
+
frames(options?: CallOptions): Promise<MethodResults['page.frames']>;
|
|
77
|
+
/**
|
|
78
|
+
* Click an element inside a closed shadow root in the top frame or a child
|
|
79
|
+
* frame. `frameId` comes from `frames()`. The selector is searched through
|
|
80
|
+
* the frame's light DOM and every shadow root; the node's center is mapped
|
|
81
|
+
* to viewport coordinates and clicked with human-like movement.
|
|
82
|
+
*/
|
|
83
|
+
clickShadow(selector: string, options?: {
|
|
84
|
+
frameId?: string;
|
|
85
|
+
resolveTimeoutMs?: number;
|
|
86
|
+
} & CallOptions): Promise<MethodResults['page.click_shadow']>;
|
|
87
|
+
/**
|
|
88
|
+
* Best-effort helper for interactive Cloudflare challenge pages: the server
|
|
89
|
+
* clicks the Turnstile checkbox through its closed shadow root until the page
|
|
90
|
+
* leaves the challenge. Resolves with zero clicks on a normal page.
|
|
91
|
+
*/
|
|
92
|
+
solveTurnstile(options?: {
|
|
93
|
+
timeoutMs?: number;
|
|
94
|
+
} & CallOptions): Promise<MethodResults['page.solve_turnstile']>;
|
|
65
95
|
captureState(options?: CallOptions): Promise<BrowserState>;
|
|
66
96
|
restoreState(state: BrowserState, options?: CallOptions): Promise<void>;
|
|
67
97
|
fetch(url: string, fetchOptions?: FetchOptions, options?: CallOptions): Promise<MethodResults['page.fetch']>;
|
package/dist/page.js
CHANGED
|
@@ -67,15 +67,15 @@ export class Page {
|
|
|
67
67
|
throw new OperationError('DeadlineExceeded', 'The local action deadline elapsed; recover the operation by ID to learn its outcome.', operation.id, record, { requestState: 'acknowledged' });
|
|
68
68
|
}
|
|
69
69
|
if (record.state !== 'finished' || record.outcome !== 'verified_complete' || record.receipt?.outcome !== 'verified_complete' || record.error_code != null) {
|
|
70
|
-
throw new OperationError(record.error_code ?? (record.state === 'running' ? 'OperationRunning' : record.outcome), `Operation ${operation.id} is ${record.state} with outcome ${record.outcome}; verified completion was not established.`, operation.id, record, { requestState: 'acknowledged' });
|
|
70
|
+
throw new OperationError(record.error_code ?? (record.state === 'running' ? 'OperationRunning' : record.outcome), record.error?.message ?? `Operation ${operation.id} is ${record.state} with outcome ${record.outcome}; verified completion was not established.`, operation.id, record, { requestState: 'acknowledged' });
|
|
71
71
|
}
|
|
72
72
|
return record.receipt;
|
|
73
73
|
}
|
|
74
74
|
goto(url, options) {
|
|
75
75
|
return this.verified({ kind: 'navigate', url }, options);
|
|
76
76
|
}
|
|
77
|
-
fill(target, value, options) {
|
|
78
|
-
return this.verified({ kind: 'fill', target: locator(target), value }, options);
|
|
77
|
+
fill(target, value, options = {}) {
|
|
78
|
+
return this.verified({ kind: 'fill', target: locator(target), value, input_mode: options.inputMode ?? 'sequential' }, options);
|
|
79
79
|
}
|
|
80
80
|
select(target, value, options) {
|
|
81
81
|
return this.verified({ kind: 'select', target: locator(target), values: typeof value === 'string' ? [value] : value }, options);
|
|
@@ -86,8 +86,8 @@ export class Page {
|
|
|
86
86
|
click(target, options) {
|
|
87
87
|
return this.verified({ kind: 'click', target: locator(target) }, options);
|
|
88
88
|
}
|
|
89
|
-
type(target, text, options) {
|
|
90
|
-
return this.verified({ kind: 'type', target: locator(target), text }, options);
|
|
89
|
+
type(target, text, options = {}) {
|
|
90
|
+
return this.verified({ kind: 'type', target: locator(target), text, input_mode: options.inputMode ?? 'sequential' }, options);
|
|
91
91
|
}
|
|
92
92
|
pressKey(key, options) {
|
|
93
93
|
return this.verified({ kind: 'press_key', key }, options);
|
|
@@ -131,11 +131,52 @@ export class Page {
|
|
|
131
131
|
const { waitTimeoutMs = 30_000, ...localOptions } = options;
|
|
132
132
|
await this.invoke('page.wait_for_text', { pageId: this.id, text, timeoutMs: waitTimeoutMs }, localOptions);
|
|
133
133
|
}
|
|
134
|
-
async evaluate(
|
|
135
|
-
return (await this.invoke('page.evaluate', { pageId: this.id,
|
|
136
|
-
}
|
|
137
|
-
async
|
|
138
|
-
await this.invoke('page.
|
|
134
|
+
async evaluate(fn, args = [], options) {
|
|
135
|
+
return (await this.invoke('page.evaluate', { pageId: this.id, function: fn, arguments: args }, options)).result;
|
|
136
|
+
}
|
|
137
|
+
async evaluateRaw(js, options) {
|
|
138
|
+
return (await this.invoke('page.evaluate_raw', { pageId: this.id, js }, options)).result;
|
|
139
|
+
}
|
|
140
|
+
async execute(fn, args = [], options) {
|
|
141
|
+
await this.invoke('page.execute', { pageId: this.id, function: fn, arguments: args }, options);
|
|
142
|
+
}
|
|
143
|
+
async executeRaw(js, options) {
|
|
144
|
+
await this.invoke('page.execute_raw', { pageId: this.id, js }, options);
|
|
145
|
+
}
|
|
146
|
+
/** List every frame in the page, including cross-origin OOPIFs. */
|
|
147
|
+
async frames(options) {
|
|
148
|
+
return this.invoke('page.frames', { pageId: this.id }, options);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Click an element inside a closed shadow root in the top frame or a child
|
|
152
|
+
* frame. `frameId` comes from `frames()`. The selector is searched through
|
|
153
|
+
* the frame's light DOM and every shadow root; the node's center is mapped
|
|
154
|
+
* to viewport coordinates and clicked with human-like movement.
|
|
155
|
+
*/
|
|
156
|
+
async clickShadow(selector, options = {}) {
|
|
157
|
+
const { frameId, resolveTimeoutMs, ...callOptions } = options;
|
|
158
|
+
// `CallOptions.timeoutMs` is the RPC deadline; `resolveTimeoutMs` is the
|
|
159
|
+
// server-side resolution deadline. Derive an RPC deadline that cannot
|
|
160
|
+
// outlive a long resolution when the caller did not set one explicitly.
|
|
161
|
+
if (callOptions.timeoutMs === undefined && resolveTimeoutMs !== undefined) {
|
|
162
|
+
callOptions.timeoutMs = resolveTimeoutMs + 10_000;
|
|
163
|
+
}
|
|
164
|
+
return this.invoke('page.click_shadow', {
|
|
165
|
+
pageId: this.id,
|
|
166
|
+
selector,
|
|
167
|
+
...(frameId === undefined ? {} : { frameId }),
|
|
168
|
+
...(resolveTimeoutMs === undefined ? {} : { timeoutMs: resolveTimeoutMs }),
|
|
169
|
+
}, callOptions);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Best-effort helper for interactive Cloudflare challenge pages: the server
|
|
173
|
+
* clicks the Turnstile checkbox through its closed shadow root until the page
|
|
174
|
+
* leaves the challenge. Resolves with zero clicks on a normal page.
|
|
175
|
+
*/
|
|
176
|
+
solveTurnstile(options = {}) {
|
|
177
|
+
const { timeoutMs = 30_000, ...callOptions } = options;
|
|
178
|
+
// 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 + 10_000 });
|
|
139
180
|
}
|
|
140
181
|
async captureState(options) {
|
|
141
182
|
return (await this.invoke('page.capture_state', { pageId: this.id }, options)).state;
|
|
@@ -208,8 +249,14 @@ export class Page {
|
|
|
208
249
|
await this.invoke('page.reset_viewport', { pageId: this.id }, options);
|
|
209
250
|
}
|
|
210
251
|
observe(options = {}) {
|
|
211
|
-
const { observationTimeoutMs, maxControls, ...localOptions } = options;
|
|
252
|
+
const { observationTimeoutMs, maxControls, cursor, role, name, ...localOptions } = options;
|
|
212
253
|
const params = { pageId: this.id };
|
|
254
|
+
if (cursor !== undefined)
|
|
255
|
+
params.cursor = cursor;
|
|
256
|
+
if (role !== undefined)
|
|
257
|
+
params.role = role;
|
|
258
|
+
if (name !== undefined)
|
|
259
|
+
params.name = name;
|
|
213
260
|
if (observationTimeoutMs !== undefined)
|
|
214
261
|
params.timeout_ms = observationTimeoutMs;
|
|
215
262
|
if (maxControls !== undefined)
|
|
@@ -217,13 +264,15 @@ export class Page {
|
|
|
217
264
|
return this.invoke('agent.observe', params, localOptions);
|
|
218
265
|
}
|
|
219
266
|
async step(action, options = {}) {
|
|
220
|
-
const { operationId = randomUUID(), observationTimeoutMs, maxControls, actionTimeoutMs, expect, mode, ...localOptions } = options;
|
|
267
|
+
const { operationId = randomUUID(), observationTimeoutMs, maxControls, actionTimeoutMs, expect, mode, destination, ...localOptions } = options;
|
|
221
268
|
try {
|
|
222
269
|
const params = { pageId: this.id, action, operation_id: operationId };
|
|
223
270
|
if (expect !== undefined)
|
|
224
271
|
params.expect = expect;
|
|
225
272
|
if (mode !== undefined)
|
|
226
273
|
params.mode = mode;
|
|
274
|
+
if (destination !== undefined)
|
|
275
|
+
params.destination = destination;
|
|
227
276
|
if (actionTimeoutMs !== undefined)
|
|
228
277
|
params.action_timeout_ms = actionTimeoutMs;
|
|
229
278
|
if (observationTimeoutMs !== undefined)
|
|
@@ -1,99 +1,99 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"sdkVersion": "0.1.0-beta.
|
|
3
|
+
"sdkVersion": "0.1.0-beta.11",
|
|
4
4
|
"installerVersion": "3.2.4",
|
|
5
5
|
"server": {
|
|
6
|
-
"version": "0.
|
|
7
|
-
"protocolVersion": "
|
|
6
|
+
"version": "0.9.2",
|
|
7
|
+
"protocolVersion": "2.0",
|
|
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.11",
|
|
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": "8b0a39e94c13980bda91c015bab4095de7a181d0eb9b760baffe029f9032880f",
|
|
16
|
+
"size": 23151688,
|
|
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.11",
|
|
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": "2ab042d659cb81dfbb8009a8c7e6a0761f2bd513436c8e37662c66a6c167cb1f",
|
|
27
|
+
"size": 21343456,
|
|
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.11",
|
|
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": "c9de3b9a6c98ef68643a62c3b8ea36d24d9c5a9590f0df0ab9287acb70b8b765",
|
|
38
|
+
"size": 20768504,
|
|
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.11",
|
|
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": "c962bd5138d0efa538c1c8d6e7dac5a7569821bf77fe5197acdfedde55b4b920",
|
|
49
|
+
"size": 19282640,
|
|
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.11",
|
|
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": "317ce0958b4fbdf4546a058c50c48e38eda8f7c22c6385d7926c93a56cc3c157",
|
|
60
|
+
"size": 18219520,
|
|
61
61
|
"minimumGlibc": null,
|
|
62
62
|
"development": false
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"chrome": {
|
|
67
|
-
"buildId": "
|
|
67
|
+
"buildId": "156.0.8078.80",
|
|
68
68
|
"platforms": {
|
|
69
69
|
"linux-x64-gnu": {
|
|
70
70
|
"platform": "linux",
|
|
71
|
-
"url": "https://storage.googleapis.com/chrome-for-testing-public/
|
|
72
|
-
"sha256": "
|
|
71
|
+
"url": "https://storage.googleapis.com/chrome-for-testing-public/156.0.8078.80/linux64/chrome-linux64.zip",
|
|
72
|
+
"sha256": "b711c720f774be355197f32edf37e0651418ba036d92446ee2da19ac017540a7",
|
|
73
73
|
"executablePath": "chrome-linux64/chrome"
|
|
74
74
|
},
|
|
75
75
|
"linux-arm64-gnu": {
|
|
76
76
|
"platform": "linux_arm",
|
|
77
|
-
"url": "https://storage.googleapis.com/chrome-for-testing-public/
|
|
78
|
-
"sha256": "
|
|
77
|
+
"url": "https://storage.googleapis.com/chrome-for-testing-public/156.0.8078.80/linux-arm64/chrome-linux-arm64.zip",
|
|
78
|
+
"sha256": "1f496a826c9ba4d6a5f5bf2de686145fe718528c2cc3dbeb96b5893b89653724",
|
|
79
79
|
"executablePath": "chrome-linux-arm64/chrome"
|
|
80
80
|
},
|
|
81
81
|
"darwin-x64": {
|
|
82
82
|
"platform": "mac",
|
|
83
|
-
"url": "https://storage.googleapis.com/chrome-for-testing-public/
|
|
84
|
-
"sha256": "
|
|
83
|
+
"url": "https://storage.googleapis.com/chrome-for-testing-public/156.0.8078.80/mac-x64/chrome-mac-x64.zip",
|
|
84
|
+
"sha256": "672b79dc79fdf28bb2ec9787b7fa33810c2b3cfd946a0fb4d3b72775f4e6fd9a",
|
|
85
85
|
"executablePath": "chrome-mac-x64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing"
|
|
86
86
|
},
|
|
87
87
|
"darwin-arm64": {
|
|
88
88
|
"platform": "mac_arm",
|
|
89
|
-
"url": "https://storage.googleapis.com/chrome-for-testing-public/
|
|
90
|
-
"sha256": "
|
|
89
|
+
"url": "https://storage.googleapis.com/chrome-for-testing-public/156.0.8078.80/mac-arm64/chrome-mac-arm64.zip",
|
|
90
|
+
"sha256": "8bc590d1b1acac042a000234c768f31830f25a3983a83ed5e067114c87c4cad1",
|
|
91
91
|
"executablePath": "chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing"
|
|
92
92
|
},
|
|
93
93
|
"win32-x64": {
|
|
94
94
|
"platform": "win64",
|
|
95
|
-
"url": "https://storage.googleapis.com/chrome-for-testing-public/
|
|
96
|
-
"sha256": "
|
|
95
|
+
"url": "https://storage.googleapis.com/chrome-for-testing-public/156.0.8078.80/win64/chrome-win64.zip",
|
|
96
|
+
"sha256": "16edb57d6107bf1c48a7c149b8d78b155fe614410093796dd72441fd6640540f",
|
|
97
97
|
"executablePath": "chrome-win64/chrome.exe"
|
|
98
98
|
}
|
|
99
99
|
}
|
package/dist/release.js
CHANGED
|
@@ -29,7 +29,7 @@ export function validateReleaseManifest(value) {
|
|
|
29
29
|
const chrome = object(manifest.chrome);
|
|
30
30
|
const servers = object(server.platforms);
|
|
31
31
|
const browsers = object(chrome.platforms);
|
|
32
|
-
if (manifest.schemaVersion !== 1 || !exactNpmVersion(manifest.sdkVersion) || manifest.installerVersion !== '3.2.4' || server.version
|
|
32
|
+
if (manifest.schemaVersion !== 1 || !exactNpmVersion(manifest.sdkVersion) || manifest.installerVersion !== '3.2.4' || !exactNpmVersion(server.version) || server.protocolVersion !== `${protocolVersion.major}.${protocolVersion.minor}` || typeof chrome.buildId !== 'string' || !/^\d+\.\d+\.\d+\.\d+$/.test(chrome.buildId))
|
|
33
33
|
throw new Error('Incompatible release versions');
|
|
34
34
|
if (Object.keys(servers).length !== platformIds.length || Object.keys(browsers).length !== platformIds.length)
|
|
35
35
|
throw new Error('Incomplete platform mapping');
|
package/dist/server-binary.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export interface ServerBinaryResolution {
|
|
|
8
8
|
source: 'explicit' | 'environment' | 'package';
|
|
9
9
|
expectedServerVersion?: string;
|
|
10
10
|
}
|
|
11
|
+
export declare function nodeEngineMismatch(range: string, version: string): boolean;
|
|
11
12
|
export declare function resolveServerBinary(options?: ServerBinaryOptions): Promise<ServerBinaryResolution>;
|
package/dist/server-binary.js
CHANGED
|
@@ -14,6 +14,29 @@ function checkAbort(signal) {
|
|
|
14
14
|
function isSingleton(value, expected) {
|
|
15
15
|
return Array.isArray(value) && value.length === 1 && value[0] === expected;
|
|
16
16
|
}
|
|
17
|
+
// npm skips an optional dependency whose engines range rejects the running
|
|
18
|
+
// Node, so a missing platform package often means the wrong Node version.
|
|
19
|
+
export function nodeEngineMismatch(range, version) {
|
|
20
|
+
const required = /^\^(\d+)\.(\d+)\.(\d+)$/.exec(range)?.slice(1).map(Number);
|
|
21
|
+
const current = /^v?(\d+)\.(\d+)\.(\d+)/.exec(version)?.slice(1).map(Number);
|
|
22
|
+
if (!required || !current || required[0] === 0)
|
|
23
|
+
return false;
|
|
24
|
+
if (current[0] !== required[0])
|
|
25
|
+
return true;
|
|
26
|
+
return current[1] < required[1] || (current[1] === required[1] && current[2] < required[2]);
|
|
27
|
+
}
|
|
28
|
+
function unsupportedNodeHint() {
|
|
29
|
+
let range;
|
|
30
|
+
try {
|
|
31
|
+
range = createRequire(import.meta.url)('../package.json').engines?.node;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return '';
|
|
35
|
+
}
|
|
36
|
+
if (typeof range !== 'string' || !nodeEngineMismatch(range, process.versions.node))
|
|
37
|
+
return '';
|
|
38
|
+
return ` npm skips it on unsupported Node versions: this is Node ${process.versions.node}, but @cbxss/eoka requires ${range}. Switch Node (for example \`mise use node@24\` or \`nvm install 24\`) and reinstall.`;
|
|
39
|
+
}
|
|
17
40
|
export async function resolveServerBinary(options = {}) {
|
|
18
41
|
const { signal } = options;
|
|
19
42
|
checkAbort(signal);
|
|
@@ -41,7 +64,7 @@ export async function resolveServerBinary(options = {}) {
|
|
|
41
64
|
packagePath = createRequire(import.meta.url).resolve(`${pin.packageName}/package.json`);
|
|
42
65
|
}
|
|
43
66
|
catch (cause) {
|
|
44
|
-
throw new InstallationError('ServerPackageMissing', `The exact optional dependency ${pin.packageName}@${pin.packageVersion} is missing
|
|
67
|
+
throw new InstallationError('ServerPackageMissing', `The exact optional dependency ${pin.packageName}@${pin.packageVersion} is missing.${unsupportedNodeHint()} Reinstall @cbxss/eoka with optional dependencies enabled (do not use --omit=optional), or install that exact platform package. There is no Cargo, PATH or network fallback.`, { cause });
|
|
45
68
|
}
|
|
46
69
|
if (pin.sha256 === null || pin.size === null)
|
|
47
70
|
throw new InstallationError('ReleaseNotPrepared', `The SDK has no staged server integrity pin for ${platform}. Use a prepared SDK plus its matching platform package, or set serverPath explicitly.`);
|
|
@@ -24,7 +24,7 @@ try {
|
|
|
24
24
|
actionOptions: { expect: { kind: "value", target, value: "Ada" }, timeout_ms: 5000 },
|
|
25
25
|
});
|
|
26
26
|
console.log(JSON.stringify({ ownership: browser.ownership, browserVersion: browser.browserVersion, operationId, receipt }, null, 2));
|
|
27
|
-
console.log(JSON.stringify(await page.invoke("page.evaluate", { pageId: page.id,
|
|
27
|
+
console.log(JSON.stringify(await page.invoke("page.evaluate", { pageId: page.id, function: '()=>({name: document.querySelector("#name").value})' })));
|
|
28
28
|
} catch (error) {
|
|
29
29
|
const primary = error instanceof AggregateError ? error.cause : error;
|
|
30
30
|
if (primary instanceof EokaError && primary.operationId) {
|
package/examples/offline.mjs
CHANGED
|
@@ -9,7 +9,7 @@ const browser = await Browser.launch({
|
|
|
9
9
|
});
|
|
10
10
|
try {
|
|
11
11
|
const page = await browser.newPage("data:text/html,%3Ctitle%3Eeoka%20offline%3C/title%3E");
|
|
12
|
-
const result = await page.invoke("page.evaluate", { pageId: page.id,
|
|
12
|
+
const result = await page.invoke("page.evaluate", { pageId: page.id, function: "()=>document.title" });
|
|
13
13
|
console.log(JSON.stringify({
|
|
14
14
|
title: result.result,
|
|
15
15
|
ownership: browser.ownership,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cbxss/eoka",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Node.js SDK with pinned Chrome installation and verified eoka sidecar resolution",
|
|
@@ -47,22 +47,22 @@
|
|
|
47
47
|
"example:capture": "node examples/capture.mjs"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@puppeteer/browsers": "3.2.
|
|
51
|
-
"ajv": "8.
|
|
52
|
-
"proxy-agent": "8.0.
|
|
50
|
+
"@puppeteer/browsers": "3.2.6",
|
|
51
|
+
"ajv": "8.20.0",
|
|
52
|
+
"proxy-agent": "8.0.2",
|
|
53
53
|
"yauzl": "3.4.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/node": "24.19.2",
|
|
57
|
-
"sigstore": "
|
|
58
|
-
"typescript": "
|
|
57
|
+
"sigstore": "5.0.1",
|
|
58
|
+
"typescript": "6.0.3"
|
|
59
59
|
},
|
|
60
60
|
"optionalDependencies": {
|
|
61
|
-
"@cbxss/eoka-server-linux-x64-gnu": "0.1.0-beta.
|
|
62
|
-
"@cbxss/eoka-server-linux-arm64-gnu": "0.1.0-beta.
|
|
63
|
-
"@cbxss/eoka-server-darwin-x64": "0.1.0-beta.
|
|
64
|
-
"@cbxss/eoka-server-darwin-arm64": "0.1.0-beta.
|
|
65
|
-
"@cbxss/eoka-server-win32-x64": "0.1.0-beta.
|
|
61
|
+
"@cbxss/eoka-server-linux-x64-gnu": "0.1.0-beta.11",
|
|
62
|
+
"@cbxss/eoka-server-linux-arm64-gnu": "0.1.0-beta.11",
|
|
63
|
+
"@cbxss/eoka-server-darwin-x64": "0.1.0-beta.11",
|
|
64
|
+
"@cbxss/eoka-server-darwin-arm64": "0.1.0-beta.11",
|
|
65
|
+
"@cbxss/eoka-server-win32-x64": "0.1.0-beta.11"
|
|
66
66
|
},
|
|
67
67
|
"repository": {
|
|
68
68
|
"type": "git",
|