@orkestrel/browser 0.0.28 → 0.0.30

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.
@@ -14,6 +14,7 @@ import type { BrowserRunStoreInterface } from '@orkestrel/browser';
14
14
  import type { BrowserStoreOptions } from '@orkestrel/browser';
15
15
  import type { BrowserStorePage } from '@orkestrel/browser';
16
16
  import type { BrowserStorePageOptions } from '@orkestrel/browser';
17
+ import type { BrowserToolsetInterface } from '@orkestrel/browser';
17
18
  import type { BrowserViewport } from '@orkestrel/browser';
18
19
  import type { BrowserWriterInterface } from '@orkestrel/browser';
19
20
  import type { CDPTarget } from '@orkestrel/browser';
@@ -23,6 +24,7 @@ import type { ChildProcess } from 'node:child_process';
23
24
  import type { EmitterErrorHandler } from '@orkestrel/emitter';
24
25
  import type { EmitterHooks } from '@orkestrel/emitter';
25
26
  import type { EmitterInterface } from '@orkestrel/emitter';
27
+ import type { PoolToken } from '@orkestrel/pool';
26
28
  import type { Readable } from 'node:stream';
27
29
  import type { Result } from '@orkestrel/contract';
28
30
  import type { StdioServerOptions } from '@orkestrel/mcp/server';
@@ -333,6 +335,13 @@ export declare interface BrowserDiscoveryResult {
333
335
  readonly browser: string | undefined;
334
336
  }
335
337
 
338
+ /** Reads the announced CDP endpoint while continuing to drain the browser's standard error. */
339
+ export declare class BrowserEndpoint {
340
+ #private;
341
+ constructor(stream: Readable, signal: AbortSignal);
342
+ get endpoint(): Promise<string>;
343
+ }
344
+
336
345
  /** Names a supported browser engine (raw CDP targets Chromium-family browsers only). */
337
346
  export declare type BrowserEngine = 'chromium' | 'chrome' | 'edge';
338
347
 
@@ -656,6 +665,18 @@ export declare interface BrowserOptions {
656
665
  readonly browsers?: SystemBrowserOptions;
657
666
  }
658
667
 
668
+ /** Waits for a process remainder whose host exposes no exit event. */
669
+ export declare class BrowserProcessDrain implements BrowserProcessDrainInterface {
670
+ #private;
671
+ constructor(inspect: () => boolean | undefined, timeout: number);
672
+ get result(): Promise<boolean | undefined>;
673
+ }
674
+
675
+ /** Exposes whether a process remainder disappeared before its deadline. */
676
+ export declare interface BrowserProcessDrainInterface {
677
+ readonly result: Promise<boolean | undefined>;
678
+ }
679
+
659
680
  /** Names the browser a browse profile serves, which a later start's sweep reads. */
