@orkestrel/browser 0.0.25 → 0.0.27
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 +23 -13
- package/dist/bin/main.js +11 -9
- package/dist/bin/main.js.map +1 -1
- package/dist/src/browser/index.d.ts +6 -184
- package/dist/src/browser/index.js +145 -119
- package/dist/src/browser/index.js.map +1 -1
- package/dist/src/core/index.cjs +2324 -1991
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +672 -1366
- package/dist/src/core/index.d.ts +672 -1366
- package/dist/src/core/index.js +2287 -1941
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +223 -215
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +72 -167
- package/dist/src/server/index.d.ts +72 -167
- package/dist/src/server/index.js +222 -209
- package/dist/src/server/index.js.map +1 -1
- package/package.json +8 -7
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { BrowserCallOptions } from '@orkestrel/browser';
|
|
2
2
|
import type { BrowserContextInterface } from '@orkestrel/browser';
|
|
3
|
-
import type { BrowserContextOptions } from '@orkestrel/browser';
|
|
4
3
|
import { BrowserError } from '@orkestrel/browser';
|
|
4
|
+
import type { BrowserIsolateOptions } from '@orkestrel/browser';
|
|
5
5
|
import type { BrowserJourney } from '@orkestrel/browser';
|
|
6
6
|
import type { BrowserJourneyRevision } from '@orkestrel/browser';
|
|
7
7
|
import type { BrowserJourneyStoreInterface } from '@orkestrel/browser';
|
|
8
|
+
import type { BrowserJourneyWriteOptions } from '@orkestrel/browser';
|
|
8
9
|
import type { BrowserPageInterface } from '@orkestrel/browser';
|
|
9
10
|
import type { BrowserPageOptions } from '@orkestrel/browser';
|
|
10
11
|
import type { BrowserRun } from '@orkestrel/browser';
|
|
@@ -12,7 +13,7 @@ import type { BrowserRunSlot } from '@orkestrel/browser';
|
|
|
12
13
|
import type { BrowserRunStoreInterface } from '@orkestrel/browser';
|
|
13
14
|
import type { BrowserStoreOptions } from '@orkestrel/browser';
|
|
14
15
|
import type { BrowserStorePage } from '@orkestrel/browser';
|
|
15
|
-
import type {
|
|
16
|
+
import type { BrowserStorePageOptions } from '@orkestrel/browser';
|
|
16
17
|
import type { BrowserViewport } from '@orkestrel/browser';
|
|
17
18
|
import type { BrowserWriterInterface } from '@orkestrel/browser';
|
|
18
19
|
import type { CDPTarget } from '@orkestrel/browser';
|
|
@@ -22,12 +23,10 @@ import type { ChildProcess } from 'node:child_process';
|
|
|
22
23
|
import type { EmitterErrorHandler } from '@orkestrel/emitter';
|
|
23
24
|
import type { EmitterHooks } from '@orkestrel/emitter';
|
|
24
25
|
import type { EmitterInterface } from '@orkestrel/emitter';
|
|
25
|
-
import type { PoolToken } from '@orkestrel/pool';
|
|
26
26
|
import type { Readable } from 'node:stream';
|
|
27
27
|
import type { Result } from '@orkestrel/contract';
|
|
28
28
|
import type { StdioServerOptions } from '@orkestrel/mcp/server';
|
|
29
29
|
import type { ToolDefinition } from '@orkestrel/tool';
|
|
30
|
-
import type { ToolInterface } from '@orkestrel/tool';
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
32
|
* Discovers, launches, connects to, and owns Chromium-family browser sessions.
|
|
@@ -59,7 +58,7 @@ export declare class Browser implements BrowserInterface {
|
|
|
59
58
|
disconnect(): Promise<void>;
|
|
60
59
|
context(index?: number): BrowserContextInterface | undefined;
|
|
61
60
|
contexts(): readonly BrowserContextInterface[];
|
|
62
|
-
isolate(options?:
|
|
61
|
+
isolate(options?: BrowserIsolateOptions): Promise<BrowserContextInterface>;
|
|
63
62
|
create(options?: BrowserPageOptions): Promise<BrowserPageInterface>;
|
|
64
63
|
destroy(): Promise<void>;
|
|
65
64
|
close(): Promise<void>;
|
|
@@ -165,7 +164,9 @@ export declare const BROWSER_KILL_GRACE_MS = 3000;
|
|
|
165
164
|
*
|
|
166
165
|
* @remarks
|
|
167
166
|
* Disables account sync so extension installs cannot reset URL loader factories during page imports.
|
|
168
|
-
* Edge
|
|
167
|
+
* Disables Edge's implicit sign-in so fresh automation profiles carry no Microsoft account.
|
|
168
|
+
* Chromium ignores the unknown Edge feature name on Chrome and Chromium.
|
|
169
|
+
* The launcher merges disabled features with the caller's into one switch.
|
|
169
170
|
*/
|
|
170
171
|
export declare const BROWSER_LAUNCH_ARGS: readonly string[];
|
|
171
172
|
|
|
@@ -195,7 +196,7 @@ export declare const BROWSER_RUN_DIRECTORY = "runs";
|
|
|
195
196
|
export declare const BROWSER_RUN_FILE = "run.json";
|
|
196
197
|
|
|
197
198
|
/** Names the refusal when every browser is admitted to a holder. */
|
|
198
|
-
export declare const BROWSER_SERVER_BUSY = "
|
|
199
|
+
export declare const BROWSER_SERVER_BUSY = "SERVER_BUSY";
|
|
199
200
|
|
|
200
201
|
/** Sets the default context capacity per browser, including the shared holder. */
|
|
201
202
|
export declare const BROWSER_SERVER_CONTEXTS = 2;
|
|
@@ -207,19 +208,19 @@ export declare const BROWSER_SERVER_CONTEXTS_LIMIT = 4;
|
|
|
207
208
|
export declare const BROWSER_SERVER_COPY: Readonly<Record<BrowserServerToolName, ToolDefinition>>;
|
|
208
209
|
|
|
209
210
|
/** Names the notice that a browser and its session state were lost. */
|
|
210
|
-
export declare const BROWSER_SERVER_CRASH = "
|
|
211
|
+
export declare const BROWSER_SERVER_CRASH = "SERVER_CRASH";
|
|
211
212
|
|
|
212
213
|
/** Names the diagnostic when the warm floor spends its restart bound. */
|
|
213
|
-
export declare const BROWSER_SERVER_EXHAUSTED = "
|
|
214
|
+
export declare const BROWSER_SERVER_EXHAUSTED = "SERVER_EXHAUSTED";
|
|
214
215
|
|
|
215
216
|
/** Names the refusal for an unknown or ended holder. */
|
|
216
|
-
export declare const BROWSER_SERVER_HOLDER = "
|
|
217
|
+
export declare const BROWSER_SERVER_HOLDER = "SERVER_HOLDER";
|
|
217
218
|
|
|
218
219
|
/** Names a failed attempt to warm a browser. */
|
|
219
|
-
export declare const BROWSER_SERVER_LAUNCH = "
|
|
220
|
+
export declare const BROWSER_SERVER_LAUNCH = "SERVER_LAUNCH";
|
|
220
221
|
|
|
221
222
|
/** Names a refused browser server option. */
|
|
222
|
-
export declare const BROWSER_SERVER_OPTIONS = "
|
|
223
|
+
export declare const BROWSER_SERVER_OPTIONS = "ARGUMENT";
|
|
223
224
|
|
|
224
225
|
/** Limits the number of warm browsers to 3. */
|
|
225
226
|
export declare const BROWSER_SERVER_POOL_LIMIT = 3;
|
|
@@ -234,16 +235,16 @@ export declare const BROWSER_SERVER_RECORD = "browse.json";
|
|
|
234
235
|
export declare const BROWSER_SERVER_RESTARTS = 1;
|
|
235
236
|
|
|
236
237
|
/** Names a failed profile sweep. */
|
|
237
|
-
export declare const BROWSER_SERVER_SWEEP = "
|
|
238
|
+
export declare const BROWSER_SERVER_SWEEP = "SERVER_SWEEP";
|
|
238
239
|
|
|
239
240
|
/** Names a failed browser server teardown. */
|
|
240
|
-
export declare const BROWSER_SERVER_TEARDOWN = "
|
|
241
|
+
export declare const BROWSER_SERVER_TEARDOWN = "SERVER_TEARDOWN";
|
|
241
242
|
|
|
242
243
|
/** Names the refusal when no browser can serve a call. */
|
|
243
|
-
export declare const BROWSER_SERVER_UNAVAILABLE = "
|
|
244
|
+
export declare const BROWSER_SERVER_UNAVAILABLE = "SERVER_UNAVAILABLE";
|
|
244
245
|
|
|
245
246
|
/** Names an interrupted call whose outcome is unknown. */
|
|
246
|
-
export declare const BROWSER_SERVER_UNRESOLVED = "
|
|
247
|
+
export declare const BROWSER_SERVER_UNRESOLVED = "SERVER_UNRESOLVED";
|
|
247
248
|
|
|
248
249
|
/** Names the per-OS default Playwright browser cache directory, relative to the home directory (win32 uses `LOCALAPPDATA` directly). */
|
|
249
250
|
export declare const BROWSER_STORE_CACHE_DIRS: Readonly<Record<string, string>>;
|
|
@@ -316,14 +317,6 @@ export declare interface BrowserCDPOptions {
|
|
|
316
317
|
/** Names how the browser connection was established. */
|
|
317
318
|
export declare type BrowserConnection = 'cdp' | 'launch' | 'persistent';
|
|
318
319
|
|
|
319
|
-
/**
|
|
320
|
-
* Reports that an operation was attempted after the browser wrapper was destroyed, under the
|
|
321
|
-
* code `BROWSER_DESTROYED_ERROR`.
|
|
322
|
-
*/
|
|
323
|
-
export declare class BrowserDestroyedError extends BrowserError {
|
|
324
|
-
constructor(context?: Readonly<Record<string, unknown>>);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
320
|
/**
|
|
328
321
|
* Describes the result of passive browser discovery.
|
|
329
322
|
*
|
|
@@ -477,7 +470,7 @@ export declare interface BrowserInterface {
|
|
|
477
470
|
* Creates and registers an isolated CDP context with validated proxy, download, origin,
|
|
478
471
|
* and emulation options.
|
|
479
472
|
*/
|
|
480
|
-
isolate(options?:
|
|
473
|
+
isolate(options?: BrowserIsolateOptions): Promise<BrowserContextInterface>;
|
|
481
474
|
/** Opens a page in the default context. */
|
|
482
475
|
create(options?: BrowserPageOptions): Promise<BrowserPageInterface>;
|
|
483
476
|
/**
|
|
@@ -516,9 +509,9 @@ export declare type BrowserLaunchFunction = (options: BrowserOptions) => Browser
|
|
|
516
509
|
* the Model Context Protocol on stdio, and warms Chromium at server start.
|
|
517
510
|
*
|
|
518
511
|
* @remarks
|
|
519
|
-
* The server's own manager holds one dispatcher per name of the vocabulary — `
|
|
520
|
-
* `
|
|
521
|
-
* `
|
|
512
|
+
* The server's own manager holds one dispatcher per name of the vocabulary — `read`, `click`,
|
|
513
|
+
* `type`, `press`, `navigate`, `wait`, `dialog`, `switch`, `record`, `save`, `journeys`, `edit`,
|
|
514
|
+
* `replay`, `forget`, and `capture` — each carrying the description, parameters, and annotations
|
|
522
515
|
* `BROWSER_TOOL_COPY` gives, so `tools/list` answers before Chromium starts and with Chromium
|
|
523
516
|
* absent. After the launch, a tool the toolset's manager adds under another name, such as a page
|
|
524
517
|
* tool it adopts, is mirrored as a dispatcher with that tool's definition, and the mirror is
|
|
@@ -555,7 +548,7 @@ export declare type BrowserLaunchFunction = (options: BrowserOptions) => Browser
|
|
|
555
548
|
* ```ts
|
|
556
549
|
* import { BrowserMCPServer } from '@orkestrel/browser/server'
|
|
557
550
|
*
|
|
558
|
-
* const server = new BrowserMCPServer({ root: 'tmp/browsers', readonly: true })
|
|
551
|
+
* const server = new BrowserMCPServer({ root: 'tmp/browsers', journeys: { readonly: true } })
|
|
559
552
|
* await server.start()
|
|
560
553
|
* await server.destroy()
|
|
561
554
|
* ```
|
|
@@ -578,7 +571,7 @@ export declare interface BrowserMCPServerInterface {
|
|
|
578
571
|
* Serves stdio, sweeps the profiles ended servers left, warms the pool, and resolves after the
|
|
579
572
|
* shared holder consumes a prepared context on a warm browser; the legacy handshake and every tool call await the same setup.
|
|
580
573
|
* Rejects with `BROWSER_SERVER_UNAVAILABLE` when no browser can serve and with
|
|
581
|
-
* `
|
|
574
|
+
* `CLOSED` after `destroy()`, and resolves when `destroy()` interrupts setup.
|
|
582
575
|
*/
|
|
583
576
|
start(): Promise<void>;
|
|
584
577
|
/**
|
|
@@ -593,15 +586,15 @@ export declare interface BrowserMCPServerInterface {
|
|
|
593
586
|
* @remarks
|
|
594
587
|
* - `root` — the directory the journeys, the runs, and the browser profiles live under, resolved
|
|
595
588
|
* against the working directory at construction. Default: `tmp/browsers`
|
|
596
|
-
* - `headless` — if `true`, launches Chromium without a window; if `false`, with one. Default:
|
|
589
|
+
* - `browser.headless` — if `true`, launches Chromium without a window; if `false`, with one. Default:
|
|
597
590
|
* `true`
|
|
598
|
-
* - `executable` — the path of the Chromium executable the server launches. Default: the browser
|
|
599
|
-
* `
|
|
600
|
-
* - `viewport` — the default viewport for every page in each browser's isolated context;
|
|
591
|
+
* - `browser.executable` — the path of the Chromium executable the server launches. Default: the first browser
|
|
592
|
+
* `findSystemBrowsers` finds
|
|
593
|
+
* - `browser.viewport` — the default viewport for every page in each browser's isolated context;
|
|
601
594
|
* omission keeps the browser's launch default
|
|
602
|
-
* - `readonly` — if `true`, refuses `record`, `save`, `edit`, and `forget`, and `replay` still writes runs;
|
|
595
|
+
* - `journeys.readonly` — if `true`, refuses `record`, `save`, `edit`, and `forget`, and `replay` still writes runs;
|
|
603
596
|
* if `false` or omitted, every tool runs
|
|
604
|
-
* - `launch` — creates each browser the pool warms. Default: `createBrowser`
|
|
597
|
+
* - `pool.launch` — creates each browser the pool warms. Default: `createBrowser`
|
|
605
598
|
* - `stdio` — the streams the server reads requests from and writes answers to; the end of
|
|
606
599
|
* `input` destroys the server. Default: `process.stdin` and `process.stdout`
|
|
607
600
|
* - `pool.size` — the integer number of browsers kept warm, from 1 through
|
|
@@ -609,31 +602,27 @@ export declare interface BrowserMCPServerInterface {
|
|
|
609
602
|
* - `pool.contexts` — the integer context capacity per browser, shared holder included, from 1
|
|
610
603
|
* through `BROWSER_SERVER_CONTEXTS_LIMIT`. Default: `BROWSER_SERVER_CONTEXTS`.
|
|
611
604
|
* - `log` — receives diagnostic lines. Default: `process.stderr`
|
|
612
|
-
* @throws Thrown when `pool.size` or `pool.contexts` is outside its range or is not an integer, with `
|
|
605
|
+
* @throws Thrown when `pool.size` or `pool.contexts` is outside its range or is not an integer, with `ARGUMENT`
|
|
613
606
|
*/
|
|
614
607
|
export declare interface BrowserMCPServerOptions {
|
|
615
608
|
readonly root?: string;
|
|
616
|
-
readonly
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
609
|
+
readonly browser?: {
|
|
610
|
+
readonly headless?: boolean;
|
|
611
|
+
readonly executable?: string;
|
|
612
|
+
readonly viewport?: BrowserViewport;
|
|
613
|
+
};
|
|
614
|
+
readonly journeys?: {
|
|
615
|
+
readonly readonly?: boolean;
|
|
616
|
+
};
|
|
621
617
|
readonly stdio?: StdioServerOptions;
|
|
622
618
|
readonly pool?: {
|
|
623
619
|
readonly size?: number;
|
|
624
620
|
readonly contexts?: number;
|
|
621
|
+
readonly launch?: BrowserLaunchFunction;
|
|
625
622
|
};
|
|
626
623
|
readonly log?: NodeJS.WritableStream;
|
|
627
624
|
}
|
|
628
625
|
|
|
629
|
-
/**
|
|
630
|
-
* Reports that an operation requiring an active connection was attempted while disconnected,
|
|
631
|
-
* under the code `BROWSER_NOT_CONNECTED_ERROR`.
|
|
632
|
-
*/
|
|
633
|
-
export declare class BrowserNotConnectedError extends BrowserError {
|
|
634
|
-
constructor(context?: Readonly<Record<string, unknown>>);
|
|
635
|
-
}
|
|
636
|
-
|
|
637
626
|
/**
|
|
638
627
|
* Describes the options for creating a `Browser` instance.
|
|
639
628
|
*
|
|
@@ -649,11 +638,8 @@ export declare class BrowserNotConnectedError extends BrowserError {
|
|
|
649
638
|
* - `viewport` — default viewport dimensions for new pages
|
|
650
639
|
* - `signal` — external AbortSignal for cancelling the connection attempt
|
|
651
640
|
* - `args` — additional command-line flags passed to the launched browser process
|
|
652
|
-
* - `engine` — preferred browser engine to launch; narrows system browser
|
|
653
|
-
* discovery to this engine (ignored when `executable` is given); takes
|
|
654
|
-
* precedence over `browsers.engine`
|
|
655
641
|
* - `browsers` — candidate-source overrides consulted when `connect()` needs
|
|
656
|
-
* to launch
|
|
642
|
+
* to launch, with `browsers.engine` selecting the engine; ignored when
|
|
657
643
|
* `executable` is given, which bypasses discovery entirely
|
|
658
644
|
*/
|
|
659
645
|
export declare interface BrowserOptions {
|
|
@@ -667,7 +653,6 @@ export declare interface BrowserOptions {
|
|
|
667
653
|
readonly viewport?: BrowserViewport;
|
|
668
654
|
readonly signal?: AbortSignal;
|
|
669
655
|
readonly args?: readonly string[];
|
|
670
|
-
readonly engine?: BrowserEngine;
|
|
671
656
|
readonly browsers?: SystemBrowserOptions;
|
|
672
657
|
}
|
|
673
658
|
|
|
@@ -696,62 +681,9 @@ export declare interface BrowserServerCatalog {
|
|
|
696
681
|
readonly tools: readonly ToolDefinition[];
|
|
697
682
|
}
|
|
698
683
|
|
|
699
|
-
/** Holds one prepared or assigned context generation and its downloads directory. */
|
|
700
|
-
export declare interface BrowserServerContext {
|
|
701
|
-
readonly context: BrowserContextInterface;
|
|
702
|
-
readonly toolset: BrowserToolsetInterface;
|
|
703
|
-
readonly directory: string;
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
/** Identifies one admitted browser lifetime independently of its current pool token. */
|
|
707
|
-
export declare interface BrowserServerHolder {
|
|
708
|
-
readonly id: string;
|
|
709
|
-
readonly purpose: string;
|
|
710
|
-
readonly abort: AbortController;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
/** Binds a holder generation to the exact browser lease reserved for its lifetime. */
|
|
714
|
-
export declare interface BrowserServerLease {
|
|
715
|
-
readonly token: PoolToken<BrowserSlot>;
|
|
716
|
-
readonly generation: BrowserServerContext;
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
/** Records a lost generation's cause and its own last URL. */
|
|
720
|
-
export declare interface BrowserServerLoss {
|
|
721
|
-
readonly cause: unknown;
|
|
722
|
-
readonly url: string;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
/** Binds shared catalog subscriptions to the exact generation that published them. */
|
|
726
|
-
export declare interface BrowserServerMirror {
|
|
727
|
-
readonly lease: BrowserServerLease;
|
|
728
|
-
readonly added: (tool: ToolInterface) => void;
|
|
729
|
-
readonly removed: (tool: ToolInterface) => void;
|
|
730
|
-
readonly cleared: (tools: readonly ToolInterface[]) => void;
|
|
731
|
-
}
|
|
732
|
-
|
|
733
684
|
/** Names the server tools that manage independent browser holders. */
|
|
734
685
|
export declare type BrowserServerToolName = 'acquire' | 'execute' | 'tools' | 'destroy';
|
|
735
686
|
|
|
736
|
-
/** Holds page subscriptions for one prepared or assigned context generation. */
|
|
737
|
-
export declare interface BrowserServerWatch {
|
|
738
|
-
readonly page: (page: BrowserPageInterface) => void;
|
|
739
|
-
readonly crashes: ReadonlyMap<BrowserPageInterface, () => void>;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
/** Holds one pooled browser and its exclusively owned profile. */
|
|
743
|
-
export declare interface BrowserSlot {
|
|
744
|
-
readonly browser: BrowserInterface;
|
|
745
|
-
readonly profile: string;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
/** Holds the listeners and resolver of one browser slot's loss watch. */
|
|
749
|
-
export declare interface BrowserSlotWatch {
|
|
750
|
-
readonly resolve: (cause: unknown) => void;
|
|
751
|
-
readonly disconnect: () => void;
|
|
752
|
-
readonly subscription: Disposable;
|
|
753
|
-
}
|
|
754
|
-
|
|
755
687
|
/** Names the lifecycle status of a browser wrapper. */
|
|
756
688
|
export declare type BrowserStatus = 'idle' | 'connecting' | 'connected' | 'disconnected' | 'error';
|
|
757
689
|
|
|
@@ -799,7 +731,7 @@ export declare function createBrowser(options?: BrowserOptions): BrowserInterfac
|
|
|
799
731
|
* ```ts
|
|
800
732
|
* import { createBrowserMCPServer } from '@orkestrel/browser/server'
|
|
801
733
|
*
|
|
802
|
-
* const server = createBrowserMCPServer({ root: 'tmp/browsers', headless: true })
|
|
734
|
+
* const server = createBrowserMCPServer({ root: 'tmp/browsers', browser: { headless: true } })
|
|
803
735
|
* await server.start() // resolves after leasing a connected browser
|
|
804
736
|
* await server.destroy()
|
|
805
737
|
* ```
|
|
@@ -814,22 +746,6 @@ export declare function createBrowserMCPServer(options?: BrowserMCPServerOptions
|
|
|
814
746
|
*/
|
|
815
747
|
export declare function createBrowserProfile(path?: string): Promise<BrowserProfileResult>;
|
|
816
748
|
|
|
817
|
-
/**
|
|
818
|
-
* Creates a filesystem-backed `BrowserWriterInterface` that persists bytes through
|
|
819
|
-
* `node:fs/promises`.
|
|
820
|
-
*
|
|
821
|
-
* @returns A {@link BrowserWriterInterface} that persists bytes through `node:fs/promises`
|
|
822
|
-
*/
|
|
823
|
-
export declare function createBrowserWriter(): BrowserWriterInterface;
|
|
824
|
-
|
|
825
|
-
/**
|
|
826
|
-
* Creates a Node `WebSocket`-backed `CDPTransportInterface` for the given CDP debugger URL.
|
|
827
|
-
*
|
|
828
|
-
* @param options - The CDP WebSocket debugger URL (and optional timeout)
|
|
829
|
-
* @returns A {@link CDPTransportInterface}
|
|
830
|
-
*/
|
|
831
|
-
export declare function createCDPTransport(options: WebSocketCDPTransportOptions): CDPTransportInterface;
|
|
832
|
-
|
|
833
749
|
/**
|
|
834
750
|
* Creates a journey store over an existing filesystem root.
|
|
835
751
|
* @param options - Root and listing cap
|
|
@@ -848,6 +764,22 @@ export declare function createFileBrowserJourneyStore(options: FileBrowserStoreO
|
|
|
848
764
|
*/
|
|
849
765
|
export declare function createFileBrowserRunStore(options: FileBrowserStoreOptions): BrowserRunStoreInterface;
|
|
850
766
|
|
|
767
|
+
/**
|
|
768
|
+
* Creates a filesystem-backed `BrowserWriterInterface` that persists bytes through
|
|
769
|
+
* `node:fs/promises`.
|
|
770
|
+
*
|
|
771
|
+
* @returns A {@link BrowserWriterInterface} that persists bytes through `node:fs/promises`
|
|
772
|
+
*/
|
|
773
|
+
export declare function createFileBrowserWriter(): BrowserWriterInterface;
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Creates a Node `WebSocket`-backed `CDPTransportInterface` for the given CDP debugger URL.
|
|
777
|
+
*
|
|
778
|
+
* @param options - The CDP WebSocket debugger URL (and optional timeout)
|
|
779
|
+
* @returns A {@link CDPTransportInterface}
|
|
780
|
+
*/
|
|
781
|
+
export declare function createWebSocketCDPTransport(options: WebSocketCDPTransportOptions): CDPTransportInterface;
|
|
782
|
+
|
|
851
783
|
/**
|
|
852
784
|
* Describes a browser loss with its code, cause, and the session state it invalidates.
|
|
853
785
|
* @param code - Browser server diagnostic code
|
|
@@ -855,18 +787,18 @@ export declare function createFileBrowserRunStore(options: FileBrowserStoreOptio
|
|
|
855
787
|
* @param url - The lost page's last URL, when known
|
|
856
788
|
* @returns The coded diagnostic and any operation-lifecycle guidance
|
|
857
789
|
* @example
|
|
858
|
-
* describeBrowserServerLoss('
|
|
790
|
+
* describeBrowserServerLoss('SERVER_UNAVAILABLE', new Error('Browser exited'))
|
|
859
791
|
*/
|
|
860
792
|
export declare function describeBrowserServerLoss(code: string, cause: unknown, url?: string): string;
|
|
861
793
|
|
|
862
794
|
/**
|
|
863
795
|
* Fetches the current CDP target list from a browser's `/json/list` endpoint, as a `Result`
|
|
864
|
-
* carrying either the targets or a coded `
|
|
796
|
+
* carrying either the targets or a coded `BrowserError`.
|
|
865
797
|
*
|
|
866
798
|
* @remarks
|
|
867
799
|
* The endpoint is a network boundary, so an unreachable host, a non-2xx
|
|
868
800
|
* response, and a body that is not a JSON array each come back as a failed
|
|
869
|
-
* `Result` carrying a coded `
|
|
801
|
+
* `Result` carrying a coded `BrowserError`. An entry missing a
|
|
870
802
|
* required string field is skipped rather than failing the whole list.
|
|
871
803
|
*
|
|
872
804
|
* @param port - Port the browser exposes its CDP endpoint on
|
|
@@ -896,12 +828,9 @@ export declare class FileBrowserJourneyStore implements BrowserJourneyStoreInter
|
|
|
896
828
|
#private;
|
|
897
829
|
constructor(options: FileBrowserStoreOptions);
|
|
898
830
|
get(name: string, options?: BrowserStoreOptions): Promise<BrowserJourneyRevision | undefined>;
|
|
899
|
-
set(journey: BrowserJourney,
|
|
831
|
+
set(journey: BrowserJourney, options?: BrowserJourneyWriteOptions): Promise<BrowserJourneyRevision>;
|
|
900
832
|
delete(name: string, options?: BrowserStoreOptions): Promise<void>;
|
|
901
|
-
list(options?:
|
|
902
|
-
readonly offset?: number;
|
|
903
|
-
readonly limit?: number;
|
|
904
|
-
}): Promise<BrowserStorePage<BrowserJourneyRevision>>;
|
|
833
|
+
list(options?: BrowserStorePageOptions): Promise<BrowserStorePage<BrowserJourneyRevision>>;
|
|
905
834
|
}
|
|
906
835
|
|
|
907
836
|
/**
|
|
@@ -911,22 +840,19 @@ export declare class FileBrowserJourneyStore implements BrowserJourneyStoreInter
|
|
|
911
840
|
* still refuses conflicting mutations and allocations from another process.
|
|
912
841
|
* @example
|
|
913
842
|
* const store = new FileBrowserRunStore({ root: directory })
|
|
914
|
-
* const slot = await store.
|
|
843
|
+
* const slot = await store.create('check-ready')
|
|
915
844
|
*/
|
|
916
845
|
export declare class FileBrowserRunStore implements BrowserRunStoreInterface {
|
|
917
846
|
#private;
|
|
918
847
|
constructor(options: FileBrowserStoreOptions);
|
|
919
|
-
|
|
920
|
-
|
|
848
|
+
write(bytes: Uint8Array, options?: BrowserStoreOptions): Promise<string>;
|
|
849
|
+
create(name: string, options?: BrowserStoreOptions): Promise<BrowserRunSlot>;
|
|
921
850
|
get(name: string, id: string, options?: BrowserStoreOptions): Promise<BrowserRun | undefined>;
|
|
922
851
|
set(run: BrowserRun, options?: BrowserStoreOptions): Promise<void>;
|
|
923
852
|
capture(slot: BrowserRunSlot, name: string, bytes: Uint8Array, options?: BrowserStoreOptions): Promise<string>;
|
|
924
853
|
delete(name: string, id: string, options?: BrowserStoreOptions): Promise<void>;
|
|
925
854
|
clear(name: string, options?: BrowserStoreOptions): Promise<number>;
|
|
926
|
-
list(name: string, options?:
|
|
927
|
-
readonly offset?: number;
|
|
928
|
-
readonly limit?: number;
|
|
929
|
-
}): Promise<BrowserStorePage<BrowserRun>>;
|
|
855
|
+
list(name: string, options?: BrowserStorePageOptions): Promise<BrowserStorePage<BrowserRun>>;
|
|
930
856
|
}
|
|
931
857
|
|
|
932
858
|
/**
|
|
@@ -977,15 +903,6 @@ export declare function findInstallPaths(paths: readonly string[]): readonly str
|
|
|
977
903
|
/** Searches one store base for the top-level `chromium` link and every `chromium-*` install, highest revision first. */
|
|
978
904
|
export declare function findStorePaths(base: string, platform: string): readonly string[];
|
|
979
905
|
|
|
980
|
-
/**
|
|
981
|
-
* Locates a Chrome/Chromium/Edge executable on this machine — the first entry
|
|
982
|
-
* of {@link findSystemBrowsers}.
|
|
983
|
-
*
|
|
984
|
-
* @param options - Overrides for the candidate sources; see {@link SystemBrowserOptions}
|
|
985
|
-
* @returns The first discovered browser, or undefined
|
|
986
|
-
*/
|
|
987
|
-
export declare function findSystemBrowser(options?: SystemBrowserOptions): SystemBrowser | undefined;
|
|
988
|
-
|
|
989
906
|
/**
|
|
990
907
|
* Enumerates every Chrome/Chromium/Edge executable discoverable on this
|
|
991
908
|
* machine, deduplicated by normalized absolute path.
|
|
@@ -1020,26 +937,14 @@ export declare function findSystemBrowsers(options?: SystemBrowserOptions): read
|
|
|
1020
937
|
*/
|
|
1021
938
|
export declare function formatBrowserLockEntry(pid: number, token: string): string;
|
|
1022
939
|
|
|
1023
|
-
/**
|
|
1024
|
-
* Narrows an unknown value to a `BrowserDestroyedError`.
|
|
1025
|
-
*
|
|
1026
|
-
* @param value - Value to check
|
|
1027
|
-
* @returns True if value is a BrowserDestroyedError instance; false otherwise
|
|
1028
|
-
*/
|
|
1029
|
-
export declare function isBrowserDestroyedError(value: unknown): value is BrowserDestroyedError;
|
|
1030
|
-
|
|
1031
|
-
/**
|
|
1032
|
-
* Narrows an unknown value to a `BrowserNotConnectedError`.
|
|
1033
|
-
*
|
|
1034
|
-
* @param value - Value to check
|
|
1035
|
-
* @returns True if value is a BrowserNotConnectedError instance; false otherwise
|
|
1036
|
-
*/
|
|
1037
|
-
export declare function isBrowserNotConnectedError(value: unknown): value is BrowserNotConnectedError;
|
|
1038
|
-
|
|
1039
940
|
/**
|
|
1040
941
|
* Launches a browser process with raw-CDP debugging flags.
|
|
1041
942
|
*
|
|
1042
943
|
* @remarks
|
|
944
|
+
* Merges every caller and library `--disable-features` value into one switch because Chromium
|
|
945
|
+
* reads only the last occurrence. Keeps `msImplicitSignin` disabled alongside caller features;
|
|
946
|
+
* Chrome and Chromium ignore this Edge feature name. Preserves the caller's other arguments.
|
|
947
|
+
*
|
|
1043
948
|
* POSIX launches own an isolated process group so lifecycle teardown can
|
|
1044
949
|
* signal and await every Chromium subprocess without affecting the caller.
|
|
1045
950
|
* Windows launches are not detached and own no group, so teardown there
|
|
@@ -1161,7 +1066,7 @@ export declare function removeBrowserProfile(profile: BrowserProfileResult): Pro
|
|
|
1161
1066
|
* Represents one discovered browser executable on this machine.
|
|
1162
1067
|
*
|
|
1163
1068
|
* @remarks
|
|
1164
|
-
* Returned by `findSystemBrowsers
|
|
1069
|
+
* Returned by `findSystemBrowsers` — pairs the resolved
|
|
1165
1070
|
* absolute executable path with its classified engine.
|
|
1166
1071
|
*/
|
|
1167
1072
|
export declare type SystemBrowser = {
|
|
@@ -1170,7 +1075,7 @@ export declare type SystemBrowser = {
|
|
|
1170
1075
|
};
|
|
1171
1076
|
|
|
1172
1077
|
/**
|
|
1173
|
-
* Describes the options overriding
|
|
1078
|
+
* Describes the options overriding the candidate sources for `findSystemBrowsers`.
|
|
1174
1079
|
*
|
|
1175
1080
|
* @remarks
|
|
1176
1081
|
* Each field replaces the default candidate list for its category — a field
|