@orkestrel/browser 0.0.22 → 0.0.24
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 +1 -1
- package/dist/bin/main.js +19 -4
- package/dist/bin/main.js.map +1 -1
- package/dist/src/core/index.cjs +62 -15
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +20 -10
- package/dist/src/core/index.d.ts +20 -10
- package/dist/src/core/index.js +62 -15
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +831 -100
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +180 -17
- package/dist/src/server/index.d.ts +180 -17
- package/dist/src/server/index.js +816 -104
- package/dist/src/server/index.js.map +1 -1
- package/package.json +4 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BrowserCallOptions } from '@orkestrel/browser';
|
|
1
2
|
import type { BrowserContextInterface } from '@orkestrel/browser';
|
|
2
3
|
import type { BrowserContextOptions } from '@orkestrel/browser';
|
|
3
4
|
import { BrowserError } from '@orkestrel/browser';
|
|
@@ -11,6 +12,7 @@ import type { BrowserRunSlot } from '@orkestrel/browser';
|
|
|
11
12
|
import type { BrowserRunStoreInterface } from '@orkestrel/browser';
|
|
12
13
|
import type { BrowserStoreOptions } from '@orkestrel/browser';
|
|
13
14
|
import type { BrowserStorePage } from '@orkestrel/browser';
|
|
15
|
+
import type { BrowserToolsetInterface } from '@orkestrel/browser';
|
|
14
16
|
import type { BrowserViewport } from '@orkestrel/browser';
|
|
15
17
|
import type { BrowserWriterInterface } from '@orkestrel/browser';
|
|
16
18
|
import type { CDPTarget } from '@orkestrel/browser';
|
|
@@ -20,9 +22,12 @@ import type { ChildProcess } from 'node:child_process';
|
|
|
20
22
|
import type { EmitterErrorHandler } from '@orkestrel/emitter';
|
|
21
23
|
import type { EmitterHooks } from '@orkestrel/emitter';
|
|
22
24
|
import type { EmitterInterface } from '@orkestrel/emitter';
|
|
25
|
+
import type { PoolToken } from '@orkestrel/pool';
|
|
23
26
|
import type { Readable } from 'node:stream';
|
|
24
27
|
import type { Result } from '@orkestrel/contract';
|
|
25
28
|
import type { StdioServerOptions } from '@orkestrel/mcp/server';
|
|
29
|
+
import type { ToolDefinition } from '@orkestrel/tool';
|
|
30
|
+
import type { ToolInterface } from '@orkestrel/tool';
|
|
26
31
|
|
|
27
32
|
/**
|
|
28
33
|
* Discovers, launches, connects to, and owns Chromium-family browser sessions.
|
|
@@ -46,6 +51,8 @@ export declare class Browser implements BrowserInterface {
|
|
|
46
51
|
get connection(): BrowserConnection | undefined;
|
|
47
52
|
get owned(): boolean | undefined;
|
|
48
53
|
get pid(): number | undefined;
|
|
54
|
+
get endpoint(): string | undefined;
|
|
55
|
+
ping(options?: BrowserCallOptions): Promise<void>;
|
|
49
56
|
discover(): Promise<BrowserDiscoveryResult>;
|
|
50
57
|
connect(): Promise<void>;
|
|
51
58
|
adopt(): void;
|
|
@@ -181,6 +188,51 @@ export declare const BROWSER_RUN_DIRECTORY = "runs";
|
|
|
181
188
|
/** Names the persisted run snapshot. */
|
|
182
189
|
export declare const BROWSER_RUN_FILE = "run.json";
|
|
183
190
|
|
|
191
|
+
/** Names the refusal when every browser is admitted to a holder. */
|
|
192
|
+
export declare const BROWSER_SERVER_BUSY = "BROWSER_SERVER_BUSY";
|
|
193
|
+
|
|
194
|
+
/** Defines the holder tools independently of the shared browser's vocabulary. */
|
|
195
|
+
export declare const BROWSER_SERVER_COPY: Readonly<Record<BrowserServerToolName, ToolDefinition>>;
|
|
196
|
+
|
|
197
|
+
/** Names the notice that a browser and its session state were lost. */
|
|
198
|
+
export declare const BROWSER_SERVER_CRASH = "BROWSER_SERVER_CRASH";
|
|
199
|
+
|
|
200
|
+
/** Names the diagnostic when the warm floor spends its restart bound. */
|
|
201
|
+
export declare const BROWSER_SERVER_EXHAUSTED = "BROWSER_SERVER_EXHAUSTED";
|
|
202
|
+
|
|
203
|
+
/** Names the refusal for an unknown or ended holder. */
|
|
204
|
+
export declare const BROWSER_SERVER_HOLDER = "BROWSER_SERVER_HOLDER";
|
|
205
|
+
|
|
206
|
+
/** Names a failed attempt to warm a browser. */
|
|
207
|
+
export declare const BROWSER_SERVER_LAUNCH = "BROWSER_SERVER_LAUNCH";
|
|
208
|
+
|
|
209
|
+
/** Names a refused browser server option. */
|
|
210
|
+
export declare const BROWSER_SERVER_OPTIONS = "BROWSER_SERVER_OPTIONS";
|
|
211
|
+
|
|
212
|
+
/** Limits the number of warm browsers to 3. */
|
|
213
|
+
export declare const BROWSER_SERVER_POOL_LIMIT = 3;
|
|
214
|
+
|
|
215
|
+
/** Sets the default number of warm browsers to 1. */
|
|
216
|
+
export declare const BROWSER_SERVER_POOL_SIZE = 1;
|
|
217
|
+
|
|
218
|
+
/** Names the browser process record in each profile. */
|
|
219
|
+
export declare const BROWSER_SERVER_RECORD = "browse.json";
|
|
220
|
+
|
|
221
|
+
/** Permits one failed refill before the next failure spends the bound. */
|
|
222
|
+
export declare const BROWSER_SERVER_RESTARTS = 1;
|
|
223
|
+
|
|
224
|
+
/** Names a failed profile sweep. */
|
|
225
|
+
export declare const BROWSER_SERVER_SWEEP = "BROWSER_SERVER_SWEEP";
|
|
226
|
+
|
|
227
|
+
/** Names a failed browser server teardown. */
|
|
228
|
+
export declare const BROWSER_SERVER_TEARDOWN = "BROWSER_SERVER_TEARDOWN";
|
|
229
|
+
|
|
230
|
+
/** Names the refusal when no browser can serve a call. */
|
|
231
|
+
export declare const BROWSER_SERVER_UNAVAILABLE = "BROWSER_SERVER_UNAVAILABLE";
|
|
232
|
+
|
|
233
|
+
/** Names an interrupted call whose outcome is unknown. */
|
|
234
|
+
export declare const BROWSER_SERVER_UNRESOLVED = "BROWSER_SERVER_UNRESOLVED";
|
|
235
|
+
|
|
184
236
|
/** Names the per-OS default Playwright browser cache directory, relative to the home directory (win32 uses `LOCALAPPDATA` directly). */
|
|
185
237
|
export declare const BROWSER_STORE_CACHE_DIRS: Readonly<Record<string, string>>;
|
|
186
238
|
|
|
@@ -237,7 +289,7 @@ export declare const BROWSER_WINDOWS_SUFFIXES: readonly string[];
|
|
|
237
289
|
* - `endpoint` — explicit CDP WebSocket URL; when provided, skips discovery
|
|
238
290
|
* - `discover` — whether `connect()` passively probes for an existing browser
|
|
239
291
|
* before launching (default `true`); set `false` to skip discovery and go
|
|
240
|
-
* straight to launch — a short probe
|
|
292
|
+
* straight to launch — when `port` is explicit, a short probe runs first and rejects
|
|
241
293
|
* with a coded error naming the occupied port if something is already
|
|
242
294
|
* listening there, so a demanded fresh launch never silently attaches to a
|
|
243
295
|
* stranger browser
|
|
@@ -355,6 +407,10 @@ export declare type BrowserEventMap = {
|
|
|
355
407
|
* - `create(options?)` → shortcut to open a page in the default context
|
|
356
408
|
*/
|
|
357
409
|
export declare interface BrowserInterface {
|
|
410
|
+
/** Reports the CDP WebSocket endpoint of the represented session, or undefined when none is. */
|
|
411
|
+
readonly endpoint: string | undefined;
|
|
412
|
+
/** Sends CDP `Browser.getVersion` and resolves when the browser answers, changing no state. */
|
|
413
|
+
ping(options?: BrowserCallOptions): Promise<void>;
|
|
358
414
|
readonly emitter: EmitterInterface<BrowserEventMap>;
|
|
359
415
|
readonly engine: BrowserEngine;
|
|
360
416
|
readonly status: BrowserStatus;
|
|
@@ -435,17 +491,17 @@ export declare interface BrowserInterface {
|
|
|
435
491
|
}
|
|
436
492
|
|
|
437
493
|
/**
|
|
438
|
-
* Creates
|
|
494
|
+
* Creates a browser a browse server connects while warming its pool.
|
|
439
495
|
*
|
|
440
496
|
* @param options - The launch the server composes: `headless`, `executable`, the profile it
|
|
441
|
-
* owns, `cdp.discover` set to `false`, and the signal its `destroy()` aborts
|
|
497
|
+
* owns, the optional `viewport`, `cdp.discover` set to `false`, and the signal its `destroy()` aborts
|
|
442
498
|
* @returns A browser whose `connect()` launches it
|
|
443
499
|
*/
|
|
444
500
|
export declare type BrowserLaunchFunction = (options: BrowserOptions) => BrowserInterface;
|
|
445
501
|
|
|
446
502
|
/**
|
|
447
503
|
* Implements `BrowserMCPServerInterface`: serves the browser vocabulary and the journey tools over
|
|
448
|
-
* the Model Context Protocol on stdio, and
|
|
504
|
+
* the Model Context Protocol on stdio, and warms Chromium at server start.
|
|
449
505
|
*
|
|
450
506
|
* @remarks
|
|
451
507
|
* The server's own manager holds one dispatcher per name of the vocabulary — `look`, `read`, `plain`,
|
|
@@ -455,18 +511,27 @@ export declare type BrowserLaunchFunction = (options: BrowserOptions) => Browser
|
|
|
455
511
|
* absent. After the launch, a tool the toolset's manager adds under another name, such as a page
|
|
456
512
|
* tool it adopts, is mirrored as a dispatcher with that tool's definition, and the mirror is
|
|
457
513
|
* removed when the toolset withdraws the tool, so the server's tool list changes and a subscribed
|
|
458
|
-
* client is notified. The
|
|
459
|
-
*
|
|
460
|
-
*
|
|
514
|
+
* client is notified. The server also advertises `acquire`, `execute`, `tools`, and `destroy` with
|
|
515
|
+
* `BROWSER_SERVER_COPY`. Startup warms the pool and leases the shared browser. The legacy
|
|
516
|
+
* handshake and browser calls await that setup. Named holders each own a lease, a pending grant,
|
|
517
|
+
* and loss notices; concurrent calls on a holder share its replacement grant. Ending a holder
|
|
518
|
+
* destroys its token, and admission counts that holder until disposal settles.
|
|
519
|
+
* A launch creates `ROOT/.profiles/PID-UUID/` exclusively, connects a browser that never attaches to an
|
|
461
520
|
* existing endpoint, opens one page in an isolated context, and constructs the page toolset with
|
|
462
521
|
* that context and the file journey and run stores under the root, on a manager the toolset owns.
|
|
463
522
|
* A dispatcher forwards its arguments and the call's context, signal included, to the toolset's
|
|
464
523
|
* manager and returns that manager's value, or rejects with its failure message; a text value
|
|
465
524
|
* reaches the client as one text block rather than as its JSON text.
|
|
525
|
+
* A disconnect or current-page crash retires its slot. A failed call receives a liveness ping;
|
|
526
|
+
* loss makes its outcome unresolved, while a known success remains successful. Pending losses
|
|
527
|
+
* prefix the next outcome on a successor, or a refusal, and calls are never repeated.
|
|
528
|
+
* Concurrent checks share one ping per slot. Cancelling a call ends only its wait; the ping keeps
|
|
529
|
+
* its deadline and records loss for the next call.
|
|
466
530
|
*
|
|
467
531
|
* `start()` serves stdio and destroys the server at the end of its input, on `SIGINT`, and on
|
|
468
|
-
* `SIGTERM`. `destroy()` stops reading requests and removes every dispatcher, then destroys
|
|
469
|
-
* toolset, which aborts the active replay, then
|
|
532
|
+
* `SIGTERM`. `destroy()` stops reading requests and removes every dispatcher, then destroys every
|
|
533
|
+
* slot through the pool — its toolset, which aborts the active replay, then its browser, then its
|
|
534
|
+
* profile — and rechecks the profile folders this server made or kept.
|
|
470
535
|
*
|
|
471
536
|
* Chromium on Linux refuses to start as the root user unless its sandbox is disabled, so a server
|
|
472
537
|
* running as root on Linux launches Chromium with `--no-sandbox`; a launch that could run
|
|
@@ -496,13 +561,14 @@ export declare class BrowserMCPServer implements BrowserMCPServerInterface {
|
|
|
496
561
|
/** Serves the browser vocabulary and the journey tools over MCP on stdio. */
|
|
497
562
|
export declare interface BrowserMCPServerInterface {
|
|
498
563
|
/**
|
|
499
|
-
* Serves
|
|
500
|
-
*
|
|
564
|
+
* Serves stdio, sweeps the profiles ended servers left, warms the pool, and resolves after the
|
|
565
|
+
* shared holder leases a warm browser; the legacy handshake and every tool call await the same setup.
|
|
566
|
+
* Rejects with `BROWSER_SERVER_UNAVAILABLE` when no browser can serve and with
|
|
567
|
+
* `BROWSER_TOOLSET_ENDED` after `destroy()`, and resolves when `destroy()` interrupts setup.
|
|
501
568
|
*/
|
|
502
569
|
start(): Promise<void>;
|
|
503
570
|
/**
|
|
504
|
-
* Stops admission,
|
|
505
|
-
* and removes its profile.
|
|
571
|
+
* Stops admission, tears down every browser, its toolset, and its profile, then rechecks the folders it answers for.
|
|
506
572
|
*/
|
|
507
573
|
destroy(): Promise<void>;
|
|
508
574
|
}
|
|
@@ -517,19 +583,30 @@ export declare interface BrowserMCPServerInterface {
|
|
|
517
583
|
* `true`
|
|
518
584
|
* - `executable` — the path of the Chromium executable the server launches. Default: the browser
|
|
519
585
|
* `findSystemBrowser` finds
|
|
520
|
-
* - `
|
|
586
|
+
* - `viewport` — the default viewport for every page in each browser's isolated context;
|
|
587
|
+
* omission keeps the browser's launch default
|
|
588
|
+
* - `readonly` — if `true`, refuses `record`, `save`, `edit`, and `forget`, and `replay` still writes runs;
|
|
521
589
|
* if `false` or omitted, every tool runs
|
|
522
|
-
* - `launch` — creates
|
|
590
|
+
* - `launch` — creates each browser the pool warms. Default: `createBrowser`
|
|
523
591
|
* - `stdio` — the streams the server reads requests from and writes answers to; the end of
|
|
524
592
|
* `input` destroys the server. Default: `process.stdin` and `process.stdout`
|
|
593
|
+
* - `pool.size` — the integer number of browsers kept warm, from 1 through
|
|
594
|
+
* `BROWSER_SERVER_POOL_LIMIT`. Default: `BROWSER_SERVER_POOL_SIZE`.
|
|
595
|
+
* - `log` — receives diagnostic lines. Default: `process.stderr`
|
|
596
|
+
* @throws Thrown when `pool.size` is outside that range or is not an integer, with `BROWSER_SERVER_OPTIONS`
|
|
525
597
|
*/
|
|
526
598
|
export declare interface BrowserMCPServerOptions {
|
|
527
599
|
readonly root?: string;
|
|
528
600
|
readonly headless?: boolean;
|
|
529
601
|
readonly executable?: string;
|
|
602
|
+
readonly viewport?: BrowserViewport;
|
|
530
603
|
readonly readonly?: boolean;
|
|
531
604
|
readonly launch?: BrowserLaunchFunction;
|
|
532
605
|
readonly stdio?: StdioServerOptions;
|
|
606
|
+
readonly pool?: {
|
|
607
|
+
readonly size?: number;
|
|
608
|
+
};
|
|
609
|
+
readonly log?: NodeJS.WritableStream;
|
|
533
610
|
}
|
|
534
611
|
|
|
535
612
|
/**
|
|
@@ -577,6 +654,12 @@ export declare interface BrowserOptions {
|
|
|
577
654
|
readonly browsers?: SystemBrowserOptions;
|
|
578
655
|
}
|
|
579
656
|
|
|
657
|
+
/** Names the browser a browse profile serves, which a later start's sweep reads. */
|
|
658
|
+
export declare interface BrowserProfileRecord {
|
|
659
|
+
readonly pid: number;
|
|
660
|
+
readonly endpoint: string;
|
|
661
|
+
}
|
|
662
|
+
|
|
580
663
|
/**
|
|
581
664
|
* Describes the resolved browser profile directory used for a Chromium-family launch.
|
|
582
665
|
*
|
|
@@ -590,6 +673,47 @@ export declare interface BrowserProfileResult {
|
|
|
590
673
|
readonly temporary: boolean;
|
|
591
674
|
}
|
|
592
675
|
|
|
676
|
+
/** Describes the JSON catalog returned by the holder tools. */
|
|
677
|
+
export declare interface BrowserServerCatalog {
|
|
678
|
+
readonly holder: string;
|
|
679
|
+
readonly tools: readonly ToolDefinition[];
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
/** Identifies one admitted browser lifetime independently of its current pool token. */
|
|
683
|
+
export declare interface BrowserServerHolder {
|
|
684
|
+
readonly id: string;
|
|
685
|
+
readonly purpose: string;
|
|
686
|
+
readonly abort: AbortController;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
/** Binds shared catalog subscriptions to the exact token that published them. */
|
|
690
|
+
export declare interface BrowserServerMirror {
|
|
691
|
+
readonly token: PoolToken<BrowserSlot>;
|
|
692
|
+
readonly added: (tool: ToolInterface) => void;
|
|
693
|
+
readonly removed: (tool: ToolInterface) => void;
|
|
694
|
+
readonly cleared: (tools: readonly ToolInterface[]) => void;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/** Names the server tools that manage independent browser holders. */
|
|
698
|
+
export declare type BrowserServerToolName = 'acquire' | 'execute' | 'tools' | 'destroy';
|
|
699
|
+
|
|
700
|
+
/** Holds one warm browser a browse server owns: the browser, its profile, its isolated context, and its started toolset. */
|
|
701
|
+
export declare interface BrowserSlot {
|
|
702
|
+
readonly browser: BrowserInterface;
|
|
703
|
+
readonly profile: string;
|
|
704
|
+
readonly context: BrowserContextInterface;
|
|
705
|
+
readonly toolset: BrowserToolsetInterface;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/** Holds the listeners and resolver of one browser slot's loss watch. */
|
|
709
|
+
export declare interface BrowserSlotWatch {
|
|
710
|
+
readonly resolve: (cause: unknown) => void;
|
|
711
|
+
readonly disconnect: () => void;
|
|
712
|
+
readonly page: (page: BrowserPageInterface) => void;
|
|
713
|
+
readonly crashes: ReadonlyMap<BrowserPageInterface, () => void>;
|
|
714
|
+
readonly subscription: Disposable;
|
|
715
|
+
}
|
|
716
|
+
|
|
593
717
|
/** Names the lifecycle status of a browser wrapper. */
|
|
594
718
|
export declare type BrowserStatus = 'idle' | 'connecting' | 'connected' | 'disconnected' | 'error';
|
|
595
719
|
|
|
@@ -628,7 +752,7 @@ export declare function createBrowser(options?: BrowserOptions): BrowserInterfac
|
|
|
628
752
|
|
|
629
753
|
/**
|
|
630
754
|
* Creates the browse server, which serves the browser vocabulary and the journey tools over the
|
|
631
|
-
* Model Context Protocol on stdio and
|
|
755
|
+
* Model Context Protocol on stdio and warms Chromium at server start.
|
|
632
756
|
*
|
|
633
757
|
* @param options - The root, the launch, the journeys' read-only switch, and the streams
|
|
634
758
|
* @returns A {@link BrowserMCPServerInterface} that reads nothing until `start()`
|
|
@@ -638,7 +762,7 @@ export declare function createBrowser(options?: BrowserOptions): BrowserInterfac
|
|
|
638
762
|
* import { createBrowserMCPServer } from '@orkestrel/browser/server'
|
|
639
763
|
*
|
|
640
764
|
* const server = createBrowserMCPServer({ root: 'tmp/browsers', headless: true })
|
|
641
|
-
* await server.start() //
|
|
765
|
+
* await server.start() // resolves after leasing a connected browser
|
|
642
766
|
* await server.destroy()
|
|
643
767
|
* ```
|
|
644
768
|
*/
|
|
@@ -686,6 +810,17 @@ export declare function createFileBrowserJourneyStore(options: FileBrowserStoreO
|
|
|
686
810
|
*/
|
|
687
811
|
export declare function createFileBrowserRunStore(options: FileBrowserStoreOptions): BrowserRunStoreInterface;
|
|
688
812
|
|
|
813
|
+
/**
|
|
814
|
+
* Describes a browser loss with its code, cause, and the session state it invalidates.
|
|
815
|
+
* @param code - Browser server diagnostic code
|
|
816
|
+
* @param cause - The loss or refusal, including its process context when present
|
|
817
|
+
* @param url - The lost page's last URL, when known
|
|
818
|
+
* @returns The coded diagnostic and any operation-lifecycle guidance
|
|
819
|
+
* @example
|
|
820
|
+
* describeBrowserServerLoss('BROWSER_SERVER_UNAVAILABLE', new Error('Browser exited'))
|
|
821
|
+
*/
|
|
822
|
+
export declare function describeBrowserServerLoss(code: string, cause: unknown, url?: string): string;
|
|
823
|
+
|
|
689
824
|
/**
|
|
690
825
|
* Fetches the current CDP target list from a browser's `/json/list` endpoint, as a `Result`
|
|
691
826
|
* carrying either the targets or a coded `BrowserConnectionError`.
|
|
@@ -741,6 +876,7 @@ export declare class FileBrowserJourneyStore implements BrowserJourneyStoreInter
|
|
|
741
876
|
export declare class FileBrowserRunStore implements BrowserRunStoreInterface {
|
|
742
877
|
#private;
|
|
743
878
|
constructor(options: FileBrowserStoreOptions);
|
|
879
|
+
snapshot(bytes: Uint8Array, options?: BrowserStoreOptions): Promise<string>;
|
|
744
880
|
open(name: string, options?: BrowserStoreOptions): Promise<BrowserRunSlot>;
|
|
745
881
|
get(name: string, id: string, options?: BrowserStoreOptions): Promise<BrowserRun | undefined>;
|
|
746
882
|
set(run: BrowserRun, options?: BrowserStoreOptions): Promise<void>;
|
|
@@ -903,9 +1039,36 @@ export declare function parseBrowserEngine(executable: string): BrowserEngine |
|
|
|
903
1039
|
*/
|
|
904
1040
|
export declare function parseBrowserLockEntry(name: string): number | undefined;
|
|
905
1041
|
|
|
1042
|
+
/**
|
|
1043
|
+
* Parses a profile record naming a positive process identifier and a loopback DevTools endpoint.
|
|
1044
|
+
* @param text - JSON record read from a browse profile
|
|
1045
|
+
* @returns The record, or undefined when its shape or endpoint is refused
|
|
1046
|
+
* @example
|
|
1047
|
+
* parseBrowserProfileRecord('{"pid":123,"endpoint":"ws://127.0.0.1:9222/devtools/browser/session"}')
|
|
1048
|
+
*/
|
|
1049
|
+
export declare function parseBrowserProfileRecord(text: string): BrowserProfileRecord | undefined;
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* Parses positive integer viewport dimensions in WIDTHxHEIGHT form.
|
|
1053
|
+
* @param value - The viewport environment variable, or undefined when unset
|
|
1054
|
+
* @returns The viewport, or undefined when absent or malformed
|
|
1055
|
+
* @example
|
|
1056
|
+
* parseBrowserViewport('1280x720') // { width: 1280, height: 720 }
|
|
1057
|
+
*/
|
|
1058
|
+
export declare function parseBrowserViewport(value: string | undefined): BrowserViewport | undefined;
|
|
1059
|
+
|
|
906
1060
|
/** Probes PATH (`which`/`where`) for every resolvable command name, in the given order. */
|
|
907
1061
|
export declare function probePathNames(names: readonly string[], platform: string): readonly string[];
|
|
908
1062
|
|
|
1063
|
+
/**
|
|
1064
|
+
* Probes whether a process has not been confirmed absent.
|
|
1065
|
+
* @param pid - Process identifier to probe with signal zero
|
|
1066
|
+
* @returns True if the host has not confirmed absence with ESRCH; false otherwise
|
|
1067
|
+
* @example
|
|
1068
|
+
* probeProcess(process.pid) // true
|
|
1069
|
+
*/
|
|
1070
|
+
export declare function probeProcess(pid: number): boolean;
|
|
1071
|
+
|
|
909
1072
|
/**
|
|
910
1073
|
* Reads the CDP endpoint a launched browser announces on its standard error.
|
|
911
1074
|
*
|