@browserbasehq/orca 3.0.8-google-cua-2 → 3.0.8-stable

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 +143 -47
  2. package/dist/index.js +5021 -4399
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as z3 from 'zod/v3';
4
4
  import { ClientOptions as ClientOptions$2 } from '@anthropic-ai/sdk';
5
5
  import { GoogleVertexProviderSettings as GoogleVertexProviderSettings$1 } from '@ai-sdk/google-vertex';
6
6
  import { LanguageModelV2 } from '@ai-sdk/provider';
7
- import { ClientOptions as ClientOptions$1 } from 'openai';
7
+ import OpenAI, { ClientOptions as ClientOptions$1 } from 'openai';
8
8
  import { Client, ClientOptions as ClientOptions$3 } from '@modelcontextprotocol/sdk/client/index.js';
9
9
  import * as ai from 'ai';
10
10
  import { ToolSet, ModelMessage, PrepareStepFunction, GenerateTextOnStepFinishCallback, StreamTextOnStepFinishCallback, StreamTextOnErrorCallback, StreamTextOnChunkCallback, StreamTextOnFinishCallback, StepResult, StreamTextResult, wrapLanguageModel, generateObject, generateText, streamText, streamObject, experimental_generateImage, embed, embedMany, experimental_transcribe, experimental_generateSpeech, InferUITools } from 'ai';
@@ -19,6 +19,7 @@ import { Protocol } from 'devtools-protocol';
19
19
  import { Buffer as Buffer$1 } from 'buffer';
20
20
  import { z as z$1 } from 'zod/v4';
21
21
  import { ChatCompletion } from 'openai/resources';
22
+ import { ChatCompletion as ChatCompletion$1 } from 'openai/resources/chat/completions';
22
23
  import { ToolSet as ToolSet$1 } from 'ai/dist';
23
24
  import { Schema } from '@google/genai';
24
25
 
@@ -607,6 +608,7 @@ interface EvaluationResult {
607
608
  declare const LocalBrowserLaunchOptionsSchema: z$1.ZodObject<{
608
609
  args: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
609
610
  executablePath: z$1.ZodOptional<z$1.ZodString>;
611
+ port: z$1.ZodOptional<z$1.ZodNumber>;
610
612
  userDataDir: z$1.ZodOptional<z$1.ZodString>;
611
613
  preserveUserDataDir: z$1.ZodOptional<z$1.ZodBoolean>;
612
614
  headless: z$1.ZodOptional<z$1.ZodBoolean>;
@@ -632,8 +634,6 @@ declare const LocalBrowserLaunchOptionsSchema: z$1.ZodObject<{
632
634
  downloadsPath: z$1.ZodOptional<z$1.ZodString>;
633
635
  acceptDownloads: z$1.ZodOptional<z$1.ZodBoolean>;
634
636
  }, z$1.core.$strict>;
635
- /** Simple model name string */
636
- declare const ModelNameSchema: z$1.ZodString;
637
637
  /** Detailed model configuration object */
638
638
  declare const ModelConfigObjectSchema: z$1.ZodObject<{
639
639
  provider: z$1.ZodOptional<z$1.ZodEnum<{
@@ -646,8 +646,8 @@ declare const ModelConfigObjectSchema: z$1.ZodObject<{
646
646
  apiKey: z$1.ZodOptional<z$1.ZodString>;
647
647
  baseURL: z$1.ZodOptional<z$1.ZodString>;
648
648
  }, z$1.core.$strip>;
649
- /** Model configuration - string model name or detailed config */
650
- declare const ModelConfigSchema: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
649
+ /** Model configuration */
650
+ declare const ModelConfigSchema: z$1.ZodObject<{
651
651
  provider: z$1.ZodOptional<z$1.ZodEnum<{
652
652
  openai: "openai";
653
653
  anthropic: "anthropic";
@@ -657,7 +657,7 @@ declare const ModelConfigSchema: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodOb
657
657
  modelName: z$1.ZodString;
658
658
  apiKey: z$1.ZodOptional<z$1.ZodString>;
659
659
  baseURL: z$1.ZodOptional<z$1.ZodString>;
660
- }, z$1.core.$strip>]>;
660
+ }, z$1.core.$strip>;
661
661
  /** Action object returned by observe and used by act */
662
662
  declare const ActionSchema: z$1.ZodObject<{
663
663
  selector: z$1.ZodString;
@@ -680,6 +680,7 @@ declare const BrowserConfigSchema: z$1.ZodObject<{
680
680
  launchOptions: z$1.ZodOptional<z$1.ZodObject<{
681
681
  args: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
682
682
  executablePath: z$1.ZodOptional<z$1.ZodString>;
683
+ port: z$1.ZodOptional<z$1.ZodNumber>;
683
684
  userDataDir: z$1.ZodOptional<z$1.ZodString>;
684
685
  preserveUserDataDir: z$1.ZodOptional<z$1.ZodBoolean>;
685
686
  headless: z$1.ZodOptional<z$1.ZodBoolean>;
@@ -712,13 +713,6 @@ declare const SessionHeadersSchema: z$1.ZodObject<{
712
713
  true: "true";
713
714
  false: "false";
714
715
  }>>;
715
- "x-language": z$1.ZodOptional<z$1.ZodEnum<{
716
- typescript: "typescript";
717
- python: "python";
718
- playground: "playground";
719
- }>>;
720
- "x-sdk-version": z$1.ZodOptional<z$1.ZodString>;
721
- "x-sent-at": z$1.ZodOptional<z$1.ZodString>;
722
716
  }, z$1.core.$strip>;
723
717
  /** Standard error response */
724
718
  declare const ErrorResponseSchema: z$1.ZodObject<{
@@ -1024,6 +1018,7 @@ declare const SessionStartRequestSchema: z$1.ZodObject<{
1024
1018
  launchOptions: z$1.ZodOptional<z$1.ZodObject<{
1025
1019
  args: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1026
1020
  executablePath: z$1.ZodOptional<z$1.ZodString>;
1021
+ port: z$1.ZodOptional<z$1.ZodNumber>;
1027
1022
  userDataDir: z$1.ZodOptional<z$1.ZodString>;
1028
1023
  preserveUserDataDir: z$1.ZodOptional<z$1.ZodBoolean>;
1029
1024
  headless: z$1.ZodOptional<z$1.ZodBoolean>;
@@ -1069,17 +1064,15 @@ declare const SessionStartResponseSchema: z$1.ZodObject<{
1069
1064
  available: z$1.ZodBoolean;
1070
1065
  }, z$1.core.$strip>;
1071
1066
  }, z$1.core.$strip>;
1072
- /** Session end request - empty JSON object (required). */
1073
- declare const SessionEndRequestSchema: z$1.ZodObject<{
1074
- _forceBody: z$1.ZodOptional<z$1.ZodUndefined>;
1075
- }, z$1.core.$strict>;
1067
+ /** Session end request - no request body. */
1068
+ declare const SessionEndRequestSchema: z$1.ZodOptional<z$1.ZodObject<{}, z$1.core.$strict>>;
1076
1069
  declare const SessionEndResultSchema: z$1.ZodObject<{}, z$1.core.$strict>;
1077
1070
  /** Session end response - just success flag, no data wrapper */
1078
1071
  declare const SessionEndResponseSchema: z$1.ZodObject<{
1079
1072
  success: z$1.ZodBoolean;
1080
1073
  }, z$1.core.$strict>;
1081
1074
  declare const ActOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
1082
- model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1075
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
1083
1076
  provider: z$1.ZodOptional<z$1.ZodEnum<{
1084
1077
  openai: "openai";
1085
1078
  anthropic: "anthropic";
@@ -1089,7 +1082,7 @@ declare const ActOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
1089
1082
  modelName: z$1.ZodString;
1090
1083
  apiKey: z$1.ZodOptional<z$1.ZodString>;
1091
1084
  baseURL: z$1.ZodOptional<z$1.ZodString>;
1092
- }, z$1.core.$strip>]>>;
1085
+ }, z$1.core.$strip>, z$1.ZodString]>>;
1093
1086
  variables: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
1094
1087
  timeout: z$1.ZodOptional<z$1.ZodNumber>;
1095
1088
  }, z$1.core.$strip>>;
@@ -1102,7 +1095,7 @@ declare const ActRequestSchema: z$1.ZodObject<{
1102
1095
  arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1103
1096
  }, z$1.core.$strip>]>;
1104
1097
  options: z$1.ZodOptional<z$1.ZodObject<{
1105
- model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1098
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
1106
1099
  provider: z$1.ZodOptional<z$1.ZodEnum<{
1107
1100
  openai: "openai";
1108
1101
  anthropic: "anthropic";
@@ -1112,11 +1105,11 @@ declare const ActRequestSchema: z$1.ZodObject<{
1112
1105
  modelName: z$1.ZodString;
1113
1106
  apiKey: z$1.ZodOptional<z$1.ZodString>;
1114
1107
  baseURL: z$1.ZodOptional<z$1.ZodString>;
1115
- }, z$1.core.$strip>]>>;
1108
+ }, z$1.core.$strip>, z$1.ZodString]>>;
1116
1109
  variables: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
1117
1110
  timeout: z$1.ZodOptional<z$1.ZodNumber>;
1118
1111
  }, z$1.core.$strip>>;
