@browserbasehq/stagehand 3.0.2-alpha-2d1b5732dc441a3331f5743cdfed3e1037d8b3b5 → 3.1.0-alpha-5556041e2deaed5012363303fd7a8ac00e3242cd

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/dist/index.d.ts CHANGED
@@ -199,11 +199,7 @@ declare class CdpConnection implements CDPSessionLike {
199
199
  close(): Promise<void>;
200
200
  getSession(sessionId: string): CdpSession | undefined;
201
201
  attachToTarget(targetId: string): Promise<CdpSession>;
202
- getTargets(): Promise<Array<{
203
- targetId: string;
204
- type: string;
205
- url: string;
206
- }>>;
202
+ getTargets(): Promise<Protocol.Target.TargetInfo[]>;
207
203
  private onMessage;
208
204
  _sendViaSession<R = unknown>(sessionId: string, method: string, params?: object): Promise<R>;
209
205
  _onSessionEvent(sessionId: string, event: string, handler: EventHandler): void;
@@ -1508,6 +1504,9 @@ declare class ExperimentalApiConflictError extends StagehandError {
1508
1504
  declare class ExperimentalNotConfiguredError extends StagehandError {
1509
1505
  constructor(featureName: string);
1510
1506
  }
1507
+ declare class CuaModelRequiredError extends StagehandError {
1508
+ constructor(availableModels: readonly string[]);
1509
+ }
1511
1510
  declare class ZodSchemaValidationError extends Error {
1512
1511
  readonly received: unknown;
1513
1512
  readonly issues: ReturnType<ZodError["format"]>;
@@ -1530,6 +1529,24 @@ declare class StagehandShadowSegmentEmptyError extends StagehandError {
1530
1529
  declare class StagehandShadowSegmentNotFoundError extends StagehandError {
1531
1530
  constructor(segment: string, hint?: string);
1532
1531
  }
1532
+ declare class ElementNotVisibleError extends StagehandError {
1533
+ constructor(selector: string);
1534
+ }
1535
+ declare class ResponseBodyError extends StagehandError {
1536
+ constructor(message: string);
1537
+ }
1538
+ declare class ResponseParseError extends StagehandError {
1539
+ constructor(message: string);
1540
+ }
1541
+ declare class TimeoutError extends StagehandError {
1542
+ constructor(operation: string, timeoutMs: number);
1543
+ }
1544
+ declare class PageNotFoundError extends StagehandError {
1545
+ constructor(identifier: string);
1546
+ }
1547
+ declare class ConnectionTimeoutError extends StagehandError {
1548
+ constructor(message: string);
1549
+ }
1533
1550
 
1534
1551
  declare class AISdkClient extends LLMClient {
1535
1552
  type: "aisdk";
@@ -1690,6 +1707,7 @@ declare class V3Context {
1690
1707
  * We poll internal maps that bootstrap/onAttachedToTarget populate.
1691
1708
  */
1692
1709
  private waitForFirstTopLevelPage;
1710
+ private waitForInitialTopLevelTargets;
1693
1711
  private ensurePiercer;
1694
1712
  /** Mark a page target as the most-recent one (active). */
1695
1713
  private _pushActive;
@@ -2076,4 +2094,4 @@ declare class V3Evaluator {
2076
2094
  private _evaluateWithMultipleScreenshots;
2077
2095
  }
2078
2096
 
2079
- export { type AISDKCustomProvider, type AISDKProvider, AISdkClient, AVAILABLE_CUA_MODELS, type ActOptions, type ActResult, type Action, type ActionExecutionResult, type AgentAction, type AgentConfig, type AgentExecuteOptions, type AgentExecutionOptions, type AgentHandlerOptions, type AgentInstance, type AgentModelConfig, AgentProvider, type AgentProviderType, type AgentResult, AgentScreenshotProviderError, type AgentType, AnnotatedScreenshotText, type AnthropicContentBlock, type AnthropicJsonSchemaObject, type AnthropicMessage, type AnthropicTextBlock, type AnthropicToolResult, type AnyPage, type AvailableCuaModel, type AvailableModel, BrowserbaseSessionNotFoundError, CaptchaTimeoutError, type ChatCompletionOptions, type ChatMessage, type ChatMessageContent, type ChatMessageImageContent, type ChatMessageTextContent, type ClientOptions, type ComputerCallItem, type ConsoleListener, ConsoleMessage, ContentFrameNotFoundError, type CreateChatCompletionOptions, CreateChatCompletionResponseError, ExperimentalApiConflictError, ExperimentalNotConfiguredError, type ExtractOptions, type ExtractResult, type FunctionCallItem, HandlerNotInitializedError, type HistoryEntry, InvalidAISDKModelFormatError, type JsonSchema, type JsonSchemaProperty, LLMClient, type LLMResponse, LLMResponseError, type LLMTool, LOG_LEVEL_NAMES, type LoadState, type LocalBrowserLaunchOptions, type LogLevel, type LogLine, type Logger, MCPConnectionError, MissingEnvironmentVariableError, MissingLLMConfigurationError, type ModelConfiguration, type ModelProvider, type ObserveOptions, Page, Response$1 as Response, type ResponseInputItem, type ResponseItem, V3 as Stagehand, StagehandAPIError, StagehandAPIUnauthorizedError, StagehandClickError, StagehandDefaultError, StagehandDomProcessError, StagehandElementNotFoundError, StagehandEnvironmentError, StagehandError, StagehandEvalError, StagehandHttpError, StagehandIframeError, StagehandInitError, StagehandInvalidArgumentError, type StagehandMetrics, StagehandMissingArgumentError, StagehandNotInitializedError, StagehandResponseBodyError, StagehandResponseParseError, StagehandServerError, StagehandShadowRootMissingError, StagehandShadowSegmentEmptyError, StagehandShadowSegmentNotFoundError, type ToolUseItem, UnsupportedAISDKModelProviderError, UnsupportedModelError, UnsupportedModelProviderError, V3, type V3Env, V3Evaluator, V3FunctionName, type V3Options, XPathResolutionError, ZodSchemaValidationError, connectToMCPServer, defaultExtractSchema, getZodType, injectUrls, isRunningInBun, jsonSchemaToZod, loadApiKeyFromEnv, modelToAgentProviderMap, pageTextSchema, providerEnvVarMap, toGeminiSchema, transformSchema, trimTrailingTextNode, validateZodSchema };
2097
+ export { type AISDKCustomProvider, type AISDKProvider, AISdkClient, AVAILABLE_CUA_MODELS, type ActOptions, type ActResult, type Action, type ActionExecutionResult, type AgentAction, type AgentConfig, type AgentExecuteOptions, type AgentExecutionOptions, type AgentHandlerOptions, type AgentInstance, type AgentModelConfig, AgentProvider, type AgentProviderType, type AgentResult, AgentScreenshotProviderError, type AgentType, AnnotatedScreenshotText, type AnthropicContentBlock, type AnthropicJsonSchemaObject, type AnthropicMessage, type AnthropicTextBlock, type AnthropicToolResult, type AnyPage, type AvailableCuaModel, type AvailableModel, BrowserbaseSessionNotFoundError, CaptchaTimeoutError, type ChatCompletionOptions, type ChatMessage, type ChatMessageContent, type ChatMessageImageContent, type ChatMessageTextContent, type ClientOptions, type ComputerCallItem, ConnectionTimeoutError, type ConsoleListener, ConsoleMessage, ContentFrameNotFoundError, type CreateChatCompletionOptions, CreateChatCompletionResponseError, CuaModelRequiredError, ElementNotVisibleError, ExperimentalApiConflictError, ExperimentalNotConfiguredError, type ExtractOptions, type ExtractResult, type FunctionCallItem, HandlerNotInitializedError, type HistoryEntry, InvalidAISDKModelFormatError, type JsonSchema, type JsonSchemaProperty, LLMClient, type LLMResponse, LLMResponseError, type LLMTool, LOG_LEVEL_NAMES, type LoadState, type LocalBrowserLaunchOptions, type LogLevel, type LogLine, type Logger, MCPConnectionError, MissingEnvironmentVariableError, MissingLLMConfigurationError, type ModelConfiguration, type ModelProvider, type ObserveOptions, Page, PageNotFoundError, Response$1 as Response, ResponseBodyError, type ResponseInputItem, type ResponseItem, ResponseParseError, V3 as Stagehand, StagehandAPIError, StagehandAPIUnauthorizedError, StagehandClickError, StagehandDefaultError, StagehandDomProcessError, StagehandElementNotFoundError, StagehandEnvironmentError, StagehandError, StagehandEvalError, StagehandHttpError, StagehandIframeError, StagehandInitError, StagehandInvalidArgumentError, type StagehandMetrics, StagehandMissingArgumentError, StagehandNotInitializedError, StagehandResponseBodyError, StagehandResponseParseError, StagehandServerError, StagehandShadowRootMissingError, StagehandShadowSegmentEmptyError, StagehandShadowSegmentNotFoundError, TimeoutError, type ToolUseItem, UnsupportedAISDKModelProviderError, UnsupportedModelError, UnsupportedModelProviderError, V3, type V3Env, V3Evaluator, V3FunctionName, type V3Options, XPathResolutionError, ZodSchemaValidationError, connectToMCPServer, defaultExtractSchema, getZodType, injectUrls, isRunningInBun, jsonSchemaToZod, loadApiKeyFromEnv, modelToAgentProviderMap, pageTextSchema, providerEnvVarMap, toGeminiSchema, transformSchema, trimTrailingTextNode, validateZodSchema };