660
681
  export declare interface BrowserProfileRecord {
661
682
  readonly pid: number;
@@ -681,6 +702,32 @@ export declare interface BrowserServerCatalog {
681
702
  readonly tools: readonly ToolDefinition[];
682
703
  }
683
704
 
705
+ /** Owns a holder's context, toolset, and download directory. */
706
+ export declare interface BrowserServerGeneration {
707
+ readonly context: BrowserContextInterface;
708
+ readonly toolset: BrowserToolsetInterface;
709
+ readonly directory: string;
710
+ }
711
+
712
+ /** Identifies an admitted holder and its cancellation lifetime. */
713
+ export declare interface BrowserServerHolder {
714
+ readonly id: string;
715
+ readonly purpose: string;
716
+ readonly abort: AbortController;
717
+ }
718
+
719
+ /** Pairs a pool token with the generation it owns. */
720
+ export declare interface BrowserServerLease {
721
+ readonly token: PoolToken<BrowserServerSlot>;
722
+ readonly generation: BrowserServerGeneration;
723
+ }
724
+
725
+ /** Pairs a pooled browser with its profile directory. */
726
+ export declare interface BrowserServerSlot {
727
+ readonly browser: BrowserInterface;
728
+ readonly profile: string;
729
+ }
730
+
684
731
  /** Names the server tools that manage independent browser holders. */
685
732
  export declare type BrowserServerToolName = 'acquire' | 'execute' | 'tools' | 'destroy';
686
733
 
@@ -1005,15 +1052,6 @@ export declare function parseBrowserViewport(value: string | undefined): Browser
1005
1052
  /** Probes PATH (`which`/`where`) for every resolvable command name, in the given order. */
1006
1053
  export declare function probePathNames(names: readonly string[], platform: string): readonly string[];
1007
1054
 
1008
- /**
1009
- * Probes whether a process has not been confirmed absent.
1010
- * @param pid - Process identifier to probe with signal zero
1011
- * @returns True if the host has not confirmed absence with ESRCH; false otherwise
1012
- * @example
1013
- * probeProcess(process.pid) // true
1014
- */
1015
- export declare function probeProcess(pid: number): boolean;
1016
-
1017
1055
  /**
1018
1056
  * Reads the CDP endpoint a launched browser announces on its standard error.
1019
1057
  *
@@ -14,6 +14,7 @@ import type { BrowserRunStoreInterface } from '@orkestrel/browser';
14
14
  import type { BrowserStoreOptions } from '@orkestrel/browser';
15
15
  import type { BrowserStorePage } from '@orkestrel/browser';
16
16
  import type { BrowserStorePageOptions } from '@orkestrel/browser';
17
+ import type { BrowserToolsetInterface } from '@orkestrel/browser';
17
18
  import type { BrowserViewport } from '@orkestrel/browser';
18
19
  import type { BrowserWriterInterface } from '@orkestrel/browser';
19
20
  import type { CDPTarget } from '@orkestrel/browser';
@@ -23,6 +24,7 @@ import type { ChildProcess } from 'node:child_process';
23
24
  import type { EmitterErrorHandler } from '@orkestrel/emitter';
24
25
  import type { EmitterHooks } from '@orkestrel/emitter';
25
26
  import type { EmitterInterface } from '@orkestrel/emitter';
27
+ import type { PoolToken } from '@orkestrel/pool';
26
28
  import type { Readable } from 'node:stream';
27
29
  import type { Result } from '@orkestrel/contract';
28
30
  import type { StdioServerOptions } from '@orkestrel/mcp/server';
@@ -333,6 +335,13 @@ export declare interface BrowserDiscoveryResult {
333
335
  readonly browser: string | undefined;
334
336
  }
335
337
 
338
+ /** Reads the announced CDP endpoint while continuing to drain the browser's standard error. */
339
+ export declare class BrowserEndpoint {
340
+ #private;
341
+ constructor(stream: Readable, signal: AbortSignal);
342
+ get endpoint(): Promise<string>;
343
+ }
344
+
336
345
  /** Names a supported browser engine (raw CDP targets Chromium-family browsers only). */
337
346
  export declare type BrowserEngine = 'chromium' | 'chrome' | 'edge';
338
347
 
@@ -656,6 +665,18 @@ export declare interface BrowserOptions {
656
665
  readonly browsers?: SystemBrowserOptions;
657
666
  }
658
667
 
668
+ /** Waits for a process remainder whose host exposes no exit event. */
669
+ export declare class BrowserProcessDrain implements BrowserProcessDrainInterface {
670
+ #private;
671
+ constructor(inspect: () => boolean | undefined, timeout: number);
672
+ get result(): Promise<boolean | undefined>;
673
+ }
674
+
675
+ /** Exposes whether a process remainder disappeared before its deadline. */
676
+ export declare interface BrowserProcessDrainInterface {
677
+ readonly result: Promise<boolean | undefined>;
678
+ }
679
+
659
680
  /** Names the browser a browse profile serves, which a later start's sweep reads. */
660
681
  export declare interface BrowserProfileRecord {
661
682
  readonly pid: number;
@@ -681,6 +702,32 @@ export declare interface BrowserServerCatalog {
681
702
  readonly tools: readonly ToolDefinition[];
682
703
  }
683
704
 
705
+ /** Owns a holder's context, toolset, and download directory. */
706
+ export declare interface BrowserServerGeneration {
707
+ readonly context: BrowserContextInterface;
708
+ readonly toolset: BrowserToolsetInterface;
709
+ readonly directory: string;
710
+ }
711
+
712
+ /** Identifies an admitted holder and its cancellation lifetime. */
713
+ export declare interface BrowserServerHolder {
714
+ readonly id: string;
715
+ readonly purpose: string;
716
+ readonly abort: AbortController;
717
+ }
718
+
719
+ /** Pairs a pool token with the generation it owns. */
720
+ export declare interface BrowserServerLease {
721
+ readonly token: PoolToken<BrowserServerSlot>;
722
+ readonly generation: BrowserServerGeneration;
723
+ }
724
+
725
+ /** Pairs a pooled browser with its profile directory. */
726
+ export declare interface BrowserServerSlot {
727
+ readonly browser: BrowserInterface;
728
+ readonly profile: string;
729
+ }
730
+
684
731
  /** Names the server tools that manage independent browser holders. */
685
732
  export declare type BrowserServerToolName = 'acquire' | 'execute' | 'tools' | 'destroy';
686
733
 
@@ -1005,15 +1052,6 @@ export declare function parseBrowserViewport(value: string | undefined): Browser
1005
1052
  /** Probes PATH (`which`/`where`) for every resolvable command name, in the given order. */
1006
1053
  export declare function probePathNames(names: readonly string[], platform: string): readonly string[];
1007
1054
 
1008
- /**
1009
- * Probes whether a process has not been confirmed absent.
1010
- * @param pid - Process identifier to probe with signal zero
1011
- * @returns True if the host has not confirmed absence with ESRCH; false otherwise
1012
- * @example
1013
- * probeProcess(process.pid) // true
1014
- */
1015
- export declare function probeProcess(pid: number): boolean;
1016
-
1017
1055
  /**
1018
1056
  * Reads the CDP endpoint a launched browser announces on its standard error.
1019
1057
  *