1119
- frameId: z$1.ZodOptional<z$1.ZodString>;
1112
+ frameId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
1120
1113
  streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
1121
1114
  }, z$1.core.$strip>;
1122
1115
  /** Inner act result data */
@@ -1166,7 +1159,7 @@ declare const ActResponseSchema: z$1.ZodObject<{
1166
1159
  }, z$1.core.$strip>;
1167
1160
  }, z$1.core.$strip>;
1168
1161
  declare const ExtractOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
1169
- model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1162
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
1170
1163
  provider: z$1.ZodOptional<z$1.ZodEnum<{
1171
1164
  openai: "openai";
1172
1165
  anthropic: "anthropic";
@@ -1176,7 +1169,7 @@ declare const ExtractOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
1176
1169
  modelName: z$1.ZodString;
1177
1170
  apiKey: z$1.ZodOptional<z$1.ZodString>;
1178
1171
  baseURL: z$1.ZodOptional<z$1.ZodString>;
1179
- }, z$1.core.$strip>]>>;
1172
+ }, z$1.core.$strip>, z$1.ZodString]>>;
1180
1173
  timeout: z$1.ZodOptional<z$1.ZodNumber>;
1181
1174
  selector: z$1.ZodOptional<z$1.ZodString>;
1182
1175
  }, z$1.core.$strip>>;
@@ -1184,7 +1177,7 @@ declare const ExtractRequestSchema: z$1.ZodObject<{
1184
1177
  instruction: z$1.ZodOptional<z$1.ZodString>;
1185
1178
  schema: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
1186
1179
  options: z$1.ZodOptional<z$1.ZodObject<{
1187
- model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1180
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
1188
1181
  provider: z$1.ZodOptional<z$1.ZodEnum<{
1189
1182
  openai: "openai";
1190
1183
  anthropic: "anthropic";
@@ -1194,11 +1187,11 @@ declare const ExtractRequestSchema: z$1.ZodObject<{
1194
1187
  modelName: z$1.ZodString;
1195
1188
  apiKey: z$1.ZodOptional<z$1.ZodString>;
1196
1189
  baseURL: z$1.ZodOptional<z$1.ZodString>;
1197
- }, z$1.core.$strip>]>>;
1190
+ }, z$1.core.$strip>, z$1.ZodString]>>;
1198
1191
  timeout: z$1.ZodOptional<z$1.ZodNumber>;
1199
1192
  selector: z$1.ZodOptional<z$1.ZodString>;
1200
1193
  }, z$1.core.$strip>>;
1201
- frameId: z$1.ZodOptional<z$1.ZodString>;
1194
+ frameId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
1202
1195
  streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
1203
1196
  }, z$1.core.$strip>;
1204
1197
  declare const ExtractResultSchema: z$1.ZodObject<{
@@ -1213,7 +1206,7 @@ declare const ExtractResponseSchema: z$1.ZodObject<{
1213
1206
  }, z$1.core.$strip>;
1214
1207
  }, z$1.core.$strip>;
1215
1208
  declare const ObserveOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
1216
- model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1209
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
1217
1210
  provider: z$1.ZodOptional<z$1.ZodEnum<{
1218
1211
  openai: "openai";
1219
1212
  anthropic: "anthropic";
@@ -1223,14 +1216,14 @@ declare const ObserveOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
1223
1216
  modelName: z$1.ZodString;
1224
1217
  apiKey: z$1.ZodOptional<z$1.ZodString>;
1225
1218
  baseURL: z$1.ZodOptional<z$1.ZodString>;
1226
- }, z$1.core.$strip>]>>;
1219
+ }, z$1.core.$strip>, z$1.ZodString]>>;
1227
1220
  timeout: z$1.ZodOptional<z$1.ZodNumber>;
1228
1221
  selector: z$1.ZodOptional<z$1.ZodString>;
1229
1222
  }, z$1.core.$strip>>;
1230
1223
  declare const ObserveRequestSchema: z$1.ZodObject<{
1231
1224
  instruction: z$1.ZodOptional<z$1.ZodString>;
1232
1225
  options: z$1.ZodOptional<z$1.ZodObject<{
1233
- model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1226
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
1234
1227
  provider: z$1.ZodOptional<z$1.ZodEnum<{
1235
1228
  openai: "openai";
1236
1229
  anthropic: "anthropic";
@@ -1240,11 +1233,11 @@ declare const ObserveRequestSchema: z$1.ZodObject<{
1240
1233
  modelName: z$1.ZodString;
1241
1234
  apiKey: z$1.ZodOptional<z$1.ZodString>;
1242
1235
  baseURL: z$1.ZodOptional<z$1.ZodString>;
1243
- }, z$1.core.$strip>]>>;
1236
+ }, z$1.core.$strip>, z$1.ZodString]>>;
1244
1237
  timeout: z$1.ZodOptional<z$1.ZodNumber>;
