import { BedrockAgentCoreClient } from '@aws-sdk/client-bedrock-agentcore'; import type { BrowserClientConfig, SessionInfo, StartSessionParams, WebSocketConnection, GetSessionParams, GetSessionResponse, ListSessionsParams, ListSessionsResponse, UpdateStreamParams, UpdateStreamResponse } from './types.js'; /** * Base client for AWS Bedrock AgentCore Browser service. * * Provides core AWS SDK operations for browser session management and WebSocket connectivity. * This client handles session lifecycle and authentication but does not include browser * automation methods. Use PlaywrightBrowser for full browser automation capabilities. * * @example * ```typescript * const browser = new Browser({ region: 'us-east-1' }) * * // Start a session * const session = await browser.startSession({ sessionName: 'my-session' }) * * // Get WebSocket URL for custom browser integration * const wsConnection = await browser.generateWebSocketUrl() * * // Stop the session * await browser.stopSession() * ``` */ export declare class Browser { readonly region: string; readonly identifier: string; protected _client: BedrockAgentCoreClient; protected _session: SessionInfo | null; private _credentialsProvider; /** * Creates a new BrowserClient instance. * * @param config - Configuration options for the client */ constructor(config: BrowserClientConfig); /** * Starts a new browser session. * * @param params - Optional parameters for session configuration * @returns Information about the started session * * @throws Error if a session is already active */ startSession(params?: StartSessionParams): Promise; /** * Attaches an existing session by ID so that signing methods * (generateWebSocketUrl, generateLiveViewUrl) can be used * without calling startSession(). * * @param sessionId - The ID of an existing browser session */ attachSession(sessionId: string): void; /** * Stops the active browser session. * * @throws Error if no session is active */ stopSession(): Promise; /** * Get detailed information about a browser session. * * @param params - Optional parameters specifying which session to query * @returns Detailed session information * * @example * ```typescript * // Get current active session details * const sessionInfo = await browser.getSession() * console.log(`Session status: ${sessionInfo.status}`) * * // Get details for a specific session * const sessionInfo = await browser.getSession({ * sessionId: 'specific-session-id' * }) * ``` */ getSession(params?: GetSessionParams): Promise; /** * List browser sessions for this browser. * * @param params - Optional filtering and pagination parameters * @returns List of session summaries with optional pagination token * * @example * ```typescript * // List all active sessions * const response = await browser.listSessions({ status: 'READY' }) * for (const session of response.items) { * console.log(`Session ${session.sessionId}: ${session.status}`) * } * * // Paginate through results * let response = await browser.listSessions({ maxResults: 10 }) * while (response.nextToken) { * response = await browser.listSessions({ * maxResults: 10, * nextToken: response.nextToken * }) * } * ``` */ listSessions(params?: ListSessionsParams): Promise; /** * Update the browser automation stream status. * * @param params - Stream update parameters * @returns Updated stream information * * @example * ```typescript * // Enable automation stream * const result = await browser.updateBrowserStream({ * streamStatus: 'ENABLED' * }) * * // Disable automation stream * await browser.updateBrowserStream({ * streamStatus: 'DISABLED' * }) * ``` */ updateBrowserStream(params: UpdateStreamParams): Promise; /** * Generates a presigned HTTPS URL for the browser live-view (DCV streaming). * Uses SigV4 presigning with query parameters — suitable for browser-side * WebSocket connections where custom headers cannot be sent. * * @param expiresIn - URL expiration in seconds (default: 300) * @returns Presigned HTTPS URL string * * @throws Error if no session is active */ generateLiveViewUrl(expiresIn?: number): Promise; /** * Generates a WebSocket URL and authentication headers for browser automation. * Uses AWS Signature Version 4 to sign the WebSocket connection request. * * @returns WebSocket connection details with URL and authentication headers * * @throws Error if no session is active */ generateWebSocketUrl(): Promise; } //# sourceMappingURL=client.d.ts.map