import type { Logger } from "pino"; import type { Gateway } from "../../core/index.js"; import { CdpProtocolClient } from "../../core/cdp/protocol.js"; import { AgentSession } from "../../agent-tools/index.js"; export interface McpBrowserSession { sessionId: string; providerId: string; agent: AgentSession; cdp: CdpProtocolClient; createdAt: number; } export interface LazyProviderSetup { (): Promise; } export interface ConnectEndpoint { url: string; headers?: Record; } export interface CreateSessionOptions { timeout?: number; idleMs?: number; pageConsole?: boolean; } /** Owns one {@link AgentSession} per MCP browser session, routed through the * gateway so provider selection, failover and slot accounting still apply. */ export declare class McpSessionManager { private gateway; private logger; private sessions; private providerSetupPromise; private providerSetup; private connectEndpoint; constructor(gateway: Gateway, logger: Logger); setLazyProviderSetup(setup: LazyProviderSetup): void; /** Route sessions through the gateway's own `/v1/connect` so profiles, * recording and session tracking apply. Without it (stdio, no server * running) sessions use gateway routing in-process and dial the selected * provider directly. */ setConnectEndpoint(endpoint: ConnectEndpoint): void; createSession(options?: CreateSessionOptions): Promise; private createViaGateway; /** Closes this session's tabs and its own CDP connection. Never closes the * upstream browser: other sessions and clients may be using it. */ releaseSession(sessionId: string): Promise<{ success: boolean; durationMs?: number; }>; get(sessionId: string): McpBrowserSession | undefined; /** Resolves the session a tool call means. With several open sessions the * caller must name one: guessing would hand one client another's browser. */ resolve(sessionId?: string): McpBrowserSession; getAll(): McpBrowserSession[]; count(): number; /** Drops sessions the policy already expired so their slots are not held. */ reapExpired(): Promise; releaseAll(): Promise; private ensureProviders; } //# sourceMappingURL=sessions.d.ts.map