1245
1238
  selector: z$1.ZodOptional<z$1.ZodString>;
1246
1239
  }, z$1.core.$strip>>;
1247
- frameId: z$1.ZodOptional<z$1.ZodString>;
1240
+ frameId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
1248
1241
  streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
1249
1242
  }, z$1.core.$strip>;
1250
1243
  declare const ObserveResultSchema: z$1.ZodObject<{
@@ -1277,7 +1270,7 @@ declare const AgentConfigSchema: z$1.ZodObject<{
1277
1270
  google: "google";
1278
1271
  microsoft: "microsoft";
1279
1272
  }>>;
1280
- model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1273
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
1281
1274
  provider: z$1.ZodOptional<z$1.ZodEnum<{
1282
1275
  openai: "openai";
1283
1276
  anthropic: "anthropic";
@@ -1287,7 +1280,7 @@ declare const AgentConfigSchema: z$1.ZodObject<{
1287
1280
  modelName: z$1.ZodString;
1288
1281
  apiKey: z$1.ZodOptional<z$1.ZodString>;
1289
1282
  baseURL: z$1.ZodOptional<z$1.ZodString>;
1290
- }, z$1.core.$strip>]>>;
1283
+ }, z$1.core.$strip>, z$1.ZodString]>>;
1291
1284
  systemPrompt: z$1.ZodOptional<z$1.ZodString>;
1292
1285
  cua: z$1.ZodOptional<z$1.ZodBoolean>;
1293
1286
  }, z$1.core.$strip>;
@@ -1334,6 +1327,10 @@ declare const AgentResultDataSchema: z$1.ZodObject<{
1334
1327
  inference_time_ms: z$1.ZodNumber;
1335
1328
  }, z$1.core.$strip>>;
1336
1329
  }, z$1.core.$strip>;
1330
+ declare const AgentCacheEntrySchema: z$1.ZodObject<{
1331
+ cacheKey: z$1.ZodString;
1332
+ entry: z$1.ZodUnknown;
1333
+ }, z$1.core.$strip>;
1337
1334
  declare const AgentExecuteOptionsSchema: z$1.ZodObject<{
1338
1335
  instruction: z$1.ZodString;
1339
1336
  maxSteps: z$1.ZodOptional<z$1.ZodNumber>;
@@ -1347,7 +1344,7 @@ declare const AgentExecuteRequestSchema: z$1.ZodObject<{
1347
1344
  google: "google";
1348
1345
  microsoft: "microsoft";
1349
1346
  }>>;
1350
- model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1347
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
1351
1348
  provider: z$1.ZodOptional<z$1.ZodEnum<{
1352
1349
  openai: "openai";
1353
1350
  anthropic: "anthropic";
@@ -1357,7 +1354,7 @@ declare const AgentExecuteRequestSchema: z$1.ZodObject<{
1357
1354
  modelName: z$1.ZodString;
1358
1355
  apiKey: z$1.ZodOptional<z$1.ZodString>;
1359
1356
  baseURL: z$1.ZodOptional<z$1.ZodString>;
1360
- }, z$1.core.$strip>]>>;
1357
+ }, z$1.core.$strip>, z$1.ZodString]>>;
1361
1358
  systemPrompt: z$1.ZodOptional<z$1.ZodString>;
1362
1359
  cua: z$1.ZodOptional<z$1.ZodBoolean>;
1363
1360
  }, z$1.core.$strip>;
@@ -1366,8 +1363,9 @@ declare const AgentExecuteRequestSchema: z$1.ZodObject<{
1366
1363
  maxSteps: z$1.ZodOptional<z$1.ZodNumber>;
1367
1364
  highlightCursor: z$1.ZodOptional<z$1.ZodBoolean>;
1368
1365
  }, z$1.core.$strip>;
1369
- frameId: z$1.ZodOptional<z$1.ZodString>;
1366
+ frameId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
1370
1367
  streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
1368
+ shouldCache: z$1.ZodOptional<z$1.ZodBoolean>;
1371
1369
  }, z$1.core.$strip>;
1372
1370
  declare const AgentExecuteResultSchema: z$1.ZodObject<{
1373
1371
  result: z$1.ZodObject<{
@@ -1393,6 +1391,10 @@ declare const AgentExecuteResultSchema: z$1.ZodObject<{
1393
1391
  inference_time_ms: z$1.ZodNumber;
1394
1392
  }, z$1.core.$strip>>;
1395
1393
  }, z$1.core.$strip>;
1394
+ cacheEntry: z$1.ZodOptional<z$1.ZodObject<{
1395
+ cacheKey: z$1.ZodString;
1396
+ entry: z$1.ZodUnknown;
1397
+ }, z$1.core.$strip>>;
1396
1398
  }, z$1.core.$strip>;
1397
1399
  declare const AgentExecuteResponseSchema: z$1.ZodObject<{
1398
1400
  success: z$1.ZodBoolean;
@@ -1420,6 +1422,10 @@ declare const AgentExecuteResponseSchema: z$1.ZodObject<{
1420
1422
  inference_time_ms: z$1.ZodNumber;
1421
1423
  }, z$1.core.$strip>>;
1422
1424
  }, z$1.core.$strip>;
1425
+ cacheEntry: z$1.ZodOptional<z$1.ZodObject<{
1426
+ cacheKey: z$1.ZodString;
1427
+ entry: z$1.ZodUnknown;
1428
+ }, z$1.core.$strip>>;
1423
1429
  }, z$1.core.$strip>;
1424
1430
  }, z$1.core.$strip>;
1425
1431
  declare const NavigateOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
@@ -1442,7 +1448,7 @@ declare const NavigateRequestSchema: z$1.ZodObject<{
1442
1448
  networkidle: "networkidle";
1443
1449
  }>>;
1444
1450
  }, z$1.core.$strip>>;
1445
- frameId: z$1.ZodOptional<z$1.ZodString>;
1451
+ frameId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
1446
1452
  streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
1447
1453
  }, z$1.core.$strip>;
