@browserbasehq/orca 3.0.2-test-cua-base-url → 3.0.2-zod34

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +127 -49
  2. package/dist/index.js +1538 -792
  3. package/package.json +5 -4
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import z, { ZodType, z as z$1, ZodError, ZodTypeAny } from 'zod/v3';
1
+ import { ZodTypeAny, z, ZodError } from 'zod';
2
+ import * as z3 from 'zod/v3';
2
3
  import { ClientOptions as ClientOptions$2 } from '@anthropic-ai/sdk';
3
4
  import { LanguageModelV2 } from '@ai-sdk/provider';
4
5
  import { ClientOptions as ClientOptions$1 } from 'openai';
@@ -17,6 +18,9 @@ import { ChatCompletion } from 'openai/resources';
17
18
  import { ToolSet as ToolSet$1 } from 'ai/dist';
18
19
  import { Schema } from '@google/genai';
19
20
 
21
+ type StagehandZodSchema = ZodTypeAny | z3.ZodTypeAny;
22
+ type InferStagehandSchema<T extends StagehandZodSchema> = T extends z3.ZodTypeAny ? z3.infer<T> : T extends ZodTypeAny ? z.infer<T> : never;
23
+
20
24
  type AnthropicJsonSchemaObject = {
21
25
  definitions?: {
22
26
  MySchema?: {
@@ -102,7 +106,7 @@ interface ChatCompletionOptions {
102
106
  };
103
107
  response_model?: {
104
108
  name: string;
105
- schema: ZodType;
109
+ schema: StagehandZodSchema;
106
110
  };
107
111
  tools?: LLMTool[];
108
112
  tool_choice?: "auto" | "none" | "required";
@@ -141,6 +145,21 @@ interface CreateChatCompletionOptions {
141
145
  logger: (message: LogLine) => void;
142
146
  retries?: number;
143
147
  }
148
+ /** Simple usage shape if your LLM returns usage tokens. */
149
+ interface LLMUsage {
150
+ prompt_tokens: number;
151
+ completion_tokens: number;
152
+ total_tokens: number;
153
+ reasoning_tokens?: number;
154
+ cached_input_tokens?: number;
155
+ }
156
+ /**
157
+ * For calls that use a schema: the LLMClient may return { data: T; usage?: LLMUsage }
158
+ */
159
+ interface LLMParsedResponse<T> {
160
+ data: T;
161
+ usage?: LLMUsage;
162
+ }
144
163
  declare abstract class LLMClient {
145
164
  type: "openai" | "anthropic" | "cerebras" | "groq" | (string & {});
146
165
  modelName: AvailableModel | (string & {});
@@ -148,9 +167,15 @@ declare abstract class LLMClient {
148
167
  clientOptions: ClientOptions;
149
168
  userProvidedInstructions?: string;
150
169
  constructor(modelName: AvailableModel, userProvidedInstructions?: string);
151
- abstract createChatCompletion<T = LLMResponse & {
152
- usage?: LLMResponse["usage"];
153
- }>(options: CreateChatCompletionOptions): Promise<T>;
170
+ abstract createChatCompletion<T>(options: CreateChatCompletionOptions & {
171
+ options: {
172
+ response_model: {
173
+ name: string;
174
+ schema: StagehandZodSchema;
175
+ };
176
+ };
177
+ }): Promise<LLMParsedResponse<T>>;
178
+ abstract createChatCompletion<T = LLMResponse>(options: CreateChatCompletionOptions): Promise<T>;
154
179
  generateObject: typeof generateObject;
155
180
  generateText: typeof generateText;
156
181
  streamText: typeof streamText;
@@ -199,11 +224,7 @@ declare class CdpConnection implements CDPSessionLike {
199
224
  close(): Promise<void>;
200
225
  getSession(sessionId: string): CdpSession | undefined;
201
226
  attachToTarget(targetId: string): Promise<CdpSession>;
202
- getTargets(): Promise<Array<{
203
- targetId: string;
204
- type: string;
205
- url: string;
206
- }>>;
227
+ getTargets(): Promise<Protocol.Target.TargetInfo[]>;
207
228
  private onMessage;
208
229
  _sendViaSession<R = unknown>(sessionId: string, method: string, params?: object): Promise<R>;
209
230
  _onSessionEvent(sessionId: string, event: string, handler: EventHandler): void;
@@ -238,9 +259,12 @@ declare class Frame implements FrameManager {
238
259
  session: CDPSessionLike;
239
260
  frameId: string;
240
261
  pageId: string;
262
+ private readonly remoteBrowser;
241
263
  /** Owning CDP session id (useful for logs); null for root connection (should not happen for targets) */
242
264
  readonly sessionId: string | null;
243
- constructor(session: CDPSessionLike, frameId: string, pageId: string);
265
+ constructor(session: CDPSessionLike, frameId: string, pageId: string, remoteBrowser: boolean);
266
+ /** True when the controlled browser runs on a different machine. */
267
+ isBrowserRemote(): boolean;
244
268
  /** DOM.getNodeForLocation → DOM.describeNode */
245
269
  getNodeAtLocation(x: number, y: number): Promise<Protocol.DOM.Node>;
246
270
  /** CSS selector → DOM.querySelector → DOM.getBoxModel */
@@ -284,6 +308,14 @@ declare class Frame implements FrameManager {
284
308
  private getExecutionContextId;
285
309
  }
286
310
 
311
+ interface SetInputFilePayload {
312
+ name: string;
313
+ mimeType?: string;
314
+ buffer: ArrayBuffer | Uint8Array | Buffer$1 | string;
315
+ lastModified?: number;
316
+ }
317
+ type SetInputFilesArgument = string | string[] | SetInputFilePayload | SetInputFilePayload[];
318
+
287
319
  type MouseButton = "left" | "right" | "middle";
288
320
  /**
289
321
  * Locator
@@ -326,15 +358,16 @@ declare class Locator {
326
358
  * - Best‑effort dispatches change/input via CDP (Chrome does by default).
327
359
  * - Passing an empty array clears the selection.
328
360
  */
329
- setInputFiles(files: string | string[] | {
330
- name: string;
331
- mimeType: string;
332
- buffer: ArrayBuffer | Uint8Array | Buffer$1 | string;
333
- } | Array<{
334
- name: string;
335
- mimeType: string;
336
- buffer: ArrayBuffer | Uint8Array | Buffer$1 | string;
337
- }>): Promise<void>;
361
+ setInputFiles(files: SetInputFilesArgument): Promise<void>;
362
+ /**
363
+ * Remote browser fallback: build File objects inside the page and attach them via JS.
364
+ *
365
+ * When Stagehand is driving a browser that cannot see the local filesystem (Browserbase,
366
+ * remote CDP, etc.), CDP's DOM.setFileInputFiles would fail because Chrome can't reach
367
+ * our temp files. Instead we base64-encode the payloads, send them into the page, and
368
+ * let a DOM helper create File objects + dispatch change/input events.
369
+ */
370
+ private assignFilesViaPayloadInjection;
338
371
  /**
339
372
  * Return the DOM backendNodeId for this locator's target element.
340
373
  * Useful for identity comparisons without needing element handles.
@@ -723,6 +756,14 @@ declare class Response$1 {
723
756
  * richer metadata.
724
757
  */
725
758
  applyExtraInfo(event: Protocol.Network.ResponseReceivedExtraInfoEvent): void;
759
+ /**
760
+ * Internal helper for creating a Response object from a Serializable
761
+ * goto response from the Stagehand API
762
+ */
763
+ static fromSerializable(serialized: SerializableResponse, context: {
764
+ page: Page;
765
+ session: CDPSessionLike;
766
+ }): Response$1;
726
767
  /** Marks the response as finished and resolves the `finished()` promise. */
727
768
  markFinished(error: Error | null): void;
728
769
  }
@@ -741,11 +782,11 @@ declare class StagehandAPIClient {
741
782
  constructor({ apiKey, projectId, logger }: StagehandAPIConstructorParams);
742
783
  init({ modelName, modelApiKey, domSettleTimeoutMs, verbose, systemPrompt, selfHeal, browserbaseSessionCreateParams, browserbaseSessionID, }: StartSessionParams): Promise<StartSessionResult>;
743
784
  act({ input, options, frameId }: APIActParameters): Promise<ActResult>;
744
- extract<T extends z.AnyZodObject>({ instruction, schema: zodSchema, options, frameId, }: APIExtractParameters): Promise<ExtractResult<T>>;
785
+ extract<T extends StagehandZodSchema>({ instruction, schema: zodSchema, options, frameId, }: APIExtractParameters): Promise<ExtractResult<T>>;
745
786
  observe({ instruction, options, frameId, }: APIObserveParameters): Promise<Action[]>;
746
787
  goto(url: string, options?: {
747
788
  waitUntil?: "load" | "domcontentloaded" | "networkidle";
748
- }, frameId?: string): Promise<void>;
789
+ }, frameId?: string): Promise<SerializableResponse | null>;
749
790
  agentExecute(agentConfig: AgentConfig, executeOptions: AgentExecuteOptions | string, frameId?: string): Promise<AgentResult>;
750
791
  end(): Promise<Response>;
751
792
  getReplayMetrics(): Promise<StagehandMetrics>;
@@ -793,6 +834,7 @@ declare class Page {
793
834
  private nextOrdinal;
794
835
  /** cache Frames per frameId so everyone uses the same one */
795
836
  private readonly frameCache;
837
+ private readonly browserIsRemote;
796
838
  /** Stable id for Frames created by this Page (use top-level TargetId). */
797
839
  private readonly pageId;
798
840
  /** Cached current URL for synchronous page.url() */
@@ -813,7 +855,7 @@ declare class Page {
813
855
  * Factory: create Page and seed registry with the shallow tree from Page.getFrameTree.
814
856
  * Assumes Page domain is already enabled on the session passed in.
815
857
  */
816
- static create(conn: CdpConnection, session: CDPSessionLike, targetId: string, apiClient?: StagehandAPIClient | null, localBrowserLaunchOptions?: LocalBrowserLaunchOptions | null): Promise<Page>;
858
+ static create(conn: CdpConnection, session: CDPSessionLike, targetId: string, apiClient?: StagehandAPIClient | null, localBrowserLaunchOptions?: LocalBrowserLaunchOptions | null, browserIsRemote?: boolean): Promise<Page>;
817
859
  /**
818
860
  * Parent/child session emitted a `frameAttached`.
819
861
  * Topology update + ownership stamped to **emitting session**.
@@ -1128,6 +1170,8 @@ interface AgentResult {
1128
1170
  usage?: {
1129
1171
  input_tokens: number;
1130
1172
  output_tokens: number;
1173
+ reasoning_tokens?: number;
1174
+ cached_input_tokens?: number;
1131
1175
  inference_time_ms: number;
1132
1176
  };
1133
1177
  }
@@ -1293,7 +1337,7 @@ interface ActResult {
1293
1337
  actionDescription: string;
1294
1338
  actions: Action[];
1295
1339
  }
1296
- type ExtractResult<T extends z$1.AnyZodObject> = z$1.infer<T>;
1340
+ type ExtractResult<T extends StagehandZodSchema> = InferStagehandSchema<T>;
1297
1341
  interface Action {
1298
1342
  selector: string;
1299
1343
  description: string;
@@ -1312,20 +1356,12 @@ interface ExtractOptions {
1312
1356
  selector?: string;
1313
1357
  page?: Page$1 | Page$2 | Page$3 | Page;
1314
1358
  }
1315
- declare const defaultExtractSchema: z$1.ZodObject<{
1316
- extraction: z$1.ZodString;
1317
- }, "strip", z$1.ZodTypeAny, {
1318
- extraction?: string;
1319
- }, {
1320
- extraction?: string;
1321
- }>;
1322
- declare const pageTextSchema: z$1.ZodObject<{
1323
- pageText: z$1.ZodString;
1324
- }, "strip", z$1.ZodTypeAny, {
1325
- pageText?: string;
1326
- }, {
1327
- pageText?: string;
1328
- }>;
1359
+ declare const defaultExtractSchema: z.ZodObject<{
1360
+ extraction: z.ZodString;
1361
+ }, z.core.$strip>;
1362
+ declare const pageTextSchema: z.ZodObject<{
1363
+ pageText: z.ZodString;
1364
+ }, z.core.$strip>;
1329
1365
  interface ObserveOptions {
1330
1366
  model?: ModelConfiguration;
1331
1367
  timeout?: number;
@@ -1342,18 +1378,28 @@ declare enum V3FunctionName {
1342
1378
  interface StagehandMetrics {
1343
1379
  actPromptTokens: number;
1344
1380
  actCompletionTokens: number;
1381
+ actReasoningTokens: number;
1382
+ actCachedInputTokens: number;
1345
1383
  actInferenceTimeMs: number;
1346
1384
  extractPromptTokens: number;
1347
1385
  extractCompletionTokens: number;
1386
+ extractReasoningTokens: number;
1387
+ extractCachedInputTokens: number;
1348
1388
  extractInferenceTimeMs: number;
1349
1389
  observePromptTokens: number;
1350
1390
  observeCompletionTokens: number;
1391
+ observeReasoningTokens: number;
1392
+ observeCachedInputTokens: number;
1351
1393
  observeInferenceTimeMs: number;
1352
1394
  agentPromptTokens: number;
1353
1395
  agentCompletionTokens: number;
1396
+ agentReasoningTokens: number;
1397
+ agentCachedInputTokens: number;
1354
1398
  agentInferenceTimeMs: number;
1355
1399
  totalPromptTokens: number;
1356
1400
  totalCompletionTokens: number;
1401
+ totalReasoningTokens: number;
1402
+ totalCachedInputTokens: number;
1357
1403
  totalInferenceTimeMs: number;
1358
1404
  }
1359
1405
 
@@ -1500,6 +1546,9 @@ declare class ExperimentalApiConflictError extends StagehandError {
1500
1546
  declare class ExperimentalNotConfiguredError extends StagehandError {
1501
1547
  constructor(featureName: string);
1502
1548
  }
1549
+ declare class CuaModelRequiredError extends StagehandError {
1550
+ constructor(availableModels: readonly string[]);
1551
+ }
1503
1552
  declare class ZodSchemaValidationError extends Error {
1504
1553
  readonly received: unknown;
1505
1554
  readonly issues: ReturnType<ZodError["format"]>;
@@ -1522,6 +1571,24 @@ declare class StagehandShadowSegmentEmptyError extends StagehandError {
1522
1571
  declare class StagehandShadowSegmentNotFoundError extends StagehandError {
1523
1572
  constructor(segment: string, hint?: string);
1524
1573
  }
1574
+ declare class ElementNotVisibleError extends StagehandError {
1575
+ constructor(selector: string);
1576
+ }
1577
+ declare class ResponseBodyError extends StagehandError {
1578
+ constructor(message: string);
1579
+ }
1580
+ declare class ResponseParseError extends StagehandError {
1581
+ constructor(message: string);
1582
+ }
1583
+ declare class TimeoutError extends StagehandError {
1584
+ constructor(operation: string, timeoutMs: number);
1585
+ }
1586
+ declare class PageNotFoundError extends StagehandError {
1587
+ constructor(identifier: string);
1588
+ }
1589
+ declare class ConnectionTimeoutError extends StagehandError {
1590
+ constructor(message: string);
1591
+ }
1525
1592
 
1526
1593
  declare class AISdkClient extends LLMClient {
1527
1594
  type: "aisdk";
@@ -1560,7 +1627,7 @@ interface APIActParameters {
1560
1627
  }
1561
1628
  interface APIExtractParameters {
1562
1629
  instruction?: string;
1563
- schema?: ZodTypeAny;
1630
+ schema?: StagehandZodSchema;
1564
1631
  options?: ExtractOptions;
1565
1632
  frameId?: string;
1566
1633
  }
@@ -1569,6 +1636,16 @@ interface APIObserveParameters {
1569
1636
  options?: ObserveOptions;
1570
1637
  frameId?: string;
1571
1638
  }
1639
+ interface SerializableResponse {
1640
+ requestId: string;
1641
+ frameId?: string;
1642
+ loaderId?: string;
1643
+ response: Protocol.Network.Response;
1644
+ fromServiceWorkerFlag?: boolean;
1645
+ finishedSettled?: boolean;
1646
+ extraInfoHeaders?: Protocol.Network.Headers | null;
1647
+ extraInfoHeadersText?: string;
1648
+ }
1572
1649
 
1573
1650
  /**
1574
1651
  * Represents a path through a Zod schema from the root object down to a
@@ -1672,6 +1749,7 @@ declare class V3Context {
1672
1749
  * We poll internal maps that bootstrap/onAttachedToTarget populate.
1673
1750
  */
1674
1751
  private waitForFirstTopLevelPage;
1752
+ private waitForInitialTopLevelTargets;
1675
1753
  private ensurePiercer;
1676
1754
  /** Mark a page target as the most-recent one (active). */
1677
1755
  private _pushActive;
@@ -1862,7 +1940,7 @@ declare class V3 {
1862
1940
  */
1863
1941
  get history(): Promise<ReadonlyArray<HistoryEntry>>;
1864
1942
  addToHistory(method: HistoryEntry["method"], parameters: unknown, result?: unknown): void;
1865
- updateMetrics(functionName: V3FunctionName, promptTokens: number, completionTokens: number, inferenceTimeMs: number): void;
1943
+ updateMetrics(functionName: V3FunctionName, promptTokens: number, completionTokens: number, reasoningTokens: number, cachedInputTokens: number, inferenceTimeMs: number): void;
1866
1944
  private updateTotalMetrics;
1867
1945
  private _immediateShutdown;
1868
1946
  private static _installProcessGuards;
@@ -1893,10 +1971,10 @@ declare class V3 {
1893
1971
  * - extract(instruction, schema) → schema-inferred
1894
1972
  * - extract(instruction, schema, options)
1895
1973
  */
1896
- extract(): Promise<z$1.infer<typeof pageTextSchema>>;
1897
- extract(options: ExtractOptions): Promise<z$1.infer<typeof pageTextSchema>>;
1898
- extract(instruction: string, options?: ExtractOptions): Promise<z$1.infer<typeof defaultExtractSchema>>;
1899
- extract<T extends ZodTypeAny>(instruction: string, schema: T, options?: ExtractOptions): Promise<z$1.infer<T>>;
1974
+ extract(): Promise<z.infer<typeof pageTextSchema>>;
1975
+ extract(options: ExtractOptions): Promise<z.infer<typeof pageTextSchema>>;
1976
+ extract(instruction: string, options?: ExtractOptions): Promise<z.infer<typeof defaultExtractSchema>>;
1977
+ extract<T extends StagehandZodSchema>(instruction: string, schema: T, options?: ExtractOptions): Promise<InferStagehandSchema<T>>;
1900
1978
  /**
1901
1979
  * Run an "observe" instruction through the ObserveHandler.
1902
1980
  */
@@ -1968,14 +2046,14 @@ declare class AgentProvider {
1968
2046
  static getAgentProvider(modelName: string): AgentProviderType;
1969
2047
  }
1970
2048
 
1971
- declare function validateZodSchema(schema: z$1.ZodTypeAny, data: unknown): boolean;
2049
+ declare function validateZodSchema(schema: StagehandZodSchema, data: unknown): boolean;
1972
2050
  /**
1973
2051
  * Detects if the code is running in the Bun runtime environment.
1974
2052
  * @returns {boolean} True if running in Bun, false otherwise.
1975
2053
  */
1976
2054
  declare function isRunningInBun(): boolean;
1977
- declare function toGeminiSchema(zodSchema: z$1.ZodTypeAny): Schema;
1978
- declare function getZodType(schema: z$1.ZodTypeAny): string;
2055
+ declare function toGeminiSchema(zodSchema: StagehandZodSchema): Schema;
2056
+ declare function getZodType(schema: StagehandZodSchema): string;
1979
2057
  /**
1980
2058
  * Recursively traverses a given Zod schema, scanning for any fields of type `z.string().url()`.
1981
2059
  * For each such field, it replaces the `z.string().url()` with `z.number()`.
@@ -1989,7 +2067,7 @@ declare function getZodType(schema: z$1.ZodTypeAny): string;
1989
2067
  * 1. The updated Zod schema, with any `.url()` fields replaced by `z.number()`.
1990
2068
  * 2. An array of {@link ZodPathSegments} objects representing each replaced field, including the path segments.
1991
2069
  */
1992
- declare function transformSchema(schema: z$1.ZodTypeAny, currentPath: Array<string | number>): [z$1.ZodTypeAny, ZodPathSegments[]];
2070
+ declare function transformSchema(schema: StagehandZodSchema, currentPath: Array<string | number>): [StagehandZodSchema, ZodPathSegments[]];
1993
2071
  /**
1994
2072
  * Once we get the final extracted object that has numeric IDs in place of URLs,
1995
2073
  * use `injectUrls` to walk the object and replace numeric IDs
@@ -2058,4 +2136,4 @@ declare class V3Evaluator {
2058
2136
  private _evaluateWithMultipleScreenshots;
2059
2137
  }
2060
2138
 
2061
- 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 };
2139
+ 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 LLMParsedResponse, type LLMResponse, LLMResponseError, type LLMTool, type LLMUsage, 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 };