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

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 +135 -49
  2. package/dist/index.js +1551 -792
  3. package/package.json +5 -4
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import z, { ZodType, z as z$1, ZodError, ZodTypeAny } from 'zod/v3';
1
+ import { ZodTypeAny, z, ZodObject, ZodRawShape, ZodError } from 'zod';
2
+ import * as z3 from 'zod/v3';
3
+ import { zodToJsonSchema } from 'zod-to-json-schema';
2
4
  import { ClientOptions as ClientOptions$2 } from '@anthropic-ai/sdk';
3
5
  import { LanguageModelV2 } from '@ai-sdk/provider';
4
6
  import { ClientOptions as ClientOptions$1 } from 'openai';
@@ -17,6 +19,16 @@ import { ChatCompletion } from 'openai/resources';
17
19
  import { ToolSet as ToolSet$1 } from 'ai/dist';
18
20
  import { Schema } from '@google/genai';
19
21
 
22
+ type StagehandZodSchema = ZodTypeAny | z3.ZodTypeAny;
23
+ type StagehandZodObject = ZodObject<ZodRawShape> | z3.ZodObject<z3.ZodRawShape>;
24
+ type InferStagehandSchema<T extends StagehandZodSchema> = T extends z3.ZodTypeAny ? z3.infer<T> : T extends ZodTypeAny ? z.infer<T> : never;
25
+ declare const isZod4Schema: (schema: StagehandZodSchema) => schema is ZodTypeAny & {
26
+ _zod: unknown;
27
+ };
28
+ declare const isZod3Schema: (schema: StagehandZodSchema) => schema is z3.ZodTypeAny;
29
+ type JsonSchemaDocument = Record<string, unknown>;
30
+ declare function toJsonSchema(schema: StagehandZodSchema, options?: Parameters<typeof zodToJsonSchema>[1]): JsonSchemaDocument;
31
+
20
32
  type AnthropicJsonSchemaObject = {
21
33
  definitions?: {
22
34
  MySchema?: {
@@ -102,7 +114,7 @@ interface ChatCompletionOptions {
102
114
  };
103
115
  response_model?: {
104
116
  name: string;
105
- schema: ZodType;
117
+ schema: StagehandZodSchema;
106
118
  };
107
119
  tools?: LLMTool[];
108
120
  tool_choice?: "auto" | "none" | "required";
@@ -141,6 +153,21 @@ interface CreateChatCompletionOptions {
141
153
  logger: (message: LogLine) => void;
142
154
  retries?: number;
143
155
  }
156
+ /** Simple usage shape if your LLM returns usage tokens. */
157
+ interface LLMUsage {
158
+ prompt_tokens: number;
159
+ completion_tokens: number;
160
+ total_tokens: number;
161
+ reasoning_tokens?: number;
162
+ cached_input_tokens?: number;
163
+ }
164
+ /**
165
+ * For calls that use a schema: the LLMClient may return { data: T; usage?: LLMUsage }
166
+ */
167
+ interface LLMParsedResponse<T> {
168
+ data: T;
169
+ usage?: LLMUsage;
170
+ }
144
171
  declare abstract class LLMClient {
145
172
  type: "openai" | "anthropic" | "cerebras" | "groq" | (string & {});
146
173
  modelName: AvailableModel | (string & {});
@@ -148,9 +175,15 @@ declare abstract class LLMClient {
148
175
  clientOptions: ClientOptions;
149
176
  userProvidedInstructions?: string;
150
177
  constructor(modelName: AvailableModel, userProvidedInstructions?: string);
151
- abstract createChatCompletion<T = LLMResponse & {
152
- usage?: LLMResponse["usage"];
153
- }>(options: CreateChatCompletionOptions): Promise<T>;
178
+ abstract createChatCompletion<T>(options: CreateChatCompletionOptions & {
179
+ options: {
180
+ response_model: {
181
+ name: string;
182
+ schema: StagehandZodSchema;
183
+ };
184
+ };
185
+ }): Promise<LLMParsedResponse<T>>;
186
+ abstract createChatCompletion<T = LLMResponse>(options: CreateChatCompletionOptions): Promise<T>;
154
187
  generateObject: typeof generateObject;
155
188
  generateText: typeof generateText;
156
189
  streamText: typeof streamText;
@@ -199,11 +232,7 @@ declare class CdpConnection implements CDPSessionLike {
199
232
  close(): Promise<void>;
200
233
  getSession(sessionId: string): CdpSession | undefined;
201
234
  attachToTarget(targetId: string): Promise<CdpSession>;
202
- getTargets(): Promise<Array<{
203
- targetId: string;
204
- type: string;
205
- url: string;
206
- }>>;
235
+ getTargets(): Promise<Protocol.Target.TargetInfo[]>;
207
236
  private onMessage;
208
237
  _sendViaSession<R = unknown>(sessionId: string, method: string, params?: object): Promise<R>;
209
238
  _onSessionEvent(sessionId: string, event: string, handler: EventHandler): void;
@@ -238,9 +267,12 @@ declare class Frame implements FrameManager {
238
267
  session: CDPSessionLike;
239
268
  frameId: string;
240
269
  pageId: string;
270
+ private readonly remoteBrowser;
241
271
  /** Owning CDP session id (useful for logs); null for root connection (should not happen for targets) */
242
272
  readonly sessionId: string | null;
243
- constructor(session: CDPSessionLike, frameId: string, pageId: string);
273
+ constructor(session: CDPSessionLike, frameId: string, pageId: string, remoteBrowser: boolean);
274
+ /** True when the controlled browser runs on a different machine. */
275
+ isBrowserRemote(): boolean;
244
276
  /** DOM.getNodeForLocation → DOM.describeNode */
245
277
  getNodeAtLocation(x: number, y: number): Promise<Protocol.DOM.Node>;
246
278
  /** CSS selector → DOM.querySelector → DOM.getBoxModel */
@@ -284,6 +316,14 @@ declare class Frame implements FrameManager {
284
316
  private getExecutionContextId;
285
317
  }
286
318
 
319
+ interface SetInputFilePayload {
320
+ name: string;
321
+ mimeType?: string;
322
+ buffer: ArrayBuffer | Uint8Array | Buffer$1 | string;
323
+ lastModified?: number;
324
+ }
325
+ type SetInputFilesArgument = string | string[] | SetInputFilePayload | SetInputFilePayload[];
326
+
287
327
  type MouseButton = "left" | "right" | "middle";
288
328
  /**
289
329
  * Locator
@@ -326,15 +366,16 @@ declare class Locator {
326
366
  * - Best‑effort dispatches change/input via CDP (Chrome does by default).
327
367
  * - Passing an empty array clears the selection.
328
368
  */
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>;
369
+ setInputFiles(files: SetInputFilesArgument): Promise<void>;
370
+ /**
371
+ * Remote browser fallback: build File objects inside the page and attach them via JS.
372
+ *
373
+ * When Stagehand is driving a browser that cannot see the local filesystem (Browserbase,
374
+ * remote CDP, etc.), CDP's DOM.setFileInputFiles would fail because Chrome can't reach
375
+ * our temp files. Instead we base64-encode the payloads, send them into the page, and
376
+ * let a DOM helper create File objects + dispatch change/input events.
377
+ */
378
+ private assignFilesViaPayloadInjection;
338
379
  /**
339
380
  * Return the DOM backendNodeId for this locator's target element.
340
381
  * Useful for identity comparisons without needing element handles.
@@ -723,6 +764,14 @@ declare class Response$1 {
723
764
  * richer metadata.
724
765
  */
725
766
  applyExtraInfo(event: Protocol.Network.ResponseReceivedExtraInfoEvent): void;
767
+ /**
768
+ * Internal helper for creating a Response object from a Serializable
769
+ * goto response from the Stagehand API
770
+ */
771
+ static fromSerializable(serialized: SerializableResponse, context: {
772
+ page: Page;
773
+ session: CDPSessionLike;
774
+ }): Response$1;
726
775
  /** Marks the response as finished and resolves the `finished()` promise. */
727
776
  markFinished(error: Error | null): void;
728
777
  }
@@ -741,11 +790,11 @@ declare class StagehandAPIClient {
741
790
  constructor({ apiKey, projectId, logger }: StagehandAPIConstructorParams);
742
791
  init({ modelName, modelApiKey, domSettleTimeoutMs, verbose, systemPrompt, selfHeal, browserbaseSessionCreateParams, browserbaseSessionID, }: StartSessionParams): Promise<StartSessionResult>;
743
792
  act({ input, options, frameId }: APIActParameters): Promise<ActResult>;
744
- extract<T extends z.AnyZodObject>({ instruction, schema: zodSchema, options, frameId, }: APIExtractParameters): Promise<ExtractResult<T>>;
793
+ extract<T extends StagehandZodSchema>({ instruction, schema: zodSchema, options, frameId, }: APIExtractParameters): Promise<ExtractResult<T>>;
745
794
  observe({ instruction, options, frameId, }: APIObserveParameters): Promise<Action[]>;
746
795
  goto(url: string, options?: {
747
796
  waitUntil?: "load" | "domcontentloaded" | "networkidle";
748
- }, frameId?: string): Promise<void>;
797
+ }, frameId?: string): Promise<SerializableResponse | null>;
749
798
  agentExecute(agentConfig: AgentConfig, executeOptions: AgentExecuteOptions | string, frameId?: string): Promise<AgentResult>;
750
799
  end(): Promise<Response>;
751
800
  getReplayMetrics(): Promise<StagehandMetrics>;
@@ -793,6 +842,7 @@ declare class Page {
793
842
  private nextOrdinal;
794
843
  /** cache Frames per frameId so everyone uses the same one */
795
844
  private readonly frameCache;
845
+ private readonly browserIsRemote;
796
846
  /** Stable id for Frames created by this Page (use top-level TargetId). */
797
847
  private readonly pageId;
798
848
  /** Cached current URL for synchronous page.url() */
@@ -813,7 +863,7 @@ declare class Page {
813
863
  * Factory: create Page and seed registry with the shallow tree from Page.getFrameTree.
814
864
  * Assumes Page domain is already enabled on the session passed in.
815
865
  */
816
- static create(conn: CdpConnection, session: CDPSessionLike, targetId: string, apiClient?: StagehandAPIClient | null, localBrowserLaunchOptions?: LocalBrowserLaunchOptions | null): Promise<Page>;
866
+ static create(conn: CdpConnection, session: CDPSessionLike, targetId: string, apiClient?: StagehandAPIClient | null, localBrowserLaunchOptions?: LocalBrowserLaunchOptions | null, browserIsRemote?: boolean): Promise<Page>;
817
867
  /**
818
868
  * Parent/child session emitted a `frameAttached`.
819
869
  * Topology update + ownership stamped to **emitting session**.
@@ -1128,6 +1178,8 @@ interface AgentResult {
1128
1178
  usage?: {
1129
1179
  input_tokens: number;
1130
1180
  output_tokens: number;
1181
+ reasoning_tokens?: number;
1182
+ cached_input_tokens?: number;
1131
1183
  inference_time_ms: number;
1132
1184
  };
1133
1185
  }
@@ -1293,7 +1345,7 @@ interface ActResult {
1293
1345
  actionDescription: string;
1294
1346
  actions: Action[];
1295
1347
  }
1296
- type ExtractResult<T extends z$1.AnyZodObject> = z$1.infer<T>;
1348
+ type ExtractResult<T extends StagehandZodSchema> = InferStagehandSchema<T>;
1297
1349
  interface Action {
1298
1350
  selector: string;
1299
1351
  description: string;
@@ -1312,20 +1364,12 @@ interface ExtractOptions {
1312
1364
  selector?: string;
1313
1365
  page?: Page$1 | Page$2 | Page$3 | Page;
1314
1366
  }
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
- }>;
1367
+ declare const defaultExtractSchema: z.ZodObject<{
1368
+ extraction: z.ZodString;
1369
+ }, z.core.$strip>;
1370
+ declare const pageTextSchema: z.ZodObject<{
1371
+ pageText: z.ZodString;
1372
+ }, z.core.$strip>;
1329
1373
  interface ObserveOptions {
1330
1374
  model?: ModelConfiguration;
1331
1375
  timeout?: number;
@@ -1342,18 +1386,28 @@ declare enum V3FunctionName {
1342
1386
  interface StagehandMetrics {
1343
1387
  actPromptTokens: number;
1344
1388
  actCompletionTokens: number;
1389
+ actReasoningTokens: number;
1390
+ actCachedInputTokens: number;
1345
1391
  actInferenceTimeMs: number;
1346
1392
  extractPromptTokens: number;
1347
1393
  extractCompletionTokens: number;
1394
+ extractReasoningTokens: number;
1395
+ extractCachedInputTokens: number;
1348
1396
  extractInferenceTimeMs: number;
1349
1397
  observePromptTokens: number;
1350
1398
  observeCompletionTokens: number;
1399
+ observeReasoningTokens: number;
1400
+ observeCachedInputTokens: number;
1351
1401
  observeInferenceTimeMs: number;
1352
1402
  agentPromptTokens: number;
1353
1403
  agentCompletionTokens: number;
1404
+ agentReasoningTokens: number;
1405
+ agentCachedInputTokens: number;
1354
1406
  agentInferenceTimeMs: number;
1355
1407
  totalPromptTokens: number;
1356
1408
  totalCompletionTokens: number;
1409
+ totalReasoningTokens: number;
1410
+ totalCachedInputTokens: number;
1357
1411
  totalInferenceTimeMs: number;
1358
1412
  }
1359
1413
 
@@ -1500,6 +1554,9 @@ declare class ExperimentalApiConflictError extends StagehandError {
1500
1554
  declare class ExperimentalNotConfiguredError extends StagehandError {
1501
1555
  constructor(featureName: string);
1502
1556
  }
1557
+ declare class CuaModelRequiredError extends StagehandError {
1558
+ constructor(availableModels: readonly string[]);
1559
+ }
1503
1560
  declare class ZodSchemaValidationError extends Error {
1504
1561
  readonly received: unknown;
1505
1562
  readonly issues: ReturnType<ZodError["format"]>;
@@ -1522,6 +1579,24 @@ declare class StagehandShadowSegmentEmptyError extends StagehandError {
1522
1579
  declare class StagehandShadowSegmentNotFoundError extends StagehandError {
1523
1580
  constructor(segment: string, hint?: string);
1524
1581
  }
1582
+ declare class ElementNotVisibleError extends StagehandError {
1583
+ constructor(selector: string);
1584
+ }
1585
+ declare class ResponseBodyError extends StagehandError {
1586
+ constructor(message: string);
1587
+ }
1588
+ declare class ResponseParseError extends StagehandError {
1589
+ constructor(message: string);
1590
+ }
1591
+ declare class TimeoutError extends StagehandError {
1592
+ constructor(operation: string, timeoutMs: number);
1593
+ }
1594
+ declare class PageNotFoundError extends StagehandError {
1595
+ constructor(identifier: string);
1596
+ }
1597
+ declare class ConnectionTimeoutError extends StagehandError {
1598
+ constructor(message: string);
1599
+ }
1525
1600
 
1526
1601
  declare class AISdkClient extends LLMClient {
1527
1602
  type: "aisdk";
@@ -1560,7 +1635,7 @@ interface APIActParameters {
1560
1635
  }
1561
1636
  interface APIExtractParameters {
1562
1637
  instruction?: string;
1563
- schema?: ZodTypeAny;
1638
+ schema?: StagehandZodSchema;
1564
1639
  options?: ExtractOptions;
1565
1640
  frameId?: string;
1566
1641
  }
@@ -1569,6 +1644,16 @@ interface APIObserveParameters {
1569
1644
  options?: ObserveOptions;
1570
1645
  frameId?: string;
1571
1646
  }
1647
+ interface SerializableResponse {
1648
+ requestId: string;
1649
+ frameId?: string;
1650
+ loaderId?: string;
1651
+ response: Protocol.Network.Response;
1652
+ fromServiceWorkerFlag?: boolean;
1653
+ finishedSettled?: boolean;
1654
+ extraInfoHeaders?: Protocol.Network.Headers | null;
1655
+ extraInfoHeadersText?: string;
1656
+ }
1572
1657
 
1573
1658
  /**
1574
1659
  * Represents a path through a Zod schema from the root object down to a
@@ -1672,6 +1757,7 @@ declare class V3Context {
1672
1757
  * We poll internal maps that bootstrap/onAttachedToTarget populate.
1673
1758
  */
1674
1759
  private waitForFirstTopLevelPage;
1760
+ private waitForInitialTopLevelTargets;
1675
1761
  private ensurePiercer;
1676
1762
  /** Mark a page target as the most-recent one (active). */
1677
1763
  private _pushActive;
@@ -1862,7 +1948,7 @@ declare class V3 {
1862
1948
  */
1863
1949
  get history(): Promise<ReadonlyArray<HistoryEntry>>;
1864
1950
  addToHistory(method: HistoryEntry["method"], parameters: unknown, result?: unknown): void;
1865
- updateMetrics(functionName: V3FunctionName, promptTokens: number, completionTokens: number, inferenceTimeMs: number): void;
1951
+ updateMetrics(functionName: V3FunctionName, promptTokens: number, completionTokens: number, reasoningTokens: number, cachedInputTokens: number, inferenceTimeMs: number): void;
1866
1952
  private updateTotalMetrics;
1867
1953
  private _immediateShutdown;
1868
1954
  private static _installProcessGuards;
@@ -1893,10 +1979,10 @@ declare class V3 {
1893
1979
  * - extract(instruction, schema) → schema-inferred
1894
1980
  * - extract(instruction, schema, options)
1895
1981
  */
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>>;
1982
+ extract(): Promise<z.infer<typeof pageTextSchema>>;
1983
+ extract(options: ExtractOptions): Promise<z.infer<typeof pageTextSchema>>;
1984
+ extract(instruction: string, options?: ExtractOptions): Promise<z.infer<typeof defaultExtractSchema>>;
1985
+ extract<T extends StagehandZodSchema>(instruction: string, schema: T, options?: ExtractOptions): Promise<InferStagehandSchema<T>>;
1900
1986
  /**
1901
1987
  * Run an "observe" instruction through the ObserveHandler.
1902
1988
  */
@@ -1968,14 +2054,14 @@ declare class AgentProvider {
1968
2054
  static getAgentProvider(modelName: string): AgentProviderType;
1969
2055
  }
1970
2056
 
1971
- declare function validateZodSchema(schema: z$1.ZodTypeAny, data: unknown): boolean;
2057
+ declare function validateZodSchema(schema: StagehandZodSchema, data: unknown): boolean;
1972
2058
  /**
1973
2059
  * Detects if the code is running in the Bun runtime environment.
1974
2060
  * @returns {boolean} True if running in Bun, false otherwise.
1975
2061
  */
1976
2062
  declare function isRunningInBun(): boolean;
1977
- declare function toGeminiSchema(zodSchema: z$1.ZodTypeAny): Schema;
1978
- declare function getZodType(schema: z$1.ZodTypeAny): string;
2063
+ declare function toGeminiSchema(zodSchema: StagehandZodSchema): Schema;
2064
+ declare function getZodType(schema: StagehandZodSchema): string;
1979
2065
  /**
1980
2066
  * Recursively traverses a given Zod schema, scanning for any fields of type `z.string().url()`.
1981
2067
  * For each such field, it replaces the `z.string().url()` with `z.number()`.
@@ -1989,7 +2075,7 @@ declare function getZodType(schema: z$1.ZodTypeAny): string;
1989
2075
  * 1. The updated Zod schema, with any `.url()` fields replaced by `z.number()`.
1990
2076
  * 2. An array of {@link ZodPathSegments} objects representing each replaced field, including the path segments.
1991
2077
  */
1992
- declare function transformSchema(schema: z$1.ZodTypeAny, currentPath: Array<string | number>): [z$1.ZodTypeAny, ZodPathSegments[]];
2078
+ declare function transformSchema(schema: StagehandZodSchema, currentPath: Array<string | number>): [StagehandZodSchema, ZodPathSegments[]];
1993
2079
  /**
1994
2080
  * Once we get the final extracted object that has numeric IDs in place of URLs,
1995
2081
  * use `injectUrls` to walk the object and replace numeric IDs
@@ -2058,4 +2144,4 @@ declare class V3Evaluator {
2058
2144
  private _evaluateWithMultipleScreenshots;
2059
2145
  }
2060
2146
 
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 };
2147
+ 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, type InferStagehandSchema, InvalidAISDKModelFormatError, type JsonSchema, type JsonSchemaDocument, 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, type StagehandZodObject, type StagehandZodSchema, TimeoutError, type ToolUseItem, UnsupportedAISDKModelProviderError, UnsupportedModelError, UnsupportedModelProviderError, V3, type V3Env, V3Evaluator, V3FunctionName, type V3Options, XPathResolutionError, ZodSchemaValidationError, connectToMCPServer, defaultExtractSchema, getZodType, injectUrls, isRunningInBun, isZod3Schema, isZod4Schema, jsonSchemaToZod, loadApiKeyFromEnv, modelToAgentProviderMap, pageTextSchema, providerEnvVarMap, toGeminiSchema, toJsonSchema, transformSchema, trimTrailingTextNode, validateZodSchema };