1448
1454
  declare const NavigateResultSchema: z$1.ZodObject<{
@@ -1755,6 +1761,7 @@ declare const api_ActResultDataSchema: typeof ActResultDataSchema;
1755
1761
  declare const api_ActResultSchema: typeof ActResultSchema;
1756
1762
  declare const api_ActionSchema: typeof ActionSchema;
1757
1763
  declare const api_AgentActionSchema: typeof AgentActionSchema;
1764
+ declare const api_AgentCacheEntrySchema: typeof AgentCacheEntrySchema;
1758
1765
  declare const api_AgentConfigSchema: typeof AgentConfigSchema;
1759
1766
  declare const api_AgentExecuteOptionsSchema: typeof AgentExecuteOptionsSchema;
1760
1767
  type api_AgentExecuteRequest = AgentExecuteRequest;
@@ -1798,7 +1805,6 @@ declare const api_LocalBrowserLaunchOptionsSchema: typeof LocalBrowserLaunchOpti
1798
1805
  type api_ModelConfig = ModelConfig;
1799
1806
  declare const api_ModelConfigObjectSchema: typeof ModelConfigObjectSchema;
1800
1807
  declare const api_ModelConfigSchema: typeof ModelConfigSchema;
1801
- declare const api_ModelNameSchema: typeof ModelNameSchema;
1802
1808
  declare const api_NavigateOptionsSchema: typeof NavigateOptionsSchema;
1803
1809
  type api_NavigateRequest = NavigateRequest;
1804
1810
  declare const api_NavigateRequestSchema: typeof NavigateRequestSchema;
@@ -1853,7 +1859,7 @@ declare const api_TokenUsageSchema: typeof TokenUsageSchema;
1853
1859
  declare const api_openApiLinks: typeof openApiLinks;
1854
1860
  declare const api_openApiSecuritySchemes: typeof openApiSecuritySchemes;
1855
1861
  declare namespace api {
1856
- export { api_ActOptionsSchema as ActOptionsSchema, type api_ActRequest as ActRequest, api_ActRequestSchema as ActRequestSchema, type api_ActResponse as ActResponse, api_ActResponseSchema as ActResponseSchema, type ActResult$1 as ActResult, type api_ActResultData as ActResultData, api_ActResultDataSchema as ActResultDataSchema, api_ActResultSchema as ActResultSchema, type Action$1 as Action, api_ActionSchema as ActionSchema, type AgentAction$1 as AgentAction, api_AgentActionSchema as AgentActionSchema, api_AgentConfigSchema as AgentConfigSchema, api_AgentExecuteOptionsSchema as AgentExecuteOptionsSchema, type api_AgentExecuteRequest as AgentExecuteRequest, api_AgentExecuteRequestSchema as AgentExecuteRequestSchema, type api_AgentExecuteResponse as AgentExecuteResponse, api_AgentExecuteResponseSchema as AgentExecuteResponseSchema, type api_AgentExecuteResult as AgentExecuteResult, api_AgentExecuteResultSchema as AgentExecuteResultSchema, type api_AgentResultData as AgentResultData, api_AgentResultDataSchema as AgentResultDataSchema, type api_AgentUsage as AgentUsage, api_AgentUsageSchema as AgentUsageSchema, type api_BrowserConfig as BrowserConfig, api_BrowserConfigSchema as BrowserConfigSchema, type api_BrowserbaseBrowserSettings as BrowserbaseBrowserSettings, api_BrowserbaseBrowserSettingsSchema as BrowserbaseBrowserSettingsSchema, type api_BrowserbaseContext as BrowserbaseContext, api_BrowserbaseContextSchema as BrowserbaseContextSchema, type api_BrowserbaseFingerprint as BrowserbaseFingerprint, api_BrowserbaseFingerprintSchema as BrowserbaseFingerprintSchema, type api_BrowserbaseFingerprintScreen as BrowserbaseFingerprintScreen, api_BrowserbaseFingerprintScreenSchema as BrowserbaseFingerprintScreenSchema, type api_BrowserbaseProxyConfig as BrowserbaseProxyConfig, api_BrowserbaseProxyConfigSchema as BrowserbaseProxyConfigSchema, type api_BrowserbaseProxyGeolocation as BrowserbaseProxyGeolocation, api_BrowserbaseProxyGeolocationSchema as BrowserbaseProxyGeolocationSchema, type api_BrowserbaseSessionCreateParams as BrowserbaseSessionCreateParams, api_BrowserbaseSessionCreateParamsSchema as BrowserbaseSessionCreateParamsSchema, type api_BrowserbaseViewport as BrowserbaseViewport, api_BrowserbaseViewportSchema as BrowserbaseViewportSchema, api_ErrorResponseSchema as ErrorResponseSchema, type api_ExternalProxyConfig as ExternalProxyConfig, api_ExternalProxyConfigSchema as ExternalProxyConfigSchema, api_ExtractOptionsSchema as ExtractOptionsSchema, type api_ExtractRequest as ExtractRequest, api_ExtractRequestSchema as ExtractRequestSchema, type api_ExtractResponse as ExtractResponse, api_ExtractResponseSchema as ExtractResponseSchema, type ExtractResult$1 as ExtractResult, api_ExtractResultSchema as ExtractResultSchema, api_LocalBrowserLaunchOptionsSchema as LocalBrowserLaunchOptionsSchema, type api_ModelConfig as ModelConfig, api_ModelConfigObjectSchema as ModelConfigObjectSchema, api_ModelConfigSchema as ModelConfigSchema, api_ModelNameSchema as ModelNameSchema, api_NavigateOptionsSchema as NavigateOptionsSchema, type api_NavigateRequest as NavigateRequest, api_NavigateRequestSchema as NavigateRequestSchema, type api_NavigateResponse as NavigateResponse, api_NavigateResponseSchema as NavigateResponseSchema, type api_NavigateResult as NavigateResult, api_NavigateResultSchema as NavigateResultSchema, api_ObserveOptionsSchema as ObserveOptionsSchema, type api_ObserveRequest as ObserveRequest, api_ObserveRequestSchema as ObserveRequestSchema, type api_ObserveResponse as ObserveResponse, api_ObserveResponseSchema as ObserveResponseSchema, type api_ObserveResult as ObserveResult, api_ObserveResultSchema as ObserveResultSchema, api_Operations as Operations, api_ProxyConfigSchema as ProxyConfigSchema, type api_ReplayAction as ReplayAction, api_ReplayActionSchema as ReplayActionSchema, type api_ReplayPage as ReplayPage, api_ReplayPageSchema as ReplayPageSchema, type api_ReplayResponse as ReplayResponse, api_ReplayResponseSchema as ReplayResponseSchema, type api_ReplayResult as ReplayResult, api_ReplayResultSchema as ReplayResultSchema, api_SessionEndRequestSchema as SessionEndRequestSchema, type api_SessionEndResponse as SessionEndResponse, api_SessionEndResponseSchema as SessionEndResponseSchema, type api_SessionEndResult as SessionEndResult, api_SessionEndResultSchema as SessionEndResultSchema, type api_SessionHeaders as SessionHeaders, api_SessionHeadersSchema as SessionHeadersSchema, type api_SessionIdParams as SessionIdParams, api_SessionIdParamsSchema as SessionIdParamsSchema, type api_SessionStartRequest as SessionStartRequest, api_SessionStartRequestSchema as SessionStartRequestSchema, type api_SessionStartResponse as SessionStartResponse, api_SessionStartResponseSchema as SessionStartResponseSchema, type api_SessionStartResult as SessionStartResult, api_SessionStartResultSchema as SessionStartResultSchema, type api_StreamEvent as StreamEvent, type api_StreamEventLogData as StreamEventLogData, api_StreamEventLogDataSchema as StreamEventLogDataSchema, api_StreamEventSchema as StreamEventSchema, type api_StreamEventStatus as StreamEventStatus, api_StreamEventStatusSchema as StreamEventStatusSchema, type api_StreamEventSystemData as StreamEventSystemData, api_StreamEventSystemDataSchema as StreamEventSystemDataSchema, type api_StreamEventType as StreamEventType, api_StreamEventTypeSchema as StreamEventTypeSchema, type api_TokenUsage as TokenUsage, api_TokenUsageSchema as TokenUsageSchema, api_openApiLinks as openApiLinks, api_openApiSecuritySchemes as openApiSecuritySchemes };
1862
+ export { api_ActOptionsSchema as ActOptionsSchema, type api_ActRequest as ActRequest, api_ActRequestSchema as ActRequestSchema, type api_ActResponse as ActResponse, api_ActResponseSchema as ActResponseSchema, type ActResult$1 as ActResult, type api_ActResultData as ActResultData, api_ActResultDataSchema as ActResultDataSchema, api_ActResultSchema as ActResultSchema, type Action$1 as Action, api_ActionSchema as ActionSchema, type AgentAction$1 as AgentAction, api_AgentActionSchema as AgentActionSchema, api_AgentCacheEntrySchema as AgentCacheEntrySchema, api_AgentConfigSchema as AgentConfigSchema, api_AgentExecuteOptionsSchema as AgentExecuteOptionsSchema, type api_AgentExecuteRequest as AgentExecuteRequest, api_AgentExecuteRequestSchema as AgentExecuteRequestSchema, type api_AgentExecuteResponse as AgentExecuteResponse, api_AgentExecuteResponseSchema as AgentExecuteResponseSchema, type api_AgentExecuteResult as AgentExecuteResult, api_AgentExecuteResultSchema as AgentExecuteResultSchema, type api_AgentResultData as AgentResultData, api_AgentResultDataSchema as AgentResultDataSchema, type api_AgentUsage as AgentUsage, api_AgentUsageSchema as AgentUsageSchema, type api_BrowserConfig as BrowserConfig, api_BrowserConfigSchema as BrowserConfigSchema, type api_BrowserbaseBrowserSettings as BrowserbaseBrowserSettings, api_BrowserbaseBrowserSettingsSchema as BrowserbaseBrowserSettingsSchema, type api_BrowserbaseContext as BrowserbaseContext, api_BrowserbaseContextSchema as BrowserbaseContextSchema, type api_BrowserbaseFingerprint as BrowserbaseFingerprint, api_BrowserbaseFingerprintSchema as BrowserbaseFingerprintSchema, type api_BrowserbaseFingerprintScreen as BrowserbaseFingerprintScreen, api_BrowserbaseFingerprintScreenSchema as BrowserbaseFingerprintScreenSchema, type api_BrowserbaseProxyConfig as BrowserbaseProxyConfig, api_BrowserbaseProxyConfigSchema as BrowserbaseProxyConfigSchema, type api_BrowserbaseProxyGeolocation as BrowserbaseProxyGeolocation, api_BrowserbaseProxyGeolocationSchema as BrowserbaseProxyGeolocationSchema, type api_BrowserbaseSessionCreateParams as BrowserbaseSessionCreateParams, api_BrowserbaseSessionCreateParamsSchema as BrowserbaseSessionCreateParamsSchema, type api_BrowserbaseViewport as BrowserbaseViewport, api_BrowserbaseViewportSchema as BrowserbaseViewportSchema, api_ErrorResponseSchema as ErrorResponseSchema, type api_ExternalProxyConfig as ExternalProxyConfig, api_ExternalProxyConfigSchema as ExternalProxyConfigSchema, api_ExtractOptionsSchema as ExtractOptionsSchema, type api_ExtractRequest as ExtractRequest, api_ExtractRequestSchema as ExtractRequestSchema, type api_ExtractResponse as ExtractResponse, api_ExtractResponseSchema as ExtractResponseSchema, type ExtractResult$1 as ExtractResult, api_ExtractResultSchema as ExtractResultSchema, api_LocalBrowserLaunchOptionsSchema as LocalBrowserLaunchOptionsSchema, type api_ModelConfig as ModelConfig, api_ModelConfigObjectSchema as ModelConfigObjectSchema, api_ModelConfigSchema as ModelConfigSchema, api_NavigateOptionsSchema as NavigateOptionsSchema, type api_NavigateRequest as NavigateRequest, api_NavigateRequestSchema as NavigateRequestSchema, type api_NavigateResponse as NavigateResponse, api_NavigateResponseSchema as NavigateResponseSchema, type api_NavigateResult as NavigateResult, api_NavigateResultSchema as NavigateResultSchema, api_ObserveOptionsSchema as ObserveOptionsSchema, type api_ObserveRequest as ObserveRequest, api_ObserveRequestSchema as ObserveRequestSchema, type api_ObserveResponse as ObserveResponse, api_ObserveResponseSchema as ObserveResponseSchema, type api_ObserveResult as ObserveResult, api_ObserveResultSchema as ObserveResultSchema, api_Operations as Operations, api_ProxyConfigSchema as ProxyConfigSchema, type api_ReplayAction as ReplayAction, api_ReplayActionSchema as ReplayActionSchema, type api_ReplayPage as ReplayPage, api_ReplayPageSchema as ReplayPageSchema, type api_ReplayResponse as ReplayResponse, api_ReplayResponseSchema as ReplayResponseSchema, type api_ReplayResult as ReplayResult, api_ReplayResultSchema as ReplayResultSchema, api_SessionEndRequestSchema as SessionEndRequestSchema, type api_SessionEndResponse as SessionEndResponse, api_SessionEndResponseSchema as SessionEndResponseSchema, type api_SessionEndResult as SessionEndResult, api_SessionEndResultSchema as SessionEndResultSchema, type api_SessionHeaders as SessionHeaders, api_SessionHeadersSchema as SessionHeadersSchema, type api_SessionIdParams as SessionIdParams, api_SessionIdParamsSchema as SessionIdParamsSchema, type api_SessionStartRequest as SessionStartRequest, api_SessionStartRequestSchema as SessionStartRequestSchema, type api_SessionStartResponse as SessionStartResponse, api_SessionStartResponseSchema as SessionStartResponseSchema, type api_SessionStartResult as SessionStartResult, api_SessionStartResultSchema as SessionStartResultSchema, type api_StreamEvent as StreamEvent, type api_StreamEventLogData as StreamEventLogData, api_StreamEventLogDataSchema as StreamEventLogDataSchema, api_StreamEventSchema as StreamEventSchema, type api_StreamEventStatus as StreamEventStatus, api_StreamEventStatusSchema as StreamEventStatusSchema, type api_StreamEventSystemData as StreamEventSystemData, api_StreamEventSystemDataSchema as StreamEventSystemDataSchema, type api_StreamEventType as StreamEventType, api_StreamEventTypeSchema as StreamEventTypeSchema, type api_TokenUsage as TokenUsage, api_TokenUsageSchema as TokenUsageSchema, api_openApiLinks as openApiLinks, api_openApiSecuritySchemes as openApiSecuritySchemes };
1857
1863
  }
1858
1864
 
1859
1865
  declare class StagehandAPIError extends Error {
@@ -1957,6 +1963,7 @@ type V3Env = "LOCAL" | "BROWSERBASE";
1957
1963
  declare const localBrowserLaunchOptionsSchema: z.ZodObject<{
1958
1964
  args: z.ZodOptional<z.ZodArray<z.ZodString>>;
1959
1965
  executablePath: z.ZodOptional<z.ZodString>;
1966
+ port: z.ZodOptional<z.ZodNumber>;
1960
1967
  userDataDir: z.ZodOptional<z.ZodString>;
1961
1968
  preserveUserDataDir: z.ZodOptional<z.ZodBoolean>;
1962
1969
  headless: z.ZodOptional<z.ZodBoolean>;
@@ -2014,7 +2021,8 @@ interface V3Options {
2014
2021
  }
2015
2022
 
2016
2023
  declare class StagehandError extends Error {
2017
- constructor(message: string);
2024
+ readonly cause?: unknown;
2025
+ constructor(message: string, cause?: unknown);
2018
2026
  }
2019
2027
  declare class StagehandDefaultError extends StagehandError {
2020
2028
  constructor(error?: unknown);
@@ -2157,6 +2165,9 @@ declare class AgentAbortError extends StagehandError {
2157
2165
  declare class StagehandClosedError extends StagehandError {
2158
2166
  constructor();
2159
2167
  }
2168
+ declare class StagehandSnapshotError extends StagehandError {
2169
+ constructor(cause?: unknown);
2170
+ }
2160
2171
 
2161
2172
  declare class AISdkClient extends LLMClient {
2162
2173
  type: "aisdk";
@@ -2167,6 +2178,23 @@ declare class AISdkClient extends LLMClient {
2167
2178
  createChatCompletion<T = ChatCompletion>({ options, }: CreateChatCompletionOptions): Promise<T>;
2168
2179
  }
2169
2180
 
2181
+ /**
2182
+ * Welcome to the Stagehand custom OpenAI client!
2183
+ *
2184
+ * This is a client for models that are compatible with the OpenAI API, like Ollama, Gemini, etc.
2185
+ * You can just pass in an OpenAI instance to the client and it will work.
2186
+ */
2187
+
2188
+ declare class CustomOpenAIClient extends LLMClient {
2189
+ type: "openai";
2190
+ private client;
2191
+ constructor({ modelName, client }: {
2192
+ modelName: string;
2193
+ client: OpenAI;
2194
+ });
2195
+ createChatCompletion<T = ChatCompletion$1>({ options, retries, logger, }: CreateChatCompletionOptions): Promise<T>;
2196
+ }
2197
+
2170
2198
  /**
2171
2199
  * Constructor parameters for StagehandAPIClient
2172
2200
  */
@@ -2224,13 +2252,16 @@ declare class StagehandAPIClient {
2224
2252
  private modelProvider?;
2225
2253
  private logger;
2226
2254
  private fetchWithCookies;
2255
+ private lastFinishedEventData;
2256
+ private latestAgentCacheEntry;
2227
2257
  constructor({ apiKey, projectId, logger }: StagehandAPIConstructorParams);
2228
2258
  init({ modelName, modelApiKey, domSettleTimeoutMs, verbose, systemPrompt, selfHeal, browserbaseSessionCreateParams, browserbaseSessionID, }: ClientSessionStartParams): Promise<SessionStartResult>;
2229
2259
  act({ input, options, frameId, }: ClientActParameters): Promise<ActResult>;
2230
2260
  extract<T extends StagehandZodSchema>({ instruction, schema: zodSchema, options, frameId, }: ClientExtractParameters): Promise<ExtractResult<T>>;
2231
2261
  observe({ instruction, options, frameId, }: ClientObserveParameters): Promise<Action[]>;
2232
2262
  goto(url: string, options?: NavigateRequest["options"], frameId?: string): Promise<SerializableResponse | null>;
2233
- agentExecute(agentConfig: AgentConfig, executeOptions: AgentExecuteOptions | string, frameId?: string): Promise<AgentResult>;
2263
+ agentExecute(agentConfig: AgentConfig, executeOptions: AgentExecuteOptions | string, frameId?: string, shouldCache?: boolean): Promise<AgentResult>;
2264
+ consumeLatestAgentCacheEntry(): AgentCacheTransferPayload | null;
2234
2265
  end(): Promise<Response>;
2235
2266
  getReplayMetrics(): Promise<StagehandMetrics>;
2236
2267
  /**
@@ -2242,6 +2273,7 @@ declare class StagehandAPIClient {
2242
2273
  * model provider differs from the one used to init the session.
2243
2274
  */
2244
2275
  private prepareModelConfig;
2276
+ private consumeFinishedEventData;
2245
2277
  private execute;
2246
2278
  private request;
2247
2279
  }
@@ -2373,6 +2405,10 @@ declare class V3Context {
2373
2405
  awaitActivePage(timeoutMs?: number): Promise<Page>;
2374
2406
  }
2375
2407
 
2408
+ type AgentCacheTransferPayload = {
2409
+ cacheKey: string;
2410
+ entry: CachedAgentEntry;
2411
+ };
2376
2412
  type AgentReplayStep = AgentReplayActStep | AgentReplayFillFormStep | AgentReplayGotoStep | AgentReplayScrollStep | AgentReplayWaitStep | AgentReplayNavBackStep | AgentReplayKeysStep | {
2377
2413
  type: string;
2378
2414
  [key: string]: unknown;
@@ -2426,6 +2462,20 @@ interface AgentReplayKeysStep {
2426
2462
  times?: number;
2427
2463
  };
2428
2464
  }
2465
+ interface SanitizedAgentExecuteOptions {
2466
+ maxSteps?: number;
2467
+ highlightCursor?: boolean;
2468
+ }
2469
+ interface CachedAgentEntry {
2470
+ version: 1;
2471
+ instruction: string;
2472
+ startUrl: string;
2473
+ options: SanitizedAgentExecuteOptions;
2474
+ configSignature: string;
2475
+ steps: AgentReplayStep[];
2476
+ result: AgentResult;
2477
+ timestamp: string;
2478
+ }
2429
2479
 
2430
2480
  /**
2431
2481
  * Response
@@ -2563,6 +2613,15 @@ type AnyPage = Page$1 | Page$2 | Page$3 | Page;
2563
2613
 
2564
2614
  type LoadState = "load" | "domcontentloaded" | "networkidle";
2565
2615
 
2616
+ type SnapshotResult = {
2617
+ formattedTree: string;
2618
+ xpathMap: Record<string, string>;
2619
+ urlMap: Record<string, string>;
2620
+ };
2621
+ type PageSnapshotOptions = {
2622
+ includeIframes?: boolean;
2623
+ };
2624
+
2566
2625
  type ScreenshotAnimationsOption = "disabled" | "allow";
2567
2626
  type ScreenshotCaretOption = "hide" | "initial";
2568
2627
  type ScreenshotScaleOption = "css" | "device";
@@ -2811,6 +2870,24 @@ declare class Page {
2811
2870
  * @param ms The number of milliseconds to wait.
2812
2871
  */
2813
2872
  waitForTimeout(ms: number): Promise<void>;
2873
+ /**
2874
+ * Wait for an element matching the selector to appear in the DOM.
2875
+ * Uses MutationObserver for efficiency
2876
+ * Pierces shadow DOM by default.
2877
+ * Supports iframe hop notation with '>>' (e.g., 'iframe#checkout >> .submit-btn').
2878
+ *
2879
+ * @param selector CSS selector to wait for (supports '>>' for iframe hops)
2880
+ * @param options.state Element state to wait for: 'attached' | 'detached' | 'visible' | 'hidden' (default: 'visible')
2881
+ * @param options.timeout Maximum time to wait in milliseconds (default: 30000)
2882
+ * @param options.pierceShadow Whether to search inside shadow DOM (default: true)
2883
+ * @returns True when the condition is met
2884
+ * @throws Error if timeout is reached before the condition is met
2885
+ */
2886
+ waitForSelector(selector: string, options?: {
2887
+ state?: "attached" | "detached" | "visible" | "hidden";
2888
+ timeout?: number;
2889
+ pierceShadow?: boolean;
2890
+ }): Promise<boolean>;
2814
2891
  /**
2815
2892
  * Evaluate a function or expression in the current main frame's main world.
2816
2893
  * - If a string is provided, it is treated as a JS expression.
@@ -2876,6 +2953,7 @@ declare class Page {
2876
2953
  keyPress(key: string, options?: {
2877
2954
  delay?: number;
2878
2955
  }): Promise<void>;
2956
+ snapshot(options?: PageSnapshotOptions): Promise<SnapshotResult>;
2879
2957
  private _pressedModifiers;
2880
2958
  /** Press a key down without releasing it */
2881
2959
  private keyDown;
@@ -3150,7 +3228,7 @@ interface AgentExecuteOptionsBase {
3150
3228
  * - `screenshot` - Take a screenshot
3151
3229
  * - `think` - Agent reasoning/planning step
3152
3230
  * - `wait` - Wait for time or condition
3153
- * - `close` - Mark task as complete
3231
+ * - `done` - Mark task as complete
3154
3232
  * - `search` - Web search (requires BRAVE_API_KEY)
3155
3233
  *
3156
3234
  * **Hybrid mode:**
@@ -3169,7 +3247,7 @@ interface AgentExecuteOptionsBase {
3169
3247
  * - `screenshot` - Take screenshot
3170
3248
  * - `think` - Agent reasoning step
3171
3249
  * - `wait` - Wait for time/condition
3172
- * - `close` - Mark task complete
3250
+ * - `done` - Mark task complete
3173
3251
  * - `search` - Web search (requires BRAVE_API_KEY)
3174
3252
  *
3175
3253
  * @experimental
@@ -3185,7 +3263,7 @@ interface AgentExecuteOptionsBase {
3185
3263
  excludeTools?: string[];
3186
3264
  /**
3187
3265
  * A Zod schema defining custom output data to return when the task completes.
3188
- * The agent will populate this data in the final close tool call.
3266
+ * The agent will populate this data in the final done tool call.
3189
3267
  *
3190
3268
  * @experimental
3191
3269
  * @example
@@ -3227,7 +3305,7 @@ interface AgentStreamExecuteOptions extends AgentExecuteOptionsBase {
3227
3305
  callbacks?: AgentStreamCallbacks;
3228
3306
  }
3229
3307
  type AgentType = "openai" | "anthropic" | "google" | "microsoft";
3230
- declare const AVAILABLE_CUA_MODELS: readonly ["openai/computer-use-preview", "openai/computer-use-preview-2025-03-11", "anthropic/claude-3-7-sonnet-latest", "anthropic/claude-opus-4-5-20251101", "anthropic/claude-haiku-4-5-20251001", "anthropic/claude-sonnet-4-20250514", "anthropic/claude-sonnet-4-5-20250929", "google/gemini-2.5-computer-use-preview-10-2025", "google/gemini-3-flash-computer-use", "microsoft/fara-7b"];
3308
+ declare const AVAILABLE_CUA_MODELS: readonly ["openai/computer-use-preview", "openai/computer-use-preview-2025-03-11", "anthropic/claude-3-7-sonnet-latest", "anthropic/claude-opus-4-5-20251101", "anthropic/claude-haiku-4-5-20251001", "anthropic/claude-sonnet-4-20250514", "anthropic/claude-sonnet-4-5-20250929", "google/gemini-2.5-computer-use-preview-10-2025", "microsoft/fara-7b"];
3231
3309
  type AvailableCuaModel = (typeof AVAILABLE_CUA_MODELS)[number];
3232
3310
  interface AgentExecutionOptions<TOptions extends AgentExecuteOptions = AgentExecuteOptions> {
3233
3311
  options: TOptions;
@@ -3713,6 +3791,18 @@ declare class V3 {
3713
3791
  * Returns true if the browser is running on Browserbase.
3714
3792
  */
3715
3793
  get isBrowserbase(): boolean;
3794
+ /**
3795
+ * Returns true if advancedStealth is enabled in Browserbase settings.
3796
+ */
3797
+ get isAdvancedStealth(): boolean;
3798
+ /**
3799
+ * Returns the configured viewport dimensions from launch options.
3800
+ * Falls back to default 1288x711 if not configured.
3801
+ */
3802
+ get configuredViewport(): {
3803
+ width: number;
3804
+ height: number;
3805
+ };
3716
3806
  private _onCdpClosed;
3717
3807
  readonly experimental: boolean;
3718
3808
  readonly logInferenceToFile: boolean;
@@ -4215,4 +4305,10 @@ declare class V3Evaluator {
4215
4305
  private _evaluateWithMultipleScreenshots;
4216
4306
  }
4217
4307
 
4218
- export { type AISDKCustomProvider, type AISDKProvider, AISdkClient, AVAILABLE_CUA_MODELS, type ActOptions, type ActResult, ActTimeoutError, type Action, type ActionExecutionResult, AgentAbortError, type AgentAction, type AgentCallbacks, type AgentConfig, type AgentContext, type AgentExecuteCallbacks, type AgentExecuteOptions, type AgentExecuteOptionsBase, type AgentExecutionOptions, type AgentHandlerOptions, type AgentInstance, type AgentModelConfig, AgentProvider, type AgentProviderType, type AgentResult, AgentScreenshotProviderError, type AgentState, type AgentStreamCallbacks, type AgentStreamExecuteOptions, type AgentStreamResult, type AgentToolCall, type AgentToolMode, type AgentToolResult, type AgentToolTypesMap, type AgentTools, type AgentType, type AgentUITools, AnnotatedScreenshotText, type AnthropicClientOptions, type AnthropicContentBlock, type AnthropicJsonSchemaObject, type AnthropicMessage, type AnthropicTextBlock, type AnthropicToolResult, type AnyPage, api as Api, type AvailableCuaModel, type AvailableModel, BrowserbaseSessionNotFoundError, CaptchaTimeoutError, type ChatCompletionOptions, type ChatMessage, type ChatMessageContent, type ChatMessageImageContent, type ChatMessageTextContent, type ClickToolResult, type ClientOptions, type ComputerCallItem, ConnectionTimeoutError, type ConsoleListener, ConsoleMessage, ContentFrameNotFoundError, type CreateChatCompletionOptions, CreateChatCompletionResponseError, CuaModelRequiredError, type DragAndDropToolResult, ElementNotVisibleError, ExperimentalApiConflictError, ExperimentalNotConfiguredError, type ExtractOptions, type ExtractResult, ExtractTimeoutError, type FillFormField, type FillFormVisionToolResult, type FunctionCallItem, type GoogleServiceAccountCredentials, type GoogleVertexProviderSettings, 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 ModelOutputContentItem, type ModelProvider, type NonStreamingAgentInstance, type ObserveOptions, ObserveTimeoutError, type OpenAIClientOptions, Page, PageNotFoundError, Response$1 as Response, ResponseBodyError, type ResponseInputItem, type ResponseItem, ResponseParseError, type SafetyCheck, type SafetyConfirmationHandler, type SafetyConfirmationResponse, type ScrollVisionToolResult, V3 as Stagehand, StagehandAPIError, StagehandAPIUnauthorizedError, StagehandClickError, StagehandClosedError, StagehandDefaultError, StagehandDomProcessError, StagehandElementNotFoundError, StagehandEnvironmentError, StagehandError, StagehandEvalError, StagehandHttpError, StagehandIframeError, StagehandInitError, StagehandInvalidArgumentError, type StagehandMetrics, StagehandMissingArgumentError, StagehandNotInitializedError, StagehandResponseBodyError, StagehandResponseParseError, StagehandServerError, StagehandShadowRootMissingError, StagehandShadowSegmentEmptyError, StagehandShadowSegmentNotFoundError, type StagehandZodObject, type StagehandZodSchema, type StreamingAgentInstance, StreamingCallbacksInNonStreamingModeError, TimeoutError, type ToolUseItem, type TypeToolResult, UnsupportedAISDKModelProviderError, UnsupportedModelError, UnsupportedModelProviderError, V3, type V3Env, V3Evaluator, V3FunctionName, type V3Options, type WaitToolResult, XPathResolutionError, ZodSchemaValidationError, connectToMCPServer, defaultExtractSchema, getZodType, injectUrls, isRunningInBun, isZod3Schema, isZod4Schema, jsonSchemaToZod, loadApiKeyFromEnv, localBrowserLaunchOptionsSchema, modelToAgentProviderMap, pageTextSchema, providerEnvVarMap, toGeminiSchema, toJsonSchema, transformSchema, trimTrailingTextNode, validateZodSchema };
4308
+ interface ServerAgentCacheHandle {
4309
+ complete(): AgentCacheTransferPayload | null;
4310
+ discard(): void;
4311
+ }
4312
+ declare function __internalCreateInMemoryAgentCacheHandle(stagehand: V3): ServerAgentCacheHandle;
4313
+
4314
+ export { type AISDKCustomProvider, type AISDKProvider, AISdkClient, AVAILABLE_CUA_MODELS, type ActOptions, type ActResult, ActTimeoutError, type Action, type ActionExecutionResult, AgentAbortError, type AgentAction, type AgentCallbacks, type AgentConfig, type AgentContext, type AgentExecuteCallbacks, type AgentExecuteOptions, type AgentExecuteOptionsBase, type AgentExecutionOptions, type AgentHandlerOptions, type AgentInstance, type AgentModelConfig, AgentProvider, type AgentProviderType, type AgentResult, AgentScreenshotProviderError, type AgentState, type AgentStreamCallbacks, type AgentStreamExecuteOptions, type AgentStreamResult, type AgentToolCall, type AgentToolMode, type AgentToolResult, type AgentToolTypesMap, type AgentTools, type AgentType, type AgentUITools, AnnotatedScreenshotText, type AnthropicClientOptions, type AnthropicContentBlock, type AnthropicJsonSchemaObject, type AnthropicMessage, type AnthropicTextBlock, type AnthropicToolResult, type AnyPage, api as Api, type AvailableCuaModel, type AvailableModel, BrowserbaseSessionNotFoundError, CaptchaTimeoutError, type ChatCompletionOptions, type ChatMessage, type ChatMessageContent, type ChatMessageImageContent, type ChatMessageTextContent, type ClickToolResult, type ClientOptions, type ComputerCallItem, ConnectionTimeoutError, type ConsoleListener, ConsoleMessage, ContentFrameNotFoundError, type CreateChatCompletionOptions, CreateChatCompletionResponseError, CuaModelRequiredError, CustomOpenAIClient, type DragAndDropToolResult, ElementNotVisibleError, ExperimentalApiConflictError, ExperimentalNotConfiguredError, type ExtractOptions, type ExtractResult, ExtractTimeoutError, type FillFormField, type FillFormVisionToolResult, type FunctionCallItem, type GoogleServiceAccountCredentials, type GoogleVertexProviderSettings, 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 ModelOutputContentItem, type ModelProvider, type NonStreamingAgentInstance, type ObserveOptions, ObserveTimeoutError, type OpenAIClientOptions, Page, PageNotFoundError, type PageSnapshotOptions, Response$1 as Response, ResponseBodyError, type ResponseInputItem, type ResponseItem, ResponseParseError, type SafetyCheck, type SafetyConfirmationHandler, type SafetyConfirmationResponse, type ScrollVisionToolResult, type ServerAgentCacheHandle, type SnapshotResult, V3 as Stagehand, StagehandAPIError, StagehandAPIUnauthorizedError, StagehandClickError, StagehandClosedError, StagehandDefaultError, StagehandDomProcessError, StagehandElementNotFoundError, StagehandEnvironmentError, StagehandError, StagehandEvalError, StagehandHttpError, StagehandIframeError, StagehandInitError, StagehandInvalidArgumentError, type StagehandMetrics, StagehandMissingArgumentError, StagehandNotInitializedError, StagehandResponseBodyError, StagehandResponseParseError, StagehandServerError, StagehandShadowRootMissingError, StagehandShadowSegmentEmptyError, StagehandShadowSegmentNotFoundError, StagehandSnapshotError, type StagehandZodObject, type StagehandZodSchema, type StreamingAgentInstance, StreamingCallbacksInNonStreamingModeError, TimeoutError, type ToolUseItem, type TypeToolResult, UnsupportedAISDKModelProviderError, UnsupportedModelError, UnsupportedModelProviderError, V3, type V3Env, V3Evaluator, V3FunctionName, type V3Options, type WaitToolResult, XPathResolutionError, ZodSchemaValidationError, __internalCreateInMemoryAgentCacheHandle, connectToMCPServer, defaultExtractSchema, getZodType, injectUrls, isRunningInBun, isZod3Schema, isZod4Schema, jsonSchemaToZod, loadApiKeyFromEnv, localBrowserLaunchOptionsSchema, modelToAgentProviderMap, pageTextSchema, providerEnvVarMap, toGeminiSchema, toJsonSchema, transformSchema, trimTrailingTextNode, validateZodSchema };